This commit is contained in:
parent
a440859628
commit
64a6015f98
|
|
@ -627,6 +627,7 @@ import {
|
|||
import { getPostTypeSelectListCommonFun } from '@/utils/getCommonData'
|
||||
export default {
|
||||
name: 'AddOrEditForm',
|
||||
dicts: ['salary'],
|
||||
props: {
|
||||
queryDetailsId: {
|
||||
type: [String, Number],
|
||||
|
|
@ -980,8 +981,10 @@ export default {
|
|||
},
|
||||
{
|
||||
trigger: 'blur',
|
||||
pattern: /^[1-9]\d{0,5}$/,
|
||||
message: '请输入1-999999之间的正整数',
|
||||
// pattern: /^[1-9]\d{0,5}$/,
|
||||
// message: '请输入1-999999之间的正整数',
|
||||
pattern: '',
|
||||
message: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -1831,6 +1834,95 @@ export default {
|
|||
this.isReadCard = false
|
||||
this.Base64Photo = ''
|
||||
},
|
||||
|
||||
// 初始化工资核定标准正则表达式
|
||||
initSalaryRegexp(num) {
|
||||
// 确保num是1-999999之间的整数
|
||||
const n = Math.min(Math.max(Number(num) || 1, 1), 999999)
|
||||
const str = n.toString()
|
||||
const len = str.length
|
||||
const maxLen = 6 // 999999是6位数
|
||||
let regexParts = []
|
||||
|
||||
// 1. 处理位数大于num位数的情况(这些位数的数字一定大于num)
|
||||
if (len < maxLen) {
|
||||
// 例如:num是3位数(123),则4-6位数均合法(1000-999999)
|
||||
for (let i = len + 1; i <= maxLen; i++) {
|
||||
// 第一位1-9,后面i-1位0-9(无前置零)
|
||||
regexParts.push(`[1-9]\\d{${i - 1}}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 处理位数等于num位数的情况(需大于等于num且小于等于该位数的最大值)
|
||||
const firstDigit = parseInt(str[0], 10)
|
||||
const rest = str.slice(1) // num除去第一位的部分
|
||||
const maxSameLen = '9'.repeat(len) // 同位数的最大值(如3位数是999)
|
||||
|
||||
if (str === maxSameLen) {
|
||||
// 若num等于同位数最大值(如999),则同位数只有它本身合法
|
||||
regexParts.push(str)
|
||||
} else {
|
||||
// 分三部分处理同位数:
|
||||
// a. 第一位大于num的第一位:后面任意(如num=345,第一位4-9,后两位任意)
|
||||
if (firstDigit < 9) {
|
||||
regexParts.push(`[${firstDigit + 1}-9]\\d{${len - 1}}`)
|
||||
}
|
||||
|
||||
// b. 第一位等于num的第一位,后面部分大于等于num的后几位
|
||||
// 生成后几位的正则(如num=345,第一位3,后两位需≥45)
|
||||
const restRegex = this.getRestRegex(rest)
|
||||
if (restRegex) {
|
||||
regexParts.push(`${firstDigit}${restRegex}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 拼接所有部分,生成最终正则(^和$限制整串匹配)
|
||||
const regexStr = `^(${regexParts.join('|')})$`
|
||||
this.contractInfoFormRules.wageCriterion[1].pattern = new RegExp(
|
||||
regexStr,
|
||||
)
|
||||
},
|
||||
|
||||
// 辅助函数:生成“后n位数字≥targetRest”的正则(targetRest是字符串,如"45")
|
||||
getRestRegex(targetRest) {
|
||||
const len = targetRest.length
|
||||
if (len === 0) return '' // 若没有后几位(1位数),无需处理
|
||||
|
||||
let result = ''
|
||||
let isTight = true // 是否严格限制前几位等于targetRest的对应位
|
||||
|
||||
for (let i = 0; i < len; i++) {
|
||||
const digit = parseInt(targetRest[i], 10)
|
||||
if (!isTight) {
|
||||
// 前面已有位大于targetRest,后面可任意
|
||||
result += '\\d'
|
||||
continue
|
||||
}
|
||||
|
||||
if (digit < 9) {
|
||||
// 当前位可大于digit(后面任意),或等于digit(继续限制)
|
||||
result += `([${digit + 1}-9]\\d{${len - i - 1}}|${digit}`
|
||||
isTight = true
|
||||
} else {
|
||||
// 当前位等于9,只能继续限制
|
||||
result += '9'
|
||||
isTight = true
|
||||
}
|
||||
}
|
||||
|
||||
// 闭合所有括号(处理“或”逻辑的嵌套)
|
||||
if (result.includes('(')) {
|
||||
result += ')'.repeat((result.match(/\(/g) || []).length)
|
||||
}
|
||||
|
||||
return result
|
||||
},
|
||||
|
||||
// 初始化工资核定标准提示信息
|
||||
initSalaryMessage(num) {
|
||||
// return `请输入${num}-999999之间的正整数`
|
||||
this.contractInfoFormRules.wageCriterion[1].message = `请输入${num}-999999之间的正整数`
|
||||
},
|
||||
},
|
||||
|
||||
async created() {
|
||||
|
|
@ -1845,6 +1937,27 @@ export default {
|
|||
this.getLotProjectSelectList()
|
||||
},
|
||||
|
||||
mounted() {
|
||||
console.log(this.dict.type.salary, 'this.dict.type.salary')
|
||||
// 获取最低工资标准
|
||||
if (this.formType === 1) {
|
||||
setTimeout(() => {
|
||||
// this.contractInfoForm.wageCriterion =
|
||||
// this.dict.type.salary.find((item) => item.label == 'min')
|
||||
// .value || ''
|
||||
|
||||
this.initSalaryRegexp(
|
||||
this.dict.type.salary.find((item) => item.label == 'min')
|
||||
.value,
|
||||
)
|
||||
this.initSalaryMessage(
|
||||
this.dict.type.salary.find((item) => item.label == 'min')
|
||||
.value,
|
||||
)
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
if (this.webSocket) {
|
||||
this.closeWebSocket()
|
||||
|
|
|
|||
|
|
@ -391,6 +391,7 @@ import {
|
|||
} from '@/api/common'
|
||||
export default {
|
||||
name: 'ShanghaiProSetting',
|
||||
dicts: ['salary'],
|
||||
components: {
|
||||
DialogModel,
|
||||
UploadFileFormData,
|
||||
|
|
@ -565,8 +566,10 @@ export default {
|
|||
},
|
||||
{
|
||||
trigger: 'blur',
|
||||
pattern: /^[1-9]\d{0,5}$/,
|
||||
message: '请输入1-999999之间的正整数',
|
||||
// pattern: /^[1-9]\d{0,5}$/,
|
||||
// message: '请输入1-999999之间的正整数',
|
||||
pattern: '',
|
||||
message: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -602,6 +605,20 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// this.addEntryProjectForm.wageCriterion =
|
||||
// this.dict.type.salary.find((item) => item.label == 'min')
|
||||
// .value || ''
|
||||
|
||||
this.initSalaryRegexp(
|
||||
this.dict.type.salary.find((item) => item.label == 'min').value,
|
||||
)
|
||||
this.initSalaryMessage(
|
||||
this.dict.type.salary.find((item) => item.label == 'min').value,
|
||||
)
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
methods: {
|
||||
onHandlePersonExit() {
|
||||
|
|
@ -932,6 +949,95 @@ export default {
|
|||
(item) => item.value === val,
|
||||
).label
|
||||
},
|
||||
|
||||
// 初始化工资核定标准正则表达式
|
||||
initSalaryRegexp(num) {
|
||||
// 确保num是1-999999之间的整数
|
||||
const n = Math.min(Math.max(Number(num) || 1, 1), 999999)
|
||||
const str = n.toString()
|
||||
const len = str.length
|
||||
const maxLen = 6 // 999999是6位数
|
||||
let regexParts = []
|
||||
|
||||
// 1. 处理位数大于num位数的情况(这些位数的数字一定大于num)
|
||||
if (len < maxLen) {
|
||||
// 例如:num是3位数(123),则4-6位数均合法(1000-999999)
|
||||
for (let i = len + 1; i <= maxLen; i++) {
|
||||
// 第一位1-9,后面i-1位0-9(无前置零)
|
||||
regexParts.push(`[1-9]\\d{${i - 1}}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 处理位数等于num位数的情况(需大于等于num且小于等于该位数的最大值)
|
||||
const firstDigit = parseInt(str[0], 10)
|
||||
const rest = str.slice(1) // num除去第一位的部分
|
||||
const maxSameLen = '9'.repeat(len) // 同位数的最大值(如3位数是999)
|
||||
|
||||
if (str === maxSameLen) {
|
||||
// 若num等于同位数最大值(如999),则同位数只有它本身合法
|
||||
regexParts.push(str)
|
||||
} else {
|
||||
// 分三部分处理同位数:
|
||||
// a. 第一位大于num的第一位:后面任意(如num=345,第一位4-9,后两位任意)
|
||||
if (firstDigit < 9) {
|
||||
regexParts.push(`[${firstDigit + 1}-9]\\d{${len - 1}}`)
|
||||
}
|
||||
|
||||
// b. 第一位等于num的第一位,后面部分大于等于num的后几位
|
||||
// 生成后几位的正则(如num=345,第一位3,后两位需≥45)
|
||||
const restRegex = this.getRestRegex(rest)
|
||||
if (restRegex) {
|
||||
regexParts.push(`${firstDigit}${restRegex}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 拼接所有部分,生成最终正则(^和$限制整串匹配)
|
||||
const regexStr = `^(${regexParts.join('|')})$`
|
||||
this.addEntryProjectFormRules.wageCriterion[1].pattern = new RegExp(
|
||||
regexStr,
|
||||
)
|
||||
},
|
||||
|
||||
// 辅助函数:生成“后n位数字≥targetRest”的正则(targetRest是字符串,如"45")
|
||||
getRestRegex(targetRest) {
|
||||
const len = targetRest.length
|
||||
if (len === 0) return '' // 若没有后几位(1位数),无需处理
|
||||
|
||||
let result = ''
|
||||
let isTight = true // 是否严格限制前几位等于targetRest的对应位
|
||||
|
||||
for (let i = 0; i < len; i++) {
|
||||
const digit = parseInt(targetRest[i], 10)
|
||||
if (!isTight) {
|
||||
// 前面已有位大于targetRest,后面可任意
|
||||
result += '\\d'
|
||||
continue
|
||||
}
|
||||
|
||||
if (digit < 9) {
|
||||
// 当前位可大于digit(后面任意),或等于digit(继续限制)
|
||||
result += `([${digit + 1}-9]\\d{${len - i - 1}}|${digit}`
|
||||
isTight = true
|
||||
} else {
|
||||
// 当前位等于9,只能继续限制
|
||||
result += '9'
|
||||
isTight = true
|
||||
}
|
||||
}
|
||||
|
||||
// 闭合所有括号(处理“或”逻辑的嵌套)
|
||||
if (result.includes('(')) {
|
||||
result += ')'.repeat((result.match(/\(/g) || []).length)
|
||||
}
|
||||
|
||||
return result
|
||||
},
|
||||
|
||||
// 初始化工资核定标准提示信息
|
||||
initSalaryMessage(num) {
|
||||
// return `请输入${num}-999999之间的正整数`
|
||||
this.addEntryProjectFormRules.wageCriterion[1].message = `请输入${num}-999999之间的正整数`
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ import {
|
|||
import { updatePersonLightStatusAPI } from '@/api/construction-person/entry-and-exit-manage/person-entry'
|
||||
export default {
|
||||
name: 'ContractWitnessUpload',
|
||||
dicts: ['salary'],
|
||||
props: {
|
||||
queryDetailsId: {
|
||||
type: [String, Number],
|
||||
|
|
@ -233,8 +234,10 @@ export default {
|
|||
},
|
||||
{
|
||||
trigger: 'blur',
|
||||
pattern: /^[1-9]\d{0,5}$/,
|
||||
message: '请输入1-999999之间的正整数',
|
||||
// pattern: /^[1-9]\d{0,5}$/,
|
||||
// message: '请输入1-999999之间的正整数',
|
||||
pattern: '',
|
||||
message: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -273,6 +276,21 @@ export default {
|
|||
],
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// this.contractInfoForm.wageCriterion =
|
||||
// this.dict.type.salary.find((item) => item.label == 'min')
|
||||
// .value || ''
|
||||
|
||||
this.initSalaryRegexp(
|
||||
this.dict.type.salary.find((item) => item.label == 'min').value,
|
||||
)
|
||||
this.initSalaryMessage(
|
||||
this.dict.type.salary.find((item) => item.label == 'min').value,
|
||||
)
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
// 检查表单状态
|
||||
checkFormStatus() {
|
||||
|
|
@ -443,6 +461,94 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
// 初始化工资核定标准正则表达式
|
||||
initSalaryRegexp(num) {
|
||||
// 确保num是1-999999之间的整数
|
||||
const n = Math.min(Math.max(Number(num) || 1, 1), 999999)
|
||||
const str = n.toString()
|
||||
const len = str.length
|
||||
const maxLen = 6 // 999999是6位数
|
||||
let regexParts = []
|
||||
|
||||
// 1. 处理位数大于num位数的情况(这些位数的数字一定大于num)
|
||||
if (len < maxLen) {
|
||||
// 例如:num是3位数(123),则4-6位数均合法(1000-999999)
|
||||
for (let i = len + 1; i <= maxLen; i++) {
|
||||
// 第一位1-9,后面i-1位0-9(无前置零)
|
||||
regexParts.push(`[1-9]\\d{${i - 1}}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 处理位数等于num位数的情况(需大于等于num且小于等于该位数的最大值)
|
||||
const firstDigit = parseInt(str[0], 10)
|
||||
const rest = str.slice(1) // num除去第一位的部分
|
||||
const maxSameLen = '9'.repeat(len) // 同位数的最大值(如3位数是999)
|
||||
|
||||
if (str === maxSameLen) {
|
||||
// 若num等于同位数最大值(如999),则同位数只有它本身合法
|
||||
regexParts.push(str)
|
||||
} else {
|
||||
// 分三部分处理同位数:
|
||||
// a. 第一位大于num的第一位:后面任意(如num=345,第一位4-9,后两位任意)
|
||||
if (firstDigit < 9) {
|
||||
regexParts.push(`[${firstDigit + 1}-9]\\d{${len - 1}}`)
|
||||
}
|
||||
|
||||
// b. 第一位等于num的第一位,后面部分大于等于num的后几位
|
||||
// 生成后几位的正则(如num=345,第一位3,后两位需≥45)
|
||||
const restRegex = this.getRestRegex(rest)
|
||||
if (restRegex) {
|
||||
regexParts.push(`${firstDigit}${restRegex}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 拼接所有部分,生成最终正则(^和$限制整串匹配)
|
||||
const regexStr = `^(${regexParts.join('|')})$`
|
||||
this.contractInfoFormRules.wageCriterion[1].pattern = new RegExp(
|
||||
regexStr,
|
||||
)
|
||||
},
|
||||
|
||||
// 辅助函数:生成“后n位数字≥targetRest”的正则(targetRest是字符串,如"45")
|
||||
getRestRegex(targetRest) {
|
||||
const len = targetRest.length
|
||||
if (len === 0) return '' // 若没有后几位(1位数),无需处理
|
||||
|
||||
let result = ''
|
||||
let isTight = true // 是否严格限制前几位等于targetRest的对应位
|
||||
|
||||
for (let i = 0; i < len; i++) {
|
||||
const digit = parseInt(targetRest[i], 10)
|
||||
if (!isTight) {
|
||||
// 前面已有位大于targetRest,后面可任意
|
||||
result += '\\d'
|
||||
continue
|
||||
}
|
||||
|
||||
if (digit < 9) {
|
||||
// 当前位可大于digit(后面任意),或等于digit(继续限制)
|
||||
result += `([${digit + 1}-9]\\d{${len - i - 1}}|${digit}`
|
||||
isTight = true
|
||||
} else {
|
||||
// 当前位等于9,只能继续限制
|
||||
result += '9'
|
||||
isTight = true
|
||||
}
|
||||
}
|
||||
|
||||
// 闭合所有括号(处理“或”逻辑的嵌套)
|
||||
if (result.includes('(')) {
|
||||
result += ')'.repeat((result.match(/\(/g) || []).length)
|
||||
}
|
||||
|
||||
return result
|
||||
},
|
||||
|
||||
// 初始化工资核定标准提示信息
|
||||
initSalaryMessage(num) {
|
||||
// return `请输入${num}-999999之间的正整数`
|
||||
this.contractInfoFormRules.wageCriterion[1].message = `请输入${num}-999999之间的正整数`
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -324,6 +324,8 @@ export default {
|
|||
handleCheckPersonCount(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParams.isAtt = '1'
|
||||
} else {
|
||||
this.queryParams.isAtt = ''
|
||||
}
|
||||
this.queryParams.teamId = data.teamId
|
||||
this.dialogConfigFour.outerTitle = '人员信息'
|
||||
|
|
|
|||
|
|
@ -573,6 +573,7 @@ export default {
|
|||
// 查看班组数量 从分包点击查看班组
|
||||
onHandleCheckTeamCountInSub(data) {
|
||||
this.teamQueryParams.subId = data.subId
|
||||
this.teamQueryParams.proId = data.proId
|
||||
this.dialogConfigThree.outerTitle = '班组信息'
|
||||
this.dialogConfigThree.outerVisible = true
|
||||
},
|
||||
|
|
@ -581,6 +582,8 @@ export default {
|
|||
handleCheckPersonCount_1(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParamsPerson.isAtt = '1'
|
||||
} else {
|
||||
this.queryParamsPerson.isAtt = ''
|
||||
}
|
||||
this.queryParamsPerson.subId = ''
|
||||
this.queryParamsPerson.teamId = ''
|
||||
|
|
@ -593,6 +596,8 @@ export default {
|
|||
handleCheckPersonCount_2(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParamsPerson.isAtt = '1'
|
||||
} else {
|
||||
this.queryParamsPerson.isAtt = ''
|
||||
}
|
||||
this.queryParamsPerson.subId = data.subId
|
||||
this.dialogConfigFour.outerTitle = '人员信息'
|
||||
|
|
@ -603,6 +608,8 @@ export default {
|
|||
handleCheckPersonCount_3(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParamsPerson.isAtt = '1'
|
||||
} else {
|
||||
this.queryParamsPerson.isAtt = ''
|
||||
}
|
||||
this.queryParamsPerson.teamId = data.teamId
|
||||
this.dialogConfigFour.outerTitle = '人员信息'
|
||||
|
|
|
|||
|
|
@ -357,6 +357,8 @@ export default {
|
|||
handleCheckPersonCount(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParams.isAtt = '1'
|
||||
} else {
|
||||
this.queryParams.isAtt = ''
|
||||
}
|
||||
this.queryParams.subId = data.subId
|
||||
this.queryParams.proId = data.proId
|
||||
|
|
@ -367,6 +369,8 @@ export default {
|
|||
handleCheckPersonCount_2(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParams.isAtt = '1'
|
||||
} else {
|
||||
this.queryParams.isAtt = ''
|
||||
}
|
||||
this.queryParams.subId = this.subId
|
||||
this.queryParams.proId = this.proId
|
||||
|
|
|
|||
|
|
@ -517,6 +517,7 @@ export default {
|
|||
// 查看班组数量 从分包点击查看班组
|
||||
onHandleCheckTeamCountInSub(data) {
|
||||
this.teamQueryParams.subId = data.subId
|
||||
this.teamQueryParams.proId = data.proId
|
||||
this.dialogConfigThree.outerTitle = '班组信息'
|
||||
this.dialogConfigThree.outerVisible = true
|
||||
},
|
||||
|
|
@ -525,6 +526,8 @@ export default {
|
|||
handleCheckPersonCount_1(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParamsPerson.isAtt = '1'
|
||||
} else {
|
||||
this.queryParamsPerson.isAtt = ''
|
||||
}
|
||||
this.queryParamsPerson.subId = ''
|
||||
this.queryParamsPerson.teamId = ''
|
||||
|
|
@ -537,6 +540,8 @@ export default {
|
|||
handleCheckPersonCount_2(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParamsPerson.isAtt = '1'
|
||||
} else {
|
||||
this.queryParamsPerson.isAtt = ''
|
||||
}
|
||||
this.queryParamsPerson.subId = data.subId
|
||||
this.dialogConfigFour.outerTitle = '人员信息'
|
||||
|
|
@ -547,6 +552,8 @@ export default {
|
|||
handleCheckPersonCount_3(data, type) {
|
||||
if (type === 2) {
|
||||
this.queryParamsPerson.isAtt = '1'
|
||||
} else {
|
||||
this.queryParamsPerson.isAtt = ''
|
||||
}
|
||||
this.queryParamsPerson.teamId = data.teamId
|
||||
this.dialogConfigFour.outerTitle = '人员信息'
|
||||
|
|
|
|||
Loading…
Reference in New Issue