浏览代码

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie 3 年之前
父节点
当前提交
7b9dafcd91

+ 10 - 1
src/api/approval/processConfig.js

@@ -70,7 +70,16 @@ export function getUserApprovalList(params) {
 export function changeApprove(url, data) {
   return request({
     url: url,
+    method: 'post',
+    data: data
+  })
+}
+
+export function userList(params) {
+  return request({
+    url: '/api/blade-user/audit-user-list',
     method: 'get',
-    params: data
+    params
   })
 }
+

+ 1 - 2
src/components/change-approve/main.vue

@@ -88,9 +88,8 @@ export default {
     // 确认修改
     sendHandle() {
       this.$refs["form"].validate(valid => {
-        console.log(this.url)
         if (valid) {
-          changeApprove(this.url, {...this.form, auditId: this.auditId}).then(res => {
+          changeApprove(this.url, {...this.form, id: this.auditId}).then(res => {
             this.closeDialog()
             this.$router.$avueRouter.closeTag();
             this.$router.push({path: `/approveData/index`});

+ 2 - 2
src/page/index/top/top-notice.vue

@@ -20,9 +20,9 @@
       >
       </avue-notice>
     </el-scrollbar>
-    <div slot="reference">
+    <div slot="reference" @click="init">
       <el-badge  :value="badge">
-        <i class="el-icon-bell" @click="init"></i>
+        <i class="el-icon-bell"></i>
       </el-badge>
     </div>
   </el-popover>

+ 18 - 0
src/views/approval/processConfig/config/detail.json

@@ -19,6 +19,7 @@
   "selection": true,
   "menuWidth": 100,
   "dialogClickModal": false,
+  "sortable": true,
   "column":[
     {
       "label": "路径名称",
@@ -39,6 +40,23 @@
       "searchSpan": 8
     },
     {
+      "label": "指定规则",
+      "prop": "userMold",
+      "search": false,
+      "index": 1,
+      "overHidden": true,
+      "slot": true,
+      "searchSpan": 8
+    },
+    {
+      "label": "角色/部门",
+      "prop": "auditMoldId",
+      "multiple": true,
+      "index": 1,
+      "overHidden": true,
+      "searchSpan": 8
+    },
+    {
       "label": "审核人",
       "prop": "auditUserId",
       "search": false,

+ 1 - 0
src/views/approval/processConfig/config/mainList.json

@@ -16,6 +16,7 @@
   "searchLabelWidth": 120,
   "searchSpan": 8,
   "searchMenuPosition": "right",
+
   "column": [
     {
       "label": "审核路径名",

+ 116 - 11
src/views/approval/processConfig/index.vue

@@ -129,14 +129,42 @@
             ></el-option>
           </el-select>
         </template>
+        <template slot="userMold" slot-scope="{ row, index }">
+          <el-select
+            v-model="row.userMold"
+            filterable
+            placeholder="请选择规则"
+            @change="userMoldChange(row)"
+          >
+            <el-option
+              v-for="(item, index) in ruleData"
+              :key="index"
+              :value="item.value"
+              :label="item.label"
+            ></el-option>
+          </el-select>
+        </template>
+        <template slot="auditMoldId" slot-scope="{ row, index }">
+          <el-cascader
+            v-model="row.auditMoldId"
+            :disabled="!row.userMold || row.userMold == 3"
+            :options="row.userMold == 1? roleData: row.userMold == 2? deptData: []"
+            :props="props"
+            collapse-tags
+            clearable
+            filterable
+            @change="auditChange(row)"
+          ></el-cascader>
+        </template>
         <template slot="auditUserId" slot-scope="{row,index}">
           <el-select
             v-model="row.auditUserId"
             filterable
             collapse-tags
+            multiple
             placeholder="审核人"
           >
-            <el-option v-for="(item,index) in auditUserIdDic"
+            <el-option v-for="(item,index) in row.userList"
                        :key="index"
                        :label="item.realName"
                        :value="item.id"
@@ -171,8 +199,14 @@
 <script>
 import option from "./config/mainList.json";
 import detailOption from "./config/detail.json";
-import { getList, modify, removeList, detailData ,getUserList,getUserApprovalList} from "@/api/approval/processConfig";
+import { getList,
+  modify,
+  removeList,
+  detailData ,userList,
+  getUserApprovalList} from "@/api/approval/processConfig";
 import _ from "lodash";
+import {getDeptTree} from "@/api/system/dept";
+import {getRoleTree} from "@/api/system/role";
 
 export default {
   name: "index",
@@ -208,6 +242,21 @@ export default {
         status: 'A',
       },
       dataRule: {},
+      tenantId: null, // 租户
+      // dicData: [],
+      props: {
+        multiple: true,
+        value: 'id',
+        label: 'title',
+        emitPath: false,
+      },
+      roleData: [],
+      deptData: [],
+      ruleData: [
+        {value: 1, label: '角色'},
+        {value: 2, label: '部门'},
+        {value: 3, label: '用户'},
+      ], //指定规则
     }
   },
   created() {
@@ -218,6 +267,14 @@ export default {
       this.auditUserIdDic = res.data.data
     })
 
+    this.tenantId = this.$store.getters.userInfo.tenant_id;
+    getRoleTree(this.tenantId).then(res => {
+      this.roleData = res.data.data;
+    });
+    getDeptTree(this.tenantId).then(res => {
+      this.deptData = res.data.data;
+    });
+
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -253,6 +310,27 @@ export default {
       detailData({id: row.id}).then(res => {
         this.dataForm = res.data.data
         this.detailData = res.data.data.auditPathsLevels
+        this.detailData.map(e => {
+          let params = {};
+          if (e.auditMoldId && e.auditMoldId.length > 0) {
+            if (e.userMold === 1) {
+              this.$set(params, 'roleId', e.auditMoldId)
+            } else if (e.userMold === 2) {
+              this.$set(params, 'deptId', e.auditMoldId)
+            }
+            userList(params).then(response => {
+              this.$set(e, 'userList', response.data.data);
+            })
+          } else {
+            this.$set(e, 'userList', this.auditUserIdDic);
+          }
+          if (e.auditMoldId) {
+            e.auditMoldId = e.auditMoldId.split(',')
+          }
+          if (e.auditUserId) {
+            e.auditUserId = e.auditUserId.split(',')
+          }
+        })
       })
       this.title = '修改';
       this.visible = !this.visible
@@ -304,6 +382,7 @@ export default {
     },
     addDetail() {
       this.detailData.push({
+        userList: this.auditUserIdDic,
         levelName: null,
         auditUserId: [],
         iffixAuditUser: 'T',
@@ -330,18 +409,22 @@ export default {
             return false
           }
         }
-      };
-
-      this.detailData.map(item=>{
+      }
+      let params ={
+        ...this.dataForm,
+        auditPathsLevels: JSON.parse(JSON.stringify(this.detailData))
+      }
+      for (let item of params.auditPathsLevels){
         item.levelId = _.add(item.$index,1)
         delete item.id
-      })
-
-      const params ={
-        ...this.dataForm,
-        auditPathsLevels : this.detailData
+        if (item.auditMoldId) {
+          console.log(item.auditMoldId)
+          item.auditMoldId = item.auditMoldId.join(',');
+        }
+        if (item.auditUserId) {
+          item.auditUserId = item.auditUserId.join(',');
+        }
       }
-
       modify(params).then(res =>{
         if(res.data.success){
           this.$message.success("操作成功!")
@@ -350,6 +433,28 @@ export default {
         }
       })
     },
+    auditChange(row) {
+      let params = {};
+      row.auditUserId = null;
+      if (row.auditMoldId && row.auditMoldId.length > 0) {
+        const data = row.auditMoldId.join(',');
+        if (row.userMold === 1) {
+          this.$set(params, 'roleId', data)
+        } else if (row.userMold === 2) {
+          this.$set(params, 'deptId', data)
+        }
+        userList(params).then(res => {
+          this.$set(row, 'userList', res.data.data);
+        })
+      } else {
+        this.$set(row, 'userList', [])
+      }
+    },
+    userMoldChange(row) {
+      row.auditUserId = null;
+      row.auditMoldId = null;
+      this.$set(row, 'userList', row.userMold == 3? this.auditUserIdDic: []);
+    },
   },
 }
 </script>

+ 1 - 1
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -734,7 +734,7 @@
       ref="changeApprove"
       @closeDialog="closeChangeApprove"
       :auditId="detailData.auditId"
-      url="/api/blade-purchase-sales/order/changeAuditUser"
+      url="/api/blade-check/auditproecess/changeAuditUser"
     />
   </div>
 </template>

+ 2 - 2
src/views/workManagement/purchaseApply/index.vue

@@ -122,7 +122,7 @@ export default {
   },
   activated() {
     if (this.$route.query.check) {
-      this.show = true
+      this.show = true;
       this.detailData = {
         id: this.$route.query.check.billId,
         check: this.$route.query.check,
@@ -234,7 +234,7 @@ export default {
       this.selection = list;
     },
     goBack() {
-      if (this.$route.query) {
+      if (this.$route.query.check) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
           path: "/workManagement/purchaseApply/index"