| | |
| | | const modelOptions = ref([]); |
| | | |
| | | // 打开弹框 |
| | | const openDialog = async (type, row) => { |
| | | const openDialog = async (type, row, defaultCheckResult = "") => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | // 先清空表单验证状态,避免闪烁 |
| | | await nextTick(); |
| | | proxy.$refs.formRef?.clearValidate(); |
| | | |
| | | |
| | | // 并行加载基础数据 |
| | | const [userListsRes] = await Promise.all([ |
| | | userListNoPage(), |
| | |
| | | }) |
| | | ]); |
| | | userList.value = userListsRes.data; |
| | | |
| | | |
| | | form.value = {} |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | | |
| | | |
| | | if (operationType.value === 'edit') { |
| | | // 先保存 testStandardId,避免被清空 |
| | | const savedTestStandardId = row.testStandardId; |
| | | // 先设置表单数据,但暂时清空 testStandardId,等选项加载完成后再设置 |
| | | form.value = {...row, testStandardId: ''} |
| | | // 如果传入了默认检测结果,覆盖row中的值 |
| | | if (defaultCheckResult) { |
| | | form.value.checkResult = defaultCheckResult; |
| | | } |
| | | currentProductId.value = row.productId || 0 |
| | | // 清空验证状态,避免数据加载过程中的校验闪烁 |
| | | nextTick(() => { |