| | |
| | | import { getQuotationList } from "@/api/salesManagement/salesQuotation.js"; |
| | | import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { getDeliveryDetailByShippingNo } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import { ledgerListPage, getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | |
| | | fetchBusinessTypeOptions(), |
| | | listApprovalTemplate(TEMPLATE_TYPE_CUSTOM), |
| | | ]); |
| | | submitBusinessTypeOptions.value = typeOptions.filter((x) => ![5, 6, 7].includes(x.value)); |
| | | submitBusinessTypeOptions.value = typeOptions.filter((x) => ![5, 6, 7, 19].includes(x.value)); |
| | | allSubmitTemplates.value = unwrapTemplateList(customRes) |
| | | .filter((row) => mapEnabledFromApi(row.enabled)) |
| | | .map(mapSubmitTemplateCard); |
| | |
| | | } |
| | | } |
| | | |
| | | // 销售审批:用 quotationNo(销售合同号)去查销售台账详情 |
| | | else if (row.businessType === 19) { |
| | | const salesContractNo = row?.quotationNo; |
| | | if (salesContractNo) { |
| | | const listRes = await ledgerListPage({ salesContractNo }); |
| | | const records = listRes?.records || listRes?.data || []; |
| | | const ledger = Array.isArray(records) ? records[0] : null; |
| | | if (ledger?.id) { |
| | | const detail = await getSalesLedgerWithProducts({ id: ledger.id, type: 1 }); |
| | | detailData.value = detail || ledger; |
| | | } else { |
| | | detailData.value = ledger || {}; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 其他审批类型 |
| | | else { |
| | | detailData.value = {}; |
| | |
| | | } |
| | | } |
| | | |
| | | // 销售审批:用 quotationNo(销售合同号)去查销售台账详情 |
| | | else if (row.businessType === 19) { |
| | | const salesContractNo = row?.quotationNo; |
| | | if (salesContractNo) { |
| | | const listRes = await ledgerListPage({ salesContractNo }); |
| | | const records = listRes?.records || listRes?.data || []; |
| | | const ledger = Array.isArray(records) ? records[0] : null; |
| | | if (ledger?.id) { |
| | | const detail = await getSalesLedgerWithProducts({ id: ledger.id, type: 1 }); |
| | | detailData.value = detail || ledger; |
| | | } else { |
| | | detailData.value = ledger || {}; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 其他审批类型 |
| | | else { |
| | | detailData.value = {}; |