Commit 4964d56c by linjinhong

feat:添加操作日志

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