From f9adfa16fdf2012e915908ea1fed19f75d5107a4 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 30 五月 2026 17:14:02 +0800
Subject: [PATCH] 新疆马铃薯 1.报价提交问题
---
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js | 130 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 127 insertions(+), 3 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
index 67b9213..f61e038 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -10,6 +10,9 @@
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";
@@ -77,10 +80,16 @@
const detailDialog = reactive({ visible: false });
const detailRow = ref({});
+ const detailData = ref({});
const approveDialog = reactive({ visible: false, row: null });
const approveOpinion = ref("");
const approveSubmitting = ref(false);
+
+ /** 鎶ヤ环/閲囪喘/鍙戣揣璇︽儏鍔犺浇鐘舵�� */
+ const quotationLoading = ref(false);
+ const purchaseLoading = ref(false);
+ const deliveryLoading = ref(false);
/** 宸梾/璐圭敤鎶ラ攢涓撶敤璇︽儏銆佸鎵瑰脊绐� */
const reimburseDialog = reactive({
@@ -135,7 +144,7 @@
}));
const tableColumn = ref([
- { label: "鐢宠浜虹紪鍙�", prop: "applicantNo", width: 110 },
+ // { label: "鐢宠浜虹紪鍙�", prop: "applicantNo", width: 110 },
{ label: "鐢宠浜哄悕绉�", prop: "applicantName", minWidth: 100 },
{ label: "妯℃澘绫诲瀷", prop: "businessName", minWidth: 120 },
{
@@ -220,7 +229,7 @@
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);
@@ -288,11 +297,68 @@
await openReimburseDetail(row, "detail");
return;
}
+
detailRow.value = { ...row };
+ const bizType = Number(row.businessType);
+ // 鎶ヤ环瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鎶ヤ环鍗曞彿"鍘绘煡鎶ヤ环鍒楄〃
+ if (bizType === 6) {
+ const quotationNo = row?.quotationNo;
+ if (quotationNo) {
+ quotationLoading.value = true;
+ try {
+ const res = await getQuotationList({ quotationNo });
+ const records = res?.data?.records || [];
+ detailData.value = records[0] || {};
+ } finally {
+ quotationLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
+ }
+ }
+
+ // 閲囪喘瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"閲囪喘鍚堝悓鍙�"鍘绘煡閲囪喘璇︽儏
+ else if (bizType === 5) {
+ const purchaseContractNumber = row?.purchaseContractNumber;
+ if (purchaseContractNumber) {
+ purchaseLoading.value = true;
+ try {
+ const res = await getPurchaseByCode({ purchaseContractNumber });
+ detailData.value = res || {};
+ } finally {
+ purchaseLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
+ }
+ }
+
+ // 鍙戣揣瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鍙戣揣鍗曞彿"鍘绘煡鍙戣揣璇︽儏
+ else if (bizType === 7) {
+ const shippingNo = row?.shippingNo;
+ if (shippingNo) {
+ deliveryLoading.value = true;
+ try {
+ const res = await getDeliveryDetailByShippingNo({ shippingNo });
+ detailData.value = res?.data || res || {};
+ } finally {
+ deliveryLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
+ }
+ }
+
+ // 鍏朵粬瀹℃壒绫诲瀷
+ else {
+ detailData.value = {};
+ }
+
detailDialog.visible = true;
}
async function openApprove(row) {
+
if (inferReimburseModuleKeyFromInstance(row)) {
approveOpinion.value = "";
await openReimburseDetail(row, "approve");
@@ -300,6 +366,60 @@
}
approveDialog.row = { ...row };
approveOpinion.value = "";
+ const bizType = Number(row.businessType);
+ // 鎶ヤ环瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鎶ヤ环鍗曞彿"鍘绘煡鎶ヤ环鍒楄〃
+ if (bizType === 6) {
+ const quotationNo = row?.quotationNo;
+ if (quotationNo) {
+ quotationLoading.value = true;
+ try {
+ const res = await getQuotationList({ quotationNo });
+ const records = res?.data?.records || [];
+ detailData.value = records[0] || {};
+ } finally {
+ quotationLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
+ }
+ }
+
+ // 閲囪喘瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"閲囪喘鍚堝悓鍙�"鍘绘煡閲囪喘璇︽儏
+ else if (bizType === 5) {
+ const purchaseContractNumber = row?.purchaseContractNumber;
+ if (purchaseContractNumber) {
+ purchaseLoading.value = true;
+ try {
+ const res = await getPurchaseByCode({ purchaseContractNumber });
+ detailData.value = res || {};
+ } finally {
+ purchaseLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
+ }
+ }
+
+ // 鍙戣揣瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鍙戣揣鍗曞彿"鍘绘煡鍙戣揣璇︽儏
+ else if (bizType === 7) {
+ const shippingNo = row?.shippingNo;
+ if (shippingNo) {
+ deliveryLoading.value = true;
+ try {
+ const res = await getDeliveryDetailByShippingNo({ shippingNo });
+ detailData.value = res?.data || res || {};
+ } finally {
+ deliveryLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
+ }
+ }
+
+ // 鍏朵粬瀹℃壒绫诲瀷
+ else {
+ detailData.value = {};
+ }
approveDialog.visible = true;
}
@@ -586,6 +706,10 @@
tableColumn,
detailDialog,
detailRow,
+ detailData,
+ quotationLoading,
+ purchaseLoading,
+ deliveryLoading,
reimburseDialog,
approveDialog,
approveOpinion,
@@ -625,4 +749,4 @@
openApprove,
fetchApprovalList,
};
-}
+}
\ No newline at end of file
--
Gitblit v1.9.3