This commit is contained in:
parent
c08663c861
commit
0cfd021035
|
|
@ -122,16 +122,40 @@ export default {
|
|||
personExitFormRules: {
|
||||
fileList: [
|
||||
{
|
||||
required: true,
|
||||
trigger: 'change,blur',
|
||||
required: this.checkExitFileFun() == 1,
|
||||
message: '请上传离场工资结算确认单',
|
||||
validator: this.validateFileList,
|
||||
},
|
||||
],
|
||||
},
|
||||
needExitFile: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 确定按钮
|
||||
async initExitFileRule() {
|
||||
if (!this.personExitFormData.proId) {
|
||||
return
|
||||
}
|
||||
const result = await this.checkExitFileFun()
|
||||
|
||||
this.needExitFile = result == 1
|
||||
if (this.needExitFile) {
|
||||
this.personExitFormRules.fileList[0].required = true
|
||||
} else {
|
||||
this.personExitFormRules.fileList[0].required = false
|
||||
}
|
||||
},
|
||||
validateFileList(rule, value, callback) {
|
||||
if (this.needExitFile) {
|
||||
if (!value || value.length === 0) {
|
||||
callback(new Error('请上传离场工资结算确认单'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
onHandleConfirmAddOrEditFun() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (this.isExitUpload === 1) {
|
||||
|
|
@ -236,7 +260,7 @@ export default {
|
|||
handler(newVal) {
|
||||
if (Object.keys(newVal).length > 0) {
|
||||
Object.assign(this.personExitFormData, newVal)
|
||||
this.checkExitFileFun()
|
||||
this.initExitFileRule()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue