cyy hai 1 ano
pai
achega
cc89f3ec57

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

@@ -295,13 +295,13 @@ export default {
             nowData: {},
             rules: {
                 jianDangRiQi: [{ validator: option.checkTime, trigger: 'blur' }],
-                chuShengRiQi: [{ validator: option.checkTime, trigger: 'blur' }],
-                nianLing: [{ validator: option.checkNianLing, trigger: 'change' }],
-                yuanBiYeYuanXi: [{ validator: option.checkLength, trigger: 'blur' }],
-                ruZhiShiJian: [{ validator: option.checkTime, trigger: 'blur' }],
-                zhiCheng: [{ validator: option.checkLength, trigger: 'blur' }],
+                chuShengRiQi: [{ validator: option.checkTimeNull, trigger: 'blur' }],
+                nianLing: [{ validator: option.checkNianLingNull, trigger: 'change' }],
+                yuanBiYeYuanXi: [{ validator: option.checkLengthNull, trigger: 'blur' }],
+                ruZhiShiJian: [{ validator: option.checkTimeNull, trigger: 'blur' }],
+                zhiCheng: [{ validator: option.checkLengthNull, trigger: 'blur' }],
                 qianZiTuWen: [{ validator: option.attachmentsNumOne, trigger: 'change' }],
-                shenFenZhengHao: [{ validator: option.checkLength, trigger: 'blur' }],
+                shenFenZhengHao: [{ validator: option.checkLengthNull, trigger: 'blur' }],
                 baoMiXieYi: [{ validator: option.attachmentsNum, trigger: 'change' }],
                 chengNuoHan: [{ validator: option.attachmentsNum, trigger: 'change' }],
                 sheBao: [{ validator: option.attachmentsNum, trigger: 'change' }]

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

@@ -12,6 +12,20 @@ export const checkTime = (rule, value, callback) => {
         }
     }, 100)
 }
+export const checkTimeNull = (rule, value, callback) => {
+    if (!value) {
+        callback()
+    }
+    setTimeout(() => {
+        const nowTime = new Date().getTime()
+        const valueTime = new Date(value).getTime()
+        if (nowTime < valueTime) {
+            callback(new Error('请选择小于当前日期的时间'))
+        } else {
+            callback()
+        }
+    }, 100)
+}
 export const checkLength = (rule, value, callback) => {
     if (!value) {
         return callback(new Error('请填写内容'))
@@ -24,6 +38,18 @@ export const checkLength = (rule, value, callback) => {
         }
     }, 100)
 }
+export const checkLengthNull = (rule, value, callback) => {
+    if (!value) {
+        callback()
+    }
+    setTimeout(() => {
+        if (value.length > 200) {
+            callback(new Error('请将字数限制在200以内'))
+        } else {
+            callback()
+        }
+    }, 100)
+}
 export const optional = (rule, value, callback) => {
     if (!value) {
         callback()
@@ -61,11 +87,24 @@ export const checkNianLing = (rule, value, callback) => {
         callback()
     }
 }
+export const checkNianLingNull = (rule, value, callback) => {
+    if (!value) {
+        // return callback(new Error('请合理选择年龄'))
+        callback()
+    } else if (value > 150 || value < 0) {
+        callback(new Error('年龄范围在0~150岁'))
+    } else {
+        callback()
+    }
+}
 export default {
     checkTime,
     checkLength,
     optional,
     attachmentsNum,
     checkNianLing,
-    attachmentsNumOne
+    attachmentsNumOne,
+    checkTimeNull,
+    checkNianLingNull,
+    checkLengthNull
 }

+ 1 - 1
src/views/component/personnelFile/constants/simulated.js

@@ -432,7 +432,7 @@ export function correlationSql (type, val) {
     if (type === 'jyrykhjlb' || type === 'lhrynlqr' || type === 'lhpxsqb') {
         sql = `select * from t_${type} where FIND_IN_SET('${val}',${col[type]}) and shi_fou_guo_shen_ = '已完成' `
     } else if (type === 'kaoshijilu') {
-        sql = `select * from v_examination where FIND_IN_SET('${val}',${col[type]}) and paperState = '已完成' ORDER BY createTime asc`
+        sql = `select * from v_examination where FIND_IN_SET('${val}',${col[type]}) and paperState = '已完成' and examType!='自主考核' ORDER BY createTime asc`
     } else if (type === 'lhrypxjlb') {
         sql = `select * from v_wodepeixun where FIND_IN_SET('${val}',${col[type]}) and shi_fou_guo_shen_ = '已结束' `
     } else if (type === 'tjbgb') {