Commit 73b1e52c by wusiyi

fix: bug

parent 8c720a42
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "JomallProductionAssistant", "name": "JomallProductionAssistant",
"productName": "JomallProductionAssistant", "productName": "JomallProductionAssistant",
"description": "", "description": "",
"version": "1.0.33", "version": "1.0.34",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
......
...@@ -107,8 +107,7 @@ export default { ...@@ -107,8 +107,7 @@ export default {
], ],
faceType: "A", faceType: "A",
dialogVisible: false, dialogVisible: false,
showforcedProduc: false, showforcedProduc: false
completingOrderId: null
}; };
}, },
computed: { computed: {
...@@ -191,20 +190,12 @@ export default { ...@@ -191,20 +190,12 @@ export default {
} }
//更新数据到本地数据 //更新数据到本地数据
updateOrderInfoItem(this.detail.newId, this.detail, this.faceType); updateOrderInfoItem(this.detail.newId, this.detail, this.faceType);
this.checkAndCompleteProduction(this.detail);
} }
console.log("updateOrderInfoItemitem", item); console.log("updateOrderInfoItemitem", item);
console.log("本地数据updateOrderInfoItem:", getOrderInfoMap()); console.log("本地数据updateOrderInfoItem:", getOrderInfoMap());
} }
} }
// deep: true, // deep: true,
},
"detail.saveImgList": {
handler(list) {
if (this.desktopDevice !== 3 || !this.detail || !list?.length) return;
this.checkAndCompleteProduction(this.detail);
},
deep: true
} }
}, },
methods: { methods: {
...@@ -265,9 +256,6 @@ export default { ...@@ -265,9 +256,6 @@ export default {
return; return;
} }
if (this.completingOrderId === data.id) return;
this.completingOrderId = data.id;
let params = { let params = {
id: data.id, id: data.id,
orderType: this.orderType orderType: this.orderType
...@@ -280,9 +268,9 @@ export default { ...@@ -280,9 +268,9 @@ export default {
params.data = { ...data }; params.data = { ...data };
} }
//如果为惠立彩则判断当前saveImgList字段中的power是否全是true 是则生产完成 //如果为惠立彩则判断当前saveImgList字段中的power是否全是true 是则生产完成
const canCallApi = // const canCallApi =
this.desktopDevice != 3 || // this.desktopDevice != 3 ||
(data.saveImgList?.every(el => el.power) ?? false); // (data.saveImgList?.every(el => el.power) ?? false);
try { try {
console.log("生产完成"); console.log("生产完成");
...@@ -345,8 +333,8 @@ export default { ...@@ -345,8 +333,8 @@ export default {
} }
this.$message.success("操作成功"); this.$message.success("操作成功");
} finally { } catch (error) {
this.completingOrderId = null; console.error("setData 执行失败", error);
} }
}, },
async sureData() { async sureData() {
...@@ -667,7 +655,8 @@ export default { ...@@ -667,7 +655,8 @@ export default {
if ( if (
this.detail && this.detail &&
Object.keys(this.detail).length > 0 && Object.keys(this.detail).length > 0 &&
this.isAutoFinish this.isAutoFinish &&
this.user.factory.countryCode === "US"
) { ) {
try { try {
await this.setData(this.detail); await this.setData(this.detail);
...@@ -676,26 +665,30 @@ export default { ...@@ -676,26 +665,30 @@ export default {
} }
} }
if (this.detail && !this.isAutoFinish && this.desktopDevice == 3) { // if (this.detail && !this.isAutoFinish && this.desktopDevice == 3) {
//惠立彩判断是否全部图片都已经打印完成 // //惠立彩判断是否全部图片都已经打印完成
const canCallApi = // const canCallApi =
this.detail.saveImgList?.every(el => el.power) ?? false; // this.detail.saveImgList?.every(el => el.power) ?? false;
if (canCallApi) { // if (canCallApi) {
bus.$emit("busEmit", { // bus.$emit("busEmit", {
value: this.detail.newId, // value: this.detail.newId,
type: "completeFail" // type: "completeFail"
}); // });
} // }
} // }
//判断生产单号是否为空 //判断生产单号是否为空
if (this.productionNo === "") if (this.productionNo === "")
return this.$message.warning("请录入生产单号/操作单号"); return this.$message.warning("请录入生产单号/操作单号");
// const today = moment(new Date()).format("YYYY-MM-DD"); const today = moment(new Date()).format("YYYY-MM-DD");
//判断上一单未勾选添加当天日期是否跳过 //判断上一单未勾选添加当天日期是否跳过(us)
if (!this.isAutoFinish && today != getNowDate()) { if (
this.user.factory.countryCode === "US" &&
!this.isAutoFinish &&
today != getNowDate()
) {
this.$confirm("请注意自动完成上一单未勾选", "提示", { this.$confirm("请注意自动完成上一单未勾选", "提示", {
confirmButtonText: "跳过提示", confirmButtonText: "跳过提示",
type: "warning" type: "warning"
...@@ -756,6 +749,10 @@ export default { ...@@ -756,6 +749,10 @@ export default {
} }
this.detail = findByPodProductionNo.data; this.detail = findByPodProductionNo.data;
if (this.orderType == "OP") {
this.checkAndCompleteProduction(this.detail);
}
//赋值当前扫码为生产单号的标识 //赋值当前扫码为生产单号的标识
if (!this.detail["newId"]) { if (!this.detail["newId"]) {
this.detail["newId"] = this.productionNo; this.detail["newId"] = this.productionNo;
...@@ -817,11 +814,7 @@ export default { ...@@ -817,11 +814,7 @@ export default {
isForcedProduction isForcedProduction
); );
this.$store.commit("setProductDetail", this.detail); this.$store.commit("setProductDetail", this.detail);
if (this.desktopDevice !== 3) {
await this.setData(this.detail);
} else {
this.checkAndCompleteProduction(this.detail);
}
ipcRenderer.send("win-subScreen", findByPodProductionNo.data); ipcRenderer.send("win-subScreen", findByPodProductionNo.data);
this.$dataStore.set("production_no", this.productionNo); this.$dataStore.set("production_no", this.productionNo);
this.productionNo = ""; this.productionNo = "";
...@@ -1252,7 +1245,11 @@ export default { ...@@ -1252,7 +1245,11 @@ export default {
</el-button> </el-button>
</div> </div>
<div style="margin-left: 10px;"> <div style="margin-left: 10px;">
<!-- <el-checkbox v-model="isAutoFinish">自动完成上一单</el-checkbox> --> <el-checkbox
v-if="user.factory.countryCode === 'US'"
v-model="isAutoFinish"
>自动完成上一单</el-checkbox
>
</div> </div>
<div style="margin-left: 10px;" v-if="desktopDevice == 3"> <div style="margin-left: 10px;" v-if="desktopDevice == 3">
<el-checkbox v-model="isForcedProduction" style="color: red;" <el-checkbox v-model="isForcedProduction" style="color: red;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment