| | |
| | | saveApprovalInstance, |
| | | updateApprovalInstance, |
| | | } from "@/api/officeProcessAutomation/approvalInstance.js"; |
| | | import { getQuotationList } from "@/api/salesManagement/salesQuotation.js"; |
| | | import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { getDeliveryDetailByShippingNo } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | |
| | | |
| | | const detailDialog = reactive({ visible: false }); |
| | | const detailRow = ref({}); |
| | | const detailData = ref({}); |
| | | |
| | | const approveDialog = reactive({ visible: false, row: null }); |
| | | const approveOpinion = ref(""); |
| | |
| | | fetchBusinessTypeOptions(), |
| | | listApprovalTemplate(TEMPLATE_TYPE_CUSTOM), |
| | | ]); |
| | | submitBusinessTypeOptions.value = typeOptions; |
| | | submitBusinessTypeOptions.value = typeOptions.filter((x) => ![5, 6, 7].includes(x.value)); |
| | | allSubmitTemplates.value = unwrapTemplateList(customRes) |
| | | .filter((row) => mapEnabledFromApi(row.enabled)) |
| | | .map(mapSubmitTemplateCard); |
| | |
| | | await openReimburseDetail(row, "detail"); |
| | | return; |
| | | } |
| | | |
| | | detailRow.value = { ...row }; |
| | | // 报价审批:用审批事由字段承载的"报价单号"去查报价列表 |
| | | if (row.businessType === 6) { |
| | | const quotationNo = row?.quotationNo; |
| | | if (quotationNo) { |
| | | const res = await getQuotationList({ quotationNo }); |
| | | const records = res?.data?.records || []; |
| | | detailData.value = records[0] || {}; |
| | | } |
| | | } |
| | | |
| | | // 采购审批:用审批事由字段承载的"采购合同号"去查采购详情 |
| | | else if (row.businessType === 5) { |
| | | const purchaseContractNumber = row?.purchaseContractNumber; |
| | | if (purchaseContractNumber) { |
| | | const res = await getPurchaseByCode({ purchaseContractNumber }); |
| | | detailData.value = res || {}; |
| | | } |
| | | } |
| | | |
| | | // 发货审批:用审批事由字段承载的"发货单号"去查发货详情 |
| | | else if (row.businessType === 7) { |
| | | const shippingNo = row?.shippingNo; |
| | | if (shippingNo) { |
| | | const res = await getDeliveryDetailByShippingNo({ shippingNo }); |
| | | detailData.value = res?.data || res || {}; |
| | | } |
| | | } |
| | | |
| | | // 其他审批类型 |
| | | else { |
| | | detailData.value = {}; |
| | | } |
| | | |
| | | detailDialog.visible = true; |
| | | } |
| | | |
| | | async function openApprove(row) { |
| | | |
| | | if (inferReimburseModuleKeyFromInstance(row)) { |
| | | approveOpinion.value = ""; |
| | | await openReimburseDetail(row, "approve"); |
| | |
| | | } |
| | | approveDialog.row = { ...row }; |
| | | approveOpinion.value = ""; |
| | | // 报价审批:用审批事由字段承载的"报价单号"去查报价列表 |
| | | if (row.businessType === 6) { |
| | | const quotationNo = row?.quotationNo; |
| | | if (quotationNo) { |
| | | const res = await getQuotationList({ quotationNo }); |
| | | const records = res?.data?.records || []; |
| | | detailData.value = records[0] || {}; |
| | | } |
| | | } |
| | | |
| | | // 采购审批:用审批事由字段承载的"采购合同号"去查采购详情 |
| | | else if (row.businessType === 5) { |
| | | const purchaseContractNumber = row?.purchaseContractNumber; |
| | | if (purchaseContractNumber) { |
| | | const res = await getPurchaseByCode({ purchaseContractNumber }); |
| | | detailData.value = res || {}; |
| | | } |
| | | } |
| | | |
| | | // 发货审批:用审批事由字段承载的"发货单号"去查发货详情 |
| | | else if (row.businessType === 7) { |
| | | const shippingNo = row?.shippingNo; |
| | | if (shippingNo) { |
| | | const res = await getDeliveryDetailByShippingNo({ shippingNo }); |
| | | detailData.value = res?.data || res || {}; |
| | | } |
| | | } |
| | | |
| | | // 其他审批类型 |
| | | else { |
| | | detailData.value = {}; |
| | | } |
| | | approveDialog.visible = true; |
| | | } |
| | | |
| | |
| | | tableColumn, |
| | | detailDialog, |
| | | detailRow, |
| | | detailData, |
| | | reimburseDialog, |
| | | approveDialog, |
| | | approveOpinion, |
| | |
| | | openApprove, |
| | | fetchApprovalList, |
| | | }; |
| | | } |
| | | } |