|
@@ -10,6 +10,7 @@ import { useNav } from "/@/layout/hooks/nav";
|
|
|
import { useParams } from "./use-params";
|
|
|
import { useUserInfo } from "/@/hooks/core/useUser";
|
|
|
import { httpSupplierList } from "/@/api/supplierManage/supplierAccoutManage";
|
|
|
+import { httpCompanyList } from "/@/api/InvoiceSales/invoiceApply";
|
|
|
|
|
|
export function useRequeset(props: PageContentProps) {
|
|
|
const { contentConfig } = props;
|
|
@@ -32,7 +33,7 @@ export function useRequeset(props: PageContentProps) {
|
|
|
|
|
|
async function onSearch() {
|
|
|
const { contentConfig } = props;
|
|
|
- const { apis, isTree, mockData, listNoRelation, transformCompany, transformField } = contentConfig;
|
|
|
+ const { apis, isTree, mockData, listNoRelation, transformCompany, transformField, transformFieldCompany, notDeleteCompanyrProp } = contentConfig;
|
|
|
const hasCompanyFilter = !notNeedCompanyFilter;
|
|
|
const vm = getCurrentInstance();
|
|
|
|
|
@@ -60,18 +61,22 @@ export function useRequeset(props: PageContentProps) {
|
|
|
: {}
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ if (transformFieldCompany && params['companyNo']) {
|
|
|
+ const { data } = await httpCompanyList({ size: 1000 })
|
|
|
+ const name = (data.list.find(({ companyNo }) => companyNo === params['companyNo']) || {}).company_name
|
|
|
+ const { data: rdata } = await httpSupplierList({ name })
|
|
|
+ const item = name ? rdata.list.find(item => item.name === name) || {} : {};
|
|
|
+ params['supplierNo'] = item.code;
|
|
|
+ delete params['companyNo']
|
|
|
+ }
|
|
|
+
|
|
|
if (transformField) {
|
|
|
params[transformField] = transCompany;
|
|
|
- delete params[companyProp]
|
|
|
+ !notDeleteCompanyrProp && delete params[companyProp];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- const { code, data, message } = await apis.httpList({
|
|
|
- ...params,
|
|
|
- ...(listNoRelation ? { noRela: true } : {})
|
|
|
- });
|
|
|
-
|
|
|
+ const { code, data, message } = await apis.httpList({ ...params, ...(listNoRelation ? { noRela: true } : {}) });
|
|
|
|
|
|
|
|
|
responseHandle({
|