Compare commits

..

No commits in common. "3dca3613257042f12bed295109f9775640c962b8" and "1049053a8285a55fe78d837914a313b2ea551486" have entirely different histories.

2 changed files with 15 additions and 15 deletions

View File

@ -30,22 +30,16 @@
v-if="localMode=='edit'"
style="margin-right: 4px;"
@click="handleDel"
:loading="saveLoading"
>删除</el-button>
<ticketd_b
v-if = "formData.ticket_"
:workflow_key="'wf_resignation'"
:title="ticketTitle"
:t_id="formData.id"
:ticket_="formData.ticket_"
@success="$emit('success', localMode)"
:submit_b_func="submit_b_func"
ref="ticketd_b"
></ticketd_b>
<el-button
v-else
type="primary"
style="margin-right: 4px;"
@click="handleSave"
:loading="saveLoading"
>提交审批</el-button>
</el-footer>
</el-main>
<el-aside width="20%" v-if="formData.ticket_">
@ -80,7 +74,12 @@ export default {
employee_name: ""
},
localMode: this.mode,
saveLoading: false
ticketTitle: "离职申请"
}
},
watch: {
mode(newVal) {
this.localMode = newVal;
}
},
mounted() {
@ -125,18 +124,20 @@ export default {
})
})
},
async handleSave() {
async submit_b_func() {
if (this.localMode == "add") {
try {
let res = await this.$API.hrm.resignation.create.req(this.formData);
this.$message.success("提交成功");
this.$emit('success', this.localMode);
this.ticketTitle = this.formData.employee_name + "的离职申请";
this.formData.id = res.id;
return res.id;
} catch (error) {
console.error('提交离职申请失败:', error);
throw error;
}
} else if (this.localMode == "edit") {
this.$message.error("不支持编辑");
throw new Error("不支持编辑");
}
}
}

View File

@ -63,7 +63,6 @@
type="primary"
style="margin-right: 4px;"
@click="handleSave"
:loading="saveLoading"
>提交审批</el-button>
</el-footer>
</el-main>
@ -138,10 +137,10 @@ export default {
this.$API.pum.supplieraudit.create.req(this.formData).then(res=>{
this.saveLoading = true;
this.$message.success("提交成功");
this.$emit('success', this.localMode);
}).catch(e=>{
this.saveLoading = false;
})
this.$emit('success', this.localMode);
} else if (this.localMode == "edit") {
this.$message.error("不支持编辑!")
}