turnoverBom.vue 7.3 KB

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