This commit is contained in:
BianLzhaoMin 2025-08-21 14:42:57 +08:00
parent a89853b4ac
commit 43bfac24de
4 changed files with 434 additions and 285 deletions

View File

@ -190,6 +190,31 @@ export default {
//
handleChange(file, fileList) {
console.log(file, fileList, 'file, fileList')
const isFormat = this.fileType.some((e) => file.name.endsWith(e))
if (!isFormat) {
this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join(
'、',
)}格式的文件!`,
)
this.$emit(
'update:fileList',
fileList.filter((item) => item.uid !== file.uid),
)
return false
}
//
const isLt = file.size / 1024 / 1024 < this.fileSize
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 ${this.fileSize} MB`)
this.$emit(
'update:fileList',
fileList.filter((item) => item.uid !== file.uid),
)
return false
}
this.$emit('update:fileList', fileList)
this.$emit('onUploadChange', fileList)
},

View File

@ -481,6 +481,7 @@
label-width="140px"
ref="salaryCardInfoFormRef"
:model="salaryCardInfoForm"
:rules="salaryCardInfoFormRules"
>
<TitleTip
titleText="工资卡见证"
@ -534,7 +535,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="银行名称" prop="bankName">
<el-form-item label="银行名称">
<el-input
clearable
maxlength="30"
@ -566,7 +567,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="银行支行名称" prop="bankBranchName">
<el-form-item label="银行支行名称">
<el-input
clearable
maxlength="50"
@ -946,8 +947,23 @@ export default {
required: false,
},
{
pattern: /^[1-9]\d*$/,
message: '请输入正确的工资核定标准',
trigger: 'blur',
pattern: /^[1-9]\d{0,5}$/,
message: '请输入1-999999之间的正整数',
},
],
},
//
salaryCardInfoFormRules: {
bankCardCode: [
{
required: false,
},
{
trigger: 'blur',
pattern: /^[1-9]\d{12,18}$/,
message: '请输入13-19位的正确银行卡号',
},
],
},
@ -1025,15 +1041,18 @@ export default {
if (!valid1) {
//
reject(new Error('身份证信息表单验证失败'))
this.$modal.msgError('请完善身份证信息表单')
return
}
// 2.
this.$refs.keyInfoFormRef.validate(async (valid2) => {
if (valid2) {
this.$refs.contractInfoFormRef.validate(
async (valid3) => {
if (valid3) {
this.$refs.salaryCardInfoFormRef.validate(
async (valid4) => {
if (valid4) {
const fieldsToCheck_1 = [
'contractCode', //
'wageCriterion', //
@ -1045,12 +1064,15 @@ export default {
'bankCardCode', //
'bankBranchName', //
]
const status_1 = this.checkFormStatus(
const status_1 =
this.checkFormStatus(
fieldsToCheck_1,
this.contractImageList,
this
.contractImageList,
1,
)
const status_2 = this.checkFormStatus(
const status_2 =
this.checkFormStatus(
fieldsToCheck_2,
this.bankImageList,
2,
@ -1062,14 +1084,18 @@ export default {
...this.idCardInfoForm,
}
const { faceImg } = this.idCardInfoForm
const formData = new FormData()
const { faceImg } =
this.idCardInfoForm
const formData =
new FormData()
const fileMsg = []
let fileIdList = []
if (this.queryDetailsId) {
params.id = this.queryDetailsId
params.einStatus = this.einStatus
params.id =
this.queryDetailsId
params.einStatus =
this.einStatus
}
delete params.faceImg //
@ -1089,7 +1115,8 @@ export default {
})
if (
status_1 === 'all_filled' &&
status_1 ===
'all_filled' &&
!this.isEditContract
) {
params.bmWorkerContract =
@ -1102,36 +1129,50 @@ export default {
'files',
j.raw,
)
fileMsg.push({
fileMsg.push(
{
type: item.type,
name: item.name,
})
},
)
},
)
},
)
}
if (status_1 === 'partial') {
if (
status_1 === 'partial'
) {
this.$modal.msgError(
'请完善合同见证中的必填信息(除附件外)后再提交',
)
return reject(
new Error('合同信息未完善'),
new Error(
'合同信息未完善',
),
)
}
if (status_2 === 'all_filled') {
if (
status_2 ===
'all_filled'
) {
params.bmWorkerWageCard =
this.salaryCardInfoForm
if (this.queryDetailsId) {
let reserveFileList = []
if (
this.queryDetailsId
) {
let reserveFileList =
[]
this.bankImageList.forEach(
(item) => {
item.fileList.forEach(
(j) => {
if (j.id) {
if (
j.id
) {
reserveFileList.push(
j.id,
)
@ -1142,21 +1183,34 @@ export default {
)
if (
reserveFileList.length > 0
reserveFileList.length >
0
) {
fileIdList =
this.editUploadFileList
.filter(
(item) =>
(
item,
) =>
!reserveFileList.includes(
item.id,
),
)
.map((j) => j.id)
.map(
(
j,
) =>
j.id,
)
if (fileIdList.length > 0) {
if (
fileIdList.length >
0
) {
params.bmWorkerWageCard.delIds =
fileIdList.join(',')
fileIdList.join(
',',
)
}
}
}
@ -1165,15 +1219,19 @@ export default {
(item) => {
item.fileList.forEach(
(j) => {
if (!j.id) {
if (
!j.id
) {
formData.append(
'files',
j.raw,
)
fileMsg.push({
fileMsg.push(
{
type: item.type,
name: item.name,
})
},
)
}
},
)
@ -1181,27 +1239,36 @@ export default {
)
}
if (status_2 === 'partial') {
if (
status_2 === 'partial'
) {
this.$modal.msgError(
'请完善工资卡见证中的必填信息(除附件外)后再提交',
)
return reject(
new Error('工资卡信息未完善'),
new Error(
'工资卡信息未完善',
),
)
}
if (
status_2 === 'all_empty' &&
status_2 ===
'all_empty' &&
this.queryDetailsId
) {
if (
this.editUploadFileList.length >
0
this
.editUploadFileList
.length > 0
) {
params.bmWorkerWageCard.delIds =
this.editUploadFileList
.map((j) => j.id)
.map(
(j) =>
j.id,
)
.join(',')
}
}
@ -1215,11 +1282,14 @@ export default {
JSON.stringify(fileMsg),
)
const API = this.queryDetailsId
const API = this
.queryDetailsId
? editEntryPersonAPI
: addEntryPersonAPI
const res = await API(formData)
const res = await API(
formData,
)
if (res.code === 200) {
this.$modal.msgSuccess(
this.queryDetailsId
@ -1230,8 +1300,10 @@ export default {
// 绿
const result =
await updatePersonLightStatusAPI(
this.queryDetailsId
? this.workerId
this
.queryDetailsId
? this
.workerId
: res.data,
)
console.log(
@ -1241,12 +1313,31 @@ export default {
resolve()
} else {
this.$modal.msgError(res.msg)
reject(new Error(res.msg))
this.$modal.msgError(
res.msg,
)
reject(
new Error(res.msg),
)
}
} else {
reject(
new Error(
'工资卡信息表单验证失败',
),
)
this.$modal.msgError(
'请完善工资卡信息表单',
)
}
},
)
} else {
reject(
new Error('合同信息表单验证失败'),
this.$modal.msgError(
'请完善合同信息表单',
),
)
}
},
@ -1254,6 +1345,7 @@ export default {
} else {
//
reject(new Error('关键信息表单验证失败'))
this.$modal.msgError('请完善关键信息表单')
}
})
})

View File

@ -66,7 +66,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="合同签订日期" prop="contractStartDate">
<el-form-item label="合同签订日期">
<el-date-picker
type="date"
style="width: 100%"
@ -77,7 +77,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同终止日期" prop="contractStopDate">
<el-form-item label="合同终止日期">
<el-date-picker
type="date"
style="width: 100%"
@ -90,7 +90,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工资核定方式" prop="wageApprovedWay">
<el-form-item label="工资核定方式">
<el-radio-group
size="mini"
v-model="contractInfoForm.wageApprovedWay"
@ -223,6 +223,16 @@ export default {
validator: validateContractStopDate,
},
],
wageCriterion: [
{
required: false,
},
{
trigger: 'blur',
pattern: /^[1-9]\d{0,5}$/,
message: '请输入1-999999之间的正整数',
},
],
},
contractImageList: [

View File

@ -6,6 +6,7 @@
label-width="140px"
ref="salaryCardInfoFormRef"
:model="salaryCardInfoForm"
:rules="salaryCardInfoFormRules"
>
<TitleTip
titleText="工资卡见证"
@ -60,7 +61,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="银行名称" prop="bankName">
<el-form-item label="银行名称">
<el-input
clearable
maxlength="50"
@ -92,7 +93,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="银行支行名称" prop="bankBranchName">
<el-form-item label="银行支行名称">
<el-input
clearable
maxlength="50"
@ -184,6 +185,19 @@ export default {
},
],
salaryCardInfoFormRules: {
bankCardCode: [
{
required: false,
},
{
trigger: 'blur',
pattern: /^[1-9]\d{12,18}$/,
message: '请输入13-19位的正确银行卡号',
},
],
},
editUploadFileList: [],
}
},
@ -238,6 +252,8 @@ export default {
//
onHandleConfirmAddOrEditFun() {
return new Promise(async (resolve, reject) => {
this.$refs.salaryCardInfoFormRef.validate(async (valid) => {
if (valid) {
const status = this.checkFormStatus()
// 1. params
@ -291,7 +307,9 @@ export default {
fileIdList = this.editUploadFileList
.filter(
(item) =>
!reserveFileList.includes(item.id),
!reserveFileList.includes(
item.id,
),
)
.map((j) => j.id)
@ -337,6 +355,10 @@ export default {
this.$modal.msgError('工资卡信息上传失败,请重试')
reject(err)
}
} else {
reject(new Error('工资卡信息表单验证失败'))
}
})
})
},