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) { handleChange(file, fileList) {
console.log(file, fileList, '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('update:fileList', fileList)
this.$emit('onUploadChange', fileList) this.$emit('onUploadChange', fileList)
}, },

View File

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

View File

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

View File

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