Bläddra i källkod

人员档案增加详细提示

cyy 2 veckor sedan
förälder
incheckning
41f73d9b72

+ 10 - 3
src/views/component/personnelFile/components/gzjlTag.vue

@@ -337,7 +337,10 @@
 </template>
 </template>
 <script>
 <script>
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
-import option from '../constants/option.js'
+import option, {
+  fieldLabelMaps,
+  getInvalidFieldTips
+} from '../constants/option.js'
 export default {
 export default {
   components: {
   components: {
     IbpsAttachment
     IbpsAttachment
@@ -457,14 +460,18 @@ export default {
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         return
         return
       }
       }
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate((valid, invalidFields) => {
         if (valid) {
         if (valid) {
           this.$emit('changeBaseData', val, 'gzjl')
           this.$emit('changeBaseData', val, 'gzjl')
           // alert('submit!')
           // alert('submit!')
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         } else {
         } else {
           console.log('error submit!!')
           console.log('error submit!!')
-          this.$emit('tipsShowTab', true)
+          const fields = getInvalidFieldTips(
+            invalidFields,
+            fieldLabelMaps.gzjl
+          )
+          this.$emit('tipsShowTab', true, '工作经历', fields)
           return false
           return false
         }
         }
       })
       })

+ 10 - 3
src/views/component/personnelFile/components/jbqkTag.vue

@@ -457,7 +457,10 @@
 </template>
 </template>
 <script>
 <script>
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
-import option from '../constants/option.js'
+import option, {
+  fieldLabelMaps,
+  getInvalidFieldTips
+} from '../constants/option.js'
 
 
 export default {
 export default {
   components: {
   components: {
@@ -704,12 +707,16 @@ export default {
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         return
         return
       }
       }
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate((valid, invalidFields) => {
         if (valid) {
         if (valid) {
           this.$emit('changeBaseData', val, 'ryjbqk')
           this.$emit('changeBaseData', val, 'ryjbqk')
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         } else {
         } else {
-          this.$emit('tipsShowTab', true)
+          const fields = getInvalidFieldTips(
+            invalidFields,
+            fieldLabelMaps.ryjbqk
+          )
+          this.$emit('tipsShowTab', true, '基本情况', fields)
           return false
           return false
         }
         }
       })
       })

+ 10 - 3
src/views/component/personnelFile/components/jyjlTag.vue

@@ -300,7 +300,10 @@
 </template>
 </template>
 <script>
 <script>
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
-import option from '../constants/option.js'
+import option, {
+  fieldLabelMaps,
+  getInvalidFieldTips
+} from '../constants/option.js'
 export default {
 export default {
   components: {
   components: {
     IbpsAttachment
     IbpsAttachment
@@ -419,14 +422,18 @@ export default {
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         return
         return
       }
       }
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate((valid, invalidFields) => {
         if (valid) {
         if (valid) {
           this.$emit('changeBaseData', val, 'jyjl')
           this.$emit('changeBaseData', val, 'jyjl')
           // alert('submit!')
           // alert('submit!')
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         } else {
         } else {
           console.log('error submit!!')
           console.log('error submit!!')
-          this.$emit('tipsShowTab', true)
+          const fields = getInvalidFieldTips(
+            invalidFields,
+            fieldLabelMaps.jyjl
+          )
+          this.$emit('tipsShowTab', true, '教育经历', fields)
           return false
           return false
         }
         }
       })
       })

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

@@ -678,8 +678,8 @@ export default {
     changeButtonShow(val, name) {
     changeButtonShow(val, name) {
       this.$emit('changeBtnShow', val)
       this.$emit('changeBtnShow', val)
     },
     },
-    tipsShowTab(val, name) {
-      this.$emit('tipsShow', val)
+    tipsShowTab(val, name, fields) {
+      this.$emit('tipsShow', val, name, fields)
     }
     }
   }
   }
 }
 }

+ 10 - 3
src/views/component/personnelFile/components/zsbTag.vue

@@ -297,7 +297,10 @@
 </template>
 </template>
 <script>
 <script>
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
-import option from '../constants/option.js'
+import option, {
+  fieldLabelMaps,
+  getInvalidFieldTips
+} from '../constants/option.js'
 export default {
 export default {
   components: {
   components: {
     IbpsAttachment
     IbpsAttachment
@@ -416,14 +419,18 @@ export default {
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         return
         return
       }
       }
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate((valid, invalidFields) => {
         if (valid) {
         if (valid) {
           this.$emit('changeBaseData', val, 'zsb')
           this.$emit('changeBaseData', val, 'zsb')
           // alert('submit!')
           // alert('submit!')
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
           this.$emit('changeButtonShow', this.$parent.$parent.$parent.btnShow)
         } else {
         } else {
           console.log('error submit!!')
           console.log('error submit!!')
-          this.$emit('tipsShowTab', true)
+          const fields = getInvalidFieldTips(
+            invalidFields,
+            fieldLabelMaps.zsb
+          )
+          this.$emit('tipsShowTab', true, '资格职称证书', fields)
 
 
           return false
           return false
         }
         }

+ 82 - 1
src/views/component/personnelFile/constants/option.js

@@ -99,6 +99,85 @@ export const checkNianLingNull = (rule, value, callback) => {
     callback()
     callback()
   }
   }
 }
 }
+/** 各模块表单字段 prop -> 中文名 */
+export const fieldLabelMaps = {
+  ryjbqk: {
+    jianDangRiQi: '建档日期',
+    chuShengRiQi: '出生日期',
+    nianLing: '年龄',
+    zuiGaoXueLiX: '最高学历学位',
+    yuanBiYeYuanXi: '毕业院校',
+    xianCongShiZhua: '专业',
+    canJiaGongZuo: '参加工作时间',
+    ruZhiShiJian: '本单位入职日期',
+    renZhiShiJian: '本岗位任职时间',
+    xingZhengZhiWu: '职务',
+    zhiChengDengJi: '职称等级',
+    zhiCheng: '职称',
+    shenFenZhengHao: '身份证号',
+    renYuanLeiXing: '人员类型',
+    baoMiXieYi: '保密协议',
+    qianZiTuWen: '签字图文',
+    sheBao: '劳动合同或社保证明',
+    chengNuoHan: '承诺函',
+    fuJian: '附件'
+  },
+  jyjl: {
+    kaiShiShiJian: '开始时间',
+    jieShuShiJian: '结束时间',
+    xueXiao: '学校',
+    zhuanYe: '专业',
+    xueLiXueWei: '学历学位',
+    fuJian: '附件'
+  },
+  gzjl: {
+    ruZhiShiJian: '入职时间',
+    liZhiShiJian: '离职时间',
+    danWeiMingChen: '单位名称',
+    buMen: '部门',
+    zhiWei: '职位',
+    gongZuoNeiRong: '工作内容',
+    fujian: '附件'
+  },
+  zsb: {
+    zhengShuMingC: '证书名称',
+    zhengJianHao: '证件号',
+    faZhengDanWei: '发证单位',
+    faZhengShiJian: '发证日期',
+    dangAnBaoCun: '档案保存',
+    huoJiangZhengS: '获奖证书'
+  }
+}
+
+/**
+ * 从 Element 表单校验失败对象提取可读字段提示
+ * @param {Object} invalidFields validate 回调第二参数
+ * @param {Object} labelMap prop 末段 -> 中文名
+ * @returns {string} 如「建档日期、第2行开始时间」
+ */
+export function getInvalidFieldTips(invalidFields, labelMap = {}) {
+  if (!invalidFields || typeof invalidFields !== 'object') {
+    return ''
+  }
+  const labels = []
+  const seen = new Set()
+  Object.keys(invalidFields).forEach((prop) => {
+    const parts = prop.split('.')
+    const fieldKey = parts[parts.length - 1]
+    let rowIndex = null
+    if (parts.length >= 3 && !Number.isNaN(Number(parts[parts.length - 2]))) {
+      rowIndex = Number(parts[parts.length - 2]) + 1
+    }
+    const label = labelMap[fieldKey] || fieldKey
+    const tip = rowIndex != null ? `第${rowIndex}行${label}` : label
+    if (!seen.has(tip)) {
+      seen.add(tip)
+      labels.push(tip)
+    }
+  })
+  return labels.join('、')
+}
+
 export default {
 export default {
   checkTime,
   checkTime,
   checkLength,
   checkLength,
@@ -108,5 +187,7 @@ export default {
   attachmentsNumOne,
   attachmentsNumOne,
   checkTimeNull,
   checkTimeNull,
   checkNianLingNull,
   checkNianLingNull,
-  checkLengthNull
+  checkLengthNull,
+  fieldLabelMaps,
+  getInvalidFieldTips
 }
 }

+ 12 - 4
src/views/component/personnelFile/index.vue

@@ -218,8 +218,8 @@ export default {
       const key = taskId ? 'getBpmTask' : 'getBpmInst'
       const key = taskId ? 'getBpmTask' : 'getBpmInst'
       const params = taskId ? [this.processKey, taskId] : [instanceId]
       const params = taskId ? [this.processKey, taskId] : [instanceId]
 
 
-      // const sql1 = `select a.CREATE_BY_ from ibps_bpm_inst a join ibps_bpm_task_pendding b on b.proc_inst_id_=a.id_ where b.PROC_DEF_KEY_ = '${processKey}' and b.task_id_ ='${taskId}'`
-      // // const sql1 = `select CREATE_BY_ FROM ibps_bpm_oper_log WHERE PROC_INST_ID_ = (SELECT PROC_INST_ID_ FROM ibps_bpm_bus_rel WHERE BUSINESSKEY_ = "${this.$attrs.params.attrs.id}" LIMIT 1 )AND OPER_TYPE_ IN('start')`
+      // const sql1 = `select a.CREATE_BY_ from ibps_bpm_inst a join ibps_bpm_tasks b on a.id_ = b.PROC_INST_ID_ where b.PROC_DEF_KEY_ = '${processKey}' and b.task_id_ ='${taskId}'`
+
       // const sql2 = `select CREATE_BY_ FROM ibps_bpm_oper_log WHERE PROC_INST_ID_ = '${instanceId}' AND OPER_TYPE_ IN('start') ORDER BY CREATE_TIME_ asc limit 1`
       // const sql2 = `select CREATE_BY_ FROM ibps_bpm_oper_log WHERE PROC_INST_ID_ = '${instanceId}' AND OPER_TYPE_ IN('start') ORDER BY CREATE_TIME_ asc limit 1`
 
 
       this.$common.request('query', { key, params }).then((r) => {
       this.$common.request('query', { key, params }).then((r) => {
@@ -596,12 +596,20 @@ export default {
         this.tipsMess('请检查姓名、性别和工号是否填写正确')
         this.tipsMess('请检查姓名、性别和工号是否填写正确')
       }
       }
     },
     },
-    tipsShow(val, name) {
+    tipsShow(val, name, fields) {
       if (val && this.tipsControls === false) {
       if (val && this.tipsControls === false) {
         this.infoNumArr = []
         this.infoNumArr = []
 
 
         this.tipsControls = true
         this.tipsControls = true
-        this.tipsMess('请检查表单数据是否填写正确')
+        let tip = '请检查表单数据是否填写正确'
+        if (name && fields) {
+          tip = `请检查【${name}】:${fields}`
+        } else if (name) {
+          tip = `请检查【${name}】表单数据是否填写正确`
+        } else if (fields) {
+          tip = `请检查:${fields}`
+        }
+        this.tipsMess(tip)
       }
       }
     },
     },
     checkData(val) {
     checkData(val) {