turnoverBom.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <template>
  2. <view>
  3. <!-- 周转车详情 -->
  4. <view class="title_box rx-bc">
  5. <view class="name">周转车</view>
  6. </view>
  7. <view v-for="(item, index) in newList" :key='index'>
  8. <view class="title_box rx-bc" >
  9. <view class="left rx-ss" @click="getDelete(index)" v-if='!isDetails'>
  10. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  11. </view>
  12. <view class="des" @click="handContract()">{{isContract ? '收缩' : '展开' }}</view>
  13. </view>
  14. <view class="content_table">
  15. <view class="item rx-sc">
  16. <view class="rx ww50 ">
  17. <view class="lable ww80 rx-cc ">编码</view>
  18. <view class="content rx-sc">
  19. <view>{{item.code}}</view>
  20. </view>
  21. </view>
  22. <view class="rx ww50">
  23. <view class="lable rx-cc ww80">名称</view>
  24. <view class="content rx-sc">
  25. <view>{{item.name}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="item rx-sc">
  30. <view class="rx ww50 ">
  31. <view class="lable ww80 rx-cc ">编号</view>
  32. <view class="content rx-sc">
  33. <view>{{item.codeNumber}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="content_table2">
  39. <view class="head row rx-sc">
  40. <view class="item ww10">货位</view>
  41. <view class="item ww25">工单编号</view>
  42. <view class="item ww25">产品编码</view>
  43. <view class="item ww20">数量PCS</view>
  44. <view class="item ww20" v-if='!isDetails'>投料PCS</view>
  45. <view class="item ww20" v-if='isDetails'> {{wordItem.taskType==3 ? '抽样' : '投料'}} </view>
  46. </view>
  47. <view class="table">
  48. <u-list @scrolltolower="scrolltolower" class="z_list">
  49. <view v-for="(it, idx) in item.extInfo.positionList" :key='idx' >
  50. <view class="tr row rx-sc" v-if=" isContract || ( it.workOrderCode != '' && it.workOrderCode != null)" >
  51. <view class="item ww10">
  52. {{ it.code }} </view>
  53. <view class="item ww25" :class="{'color157': it.workOrderCode === wordItem.code}">
  54. {{ it.workOrderCode }}
  55. </view>
  56. <view class="item ww25" :class="{'color157': it.categoryCode === wordItem.productCode}">
  57. {{it.categoryCode}}
  58. </view>
  59. <view class="item ww20 ">
  60. <text>{{it.quantity}}</text>
  61. </view>
  62. <view class="item ww20">
  63. <!-- 抽样 -->
  64. <view v-if=" isDetails && wordItem.taskType==3 ">{{ it.sampleNum }}</view>
  65. <view v-else-if=" isDetails && wordItem.taskType!==3 ">{{ it.feedNum }} </view>
  66. <!-- 投料 -->
  67. <input v-else :class="['uni-input', wordItem.code == it.workOrderCode && it.quantity > 0 ? 'content_num' : ''] " v-model="it.feedNum"
  68. type="digit" :disabled="it.quantity <= 0 || it.workOrderCode!==wordItem.code "
  69. @blur="Number(it.feedNum) > Number(it.quantity) ? it.feedNum = Number(it.quantity) : ''" @input="jsNumber(it)"></input>
  70. </view>
  71. </view>
  72. </view>
  73. </u-list>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. props: {
  82. list: {
  83. type: Array,
  84. default: () => []
  85. },
  86. wordItem: {
  87. type: Object,
  88. default: () => {}
  89. },
  90. pattern: {
  91. type: String,
  92. default: ''
  93. },
  94. isDetails: {
  95. type: Boolean,
  96. default: false
  97. },
  98. productsObj: {
  99. type: Object,
  100. default: () => {}
  101. },
  102. productsObjClone:{
  103. type: Number,
  104. default: 0
  105. }
  106. },
  107. mounted() {
  108. this.newList = this.list;
  109. },
  110. watch: {
  111. list: {
  112. immediate: true,
  113. handler(newVal) {
  114. newVal.forEach(f => {
  115. if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length) {
  116. f.extInfo.positionList.forEach(oo => {
  117. if (this.wordItem.code == oo.workOrderCode && this.wordItem.productCode ==
  118. oo.categoryCode && Number(oo.quantity) > 1 && this.isDetails != true) {
  119. this.$set(oo, 'feedNum', oo.quantity)
  120. }
  121. })
  122. }
  123. })
  124. this.newList = newVal
  125. }
  126. }
  127. },
  128. data() {
  129. return {
  130. newList: [],
  131. totalCount: 0,
  132. isContract: false
  133. }
  134. },
  135. methods: {
  136. jsNumber(val) {
  137. if(val.feedNum>val.quantity){
  138. val.feedNum = val.quantity;
  139. }
  140. // extInfo.positionList
  141. let num = 0;
  142. this.newList.map(v => {
  143. v.extInfo.positionList.map(d => {
  144. if (this.wordItem.code == d.workOrderCode) {
  145. console.log(d);
  146. num+=Number(d.feedNum);
  147. }
  148. })
  149. })
  150. this.productsObj.feedQuantity = num;
  151. },
  152. getDelete(index) {
  153. this.list.splice(index, 1)
  154. },
  155. scrolltolower() {},
  156. handContract() {
  157. this.isContract = !this.isContract
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .title_box {
  164. margin-top: 20rpx;
  165. .name {
  166. font-size: 28rpx;
  167. font-style: normal;
  168. font-weight: 400;
  169. color: $theme-color;
  170. padding-left: 20rpx;
  171. position: relative;
  172. &:before {
  173. position: absolute;
  174. content: '';
  175. left: 0rpx;
  176. top: 0rpx;
  177. bottom: 0rpx;
  178. width: 4rpx;
  179. height: 28rpx;
  180. background: $theme-color;
  181. margin: auto;
  182. }
  183. }
  184. .des{
  185. font-size: 28rpx;
  186. font-style: normal;
  187. font-weight: 400;
  188. color: $theme-color;
  189. }
  190. .left {
  191. width: 40rpx;
  192. }
  193. .btn_box {
  194. padding: 0 18rpx;
  195. height: 60rpx;
  196. background: $theme-color;
  197. font-size: 26rpx;
  198. font-style: normal;
  199. font-weight: 400;
  200. font-size: 24rpx;
  201. color: #fff;
  202. border-radius: 4rpx;
  203. .scan {
  204. width: 34rpx;
  205. height: 34rpx;
  206. margin-right: 12rpx;
  207. }
  208. }
  209. }
  210. .content_table {
  211. margin-top: 8rpx;
  212. width: 100%;
  213. border: 2rpx solid $border-color;
  214. .item {
  215. display: flex;
  216. border-bottom: 2rpx solid $border-color;
  217. .lable {
  218. width: 132rpx;
  219. text-align: center;
  220. background-color: #F7F9FA;
  221. font-size: 26rpx;
  222. border-right: 2rpx solid $border-color;
  223. flex-shrink: 0;
  224. }
  225. .ww80 {
  226. width: 80rpx;
  227. }
  228. .ww50 {
  229. width: 50%;
  230. }
  231. .content {
  232. width: 518rpx;
  233. min-height: 64rpx;
  234. font-size: 28rpx;
  235. line-height: 28rpx;
  236. font-style: normal;
  237. font-weight: 400;
  238. padding: 2rpx 8rpx;
  239. box-sizing: border-box;
  240. word-wrap: break-word;
  241. flex-grow: 1 !important;
  242. font-size: 24rpx;
  243. }
  244. &:last-child {
  245. border-bottom: none;
  246. }
  247. }
  248. }
  249. .content_table2 {
  250. width: 100%;
  251. .row {
  252. width: 100%;
  253. .item {
  254. color: #404446;
  255. font-size: 28rpx;
  256. padding-left: 12rpx;
  257. padding-right: 6rpx;
  258. }
  259. .color157 {
  260. color: $theme-color;
  261. }
  262. .ww20 {
  263. width: 20%;
  264. }
  265. .ww25 {
  266. width: 25%;
  267. }
  268. .ww35 {
  269. width: 35%;
  270. }
  271. .ww10 {
  272. width: 10%;
  273. }
  274. }
  275. .head {
  276. height: 64rpx;
  277. background: #F7F9FA;
  278. border-top: 2rpx solid #E3E5E5;
  279. border-left: 2rpx solid #E3E5E5;
  280. box-sizing: border-box;
  281. .item {
  282. height: 64rpx;
  283. line-height: 64rpx;
  284. border-right: 2rpx solid #E3E5E5;
  285. box-sizing: border-box;
  286. font-size: 24rpx;
  287. }
  288. }
  289. .tr {
  290. border-top: 2rpx solid #E3E5E5;
  291. border-left: 2rpx solid #E3E5E5;
  292. box-sizing: border-box;
  293. .item {
  294. font-size: 24rpx;
  295. min-height: 64rpx;
  296. display: flex;
  297. align-items: center;
  298. border-right: 2rpx solid #E3E5E5;
  299. box-sizing: border-box;
  300. white-space: normal;
  301. word-break: break-all;
  302. }
  303. &:last-child {
  304. border-bottom: 2rpx solid #E3E5E5;
  305. }
  306. }
  307. }
  308. .content_num {
  309. display: flex;
  310. align-items: center;
  311. padding: 0 4rpx;
  312. /deep/ .uni-input-input {
  313. border: 2rpx solid #F0F8F2;
  314. background: #F0F8F2;
  315. color: $theme-color;
  316. }
  317. }
  318. .z_list {
  319. max-height: 500rpx;
  320. }
  321. </style>