Przeglądaj źródła

花名册-页面优化

lizhenhao 2 lat temu
rodzic
commit
2cf6a599bd

+ 7 - 0
src/api/roster/RosterService.js

@@ -15,6 +15,13 @@ export default class RosterService {
       params: {id: id}
     })
   }
+  queryAllSupervisor () {
+    return request({
+      url: '/roster/base/queryAllSupervisor',
+      method: 'get',
+      params: {}
+    })
+  }
   save (inputForm) {
     return request({
       url: `/roster/base/save`,

+ 5 - 5
src/views/common/upLoadComponent.vue

@@ -12,7 +12,7 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="info" size="mini" >点击上传</el-button>
+      <el-button type="info" size="mini" :disabled="auth==='view'">点击上传</el-button>
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -33,7 +33,7 @@
         :data="dataListNew"
         :checkbox-config="{}">
         <vxe-column type="seq" width="40"></vxe-column>
-        <vxe-column title="文件名称" field="name">
+        <vxe-column title="文件名称" field="name" align="center">
           <template slot-scope="scope">
             <!--                <div v-if="ifName(scope.row) === true">-->
             <!--                  <el-image-->
@@ -48,12 +48,12 @@
             <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
           </template>
         </vxe-column>
-        <vxe-column title="创建人" field="createBy.name"></vxe-column>
-        <vxe-column title="创建时间" field="createDate"></vxe-column>
+        <vxe-column title="创建人" field="createBy.name" align="center"></vxe-column>
+        <vxe-column title="创建时间" field="createDate" align="center"></vxe-column>
         <vxe-column title="操作" width="200px" fixed="right" align="center">
           <template  slot-scope="scope">
             <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
-            <el-button type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$rowIndex)">删除</el-button>
+            <el-button type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$rowIndex)" :disabled="auth==='view'">删除</el-button>
           </template>
         </vxe-column>
       </vxe-table>

+ 82 - 32
src/views/modules/roster/RosterForm.vue

@@ -312,7 +312,14 @@
             <el-form-item label="民族" prop="ethnic"
                           :rules="[
                  ]">
-              <el-input v-model="inputForm.ethnic" placeholder="请填写民族"     clearable></el-input>
+              <el-select v-model="inputForm.ethnic" placeholder="请选择民族" style="width:100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('ethnic')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -451,7 +458,7 @@
               <el-input v-model="inputForm.email" placeholder="请填写个人邮箱"     clearable></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="21">
+          <el-col :span="24">
             <el-form-item label="备注" prop="remarks"
                           :rules="[
                  ]">
@@ -801,11 +808,11 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="12">
+            <el-col :span="24">
               <el-form-item label="职位描述" :prop="'rosterWorkDTOList[' + index_work + '].postDescription'"
                             :rules="[
                  ]">
-                <el-input v-model="inputForm.rosterWorkDTOList[index_work].postDescription" placeholder="请填写职位描述"     clearable></el-input>
+                <el-input type="textarea" v-model="inputForm.rosterWorkDTOList[index_work].postDescription" placeholder="请填写职位描述"     clearable></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24" style="text-align: center">
@@ -922,15 +929,14 @@
               <el-form-item label="证书类型" :prop="'rosterCertificateDTOList[' + index_certificate + '].certType'"
                             :rules="[
                  ]">
-                <el-input v-model="inputForm.rosterCertificateDTOList[index_certificate].certType" placeholder="请填写证书类型"     clearable></el-input>
-<!--                <el-select v-model="inputForm.rosterCertificateDTOList[index_certificate].relationship" placeholder="请选择关系"  style="width: 100%;">-->
-<!--                  <el-option-->
-<!--                    v-for="item in $dictUtils.getDictList('family_relationship')"-->
-<!--                    :key="item.value"-->
-<!--                    :label="item.label"-->
-<!--                    :value="item.value">-->
-<!--                  </el-option>-->
-<!--                </el-select>-->
+                <el-select v-model="inputForm.rosterCertificateDTOList[index_certificate].certType" placeholder="请选择证书类型"  style="width: 100%;">
+                  <el-option
+                    v-for="item in $dictUtils.getDictList('cert_type')"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -1013,7 +1019,7 @@
                 <el-input v-model="inputForm.rosterCertificateDTOList[index_certificate].level" placeholder="请填写级别"     clearable></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="12">
+            <el-col :span="24">
               <el-form-item label="描述" :prop="'rosterCertificateDTOList[' + index_certificate + '].description'"
                             :rules="[
                  ]">
@@ -1034,11 +1040,42 @@
             </el-col>
           </el-row>
         </div>
-<!--        附件-->
-        <UpLoadComponent
-          ref="uploadComponent">
-        </UpLoadComponent>
+        <el-divider content-position="left"><i class="el-icon-document"></i> 直属领导</el-divider>
+        <el-row  :gutter="15">
+          <el-col :span="12">
+            <el-form-item label="汇报类型" prop="rosterLeadershipDTO.debriefType"
+                          :rules="[
+                 ]">
+              <el-select v-model="inputForm.rosterLeadershipDTO.debriefType" style="width:100%" placeholder="请选择汇报类型">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('debrief_type')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="汇报对象" prop="rosterLeadershipDTO.supervisorId"
+                          :rules="[
+                 ]">
+              <el-select v-model="inputForm.rosterLeadershipDTO.supervisorId" style="width:100%" placeholder="请选择汇报对象">
+                <el-option
+                  v-for="item in supervisorList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
+      <!--        附件-->
+      <UpLoadComponent
+        ref="uploadComponent">
+      </UpLoadComponent>
       <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="[url]" :zIndex=9999></el-image-viewer>
       <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
@@ -1125,15 +1162,22 @@
           rosterCertificateDTOList: [],
           rosterFilesDTOList: [],
           headshot: '',
-          headshotLsUrl: ''
+          headshotLsUrl: '',
+          rosterLeadershipDTO: {
+            baseId: '',
+            debriefType: '',
+            supervisorId: ''
+          }
         },
         jobPositionList: [],
         positionList: [],
         rankList: [],
+        supervisorList: [],
         showViewer: false,
         url: '',
         rules: {
-          idCard: [{required: true, message: '证件号不能为空', trigger: 'blur'},
+          idCard: [
+            {required: true, message: '证件号不能为空', trigger: 'blur'},
             {validator: checkIdCard, trigger: 'change'},
             {validator: checkIdCard, trigger: 'blur'}
           ],
@@ -1197,6 +1241,7 @@
     methods: {
       init (method, id) {
         this.queryAllPosition()
+        this.queryAllSupervisor()
         this.method = method
         this.inputForm = {
           name: '',
@@ -1256,7 +1301,12 @@
           rosterCertificateDTOList: [],
           rosterFilesDTOList: [],
           headshot: '',
-          headshotLsUrl: ''
+          headshotLsUrl: '',
+          rosterLeadershipDTO: {
+            baseId: '',
+            debriefType: '',
+            supervisorId: ''
+          }
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -1316,6 +1366,11 @@
           this.positionList = JSON.parse(JSON.stringify(data))
         })
       },
+      queryAllSupervisor () {
+        this.rosterService.queryAllSupervisor().then(({data}) => {
+          this.supervisorList = JSON.parse(JSON.stringify(data))
+        })
+      },
       getJobPositionByOff () {
         const id = this.inputForm.officeId
         if (id !== null && id !== undefined && id !== '') {
@@ -1438,14 +1493,6 @@
           }
           this.inputForm.rosterCertificateDTOList.push(certificate)
         }
-        if (val === 'files') {
-          const files = {
-            id: '',
-            baseId: '',
-            url: ''
-          }
-          this.inputForm.rosterFilesDTOList.push(files)
-        }
       },
       delRow (index, val) {
         if (val === 'bank') {
@@ -1463,9 +1510,6 @@
         if (val === 'certificate') {
           this.inputForm.rosterCertificateDTOList.splice(index, 1)
         }
-        if (val === 'files') {
-          this.inputForm.rosterFilesDTOList.splice(index, 1)
-        }
       },
       handleAvatarSuccess (res, file, fileList, index, val) {
         if (val === 'head') {
@@ -1558,8 +1602,14 @@
                 this.inputForm.sex = info.sex
                 callback()
               }
+            } else {
+              callback()
             }
+          } else {
+            callback()
           }
+        } else {
+          callback()
         }
       }
     }

+ 4 - 1
src/views/modules/roster/RosterList.vue

@@ -5,6 +5,9 @@
       <el-form-item prop="name">
         <el-input size="small" v-model="searchForm.name" placeholder="姓名" clearable></el-input>
       </el-form-item>
+      <el-form-item prop="idCard">
+        <el-input size="small" v-model="searchForm.idCard" placeholder="证件号" clearable></el-input>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
         <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
@@ -22,7 +25,7 @@
       <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane :key="index" v-for="(item,index) in workerTypeList" :label="item.label" :name="item.label" :value="item.value"></el-tab-pane>
       </el-tabs>
-      <div style="height: calc(100% - 80px);">
+      <div style="height: calc(100% - 140px);">
         <vxe-table
           border="inner"
           auto-resize