Browse Source

客户登记修改

lizhenhao 2 years atrás
parent
commit
7f4f5d6ca6

+ 15 - 4
src/views/modules/cw/workClientInfo/WorkClientList.vue

@@ -148,9 +148,9 @@
           </vxe-column>
           <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text" icon="el-icon-edit" size="small" @click="push(scope.row)">修改</el-button>
-              <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.status==='2'" type="text" icon="el-icon-edit" size="small" @click="reback(scope.row)">撤回</el-button>
-              <el-button v-if="hasPermission('cw_work_client:info:del')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('cw_work_client:info:edit')&&(scope.row.createBy.id === $store.state.user.id || isAdmin)&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text" icon="el-icon-edit" size="small" @click="push(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('cw_work_client:info:edit')&&(scope.row.createBy.id === $store.state.user.id || isAdmin)&&scope.row.status==='2'" type="text" icon="el-icon-edit" size="small" @click="reback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('cw_work_client:info:del')&&(scope.row.createBy.id === $store.state.user.id || isAdmin)&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -176,6 +176,7 @@
   import ProcessService from '@/api/flowable/ProcessService'
   import WorkClientForm from './WorkClientForm'
   import pick from 'lodash.pick'
+  import UserService from '@/api/sys/UserService'
   export default {
     data () {
       return {
@@ -201,16 +202,19 @@
         tableKey: '',
         loading: false,
         processDefinitionAuditId: '',
-        procDefAuditKey: ''
+        procDefAuditKey: '',
+        isAdmin: false
       }
     },
     workClientService: null,
     taskService: null,
     processService: null,
+    userService: null,
     created () {
       this.workClientService = new WorkClientService()
       this.taskService = new TaskService()
       this.processService = new ProcessService()
+      this.userService = new UserService()
     },
     components: {
       WorkClientForm
@@ -246,6 +250,12 @@
       view (id) {
         this.$refs.workClientForm.init('view', id)
       },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
       // 获取数据列表
       refreshList () {
         this.loading = true
@@ -260,6 +270,7 @@
           this.tableKey = Math.random()
           this.loading = false
         })
+        this.checkIsAdmin()
         this.processService.getByName('财务-客户登记').then(({data}) => {
           if (!this.commonJS.isEmpty(data.id)) {
             this.processDefinitionAuditId = data.id

+ 20 - 8
src/views/modules/cw/workClientInfo/WorkClientListForm.vue

@@ -15,7 +15,9 @@
           <el-form-item label="客户姓名" prop="name">
             <el-input size="small" v-model="searchForm.name" placeholder="请输入客户姓名" clearable></el-input>
           </el-form-item>
-
+          <el-form-item label="客户编号" prop="no">
+            <el-input size="small" v-model="searchForm.no" placeholder="请输入客户编号" clearable></el-input>
+          </el-form-item>
           <el-form-item>
             <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
             <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
@@ -38,14 +40,23 @@
           @sort-change=""
           :sort-config="{remote:true}"
           :data="dataList"
-          :checkbox-config="{}">
+          :row-config="{isCurrent: true}"
+          :checkbox-config="{trigger: 'row'}">
           <vxe-column type="seq" width="40"></vxe-column>
           <vxe-column type="checkbox" width="40px"></vxe-column>
-          <vxe-column width="" title="客户名称" field="name"></vxe-column>
-          <vxe-column width="" title="客户编号" field="no"></vxe-column>
-          <vxe-column width="" title="客户类型" field="type"></vxe-column>
-          <vxe-column width="" title="所属行业" field="industry"></vxe-column>
-          <vxe-column width="" title="公司级次" field="companyLevel"></vxe-column>
+          <vxe-column width="" title="客户名称" align="center" field="name"></vxe-column>
+          <vxe-column width="" title="客户编号" align="center" field="no"></vxe-column>
+          <vxe-column width="" title="客户类型" align="center" field="type">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel('cw_work_client_type', scope.row.type, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column width="" title="所属行业" align="center" field="industry">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel('cw_work_client_industry', scope.row.industry, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column width="" title="公司级次" align="center" field="companyLevel"></vxe-column>
         </vxe-table>
         <vxe-pager
           background
@@ -85,7 +96,8 @@
         },
         dataList: [],
         searchForm: {
-          name: ''
+          name: '',
+          no: ''
         }
       }
     },