|
@@ -45,15 +45,14 @@
|
|
|
<template #orderIdList>
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item label="事业部" prop="departmentId" style="margin-bottom: 18px">
|
|
|
- <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable @change="changeDepartment">
|
|
|
+ <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable @change="changeDepartment" :disabled="formData.data.id">
|
|
|
<el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
</el-select>
|
|
|
<el-button type="primary" size="small" style="margin-left: 16px" @click="clickAddOrder()">选择合同</el-button>
|
|
|
</el-form-item>
|
|
|
<el-table :data="formData.data.orderList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
|
|
|
<el-table-column label="事业部" prop="departmentName" width="140" />
|
|
|
- <el-table-column label="订单号" prop="code" min-width="180" />
|
|
|
- <el-table-column label="万里牛单号" prop="wlnCode" width="150" />
|
|
|
+ <el-table-column label="订单号" prop="orderCode" min-width="180" />
|
|
|
<el-table-column label="订单总金额 ¥" prop="totalAmount" align="right" width="120" />
|
|
|
<el-table-column label="产品总金额 ¥" prop="productTotalAmount" align="right" width="120" />
|
|
|
<el-table-column label="定制加工费 ¥" prop="customProcessingFee" align="right" width="110" />
|
|
@@ -209,9 +208,9 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "对账时间",
|
|
|
- slot: "timePeriod",
|
|
|
+ prop: "timePeriod",
|
|
|
align: "center",
|
|
|
- width: 260,
|
|
|
+ width: 180,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -363,7 +362,7 @@ const clickAddOrder = () => {
|
|
|
};
|
|
|
const selectOrder = (row) => {
|
|
|
if (formData.data.orderList && formData.data.orderList.length > 0) {
|
|
|
- let list = formData.data.orderList.filter((item) => item.id === row.id);
|
|
|
+ let list = formData.data.orderList.filter((item) => item.orderId === row.id);
|
|
|
if (list && list.length > 0) {
|
|
|
return ElMessage("该订单已添加");
|
|
|
}
|
|
@@ -371,10 +370,9 @@ const selectOrder = (row) => {
|
|
|
formData.data.orderList = [];
|
|
|
}
|
|
|
formData.data.orderList.push({
|
|
|
- id: row.id,
|
|
|
+ orderId: row.id,
|
|
|
departmentName: row.departmentName,
|
|
|
- code: row.code,
|
|
|
- wlnCode: row.wlnCode,
|
|
|
+ orderCode: row.code,
|
|
|
totalAmount: row.totalAmount,
|
|
|
productTotalAmount: row.productTotalAmount,
|
|
|
customProcessingFee: row.customProcessingFee,
|
|
@@ -394,9 +392,10 @@ const submitForm = () => {
|
|
|
for (let i = 0; i < formData.data.orderList.length; i++) {
|
|
|
amount = Number(Math.round((amount + formData.data.orderList[i].totalAmount) * 100) / 100);
|
|
|
}
|
|
|
- let orderIdList = formData.data.orderList.map((item) => item.id);
|
|
|
+ let orderIdList = formData.data.orderList.map((item) => item.orderId);
|
|
|
proxy
|
|
|
.post("/statementOfAccount/" + modalType.value, {
|
|
|
+ id: formData.data.id,
|
|
|
departmentId: formData.data.departmentId,
|
|
|
amount: amount,
|
|
|
orderIdList: orderIdList,
|
|
@@ -414,9 +413,15 @@ const submitForm = () => {
|
|
|
}
|
|
|
};
|
|
|
const clickUpdate = (row) => {
|
|
|
+ formData.data = {
|
|
|
+ id: row.id,
|
|
|
+ };
|
|
|
modalType.value = "edit";
|
|
|
proxy.post("/statementOfAccount/detail", { id: row.id }).then((res) => {
|
|
|
- formData.data = res;
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ formData.data.departmentId = res[0].departmentId;
|
|
|
+ formData.data.orderList = res;
|
|
|
+ }
|
|
|
openDialog.value = true;
|
|
|
});
|
|
|
};
|