|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="content-box">
|
|
|
<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
|
|
|
- color="#000" @clickLeft="back"></uni-nav-bar>
|
|
|
+ color="#000" @clickLeft="back" right-icon="scan" @clickRight="handlScanCode"></uni-nav-bar>
|
|
|
|
|
|
<view class="list_box">
|
|
|
<u-list @scrolltolower="scrolltolower">
|
|
|
@@ -11,10 +11,12 @@
|
|
|
<deviceBom v-if='item.equipmentList.length != 0' :workOrderId='item.workOrderId'
|
|
|
:list='item.equipmentList' @scanIt='scanIt'></deviceBom>
|
|
|
|
|
|
- <modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList' @scanIt='scanIt'>
|
|
|
+ <modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList'
|
|
|
+ @scanIt='scanIt'>
|
|
|
</modelBom>
|
|
|
-
|
|
|
- <instanceBom v-if='item.instanceList.length != 0' :workOrderId='item.workOrderId' :list='item.instanceList'></instanceBom>
|
|
|
+
|
|
|
+ <instanceBom v-if='item.instanceList.length != 0' :workOrderId='item.workOrderId'
|
|
|
+ :list='item.instanceList'></instanceBom>
|
|
|
|
|
|
|
|
|
<view class="operate_box rx-sc">
|
|
|
@@ -51,7 +53,7 @@
|
|
|
|
|
|
import {
|
|
|
batchSave
|
|
|
- } from '@/api/pda/picking.js'
|
|
|
+ } from '@/api/pda/feeding.js'
|
|
|
|
|
|
|
|
|
|
|
|
@@ -104,15 +106,20 @@
|
|
|
save() {
|
|
|
let _arr = []
|
|
|
_arr = this.List.map(m => {
|
|
|
+
|
|
|
return {
|
|
|
...m
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+ console.log(_arr)
|
|
|
+
|
|
|
batchSave(_arr).then(res => {
|
|
|
|
|
|
uni.navigateTo({
|
|
|
- url: `/pages/pda/picking/index/index?pickStatus=1`,
|
|
|
+ url: `/pages/pda/feeding/index/index?feedStatus=1`,
|
|
|
});
|
|
|
|
|
|
})
|
|
|
@@ -182,12 +189,12 @@
|
|
|
|
|
|
},
|
|
|
scanIt(id) {
|
|
|
- console.log(id)
|
|
|
-
|
|
|
- // CX-EQ-YLSJL-008 设备
|
|
|
- // M001 M002 模具
|
|
|
- // W31000055273 物料
|
|
|
- this.scanItData('W31000055273', id)
|
|
|
+ console.log(id)
|
|
|
+
|
|
|
+ // CX-EQ-YLSJL-008 设备
|
|
|
+ // M001 M002 模具
|
|
|
+ // S310000552731 物料
|
|
|
+ this.scanItData('M002', id)
|
|
|
return false
|
|
|
|
|
|
let _this = this
|
|
|
@@ -201,7 +208,7 @@
|
|
|
|
|
|
scanItData(result, id) {
|
|
|
scanLedger(result).then(res => {
|
|
|
-
|
|
|
+
|
|
|
let _arr = []
|
|
|
if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
|
|
|
_arr = this.List
|
|
|
@@ -214,7 +221,7 @@
|
|
|
this.$forceUpdate()
|
|
|
|
|
|
} else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 模具
|
|
|
-
|
|
|
+
|
|
|
_arr = this.List
|
|
|
_arr.forEach((e, index) => {
|
|
|
if (e.workOrderId == id) {
|
|
|
@@ -223,11 +230,9 @@
|
|
|
})
|
|
|
this.List = _arr
|
|
|
this.$forceUpdate()
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- else if(res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
|
|
|
-
|
|
|
+
|
|
|
+ } else if (res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
|
|
|
+
|
|
|
_arr = this.List
|
|
|
_arr.forEach((e, index) => {
|
|
|
if (e.workOrderId == id) {
|
|
|
@@ -235,13 +240,70 @@
|
|
|
}
|
|
|
})
|
|
|
this.List = _arr
|
|
|
-
|
|
|
+
|
|
|
this.$forceUpdate()
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ // 全部扫一扫
|
|
|
+ handlScanCode() {
|
|
|
+
|
|
|
+
|
|
|
+ // CX-EQ-YLSJL-008 设备
|
|
|
+ // M001 M002 模具
|
|
|
+ // S310000552731 物料
|
|
|
+ this.scanItAllData('M001')
|
|
|
+ return false
|
|
|
|
|
|
+ let _this = this
|
|
|
+ uni.scanCode({
|
|
|
+ success: function(res) {
|
|
|
+ _this.scanItAllData(res.result)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ scanItAllData(result) {
|
|
|
+ scanLedger(result).then(res => {
|
|
|
+
|
|
|
+ let _arr = []
|
|
|
+ if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
|
|
|
+ _arr = this.List
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ e.equipmentList = res
|
|
|
+ })
|
|
|
+ this.List = _arr
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
+ } else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 模具
|
|
|
+
|
|
|
+ _arr = this.List
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ e.modelList = res
|
|
|
+ })
|
|
|
+ this.List = _arr
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
+ } else if (res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
|
|
|
+
|
|
|
+ _arr = this.List
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ e.instanceList = e.instanceList.concat(res)
|
|
|
+ })
|
|
|
+ this.List = _arr
|
|
|
+
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
|
|
|
handAdd(id, list) {
|