Commit e1a5ca1f by 宋春膨

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

- 将生产计划模块中的硬编码localhost地址替换为VITE_GLOB_API_URL环境变量
- 将质量管控领料质检表单中的硬编码localhost地址替换为环境变量配置
- 优化代码格式和语法规范性
- 修复watch监听器语法格式问题
- 添加nextTick等待DOM更新完成后再触发处理逻辑
- 清理多余导入语句和空行格式
parent 2208e9e4
......@@ -223,7 +223,7 @@
cancelText: '取消',
onOk() {
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) => {
if (res.data === '下发成功') {
notification.success({
......
......@@ -70,10 +70,10 @@
() => state.formModel.zjfa,
(newZjfaId) => {
if (newZjfaId) {
state.formModel.mesQualityInspectionDetailList = []
state.formModel.mesQualityInspectionDetailList = [];
try {
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 },
})
.then((response) => {
......@@ -83,7 +83,7 @@
bh: item.bh,
zjxm: item.mc,
bz: item.bz,
jyyf: item.zjfs
jyyf: item.zjfs,
});
}
});
......@@ -92,9 +92,10 @@
notification.error({ message: '获取质检详情失败' });
}
}
},{
deep: true
}
},
{
deep: true,
},
);
onMounted(async () => {
......@@ -185,6 +186,13 @@
const record = await getMesDeQualityInspection(rowId);
setFieldsValue(record);
state.formModel = record;
// 等待 DOM 更新完成后,如果 zjfa 存在,则手动触发处理
await nextTick();
if (record.zjfa) {
handleZjfaChange(record.zjfa);
}
await getFormDataEvent(
formEventConfigs,
state.formModel,
......
......@@ -38,7 +38,7 @@
import { FromPageType } from '/@/enums/workflowEnum';
import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data';
import { executeCurFormEvent } from '/@/utils/event/data';
const emit = defineEmits(['success', 'register']);
......@@ -163,4 +163,3 @@
</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