Ver código fonte

修改审批内容

林倩 3 anos atrás
pai
commit
c4e5211259

+ 2 - 3
src/pages/list-manage/red-list-manage/index.scss

@@ -23,9 +23,8 @@
   /deep/ .vxe-body--row:hover {
      background-color: rgba(24, 144, 255, 0.08);
   }
-  /deep/ .vxe-table--render-default {
-    color: rgba(0,0,0,.65);
-  }
+ 
   /deep/ .vxe-table--render-default .vxe-table--empty-block {
     min-height: 60px;
+    color: rgba(0,0,0,.65);
   }

+ 32 - 23
src/pages/permission-selfhelp-manage/component/basic-form.vue

@@ -120,16 +120,11 @@
           <!-- <component :is="approveComponent"></component> -->
           <el-form-item label="审批内容:" class="self-form-item" prop="flowContent">
             <div style="display: flex" v-if="!isDetail">
-              <el-input
-                type="textarea"
-                :autosize="{ minRows: 5 }"
-                v-model="sizeForm.flowContent"
-                :disabled="true"
-              ></el-input>
-              <dg-button style="margin-left: 10px" @click="handleChoice">选择</dg-button>
+              <el-input type="textarea" :autosize="{ minRows: 5 }" :value="flowContentStr" :disabled="true"></el-input>
+              <dg-button style="margin-left: 10px" @click="handleChoice" v-if="sizeForm.applyType">选择</dg-button>
             </div>
             <div v-else>
-              {{ sizeForm.flowContent }}
+              {{ flowContentStr }}
             </div>
           </el-form-item>
         </dg-col>
@@ -348,13 +343,25 @@ export default {
         }
       ],
       applyContentCom: appFuncForm,
-      show: false
+      show: false,
+      applyContentOperateObj: {
+        'function-auth-apply': '申请访问资源:',
+        'service-auth-apply': '申请服务:'
+      }
     };
   },
   components: {},
   computed: {
     isDetail() {
       return this.type == 'detail';
+    },
+    flowContentStr() {
+      let str = '';
+      if (this.sizeForm.flowContent) {
+        const { visitorName, visitResourceName } = JSON.parse(this.sizeForm.flowContent);
+        str = `${visitorName}${this.applyContentOperateObj[this.sizeForm.businessCode]}${visitResourceName}`;
+      }
+      return str;
     }
   },
   watch: {
@@ -391,10 +398,11 @@ export default {
         }
       });
     },
-    // 切换审批类型
+    // 切换审批类型,清空审批内容
     handleChangeApplyType(val) {
       this.sizeForm.flowContent = '';
-      this.sizeForm.resourceInfoDTO = [];
+      this.sizeForm.resourceInfos = [];
+      this.applySelectKeys = [];
       this.getProcessName(val);
     },
     // 取消/关闭
@@ -409,13 +417,14 @@ export default {
     },
     // 提交
     handleSubmit() {
-      if (this.sizeForm.applyType !== 'APP_FUN_AUTH') return;
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.sizeForm.operateType = '2';
-          this.save();
-        }
-      });
+      if (this.sizeForm.applyType == 'APP_FUN_AUTH' || !this.sizeForm.applyType) {
+        this.$refs.ruleForm.validate((valid) => {
+          if (valid) {
+            this.sizeForm.operateType = '2';
+            this.save();
+          }
+        });
+      }
     },
     save() {
       const { resourceInfos, applyId, userType, userName, userCode, ...otherInfo } = this.sizeForm;
@@ -471,11 +480,11 @@ export default {
           success(approveContent, selectKeys, resourceInfos = []) {
             vm.sizeForm.resourceInfos = resourceInfos;
             vm.applySelectKeys = selectKeys;
-            const prefix =
-              vm.sizeForm.applyType !== 'SERVICE_AUTH'
-                ? vm.sizeForm.applicantName + '申请访问资源:'
-                : vm.sizeForm.applyId + '申请访问服务';
-            vm.sizeForm.flowContent = prefix + approveContent;
+            const visitorName =
+              vm.sizeForm.applyType !== 'SERVICE_AUTH' ? vm.sizeForm.applicantName : vm.sizeForm.applyId;
+            const visitResourceName = approveContent;
+            const resourceObj = { visitorName, visitResourceName };
+            vm.sizeForm.flowContent = JSON.stringify(resourceObj);
             layer.close(layer.dialogIndex);
           },
           close() {