浏览代码

提交审批配置页面

caojunjie 4 年之前
父节点
当前提交
ea03ecce28

+ 16 - 1
src/api/system/auditPaths-add-or-update.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-// 新增财务数据主
+// 提交数据主
 export function addCharge(data) {
   return request({
     url: '/warehouse/paths/add',
@@ -8,3 +8,18 @@ export function addCharge(data) {
     data: data
   })
 }
+// 查询审核人
+export function reviewer() {
+  return request({
+    url: '/system/role/auditGetRolelist',
+    method: 'get',
+  })
+}
+
+//修改主表
+export function modify(fId) {
+  return request({
+    url: '/warehouse/paths/' + fId,
+    method: 'get'
+  })
+}

+ 1 - 1
src/api/system/toConfigure.js

@@ -5,7 +5,7 @@ export function addCharge(data) {
   return request({
     url: '/warehouse/paths/list',
     method: 'get',
-    data: data
+    params: data
   })
 }
 //删除主表

+ 0 - 1
src/views/finance/charge/index.vue

@@ -662,7 +662,6 @@ export default {
     getList() {
       this.loading = true
       this.getDicts("approval_process").then((response) => {
-        console.log(response.data)
         this.options = response.data
       });
       listCharge(this.queryParams_s).then(response => {

+ 1 - 2
src/views/system/role/index.vue

@@ -345,8 +345,7 @@ export default {
     /** 查询角色列表 */
     getList() {
       this.loading = true;
-      listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
-        response => {
+      listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
           this.roleList = response.rows;
           this.total = response.total;
           this.loading = false;

+ 69 - 53
src/views/system/toConfigure/auditPaths-add-or-update.vue

@@ -71,7 +71,7 @@
         align="center"
         label="审核人">
         <template slot-scope="scope">
-          <el-select v-model="scope.row.auditUserId" :disabled="scope.row.iffixAuditUser === 'F'"
+          <el-select v-model="scope.row.auditUserId" v-if="scope.row.iffixAuditUser === 'T'"
                      filterable multiple collapse-tags placeholder="审核人" style="width: 100%">
             <el-option
               v-for="item in optionsUsers"
@@ -80,6 +80,15 @@
               :value="item.userId">
             </el-option>
           </el-select>
+          <el-select v-model="scope.row.auditUserId" v-if="scope.row.iffixAuditUser === 'F'"
+                     filterable multiple collapse-tags placeholder="审核人" style="width: 100%">
+            <el-option
+              v-for="item in optionsUsers_s"
+              :key="item.userId"
+              :label="item.userName"
+              :value="item.userId">
+            </el-option>
+          </el-select>
         </template>
       </el-table-column>
       <el-table-column
@@ -124,20 +133,23 @@
 </template>
 
 <script>
-import { addCharge, delCharge } from '@/api/system/toConfigure'
+import {addCharge,reviewer,modify} from '@/api/system/auditPaths-add-or-update'
+import { queryUserVal } from '@/api/warehouseBusiness/agreement'
+import { listUser } from '@/api/system/user'
 
   export default {
     data () {
       return {
         dataForm: {
-          status: 'A'
+          status: 'A',
         },
         visible: false,
         dataRule: {},
         dataList: [],
         optionsUsers: [],
+        optionsUsers_s:[],
         optionsiffixAudit: [{
-          id: 'S',
+          id: 'T',
           name: '是'
         }, {
           id: 'F',
@@ -164,54 +176,61 @@ import { addCharge, delCharge } from '@/api/system/toConfigure'
         this.optionsUsers = []
         this.visible = true
         if (typeof val !== 'undefined') {
+          console.log(val)
           this.queryAuditPath(val)
+          this.queryUsers()
         } else {
           this.queryUsers()
         }
       },
       queryUsers () {
-        this.$http({
-          url: this.$http.adornUrl('/sys/user/selectUser'),
-          method: 'post',
-          data: ({mobile: 'auditUser'})
-        }).then(({data}) => {
-          if (typeof data.list !== 'undefined' && data.list !== null) {
-            if (typeof data.list.users !== 'undefined' && data.list.users !== null) {
-              this.optionsUsers = data.list.users
-            }
-          }
+        queryUserVal().then((response)=>{
+          // this.contrastList.createBy = response.user.userName
+          // this.dataForm.opUserName = response.user.userName
+          console.log(response)
+          this.$set(this.dataForm, "opUserName", response.user.userName);
+          this.$set(this.dataForm, "opDate", response.date.slice(0,10));
+        })
+        console.log(this.dataForm)
+        //请求所有审核人角色
+        reviewer().then(data =>{
+          this.optionsUsers = data
+          console.log(data)
+        })
+        //请求所有用户名
+        listUser().then(response => {
+          this.optionsUsers_s = response.rows
+          console.log(response.rows)
         })
+        // this.$http({
+        //   url: this.$http.adornUrl('/sys/user/selectUser'),
+        //   method: 'post',
+        //   data: ({mobile: 'auditUser'})
+        // }).then(({data}) => {
+        //   if (typeof data.list !== 'undefined' && data.list !== null) {
+        //     if (typeof data.list.users !== 'undefined' && data.list.users !== null) {
+        //       this.optionsUsers = data.list.users
+        //     }
+        //   }
+        // })
       },
       queryAuditPath (val) {
-        this.$http({
-          url: this.$http.adornUrl('/engineering/auditPaths/queryAuditPath'),
-          method: 'post',
-          data: ({id: val})
-        }).then(({data}) => {
-          if (typeof data.list !== 'undefined' && data.list !== null) {
-            if (typeof data.list.users !== 'undefined' && data.list.users !== null) {
-              this.optionsUsers = data.list.users
-            }
-            if (typeof data.list.audit !== 'undefined' && data.list.audit !== null) {
-              this.dataForm = data.list.audit
-            }
-            if (typeof data.list.auditPathsLevels !== 'undefined' && data.list.auditPathsLevels !== null) {
-              this.dataList = data.list.auditPathsLevels
-              if (typeof data.list.auditUserIds !== 'undefined' && data.list.auditUserIds !== null) {
-                for (let use in data.list.auditUserIds) {
-                  this.$set(this.dataList[use], 'auditUserId', data.list.auditUserIds[use])
-                }
-              }
-            }
+        modify(val).then(res => {
+          console.log(res)
+          let data = res.data.data
+          this.dataForm = data.auditPaths
+          this.dataList = data.auditPathsLevels
+          for (let index in this.dataList){
+            this.dataList[index].auditUserId = data.auditUserIds[index]
           }
         })
       },
       addRow () {
         let val = {
           levelName: null,
-          auditUserId: null,
-          auditUserName: null,
-          iffixAuditUser: 'S',
+          auditUserId: [],
+          // auditUserName: null,
+          iffixAuditUser: 'T',
           iffinalItem: 'T',
           remarks: null
         }
@@ -221,13 +240,12 @@ import { addCharge, delCharge } from '@/api/system/toConfigure'
         rows.splice(index, 1)
       },
       changeIffixAudit (row) {
-        if (row.iffixAuditUser === 'F') {
-          row.auditUserId = null
-          row.auditUserName = null
-        }
+        row.auditUserId = []
       },
       // 表单提交
       dataFormSubmit () {
+        console.log(this.dataForm)
+        console.log(this.dataList)
         if (this.dataList.length === 0) {
           this.$message.error('请维护审批级次')
           return false
@@ -240,25 +258,23 @@ import { addCharge, delCharge } from '@/api/system/toConfigure'
             }
           }
         }
+        let formData = new FormData()
+        formData.append('auditPaths', JSON.stringify(this.dataForm))
+        formData.append('auditPathsLevels', JSON.stringify(this.dataList))
         this.$confirm(`是否提交?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(function() {
-          let formData = new FormData()
-          formData.append('auditPaths', JSON.stringify(this.dataForm))
-          formData.append('auditPathsLevels', JSON.stringify(this.dataList))
-          return delCharge(formData)
-        }).then(() => {
-            if (data && data.code === 0) {
+          return addCharge(formData)
+        }).then((data) => {
+          console.log(data)
+            if (data && data.code === 200) {
               this.$message({
                 message: '操作成功',
-                type: 'success',
-                duration: 600,
-                onClose: () => {
-                  this.closeDia()
-                }
-              })
+                type: 'success'
+              });
+              this.closeDia()
             } else {
               this.$message.error(data.msg)
             }

+ 47 - 30
src/views/system/toConfigure/index.vue

@@ -1,18 +1,28 @@
 <template>
-  <div class="mod-auditPaths">
+  <div class="app-container">
     <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
-      <el-form-item>
-        <el-input v-model="dataForm.pathName" placeholder="审核路径名称" clearable style="width: 138PX;"></el-input>
+      <el-form-item label="审核路径名" label-width="85px" prop="pathName">
+        <el-input v-model="dataForm.pathName"></el-input>
       </el-form-item>
-      <el-form-item style="float: right">
-        <el-button icon="el-icon-search" @click="getDataList()">查询</el-button>
-        <el-button icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
-        <el-button type="primary" @click="addOrUpdateHandle()">
-          新增
-        </el-button>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="getDataList">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery_s">重置</el-button>
       </el-form-item>
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="mini"
+            @click="addOrUpdateHandle()"
+            v-hasPermi="['finance:charge:add']"
+          >新增
+          </el-button>
+        </el-col>
+        <right-toolbar @queryTable="getDataList"></right-toolbar>
+      </el-row>
     </el-form>
-    <el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
+    <el-table :data="dataList" v-loading="dataListLoading" style="width: 100%;">
       <el-table-column
         header-align="center"
         align="center"
@@ -42,13 +52,6 @@
         label="维护时间">
       </el-table-column>
       <el-table-column
-        prop="branName"
-        header-align="center"
-        align="center"
-        width="180"
-        label="公司名称">
-      </el-table-column>
-      <el-table-column
         prop="status"
         header-align="center"
         align="center"
@@ -83,15 +86,13 @@
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChangeHandle"
-      @current-change="currentChangeHandle"
-      :current-page="dataForm.current"
-      :page-sizes="[10, 20, 50, 100]"
-      :page-size="dataForm.size"
-      :total="totalPage"
-      layout="total, sizes, prev, pager, next, jumper">
-    </el-pagination>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="dataForm.pageNum"
+      :limit.sync="dataForm.pageSize"
+      @pagination="getDataList"
+    />
     <!-- 弹窗, 新增 / 修改 -->
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" :dataForm="editModel"></add-or-update>
   </div>
@@ -113,9 +114,10 @@ export default {
         opDate: null,
         status: 'A',
         remarks: null,
-        current: 1,
-        size: 10
+        pageNum: 1,
+        pageSize: 10
       },
+      total:0,
       editModel: {},
       dataList: [],
       totalPage: 0,
@@ -137,10 +139,24 @@ export default {
     this.getDataList()
   },
   methods: {
+    resetQuery_s(){
+      this.dataForm = {
+        pathId: null,
+          pathName: null,
+          opUserId: null,
+          opUserName: null,
+          opDate: null,
+          status: 'A',
+          remarks: null,
+          pageNum: 1,
+          pageSize: 10
+      }
+    },
     // 获取数据列表
     getDataList () {
       this.dataListLoading = true
       addCharge(this.dataForm).then(data => {
+        this.total = data.total
         console.log(data)
         if (typeof data.rows !== 'undefined' && data.rows !== null) {
           this.dataList = data.rows
@@ -186,9 +202,10 @@ export default {
         type: 'warning'
       }).then(function() {
         return delCharge(id)
-      }).then(() => {
-        this.getList()
+      }).then((res) => {
+        console.log(res)
         this.msgSuccess('删除成功')
+        this.getDataList()
       })
 
       // this.$confirm(`确定进行删除操作?`, '提示', {

+ 2 - 0
src/views/system/user/index.vue

@@ -469,7 +469,9 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
+      console.log(this.addDateRange)
       listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        console.log(response)
           this.userList = response.rows;
           this.total = response.total;
           this.loading = false;