Commit 2208e9e4 by 宋春膨

feat(llzjd): 添加质检方案详情自动获取功能

- 监听表单中质检方案ID变化,自动清空质检详情列表
- 集成axios用于发送HTTP请求获取质检方案数据
- 实现异步获取质检方案详情并填充到表单模型中
- 添加错误处理机制和用户通知提示
- 使用深度监听确保表单数据正确更新
parent 25ee511b
......@@ -35,6 +35,7 @@
import { useRouter } from 'vue-router';
import { getRokeRouting } from '/@/api/jcsj/gylx';
import { notification } from 'ant-design-vue';
import axios from 'axios';
const { filterFormSchemaAuth } = usePermission();
......@@ -65,6 +66,37 @@
},
);
watch(
() => state.formModel.zjfa,
(newZjfaId) => {
if (newZjfaId) {
state.formModel.mesQualityInspectionDetailList = []
try {
axios
.get('http://localhost:8053/magic-api/zlgl/zjjcsj/getFaById', {
params: { id: newZjfaId },
})
.then((response) => {
for (const item of response.data.data) {
state.formModel.mesQualityInspectionDetailList.push({
bzz: item.bzz,
bh: item.bh,
zjxm: item.mc,
bz: item.bz,
jyyf: item.zjfs
});
}
});
} catch (error) {
console.error('获取质检方案详情失败:', error);
notification.error({ message: '获取质检详情失败' });
}
}
},{
deep: true
}
);
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
......
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