|
|
@@ -5,15 +5,12 @@
|
|
|
|
|
|
<view class="list_box">
|
|
|
<u-list @scrolltolower="scrolltolower">
|
|
|
-
|
|
|
<view v-for="(item,index) in List" :key="index" class="card_box">
|
|
|
<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
|
|
|
-
|
|
|
- <deviceBom :item='item'></deviceBom>
|
|
|
-
|
|
|
+ <deviceBom :item.workOrderId='item.workOrderId' :list='item.device' @scanIt='scanIt'></deviceBom>
|
|
|
<view class="operate_box rx-sc">
|
|
|
- <u-button size="small" class="u-reset-button" type="success" >手动添加</u-button>
|
|
|
- <u-button size="small" class="u-reset-button" type="success" >扫一扫</u-button>
|
|
|
+ <u-button size="small" class="u-reset-button" type="success" @click="handAdd(item.workOrderId)" >手动添加</u-button>
|
|
|
+ <u-button size="small" class="u-reset-button" type="success" @click="scanIt(item.workOrderId)">扫一扫</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-list>
|
|
|
@@ -35,7 +32,8 @@
|
|
|
import deviceBom from './components/deviceBom.vue'
|
|
|
import {
|
|
|
workorderList,
|
|
|
- getByCode
|
|
|
+ getByCode,
|
|
|
+ scanLedger
|
|
|
} from '@/api/pda/workOrder.js'
|
|
|
|
|
|
import {
|
|
|
@@ -109,6 +107,7 @@
|
|
|
workorderList(this.idsList).then(res => {
|
|
|
this.List = res.map(m => {
|
|
|
m.workOrderId = m.id
|
|
|
+ m.device = []
|
|
|
delete m.id
|
|
|
return {
|
|
|
...m
|
|
|
@@ -119,33 +118,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
- addPicking(id, list) {
|
|
|
- const storageKey = Date.now() + "";
|
|
|
- uni.setStorageSync(storageKey, list || []);
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
handleScan(id, type) {
|
|
|
console.log(id)
|
|
|
console.log(type)
|
|
|
|
|
|
- // this.scanData('SCJHGD20240117002', type, id)
|
|
|
- // return false
|
|
|
+ this.scanData('SCJHGD2024011700222', 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)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
scanData(result, type, id) {
|
|
|
-
|
|
|
if (type == 'wordOrder') {
|
|
|
let isFals = this.List.some(m => m.code == result)
|
|
|
if (isFals) {
|
|
|
@@ -171,7 +163,45 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ scanIt(id) {
|
|
|
+ console.log(id)
|
|
|
+
|
|
|
+ this.scanItData('CX-EQ-YLSJL-016', id)
|
|
|
+ return false
|
|
|
+
|
|
|
+ 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) { // 设备
|
|
|
+ _arr = this.List
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ if (e.workOrderId == id) {
|
|
|
+ _arr[index].device = [res]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.List = _arr
|
|
|
+ console.log(this.List)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handAdd(id, list) {
|
|
|
+ const storageKey = Date.now() + "";
|
|
|
+ uni.setStorageSync(storageKey, list || []);
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
},
|
|
|
|