This commit is contained in:
BianLzhaoMin 2025-11-12 14:44:01 +08:00
parent a440859628
commit 64a6015f98
7 changed files with 351 additions and 6 deletions

View File

@ -627,6 +627,7 @@ import {
import { getPostTypeSelectListCommonFun } from '@/utils/getCommonData' import { getPostTypeSelectListCommonFun } from '@/utils/getCommonData'
export default { export default {
name: 'AddOrEditForm', name: 'AddOrEditForm',
dicts: ['salary'],
props: { props: {
queryDetailsId: { queryDetailsId: {
type: [String, Number], type: [String, Number],
@ -980,8 +981,10 @@ export default {
}, },
{ {
trigger: 'blur', trigger: 'blur',
pattern: /^[1-9]\d{0,5}$/, // pattern: /^[1-9]\d{0,5}$/,
message: '请输入1-999999之间的正整数', // message: '1-999999',
pattern: '',
message: '',
}, },
], ],
}, },
@ -1831,6 +1834,95 @@ export default {
this.isReadCard = false this.isReadCard = false
this.Base64Photo = '' this.Base64Photo = ''
}, },
//
initSalaryRegexp(num) {
// num1-999999
const n = Math.min(Math.max(Number(num) || 1, 1), 999999)
const str = n.toString()
const len = str.length
const maxLen = 6 // 9999996
let regexParts = []
// 1. numnum
if (len < maxLen) {
// num31234-61000-999999
for (let i = len + 1; i <= maxLen; i++) {
// 1-9i-10-9
regexParts.push(`[1-9]\\d{${i - 1}}`)
}
}
// 2. numnum
const firstDigit = parseInt(str[0], 10)
const rest = str.slice(1) // num
const maxSameLen = '9'.repeat(len) // 3999
if (str === maxSameLen) {
// num999
regexParts.push(str)
} else {
//
// a. numnum=3454-9
if (firstDigit < 9) {
regexParts.push(`[${firstDigit + 1}-9]\\d{${len - 1}}`)
}
// b. numnum
// num=345345
const restRegex = this.getRestRegex(rest)
if (restRegex) {
regexParts.push(`${firstDigit}${restRegex}`)
}
}
// ^$
const regexStr = `^(${regexParts.join('|')})$`
this.contractInfoFormRules.wageCriterion[1].pattern = new RegExp(
regexStr,
)
},
// ntargetResttargetRest"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) {
// digitdigit
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() { async created() {
@ -1845,6 +1937,27 @@ export default {
this.getLotProjectSelectList() 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() { beforeDestroy() {
if (this.webSocket) { if (this.webSocket) {
this.closeWebSocket() this.closeWebSocket()

View File

@ -391,6 +391,7 @@ import {
} from '@/api/common' } from '@/api/common'
export default { export default {
name: 'ShanghaiProSetting', name: 'ShanghaiProSetting',
dicts: ['salary'],
components: { components: {
DialogModel, DialogModel,
UploadFileFormData, UploadFileFormData,
@ -565,8 +566,10 @@ export default {
}, },
{ {
trigger: 'blur', trigger: 'blur',
pattern: /^[1-9]\d{0,5}$/, // pattern: /^[1-9]\d{0,5}$/,
message: '请输入1-999999之间的正整数', // 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: { methods: {
onHandlePersonExit() { onHandlePersonExit() {
@ -932,6 +949,95 @@ export default {
(item) => item.value === val, (item) => item.value === val,
).label ).label
}, },
//
initSalaryRegexp(num) {
// num1-999999
const n = Math.min(Math.max(Number(num) || 1, 1), 999999)
const str = n.toString()
const len = str.length
const maxLen = 6 // 9999996
let regexParts = []
// 1. numnum
if (len < maxLen) {
// num31234-61000-999999
for (let i = len + 1; i <= maxLen; i++) {
// 1-9i-10-9
regexParts.push(`[1-9]\\d{${i - 1}}`)
}
}
// 2. numnum
const firstDigit = parseInt(str[0], 10)
const rest = str.slice(1) // num
const maxSameLen = '9'.repeat(len) // 3999
if (str === maxSameLen) {
// num999
regexParts.push(str)
} else {
//
// a. numnum=3454-9
if (firstDigit < 9) {
regexParts.push(`[${firstDigit + 1}-9]\\d{${len - 1}}`)
}
// b. numnum
// num=345345
const restRegex = this.getRestRegex(rest)
if (restRegex) {
regexParts.push(`${firstDigit}${restRegex}`)
}
}
// ^$
const regexStr = `^(${regexParts.join('|')})$`
this.addEntryProjectFormRules.wageCriterion[1].pattern = new RegExp(
regexStr,
)
},
// ntargetResttargetRest"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) {
// digitdigit
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: { watch: {

View File

@ -149,6 +149,7 @@ import {
import { updatePersonLightStatusAPI } from '@/api/construction-person/entry-and-exit-manage/person-entry' import { updatePersonLightStatusAPI } from '@/api/construction-person/entry-and-exit-manage/person-entry'
export default { export default {
name: 'ContractWitnessUpload', name: 'ContractWitnessUpload',
dicts: ['salary'],
props: { props: {
queryDetailsId: { queryDetailsId: {
type: [String, Number], type: [String, Number],
@ -233,8 +234,10 @@ export default {
}, },
{ {
trigger: 'blur', trigger: 'blur',
pattern: /^[1-9]\d{0,5}$/, // pattern: /^[1-9]\d{0,5}$/,
message: '请输入1-999999之间的正整数', // 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: { methods: {
// //
checkFormStatus() { checkFormStatus() {
@ -443,6 +461,94 @@ export default {
} }
} }
}, },
//
initSalaryRegexp(num) {
// num1-999999
const n = Math.min(Math.max(Number(num) || 1, 1), 999999)
const str = n.toString()
const len = str.length
const maxLen = 6 // 9999996
let regexParts = []
// 1. numnum
if (len < maxLen) {
// num31234-61000-999999
for (let i = len + 1; i <= maxLen; i++) {
// 1-9i-10-9
regexParts.push(`[1-9]\\d{${i - 1}}`)
}
}
// 2. numnum
const firstDigit = parseInt(str[0], 10)
const rest = str.slice(1) // num
const maxSameLen = '9'.repeat(len) // 3999
if (str === maxSameLen) {
// num999
regexParts.push(str)
} else {
//
// a. numnum=3454-9
if (firstDigit < 9) {
regexParts.push(`[${firstDigit + 1}-9]\\d{${len - 1}}`)
}
// b. numnum
// num=345345
const restRegex = this.getRestRegex(rest)
if (restRegex) {
regexParts.push(`${firstDigit}${restRegex}`)
}
}
// ^$
const regexStr = `^(${regexParts.join('|')})$`
this.contractInfoFormRules.wageCriterion[1].pattern = new RegExp(
regexStr,
)
},
// ntargetResttargetRest"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) {
// digitdigit
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> </script>

View File

@ -324,6 +324,8 @@ export default {
handleCheckPersonCount(data, type) { handleCheckPersonCount(data, type) {
if (type === 2) { if (type === 2) {
this.queryParams.isAtt = '1' this.queryParams.isAtt = '1'
} else {
this.queryParams.isAtt = ''
} }
this.queryParams.teamId = data.teamId this.queryParams.teamId = data.teamId
this.dialogConfigFour.outerTitle = '人员信息' this.dialogConfigFour.outerTitle = '人员信息'

View File

@ -573,6 +573,7 @@ export default {
// //
onHandleCheckTeamCountInSub(data) { onHandleCheckTeamCountInSub(data) {
this.teamQueryParams.subId = data.subId this.teamQueryParams.subId = data.subId
this.teamQueryParams.proId = data.proId
this.dialogConfigThree.outerTitle = '班组信息' this.dialogConfigThree.outerTitle = '班组信息'
this.dialogConfigThree.outerVisible = true this.dialogConfigThree.outerVisible = true
}, },
@ -581,6 +582,8 @@ export default {
handleCheckPersonCount_1(data, type) { handleCheckPersonCount_1(data, type) {
if (type === 2) { if (type === 2) {
this.queryParamsPerson.isAtt = '1' this.queryParamsPerson.isAtt = '1'
} else {
this.queryParamsPerson.isAtt = ''
} }
this.queryParamsPerson.subId = '' this.queryParamsPerson.subId = ''
this.queryParamsPerson.teamId = '' this.queryParamsPerson.teamId = ''
@ -593,6 +596,8 @@ export default {
handleCheckPersonCount_2(data, type) { handleCheckPersonCount_2(data, type) {
if (type === 2) { if (type === 2) {
this.queryParamsPerson.isAtt = '1' this.queryParamsPerson.isAtt = '1'
} else {
this.queryParamsPerson.isAtt = ''
} }
this.queryParamsPerson.subId = data.subId this.queryParamsPerson.subId = data.subId
this.dialogConfigFour.outerTitle = '人员信息' this.dialogConfigFour.outerTitle = '人员信息'
@ -603,6 +608,8 @@ export default {
handleCheckPersonCount_3(data, type) { handleCheckPersonCount_3(data, type) {
if (type === 2) { if (type === 2) {
this.queryParamsPerson.isAtt = '1' this.queryParamsPerson.isAtt = '1'
} else {
this.queryParamsPerson.isAtt = ''
} }
this.queryParamsPerson.teamId = data.teamId this.queryParamsPerson.teamId = data.teamId
this.dialogConfigFour.outerTitle = '人员信息' this.dialogConfigFour.outerTitle = '人员信息'

View File

@ -357,6 +357,8 @@ export default {
handleCheckPersonCount(data, type) { handleCheckPersonCount(data, type) {
if (type === 2) { if (type === 2) {
this.queryParams.isAtt = '1' this.queryParams.isAtt = '1'
} else {
this.queryParams.isAtt = ''
} }
this.queryParams.subId = data.subId this.queryParams.subId = data.subId
this.queryParams.proId = data.proId this.queryParams.proId = data.proId
@ -367,6 +369,8 @@ export default {
handleCheckPersonCount_2(data, type) { handleCheckPersonCount_2(data, type) {
if (type === 2) { if (type === 2) {
this.queryParams.isAtt = '1' this.queryParams.isAtt = '1'
} else {
this.queryParams.isAtt = ''
} }
this.queryParams.subId = this.subId this.queryParams.subId = this.subId
this.queryParams.proId = this.proId this.queryParams.proId = this.proId

View File

@ -517,6 +517,7 @@ export default {
// //
onHandleCheckTeamCountInSub(data) { onHandleCheckTeamCountInSub(data) {
this.teamQueryParams.subId = data.subId this.teamQueryParams.subId = data.subId
this.teamQueryParams.proId = data.proId
this.dialogConfigThree.outerTitle = '班组信息' this.dialogConfigThree.outerTitle = '班组信息'
this.dialogConfigThree.outerVisible = true this.dialogConfigThree.outerVisible = true
}, },
@ -525,6 +526,8 @@ export default {
handleCheckPersonCount_1(data, type) { handleCheckPersonCount_1(data, type) {
if (type === 2) { if (type === 2) {
this.queryParamsPerson.isAtt = '1' this.queryParamsPerson.isAtt = '1'
} else {
this.queryParamsPerson.isAtt = ''
} }
this.queryParamsPerson.subId = '' this.queryParamsPerson.subId = ''
this.queryParamsPerson.teamId = '' this.queryParamsPerson.teamId = ''
@ -537,6 +540,8 @@ export default {
handleCheckPersonCount_2(data, type) { handleCheckPersonCount_2(data, type) {
if (type === 2) { if (type === 2) {
this.queryParamsPerson.isAtt = '1' this.queryParamsPerson.isAtt = '1'
} else {
this.queryParamsPerson.isAtt = ''
} }
this.queryParamsPerson.subId = data.subId this.queryParamsPerson.subId = data.subId
this.dialogConfigFour.outerTitle = '人员信息' this.dialogConfigFour.outerTitle = '人员信息'
@ -547,6 +552,8 @@ export default {
handleCheckPersonCount_3(data, type) { handleCheckPersonCount_3(data, type) {
if (type === 2) { if (type === 2) {
this.queryParamsPerson.isAtt = '1' this.queryParamsPerson.isAtt = '1'
} else {
this.queryParamsPerson.isAtt = ''
} }
this.queryParamsPerson.teamId = data.teamId this.queryParamsPerson.teamId = data.teamId
this.dialogConfigFour.outerTitle = '人员信息' this.dialogConfigFour.outerTitle = '人员信息'