Commit d1d0c1d5 authored by 左玲玲's avatar 左玲玲 😬

租赁客户,设备供应商,设备查看

parent 668ec201
......@@ -325,6 +325,12 @@ export default [
icon: '',
component: './lease/supplier',
},
{
name: '设备查看',
path: '/lease/devicedata',
icon: '',
component: './lease/devicedata',
},
],
},
];
......@@ -15,7 +15,6 @@ function DrawerPro(props) {
fields: props.fields,
detailData: props.detailData,
};
return (
<Drawer
maskClosable={false}
......
import React from 'react';
const Filedetail = ({ files }) => {
return <div style={{ display: "flex", flexFlow: "row wrap", width: "100%" }}>
{
files && typeof (files) == "string" ?
<a href={files} download={files} style={{ margin: '0 20px 0 0', display: 'block' }}>{urlName ? urlName : "下载"}</a>
: files && Array.isArray(files) && files?.length ?
files?.map(el => {
return <a title={el.name} key={el.url} href={el.url} download={el.name} style={{ margin: '0 20px 0 0', display: 'block' }}>{el.name}</a>
})
:
"-"
}
</div>
}
export default Filedetail;
\ No newline at end of file
......@@ -1262,10 +1262,15 @@ function UploadImg({ value, onChange, fieldProps, valueType }) {
} else {
url = file.thumbUrl;
}
setImage({
url,
visible: true,
});
let suffixArr = url.split('.');
if (suffixArr?.length > 0 && (suffixArr[suffixArr?.length - 1] == 'png' || suffixArr[suffixArr?.length - 1] == 'jpg' || suffixArr[suffixArr?.length - 1] == 'jpeg' || suffixArr[suffixArr?.length - 1] == 'svg')) {
setImage({
url,
visible: true,
});
} else {
}
},
className: "upload-list-inline"
};
......
import { Tooltip } from "antd";
import Filedetail from "@/components/Filedetail";
function getcolumns(setdrawer) {
return {
columns: [
{
title: '客户编号',
dataIndex: 'f1',
key: 'f1',
dataIndex: 'customerNo',
key: 'customerNo',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
colProps: { span: 8 },
},
{
title: '客户名称',
dataIndex: 'f2',
key: 'f2',
dataIndex: 'customerName',
key: 'customerName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
colProps: { span: 8 },
render: (_, row) => {
return (
<Tooltip title={row.f2}>
<Tooltip title={row.customerName}>
<a
className="table-cell"
onClick={() => {
......@@ -30,7 +31,7 @@ function getcolumns(setdrawer) {
}));
}}
>
{row.f2}
{row.customerName}
</a>
</Tooltip>
);
......@@ -38,99 +39,104 @@ function getcolumns(setdrawer) {
},
{
title: '负责工厂',
dataIndex: 'f3',
key: 'f3',
dataIndex: 'factoryName',
key: 'factoryId',
valueType: 'select',
options: { path: '/', params: {} },
options: { path: '/lease/umLeaseCustomer/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
colProps: { span: 8 },
},
{ title: '企业法人', dataIndex: 'f4', key: 'f4', colProps: { span: 8 }, hideInSearch: true },
{ title: '联系电话', dataIndex: 'f5', key: 'f5', colProps: { span: 8 }, hideInSearch: true },
{ title: '企业法人', dataIndex: 'enterpriseLegalPerson', key: 'enterpriseLegalPerson', colProps: { span: 8 }, hideInSearch: true },
{ title: '联系电话', dataIndex: 'phone', key: 'phone', colProps: { span: 8 }, hideInSearch: true },
{
title: '产值',
dataIndex: 'f6',
key: 'f6',
dataIndex: 'outputValue',
key: 'outputValue',
colProps: { span: 8 },
hideInTable: true,
hideInSearch: true,
hideInSearch: true
},
{
title: '所属行业',
dataIndex: 'f7',
key: 'f7',
dataIndex: 'industry',
key: 'industry',
colProps: { span: 8 },
hideInTable: true,
hideInSearch: true,
},
{
title: '地址',
dataIndex: 'f8',
key: 'f8',
dataIndex: 'address',
key: 'address',
colProps: { span: 8 },
hideInTable: true,
hideInSearch: true,
},
{
title: '纳税人识别号',
dataIndex: 'f9',
key: 'f9',
dataIndex: 'taxpayerIdentificationNumber',
key: 'taxpayerIdentificationNumber',
colProps: { span: 8 },
hideInSearch: true,
},
{
title: '开户行银行',
dataIndex: 'f10',
key: 'f10',
dataIndex: 'openingBank',
key: 'openingBank',
colProps: { span: 8 },
hideInSearch: true,
},
{
title: '收款账户',
dataIndex: 'f11',
key: 'f11',
dataIndex: 'collectionAccount',
key: 'collectionAccount',
colProps: { span: 8 },
hideInSearch: true,
},
{
title: '所属区域',
dataIndex: 'f12',
key: 'f12',
dataIndex: 'regionName',
key: 'regionId',
colProps: { span: 8 },
valueType: 'select',
mode: 'multiple',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
options: { path: '/', params: {} },
options: { path: '/lease/umLeaseCustomer/getAllShopSelection', params: {} },
hideInSearch: true,
},
{
title: '企业简介',
dataIndex: 'f13',
key: 'f13',
dataIndex: 'enterpriseIntroduction',
key: 'enterpriseIntroduction',
hideInSearch: true,
hideInTable: true,
valueType: 'textarea',
colProps: { span: 24 },
span: 3
},
{
title: '附件上传(最多5个)',
dataIndex: 'f14',
key: 'f14',
dataIndex: 'picList',
key: 'picList',
hideInSearch: true,
hideInTable: true,
valueType: 'uploadBtn',
colProps: { span: 24 },
span: 3,
fieldProps: {
limit: 5,
},
hideInDescriptions: true
render: (_, row) => {
return <Filedetail files={row?.['picList']} />
}
},
],
pathconfig: {
add: '',
edit: '',
list: '',
delete: '',
add: '/lease/umLeaseCustomer/save',
edit: '/lease/umLeaseCustomer/save',
list: '/lease/umLeaseCustomer/queryList',
delete: '/lease/umLeaseCustomer/deleteById',
detail: '/lease/umLeaseCustomer/queryById'
},
};
}
......
......@@ -18,6 +18,7 @@ const Custom = () => {
setdrawer((s) => ({
...s,
visible: false,
item: {}
}));
}
},
......@@ -54,7 +55,7 @@ const Custom = () => {
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
let res = await doFetch({ url: pathconfig.delete, params: { id: row.id } });
if (res.code === '0000') {
actionRef.current.reload();
}
......@@ -71,24 +72,28 @@ const Custom = () => {
};
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer)?.columns ?? [];
let factory = defcolumn.filter(it => it.key == 'factoryId')?.[0];
if (drawer.val == 'add') {
factory.options.params = {}
} else if (drawer.val == 'edit') {
factory.options.params = { factoryId: drawer.item.factoryId };
}
return defcolumn.concat({
title: '操作',
valueType: 'option',
width: 150,
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)],
});
}, []);
}, [drawer.val, drawer.item]);
const pathconfig = useMemo(() => {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf;
}, []);
return <div>
<AutoTable
pagetitle={<h3 className="page-title">客户管理</h3>}
columns={columns}
path={pathconfig?.list}
// dataSource={[{ 'f1': '111', 'f2': '222', id: 1 }]}
actionRef={actionRef}
pageextra={'add'}
resizeable={false}
......@@ -112,11 +117,11 @@ const Custom = () => {
}}
/>
<DrawerPro
{...drawer}
fields={columns}
// detailpath={drawer.type == 'add' ? '' : drawer?.detailpath}
params={{ id: drawer?.item?.id }}
detailpath={drawer.val == 'add' || !drawer?.item?.id ? '' : pathconfig?.detail}
params={drawer.val == 'add' ? {} : { id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
detailData={drawer?.item ?? {}}
placement="right"
onClose={() => {
setdrawer((s) => ({
......@@ -124,7 +129,6 @@ const Custom = () => {
visible: false,
}));
}}
{...drawer}
onFinish={async (vals) => {
if (drawer?.val == "add") {
await runAsync({ url: pathconfig?.add, params: { ...vals } });
......@@ -136,23 +140,6 @@ const Custom = () => {
}
}}
>
{
<div>
<div>附件</div>
<div style={{ display: "flex", flexFlow: "row wrap", width: "100%" }}>
{
drawer?.item?.['f14'] && typeof (drawer?.item?.['f14']) == "string" ?
<a href={drawer?.item?.['f14']} download={drawer?.item?.['f14']} style={{ margin: '0 10px 0 0', display: 'block' }}>{urlName ? urlName : "下载"}</a>
: drawer?.item?.['f14'] && Array.isArray(drawer?.item?.['f14']) && drawer?.item?.['f14']?.length ?
drawer?.item?.['f14']?.map(el => {
return <a key={el.url} href={el.url} download={el.name} style={{ margin: '0 10px 0 0', display: 'block' }}>{el.name}</a>
})
:
"-"
}
</div>
</div>
}
</DrawerPro>
</div>
}
......
This diff is collapsed.
import React, { useMemo } from 'react';
import DetailPro from '@/components/DetailPro';
import getcolumns from './columns';
const Basemsg = ({ drawer, activeKey }) => {
const columns = useMemo(() => {
let defcolumn = [];
if (activeKey == 'item-1') {
defcolumn = getcolumns(setdrawer, activeKey)?.columns ?? [];
} else {
doFetch({ url: '/base/paFormField/queryList', params: { formId: '2' } }).then(res => {
if (res.code == '0000') {
let column = [];
res?.data?.dataList?.forEach?.((el) => {
column.push({
...selectValueType(el.fieldChar, el.valueList),
title: el.fieldName,
dataIndex: el.id,
key: el.id,
});
});
defcolumn = [...(getcolumns(setdrawer, activeKey)?.columns ?? []), ...column];
}
})
}
return defcolumn;
}, [activeKey]);
const detailData = useMemo(() => {
let data = {};
if (activeKey == 'item-1') {
doFetch({ url: '/asset/equipment/detail', params: { id: row.id } }).then(res => {
if (res.code == '0000') {
data = res?.data?.data ?? {};
}
})
} else {
doFetch({ url: '/asset/equipment/detail', params: { id: row.id } }).then(res => {
if (res.code == '0000') {
let obj = {};
res?.data?.data['equipmentCharList']?.forEach?.((it) => {
obj[it?.fieldId] = it?.fieldRealValue;
});
data = { ...(res?.data?.data ?? {}), ...obj };
}
})
}
return data;
}, [activeKey]);
return <DetailPro
fields={columns}
detailpath="/"
params={{ id: drawer?.item?.id }}
/>
}
export default Basemsg;
\ No newline at end of file
This diff is collapsed.
import React, { useState, useMemo, useRef, useEffect } from 'react';
import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { doFetch } from '@/utils/doFetch';
import { useRequest } from "ahooks";
import styles from "./index.less";
import TreeRender from '@/components/TreeRender';
import { Divider, Tabs, ProDescriptions } from "antd";
import Account from "./Account";
import Basemsg from "./Basemsg";
const Devicedata = () => {
let actionRef = useRef();
const [drawer, setdrawer] = useState({
visible: false,
}),
[activeKey, catk] = useState('item-1'),
[currDrawer, setCurrDrawer] = useState({
visible: false,
});
const { run, loading, runAsync } = useRequest(doFetch, {
manual: true,
onSuccess: (res, params) => {
if (res?.code == "0000") {
actionRef?.current?.reload();
setdrawer((s) => ({
...s,
visible: false,
}));
}
},
});
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer, activeKey)?.columns ?? [];
return defcolumn;
}, [activeKey]);
const items = useMemo(() => {
if (drawer.val == 'only') {
if (activeKey == 'item-1') {
return [
{ label: '基础信息', key: 'item-1', children: <Basemsg drawer={drawer} activeKey={activeKey} /> }
]
}
}
}, [drawer.val, activeKey]);
const tableItems = useMemo(() => {
return [
{
label: '租赁设备',
key: 'item-1',
children: <AutoTable
pagetitle={'设备列表'}
columns={columns}
path=''
actionRef={actionRef}
resizeable={false}
dataSource={[{ 'f1': '111', 'f2': '222', id: 1, status: 1, f12: 1, intelligentUnit: '11' }]}
bordered={false}
x={1500}
/>
},
{
label: '自主设备',
key: 'item-2',
children: <Account />
}
]
}, [columns]);
const onselecteTree = async (selectedKeys, e, alldata) => {
// let params = {
// treeNodeType: e.node.type,
// treeNodeKey: e.node.key,
// };
// setextraparams(params);
};
const selectValueType = (type, options) => {
switch (type) {
case 1:
return {
valueType: 'input',
};
case 2:
return {
valueType: 'select',
options,
};
case 3:
return {
valueType: 'radio',
options,
};
case 4:
return {
valueType: 'select',
options,
};
default:
break;
}
};
const fn2 = async () => {
const res = await doFetch({
url: urlParams.detail,
params: { id: drawer?.item?.id },
});
let obj = {};
res?.data?.data['equipmentCharList']?.forEach?.((it) => {
obj[it?.fieldId] = it?.fieldRealValue;
});
console.log('drawerpro:', {
...(res?.data?.data ?? {}),
...obj,
});
setrequest(
{
...(res?.data?.data ?? {}),
...obj,
} ?? {},
);
};
return <div className={styles.ledgerbox}>
<div className={styles.ledgerheader}>
<div className="ant-card-head" style={{ backgroundColor: 'white' }}>
<div className="ant-card-head-wrapper">
<div className="ant-card-head-title">
<h3 className="page-title">设备台账</h3>
</div>
</div>
</div>
</div>
<div className={styles.ledgercontent}>
<div className={styles.ledgerleft}>
<TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} />
</div>
<div className={styles.ledgerright}>
<Tabs activeKey={activeKey} onChange={(key) => {
catk(key);
}} items={tableItems} />
</div>
</div>
<DrawerPro
{...drawer}
fields={columns}
params={{ id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
placement="right"
onClose={() => {
setdrawer((s) => ({
...s,
visible: false,
}));
}}
>
<Tabs items={items} />
</DrawerPro>
</div>
}
export default Devicedata;
\ No newline at end of file
.ledgerbox {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #fff;
display: flex;
flex-direction: column;
position: relative;
.ledgerheader {
width: 100%;
border-bottom: 1px solid #f0f0f0;
flex-shrink: 0;
}
.ledgercontent {
flex: 1;
width: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
.ledgerleft {
width: 300px;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: hidden;
padding: 0 16px;
flex-shrink: 0;
}
.ledgerright {
flex: 1;
border-left: 1px solid #f0f0f0;
overflow: hidden;
}
}
}
\ No newline at end of file
import React, { useMemo } from 'react';
import DetailPro from '@/components/DetailPro';
import AutoTable from '@/components/AutoTable/mtable';
const Resume = ({ setdrawer, drawer }) => {
const columns = [
......
......@@ -212,7 +212,62 @@ const Ledger = () => {
]
}
}
}, [drawer.val, drawer.item])
}, [drawer.val, drawer.item]);
const rightExtra = () => {
return [
<PremButton
key='add'
btn={{
type: 'primary',
onClick: () => {
setdrawer((s) => ({
...s,
visible: true,
val: 'add',
title: '新增'
}));
}
}}
>
新增
</PremButton>,
<PremButton
key='export'
btn={{
type: 'default',
onClick: () => {
},
style: { margin: '0 12px' }
}}
>
导出
</PremButton>,
<PremButton
key='exportqrcode'
btn={{
type: 'default',
onClick: () => {
},
}}
>
导出二维码
</PremButton>,
<PremButton
key='status'
btn={{
type: 'default',
onClick: () => {
},
style: { marginLeft: 12 }
}}
>
状态查看
</PremButton>,
];
}
return <div className={styles.ledgerbox}>
......@@ -237,61 +292,7 @@ const Ledger = () => {
actionRef={actionRef}
resizeable={false}
dataSource={[{ 'f1': '111', 'f2': '222', id: 1, status: 1, f12: 1, intelligentUnit: '11' }]}
pageextra={() => {
return [
<PremButton
key='add'
btn={{
type: 'primary',
onClick: () => {
setdrawer((s) => ({
...s,
visible: true,
val: 'add',
title: '新增'
}));
}
}}
>
新增
</PremButton>,
<PremButton
key='export'
btn={{
type: 'default',
onClick: () => {
},
style: { margin: '0 12px' }
}}
>
导出
</PremButton>,
<PremButton
key='exportqrcode'
btn={{
type: 'default',
onClick: () => {
},
}}
>
导出二维码
</PremButton>,
<PremButton
key='status'
btn={{
type: 'default',
onClick: () => {
},
style: { marginLeft: 12 }
}}
>
状态查看
</PremButton>,
];
}}
pageextra={rightExtra}
bordered={false}
x={1500}
/>
......@@ -300,11 +301,11 @@ const Ledger = () => {
<DrawerPro
{...drawer}
fields={columns}
// detailpath={drawer.type == 'add' ? '' : drawer?.detailpath}
params={{ id: drawer?.item?.id }}
detailpath={drawer.val == 'add' || !drawer?.item?.id ? '' : pathconfig?.detail}
params={drawer.val == 'add' ? {} : { id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
detailData={drawer?.item ?? {}}
placement="right"
onClose={() => {
setdrawer((s) => ({
......@@ -312,7 +313,6 @@ const Ledger = () => {
visible: false,
}));
}}
{...drawer}
onFinish={async (vals) => {
// if (drawer?.val == "add") {
// await runAsync({ url: pathconfig?.add, params: { ...vals } });
......
......@@ -8,13 +8,11 @@ function getcolumns(ifs, actionRef) {
title: '供应商编号',
dataIndex: 'supplierNo',
key: 'supplierNo',
width: 120,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
key: 'supplierName',
width: 150,
formItemProps: {
rules: [
{
......@@ -24,10 +22,15 @@ function getcolumns(ifs, actionRef) {
],
},
},
{
title: '纳税人识别号',
dataIndex: 'taxpayerIdentificationNumber',
key: 'taxpayerIdentificationNumber',
},
{
title: '公司官网',
dataIndex: 'officialWebsite',
key: 'officialWebsite',
dataIndex: 'companyWebsite',
key: 'companyWebsite',
hideInTable: true,
search: false,
formItemProps: {
......@@ -41,8 +44,8 @@ function getcolumns(ifs, actionRef) {
},
{
title: '联系电话',
dataIndex: 'telephone',
key: 'telephone',
dataIndex: 'phone',
key: 'phone',
formItemProps: {
rules: [
{
......@@ -54,8 +57,8 @@ function getcolumns(ifs, actionRef) {
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
dataIndex: 'companyEmail',
key: 'companyEmail',
formItemProps: {
rules: [
{
......@@ -70,7 +73,6 @@ function getcolumns(ifs, actionRef) {
dataIndex: 'address',
key: 'address',
search: false,
width: 320,
formItemProps: {
rules: [
{
......@@ -81,29 +83,24 @@ function getcolumns(ifs, actionRef) {
},
},
{
title: '状态',
dataIndex: 'status',
valueType: 'radio',
key: 'status',
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 2,
},
],
hideInTable: true,
hideInForm: true,
title: '设备总数(租赁)',
dataIndex: 'address1',
key: 'address1',
search: false,
hideInForm: true
},
{
title: '智能单元总数(租赁)',
dataIndex: 'address2',
key: 'address2',
search: false,
hideInForm: true
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
valueType: 'select',
search: false,
formItemProps: {
rules: [
{
......@@ -129,22 +126,21 @@ function getcolumns(ifs, actionRef) {
return (
<Switch
checkedChildren="启用"
unCheckedChildren="用"
unCheckedChildren="用"
checked={row?.status == 1}
disabled={row?.statusChangeable == 1 ? false : true}
onChange={(flag) => {
// //console.log(e);
if (flag) {
doFetch({
url: '/asset/equipmentSupplier/update/status',
params: { id: row.id, status: '1' },
url: '/lease/umEquipmentSupplier/startStop',
params: { id: row.id, status: '0' },
}).then(() => {
actionRef.current.reload();
});
} else {
doFetch({
url: '/asset/equipmentSupplier/update/status',
params: { id: row.id, status: '2' },
url: '/lease/umEquipmentSupplier/startStop',
params: { id: row.id, status: '1' },
}).then(() => {
actionRef.current.reload();
});
......@@ -158,8 +154,8 @@ function getcolumns(ifs, actionRef) {
title: '评分',
dataIndex: 'score',
key: 'score',
width: 50,
valueType: 'rate',
search: false,
searchValueType: 'digit',
fieldProps: {
defaultValue: 0,
......@@ -181,7 +177,6 @@ function getcolumns(ifs, actionRef) {
key: 'remark',
search: false,
valueType: 'textarea',
width: 300,
fieldProps: {
placeholder: '请输入',
showCount: true,
......@@ -200,7 +195,7 @@ function getcolumns(ifs, actionRef) {
title: '联系信息',
valueType: 'formList',
dataIndex: 'list',
key: 'supplierUserList',
key: 'supplierContactsList',
initialValue: [
{
state: 'all',
......@@ -214,8 +209,8 @@ function getcolumns(ifs, actionRef) {
columns: [
{
title: '联系人',
dataIndex: 'userName',
key: 'userName',
dataIndex: 'contactsName',
key: 'contactsName',
formItemProps: {
rules: [
{
......@@ -230,8 +225,8 @@ function getcolumns(ifs, actionRef) {
},
{
title: '手机号码',
dataIndex: 'telephone',
key: 'telephone',
dataIndex: 'mobilePhone',
key: 'mobilePhone',
colProps: {
sm: 6,
},
......@@ -255,8 +250,8 @@ function getcolumns(ifs, actionRef) {
},
{
title: '职务',
dataIndex: 'title',
key: 'title',
dataIndex: 'postName',
key: 'postName',
fieldProps: {
placeholder: '请输入职务',
},
......
......@@ -16,22 +16,18 @@ import ExtendField from '@/components/ExtendField';
import { doFetch } from '@/utils/doFetch';
import { Image, message, Divider } from 'antd';
import { ProDescriptions } from '@ant-design/pro-components';
const urlParams = {
save: '/lease/umEquipmentSupplier/save',
remove: '/lease/umEquipmentSupplier/deleteById',
list: '/lease/umEquipmentSupplier/queryList',
detail: '/lease/umEquipmentSupplier/queryById'
};
function Supplier(props) {
let actionRef = useRef(),
formRef = useRef();
const [drawer, setDrawer] = useState({
visible: false,
});
const urlParams = {
save: '/asset/equipmentSupplier/save',
remove: '/asset/equipmentSupplier/deleteById',
list: '/asset/equipmentSupplier/queryList',
detail: '/asset/equipmentSupplier/query/detail',
detail_nocp: '/asset/equipmentSupplier/queryById',
};
const edit = (text, row, _, action) => {
return (
<PremButton
......@@ -129,11 +125,16 @@ function Supplier(props) {
dataIndex: 'supplierName',
key: 'supplierName',
},
{ title: '公司官网', dataIndex: 'officialWebsite', key: 'officialWebsite' },
{
title: '纳税人识别号',
dataIndex: 'taxpayerIdentificationNumber',
key: 'taxpayerIdentificationNumber'
},
{ title: '公司官网', dataIndex: 'companyWebsite', key: 'companyWebsite' },
{
title: '联系电话',
dataIndex: 'telephone',
key: 'telephone',
dataIndex: 'phone',
key: 'phone',
},
{
title: '公司邮箱',
......@@ -190,46 +191,46 @@ function Supplier(props) {
};
const [request, setrequest] = useState();
useEffect(() => {
const fn = async () => {
let res = await doFetch({
url: '/base/paFormField/queryList',
params: {
formId: '3',
},
});
if (res?.data?.dataList) {
let column = [];
res?.data?.dataList?.forEach?.((el) => {
column.push({
...selectValueType(el.fieldChar, el.valueList),
title: el.fieldName,
dataIndex: el.id,
key: el.id,
});
});
setnewfieldscolumns(column);
}
},
fn2 = async () => {
const res = await doFetch({
url: urlParams.detail,
params: { id: drawer?.item?.id },
});
let obj = {};
res?.data?.data['equipmentSupplierCharList']?.forEach?.((it) => {
obj[it?.fieldId] = it?.fieldRealValue;
});
setrequest(
{
...(res?.data?.data ?? {}),
...obj,
} ?? {},
);
};
fn();
fn2();
}, []);
const fn = async () => {
let res = await doFetch({
url: '/base/paFormField/queryList',
params: {
formId: '3',
},
});
if (res?.data?.dataList) {
let column = [];
res?.data?.dataList?.forEach?.((el) => {
column.push({
...selectValueType(el.fieldChar, el.valueList),
title: el.fieldName,
dataIndex: el.id,
key: el.id,
});
});
setnewfieldscolumns(column);
}
},
fn2 = async () => {
const res = await doFetch({
url: urlParams.detail,
params: { id: drawer?.item?.id },
});
let obj = {};
res?.data?.data['equipmentSupplierCharList']?.forEach?.((it) => {
obj[it?.fieldId] = it?.fieldRealValue;
});
setrequest(
{
...(res?.data?.data ?? {}),
...obj,
} ?? {},
);
};
return (
<>
<ProDescriptions dataSource={request} columns={columns} />
......@@ -238,8 +239,8 @@ function Supplier(props) {
columns={[
{
title: '联系人',
dataIndex: 'userName',
key: 'userName',
dataIndex: 'contactsName',
key: 'contactsName',
search: false,
formItemProps: {
rules: [
......@@ -253,8 +254,8 @@ function Supplier(props) {
{
title: '手机号码',
search: false,
dataIndex: 'telephone',
key: 'telephone',
dataIndex: 'mobilePhone',
key: 'mobilePhone',
},
{
title: '邮箱',
......@@ -265,8 +266,8 @@ function Supplier(props) {
{
title: '职务',
search: false,
dataIndex: 'title',
key: 'title',
dataIndex: 'postName',
key: 'postName',
fieldProps: {
placeholder: '请选择',
},
......@@ -280,7 +281,7 @@ function Supplier(props) {
},
},
]}
dataSource={request?.supplierUserList}
dataSource={request?.supplierContactsList}
resizeable={false}
pagination={false}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment