refactor(crm): 重构合同模块为订单模块并优化相关功能
重构合同模块为订单模块,包括以下主要变更: 1. 将合同编号字段从contractNo统一改为contractCode 2. 在CrmOrderBo中添加日期格式化注解 3. 重构ContractTabs组件为订单详情页 4. 添加销售员字段和相关选择器 5. 优化订单列表查询条件和展示 6. 调整订单附件管理功能
This commit is contained in:
@@ -1,48 +1,39 @@
|
||||
<template>
|
||||
<div class="contract-tabs">
|
||||
<div v-if="contractId" class="tabs-content">
|
||||
<div class="custom-tabbar" v-loading="tabLoading">
|
||||
<div
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === tab.name }"
|
||||
@click="activeTab = tab.name"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<OrderPage v-if="activeTab === 'second'" :contractId="contractId" :customerId="customerId" />
|
||||
<KLPTable v-else-if="activeTab === 'third'" v-loading="loading" :data="financeList">
|
||||
<el-table-column label="收款日期" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收款金额" align="center" prop="amount" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</KLPTable>
|
||||
<el-table v-else-if="activeTab === 'fourth'" v-loading="loading" :data="objectionList">
|
||||
<el-table-column label="编号" align="center" prop="objectionCode" />
|
||||
<el-table-column label="状态" align="center" prop="objectionStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.objectionStatus === 0" type="danger">待处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 1" type="success">已处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 2" type="info">已关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理人" align="center" prop="handleUser" />
|
||||
<el-table-column label="处理时间" align="center" prop="handleTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</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 v-if="orderId" class="tabs-content">
|
||||
<el-tabs v-model="activeTab" type="border-card">
|
||||
<el-tab-pane label="订单编辑" name="edit" v-hasPermi="['crm:order:edit']">
|
||||
<div class="order-detail" v-if="activeTab === 'edit'">
|
||||
<el-descriptions title="订单明细" />
|
||||
<OrderDetail :orderId="currentOrder.orderId" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="财务状态" name="finance" v-hasPermi="['crm:order:finance']">
|
||||
<div class="order-finance" v-if="activeTab === 'finance'">
|
||||
<!-- 财务状态内容 -->
|
||||
<ReceiveTable :order="currentOrder" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="订单异议" name="dispute" v-hasPermi="['crm:order:objection']">
|
||||
<div class="order-dispute" v-if="activeTab === 'dispute'">
|
||||
<!-- 订单异议内容 -->
|
||||
<OrderObjection :order="currentOrder" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货配卷" name="coil">
|
||||
<div class="order-record" v-if="activeTab === 'coil'">
|
||||
<!-- 发货配卷内容 -->
|
||||
<CoilTable :data="coilList" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货单据" name="delivery">
|
||||
<div class="order-record" v-if="activeTab === 'delivery'">
|
||||
<!-- 发货单内容 -->
|
||||
<DeliveryTable :data="deliveryWaybillList" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同附件" name="attachment" v-hasPermi="['crm:order:record']">
|
||||
<div class="attachment-item">
|
||||
<h4>商务附件</h4>
|
||||
<FileList :oss-ids="contractAttachment" />
|
||||
@@ -55,8 +46,18 @@
|
||||
<h4>排产函</h4>
|
||||
<FileList :oss-ids="otherAttachment" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="attachment-item">
|
||||
<h4>其他附件</h4>
|
||||
<FileList :oss-ids="form.annexFiles" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作记录" name="record" v-hasPermi="['crm:order:record']">
|
||||
<div class="order-record" v-if="activeTab === 'record'">
|
||||
<!-- 操作记录内容 -->
|
||||
<OrderRecord :orderId="currentOrder.orderId" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div v-else class="no-selection" style="display: flex; align-items: center; justify-content: center; height: 100%;">
|
||||
<el-empty description="请先选择合同" />
|
||||
@@ -65,21 +66,32 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OrderPage from "@/views/crm/order/index.vue";
|
||||
// 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";
|
||||
|
||||
// 导入可能需要的组件
|
||||
import OrderDetail from "../../components/OrderDetail.vue";
|
||||
import OrderEdit from "../../components/OrderEdit.vue";
|
||||
import ReceiveTable from "../../components/ReceiveTable.vue";
|
||||
import OrderObjection from "../../components/OrderObjection.vue";
|
||||
import OrderRecord from "../../components/OrderRecord.vue";
|
||||
|
||||
export default {
|
||||
name: "ContractTabs",
|
||||
components: {
|
||||
OrderPage,
|
||||
CoilTable,
|
||||
FileList,
|
||||
DeliveryTable
|
||||
},
|
||||
DeliveryTable,
|
||||
OrderDetail,
|
||||
OrderEdit,
|
||||
ReceiveTable,
|
||||
OrderObjection,
|
||||
OrderRecord
|
||||
},
|
||||
props: {
|
||||
contractId: {
|
||||
orderId: {
|
||||
type: [Number, String],
|
||||
default: null
|
||||
},
|
||||
@@ -123,21 +135,29 @@ export default {
|
||||
wmsDeliveryWaybills: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
// 新增必要的props
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
currentOrder: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
customerList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
deliveryWaybillList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 活动tab
|
||||
activeTab: "second",
|
||||
// 标签页配置
|
||||
tabs: [
|
||||
{ label: "下发订单", name: "second" },
|
||||
{ label: "财务状态", name: "third" },
|
||||
{ label: "订单异议", name: "fourth" },
|
||||
{ label: "发货配卷", name: "fifth" },
|
||||
{ label: '发货单据', name: 'seventh' },
|
||||
{ label: "合同附件", name: "sixth" },
|
||||
]
|
||||
activeTab: "finance"
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -158,80 +178,11 @@ export default {
|
||||
.replace('{h}', hours)
|
||||
.replace('{i}', minutes)
|
||||
.replace('{s}', seconds);
|
||||
},
|
||||
// 处理订单保存
|
||||
handleOrderSave() {
|
||||
// 这里可以添加保存逻辑
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.contract-tabs {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tabs-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.custom-tabbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
background-color: #f5f7fa;
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tab-item:hover {
|
||||
color: #409eff;
|
||||
background-color: rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #409eff;
|
||||
background-color: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.attachment-section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.attachment-item h4 {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.attachment-item .file-list-container {
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</script>
|
||||
Reference in New Issue
Block a user