inspectionBom.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name">质检</view>
  5. </view>
  6. <view class="content_table2" v-if='inspectionList.length > 0'>
  7. <view class="head row rx-sc">
  8. <view class="item ww30">类型</view>
  9. <view class="item ww20">废品数量</view>
  10. <view class="item ww40">处置</view>
  11. <view class="item ww10">操作</view>
  12. </view>
  13. <view class="table">
  14. <view class="tr row rx-sc" v-for="(it, idx) in inspectionList" :key='idx'>
  15. <view class="item ww30">
  16. {{ it.name }}
  17. </view>
  18. <view class="item ww20 content_num">
  19. <input v-if='it.id != -1' class="uni-input" v-model="it.quantity" type="number"
  20. @input="onKeyInput"></input>
  21. <view v-else>{{ it.quantity || 0}}</view>
  22. </view>
  23. <view class="item ww40 content_num" v-if='it.id != -1'>
  24. <zxz-uni-data-select :localdata="warehouseList" v-model="it.warehouseId" dataValue='id'
  25. dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  26. </view>
  27. <view class="ww10 rx-ac">
  28. <uni-icons custom-prefix="iconfont" v-if='it.id != -1' type="icon-shanchu" size="20"
  29. color="#fa3534" @click="handleDel(idx)"></uni-icons>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- <ba-tree-picker ref="treePicker" :selectedData='selectedData' key="verify" :multiple="false"
  35. @select-change="confirm" title="选择分类" :localdata="classificationList" valueKey="id" textKey="name"
  36. childrenKey="children" multiple :selectParent='false' /> -->
  37. </view>
  38. </template>
  39. <script>
  40. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  41. import {
  42. getWarehouseList,
  43. } from '@/api/pda/workOrder.js'
  44. export default {
  45. components: {
  46. baTreePicker,
  47. },
  48. props: {
  49. inspectionList: {
  50. type: Array,
  51. default: () => []
  52. },
  53. normalQuality: {
  54. type: Object,
  55. default: () => {}
  56. }
  57. },
  58. data() {
  59. return {
  60. // classificationList: [],
  61. // selectedData: [],
  62. count: 0,
  63. warehouseList: []
  64. }
  65. },
  66. created() {
  67. this.getWarehouse()
  68. setTimeout(() => {
  69. this.onKeyInput()
  70. }, 500)
  71. },
  72. methods: {
  73. // confirm(id, name, list) {
  74. // this.List = list
  75. // this.selectedData = []
  76. // this.selectedData = this.List.map(m => {
  77. // return m.id
  78. // })
  79. // },
  80. handleDel(idx) {
  81. this.inspectionList.splice(idx, 1)
  82. },
  83. onKeyInput() {
  84. this.count = 0
  85. this.inspectionList.map(L => {
  86. if (Number(L.quantity) > 0 && Number(L.quantity) != NaN && L.id != -1) {
  87. this.count = Number(this.count) + Number(L.quantity)
  88. this.inspectionList[this.inspectionList.length - 1]['quantity'] = this.count
  89. this.normalQuality['quantity'] = this.count
  90. }
  91. })
  92. },
  93. getWarehouse() {
  94. getWarehouseList().then(res => {
  95. this.warehouseList = res
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .title_box {
  103. margin-top: 28rpx;
  104. .name {
  105. font-size: 28rpx;
  106. font-style: normal;
  107. font-weight: 400;
  108. color: $theme-color;
  109. padding-left: 20rpx;
  110. position: relative;
  111. &:before {
  112. position: absolute;
  113. content: '';
  114. left: 0rpx;
  115. top: 0rpx;
  116. bottom: 0rpx;
  117. width: 4rpx;
  118. height: 28rpx;
  119. background: $theme-color;
  120. margin: auto;
  121. }
  122. }
  123. }
  124. .btn_box {
  125. height: 60rpx;
  126. width: 140rpx;
  127. background: $theme-color;
  128. font-size: 26rpx;
  129. font-style: normal;
  130. font-weight: 400;
  131. font-size: 24rpx;
  132. color: #fff;
  133. border-radius: 4rpx;
  134. margin-left: 40rpx;
  135. }
  136. .content_table2 {
  137. width: 100%;
  138. margin-top: 18rpx;
  139. .row {
  140. width: 100%;
  141. .item {
  142. color: #404446;
  143. font-size: 28rpx;
  144. padding-left: 12rpx;
  145. }
  146. .color157 {
  147. color: $theme-color;
  148. }
  149. .ww30 {
  150. width: 30%;
  151. }
  152. .ww20 {
  153. width: 20%;
  154. }
  155. .ww40 {
  156. width: 40%;
  157. }
  158. .ww10 {
  159. width: 10%;
  160. }
  161. }
  162. .head {
  163. height: 64rpx;
  164. background: #F7F9FA;
  165. border-top: 2rpx solid #E3E5E5;
  166. border-left: 2rpx solid #E3E5E5;
  167. .item {
  168. height: 64rpx;
  169. line-height: 64rpx;
  170. border-right: 2rpx solid #E3E5E5;
  171. box-sizing: border-box;
  172. }
  173. }
  174. .tr {
  175. border-top: 2rpx solid #E3E5E5;
  176. border-left: 2rpx solid #E3E5E5;
  177. .item {
  178. font-size: 24rpx;
  179. min-height: 76rpx;
  180. display: flex;
  181. align-items: center;
  182. border-right: 2rpx solid #E3E5E5;
  183. box-sizing: border-box;
  184. white-space: normal;
  185. word-break: break-all;
  186. }
  187. &:last-child {
  188. border-bottom: 2rpx solid #E3E5E5;
  189. }
  190. }
  191. }
  192. .content_num {
  193. display: flex;
  194. align-items: center;
  195. padding: 0 4rpx;
  196. /deep/ .uni-input-input {
  197. border: 2rpx solid #F0F8F2;
  198. background: #F0F8F2;
  199. color: $theme-color;
  200. }
  201. }
  202. </style>