Commit 2af4e414 by linjinhong

fix:修改问题

parent f6e45c94
......@@ -31,6 +31,9 @@ export const pathMap = {
//判断 status 操作单状态
scanProduce: {
OP: "factory/podOrderOperation/scan-produce"
},
checkInventory: {
OP: "factory/podOrderOperation/check-inventory"
}
};
......
......@@ -631,5 +631,26 @@ export default {
console.log("scanProduce", error);
res.json({ code: 500, msg: error });
}
},
checkInventory: async (req, res) => {
env = getHostApi().apiApiHost;
const token = req.headers["jwt-token"];
const params = req.body;
let url = "factory/podOrderOperation/check-inventory";
console.log("checkInventory", `${env}/${url}`);
try {
let { data } = await axios.get(`${env}/${url}`, {
headers: { "jwt-token": token },
params: {
id: params.id,
status: params.status
}
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
res.json({ code: 500, msg: error });
}
}
};
......@@ -65,5 +65,7 @@ autoRegisterRouter(
);
//操作单状态
autoRegisterRouter(router, "scanProduce", fn.scanProduce);
//检查库存
autoRegisterRouter(router, "checkInventory", fn.checkInventory);
export { router as default };
......@@ -229,7 +229,7 @@ export default {
break;
}
},
async setData(data) {
async setData(data, type) {
if (!data) return this.$message.warning("请扫描生产单号/操作单号");
let params = {
id: data.id,
......@@ -256,11 +256,47 @@ export default {
}
console.log("本地数据removeFromOrderInfo:", getOrderInfoMap());
//生产完成后在本地删除
await this.$api.post(
pathMap["completeDelivery"][this.orderType],
params
);
if (
this.orderType == "OP" &&
(this.detail.status == "PENDING_PICK" ||
this.detail.status == "PENDING_REPLENISH")
) {
const { code, data } = await this.$api.post(
pathMap["scanProduce"][this.orderType],
params
);
if (code == 301) {
this.$confirm(
`<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
<p>库存数量:${data.availableInventory || 0},生产中数量:${data.inventory ||
0},可调配库存:${data.inventory || 0}</p>`,
"提示",
{
confirmButtonText: "确定",
type: "error",
dangerouslyUseHTMLString: true,
// 🔥 关键:添加自定义类名
customClass: "custom-inventory-msgbox"
}
);
this.detail = "";
this.productionNo = "";
this.$refs.searchRef?.focus();
return;
}
} else {
await this.$api.post(
pathMap["completeDelivery"][this.orderType],
params
);
}
this.$message.success("操作成功");
} else {
if (type == "btn") {
const item = data.saveImgList?.find(el => !el.power);
this.$message.warning(`该订单${item.title}面未打印,无法生产完成`);
}
}
},
async sureData() {
......@@ -272,7 +308,7 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
await this.setData(this.detail);
await this.setData(this.detail, "btn");
});
},
clearCache() {
......@@ -562,6 +598,8 @@ export default {
}
//如果该数据的图片第一次出现且素材图大于1张则把该数据储存到本地
if (newImgList.length > 1 && !bool && this.desktopDevice == 3) {
console.log("addToOrderInfo", this.detail);
addToOrderInfo(this.detail);
console.log("本地数据addToOrderInfo", getOrderInfoMap());
}
......@@ -689,31 +727,55 @@ export default {
(this.detail.status == "PENDING_PICK" ||
this.detail.status == "PENDING_REPLENISH")
) {
const { data, code } = await this.$api.post(
pathMap["scanProduce"][this.orderType],
{ id: this.detail.id, status: this.detail.status }
);
console.log("scanProduce---------", data);
if (code == 301) {
this.$confirm(
`<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
<p>库存数量:${data.availableInventory || 0},生产中数量:${data.inventory ||
0},可调配库存:${data.inventory || 0}</p>`,
"提示",
{
confirmButtonText: "确定",
type: "error",
dangerouslyUseHTMLString: true,
// 🔥 关键:添加自定义类名
customClass: "custom-inventory-msgbox"
}
);
this.detail = "";
this.productionNo = "";
this.$refs.searchRef?.focus();
return;
}
// const {
// data: checkInventoryData,
// code: checkInventoryCode
// } = await this.$api.post(pathMap["checkInventory"][this.orderType], {
// id: this.detail.id,
// status: this.detail.status
// });
// if (checkInventoryCode == 301) {
// this.$confirm(
// `<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
// <p>库存数量:${checkInventoryData.availableInventory ||
// 0},生产中数量:${checkInventoryData.inventory ||
// 0},可调配库存:${checkInventoryData.inventory || 0}</p>`,
// "提示",
// {
// confirmButtonText: "确定",
// type: "error",
// dangerouslyUseHTMLString: true,
// customClass: "custom-inventory-msgbox"
// }
// );
// this.detail = "";
// this.productionNo = "";
// this.$refs.searchRef?.focus();
// return;
// }
// const { data, code } = await this.$api.post(
// pathMap["scanProduce"][this.orderType],
// { id: this.detail.id, status: this.detail.status }
// );
// if (code == 301) {
// this.$confirm(
// `<p>库存不足,无法进入生产!请联系仓库管理人员核对库存。</p>
// <p>库存数量:${data.availableInventory || 0},生产中数量:${data.inventory ||
// 0},可调配库存:${data.inventory || 0}</p>`,
// "提示",
// {
// confirmButtonText: "确定",
// type: "error",
// dangerouslyUseHTMLString: true,
// // 🔥 关键:添加自定义类名
// customClass: "custom-inventory-msgbox"
// }
// );
// this.detail = "";
// this.productionNo = "";
// this.$refs.searchRef?.focus();
// return;
// }
}
let designImagesCanvasJsonList = this.detail.drParam;
......
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