|
@ -753,9 +753,11 @@ function turnOrder(type, row) { |
|
|
|
|
|
|
|
|
// 完成 |
|
|
// 完成 |
|
|
function finishOrder(row) { |
|
|
function finishOrder(row) { |
|
|
|
|
|
if (validateRow(row)) { |
|
|
showTempIdeaRefView.value = true |
|
|
showTempIdeaRefView.value = true |
|
|
tempIdeaRefViewData.value = row |
|
|
tempIdeaRefViewData.value = row |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function confirmFinish(row) { |
|
|
function confirmFinish(row) { |
|
|
let param = { |
|
|
let param = { |
|
@ -926,6 +928,7 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|
formRef.dialogVisible = false |
|
|
formRef.dialogVisible = false |
|
|
|
|
|
await detailRef.value.getList() |
|
|
// 刷新当前列表 |
|
|
// 刷新当前列表 |
|
|
detailRef.value.tableObject.tableList.forEach(item=>{ |
|
|
detailRef.value.tableObject.tableList.forEach(item=>{ |
|
|
if (item.itemNumbers?.length>0) { |
|
|
if (item.itemNumbers?.length>0) { |
|
@ -935,9 +938,7 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
}) |
|
|
}) |
|
|
item.itemNumbers1 = str.substring(0, str.length - 1) |
|
|
item.itemNumbers1 = str.substring(0, str.length - 1) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
await detailRef.value.getList() |
|
|
|
|
|
await getList() |
|
|
await getList() |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
@ -1015,6 +1016,7 @@ const confirmIsTemporary = () => { |
|
|
confirmFinish(tempIdeaRefViewData.value) |
|
|
confirmFinish(tempIdeaRefViewData.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cancel = () => { |
|
|
const cancel = () => { |
|
|
showTempIdeaRefView.value = false; |
|
|
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 () => { |
|
|
onMounted(async () => { |
|
|