This commit is contained in:
shijing 2025-11-13 15:29:25 +08:00
commit 0cbbb46957
1 changed files with 21 additions and 11 deletions

View File

@ -43,20 +43,28 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-footer> <el-footer>
<el-button type="danger" <el-button type="danger"
v-if="localMode=='edit'" v-if="localMode=='edit'"
v-auth="'supplieraudit.delete'"
:loading="saveLoading"
style="margin-right: 4px;" style="margin-right: 4px;"
@click="handleDel" @click="handleDel"
>删除</el-button> >删除</el-button>
<ticketd_b <ticketd_b
:workflow_key="'wf_supplieraudit'" v-if ="formData.ticket_"
:title="ticketTitle"
:t_id="formData.id" :t_id="formData.id"
:ticket_="formData.ticket_" :ticket_="formData.ticket_"
@success="$emit('success', localMode)" @success="$emit('success', localMode)"
:submit_b_func="submit_b_func" :submit_b_func="submit_b_func"
ref="ticketd_b" ref="ticketd_b"
></ticketd_b> ></ticketd_b>
<el-button
v-else
type="primary"
style="margin-right: 4px;"
@click="handleSave"
>提交审批</el-button>
</el-footer> </el-footer>
</el-main> </el-main>
<el-aside width="20%" v-if="formData.ticket_"> <el-aside width="20%" v-if="formData.ticket_">
@ -90,7 +98,7 @@ export default {
survery_form_: null survery_form_: null
}, },
localMode: this.mode, localMode: this.mode,
ticketTitle: "供应商审核" saveLoading: false,
} }
}, },
watch: { watch: {
@ -124,16 +132,18 @@ export default {
}) })
}) })
}, },
async submit_b_func() { handleSave() {
if (this.localMode == "add") { if (this.localMode == "add") {
let res = await this.$API.pum.supplieraudit.create.req(this.formData); this.saveLoading = true;
this.ticketTitle = this.formData.name + "的供应商审核"; this.$API.pum.supplieraudit.create.req(this.formData).then(res=>{
this.formData.id = res.id; this.saveLoading = true;
return res.id; this.$message.success("提交成功");
}).catch(e=>{
this.saveLoading = false;
})
this.$emit('success', this.localMode);
} else if (this.localMode == "edit") { } else if (this.localMode == "edit") {
console.log(this.formData); this.$message.error("不支持编辑!")
this.$message.error("不支持编辑");
throw new Error("不支持编辑");
} }
}, },
} }