|
|
@@ -228,10 +228,19 @@
|
|
|
<supplierList
|
|
|
ref="supplierListRef"
|
|
|
:classType="2"
|
|
|
+ :dataSourceApi="getAccountPoolCustomerList"
|
|
|
+ :queryParams="poolCustomerQuery"
|
|
|
+ :searchFields="poolCustomerSearch"
|
|
|
+ :showCategoryTree="false"
|
|
|
+ :tableColumns="poolCustomerColumns"
|
|
|
@changeParent="getCusInfo"
|
|
|
></supplierList>
|
|
|
<orderListDialog
|
|
|
ref="orderListDialogRef"
|
|
|
+ :dataSourceApi="getAccountPoolOrderList"
|
|
|
+ :queryParams="poolOrderQuery"
|
|
|
+ :searchFields="poolOrderSearch"
|
|
|
+ :tableColumns="poolOrderColumns"
|
|
|
@changeParent="getOrderInfo"
|
|
|
></orderListDialog>
|
|
|
<contractListDialog
|
|
|
@@ -247,6 +256,7 @@
|
|
|
import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
import OrderListDialog from './orderListDialog.vue';
|
|
|
import { getSearchMergeListByTypeAPI } from '@/api/saleManage/accountstatement';
|
|
|
+ import { getAccountPoolCustomerList, getAccountPoolOrderList } from '@/api/saleManage/accountPool';
|
|
|
import { getFile } from '@/api/system/file';
|
|
|
import supplierList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
|
|
|
// import fileMain from '@/components/addDoc/index.vue';
|
|
|
@@ -263,6 +273,23 @@
|
|
|
},
|
|
|
props: ['dataForm', 'datasource', 'dialogType','recorpayList'],
|
|
|
computed: {
|
|
|
+ // 对账池客户列表的必填参数:2 = 采购订单(采购侧对账只能选供应商)
|
|
|
+ poolCustomerQuery() {
|
|
|
+ return { type: 2 };
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 对账池订单列表参数:2 = 采购订单。
|
|
|
+ * contactId 是当前已选的供应商 —— 接口文档没定义这个字段,
|
|
|
+ * 后端支持就按供应商过滤,不支持会忽略掉;不加的话选完供应商还能选到别家的订单。
|
|
|
+ */
|
|
|
+ poolOrderQuery() {
|
|
|
+ const params = { type: 2 };
|
|
|
+ const contactId = this.dataForm && this.dataForm.contactId;
|
|
|
+ if (contactId) {
|
|
|
+ params.contactId = contactId;
|
|
|
+ }
|
|
|
+ return params;
|
|
|
+ },
|
|
|
//计算未对账金额
|
|
|
accountStatementPrice() {
|
|
|
return this.datasource.reduce(
|
|
|
@@ -286,6 +313,274 @@
|
|
|
},
|
|
|
startTime: '-01-01 00:00:00',
|
|
|
endTime: '23:59:59',
|
|
|
+ /**
|
|
|
+ * 供应商选择弹框的搜索项。
|
|
|
+ * 对账池客户接口只支持 供应商编码 / 名称 / 订单编码 三个条件,
|
|
|
+ * value 直接就是接口参数名(contactCode/contactName/orderNo),
|
|
|
+ * 所以不需要再做字段名映射,searchFields 传进来就按原样发给接口。
|
|
|
+ * 默认那套(关键字/产品编码/产品名称/创建时间)对账池没有对应参数,
|
|
|
+ * 展示了也只是输了不起作用,所以这里换成接口真正支持的。
|
|
|
+ * 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: 160
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '供应商名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 240
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 请求参数里有 orderNo,说明接口是按关联订单筛的,
|
|
|
+ // 返回里大概率也带订单编码。schema 未定义,给不出就留空。
|
|
|
+ prop: 'orderNo',
|
|
|
+ label: '关联订单编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 170
|
|
|
+ },
|
|
|
+ // 以下沿用供应商档案的列。normalizeRow 会把 contactCode/contactName
|
|
|
+ // 补成 code/name;其余列直接绑 row 上的同名字段,
|
|
|
+ // 接口给得出就有值、给不出就留空,
|
|
|
+ // 打开弹框看一眼哪些列全是空的,就知道哪些可以删。
|
|
|
+ {
|
|
|
+ prop: 'serialNo',
|
|
|
+ label: '供应商代号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'phone',
|
|
|
+ label: '供应商电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'addressName',
|
|
|
+ label: '注册地址',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (_row) =>
|
|
|
+ `${(_row.addressName || '').replaceAll(',', '')}${
|
|
|
+ _row.address || ''
|
|
|
+ }`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'otherAddressName',
|
|
|
+ label: '联系地址',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (_row) =>
|
|
|
+ `${(_row.otherAddressName || '').replaceAll(',', '')}${
|
|
|
+ _row.otherAddress || ''
|
|
|
+ }`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'linkName',
|
|
|
+ label: '联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'linkPhone',
|
|
|
+ label: '联系人电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ /**
|
|
|
+ * 订单选择弹框的搜索项。
|
|
|
+ * 与客户弹框同一套:对账池订单接口只认 contactCode / contactName / orderNo,
|
|
|
+ * value 直接就是接口参数名,不需要字段名映射。
|
|
|
+ * 默认采购订单那套(订单类型/审核状态/订单进度/创建时间)对账池没有对应参数。
|
|
|
+ */
|
|
|
+ poolOrderSearch: [
|
|
|
+ {
|
|
|
+ label: '订单编码:',
|
|
|
+ value: 'orderNo',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '供应商编码:',
|
|
|
+ value: 'contactCode',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '供应商名称:',
|
|
|
+ value: 'contactName',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 订单选择弹框的列:只保留对账池订单接口给得出的字段。
|
|
|
+ // 采购订单的合同名称/采购方/联系人/应付金额等一律不展示。
|
|
|
+ // prop 用归一化后的字段名(orderNo / partbCode / partbName),
|
|
|
+ // orderListDialog 的 normalizeRow 会把 contactCode/contactName 补成它们。
|
|
|
+ poolOrderColumns: [
|
|
|
+ {
|
|
|
+ width: 60,
|
|
|
+ type: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ label: '选择',
|
|
|
+ columnKey: 'action',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'orderNo',
|
|
|
+ label: '订单编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbCode',
|
|
|
+ label: '供应商编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbName',
|
|
|
+ label: '供应商名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 220
|
|
|
+ },
|
|
|
+ // 以下沿用采购订单的列。normalizeRow 已把往来单位/来源订单那套字段
|
|
|
+ // 补成 orderNo / partbId / partbName;其余列直接绑 row 同名字段,
|
|
|
+ // 接口给得出就有值、给不出就留空,
|
|
|
+ // 打开弹框看一眼哪些列全是空的,就知道哪些可以删。
|
|
|
+ {
|
|
|
+ prop: 'contractName',
|
|
|
+ label: '合同名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 180
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbLinkName',
|
|
|
+ label: '供应商联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partbTel',
|
|
|
+ label: '供应商联系电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaName',
|
|
|
+ label: '采购方名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 180
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaLinkName',
|
|
|
+ label: '采购方联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'partaTel',
|
|
|
+ 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' },
|
|
|
@@ -307,6 +602,18 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 对账池客户列表接口,作为 prop 传给供应商选择弹框当数据源。
|
|
|
+ * Vue 2 的模板表达式只能访问实例上的属性,import 进来的模块函数必须挂到 methods,
|
|
|
+ * 否则渲染时会报 "not defined on the instance"。Vue 2 的 methods 已自动 bind 到实例,
|
|
|
+ * 直接用方法引用传给 prop 即可,不用再包一层箭头函数。
|
|
|
+ */
|
|
|
+ getAccountPoolCustomerList,
|
|
|
+ /**
|
|
|
+ * 对账池订单列表接口(/eom/accountstatementpool/orders),同上:
|
|
|
+ * 模板只能用实例属性,必须挂到 methods。
|
|
|
+ */
|
|
|
+ getAccountPoolOrderList,
|
|
|
//查询
|
|
|
handleSearch() {
|
|
|
//
|