Просмотр исходного кода

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

johnsen 4 месяцев назад
Родитель
Сommit
060e2635bc

+ 39 - 17
src/views/business/performNew/experimental.vue

@@ -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) || '已暂存'

+ 23 - 3
src/views/business/performNew/experimentalView.vue

@@ -551,9 +551,25 @@ export default {
     validateFormData() {
       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');
+            reject('VALIDATION_FAILED');
+            return;
           } else {
             const { shiYanXiangMu } = this.form;
             const regex = /[\/\\]/g;
@@ -565,7 +581,7 @@ export default {
           }
         });
       });
-    },
+    }, 
     saveExperimentalData(idval,statusval) {
       const {
         kaiShiShiJian,
@@ -637,7 +653,11 @@ export default {
 
         })
         .catch((error) => {
-            this.$message.error('提交失败');
+            // 如果错误是验证失败,不显示"提交失败"
+            // 只有当错误是其他类型(如网络错误)时才显示
+            if (error !== 'VALIDATION_FAILED') {
+              this.$message.error('提交失败');
+            }
         });
     },
     handleAgree(taskId,data) {

+ 6 - 4
src/views/business/performNew/myRecord.vue

@@ -173,8 +173,8 @@
               minWidth: 125
             },
             
-            { prop: 'shiYanXiangMu', label: '实验项目', slotName: 'shiYanXiangMu', width: 120 },
-            { prop: 'shiYanFangFa', label: '实验方法', slotName: 'shiYanFangFa', width: 180 },
+            { prop: 'shiYanXiangMu', label: '实验项目', slotName: 'shiYanXiangMu', width: 130 },
+            { prop: 'shiYanFangFa', label: '实验方法', slotName: 'shiYanFangFa', width: 190 },
             { prop: 'yangBenLeiXing', label: '样本类型', width: 100 },
             { prop: 'shiYanYiQi', label: '实验仪器', width: 120 },
             {
@@ -201,7 +201,9 @@
           ],
           rowHandle: {
             effect: 'display',
-            width: 90,
+            width: 80,
+            align: 'right',  // 添加这一行
+            //fixed: 'right',  // 如果有需要,可以固定在右侧
             actions: [
               {
                 key: 'edit',
@@ -209,7 +211,7 @@
                 type: 'primary',
                 icon: 'ibps-icon-edit',
                 hidden: (row) => row.shiFouGuoShen !== '已暂存' 
-                //&& row.shiFouGuoShen !== '已退回'
+                && row.shiFouGuoShen !== '已退回'
               },
               {
                 key: 'detail',