|
|
@ -753,9 +753,11 @@ function turnOrder(type, row) { |
|
|
|
|
|
|
|
// 完成 |
|
|
|
function finishOrder(row) { |
|
|
|
if (validateRow(row)) { |
|
|
|
showTempIdeaRefView.value = true |
|
|
|
tempIdeaRefViewData.value = row |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function confirmFinish(row) { |
|
|
|
let param = { |
|
|
@ -926,6 +928,7 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
formRef.dialogVisible = false |
|
|
|
await detailRef.value.getList() |
|
|
|
// 刷新当前列表 |
|
|
|
detailRef.value.tableObject.tableList.forEach(item=>{ |
|
|
|
if (item.itemNumbers?.length>0) { |
|
|
@ -935,9 +938,7 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
|
}) |
|
|
|
item.itemNumbers1 = str.substring(0, str.length - 1) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
await detailRef.value.getList() |
|
|
|
await getList() |
|
|
|
|
|
|
|
} finally { |
|
|
@ -1015,6 +1016,7 @@ const confirmIsTemporary = () => { |
|
|
|
confirmFinish(tempIdeaRefViewData.value) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const cancel = () => { |
|
|
|
showTempIdeaRefView.value = false; |
|
|
|
}; |
|
|
@ -1034,6 +1036,31 @@ const judgeIfDeviceRole = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const validateRow = (row) => { |
|
|
|
let flag = true; |
|
|
|
const validateResult = ref([]); |
|
|
|
for (const [key, rules] of Object.entries(DeviceMaintenanceMainRules)) { |
|
|
|
for (const rule of rules) { |
|
|
|
if (rule.required) { |
|
|
|
const schemaItem = DeviceMaintenanceMain.allSchemas.formSchema.find(item => item.field == key); |
|
|
|
if (schemaItem && (row[key] === undefined || row[key] === null || row[key] === '')) { |
|
|
|
validateResult.value.push({ |
|
|
|
msg: '[' + schemaItem.label + ']' |
|
|
|
}); |
|
|
|
flag = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!flag) { |
|
|
|
// 如果验证失败,将错误信息转换为HTML字符串并弹窗提示 |
|
|
|
const errorMessage = validateResult.value.map(error => error.msg).join(', '); |
|
|
|
message.alert('请填写以下必填项:'+errorMessage); // 使用支持HTML的弹窗显示所有错误信息 |
|
|
|
return false; // 验证失败,立即返回 |
|
|
|
} |
|
|
|
// 所有规则验证通过 |
|
|
|
return true; |
|
|
|
}; |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|