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 | 92 ++++++++++++++++++++++++------
src/views/procurementManagement/procurementLedger/index.vue | 3
src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue | 3 +
src/views/salesManagement/salesQuotation/index.vue | 26 +++-----
src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue | 2
5 files changed, 88 insertions(+), 38 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue b/src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue
index b9eb42f..ffa727e 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/components/ApproveDetailPanel.vue
@@ -126,7 +126,7 @@
</span>
</el-descriptions-item>
</el-descriptions>
- <div v-if="detailData.products.length" style="margin-top: 20px;">
+ <div v-if="detailData.products?.length" style="margin-top: 20px;">
<h4>浜у搧鏄庣粏</h4>
<el-table :data="detailData.products"
border
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue b/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
index 4a9cf29..92b0372 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
@@ -370,6 +370,9 @@
detailDialog,
detailRow,
detailData,
+ quotationLoading,
+ purchaseLoading,
+ deliveryLoading,
reimburseDialog,
approveDialog,
approveOpinion,
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
index 3f0e99c..f61e038 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -86,6 +86,11 @@
const approveOpinion = ref("");
const approveSubmitting = ref(false);
+ /** 鎶ヤ环/閲囪喘/鍙戣揣璇︽儏鍔犺浇鐘舵�� */
+ const quotationLoading = ref(false);
+ const purchaseLoading = ref(false);
+ const deliveryLoading = ref(false);
+
/** 宸梾/璐圭敤鎶ラ攢涓撶敤璇︽儏銆佸鎵瑰脊绐� */
const reimburseDialog = reactive({
visible: false,
@@ -294,31 +299,53 @@
}
detailRow.value = { ...row };
+ const bizType = Number(row.businessType);
// 鎶ヤ环瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鎶ヤ环鍗曞彿"鍘绘煡鎶ヤ环鍒楄〃
- if (row.businessType === 6) {
+ if (bizType === 6) {
const quotationNo = row?.quotationNo;
if (quotationNo) {
- const res = await getQuotationList({ quotationNo });
- const records = res?.data?.records || [];
- detailData.value = records[0] || {};
+ 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 (row.businessType === 5) {
+ else if (bizType === 5) {
const purchaseContractNumber = row?.purchaseContractNumber;
if (purchaseContractNumber) {
- const res = await getPurchaseByCode({ purchaseContractNumber });
- detailData.value = res || {};
+ purchaseLoading.value = true;
+ try {
+ const res = await getPurchaseByCode({ purchaseContractNumber });
+ detailData.value = res || {};
+ } finally {
+ purchaseLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
}
}
// 鍙戣揣瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鍙戣揣鍗曞彿"鍘绘煡鍙戣揣璇︽儏
- else if (row.businessType === 7) {
+ else if (bizType === 7) {
const shippingNo = row?.shippingNo;
if (shippingNo) {
- const res = await getDeliveryDetailByShippingNo({ shippingNo });
- detailData.value = res?.data || res || {};
+ deliveryLoading.value = true;
+ try {
+ const res = await getDeliveryDetailByShippingNo({ shippingNo });
+ detailData.value = res?.data || res || {};
+ } finally {
+ deliveryLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
}
}
@@ -339,31 +366,53 @@
}
approveDialog.row = { ...row };
approveOpinion.value = "";
+ const bizType = Number(row.businessType);
// 鎶ヤ环瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鎶ヤ环鍗曞彿"鍘绘煡鎶ヤ环鍒楄〃
- if (row.businessType === 6) {
+ if (bizType === 6) {
const quotationNo = row?.quotationNo;
if (quotationNo) {
- const res = await getQuotationList({ quotationNo });
- const records = res?.data?.records || [];
- detailData.value = records[0] || {};
+ 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 (row.businessType === 5) {
+ else if (bizType === 5) {
const purchaseContractNumber = row?.purchaseContractNumber;
if (purchaseContractNumber) {
- const res = await getPurchaseByCode({ purchaseContractNumber });
- detailData.value = res || {};
+ purchaseLoading.value = true;
+ try {
+ const res = await getPurchaseByCode({ purchaseContractNumber });
+ detailData.value = res || {};
+ } finally {
+ purchaseLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
}
}
// 鍙戣揣瀹℃壒锛氱敤瀹℃壒浜嬬敱瀛楁鎵胯浇鐨�"鍙戣揣鍗曞彿"鍘绘煡鍙戣揣璇︽儏
- else if (row.businessType === 7) {
+ else if (bizType === 7) {
const shippingNo = row?.shippingNo;
if (shippingNo) {
- const res = await getDeliveryDetailByShippingNo({ shippingNo });
- detailData.value = res?.data || res || {};
+ deliveryLoading.value = true;
+ try {
+ const res = await getDeliveryDetailByShippingNo({ shippingNo });
+ detailData.value = res?.data || res || {};
+ } finally {
+ deliveryLoading.value = false;
+ }
+ } else {
+ detailData.value = {};
}
}
@@ -658,6 +707,9 @@
detailDialog,
detailRow,
detailData,
+ quotationLoading,
+ purchaseLoading,
+ deliveryLoading,
reimburseDialog,
approveDialog,
approveOpinion,
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 8a6c27d..15339b5 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -271,8 +271,7 @@
<template #default="scope">
<el-button link
type="primary"
- @click="openForm('edit', scope.row)"
- :disabled="scope.row.stockInStatus === '瀹屽叏鍏ュ簱'">缂栬緫
+ @click="openForm('edit', scope.row)">缂栬緫
</el-button>
<el-button link
type="primary"
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index fce764f..3944b41 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -70,7 +70,7 @@
</el-table-column>
<el-table-column label="鎿嶄綔" width="200" fixed="right" align="center">
<template #default="scope">
- <el-button link type="primary" @click="handleEdit(scope.row)" :disabled="!['寰呭鎵�','鎷掔粷'].includes(scope.row.status)">缂栬緫</el-button>
+ <el-button link type="primary" @click="handleEdit(scope.row)">缂栬緫</el-button>
<el-button link type="primary" @click="handleView(scope.row)" style="color: #67C23A">鏌ョ湅</el-button>
<el-button link type="danger" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
</template>
@@ -338,9 +338,6 @@
products: [],
subtotal: 0,
freight: 0,
- otherFee: 0,
- discountRate: 0,
- discountAmount: 0,
totalAmount: 0
})
@@ -595,10 +592,6 @@
}
})) : []
form.subtotal = row.subtotal || 0
- form.freight = row.freight || 0
- form.otherFee = row.otherFee || 0
- form.discountRate = row.discountRate || 0
- form.discountAmount = row.discountAmount || 0
form.totalAmount = row.totalAmount || 0
dialogVisible.value = true
@@ -639,8 +632,6 @@
form.subtotal = 0
form.freight = 0
form.otherFee = 0
- form.discountRate = 0
- form.discountAmount = 0
form.totalAmount = 0
}
@@ -693,11 +684,19 @@
}, 0)
form.customer = customerOption.value.find(item => item.id === form.customerId)?.customerName || ''
+
+ // 鍓旈櫎 products 涓殑 modelOptions 瀛楁锛屼互鍙� form 涓殑 subtotal銆乫reight 瀛楁
+ const { subtotal, freight, ...formWithoutSubtotal } = form
+ const submitData = {
+ ...formWithoutSubtotal,
+ products: form.products.map(({ modelOptions, ...rest }) => rest)
+ }
+
if (isEdit.value) {
// 缂栬緫
const index = quotationList.value.findIndex(item => item.id === editId.value)
if (index > -1) {
- updateQuotation(form).then(res=>{
+ updateQuotation(submitData).then(res=>{
// console.log(res)
if(res.code===200){
ElMessage.success('缂栬緫鎴愬姛')
@@ -708,7 +707,7 @@
}
} else {
// 鏂板
- addQuotation(form).then(res=>{
+ addQuotation(submitData).then(res=>{
if(res.code===200){
ElMessage.success('鏂板鎴愬姛')
dialogVisible.value = false
@@ -763,9 +762,6 @@
})) : [],
subtotal: item.subtotal || 0,
freight: item.freight || 0,
- otherFee: item.otherFee || 0,
- discountRate: item.discountRate || 0,
- discountAmount: item.discountAmount || 0,
totalAmount: item.totalAmount || 0
}))
pagination.total = res.data.total
--
Gitblit v1.9.3