Browse Source

人员档案调整

cyy 1 tháng trước cách đây
mục cha
commit
05fba00a4f

+ 14 - 5
src/views/component/personnelFile/components/dialogDeltail.vue

@@ -16,13 +16,18 @@
     :show-close="false"
     append-to-body
   >
-    <el-row v-for="(item, i) in dialogData" :key="i" :gutter="24">
+    <template v-for="(item, i) in dialogData">
+    <el-row
+      v-if="visibleDialogItems(item).length"
+      :key="'row' + i"
+      :gutter="24"
+    >
       <el-col
-        v-for="(e, t) in item"
-        :key="'item' + t"
-        :span="item.length < 2 ? 24 : 12"
+        v-for="(e, t) in visibleDialogItems(item)"
+        :key="'item' + i + t"
+        :span="visibleDialogItems(item).length < 2 ? 24 : 12"
       >
-        <div class="rowSty" v-if="!e.show">
+        <div class="rowSty">
           <div class="nameSty">{{ e.name }}</div>
           <div v-if="e.type === 'text'" class="contant">{{ e.contant}}</div>
           <div
@@ -75,6 +80,7 @@
         </div>
       </el-col>
     </el-row>
+    </template>
     <span slot="footer" class="dialog-footer">
       <el-button @click="$emit('changeDetails', false)">关 闭</el-button>
     </span>
@@ -126,6 +132,9 @@ export default {
     }
   },
   methods: {
+    visibleDialogItems(item) {
+      return (item || []).filter((e) => !e.show)
+    },
     treatment(val, data) {
       switch (val) {
         case 'panduandefen':

+ 2 - 2
src/views/component/personnelFile/components/jbqkTag.vue

@@ -187,7 +187,7 @@
           </div>
         </div>
         <div class="colSty">
-          <div class="grid-content bg-purple">本单位入职日期</div>
+          <div class="grid-content bg-purple">入职日期</div>
         </div>
         <div class="colSty">
           <div v-if="judgeTag()" class="grid-content bg-purple-light">
@@ -204,7 +204,7 @@
               <el-date-picker
                 v-model="nowData.ruZhiShiJian"
                 type="date"
-                placeholder="本单位入职日期"
+                placeholder="入职日期"
                 value-format="yyyy-MM-dd"
               />
             </el-form-item>

+ 56 - 7
src/views/component/personnelFile/components/publicList.vue

@@ -20,7 +20,7 @@
         <el-table-column type="selection" min-width="2%" />
         <el-table-column type="index" label="序号" min-width="5%" />
         <el-table-column
-          v-for="(item, i) in planeData.config.config"
+          v-for="(item, i) in tableColumns"
           :key="tabName + i"
           :label="item.label"
           :min-width="item.width"
@@ -226,11 +226,20 @@ export default {
       }
     }
   },
+  computed: {
+    tableColumns() {
+      const list =
+        (this.planeData &&
+          this.planeData.config &&
+          this.planeData.config.config) ||
+        []
+      return list.filter((item) => !item.hidden)
+    }
+  },
   watch: {
     planeData: {
       handler: function (val, oldVal) {
-        // eslint-disable-next-line no-undef
-        this.nowData = structuredClone(val.data || [])
+        this.nowData = this.cloneListData(val)
         this.nowDataObj = { nowData: [...this.nowData] }
       },
       deep: true,
@@ -239,8 +248,7 @@ export default {
     btnType: {
       handler: function (val, oldVal) {
         if (val === 'exitEdit') {
-          // eslint-disable-next-line no-undef
-          this.nowData = structuredClone(this.planeData.data || [])
+          this.nowData = this.cloneListData(this.planeData)
           this.nowDataObj = { nowData: [...this.nowData] }
         }
         // else if (val === 'save' || val === 'temporaryStorage' || val === 'submit') {
@@ -255,6 +263,47 @@ export default {
     }, 2000)
   },
   methods: {
+    hasFieldValue(val) {
+      return val !== undefined && val !== null && val !== ''
+    },
+    collectConfigFields(config = {}) {
+      const fields = []
+      ;(config.config || []).forEach((item) => fields.push(item))
+      ;(config.dialog || []).forEach((row) => {
+        ;(row || []).forEach((item) => fields.push(item))
+      })
+      return fields
+    },
+    syncFieldAliases(list, config) {
+      const fields = this.collectConfigFields(config)
+      return (list || []).map((row) => {
+        const next = { ...row }
+        fields.forEach((item) => {
+          if (!item || !item.field) return
+          const keys = [item.field, ...(item.aliases || [])]
+          const val = keys
+            .map((k) => next[k])
+            .find((v) => this.hasFieldValue(v))
+          if (!this.hasFieldValue(val)) return
+          keys.forEach((k) => {
+            if (!this.hasFieldValue(next[k])) {
+              next[k] = val
+            }
+          })
+        })
+        return next
+      })
+    },
+    cloneListData(val) {
+      const list = structuredClone((val && val.data) || [])
+      return this.syncFieldAliases(list, (val && val.config) || {})
+    },
+    getFieldValue(row, item) {
+      if (!row || !item || !item.field) return ''
+      const keys = [item.field, ...(item.aliases || [])]
+      const val = keys.map((k) => row[k]).find((v) => this.hasFieldValue(v))
+      return this.hasFieldValue(val) ? val : row[item.field]
+    },
     inputOnMouseOver(e) {
       const { offsetWidth, scrollWidth } = e.target || {}
       this.isShowTooltip = offsetWidth < scrollWidth
@@ -275,11 +324,11 @@ export default {
       this.dialogData.forEach((item, i) => {
         if (item.length > 1) {
           item.forEach((it) => {
-            it.contant = val[it.field]
+            it.contant = this.getFieldValue(val, it)
             it.allData = val
           })
         } else {
-          item[0].contant = val[item[0].field]
+          item[0].contant = this.getFieldValue(val, item[0])
           item[0].allData = val
         }
       })

+ 1 - 1
src/views/component/personnelFile/components/zsbTag.vue

@@ -84,7 +84,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="证件号" min-width="15%">
+        <el-table-column label="证书号" min-width="15%">
           <template slot-scope="scope">
             <div v-if="judgeTag()">
               <el-tooltip

+ 2 - 2
src/views/component/personnelFile/constants/option.js

@@ -109,7 +109,7 @@ export const fieldLabelMaps = {
     yuanBiYeYuanXi: '毕业院校',
     xianCongShiZhua: '专业',
     canJiaGongZuo: '参加工作时间',
-    ruZhiShiJian: '本单位入职日期',
+    ruZhiShiJian: '入职日期',
     renZhiShiJian: '本岗位任职时间',
     xingZhengZhiWu: '职务',
     zhiChengDengJi: '职称等级',
@@ -141,7 +141,7 @@ export const fieldLabelMaps = {
   },
   zsb: {
     zhengShuMingC: '证书名称',
-    zhengJianHao: '证件号',
+    zhengJianHao: '证书号',
     faZhengDanWei: '发证单位',
     faZhengShiJian: '发证日期',
     dangAnBaoCun: '档案保存',

+ 60 - 10
src/views/component/personnelFile/constants/simulated.js

@@ -476,7 +476,16 @@ export const correlationConfig = {
         label: '岗位类型',
         width: '10%',
         type: 'text',
-        field: 'gang_wei_lei_xing'
+        field: 'gang_wei_lei_xing',
+        hidden: true
+      },
+      {
+        label: '岗位',
+        width: '10%',
+        type: 'dialog',
+        field: 'bu_men_fen_zu_',
+        aliases: ['buMenFenZu'],
+        dialogKey: 'gwzzpzrypgzy'
       },
       {
         label: '评估时间',
@@ -504,7 +513,19 @@ export const correlationConfig = {
         { name: '总分', field: 'zong_fen_', type: 'text' }
       ],
       [
-        { name: '岗位类型', field: 'gang_wei_lei_xing', type: 'text' },
+        {
+          name: '岗位类型',
+          field: 'gang_wei_lei_xing',
+          type: 'text',
+          show: 'N'
+        },
+        {
+          name: '岗位',
+          field: 'bu_men_fen_zu_',
+          aliases: ['buMenFenZu'],
+          type: 'dialog',
+          dialogKey: 'gwzzpzrypgzy'
+        },
         { name: '评估结果', field: 'kao_he_jie_guo_', type: 'text' }
       ],
       [{ name: '附件', field: 'shang_chuan_fu_ji', type: 'file' }],
@@ -637,11 +658,18 @@ export const correlationConfig = {
         field: 'jian_yan_zhuan_ye'
       },
       {
-        label: '能力评估结果',
+        label: '评估结果',
         width: '10%',
         type: 'text',
         field: 'kao_he_jie_guo_'
       },
+      {
+        label: '评估日期',
+        width: '10%',
+        type: 'text',
+        field: 'bian_zhi_shi_jian',
+        aliases: ['bianZhiShiJian']
+      },
       { label: '附件', width: '12%', type: 'file', field: 'shang_chuan_fu_ji' },
       { label: '表单', width: '12%', type: 'file', field: 'kuai_zhao_' }
     ],
@@ -653,7 +681,15 @@ export const correlationConfig = {
           type: 'dialog',
           dialogKey: 'sbwxdhk'
         },
-        { name: '能力评估结果', field: 'kao_he_jie_guo_', type: 'text' }
+        { name: '评估结果', field: 'kao_he_jie_guo_', type: 'text' }
+      ],
+      [
+        {
+          name: '评估日期',
+          field: 'bian_zhi_shi_jian',
+          aliases: ['bianZhiShiJian'],
+          type: 'text'
+        }
       ],
       [
         {
@@ -744,10 +780,17 @@ export const correlationConfig = {
     config: [
       {
         label: '培训主题',
-        width: '23%',
+        width: '18%',
         type: 'text',
         field: 'pei_xun_nei_rong_'
       },
+      {
+        label: '培训目的',
+        width: '15%',
+        type: 'text',
+        field: 'pei_xun_mu_di_',
+        aliases: ['peiXunMuDi']
+      },
       {
         label: '开始时间',
         width: '10%',
@@ -771,7 +814,12 @@ export const correlationConfig = {
     ],
     dialog: [
       [{ name: '培训主题', field: 'pei_xun_nei_rong_', type: 'text' }],
-      [{ name: '培训目的', field: 'pei_xun_mu_di_', type: 'text' }],
+      [{
+        name: '培训目的',
+        field: 'pei_xun_mu_di_',
+        aliases: ['peiXunMuDi'],
+        type: 'text'
+      }],
       [
         { name: '开始时间', field: 'pei_xun_kai_shi_s', type: 'text' },
         { name: '结束时间', field: 'pei_xun_jie_shu_s', type: 'text' }
@@ -803,12 +851,13 @@ export const correlationConfig = {
   kaoshijilu: {
     config: [
       { label: '考试名称', width: '15%', type: 'text', field: 'examName' },
+      { label: '考试类别', width: '10%', type: 'text', field: 'examType' },
       { label: '考试题库', width: '15%', type: 'text', field: 'bankName' },
       { label: '题库类型', width: '15%', type: 'text', field: 'bankType' },
       { label: '考试题数', width: '10%', type: 'text', field: 'questionCount' },
       { label: '考试总分', width: '10%', type: 'text', field: 'totalScore' },
       {
-        label: '得分',
+        label: '考试得分',
         width: '10%',
         type: 'secondaryTreatment',
         field: 'panduandefen'
@@ -819,7 +868,7 @@ export const correlationConfig = {
         type: 'secondaryTreatment',
         field: 'panduanexamDesc'
       },
-      { label: '开始时间', width: '15%', type: 'text', field: 'startDate' },
+      { label: '考试开始时间', width: '15%', type: 'text', field: 'startDate' },
       {
         label: '参考次数',
         width: '10%',
@@ -849,9 +898,10 @@ export const correlationConfig = {
           type: 'secondaryTreatment'
         }
       ],
+      [{ name: '考试类别', field: 'examType', type: 'text' }],
       [
         { name: '考试题库', field: 'bankName', type: 'text' },
-        { name: '开始时间', field: 'startDate', type: 'text' }
+        { name: '考试开始时间', field: 'startDate', type: 'text' }
       ],
       [
         { name: '题库类型', field: 'bankType', type: 'text' },
@@ -866,7 +916,7 @@ export const correlationConfig = {
         { name: '达标分值占比', field: 'qualifiedRadio', type: 'text' }
       ],
       [
-        { name: '得分', field: 'panduandefen', type: 'secondaryTreatment' },
+        { name: '考试得分', field: 'panduandefen', type: 'secondaryTreatment' },
         { name: '计分方式', field: 'scoringType', type: 'text' }
       ]
     ]