refactor(crm): 重构合同模块为订单模块并优化相关功能
重构合同模块为订单模块,包括以下主要变更: 1. 将合同编号字段从contractNo统一改为contractCode 2. 在CrmOrderBo中添加日期格式化注解 3. 重构ContractTabs组件为订单详情页 4. 添加销售员字段和相关选择器 5. 优化订单列表查询条件和展示 6. 调整订单附件管理功能
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<span>订单信息</span>
|
||||
<el-button @click.stop="openOrderDialog" style="margin-left: 10px;" plain
|
||||
:type="formData.orderId ? 'success' : 'default'">
|
||||
{{ formData.orderId ? formData.orderCode : '选择订单' }}
|
||||
{{ formData.orderId ? formData.contractCode : '选择订单' }}
|
||||
</el-button>
|
||||
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog" style="margin-left: 10px; cursor: pointer; color: #409eff;"
|
||||
type="primary">
|
||||
@@ -210,14 +210,14 @@
|
||||
<div class="order-dialog-content">
|
||||
<!-- 筛选条件 -->
|
||||
<el-form :model="orderQueryParams" ref="orderQueryForm" size="small" :inline="true" label-width="80px">
|
||||
<el-form-item label="合同号">
|
||||
<!-- <el-form-item label="合同号">
|
||||
<el-select v-model="orderQueryParams.contractId" placeholder="请选择合同">
|
||||
<el-option v-for="contract in contractList" :key="contract.contractId" :label="contract.contractNo"
|
||||
:value="contract.contractId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="orderQueryParams.orderCode" placeholder="请输入订单号" style="width: 180px" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="合同号" prop="contractCode">
|
||||
<el-input v-model="orderQueryParams.contractCode" placeholder="请输入合同号" style="width: 180px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户">
|
||||
<el-input v-model="orderQueryParams.customerName" placeholder="请输入客户名称" style="width: 180px" />
|
||||
@@ -234,7 +234,7 @@
|
||||
<!-- 订单列表 -->
|
||||
<el-table v-loading="orderLoading" :data="orderList" style="width: 100%" @row-click="handleOrderSelect">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="orderCode" label="订单号" width="150" />
|
||||
<!-- <el-table-column prop="orderCode" label="订单号" width="150" /> -->
|
||||
<el-table-column prop="orderType" label="订单类型" width="100" />
|
||||
<el-table-column prop="contractCode" label="合同号" width="150" />
|
||||
<el-table-column prop="companyName" label="客户" width="180" />
|
||||
@@ -365,7 +365,7 @@ export default {
|
||||
openOrderDialog() {
|
||||
this.dialogVisible = true;
|
||||
// 加载合同列表
|
||||
this.getContractList();
|
||||
// this.getContractList();
|
||||
// 加载订单列表
|
||||
this.getOrderList();
|
||||
},
|
||||
@@ -379,13 +379,13 @@ export default {
|
||||
return;
|
||||
}
|
||||
const order = await getOrder(this.formData.orderId);
|
||||
if (!order.data.contractId) {
|
||||
this.$message.error('未找到合同')
|
||||
return;
|
||||
}
|
||||
// if (!order.data.contractId) {
|
||||
// this.$message.error('未找到合同')
|
||||
// return;
|
||||
// }
|
||||
// 根据合同id拿到合同详情
|
||||
const contract = await getContract(order.data.contractId);
|
||||
this.contract = contract.data;
|
||||
// const contract = await getContract(order.data.contractId);
|
||||
this.contract = order.data;
|
||||
} catch {
|
||||
this.$message.error('获取合同附件失败')
|
||||
} finally {
|
||||
@@ -393,11 +393,11 @@ export default {
|
||||
}
|
||||
},
|
||||
/** 获取合同列表 */
|
||||
getContractList() {
|
||||
listContract().then(response => {
|
||||
this.contractList = response.rows;
|
||||
});
|
||||
},
|
||||
// getContractList() {
|
||||
// listContract().then(response => {
|
||||
// this.contractList = response.rows;
|
||||
// });
|
||||
// },
|
||||
/** 获取订单列表 */
|
||||
getOrderList() {
|
||||
this.orderLoading = true;
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="queryParams.contractNo" placeholder="请输入合同编号" clearable
|
||||
<el-form-item label="销售员" prop="salesman">
|
||||
<el-input v-model="queryParams.salesman" placeholder="请输入销售员" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="queryParams.contractCode" placeholder="请输入合同编号" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供方" prop="supplier">
|
||||
@@ -116,12 +120,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listContract, updateContract } from "@/api/crm/contract";
|
||||
import { listOrder, updateOrder } from "@/api/crm/order";
|
||||
import * as ExcelJS from 'exceljs';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
export default {
|
||||
name: "ContractList",
|
||||
dicts: ['wip_pack_saleman'],
|
||||
data() {
|
||||
return {
|
||||
// 合同信息表格数据
|
||||
@@ -156,7 +161,7 @@ export default {
|
||||
/** 查询合同信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listContract(this.queryParams).then(response => {
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.contractList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@@ -164,7 +169,7 @@ export default {
|
||||
},
|
||||
/** 状态变更 */
|
||||
handleChangeStatus(row) {
|
||||
updateContract(row).then(response => {
|
||||
updateOrder(row).then(response => {
|
||||
this.$message({
|
||||
message: "状态变更成功",
|
||||
type: "success"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-select>
|
||||
</h3>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="合同编号">{{ contract.contractNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同编号">{{ contract.contractCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同状态">
|
||||
<el-tag :type="contract.status == 0 ? 'info' : contract.status == 1 ? 'success' : contract.status == 2 ? 'danger' : 'primary'">
|
||||
{{ contract.status == 0 ? '草稿' : contract.status == 1 ? '已生效' : contract.status == 2 ? '已作废' : '已完成' }}
|
||||
|
||||
@@ -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>
|
||||
@@ -2,13 +2,12 @@
|
||||
<div class="app-container" style="height: calc(100vh - 84px); display: flex;">
|
||||
<!-- 左侧合同列表 -->
|
||||
<div class="left-panel" style="width: 30%; border-right: 1px solid #e4e7ed; overflow-y: auto;">
|
||||
<ContractList ref="contractList"
|
||||
@add="handleAdd" @update="handleUpdate" @delete="handleDelete" @export="handleExport"
|
||||
@exportContract="handleExportContract" @rowClick="handleRowClick" />
|
||||
<ContractList ref="orderList" @add="handleAdd" @update="handleUpdate" @delete="handleDelete"
|
||||
@export="handleExport" @exportContract="handleExportContract" @rowClick="handleRowClick" />
|
||||
</div>
|
||||
|
||||
<!-- 右侧内容区域 -->
|
||||
<div class="right-panel" v-if="form.contractId" style="flex: 1; display: flex; flex-direction: column;">
|
||||
<div class="right-panel" v-if="form.orderId" style="flex: 1; display: flex; flex-direction: column;">
|
||||
<!-- 右侧上方:合同内容信息预览 -->
|
||||
<div class="preview-panel" ref="previewPanel"
|
||||
style="flex: 1; overflow-y: auto; border-bottom: 1px solid #e4e7ed;">
|
||||
@@ -24,17 +23,14 @@
|
||||
|
||||
<!-- 右侧下方:Tab标签页 -->
|
||||
<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"
|
||||
:other-attachment="form.productionSchedule" />
|
||||
<ContractTabs :orderId="form.orderId" :customerId="form.customerId" :financeList="financeList"
|
||||
:objectionList="objectionList" :wmsDeliveryWaybills="wmsDeliveryWaybills" :coilList="coilList"
|
||||
:tabLoading="tabLoading" :contract-attachment="form.businessAnnex" :technical-agreement="form.techAnnex"
|
||||
:other-attachment="form.productionSchedule" :currentOrder="form" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="flex: 1; display: flex; flex-direction: column;">
|
||||
<el-empty description="选择合同后查看内容" />
|
||||
<el-empty description="选择订单后查看内容" />
|
||||
</div>
|
||||
|
||||
<!-- 添加或修改合同信息对话框 -->
|
||||
@@ -48,8 +44,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="form.contractNo" placeholder="请输入合同编号" />
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -59,13 +55,27 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="订单总金额" prop="orderAmount">
|
||||
<el-input v-model="form.orderAmount" placeholder="请输入订单总金额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="交货日期" prop="deliveryDate">
|
||||
<el-date-picker clearable v-model="form.deliveryDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择交货日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售员" prop="salesman">
|
||||
<el-select style="width: 100%;" v-model="form.salesman" placeholder="请选择销售员">
|
||||
<el-option v-for="item in dict.type.wip_pack_saleman" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签订地点" prop="signLocation">
|
||||
<el-input v-model="form.signLocation" placeholder="请输入签订地点" />
|
||||
@@ -107,7 +117,8 @@
|
||||
<!-- 需方信息 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需方" prop="customer">
|
||||
<CustomerSelect v-model="form.customer" bindField="companyName" @change="handleCustomerChange" :style="{ width: '100%' }" />
|
||||
<CustomerSelect v-model="form.customer" bindField="companyName" @change="handleCustomerChange"
|
||||
:style="{ width: '100%' }" />
|
||||
<!-- <el-input v-model="form.customer" placeholder="请输入需方" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="需方地址" prop="customerAddress">
|
||||
@@ -142,6 +153,10 @@
|
||||
<file-upload v-model="form.productionSchedule"
|
||||
:fileType="['pdf', 'jpeg', 'jpg', 'png', 'webp']"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他附件" prop="annexFiles">
|
||||
<file-upload v-model="form.annexFiles"
|
||||
:fileType="['pdf', 'jpeg', 'jpg', 'png', 'webp', 'xlsx', 'xls', 'docx', 'doc']"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -152,7 +167,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getContract, delContract, addContract, updateContract, listContractOrderObjection, listContractPackaging } from "@/api/crm/contract";
|
||||
import { delOrder, listOrderPackaging, updateOrder, getOrder, addOrder } from "@/api/crm/order";
|
||||
import { listDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||
|
||||
import ContractList from "./components/ContractList.vue";
|
||||
import ContractPreview from "./components/ContractPreview.vue";
|
||||
import ContractTabs from "./components/ContractTabs.vue";
|
||||
@@ -168,6 +185,7 @@ export default {
|
||||
ProductContent,
|
||||
CustomerSelect,
|
||||
},
|
||||
dicts: ['wip_pack_saleman'],
|
||||
data() {
|
||||
return {
|
||||
financeList: [],
|
||||
@@ -187,7 +205,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
contractName: undefined,
|
||||
contractNo: undefined,
|
||||
contractCode: undefined,
|
||||
supplier: undefined,
|
||||
customer: undefined,
|
||||
signTime: undefined,
|
||||
@@ -205,9 +223,15 @@ export default {
|
||||
contractName: [
|
||||
{ required: true, message: "合同名称不能为空", trigger: "blur" }
|
||||
],
|
||||
contractNo: [
|
||||
contractCode: [
|
||||
{ required: true, message: "合同编号不能为空", trigger: "blur" }
|
||||
],
|
||||
orderAmount: [
|
||||
{ required: true, message: "订单总金额不能为空", trigger: "blur" }
|
||||
],
|
||||
salesman: [
|
||||
{ required: true, message: "销售员不能为空", trigger: "blur" }
|
||||
],
|
||||
supplier: [
|
||||
{ required: true, message: "供方不能为空", trigger: "blur" }
|
||||
],
|
||||
@@ -315,19 +339,19 @@ export default {
|
||||
/** 行点击事件 */
|
||||
handleRowClick(row) {
|
||||
this.form = row;
|
||||
this.tabLoading = true;
|
||||
// this.tabLoading = true;
|
||||
this.getCoilList();
|
||||
listContractOrderObjection(row.contractId).then(response => {
|
||||
this.financeList = response.data.financeList || [];
|
||||
this.objectionList = response.data.oobjectionList || [];
|
||||
this.wmsDeliveryWaybills = response.data.wmsDeliveryWaybills || [];
|
||||
}).finally(() => {
|
||||
this.tabLoading = false;
|
||||
})
|
||||
// listContractOrderObjection(row.contractId).then(response => {
|
||||
// this.financeList = response.data.financeList || [];
|
||||
// this.objectionList = response.data.oobjectionList || [];
|
||||
// this.wmsDeliveryWaybills = response.data.wmsDeliveryWaybills || [];
|
||||
// }).finally(() => {
|
||||
// this.tabLoading = false;
|
||||
// })
|
||||
},
|
||||
/** 查询合同配卷列表 */
|
||||
getCoilList() {
|
||||
listContractPackaging(this.form.contractId).then(response => {
|
||||
listOrderPackaging(this.form.orderId).then(response => {
|
||||
this.coilList = response.data || [];
|
||||
})
|
||||
},
|
||||
@@ -435,18 +459,18 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加合同信息";
|
||||
this.title = "添加订单信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const contractId = row.contractId || this.ids
|
||||
getContract(contractId).then(response => {
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改合同信息";
|
||||
this.title = "修改订单信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@@ -454,19 +478,19 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.contractId != null) {
|
||||
updateContract(this.form).then(response => {
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.$refs.contractList.getList();
|
||||
this.$refs.orderList.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addContract(this.form).then(response => {
|
||||
addOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.$refs.contractList.getList();
|
||||
this.$refs.orderList.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
@@ -476,19 +500,19 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const contractIds = row.contractId || this.ids;
|
||||
this.$modal.confirm('是否确认删除合同信息编号为"' + contractIds + '"的数据项?').then(() => {
|
||||
return delContract(contractIds);
|
||||
const orderId = row.orderId || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单信息编号为"' + orderId + '"的数据项?').then(() => {
|
||||
return delOrder(orderId);
|
||||
}).then(() => {
|
||||
this.$refs.contractList.getList();
|
||||
this.$refs.orderList.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('crm/contract/export', {
|
||||
this.download('crm/order/export', {
|
||||
...this.queryParams
|
||||
}, `contract_${new Date().getTime()}.xlsx`)
|
||||
}, `order_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 导出合同操作 */
|
||||
handleExportContract(row) {
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改正式订单主对话框 -->
|
||||
<el-dialog title="添加正式订单" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog title="添加订单" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="订单编号" prop="orderCode">
|
||||
<el-input v-model="form.orderCode" placeholder="请输入订单编号" />
|
||||
|
||||
Reference in New Issue
Block a user