Commit e1a5ca1f by 宋春膨

refactor(zlgl): 替换硬编码API地址为环境变量配置

- 将生产计划模块中的硬编码localhost地址替换为VITE_GLOB_API_URL环境变量
- 将质量管控领料质检表单中的硬编码localhost地址替换为环境变量配置
- 优化代码格式和语法规范性
- 修复watch监听器语法格式问题
- 添加nextTick等待DOM更新完成后再触发处理逻辑
- 清理多余导入语句和空行格式
parent 2208e9e4
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
cancelText: '取消', cancelText: '取消',
onOk() { onOk() {
axios axios
.post('http://localhost:8053/scgl/scjh/issue', { ids } , {headers: { Authorization: 'Bearer '+store.getToken } }) .post(import.meta.env.VITE_GLOB_API_URL + '/scgl/scjh/issue', { ids } , {headers: { Authorization: 'Bearer '+store.getToken } })
.then((res) => { .then((res) => {
if (res.data === '下发成功') { if (res.data === '下发成功') {
notification.success({ notification.success({
......
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
() => state.formModel.zjfa, () => state.formModel.zjfa,
(newZjfaId) => { (newZjfaId) => {
if (newZjfaId) { if (newZjfaId) {
state.formModel.mesQualityInspectionDetailList = [] state.formModel.mesQualityInspectionDetailList = [];
try { try {
axios axios
.get('http://localhost:8053/magic-api/zlgl/zjjcsj/getFaById', { .get(import.meta.env.VITE_GLOB_API_URL + '/magic-api/zlgl/zjjcsj/getFaById', {
params: { id: newZjfaId }, params: { id: newZjfaId },
}) })
.then((response) => { .then((response) => {
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
bh: item.bh, bh: item.bh,
zjxm: item.mc, zjxm: item.mc,
bz: item.bz, bz: item.bz,
jyyf: item.zjfs jyyf: item.zjfs,
}); });
} }
}); });
...@@ -92,9 +92,10 @@ ...@@ -92,9 +92,10 @@
notification.error({ message: '获取质检详情失败' }); notification.error({ message: '获取质检详情失败' });
} }
} }
},{ },
deep: true {
} deep: true,
},
); );
onMounted(async () => { onMounted(async () => {
...@@ -185,6 +186,13 @@ ...@@ -185,6 +186,13 @@
const record = await getMesDeQualityInspection(rowId); const record = await getMesDeQualityInspection(rowId);
setFieldsValue(record); setFieldsValue(record);
state.formModel = record; state.formModel = record;
// 等待 DOM 更新完成后,如果 zjfa 存在,则手动触发处理
await nextTick();
if (record.zjfa) {
handleZjfaChange(record.zjfa);
}
await getFormDataEvent( await getFormDataEvent(
formEventConfigs, formEventConfigs,
state.formModel, state.formModel,
......
...@@ -163,4 +163,3 @@ ...@@ -163,4 +163,3 @@
</script> </script>
\ No newline at end of file
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