details.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="领料" background-color="#F7F9FA"
  4. color="#404446" @clickLeft="back"></uni-nav-bar>
  5. <view class="list_box">
  6. <u-list @scrolltolower="scrolltolower">
  7. <view v-for="(item,index) in List" :key="index" class="card_box">
  8. <view class="title_box rx-bc">
  9. <view class="left rx-sc">
  10. <view class="round">{{index + 1}}</view>
  11. <view class="code">工单编号:{{item.code}}</view>
  12. </view>
  13. <view class="right_box rx-ec">
  14. <u-button type="success" size="small" class="u-reset-button"
  15. @click="addPicking(item.id, item.instanceList)" text="添加物料"></u-button>
  16. </view>
  17. </view>
  18. <view class="material rx-ss" v-for="(mate, idx) in item.bomDetailDTOS">
  19. <view class="left rx-ss" @click="mate.checked = ! mate.checked">
  20. <view class="zdy_check rx-cc" :class="{ check_active : mate.checked }">
  21. <u-icon size="28" v-if='mate.checked' name='checkbox-mark'></u-icon>
  22. </view>
  23. </view>
  24. <view class="content_table">
  25. <view class="item">
  26. <view class="lable rx-cc">物料编码</view>
  27. <view class="content">
  28. {{mate.categoryCode}}
  29. </view>
  30. </view>
  31. <view class="item">
  32. <view class="lable rx-cc">名称</view>
  33. <view class="content">{{mate.categoryName}}</view>
  34. </view>
  35. <view class="item rx-sc">
  36. <view class="rx ww55 ">
  37. <view class="lable rx-cc">牌号</view>
  38. <view class="content ">{{mate.brandNum}}</view>
  39. </view>
  40. <view class="rx ww45">
  41. <view class="lable rx-cc ww80">数量</view>
  42. <view class="content content_num">
  43. <input class="uni-input" v-model="mate.needNum" type="digit"></input>
  44. <view class="unit">{{mate.unit}}</view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="item">
  49. <view class="lable rx-cc">领料仓库</view>
  50. <view class="content pd4">
  51. <zxz-uni-data-select :localdata="mate.warehouseList" v-model="mate.warehouseId"
  52. dataValue='id' format='{name}' :clear='false'></zxz-uni-data-select>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view>
  58. <instanceBom :list='item.instanceList'></instanceBom>
  59. </view>
  60. </view>
  61. </u-list>
  62. </view>
  63. <view class="bottom-wrapper">
  64. <view class="btn_box" @click="save">提交</view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import instanceBom from './components/instanceBom.vue'
  70. import {
  71. workorderList
  72. } from '@/api/pda/workOrder.js'
  73. import { batchSave } from '@/api/pda/picking.js'
  74. export default {
  75. components: {
  76. instanceBom
  77. },
  78. data() {
  79. return {
  80. idsList: [],
  81. List: [],
  82. classificationList: [], //分类数据
  83. taskId: null
  84. }
  85. },
  86. onLoad(options) {
  87. let queryArray = decodeURIComponent(options.arr);
  88. this.idsList = JSON.parse(queryArray);
  89. this.taskId = options.taskId
  90. this.getList()
  91. },
  92. onShow() {
  93. uni.$off("setSelectList");
  94. uni.$on("setSelectList", (selectList, id) => {
  95. console.log(selectList)
  96. this.List.forEach(m => {
  97. if (m.id == id) {
  98. this.$set(m, 'instanceList', selectList)
  99. }
  100. })
  101. });
  102. },
  103. methods: {
  104. scrolltolower() {},
  105. save() {
  106. console.log()
  107. let _arr = []
  108. _arr = this.List.map(m => {
  109. m.workOrderId = m.id
  110. delete m.id
  111. return {
  112. ...m
  113. }
  114. })
  115. batchSave(_arr).then(res => {
  116. uni.navigateTo({
  117. url: `/pages/pda/picking/index/index?pickStatus=1`,
  118. });
  119. })
  120. },
  121. getList() {
  122. workorderList(this.idsList).then(res => {
  123. this.List = res
  124. if(this.taskId) {
  125. this.List[0].taskId = this.taskId
  126. }
  127. })
  128. },
  129. handleUserChange(e) {
  130. console.log(e)
  131. },
  132. addPicking(id, list) {
  133. const storageKey = Date.now() + "";
  134. uni.setStorageSync(storageKey, list || []);
  135. uni.navigateTo({
  136. url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
  137. })
  138. },
  139. },
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .content-box {
  144. height: 100vh;
  145. overflow: hidden;
  146. display: flex;
  147. flex-direction: column;
  148. }
  149. .list_box {
  150. flex: 1;
  151. overflow: hidden;
  152. padding: 4rpx 0;
  153. .u-list {
  154. height: 100% !important;
  155. }
  156. .card_box {
  157. padding: 16rpx 24rpx;
  158. }
  159. .title_box {
  160. .round {
  161. width: 32rpx;
  162. height: 32rpx;
  163. line-height: 32rpx;
  164. border-radius: 50%;
  165. background: $theme-color;
  166. color: #fff;
  167. text-align: center;
  168. font-size: 20rpx;
  169. }
  170. .code {
  171. margin-left: 16rpx;
  172. font-family: PingFang SC;
  173. font-size: 28rpx;
  174. font-style: normal;
  175. font-weight: 400;
  176. color: $theme-color;
  177. }
  178. }
  179. .right_box {}
  180. .material {
  181. margin-top: 10rpx;
  182. .left {
  183. width: 40rpx;
  184. }
  185. .zdy_check {
  186. width: 30rpx;
  187. height: 30rpx;
  188. border: 2rpx solid #c8c9cc;
  189. border-radius: 4rpx;
  190. }
  191. .check_active {
  192. background: $theme-color;
  193. border: 2rpx solid $theme-color;
  194. /deep/ .u-icon__icon {
  195. color: #fff !important;
  196. }
  197. }
  198. .content_table {
  199. width: 652rpx;
  200. border: 2rpx solid $border-color;
  201. .item {
  202. display: flex;
  203. border-bottom: 2rpx solid $border-color;
  204. .lable {
  205. width: 132rpx;
  206. text-align: center;
  207. background-color: #F7F9FA;
  208. font-size: 26rpx;
  209. border-right: 2rpx solid $border-color;
  210. flex-shrink: 0;
  211. }
  212. .ww80 {
  213. width: 80rpx;
  214. }
  215. .content {
  216. width: 518rpx;
  217. min-height: 64rpx;
  218. font-size: 28rpx;
  219. line-height: 28rpx;
  220. font-style: normal;
  221. font-weight: 400;
  222. padding: 18rpx 8rpx;
  223. box-sizing: border-box;
  224. word-wrap: break-word;
  225. flex-grow: 1 !important;
  226. }
  227. .content_num {
  228. display: flex;
  229. align-items: center;
  230. padding: 0 4rpx;
  231. /deep/ .uni-input-input {
  232. border: 2rpx solid #F0F8F2;
  233. background: #F0F8F2;
  234. color: $theme-color;
  235. }
  236. .unit {
  237. padding: 0 4rpx;
  238. font-size: 24rpx;
  239. color: #404446;
  240. }
  241. }
  242. .pd4 {
  243. padding: 4rpx 8rpx;
  244. }
  245. &:last-child {
  246. border-bottom: none;
  247. }
  248. }
  249. .ww55 {
  250. width: 55%;
  251. }
  252. .ww45 {
  253. width: 45%;
  254. }
  255. }
  256. }
  257. }
  258. .bottom-wrapper {
  259. .btn_box {
  260. width: 750rpx;
  261. height: 88rpx;
  262. line-height: 88rpx;
  263. background: $theme-color;
  264. text-align: center;
  265. font-size: 36rpx;
  266. font-style: normal;
  267. font-weight: 400;
  268. color: #fff;
  269. }
  270. }
  271. </style>