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