|
|
@@ -8,8 +8,12 @@
|
|
|
<view v-for="(item,index) in List" :key="index" class="card_box">
|
|
|
<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
|
|
|
|
|
|
- <deviceBom v-if='item.device.length != 0' :workOrderId='item.workOrderId' :list='item.device'
|
|
|
+ <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'></modelBom>
|
|
|
+
|
|
|
+
|
|
|
<view class="operate_box rx-sc">
|
|
|
<u-button size="small" class="u-reset-button" type="success"
|
|
|
@click="handAdd(item.workOrderId)">手动添加</u-button>
|
|
|
@@ -34,6 +38,7 @@
|
|
|
<script>
|
|
|
import workOrderBom from './components/workOrderBom.vue'
|
|
|
import deviceBom from './components/deviceBom.vue'
|
|
|
+ import modelBom from './components/modelBom.vue'
|
|
|
import {
|
|
|
workorderList,
|
|
|
getByCode,
|
|
|
@@ -47,7 +52,8 @@
|
|
|
export default {
|
|
|
components: {
|
|
|
workOrderBom,
|
|
|
- deviceBom
|
|
|
+ deviceBom,
|
|
|
+ modelBom
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -111,7 +117,9 @@
|
|
|
workorderList(this.idsList).then(res => {
|
|
|
this.List = res.map(m => {
|
|
|
m.workOrderId = m.id
|
|
|
- m.device = []
|
|
|
+ m.equipmentList = [] // 设备
|
|
|
+ m.modelList = [] // 模具
|
|
|
+ m.instanceList = [] // 投料
|
|
|
delete m.id
|
|
|
return {
|
|
|
...m
|
|
|
@@ -128,15 +136,15 @@
|
|
|
console.log(id)
|
|
|
console.log(type)
|
|
|
|
|
|
- this.scanData('SCJHGD20240117002', type, id)
|
|
|
- return false
|
|
|
+ // this.scanData('SCJHGD20240117002', type, id)
|
|
|
+ // return false
|
|
|
|
|
|
- // let _this = this
|
|
|
- // uni.scanCode({
|
|
|
- // success: function(res) {
|
|
|
- // _this.scanData(res.result, type, id)
|
|
|
- // }
|
|
|
- // })
|
|
|
+ let _this = this
|
|
|
+ uni.scanCode({
|
|
|
+ success: function(res) {
|
|
|
+ _this.scanData(res.result, type, id)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
|
|
|
},
|
|
|
@@ -171,32 +179,37 @@
|
|
|
scanIt(id) {
|
|
|
console.log(id)
|
|
|
|
|
|
- this.scanItData('CX-EQ-YLSJL-016', id)
|
|
|
+ this.scanItData('M001', id)
|
|
|
return false
|
|
|
|
|
|
- let _this = this
|
|
|
- uni.scanCode({
|
|
|
- success: function(res) {
|
|
|
- _this.scanItData(res.result, id)
|
|
|
- }
|
|
|
- })
|
|
|
+ // let _this = this
|
|
|
+ // uni.scanCode({
|
|
|
+ // success: function(res) {
|
|
|
+ // _this.scanItData(res.result, id)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
|
|
|
scanItData(result, id) {
|
|
|
scanLedger(result).then(res => {
|
|
|
- console.log(res)
|
|
|
- let _arr = []
|
|
|
- if (res.rootCategoryLevelId == 4) { // 设备
|
|
|
+ let _arr = []
|
|
|
+ if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
|
|
|
_arr = this.List
|
|
|
_arr.forEach((e, index) => {
|
|
|
if (e.workOrderId == id) {
|
|
|
- _arr[index].device = [res]
|
|
|
+ _arr[index].equipmentList = res
|
|
|
}
|
|
|
})
|
|
|
this.List = _arr
|
|
|
|
|
|
- } else if (res.rootCategoryLevelId == 5) {
|
|
|
-
|
|
|
+ } else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) {
|
|
|
+ _arr = this.List
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ if (e.workOrderId == id) {
|
|
|
+ _arr[index].modelList = res
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.List = _arr
|
|
|
}
|
|
|
})
|
|
|
},
|