| | |
| | | submitContract, |
| | | } from '#/api/crm/contract'; |
| | | import { $t } from '#/locales'; |
| | | import { automaticApproval } from '#/store/audit-policy'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import Form from './modules/form.vue'; |
| | |
| | | const submitLoading = ref(false); |
| | | |
| | | async function handleSubmit(row: CrmContractApi.Contract) { |
| | | const res = await getContractApproveProcessList(); |
| | | const res = automaticApproval.value ? [] : await getContractApproveProcessList(); |
| | | processList.value = res; |
| | | currentRow.value = row; |
| | | selectedProcessKey.value = undefined; |
| | | if (automaticApproval.value) { |
| | | selectedProcessKey.value = 'contract_approve'; |
| | | await confirmSubmit(); |
| | | return; |
| | | } |
| | | submitModalVisible.value = true; |
| | | } |
| | | |
| | |
| | | submitLoading.value = true; |
| | | try { |
| | | await submitContract(currentRow.value!.id!, selectedProcessKey.value); |
| | | message.success('提交审批成功'); |
| | | message.success(automaticApproval.value ? '已提交生效' : '提交审批成功'); |
| | | submitModalVisible.value = false; |
| | | handleRefresh(); |
| | | } finally { |