Browse Source

修复测试bug

master
ljlong_2630 8 months ago
parent
commit
5232de2cb3
  1. 39
      src/views/eam/device/devicemaintenancejob/index.vue
  2. 32
      src/views/eam/mold/moldmaintenancejob/index.vue

39
src/views/eam/device/devicemaintenancejob/index.vue

@ -753,8 +753,10 @@ function turnOrder(type, row) {
// //
function finishOrder(row) { function finishOrder(row) {
showTempIdeaRefView.value = true if (validateRow(row)) {
tempIdeaRefViewData.value = row showTempIdeaRefView.value = true
tempIdeaRefViewData.value = row
}
} }
function confirmFinish(row) { function confirmFinish(row) {
@ -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,10 +938,8 @@ 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 {
formRef.formLoading = false formRef.formLoading = false
@ -1012,9 +1013,10 @@ function isReceiver(orderPerson) {
const confirmIsTemporary = () => { 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 () => {

32
src/views/eam/mold/moldmaintenancejob/index.vue

@ -513,8 +513,10 @@ function turnOrder() { }
// //
function finishOrder(row) { function finishOrder(row) {
showTempIdeaRefView.value = true if (validateRow(row)) {
tempIdeaRefViewData.value = row showTempIdeaRefView.value = true
tempIdeaRefViewData.value = row
}
} }
function confirmFinish(row) { function confirmFinish(row) {
@ -984,6 +986,32 @@ const cancel = () => {
showTempIdeaRefView.value = false; showTempIdeaRefView.value = false;
}; };
const validateRow = (row) => {
let flag = true;
const validateResult = ref([]);
for (const [key, rules] of Object.entries(MoldMaintenanceMainRules)) {
for (const rule of rules) {
if (rule.required) {
const schemaItem = MoldMaintenanceMain.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 () => {

Loading…
Cancel
Save