Commit 4964d56c by linjinhong

feat:添加操作日志

parent 90fd3ed3
......@@ -54,7 +54,9 @@ export const pathMap = {
replenishmentComposingDesignImages:
"factory/podOrderOperation/replenishmentComposingDesignImages",
//获取单个批次号信息
podOrderBatchDownload: "factory/podOrderBatchDownload/get"
podOrderBatchDownload: "factory/podOrderBatchDownload/get",
//操作日志
getPodOrderLog: "factory/podOrderLog/getPodOrderLog"
};
// 操作单状态枚举
export const statusMap = {
......
......@@ -686,7 +686,7 @@ export default {
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
console.log("productionConfig", error);
res.json({ code: 500, msg: error });
}
},
......@@ -703,7 +703,7 @@ export default {
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
console.log("productionConfigUpdate", error);
res.json({ code: 500, msg: error });
}
},
......@@ -720,7 +720,7 @@ export default {
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
console.log("productionSoftware", error);
res.json({ code: 500, msg: error });
}
},
......@@ -738,7 +738,7 @@ export default {
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
console.log("listMaterialsByBatch", error);
res.json({ code: 500, msg: error });
}
},
......@@ -756,7 +756,7 @@ export default {
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
console.log("psReComposingDesignImages", error);
res.json({ code: 500, msg: error });
}
},
......@@ -773,7 +773,7 @@ export default {
});
res.send(data);
} catch (error) {
console.log("checkInventory", error);
console.log("listOperationByBatch", error);
res.json({ code: 500, msg: error });
}
},
......@@ -805,7 +805,7 @@ export default {
const result = await downloadDTFFiles(files[0].url, targetDir);
res.json({ code: 200, data: result });
} catch (error) {
console.log("checkInventory", error);
console.log("replenishmentComposingDesignImages", error);
res.json({ code: 500, msg: error });
}
},
......@@ -822,7 +822,24 @@ export default {
res.json({ code: 200, data });
} catch (error) {
console.log("checkInventory", error);
console.log("podOrderBatchDownload", error);
res.json({ code: 500, msg: error });
}
},
getPodOrderLog: async (req, res) => {
env = getHostApi().apiApiHost;
const token = req.headers["jwt-token"];
const { id } = req.body;
let url = pathMap["getPodOrderLog"];
try {
let { data } = await axios.get(`${env}/${url}?id=${id}`, {
headers: { "jwt-token": token }
});
res.json({ code: 200, data });
} catch (error) {
console.log("getPodOrderLog", error);
res.json({ code: 500, msg: error });
}
}
......
......@@ -81,6 +81,8 @@ autoRegisterRouter(
autoRegisterRouter(router, "podOrderBatchDownload", fn.podOrderBatchDownload);
//根据批次分页查询操作单
autoRegisterRouter(router, "listOperationByBatch", fn.listOperationByBatch);
//操作日志
autoRegisterRouter(router, "getPodOrderLog", fn.getPodOrderLog);
// 根据生产单号查询详情
autoRegisterRouter(router, "findByPodProductionNo", fn.findByPodProductionNo);
......
const { ipcMain, BrowserWindow } = require("electron");
const path = require("path");
const { getHostApi } = require("@/server/utils/store");
const { batchDownloadByStr } = require("./utils/download-core");
const { batchDownloadByStr } = require("./download-core");
/* ===================== 原有命名逻辑(完全保留) ===================== */
function formatTime() {
......
......@@ -193,8 +193,17 @@ export default {
return [{ url: trimmed }];
}
},
openLogDialog() {
this.logVisible = true;
async openLogDialog(item) {
try {
const { data } = await this.$api.post(
pathMap["getPodOrderLog"],
item.id
);
this.logList = data;
this.logVisible = true;
} catch (error) {
console.log(error);
}
},
changeActive(item) {
const index = this.selection.indexOf(item.id);
......
......@@ -15,7 +15,7 @@ import {
submitTypesettingDownload,
getTypesettingDownloadStatus,
onTypesettingStatusChange
} from "@/api/download.api";
} from "@/utils/download-api";
export default {
name: "design-dtf",
......@@ -39,7 +39,7 @@ export default {
templateBatchArrangeNum: "",
templateId: "",
isDownloading: false,
resTypesettingisDownloading: false,
TypeDownloading: false,
dtfSetting: getDTFSetting(),
removeStatusListener: null, // 保存取消监听函数
......@@ -243,7 +243,7 @@ export default {
//提交手动排版
async submit() {
if (this.resTypesettingisDownloading) {
if (this.TypeDownloading) {
this.$message.warning("其他排版下载中,请等待完成后再操作");
return;
}
......@@ -251,7 +251,7 @@ export default {
return this.$message.error("请选择排版宽度");
}
try {
this.resTypesettingisDownloading = true;
this.TypeDownloading = true;
if (this.dtfSetting.widthStrategy == 3 && this.radio == 60) {
this.$confirm(
"由于排版设置中选择“按更大规格排版”仅适用于40+2,选60时,默认超60的规格不排版",
......@@ -293,7 +293,7 @@ export default {
this.fetchBatchList(this.searchForm);
} catch (error) {
console.log(error);
this.resTypesettingisDownloading = false;
this.TypeDownloading = false;
}
},
......@@ -359,7 +359,7 @@ export default {
*/
handleDownloadStatus(type, status) {
const statusKey =
type === "material" ? "isDownloading" : "resTypesettingisDownloading";
type === "material" ? "isDownloading" : "TypeDownloading";
this[statusKey] = status.isRunning;
if (!status.isRunning && status.result) {
......@@ -381,7 +381,7 @@ export default {
const res = await getDownloadStatus();
const resTypesetting = await getTypesettingDownloadStatus();
this.isDownloading = res.data.isRunning;
this.resTypesettingisDownloading = resTypesetting.data.isRunning;
this.TypeDownloading = resTypesetting.data.isRunning;
} catch (err) {
console.error("同步下载状态失败", err);
}
......
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