qinbai 3 years ago
parent
commit
655aab2eab

+ 16 - 0
src/api/approval/processConfig.js

@@ -33,3 +33,19 @@ export function detailData(params) {
     params: params,
   })
 }
+//业务审批配置列表
+export function getBusinList(params) {
+  return request({
+    url: '/api/blade-check/auditpathsacts/list',
+    method: 'get',
+    params: params,
+  })
+}
+
+export function businModify(data) {
+  return request({
+    url: '/api/blade-check/auditpathsacts/modify',
+    method: 'post',
+    data: data,
+  })
+}

+ 26 - 8
src/views/approval/businessApproval/config/mainList.json

@@ -1,6 +1,6 @@
 {
   "searchShow": true,
-  "searchMenuSpan": 24,
+  "searchMenuSpan": 16,
   "border": true,
   "index": true,
   "viewBtn": false,
@@ -8,7 +8,7 @@
   "delBtn": false,
   "addBtn": false,
   "align": "center",
-  "menuWidth": "120",
+  "menuWidth": 180,
   "showSummary": true,
   "searchIcon": true,
   "searchIndex": 2,
@@ -18,24 +18,42 @@
   "column": [
     {
       "label": "活动名",
-      "prop": "pathName",
+      "prop": "actName",
       "search": true,
       "index": 1,
-      "width": 220,
+      "width": 400,
       "overHidden": true
     },
     {
       "label": "审核条件",
-      "prop": "opUserName",
+      "prop": "reviewConditions",
+      "type":"select",
       "index": 2,
-      "width": 220,
+      "width": 350,
+      "dicData": [
+        {
+          "label": "正常审批",
+          "value":"O"
+        },
+        {
+          "label": "非正常审批",
+          "value": "I"
+        }
+      ],
       "overHidden": true
     },
     {
       "label": "审核路径",
-      "prop": "opDate",
+      "prop": "pathId",
+      "type": "select",
       "index": 3,
-      "width": 300,
+      "slot": true,
+      "dicUrl": "/api/blade-check/auditpaths/list",
+      "props": {
+        "label": "pathName",
+        "value": "id"
+      },
+      "width": 700,
       "overHidden": true
     }
   ]

+ 53 - 16
src/views/approval/businessApproval/index.vue

@@ -12,23 +12,39 @@
                @selection-change="selectionChange"
                @current-change="currentChange"
                @size-change="sizeChange"
+               @row-update="rowUpdate"
                @refresh-change="refreshChange"
                @on-load="onLoad">
       <template slot-scope="scope" slot="menu">
         <el-button
           type="text"
-          icon="el-icon-edit"
           size="small"
-          @click.stop="editOpen(scope.row)"
-        >编辑
+          @click.stop="rowCell(scope.row,scope.index)"
+        >{{ scope.row.$cellEdit ? '保存' : '修改' }}
         </el-button>
       </template>
+      <template slot="pathId" slot-scope="{row,index}">
+        <el-select v-if="row.$cellEdit"
+                    v-model="row.pathId"
+                    size="small"
+                     placeholder="请选择"
+                     clearable
+                     filterable>
+          <el-option v-for="(item,index) in pathIdDic"
+                     :key="index"
+                     :label="item.pathName"
+                     :value="item.id"
+          ></el-option>
+        </el-select>
+        <span v-else>{{ row.pathName }}</span>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
   import option from "./config/mainList.json";
+  import { getList,getBusinList,businModify } from "@/api/approval/processConfig";
 
   export default {
     data() {
@@ -41,6 +57,7 @@
         option: option,
         parentId:0,
         dataList: [],
+        pathIdDic:[],
         page: {
           pageSize: 10,
           pagerCount: 5,
@@ -50,9 +67,12 @@
       }
     },
     created() {
-
+      getList().then(res =>{
+        this.pathIdDic  = res.data.data.records
+      })
     },
     mounted() {
+
     },
 
     methods: {
@@ -67,6 +87,22 @@
       rowDel(row, index, done) {
 
       },
+      rowUpdate(row, index, done) {
+        done(row);
+      },
+      rowCell(row, index) {
+        if(row.$cellEdit){
+          let data = []
+          data.push(row)
+          businModify(data).then(res =>{
+            if(res.data.success){
+              this.$message.success("保存成功!")
+              this.onLoad(this.page, this.search);
+            }
+          })
+        }
+        this.$refs.crud.rowCell(row, index)
+      },
       //点击搜索按钮触发
       searchChange(params, done) {
         this.query = params;
@@ -87,20 +123,21 @@
         console.log('1')
       },
       refreshChange() {
-        console.log('1')
+        this.onLoad(this.page, this.search);
       },
       onLoad(page, params = {}) {
-        // this.loading = true;
-        // if (params.createTime != undefined) {  //合同
-        //   params.createStartDate = params.createTime[0]+ " " + "00:00:00";
-        //   params.createEndDate = params.createTime[1] + " " + "23:59:59";
-        //   this.$delete(params,'createTime')
-        // }
-        // getBillList(page.currentPage, page.pageSize,params).then(res=>{
-        //   this.dataList = res.data.data.records
-        //   this.page.total = res.data.data.total
-        //   this.loading = false;
-        // })
+        this.loading = true;
+        params = {
+          ...params,
+          current: page.currentPage,
+          size: page.pageSize,
+        }
+        getBusinList(params).then(res=>{
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+        }).finally(()=>{
+          this.loading = false;
+        })
       },
       goBack() {
         this.detailData=this.$options.data().detailData