|
@@ -14,6 +14,7 @@ import { template, procureTemplate } from "./../_config/xls-template";
|
|
|
import { utils, writeFile } from "xlsx";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import { useUserInfo } from "/@/hooks/core/useUser";
|
|
|
+import { httpSupplierList } from "/@/api/supplierManage/supplierAccoutManage";
|
|
|
|
|
|
import { httpRequsetExport } from "/@/utils/export";
|
|
|
|
|
@@ -65,23 +66,23 @@ function onDownloadTemplate(isProcure = false) {
|
|
|
|
|
|
const data: any[] = [];
|
|
|
selects.value.forEach((item) => {
|
|
|
- const _template = { ...judieTemplate };
|
|
|
+ const _template = { ...judieTemplate };
|
|
|
|
|
|
if (isProcure) { // 采购
|
|
|
_template["商品编码"] = item.spuCode;
|
|
|
_template["商品名称"] = item.good_name;
|
|
|
- _template["买入方公司编码"] = item.companyNo;
|
|
|
- _template["买入方公司名称"] = item.companyName;
|
|
|
- _template["卖出方公司编码"] = item.supplierNo;
|
|
|
- _template["卖出方公司名称"] = item.supplierName;
|
|
|
+ _template["买入方公司编码"] = item.supplierNo;
|
|
|
+ _template["买入方公司名称"] = item.supplierName;
|
|
|
+ _template["卖出方公司编码"] = item.cgd_supplierNo;
|
|
|
+ _template["卖出方公司名称"] = item.cgd_supplierName;
|
|
|
_template["开票商品名称"] = item.cgd_inv_good_name;
|
|
|
} else { // 财务
|
|
|
_template["商品编码"] = item.spuCode;
|
|
|
_template["商品名称"] = item.good_name;
|
|
|
- _template["买入方公司编码"] = item.companyNo;
|
|
|
- _template["买入方公司名称"] = item.companyName;
|
|
|
- _template["卖出方公司编码"] = item.supplierNo;
|
|
|
- _template["卖出方公司名称"] = item.supplierName;
|
|
|
+ _template["买入方公司编码"] = item.supplierNo;
|
|
|
+ _template["买入方公司名称"] = item.supplierName;
|
|
|
+ _template["卖出方公司编码"] = item.cgd_supplierNo;
|
|
|
+ _template["卖出方公司名称"] = item.cgd_supplierName;
|
|
|
_template["采购类目编码"] = item.cgd_inv_cat_code;
|
|
|
_template['采购类目名称'] = item.cgd_inv_cat_name;
|
|
|
_template["采购开票商品名称"] = item.cgd_inv_good_name;
|
|
@@ -124,6 +125,11 @@ async function handleExportPage() {
|
|
|
const startDays = start.daysInMonth();
|
|
|
const endDays = end.daysInMonth();
|
|
|
|
|
|
+ // const supplierNo
|
|
|
+ const { data } = await httpSupplierList({ name: currentCompany.value?.companyName })
|
|
|
+ const item = currentCompany.value?.companyName ? data.list.find(item => item.name === currentCompany.value?.companyName) || {} : {};
|
|
|
+ const transCompany = item.code;
|
|
|
+
|
|
|
if (Math.abs(diffDay) > (startDays + endDays)) {
|
|
|
ElMessage.warning('导出的时间区间不能超过两个月')
|
|
|
return
|
|
@@ -135,7 +141,7 @@ async function handleExportPage() {
|
|
|
onStart: () => (_loading.value = true),
|
|
|
onSuccess: () => (_loading.value = false),
|
|
|
onFail: () => (_loading.value = false),
|
|
|
- params: { isZx: 1, ...params,companyNo:currentCompany.value.companyNo },
|
|
|
+ params: { isZx: 1, ...params, supplierNo: transCompany, isChild: 1, noRela: true },
|
|
|
admin: false
|
|
|
});
|
|
|
}
|