|
@@ -70,7 +70,8 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="bottom-wrapper">
|
|
<view class="bottom-wrapper">
|
|
|
- <view class="btn_box" @click="save">一键投料</view>
|
|
|
|
|
|
|
+ <view class="btn_box" @click="save(1)">缓存</view>
|
|
|
|
|
+ <view class="btn_box" @click="save(2)">一键投料</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -96,7 +97,9 @@
|
|
|
import {
|
|
import {
|
|
|
workorderList,
|
|
workorderList,
|
|
|
getByCode,
|
|
getByCode,
|
|
|
- scanLedger
|
|
|
|
|
|
|
+ scanLedger,
|
|
|
|
|
+ feedSaveCache,
|
|
|
|
|
+ feedGetCache
|
|
|
} from '@/api/pda/workOrder.js'
|
|
} from '@/api/pda/workOrder.js'
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
@@ -221,7 +224,7 @@
|
|
|
methods: {
|
|
methods: {
|
|
|
scrolltolower() {},
|
|
scrolltolower() {},
|
|
|
|
|
|
|
|
- save() {
|
|
|
|
|
|
|
+ async save(type) {
|
|
|
|
|
|
|
|
this.List.forEach(f => {
|
|
this.List.forEach(f => {
|
|
|
f.instanceList.forEach(e => {
|
|
f.instanceList.forEach(e => {
|
|
@@ -234,6 +237,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ const isCache = await this.checkCache(type)
|
|
|
|
|
+
|
|
|
|
|
+ if (!isCache) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
batchSave(this.List).then(res => {
|
|
batchSave(this.List).then(res => {
|
|
|
|
|
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
@@ -243,6 +253,28 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ checkCache(type) {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ if (type == 1) {
|
|
|
|
|
+ feedSaveCache(this.List).then(rr => {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: `已经缓存`,
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ resolve(false)
|
|
|
|
|
+ } else if (type == 2) {
|
|
|
|
|
+ resolve(true)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
getList() {
|
|
getList() {
|
|
|
workorderList({
|
|
workorderList({
|
|
|
ids: this.idsList,
|
|
ids: this.idsList,
|
|
@@ -280,7 +312,7 @@
|
|
|
} else if (f.rootCategoryLevelId == 26) {
|
|
} else if (f.rootCategoryLevelId == 26) {
|
|
|
m.revolvingDiskList.push(f)
|
|
m.revolvingDiskList.push(f)
|
|
|
} else if ([23, 2, 9, 28].includes(Number(f
|
|
} else if ([23, 2, 9, 28].includes(Number(f
|
|
|
- .rootCategoryLevelId))) {
|
|
|
|
|
|
|
+ .rootCategoryLevelId))) {
|
|
|
m.semiProductList.push(f)
|
|
m.semiProductList.push(f)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -311,6 +343,8 @@
|
|
|
...m
|
|
...m
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.getCacheFn()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -326,7 +360,6 @@
|
|
|
// this.scanData('SCJHGD20240117002', type, id)
|
|
// this.scanData('SCJHGD20240117002', type, id)
|
|
|
// return false
|
|
// return false
|
|
|
|
|
|
|
|
-
|
|
|
|
|
uni.scanCode({
|
|
uni.scanCode({
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
this.scanData(res.result, type, id)
|
|
this.scanData(res.result, type, id)
|
|
@@ -456,7 +489,7 @@
|
|
|
})
|
|
})
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
_arr.forEach((e, index) => {
|
|
_arr.forEach((e, index) => {
|
|
|
if (e.workOrderId == id) {
|
|
if (e.workOrderId == id) {
|
|
|
_arr[index].turnover = _arr[index].turnover.concat(res)
|
|
_arr[index].turnover = _arr[index].turnover.concat(res)
|
|
@@ -464,12 +497,12 @@
|
|
|
})
|
|
})
|
|
|
this.List = _arr
|
|
this.List = _arr
|
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -526,6 +559,18 @@
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ getCacheFn() {
|
|
|
|
|
+ let parma = {
|
|
|
|
|
+ workOrderIds: this.idsList,
|
|
|
|
|
+ taskId: this.taskId
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ feedGetCache(parma).then(res => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
handAdd(id) {
|
|
handAdd(id) {
|
|
|
const storageKey = Date.now() + "";
|
|
const storageKey = Date.now() + "";
|
|
|
uni.setStorageSync(storageKey, this.List || []);
|
|
uni.setStorageSync(storageKey, this.List || []);
|
|
@@ -580,8 +625,14 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.bottom-wrapper {
|
|
.bottom-wrapper {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-around;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
.btn_box {
|
|
.btn_box {
|
|
|
- width: 750rpx;
|
|
|
|
|
|
|
+ width: 50%;
|
|
|
height: 88rpx;
|
|
height: 88rpx;
|
|
|
line-height: 88rpx;
|
|
line-height: 88rpx;
|
|
|
background: $theme-color;
|
|
background: $theme-color;
|
|
@@ -590,9 +641,14 @@
|
|
|
font-style: normal;
|
|
font-style: normal;
|
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
|
|
+
|
|
|
|
|
+ &:first-child {
|
|
|
|
|
+ border-right: 2rpx solid #fff;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
.operate_box {
|
|
.operate_box {
|
|
|
|
|
|
|
|
position: fixed;
|
|
position: fixed;
|