|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
|
<view class="list_box">
|
|
|
<u-list @scrolltolower="scrolltolower">
|
|
|
-
|
|
|
+
|
|
|
|
|
|
<view v-for="(item,index) in List" :key="index" class="card_box">
|
|
|
<view class="title_box rx-bc">
|
|
|
@@ -17,7 +17,7 @@
|
|
|
<view class="right_box rx-ec">
|
|
|
|
|
|
<u-button type="success" size="small" class="u-reset-button"
|
|
|
- @click="addPicking(item.workOrderId, item.instanceList)" text="添加物料"></u-button>
|
|
|
+ @click="addPicking(item.workOrderId, item)" text="添加物料"></u-button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
@@ -53,7 +53,7 @@
|
|
|
<view class="content content_num">
|
|
|
<input class="uni-input" v-model="mate.demandQuantity" type="digit"></input>
|
|
|
<view class="unit">{{mate.unit}}</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -61,11 +61,11 @@
|
|
|
|
|
|
|
|
|
<view class="item">
|
|
|
-
|
|
|
<view class="lable rx-cc">领料仓库</view>
|
|
|
<view class="content pd4">
|
|
|
<zxz-uni-data-select :localdata="mate.warehouseList" v-model="mate.warehouseId"
|
|
|
- dataValue='id' format='{name}' dataKey="name" filterable :clear='false'></zxz-uni-data-select>
|
|
|
+ dataValue='id' format='{name}' dataKey="name" filterable
|
|
|
+ :clear='false'></zxz-uni-data-select>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -74,6 +74,8 @@
|
|
|
|
|
|
<view>
|
|
|
<instanceBom :list='item.instanceList'></instanceBom>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
@@ -96,8 +98,10 @@
|
|
|
import {
|
|
|
workorderList
|
|
|
} from '@/api/pda/workOrder.js'
|
|
|
-
|
|
|
- import { batchSave } from '@/api/pda/picking.js'
|
|
|
+
|
|
|
+ import {
|
|
|
+ batchSave
|
|
|
+ } from '@/api/pda/picking.js'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -109,7 +113,7 @@
|
|
|
List: [],
|
|
|
|
|
|
classificationList: [], //分类数据
|
|
|
-
|
|
|
+
|
|
|
taskId: null
|
|
|
|
|
|
|
|
|
@@ -118,10 +122,10 @@
|
|
|
onLoad(options) {
|
|
|
let queryArray = decodeURIComponent(options.arr);
|
|
|
this.idsList = JSON.parse(queryArray);
|
|
|
-
|
|
|
+
|
|
|
this.taskId = options.taskId
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
@@ -132,7 +136,21 @@
|
|
|
uni.$on("setSelectList", (selectList, id) => {
|
|
|
this.List.forEach(m => {
|
|
|
if (m.workOrderId == id) {
|
|
|
- this.$set(m, 'instanceList', selectList)
|
|
|
+ let instanceList = [] // 投料
|
|
|
+ let modelList = [] // 模具
|
|
|
+
|
|
|
+ selectList.forEach(f => {
|
|
|
+ if (f.rootCategoryLevelId == 1) {
|
|
|
+ instanceList = instanceList.concat(f)
|
|
|
+ } else if(f.rootCategoryLevelId == 5) {
|
|
|
+ modelList = modelList.concat(f)
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$set(m, 'instanceList', instanceList)
|
|
|
+ this.$set(m, 'modelList', modelList)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -148,46 +166,52 @@
|
|
|
|
|
|
save() {
|
|
|
let _arr = []
|
|
|
- _arr = this.List.map(m => {
|
|
|
- if(m.bomDetailDTOS.length > 0) {
|
|
|
- m.bomDetailDTOS = m.bomDetailDTOS.filter(f => f.checked)
|
|
|
- }
|
|
|
- return {
|
|
|
- ...m
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
+ _arr = this.List.map(m => {
|
|
|
+ if (m.bomDetailDTOS.length > 0) {
|
|
|
+ m.bomDetailDTOS = m.bomDetailDTOS.filter(f => f.checked)
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
batchSave(_arr).then(res => {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/pda/picking/index/index?pickStatus=1`,
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
|
getList() {
|
|
|
- workorderList({ids: this.idsList, taskId:this.taskId}).then(res => {
|
|
|
- console.log('4',res)
|
|
|
-
|
|
|
+ workorderList({
|
|
|
+ ids: this.idsList,
|
|
|
+ taskId: this.taskId
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
+
|
|
|
this.List = res.map(m => {
|
|
|
- m.workOrderId = m.id
|
|
|
- delete m.id
|
|
|
- return {
|
|
|
- ...m
|
|
|
- }
|
|
|
+ m.workOrderId = m.id
|
|
|
+ if (!m.hasOwnProperty('modelList')) {
|
|
|
+ m.modelList = [] // 模具
|
|
|
+ }
|
|
|
+ delete m.id
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ }
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- handleUserChange(e) {
|
|
|
- console.log(e)
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
- addPicking(id, list) {
|
|
|
+ addPicking(id, item) {
|
|
|
const storageKey = Date.now() + "";
|
|
|
- uni.setStorageSync(storageKey, list || []);
|
|
|
+
|
|
|
+ let arr = [...item.instanceList, ...item.modelList]
|
|
|
+ uni.setStorageSync(storageKey, arr);
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=pick`
|
|
|
})
|