Commit c52d287d by linjinhong

fix:修改问题

parent 82e0f37b
...@@ -307,7 +307,11 @@ export default { ...@@ -307,7 +307,11 @@ export default {
}, },
async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList) { async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList) {
let imageResList = []; let imageResList = [];
if (this.detail.diyId && this.detail.adjustable && designImagesCanvasJsonList) { if (
this.detail.diyId &&
this.detail.adjustable &&
designImagesCanvasJsonList
) {
designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList); designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList);
if (!designImagesCanvasJsonList[0].images) { if (!designImagesCanvasJsonList[0].images) {
let imageList = await this.canvasToImage(designImagesCanvasJsonList); let imageList = await this.canvasToImage(designImagesCanvasJsonList);
...@@ -323,7 +327,6 @@ export default { ...@@ -323,7 +327,6 @@ export default {
item.productionFile = item.url; item.productionFile = item.url;
}); });
imageResList = Sres.data; imageResList = Sres.data;
} else { } else {
// designImagesCanvasJsonList.forEach((el) => { // designImagesCanvasJsonList.forEach((el) => {
// el.images.forEach((item) => { // el.images.forEach((item) => {
...@@ -416,49 +419,50 @@ export default { ...@@ -416,49 +419,50 @@ export default {
console.error("清理目录时发生错误:", error.msg); console.error("清理目录时发生错误:", error.msg);
} }
if (this.factoryType !== "US") { if (this.factoryType !== "US") {
if (this.factoryType !== "US") { if (this.factoryType !== "US") {
const regex = /^[A-Z]{4}_/; //是否以四个大写字母加下划线开头 const regex = /^[A-Z]{4}_/; //是否以四个大写字母加下划线开头
if (regex.test(this.productionNo)) { if (regex.test(this.productionNo)) {
this.productionNo = this.productionNo =
this.productionNo.split("_")[0] + this.productionNo.split("_")[0] +
"-" + "-" +
this.productionNo.split("_")[ this.productionNo.split("_")[
this.productionNo.split("_").length - 1 this.productionNo.split("_").length - 1
]; ];
}
} }
}
console.log(423, this.productionNo); console.log(423, this.productionNo);
try { try {
//查找生产单号信息传给第二个显示器 //查找生产单号信息传给第二个显示器
const findByPodProductionNo = await this.$api.post( const findByPodProductionNo = await this.$api.post(
"/findByPodProductionNo", "/findByPodProductionNo",
{ {
thirdSubOrderNumber: this.productionNo, thirdSubOrderNumber: this.productionNo,
type: this.factoryType, type: this.factoryType,
} }
);
this.detail = findByPodProductionNo.data;
this.imgList = [];
let designImagesCanvasJsonList = this.detail.drParam;
await this.hasDesignImagesCanvasJsonList(designImagesCanvasJsonList);
this.$store.commit("setProductDetail", findByPodProductionNo.data);
ipcRenderer.send("win-subScreen", findByPodProductionNo.data);
this.$dataStore.set("production_no", this.productionNo);
this.productionNo = "";
this.$refs.searchRef.focus();
} catch (err) {
console.log(err);
if (!err.data) {
this.$message.error(
"未使用英文输入法输入/扫码,或该生产单号未拣胚或已完成"
); );
this.detail = findByPodProductionNo.data;
this.imgList = [];
let designImagesCanvasJsonList = this.detail.drParam;
await this.hasDesignImagesCanvasJsonList(designImagesCanvasJsonList);
this.$store.commit("setProductDetail", findByPodProductionNo.data);
ipcRenderer.send("win-subScreen", findByPodProductionNo.data);
this.$dataStore.set("production_no", this.productionNo);
this.productionNo = "";
this.$refs.searchRef.focus();
} catch (err) {
console.log(err);
if (!err.data) {
this.$message.error(
"未使用英文输入法输入/扫码,或该生产单号未拣胚或已完成"
);
}
this.productionNo = "";
this.$refs.searchRef.focus();
} finally {
this.isFirst = false;
} }
this.productionNo = "";
this.$refs.searchRef.focus();
} finally {
this.isFirst = false;
} }
}, },
// // 聚焦资源管理器窗口(Windows) // // 聚焦资源管理器窗口(Windows)
......
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