Procházet zdrojové kódy

修复控制台报错,验证流程状态不改变的bug

zhonghuizhen před 6 měsíci
rodič
revize
383ea66cd6

+ 4 - 3
src/views/business/performance/experimental.vue

@@ -540,9 +540,9 @@ export default {
     },*/
     handleAgree(taskId,data) {
       if(data.shiFouGuoShen === '已编制'){
-          data.shiFouGuoShen === '已审核'
+          data.shiFouGuoShen = '已审核'
       }else if(data.shiFouGuoShen === '已审核'){
-        data.shiFouGuoShen === '已完成'
+        data.shiFouGuoShen = '已完成'
       }
       agree({ 
         opinion: '同意',
@@ -764,7 +764,8 @@ export default {
         exportTemplate({ id: this.formId }).then((res) => {
           ActionUtils.download(
             res.data,
-            `${this.configData.methodName}-${this.form.shiYanXiangMu}.xlsx`
+           // `${this.configData.methodName}-${this.form.shiYanXiangMu}.xlsx`
+           `${this.configData.methodName}.xlsx`
           )
         })
       })

+ 23 - 13
src/views/business/performance/experimentalView.vue

@@ -19,7 +19,7 @@
       :model.sync="form"
       :rules="rules"
       class="config-form"
-      :class="readonly ? 'readonly-form' : ''"
+      :class="internalReadonly ? 'readonly-form' : ''"
       @submit.native.prevent
     >
       <div v-if="loadCompleted" class="config-form-container">
@@ -29,16 +29,16 @@
             :criterion="configData.criterion || ''"
             :formulas="configData.formulas || []"
             :references="configData.references || []"
-            :readonly="readonly"
+            :readonly="internalReadonly"
           />
-          <basic-info :info="form" :readonly="readonly" />
-          <reagent-info :info="form.reagentPoList" :readonly="readonly" />
+          <basic-info :info="form" :readonly="internalReadonly" />
+          <reagent-info :info="form.reagentPoList" :readonly="internalReadonly" />
           <param-info
             v-if="$utils.isNotEmpty(configData && configData.params)"
             :form-id="formId"
             :info="form.shiYanCanShu"
             :config-data="configData.params || []"
-            :readonly="readonly"
+            :readonly="internalReadonly"
             @updateParams="handleUpdateParams"
           />
         </div>
@@ -46,20 +46,20 @@
           <experimental-data
             :exp="form.jiSuanJieGuo"
             :form-id="formId"
-            :readonly="readonly"
+            :readonly="internalReadonly"
             @export="handleExport"
             @import="handleImport"
           />
           <precision
             v-if="$utils.isNotEmpty(form.jiSuanJieGuo)"
             :info="form.jiSuanJieGuo"
-            :readonly="readonly"
+            :readonly="internalReadonly"
             @recalculate="handleRecalculate"
           />
           <conclusion
             :result="form.shiYanJieLun"
             :files="form.fuJian"
-            :readonly="readonly"
+            :readonly="internalReadonly"
             @updateData="handleUpdateData"
           />
         </div>
@@ -224,6 +224,7 @@ export default {
       dialogFormVisible: false,
       flowDiagramVisible: false,
       approvalHistoryVisible: false,
+      internalReadonly: this.readonly,
       pdf: 'pdf',
       formLabelWidth: '110px',
       configData: { methodName: '' },
@@ -332,6 +333,14 @@ export default {
     visible: {
       handler(val) {
         this.localVisible = val;
+
+      },
+      immediate: true
+    },
+     //监听 readonly prop 的变化
+     readonly: {
+      handler(val) {
+        this.internalReadonly = val;
       },
       immediate: true
     }
@@ -589,7 +598,7 @@ export default {
         })
         .then((res) => {
           this.$message.success('提交成功');
-          this.visible = false;
+          this.closeDialog();
           const id = res.variables.bizKey || '';
           return this.saveExperimentalData(id,'已编制')
         })
@@ -766,7 +775,8 @@ export default {
         exportTemplate({ id: this.formId }).then((res) => {
           ActionUtils.download(
             res.data,
-            `${this.configData.methodName}-${this.form.shiYanXiangMu}.xlsx`
+            //`${this.configData.methodName}-${this.form.shiYanXiangMu}.xlsx`
+            `${this.configData.methodName}.xlsx`
           )
         })
       })
@@ -887,7 +897,7 @@ export default {
       }
     },
     showToolBarsBtn(key) {
-      if (this.readonly && this.params.action !== 'edit') {
+      if (this.internalReadonly && this.params.action !== 'edit') {
         return !['flowChart','approvalHistory', 'pdf', 'cancel'].includes(key)
       }
       
@@ -899,13 +909,13 @@ export default {
       
       if (status === '已编制' && this.params.action == 'edit') {
         //已编制状态不允许修改表单内容
-        this.readonly = true
+        this.internalReadonly = true
         return !['flowChart','approvalHistory', 'pdf', 'cancel', 'save', 'sendBack','doEndProcess', 'submit'].includes(key)
       }
       
       if (status === '已审核' && this.params.action == 'edit') {
           //已审核状态不允许修改表单内容
-          this.readonly = true
+          this.internalReadonly = true
         return !['flowChart','approvalHistory', 'pdf', 'cancel', 'save', 'sendBack','doEndProcess', 'submit'].includes(key)
       }