|
|
@@ -23,7 +23,7 @@
|
|
|
|
|
|
</view>
|
|
|
|
|
|
- <view class="material rx-ss" v-for="(mate, idx) in item.bomDetailDTOS">
|
|
|
+ <view class="material rx-ss" v-for="(mate, idx) in item.bomList">
|
|
|
<view class="left rx-ss" @click="mate.checked = ! mate.checked">
|
|
|
<view class="zdy_check rx-cc" :class="{ check_active : mate.checked }">
|
|
|
<u-icon size="28" v-if='mate.checked' name='checkbox-mark'></u-icon>
|
|
|
@@ -73,14 +73,17 @@
|
|
|
</view>
|
|
|
|
|
|
<view>
|
|
|
- <instanceBom :list='item.instanceList'></instanceBom>
|
|
|
+ <instanceBom :list='item.instanceList2'></instanceBom>
|
|
|
|
|
|
|
|
|
-
|
|
|
- <modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId'
|
|
|
- :list='item.modelList'>
|
|
|
+ <modelBom :workOrderId='item.workOrderId' :modelList='item.modelList'
|
|
|
+ :modelList2='item.modelList2' :code='item.code' @hendDel='hendDel'>
|
|
|
</modelBom>
|
|
|
|
|
|
+ <boatBom :palletList='item.palletList' :palletList2='item.palletList2' :code='item.code'
|
|
|
+ @hendDel='hendDel'>
|
|
|
+ </boatBom>
|
|
|
+
|
|
|
|
|
|
|
|
|
</view>
|
|
|
@@ -102,7 +105,8 @@
|
|
|
|
|
|
<script>
|
|
|
import instanceBom from './components/instanceBom.vue'
|
|
|
- import modelBom from '../feeding/components/modelBom.vue'
|
|
|
+ import modelBom from './components/modelBom.vue'
|
|
|
+ import boatBom from './components/boatBom.vue'
|
|
|
import {
|
|
|
workorderList
|
|
|
} from '@/api/pda/workOrder.js'
|
|
|
@@ -114,7 +118,8 @@
|
|
|
export default {
|
|
|
components: {
|
|
|
instanceBom,
|
|
|
- modelBom
|
|
|
+ modelBom,
|
|
|
+ boatBom
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -123,7 +128,8 @@
|
|
|
|
|
|
classificationList: [], //分类数据
|
|
|
|
|
|
- taskId: null
|
|
|
+ taskId: null,
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -145,21 +151,27 @@
|
|
|
uni.$on("setSelectList", (selectList, id) => {
|
|
|
this.List.forEach(m => {
|
|
|
if (m.workOrderId == id) {
|
|
|
- let instanceList = [] // 投料
|
|
|
- let modelList = [] // 模具
|
|
|
-
|
|
|
- selectList.forEach(f => {
|
|
|
- if (f.rootCategoryLevelId == 1) {
|
|
|
- instanceList = instanceList.concat(f)
|
|
|
- } else if (f.rootCategoryLevelId == 5) {
|
|
|
- modelList = modelList.concat(f)
|
|
|
+ let instanceList2 = [] // 投料
|
|
|
+ let modelList2 = [] // 模具
|
|
|
+ let palletList2 = []
|
|
|
|
|
|
|
|
|
+ selectList.forEach(f => {
|
|
|
+ if (f.rootCategoryLevelId == 1) { // 投料
|
|
|
+ f.automatic = 1
|
|
|
+ instanceList2 = instanceList2.concat(f)
|
|
|
+ } else if (f.rootCategoryLevelId == 5) { // 模具
|
|
|
+ f.automatic = 1
|
|
|
+ modelList2 = modelList2.concat(f)
|
|
|
+ } else if (f.rootCategoryLevelId == 8) { // 舟皿
|
|
|
+ f.automatic = 1
|
|
|
+ palletList2 = palletList2.concat(f)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- this.$set(m, 'instanceList', instanceList)
|
|
|
- this.$set(m, 'modelList', modelList)
|
|
|
+ this.$set(m, 'instanceList2', instanceList2)
|
|
|
+ this.$set(m, 'modelList2', modelList2)
|
|
|
+ this.$set(m, 'palletList2', palletList2)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -174,17 +186,23 @@
|
|
|
scrolltolower() {},
|
|
|
|
|
|
save() {
|
|
|
+
|
|
|
+
|
|
|
let _arr = []
|
|
|
_arr = this.List.map(m => {
|
|
|
- if (m.bomDetailDTOS.length > 0) {
|
|
|
- m.bomDetailDTOS = m.bomDetailDTOS.filter(f => f.checked)
|
|
|
+
|
|
|
+ if (m.bomList.length > 0) {
|
|
|
+ let bomList = m.bomList.filter(f => f.checked)
|
|
|
+ m['bomDetailDTOSList'] = [...bomList, ...m.modelList, ...m.palletList]
|
|
|
}
|
|
|
+ m.instanceList = [...m.instanceList2, ...m.modelList2, ...m.palletList2]
|
|
|
+
|
|
|
return {
|
|
|
...m
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
|
|
|
+
|
|
|
batchSave(_arr).then(res => {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/pda/picking/index/index?pickStatus=1`,
|
|
|
@@ -194,32 +212,100 @@
|
|
|
},
|
|
|
|
|
|
getList() {
|
|
|
+
|
|
|
workorderList({
|
|
|
ids: this.idsList,
|
|
|
taskId: this.taskId
|
|
|
}).then(res => {
|
|
|
|
|
|
-
|
|
|
this.List = res.map(m => {
|
|
|
m.workOrderId = m.id
|
|
|
- if (!m.hasOwnProperty('modelList')) {
|
|
|
- m.modelList = [] // 模具
|
|
|
- }
|
|
|
+ let modelList = []
|
|
|
+ let palletList = []
|
|
|
+ let bomList = []
|
|
|
+
|
|
|
+ m.bomDetailDTOS.forEach((f, i) => {
|
|
|
+
|
|
|
+ if (f.rootCategoryLevelId == 5) {
|
|
|
+ f.automatic = 2
|
|
|
+ modelList = modelList.concat(f)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (f.rootCategoryLevelId == 8) {
|
|
|
+ f.automatic = 2
|
|
|
+ palletList = palletList.concat(f)
|
|
|
+ }
|
|
|
+ if (f.rootCategoryLevelId != 5 && f.rootCategoryLevelId != 8) {
|
|
|
+ f.automatic = 2
|
|
|
+ bomList = bomList.concat(f)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ m['modelList'] = modelList
|
|
|
+ m['palletList'] = palletList
|
|
|
+ m['bomList'] = bomList
|
|
|
+
|
|
|
+ m['instanceList2'] = []
|
|
|
+ m['palletList2'] = []
|
|
|
+ m['modelList2'] = []
|
|
|
+
|
|
|
delete m.id
|
|
|
return {
|
|
|
...m
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ hendDel(type, code, list) {
|
|
|
+
|
|
|
+ if (type == 'modelBom') {
|
|
|
+ console.log(list.length)
|
|
|
+ if (list.length == 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+ this.List.forEach(f => {
|
|
|
+ if (f.code == code) {
|
|
|
+ if (list.length == 0) {
|
|
|
+ f.modelList2 = []
|
|
|
+ f.modelList = []
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ f.modelList2 = list.filter(t => t.automatic == 1)
|
|
|
+ f.modelList = list.filter(t => t.automatic == 2)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type == 'boatBom') {
|
|
|
+ this.List.forEach(f => {
|
|
|
+ if (f.code == code) {
|
|
|
+ if (list.length == 0) {
|
|
|
+ f.palletList2 = []
|
|
|
+ f.palletList = []
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ f.palletList2 = list.filter(t => t.automatic == 1)
|
|
|
+ f.palletList = list.filter(t => t.automatic == 2)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
|
|
|
addPicking(id, item) {
|
|
|
const storageKey = Date.now() + "";
|
|
|
-
|
|
|
- let arr = [...item.instanceList, ...item.modelList]
|
|
|
+ console.log(item)
|
|
|
+ let arr = [...item.instanceList2, ...item.modelList2, ...item.palletList2]
|
|
|
uni.setStorageSync(storageKey, arr);
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=pick&taskId=${this.taskId}`
|