inspectionBom.vue 4.6 KB

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