feat(合同/客户): 添加发货单据展示功能

在合同和客户详情页新增发货单据标签页,展示wmsDeliveryWaybills数据
移除CustomerOrder中未使用的getSummary方法和相关代码
This commit is contained in:
砂糖
2026-04-11 16:24:04 +08:00
parent b4dc0ed9e4
commit 4beaf79fd6
4 changed files with 32 additions and 48 deletions

View File

@@ -108,8 +108,6 @@ export default {
rules: {
},
orderId: '',
// customerList: [],
currentCustomer: {},
};
},
computed: {
@@ -123,46 +121,12 @@ export default {
if (newVal !== oldVal) {
this.queryParams.customerId = newVal;
this.getList();
this.getSummary();
}
},
immediate: true
}
},
methods: {
/** 查询正式订单主列表 */
getSummary() {
Promise.all(
[
listOrder({
pageNum: 1,
pageSize: 1,
customerId: this.customerId,
preOrderStatus: 0, // 待审核
}),
listOrder({
pageNum: 1,
pageSize: 1,
customerId: this.customerId,
preOrderStatus: 1, // 已审核
}),
listOrder({
pageNum: 1,
pageSize: 1,
customerId: this.customerId,
preOrderStatus: 2, // 已取消
}),
]
).then(([preOrderList, auditOrderList, canOrderList]) => {
console.log(preOrderList, auditOrderList, canOrderList)
this.currentCustomer = {
waitCount: preOrderList.total,
dealCount: auditOrderList.total,
cancelCount: canOrderList.total,
total: preOrderList.total + auditOrderList.total + canOrderList.total,
}
})
},
getList() {
if (!this.customerId) {
this.total = 0;

View File

@@ -40,6 +40,7 @@
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
<DeliveryTable v-else-if="activeTab === 'seventh'" :data="wmsDeliveryWaybills" />
<CoilTable v-else-if="activeTab === 'fifth'" :data="coilList" />
<div v-else-if="activeTab === 'sixth'" class="attachment-section">
<div class="attachment-item">
@@ -67,14 +68,16 @@
import OrderPage from "@/views/crm/order/index.vue";
import CoilTable from "../../components/CoilTable.vue";
import FileList from "@/components/FileList";
import DeliveryTable from "../../components/DeliveryTable.vue";
export default {
name: "ContractTabs",
components: {
OrderPage,
CoilTable,
FileList
},
FileList,
DeliveryTable
},
props: {
contractId: {
type: [Number, String],
@@ -116,6 +119,10 @@ export default {
otherAttachment: {
type: String,
default: ''
},
wmsDeliveryWaybills: {
type: Array,
default: () => []
}
},
data() {
@@ -128,7 +135,8 @@ export default {
{ label: "财务状态", name: "third" },
{ label: "订单异议", name: "fourth" },
{ label: "发货配卷", name: "fifth" },
{ label: "合同附件", name: "sixth" }
{ label: '发货单据', name: 'seventh' },
{ label: "合同附件", name: "sixth" },
]
};
},

View File

@@ -26,6 +26,7 @@
<div class="tab-panel" ref="tabPanel" style="flex: 1; overflow-y: auto;">
<ContractTabs :contractId="form.contractId"
:customerId="form.customerId" :financeList="financeList" :objectionList="objectionList"
:wmsDeliveryWaybills="wmsDeliveryWaybills"
:coilList="coilList" :tabLoading="tabLoading"
:contract-attachment="form.businessAnnex"
:technical-agreement="form.techAnnex"
@@ -157,7 +158,6 @@ import ContractPreview from "./components/ContractPreview.vue";
import ContractTabs from "./components/ContractTabs.vue";
import ProductContent from "./components/ProductContent.vue";
import CustomerSelect from "@/components/KLPService/CustomerSelect/index.vue";
import { formatAreaTextEnhanced } from '@/components/ChinaAreaSelect/index.js'
export default {
name: "Contract",
@@ -166,12 +166,13 @@ export default {
ContractPreview,
ContractTabs,
ProductContent,
CustomerSelect
CustomerSelect,
},
data() {
return {
financeList: [],
objectionList: [],
wmsDeliveryWaybills: [],
coilList: [],
loading: false,
tabLoading: false,
@@ -319,6 +320,7 @@ export default {
listContractOrderObjection(row.contractId).then(response => {
this.financeList = response.data.financeList || [];
this.objectionList = response.data.oobjectionList || [];
this.wmsDeliveryWaybills = response.data.wmsDeliveryWaybills || [];
}).finally(() => {
this.tabLoading = false;
})

View File

@@ -6,17 +6,18 @@
<div style="font-weight: 900;">客户列表</div>
<!-- 搜索区域 -->
<div style="display: flex; align-items: center; gap: 5px; margin-top: 10px;">
<el-input style="flex: 1;" prefix-icon="el-icon-search" placeholder="输入关键字搜索"
v-model="queryParams.keyword" @change="getCustomerList" clearable></el-input>
<el-input style="flex: 1;" prefix-icon="el-icon-search" placeholder="输入关键字搜索" v-model="queryParams.keyword"
@change="getCustomerList" clearable></el-input>
<el-button icon="el-icon-sort" @click="toggleQuery"></el-button>
<el-button type="primary" icon="el-icon-search" style="margin-left: 0;" size="mini" @click="getCustomerList"></el-button>
<el-button type="primary" icon="el-icon-search" style="margin-left: 0;" size="mini"
@click="getCustomerList"></el-button>
<el-button type="primary" icon="el-icon-plus" style="margin-left: 0;" @click="handleAdd"></el-button>
</div>
<!-- 高级查询区域 -->
<div v-show="showQuery"
style="display: flex; align-items: center; gap: 5px; margin-top: 10px; flex-wrap: wrap;">
<el-input style="width: 180px" placeholder="客户编码"
v-model="queryParams.customerCode" @change="getCustomerList" clearable></el-input>
<el-input style="width: 180px" placeholder="客户编码" v-model="queryParams.customerCode" @change="getCustomerList"
clearable></el-input>
<el-select style="width: 100px;" v-model="queryParams.industry" placeholder="客户行业" clearable
@change="getCustomerList">
<el-option v-for="item in dict.type.customer_industry" :key="item.value" :label="item.label"
@@ -98,6 +99,9 @@
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
</el-tab-pane>
<el-tab-pane label="发货单据" name="seventh">
<DeliveryTable :data="wmsDeliveryWaybills" />
</el-tab-pane>
<el-tab-pane label="发货配卷" name="fifth">
<CoilTable :data="coilList" />
</el-tab-pane>
@@ -164,6 +168,7 @@ import CustomerEdit from '../components/CustomerEdit.vue'
import CustomerOrder from '../components/CustomerOrder.vue'
import ChinaAreaSelect from '@/components/ChinaAreaSelect/index.vue'
import CoilTable from '../components/CoilTable.vue'
import DeliveryTable from '../components/DeliveryTable.vue'
import { listCustomer, addCustomer, updateCustomer, delCustomer, listCoilByCustomerId, listFinanceByCustomerId } from '@/api/crm/customer'
@@ -176,13 +181,15 @@ export default {
CustomerEdit,
CustomerOrder,
ChinaAreaSelect,
CoilTable
CoilTable,
DeliveryTable
},
dicts: ['customer_industry', 'customer_level'],
data() {
return {
customerList: [],
financeList: [],
wmsDeliveryWaybills: [],
objectionList: [],
coilList: [],
showQuery: false,
@@ -235,6 +242,7 @@ export default {
listFinanceByCustomerId(this.currentCustomerId).then(response => {
this.financeList = response.data.financeList || [];
this.objectionList = response.data.oobjectionList || [];
this.wmsDeliveryWaybills = response.data.wmsDeliveryWaybills || [];
}).catch(() => {
this.$message.error('获取客户财务状态失败');
});
@@ -242,7 +250,7 @@ export default {
/** 查询合同配卷列表 */
getCoilList() {
listContractPackaging(this.form.contractId).then(response => {
listCoilByCustomerId(this.currentCustomerId).then(response => {
this.coilList = response.data || [];
})
},
@@ -303,6 +311,8 @@ export default {
handleItemClick(item) {
this.currentCustomer = { ...item };
this.getFinanceList();
this.getCoilList();
this.activeTab = 'detail';
},