diff --git a/.umirc.ts b/.umirc.ts index 6fdf83b..318fa17 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -16,8 +16,8 @@ export default defineConfig({ '/api/': { // target: 'http://yt:8003', // target: 'http://10.39.13.78:8001/', - target: 'https://test-admin.linyikj.com.cn/', - // target: 'https://admin.linyikj.com.cn/', + // target: 'https://test-admin.linyikj.com.cn/', + target: 'https://admin.linyikj.com.cn/', // target: 'http://c789629c.natappfree.cc', changeOrigin: true, diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 76111db..d956e28 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -373,24 +373,20 @@ export const Selects = { valueType: 'select', hideInTable: hideInTable, formItemProps: { ...(required ? rulesHelper.number : {}) }, - request: async (params) => { - let res = await Apis.Company.CompanyReceiptAccounts.Select({ - keywords: params?.KeyWords, - companies_id: params?.companies_id, - ...params, - }); - res?.data?.map((l: any) => { - l.label = - l.company_name + '_' + l.company_bank + '_' + l.company_account; - }); - return res?.data; - }, + request: async (params) => + ( + await Apis.Company.CompanyReceiptAccounts.Select({ + keywords: params?.KeyWords, + companies_id: params?.companies_id, + ...params, + }) + ).data, ...rest, fieldProps: { showSearch: true, fieldNames: { label: 'label', - value: 'id', + value: 'value', }, ...rest?.fieldProps, }, @@ -416,6 +412,7 @@ export const Selects = { ( await Apis.Company.CompanyProjectReceiptAccounts.Select({ keywords: params?.KeyWords, + projects_id: params?.asset_projects_id, ...params, }) ).data, @@ -570,7 +567,7 @@ export const Selects = { }, }; }, - //获取项目仪表 + //获取仪表 AssetMeters(props?: PropsType): ReturnType { const { title = '选择仪表', diff --git a/src/pages/asset/accounts/index.tsx b/src/pages/asset/accounts/index.tsx index 6ef3e7b..d47ac23 100644 --- a/src/pages/asset/accounts/index.tsx +++ b/src/pages/asset/accounts/index.tsx @@ -40,10 +40,15 @@ export default function Index({ title = '项目账户' }) { , ]} columns={[ + MyColumns.ID(), + { - title: 'ID', - dataIndex: 'id', - // width: 360, + title: '机构名称', + dataIndex: ['company', 'name'], + }, + { + title: '项目名称', + dataIndex: ['project', 'name'], }, { title: '收款名称', diff --git a/src/pages/asset/accounts/modals/AccountsGet.tsx b/src/pages/asset/accounts/modals/AccountsGet.tsx index a81bbfd..2942c52 100644 --- a/src/pages/asset/accounts/modals/AccountsGet.tsx +++ b/src/pages/asset/accounts/modals/AccountsGet.tsx @@ -28,10 +28,14 @@ export default function Create(props: MyBetaModalFormProps) { onOpenChange={(open: any) => { if (open) { form.resetFields(); // 清空表单数据 + form.setFieldsValue({ + companies_id: props?.item?.companies_id || undefined, + projects_id: props?.item?.id || undefined, + }); } }} key={new Date().getTime()} - onFinish={async (values) => + onFinish={async (values: any) => Apis.Company.CompanyProjectReceiptAccounts.Store({ ...values, companies_id: props?.item?.companies_id || values?.companies_id, @@ -89,7 +93,8 @@ export default function Create(props: MyBetaModalFormProps) { key: 'receipt_accounts_id', title: '选择收款账户', params: { - companies_id: companies_id || props?.item?.companies_id || 0, + companies_id: + companies_id || props?.item?.companies_id || undefined, }, colProps: { span: 24 }, formItemProps: { ...rulesHelper.number },