|
|
@@ -243,12 +243,24 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <parentList ref="parentRef" @changeParent="getCusInfo"></parentList>
|
|
|
+ <parentList
|
|
|
+ ref="parentRef"
|
|
|
+ :dataSourceApi="getAccountPoolCustomerList"
|
|
|
+ :queryParams="poolCustomerQuery"
|
|
|
+ :searchFields="poolCustomerSearch"
|
|
|
+ :showCategoryTree="false"
|
|
|
+ :tableColumns="poolCustomerColumns"
|
|
|
+ @changeParent="getCusInfo"
|
|
|
+ ></parentList>
|
|
|
<orderListDialog
|
|
|
ref="orderListDialogRef"
|
|
|
@changeParent="getOrderInfo"
|
|
|
:contactData="contactData"
|
|
|
:needProduces="dataForm.queryDimension == 2 ? '4' : '0,1,2,5'"
|
|
|
+ :dataSourceApi="getAccountPoolOrderList"
|
|
|
+ :queryParams="poolOrderQuery"
|
|
|
+ :searchFields="poolOrderSearch"
|
|
|
+ :tableColumns="poolOrderColumns"
|
|
|
></orderListDialog>
|
|
|
<contractListDialog
|
|
|
ref="selectContractRef"
|
|
|
@@ -265,6 +277,10 @@
|
|
|
// import fileMain from '@/components/addDoc/index.vue';
|
|
|
import contractListDialog from '@/views/saleManage/saleOrder/components/contractListDialog.vue';
|
|
|
import { accountStatementExportAPI } from '@/api/saleManage/accountstatement';
|
|
|
+ import {
|
|
|
+ getAccountPoolCustomerList,
|
|
|
+ getAccountPoolOrderList
|
|
|
+ } from '@/api/saleManage/accountPool';
|
|
|
|
|
|
export default {
|
|
|
name: 'saleForm',
|
|
|
@@ -326,6 +342,284 @@
|
|
|
},
|
|
|
startTime: '-01-01 00:00:00',
|
|
|
endTime: '23:59:59',
|
|
|
+ /**
|
|
|
+ * 客户选择弹框的搜索项。
|
|
|
+ * 对账池客户接口只支持 客户编码 / 名称 / 订单编码 三个条件,
|
|
|
+ * value 直接就是接口参数名(contactCode/contactName/orderNo),
|
|
|
+ * 不需要字段名映射。默认那套(关键字/创建时间)对账池没有对应参数。
|
|
|
+ * 3 项以内 seekPage 会平铺显示,不会折进「更多选项」下拉。
|
|
|
+ */
|
|
|
+ poolCustomerSearch: [
|
|
|
+ {
|
|
|
+ label: '客户编码:',
|
|
|
+ value: 'contactCode',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '客户名称:',
|
|
|
+ value: 'contactName',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '订单编码:',
|
|
|
+ value: 'orderNo',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 客户选择弹框的列:沿用客户档案的列,接口给得出就有值、给不出就留空。
|
|
|
+ // 打开弹框看一眼哪些列全是空的,就知道哪些可以删。
|
|
|
+ poolCustomerColumns: [
|
|
|
+ {
|
|
|
+ action: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ align: 'center',
|
|
|
+ label: '选择'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '客户编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '客户名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'orderNo',
|
|
|
+ label: '关联订单编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 170
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'serialNo',
|
|
|
+ label: '客户代号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'phone',
|
|
|
+ label: '客户电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'addressName',
|
|
|
+ label: '单位地址',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (_row) =>
|
|
|
+ `${(_row.addressName || '').replaceAll(',', '')}${
|
|
|
+ _row.address || ''
|
|
|
+ }`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'linkName',
|
|
|
+ label: '联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'linkPhone',
|
|
|
+ label: '联系人电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'remark',
|
|
|
+ label: '备注',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 180
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ /**
|
|
|
+ * 订单选择弹框的搜索项,与客户弹框同一套:
|
|
|
+ * value 就是接口参数名(contactCode/contactName/orderNo)。
|
|
|
+ * 默认销售订单那套(销售类型/库存状态/合同编号/订单类型/审核状态…)对账池没有对应参数。
|
|
|
+ */
|
|
|
+ poolOrderSearch: [
|
|
|
+ {
|
|
|
+ label: '订单编码:',
|
|
|
+ value: 'orderNo',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '客户编码:',
|
|
|
+ value: 'contactCode',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '客户名称:',
|
|
|
+ value: 'contactName',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 订单选择弹框的列:沿用销售订单的列。
|
|
|
+ // prop 用归一化后的字段名(orderNo / partaCode / partaName),
|
|
|
+ // orderListDialog 的 normalizeRow 会把 contactCode/contactName 补成它们。
|
|
|
+ poolOrderColumns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ action: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ align: 'center',
|
|
|
+ label: '选择'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'orderNo',
|
|
|
+ label: '订单编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaCode',
|
|
|
+ label: '客户编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaName',
|
|
|
+ label: '客户名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 180
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'contractName',
|
|
|
+ label: '合同名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 180
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'needProduce',
|
|
|
+ label: '订单类型',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 150,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ // 无值时留空,别让缺数据的一行显示成「库存式订单」
|
|
|
+ if (cellValue == null) return '';
|
|
|
+ if (cellValue == 1) return '有客户生产性订单';
|
|
|
+ if (cellValue == 2) return '无客户生产性订单';
|
|
|
+ if (cellValue == 4) return '不定向订单';
|
|
|
+ if (cellValue == 5) return '委外订单';
|
|
|
+ return '库存式订单';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'deliveryDate',
|
|
|
+ label: '交货日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'saleTypeName',
|
|
|
+ label: '销售类型',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaLinkName',
|
|
|
+ label: '客户联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaTel',
|
|
|
+ label: '客户联系电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbName',
|
|
|
+ label: '售出方名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbLinkName',
|
|
|
+ label: '售出方联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbTel',
|
|
|
+ label: '售出方联系电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 原「应付金额」列。对账池口径下 normalizeRow 会用
|
|
|
+ // accountableAmount / availableAmount 兜底;都没有就留空。
|
|
|
+ prop: 'payAmount',
|
|
|
+ label: '应付金额(元)',
|
|
|
+ align: 'right',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 150,
|
|
|
+ formatter: (_row) => {
|
|
|
+ const raw = _row.payAmount;
|
|
|
+ if (raw == null || raw === '') return '';
|
|
|
+ const num = Number(raw);
|
|
|
+ return Number.isFinite(num)
|
|
|
+ ? num.toLocaleString('zh-CN', {
|
|
|
+ minimumFractionDigits: 2,
|
|
|
+ maximumFractionDigits: 2
|
|
|
+ })
|
|
|
+ : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '单据/创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160
|
|
|
+ }
|
|
|
+ ],
|
|
|
rules: {
|
|
|
sourceType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
contactId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
@@ -351,6 +645,23 @@
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ // 对账池客户列表的必填参数:1 = 销售订单(销售侧对账只能选客户)
|
|
|
+ poolCustomerQuery() {
|
|
|
+ return { type: 1 };
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 对账池订单列表参数:1 = 销售订单。
|
|
|
+ * contactId 是当前已选的客户 —— 接口文档没定义这个字段,
|
|
|
+ * 后端支持就按客户过滤,不支持会忽略掉;不加的话选完客户还能选到别家的订单。
|
|
|
+ */
|
|
|
+ poolOrderQuery() {
|
|
|
+ const params = { type: 1 };
|
|
|
+ const contactId = this.dataForm && this.dataForm.contactId;
|
|
|
+ if (contactId) {
|
|
|
+ params.contactId = contactId;
|
|
|
+ }
|
|
|
+ return params;
|
|
|
+ },
|
|
|
// dateTypeOps() {
|
|
|
// return this.dataForm.queryDimension != 2
|
|
|
// ? this.dateTypeOp.filter((item) => item.value != 5)
|
|
|
@@ -369,6 +680,14 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 对账池客户列表 / 订单列表接口,作为 prop 传给选择弹框当数据源。
|
|
|
+ * Vue 2 的模板表达式只能访问实例上的属性,import 进来的模块函数必须挂到 methods,
|
|
|
+ * 否则渲染时会报 "not defined on the instance"。Vue 2 的 methods 已自动 bind 到实例,
|
|
|
+ * 直接用方法引用传给 prop 即可,不用再包一层箭头函数。
|
|
|
+ */
|
|
|
+ getAccountPoolCustomerList,
|
|
|
+ getAccountPoolOrderList,
|
|
|
//查询
|
|
|
handleSearch() {
|
|
|
//
|