details.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. export default {
  74. components: {
  75. instanceBom
  76. },
  77. data() {
  78. return {
  79. idsList: [],
  80. List: [],
  81. classificationList: [], //分类数据
  82. }
  83. },
  84. onLoad(options) {
  85. let queryArray = decodeURIComponent(options.arr);
  86. this.idsList = JSON.parse(queryArray);
  87. this.getList()
  88. },
  89. onShow() {
  90. uni.$off("setSelectList");
  91. uni.$on("setSelectList", (selectList, id) => {
  92. console.log(selectList)
  93. this.List.forEach(m => {
  94. if (m.id == id) {
  95. console.log(m.hasOwnProperty('instanceList'))
  96. if (!m.hasOwnProperty('instanceList') || m.instanceList.length == 0) {
  97. console.log(222)
  98. this.$set(m, 'instanceList', selectList)
  99. console.log(m)
  100. } else {
  101. let data = [...m.instanceList]
  102. selectList.map(item => {
  103. const obj = m.instanceList.find(value => value.id == item
  104. .id); //分别判断arr1里面是否含 有arr的元素
  105. if (!obj) {
  106. data.push(item);
  107. };
  108. });
  109. console.log(data)
  110. }
  111. }
  112. })
  113. });
  114. },
  115. methods: {
  116. scrolltolower() {},
  117. save() {
  118. console.log(this.idsList)
  119. },
  120. getList() {
  121. workorderList(this.idsList).then(res => {
  122. this.List = res
  123. })
  124. },
  125. handleUserChange(e) {
  126. console.log(e)
  127. },
  128. addPicking(id, list) {
  129. const storageKey = Date.now() + "";
  130. uni.setStorageSync(storageKey, list|| []);
  131. uni.navigateTo({
  132. url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
  133. })
  134. },
  135. },
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .content-box {
  140. height: 100vh;
  141. overflow: hidden;
  142. display: flex;
  143. flex-direction: column;
  144. }
  145. .list_box {
  146. flex: 1;
  147. overflow: hidden;
  148. padding: 4rpx 0;
  149. .u-list {
  150. height: 100% !important;
  151. }
  152. .card_box {
  153. padding: 16rpx 24rpx;
  154. }
  155. .title_box {
  156. .round {
  157. width: 32rpx;
  158. height: 32rpx;
  159. line-height: 32rpx;
  160. border-radius: 50%;
  161. background: $theme-color;
  162. color: #fff;
  163. text-align: center;
  164. font-size: 20rpx;
  165. }
  166. .code {
  167. margin-left: 16rpx;
  168. font-family: PingFang SC;
  169. font-size: 28rpx;
  170. font-style: normal;
  171. font-weight: 400;
  172. color: $theme-color;
  173. }
  174. }
  175. .right_box {}
  176. .material {
  177. margin-top: 10rpx;
  178. .left {
  179. width: 40rpx;
  180. }
  181. .zdy_check {
  182. width: 30rpx;
  183. height: 30rpx;
  184. border: 2rpx solid #c8c9cc;
  185. border-radius: 4rpx;
  186. }
  187. .check_active {
  188. background: $theme-color;
  189. border: 2rpx solid $theme-color;
  190. /deep/ .u-icon__icon {
  191. color: #fff !important;
  192. }
  193. }
  194. .content_table {
  195. width: 652rpx;
  196. border: 2rpx solid $border-color;
  197. .item {
  198. display: flex;
  199. border-bottom: 2rpx solid $border-color;
  200. .lable {
  201. width: 132rpx;
  202. text-align: center;
  203. background-color: #F7F9FA;
  204. font-size: 26rpx;
  205. border-right: 2rpx solid $border-color;
  206. flex-shrink: 0;
  207. }
  208. .ww80 {
  209. width: 80rpx;
  210. }
  211. .content {
  212. width: 518rpx;
  213. min-height: 64rpx;
  214. font-size: 28rpx;
  215. line-height: 28rpx;
  216. font-style: normal;
  217. font-weight: 400;
  218. padding: 18rpx 8rpx;
  219. box-sizing: border-box;
  220. word-wrap: break-word;
  221. flex-grow: 1 !important;
  222. }
  223. .content_num {
  224. display: flex;
  225. align-items: center;
  226. padding: 0 4rpx;
  227. /deep/ .uni-input-input {
  228. border: 2rpx solid #F0F8F2;
  229. background: #F0F8F2;
  230. color: $theme-color;
  231. }
  232. .unit {
  233. padding: 0 4rpx;
  234. font-size: 24rpx;
  235. color: #404446;
  236. }
  237. }
  238. .pd4 {
  239. padding: 4rpx 8rpx;
  240. }
  241. &:last-child {
  242. border-bottom: none;
  243. }
  244. }
  245. .ww55 {
  246. width: 55%;
  247. }
  248. .ww45 {
  249. width: 45%;
  250. }
  251. }
  252. }
  253. }
  254. .bottom-wrapper {
  255. .btn_box {
  256. width: 750rpx;
  257. height: 88rpx;
  258. line-height: 88rpx;
  259. background: $theme-color;
  260. text-align: center;
  261. font-size: 36rpx;
  262. font-style: normal;
  263. font-weight: 400;
  264. color: #fff;
  265. }
  266. }
  267. </style>