qualityStat.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name">质检统计</view>
  5. </view>
  6. <view class="material ">
  7. <view class="content_table" v-for="(item, index) in normalQuality" :key="index">
  8. <view class="item">
  9. <view class="lable rx-cc">质检类型</view>
  10. <view class="content">
  11. {{ item.inspectionName }}
  12. </view>
  13. </view>
  14. <view class="item rx-sc">
  15. <view class="rx ww55 ">
  16. <view class="lable rx-cc">废品数量</view>
  17. <view class="content rx-sc">
  18. <view>{{item.quantity}}</view>
  19. <view class="unit">{{item.unit}}</view>
  20. </view>
  21. </view>
  22. <view class="rx ww45">
  23. <view class="lable rx-cc ww80"></view>
  24. <view class="content">
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="content_table" v-if='normalQuality.length > 0'>
  30. <view class="item">
  31. <view class="lable rx-cc">废品总数</view>
  32. <view class="content color157">
  33. {{ wasteCount }} {{ unit }}
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. props: {
  43. normalQuality: {
  44. type: Array,
  45. default: () => []
  46. }
  47. },
  48. data() {
  49. return {
  50. wasteCount: 0, //废品总数
  51. unit: null,
  52. }
  53. },
  54. created() {
  55. this.wasteCount = 0
  56. if(this.normalQuality && this.normalQuality.length > 0) {
  57. this.normalQuality.forEach(e => {
  58. this.unit = e.unit
  59. this.wasteCount = Number(this.wasteCount) + Number(e.quantity)
  60. })
  61. }
  62. },
  63. methods: {
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .title_box {
  69. margin-top: 28rpx;
  70. .name {
  71. font-size: 28rpx;
  72. font-style: normal;
  73. font-weight: 400;
  74. color: $theme-color;
  75. padding-left: 20rpx;
  76. position: relative;
  77. &:before {
  78. position: absolute;
  79. content: '';
  80. left: 0rpx;
  81. top: 0rpx;
  82. bottom: 0rpx;
  83. width: 4rpx;
  84. height: 28rpx;
  85. background: $theme-color;
  86. margin: auto;
  87. }
  88. }
  89. .btn_box {
  90. padding: 0 18rpx;
  91. height: 60rpx;
  92. background: $theme-color;
  93. font-size: 26rpx;
  94. font-style: normal;
  95. font-weight: 400;
  96. font-size: 24rpx;
  97. color: #fff;
  98. border-radius: 4rpx;
  99. .scan {
  100. width: 34rpx;
  101. height: 34rpx;
  102. margin-right: 12rpx;
  103. }
  104. }
  105. }
  106. .material {
  107. margin-top: 10rpx;
  108. .content_table {
  109. width: 100%;
  110. border: 2rpx solid $border-color;
  111. .item {
  112. display: flex;
  113. border-bottom: 2rpx solid $border-color;
  114. .lable {
  115. width: 156rpx;
  116. text-align: center;
  117. background-color: #F7F9FA;
  118. font-size: 26rpx;
  119. border-right: 2rpx solid $border-color;
  120. flex-shrink: 0;
  121. }
  122. .lable150 {
  123. width: 156rpx !important;
  124. font-size: 24rpx;
  125. }
  126. .ww80 {
  127. width: 80rpx;
  128. }
  129. .content {
  130. width: 518rpx;
  131. min-height: 64rpx;
  132. font-size: 28rpx;
  133. line-height: 28rpx;
  134. font-style: normal;
  135. font-weight: 400;
  136. padding: 18rpx 8rpx;
  137. box-sizing: border-box;
  138. word-wrap: break-word;
  139. flex-grow: 1 !important;
  140. .unit {
  141. padding: 0 4rpx;
  142. font-size: 24rpx;
  143. color: #404446;
  144. }
  145. .penalize {
  146. width: 200rpx;
  147. line-height: 60rpx;
  148. background: $theme-color;
  149. font-size: 24rpx;
  150. text-align: center;
  151. color: #fff;
  152. }
  153. }
  154. .pd4 {
  155. padding: 4rpx 8rpx;
  156. }
  157. &:last-child {
  158. border-bottom: none;
  159. }
  160. }
  161. .ww55 {
  162. width: 55%;
  163. }
  164. .ww45 {
  165. width: 45%;
  166. }
  167. }
  168. }
  169. .content_num {
  170. display: flex;
  171. align-items: center;
  172. padding: 0 4rpx;
  173. box-sizing: border-box;
  174. /deep/ .uni-input-input {
  175. border: 2rpx solid #F0F8F2;
  176. min-width: 100rpx;
  177. background: #F0F8F2;
  178. color: $theme-color;
  179. box-sizing: border-box;
  180. }
  181. }
  182. .color157{
  183. color: #157a2c;
  184. }
  185. </style>