|
|
@@ -510,9 +510,10 @@ export default {
|
|
|
case 'cancel':
|
|
|
this.handleCancel();
|
|
|
break;
|
|
|
+ /*
|
|
|
case 'test':
|
|
|
this.handleTest();
|
|
|
- break;
|
|
|
+ break;*/
|
|
|
case 'pdf':
|
|
|
this.dialogFormVisible = true;
|
|
|
break;
|
|
|
@@ -554,23 +555,39 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
validateFormData() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- this.$message.warning('请完善表单必填项后再进行操作!');
|
|
|
- reject('Validation failed');
|
|
|
- } else {
|
|
|
- const { shiYanXiangMu } = this.form;
|
|
|
- const regex = /[\/\\]/g;
|
|
|
- if (regex.test(shiYanXiangMu)) {
|
|
|
- this.form.shiYanXiangMu = shiYanXiangMu.replace(regex, '_');
|
|
|
- this.$message.warning('【实验项目】中的【\\】与【/】已被转化为【_】');
|
|
|
- }
|
|
|
- resolve();
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!this.form.reagentPoList || this.form.reagentPoList.length === 0) {
|
|
|
+ this.$message.warning('请至少填写一个实验试剂!');
|
|
|
+ reject('VALIDATION_FAILED'); // 使用特定标识
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$utils.isEmpty(this.form.shiYanShuJu) && this.$utils.isEmpty(this.form.jiSuanJieGuo)) {
|
|
|
+ this.$message.warning('请填写或导入实验数据!');
|
|
|
+ reject('VALIDATION_FAILED');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$utils.isEmpty(this.form.shiYanJieLun)) {
|
|
|
+ this.$message.warning('请填写实验结论!');
|
|
|
+ reject('VALIDATION_FAILED');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!valid) {
|
|
|
+ this.$message.warning('请完善表单必填项后再进行操作!');
|
|
|
+ reject('VALIDATION_FAILED');
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ const { shiYanXiangMu } = this.form;
|
|
|
+ const regex = /[\/\\]/g;
|
|
|
+ if (regex.test(shiYanXiangMu)) {
|
|
|
+ this.form.shiYanXiangMu = shiYanXiangMu.replace(regex, '_');
|
|
|
+ this.$message.warning('【实验项目】中的【\\】与【/】已被转化为【_】');
|
|
|
}
|
|
|
- });
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
});
|
|
|
- },
|
|
|
+ });
|
|
|
+ },
|
|
|
handleStartFlow(data) {
|
|
|
this.validateFormData()
|
|
|
.then(async () => {
|
|
|
@@ -592,7 +609,11 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
+ // 如果错误是验证失败,不显示"提交失败"
|
|
|
+ // 只有当错误是其他类型(如网络错误)时才显示
|
|
|
+ if (error !== 'VALIDATION_FAILED') {
|
|
|
this.$message.error('提交失败');
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
handleAgree(taskId,data) {
|
|
|
@@ -903,6 +924,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ /*
|
|
|
handleTest() {
|
|
|
const o = {
|
|
|
xingNengZhiBia: '精密度',
|
|
|
@@ -953,7 +975,7 @@ export default {
|
|
|
...t,
|
|
|
shiYanCanShu: this.form.shiYanCanShu
|
|
|
}
|
|
|
- },
|
|
|
+ },*/
|
|
|
// 控制工具栏按钮显示
|
|
|
showToolBarsBtn(key) {
|
|
|
const status = (this.form && this.form.shiFouGuoShen) || '已暂存'
|