Bläddra i källkod

花名册调整

lizhenhao 2 år sedan
förälder
incheckning
7ed3729101

+ 6 - 0
src/api/sys/OfficeService.js

@@ -47,4 +47,10 @@ export default class OfficeService {
       params: params
     })
   }
+  getAllCompany () {
+    return request({
+      url: '/sys/office/get_all_company',
+      method: 'get'
+    })
+  }
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 757 - 122
src/views/modules/roster/RosterForm.vue


+ 23 - 16
src/views/modules/roster/RosterList.vue

@@ -52,29 +52,35 @@
           :checkbox-config="{}">
           <vxe-column type="seq" width="60" title="序号"></vxe-column>
           <vxe-column type="checkbox"  width="40px"></vxe-column>
-          <vxe-column title="姓名" field="name">
+          <vxe-column title="姓名" field="name" min-width="150px" align="center">
             <template slot-scope="scope">
-              <el-link  type="primary" :underline="false" v-if="hasPermission('roster:base:view')"  @click="view(scope.row.id)">{{scope.row.name}}</el-link>
+              <el-link  type="primary" :underline="false" v-if="hasPermission('roster:base:view')"  @click="view(scope.row)">{{scope.row.name}}</el-link>
               <span v-else>{{scope.row.name}}</span>
             </template>
           </vxe-column>
-          <vxe-column width="200px"  title="证件号" field="idCard" > </vxe-column>
-          <vxe-column width="200px"  title="员工类型" field="workerType" >
+          <vxe-column min-width="150px"  title="电话号码" field="mobile" align="center"> </vxe-column>
+          <vxe-column min-width="150px"  title="证件号" field="idCard" align="center"> </vxe-column>
+          <vxe-column min-width="150px"  title="人员类型" field="personType" align="center">
+            <template slot-scope="scope">
+              <span> {{$dictUtils.getDictLabel("roster_person_type", scope.row.personType)}} </span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="150px"  title="员工类型" field="workerType" align="center">
             <template slot-scope="scope">
               <span> {{$dictUtils.getDictLabel("worker_type", scope.row.workerType)}} </span>
             </template>
           </vxe-column>
-          <vxe-column width="200px"  title="入职日期" field="onboardingDate" >
+          <vxe-column min-width="150px"  title="入职日期" field="onboardingDate" align="center">
               <template slot-scope="scope">
-                {{ moment(scope.row.onboardingDate).format('YYYY-MM-DD')}}
+                {{ commonJS.isEmpty(scope.row.onboardingDate) ? '' : moment(scope.row.onboardingDate).format('YYYY-MM-DD')}}
               </template>
           </vxe-column>
 
-          <vxe-column title="操作" width="200px" fixed="right" align="center">
+          <vxe-column title="操作" width="120px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('roster:base:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
-              <el-button v-if="hasPermission('roster:base:edit')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
-              <el-button v-if="hasPermission('roster:base:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+<!--              <el-button v-if="hasPermission('roster:base:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row)">查看</el-button>-->
+              <el-button v-if="hasPermission('roster:base:edit')" type="text"  size="small" @click="edit(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('roster:base:del')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -165,22 +171,22 @@
         this.$refs.rosterForm.init('add', '')
       },
       // 修改
-      edit (id) {
-        id = id || this.$refs.rosterTable.getCheckboxRecords().map(item => {
+      edit (row) {
+        row.id = row.id || this.$refs.rosterTable.getCheckboxRecords().map(item => {
           return item.id
         })[0]
-        this.$refs.rosterForm.init('edit', id)
+        this.$refs.rosterForm.init('edit', row.id, row.personType)
       },
       // 查看
-      view (id) {
-        this.$refs.rosterForm.init('view', id)
+      view (row) {
+        this.$refs.rosterForm.init('view', row.id, row.personType)
       },
       // 删除
       del (id) {
         let ids = id || this.$refs.rosterTable.getCheckboxRecords().map(item => {
           return item.id
         }).join(',')
-        this.$confirm(`确定删除所选项吗?`, '提示', {
+        this.$confirm(`删除花名册数据时会将关联的用户数据同时删除,确定删除所选项吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
@@ -212,6 +218,7 @@
         this.$dictUtils.getDictList('worker_type').forEach(item => {
           this.workerTypeList.push(item)
         })
+        this.workerTypeList.push({'label': '游客', 'value': '7'})
       },
       showTabs () {
         this.addTabs()

+ 36 - 16
src/views/modules/sys/cert/CertForm.vue

@@ -81,7 +81,8 @@
           @edit-closed=""
           :key="tableKey"
           highlight-current-row
-          :edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true}"
+          :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true}"
+          @edit-actived="editActivedEvent"
         >
           <vxe-table-column field="type"align="center" title="证书类型" :edit-render="{name: '$select', options: $dictUtils.getDictList('sys_cert_type')}">
             <template v-slot:edit="scope">
@@ -125,11 +126,11 @@
               <el-input v-model="scope.row.enrollCertNo" ></el-input>
             </template>
           </vxe-table-column>
-          <vxe-table-column field="profession"align="center" title="专业" :edit-render="{name: '$select'}">
-            <template v-slot:edit="scope">
-              <vxe-select v-model="scope.row.profession" @change="changeProfession" placeholder="请选择专业" clearable style="width: 100%;" transfer>
+          <vxe-table-column field="profession"align="center" title="专业" :formatter="formatLabel" :edit-render="{}">
+            <template #edit="{ row }">
+              <vxe-select v-model="row.profession" @change="changeProfession" placeholder="请选择专业" clearable style="width: 100%;" transfer>
                 <vxe-option
-                  v-for="item in scope.row.professionList"
+                  v-for="item in row.professionList"
                   :key="item.value"
                   :label="item.label"
                   :value="item.label">
@@ -268,17 +269,6 @@ export default {
             if (this.commonJS.isEmpty(this.inputForm.certDTOList)) {
               this.inputForm.certDTOList = []
             }
-            this.inputForm.certDTOList.forEach(item => {
-              if (item.type === '1' || item.type === '2') {
-                item.professionList = this.$dictUtils.getDictList('sys_cert_profession_build')
-              } else if (item.type === '3' || item.type === '4') {
-                item.professionList = this.$dictUtils.getDictList('sys_cert_profession_cost')
-              } else if (item.type === '5') {
-                item.professionList = this.$dictUtils.getDictList('sys_cert_profession_supervision')
-              } else if (item.type === '6') {
-                item.professionList = this.$dictUtils.getDictList('sys_cert_profession_accounting')
-              }
-            })
             this.loading = false
           })
         }
@@ -378,6 +368,36 @@ export default {
     closeViewer () {
       this.url = ''
       this.showViewer = false
+    },
+    // 格式化显示名称
+    // 单元格或行在没有变成可编辑前、单元格或行在编辑状态结束后 都会执行此方法
+    formatLabel ({ cellValue, row }) {
+      if (row.type === '1' || row.type === '2') {
+        row.professionList = this.$dictUtils.getDictList('sys_cert_profession_build')
+      } else if (row.type === '3' || row.type === '4') {
+        row.professionList = this.$dictUtils.getDictList('sys_cert_profession_cost')
+      } else if (row.type === '5') {
+        row.professionList = this.$dictUtils.getDictList('sys_cert_profession_supervision')
+      } else if (row.type === '6') {
+        row.professionList = this.$dictUtils.getDictList('sys_cert_profession_accounting')
+      }
+      if (this.commonJS.isNotEmpty(row.professionList)) {
+        let dict = row.professionList.find(item => item.value === cellValue || item.label === cellValue)
+        if (dict) {
+          row.profession = dict.value
+          return dict.label
+        }
+      }
+      return ''
+    },
+    // 在点击行之后,行数据变为可编辑时,执行此方法
+    editActivedEvent ({row}) {
+      if (this.commonJS.isNotEmpty(row.professionList)) {
+        let dict = row.professionList.find(item => item.value === row.profession || item.label === row.profession)
+        if (dict) {
+          row.profession = dict.label
+        }
+      }
     }
   }
 }

+ 2 - 2
src/views/modules/sys/user/UserForm.vue

@@ -125,8 +125,8 @@
         </el-col>
 
         <el-col :span="12">
-            <el-form-item label="工号" prop="no" :rules="[{required: true, message:'工号不能为空', trigger:'blur'}]">
-              <el-input v-model="inputForm.no" maxlength="50" placeholder=""></el-input>
+            <el-form-item label="工号" prop="no" >
+              <el-input :disabled="true" v-model="inputForm.no" maxlength="50" placeholder="自动生成"></el-input>
             </el-form-item>
         </el-col>
         <el-col :span="12">