Переглянути джерело

update:审批通过可以不输入审批意见

damon227 1 рік тому
батько
коміт
23d1324077

+ 7 - 1
src/views/modules/common/approve-component-batch.vue

@@ -30,7 +30,7 @@
         dataForm: {},
         fileList: [],
         dataRule: {
-          remark: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
+          // remark: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
         },
         loading: false
       }
@@ -50,6 +50,12 @@
       dataFormSubmit (val) {
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
+            if (val !== '1') {
+              if (!this.dataForm.remark) {
+                this.$message.error('请填写审批意见')
+                return
+              }
+            }
             this.loading = true
             // 添加附件
             let fList = this.fileList

+ 8 - 2
src/views/modules/common/approve-component.vue

@@ -8,7 +8,7 @@
             </el-form-item>
           </el-row>
           <el-row class="my-row">
-            <upload-component :title="'审批附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
+            <upload-component :title="'审批附件'" :display-star="false" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
           </el-row>
         </el-form>
       </el-col>
@@ -30,7 +30,7 @@
         dataForm: {},
         fileList: [],
         dataRule: {
-          remark: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
+          // remark: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
         }
       }
     },
@@ -48,6 +48,12 @@
       dataFormSubmit (val) {
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
+            if (val !== '1') {
+              if (!this.dataForm.remark) {
+                this.$message.error('请填写审批意见')
+                return
+              }
+            }
             // 添加附件
             let fList = this.fileList
             if (fList.length > 0) {