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

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

parent 668ec201
...@@ -325,6 +325,12 @@ export default [ ...@@ -325,6 +325,12 @@ export default [
icon: '', icon: '',
component: './lease/supplier', component: './lease/supplier',
}, },
{
name: '设备查看',
path: '/lease/devicedata',
icon: '',
component: './lease/devicedata',
},
], ],
}, },
]; ];
...@@ -15,7 +15,6 @@ function DrawerPro(props) { ...@@ -15,7 +15,6 @@ function DrawerPro(props) {
fields: props.fields, fields: props.fields,
detailData: props.detailData, detailData: props.detailData,
}; };
return ( return (
<Drawer <Drawer
maskClosable={false} 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 }) { ...@@ -1262,10 +1262,15 @@ function UploadImg({ value, onChange, fieldProps, valueType }) {
} else { } else {
url = file.thumbUrl; url = file.thumbUrl;
} }
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({ setImage({
url, url,
visible: true, visible: true,
}); });
} else {
}
}, },
className: "upload-list-inline" className: "upload-list-inline"
}; };
......
import { Tooltip } from "antd"; import { Tooltip } from "antd";
import Filedetail from "@/components/Filedetail";
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return { return {
columns: [ columns: [
{ {
title: '客户编号', title: '客户编号',
dataIndex: 'f1', dataIndex: 'customerNo',
key: 'f1', key: 'customerNo',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
colProps: { span: 8 }, colProps: { span: 8 },
}, },
{ {
title: '客户名称', title: '客户名称',
dataIndex: 'f2', dataIndex: 'customerName',
key: 'f2', key: 'customerName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
colProps: { span: 8 }, colProps: { span: 8 },
render: (_, row) => { render: (_, row) => {
return ( return (
<Tooltip title={row.f2}> <Tooltip title={row.customerName}>
<a <a
className="table-cell" className="table-cell"
onClick={() => { onClick={() => {
...@@ -30,7 +31,7 @@ function getcolumns(setdrawer) { ...@@ -30,7 +31,7 @@ function getcolumns(setdrawer) {
})); }));
}} }}
> >
{row.f2} {row.customerName}
</a> </a>
</Tooltip> </Tooltip>
); );
...@@ -38,99 +39,104 @@ function getcolumns(setdrawer) { ...@@ -38,99 +39,104 @@ function getcolumns(setdrawer) {
}, },
{ {
title: '负责工厂', title: '负责工厂',
dataIndex: 'f3', dataIndex: 'factoryName',
key: 'f3', key: 'factoryId',
valueType: 'select', valueType: 'select',
options: { path: '/', params: {} }, options: { path: '/lease/umLeaseCustomer/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
colProps: { span: 8 }, colProps: { span: 8 },
}, },
{ title: '企业法人', dataIndex: 'f4', key: 'f4', colProps: { span: 8 }, hideInSearch: true }, { title: '企业法人', dataIndex: 'enterpriseLegalPerson', key: 'enterpriseLegalPerson', colProps: { span: 8 }, hideInSearch: true },
{ title: '联系电话', dataIndex: 'f5', key: 'f5', colProps: { span: 8 }, hideInSearch: true }, { title: '联系电话', dataIndex: 'phone', key: 'phone', colProps: { span: 8 }, hideInSearch: true },
{ {
title: '产值', title: '产值',
dataIndex: 'f6', dataIndex: 'outputValue',
key: 'f6', key: 'outputValue',
colProps: { span: 8 }, colProps: { span: 8 },
hideInTable: true, hideInTable: true,
hideInSearch: true, hideInSearch: true
}, },
{ {
title: '所属行业', title: '所属行业',
dataIndex: 'f7', dataIndex: 'industry',
key: 'f7', key: 'industry',
colProps: { span: 8 }, colProps: { span: 8 },
hideInTable: true, hideInTable: true,
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '地址', title: '地址',
dataIndex: 'f8', dataIndex: 'address',
key: 'f8', key: 'address',
colProps: { span: 8 }, colProps: { span: 8 },
hideInTable: true, hideInTable: true,
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '纳税人识别号', title: '纳税人识别号',
dataIndex: 'f9', dataIndex: 'taxpayerIdentificationNumber',
key: 'f9', key: 'taxpayerIdentificationNumber',
colProps: { span: 8 }, colProps: { span: 8 },
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '开户行银行', title: '开户行银行',
dataIndex: 'f10', dataIndex: 'openingBank',
key: 'f10', key: 'openingBank',
colProps: { span: 8 }, colProps: { span: 8 },
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '收款账户', title: '收款账户',
dataIndex: 'f11', dataIndex: 'collectionAccount',
key: 'f11', key: 'collectionAccount',
colProps: { span: 8 }, colProps: { span: 8 },
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '所属区域', title: '所属区域',
dataIndex: 'f12', dataIndex: 'regionName',
key: 'f12', key: 'regionId',
colProps: { span: 8 }, colProps: { span: 8 },
valueType: 'select', valueType: 'select',
mode: 'multiple', mode: 'multiple',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
options: { path: '/', params: {} }, options: { path: '/lease/umLeaseCustomer/getAllShopSelection', params: {} },
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '企业简介', title: '企业简介',
dataIndex: 'f13', dataIndex: 'enterpriseIntroduction',
key: 'f13', key: 'enterpriseIntroduction',
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
valueType: 'textarea', valueType: 'textarea',
colProps: { span: 24 }, colProps: { span: 24 },
span: 3
}, },
{ {
title: '附件上传(最多5个)', title: '附件上传(最多5个)',
dataIndex: 'f14', dataIndex: 'picList',
key: 'f14', key: 'picList',
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
valueType: 'uploadBtn', valueType: 'uploadBtn',
colProps: { span: 24 }, colProps: { span: 24 },
span: 3,
fieldProps: { fieldProps: {
limit: 5, limit: 5,
}, },
hideInDescriptions: true render: (_, row) => {
return <Filedetail files={row?.['picList']} />
}
}, },
], ],
pathconfig: { pathconfig: {
add: '', add: '/lease/umLeaseCustomer/save',
edit: '', edit: '/lease/umLeaseCustomer/save',
list: '', list: '/lease/umLeaseCustomer/queryList',
delete: '', delete: '/lease/umLeaseCustomer/deleteById',
detail: '/lease/umLeaseCustomer/queryById'
}, },
}; };
} }
......
...@@ -18,6 +18,7 @@ const Custom = () => { ...@@ -18,6 +18,7 @@ const Custom = () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: false, visible: false,
item: {}
})); }));
} }
}, },
...@@ -54,7 +55,7 @@ const Custom = () => { ...@@ -54,7 +55,7 @@ const Custom = () => {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onConfirm: async () => { 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') { if (res.code === '0000') {
actionRef.current.reload(); actionRef.current.reload();
} }
...@@ -71,24 +72,28 @@ const Custom = () => { ...@@ -71,24 +72,28 @@ const Custom = () => {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer)?.columns ?? []; 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({ return defcolumn.concat({
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)], render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)],
}); });
}, []); }, [drawer.val, drawer.item]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {}; let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf; return pathconf;
}, []); }, []);
return <div> return <div>
<AutoTable <AutoTable
pagetitle={<h3 className="page-title">客户管理</h3>} pagetitle={<h3 className="page-title">客户管理</h3>}
columns={columns} columns={columns}
path={pathconfig?.list} path={pathconfig?.list}
// dataSource={[{ 'f1': '111', 'f2': '222', id: 1 }]}
actionRef={actionRef} actionRef={actionRef}
pageextra={'add'} pageextra={'add'}
resizeable={false} resizeable={false}
...@@ -112,11 +117,11 @@ const Custom = () => { ...@@ -112,11 +117,11 @@ const Custom = () => {
}} }}
/> />
<DrawerPro <DrawerPro
{...drawer}
fields={columns} fields={columns}
// detailpath={drawer.type == 'add' ? '' : drawer?.detailpath} detailpath={drawer.val == 'add' || !drawer?.item?.id ? '' : pathconfig?.detail}
params={{ id: drawer?.item?.id }} params={drawer.val == 'add' ? {} : { id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}} defaultFormValue={drawer?.item ?? {}}
detailData={drawer?.item ?? {}}
placement="right" placement="right"
onClose={() => { onClose={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...@@ -124,7 +129,6 @@ const Custom = () => { ...@@ -124,7 +129,6 @@ const Custom = () => {
visible: false, visible: false,
})); }));
}} }}
{...drawer}
onFinish={async (vals) => { onFinish={async (vals) => {
if (drawer?.val == "add") { if (drawer?.val == "add") {
await runAsync({ url: pathconfig?.add, params: { ...vals } }); await runAsync({ url: pathconfig?.add, params: { ...vals } });
...@@ -136,23 +140,6 @@ const Custom = () => { ...@@ -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> </DrawerPro>
</div> </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 React, { useMemo } from 'react';
import DetailPro from '@/components/DetailPro';
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
const Resume = ({ setdrawer, drawer }) => { const Resume = ({ setdrawer, drawer }) => {
const columns = [ const columns = [
......
...@@ -212,32 +212,8 @@ const Ledger = () => { ...@@ -212,32 +212,8 @@ const Ledger = () => {
] ]
} }
} }
}, [drawer.val, drawer.item]) }, [drawer.val, drawer.item]);
const rightExtra = () => {
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}>
<AutoTable
pagetitle={'设备列表'}
columns={columns}
path={pathconfig?.list}
actionRef={actionRef}
resizeable={false}
dataSource={[{ 'f1': '111', 'f2': '222', id: 1, status: 1, f12: 1, intelligentUnit: '11' }]}
pageextra={() => {
return [ return [
<PremButton <PremButton
key='add' key='add'
...@@ -291,7 +267,32 @@ const Ledger = () => { ...@@ -291,7 +267,32 @@ const Ledger = () => {
状态查看 状态查看
</PremButton>, </PremButton>,
]; ];
}} }
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}>
<AutoTable
pagetitle={'设备列表'}
columns={columns}
path={pathconfig?.list}
actionRef={actionRef}
resizeable={false}
dataSource={[{ 'f1': '111', 'f2': '222', id: 1, status: 1, f12: 1, intelligentUnit: '11' }]}
pageextra={rightExtra}
bordered={false} bordered={false}
x={1500} x={1500}
/> />
...@@ -300,11 +301,11 @@ const Ledger = () => { ...@@ -300,11 +301,11 @@ const Ledger = () => {
<DrawerPro <DrawerPro
{...drawer}
fields={columns} fields={columns}
// detailpath={drawer.type == 'add' ? '' : drawer?.detailpath} detailpath={drawer.val == 'add' || !drawer?.item?.id ? '' : pathconfig?.detail}
params={{ id: drawer?.item?.id }} params={drawer.val == 'add' ? {} : { id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}} defaultFormValue={drawer?.item ?? {}}
detailData={drawer?.item ?? {}}
placement="right" placement="right"
onClose={() => { onClose={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...@@ -312,7 +313,6 @@ const Ledger = () => { ...@@ -312,7 +313,6 @@ const Ledger = () => {
visible: false, visible: false,
})); }));
}} }}
{...drawer}
onFinish={async (vals) => { onFinish={async (vals) => {
// if (drawer?.val == "add") { // if (drawer?.val == "add") {
// await runAsync({ url: pathconfig?.add, params: { ...vals } }); // await runAsync({ url: pathconfig?.add, params: { ...vals } });
......
...@@ -8,13 +8,11 @@ function getcolumns(ifs, actionRef) { ...@@ -8,13 +8,11 @@ function getcolumns(ifs, actionRef) {
title: '供应商编号', title: '供应商编号',
dataIndex: 'supplierNo', dataIndex: 'supplierNo',
key: 'supplierNo', key: 'supplierNo',
width: 120,
}, },
{ {
title: '供应商名称', title: '供应商名称',
dataIndex: 'supplierName', dataIndex: 'supplierName',
key: 'supplierName', key: 'supplierName',
width: 150,
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -24,10 +22,15 @@ function getcolumns(ifs, actionRef) { ...@@ -24,10 +22,15 @@ function getcolumns(ifs, actionRef) {
], ],
}, },
}, },
{
title: '纳税人识别号',
dataIndex: 'taxpayerIdentificationNumber',
key: 'taxpayerIdentificationNumber',
},
{ {
title: '公司官网', title: '公司官网',
dataIndex: 'officialWebsite', dataIndex: 'companyWebsite',
key: 'officialWebsite', key: 'companyWebsite',
hideInTable: true, hideInTable: true,
search: false, search: false,
formItemProps: { formItemProps: {
...@@ -41,8 +44,8 @@ function getcolumns(ifs, actionRef) { ...@@ -41,8 +44,8 @@ function getcolumns(ifs, actionRef) {
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'telephone', dataIndex: 'phone',
key: 'telephone', key: 'phone',
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -54,8 +57,8 @@ function getcolumns(ifs, actionRef) { ...@@ -54,8 +57,8 @@ function getcolumns(ifs, actionRef) {
}, },
{ {
title: '邮箱', title: '邮箱',
dataIndex: 'email', dataIndex: 'companyEmail',
key: 'email', key: 'companyEmail',
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -70,7 +73,6 @@ function getcolumns(ifs, actionRef) { ...@@ -70,7 +73,6 @@ function getcolumns(ifs, actionRef) {
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
search: false, search: false,
width: 320,
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -81,29 +83,24 @@ function getcolumns(ifs, actionRef) { ...@@ -81,29 +83,24 @@ function getcolumns(ifs, actionRef) {
}, },
}, },
{ {
title: '状态', title: '设备总数(租赁)',
dataIndex: 'status', dataIndex: 'address1',
valueType: 'radio', key: 'address1',
key: 'status', search: false,
options: [ hideInForm: true
{
label: '启用',
value: 1,
}, },
{ {
label: '禁用', title: '智能单元总数(租赁)',
value: 2, dataIndex: 'address2',
}, key: 'address2',
], search: false,
hideInTable: true, hideInForm: true
hideInForm: true,
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
valueType: 'select', valueType: 'select',
search: false,
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -129,22 +126,21 @@ function getcolumns(ifs, actionRef) { ...@@ -129,22 +126,21 @@ function getcolumns(ifs, actionRef) {
return ( return (
<Switch <Switch
checkedChildren="启用" checkedChildren="启用"
unCheckedChildren="用" unCheckedChildren="用"
checked={row?.status == 1} checked={row?.status == 1}
disabled={row?.statusChangeable == 1 ? false : true} disabled={row?.statusChangeable == 1 ? false : true}
onChange={(flag) => { onChange={(flag) => {
// //console.log(e);
if (flag) { if (flag) {
doFetch({ doFetch({
url: '/asset/equipmentSupplier/update/status', url: '/lease/umEquipmentSupplier/startStop',
params: { id: row.id, status: '1' }, params: { id: row.id, status: '0' },
}).then(() => { }).then(() => {
actionRef.current.reload(); actionRef.current.reload();
}); });
} else { } else {
doFetch({ doFetch({
url: '/asset/equipmentSupplier/update/status', url: '/lease/umEquipmentSupplier/startStop',
params: { id: row.id, status: '2' }, params: { id: row.id, status: '1' },
}).then(() => { }).then(() => {
actionRef.current.reload(); actionRef.current.reload();
}); });
...@@ -158,8 +154,8 @@ function getcolumns(ifs, actionRef) { ...@@ -158,8 +154,8 @@ function getcolumns(ifs, actionRef) {
title: '评分', title: '评分',
dataIndex: 'score', dataIndex: 'score',
key: 'score', key: 'score',
width: 50,
valueType: 'rate', valueType: 'rate',
search: false,
searchValueType: 'digit', searchValueType: 'digit',
fieldProps: { fieldProps: {
defaultValue: 0, defaultValue: 0,
...@@ -181,7 +177,6 @@ function getcolumns(ifs, actionRef) { ...@@ -181,7 +177,6 @@ function getcolumns(ifs, actionRef) {
key: 'remark', key: 'remark',
search: false, search: false,
valueType: 'textarea', valueType: 'textarea',
width: 300,
fieldProps: { fieldProps: {
placeholder: '请输入', placeholder: '请输入',
showCount: true, showCount: true,
...@@ -200,7 +195,7 @@ function getcolumns(ifs, actionRef) { ...@@ -200,7 +195,7 @@ function getcolumns(ifs, actionRef) {
title: '联系信息', title: '联系信息',
valueType: 'formList', valueType: 'formList',
dataIndex: 'list', dataIndex: 'list',
key: 'supplierUserList', key: 'supplierContactsList',
initialValue: [ initialValue: [
{ {
state: 'all', state: 'all',
...@@ -214,8 +209,8 @@ function getcolumns(ifs, actionRef) { ...@@ -214,8 +209,8 @@ function getcolumns(ifs, actionRef) {
columns: [ columns: [
{ {
title: '联系人', title: '联系人',
dataIndex: 'userName', dataIndex: 'contactsName',
key: 'userName', key: 'contactsName',
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -230,8 +225,8 @@ function getcolumns(ifs, actionRef) { ...@@ -230,8 +225,8 @@ function getcolumns(ifs, actionRef) {
}, },
{ {
title: '手机号码', title: '手机号码',
dataIndex: 'telephone', dataIndex: 'mobilePhone',
key: 'telephone', key: 'mobilePhone',
colProps: { colProps: {
sm: 6, sm: 6,
}, },
...@@ -255,8 +250,8 @@ function getcolumns(ifs, actionRef) { ...@@ -255,8 +250,8 @@ function getcolumns(ifs, actionRef) {
}, },
{ {
title: '职务', title: '职务',
dataIndex: 'title', dataIndex: 'postName',
key: 'title', key: 'postName',
fieldProps: { fieldProps: {
placeholder: '请输入职务', placeholder: '请输入职务',
}, },
......
...@@ -16,22 +16,18 @@ import ExtendField from '@/components/ExtendField'; ...@@ -16,22 +16,18 @@ import ExtendField from '@/components/ExtendField';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { Image, message, Divider } from 'antd'; import { Image, message, Divider } from 'antd';
import { ProDescriptions } from '@ant-design/pro-components'; 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) { function Supplier(props) {
let actionRef = useRef(), let actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setDrawer] = useState({ const [drawer, setDrawer] = useState({
visible: false, 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) => { const edit = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -129,11 +125,16 @@ function Supplier(props) { ...@@ -129,11 +125,16 @@ function Supplier(props) {
dataIndex: 'supplierName', dataIndex: 'supplierName',
key: 'supplierName', key: 'supplierName',
}, },
{ title: '公司官网', dataIndex: 'officialWebsite', key: 'officialWebsite' }, {
title: '纳税人识别号',
dataIndex: 'taxpayerIdentificationNumber',
key: 'taxpayerIdentificationNumber'
},
{ title: '公司官网', dataIndex: 'companyWebsite', key: 'companyWebsite' },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'telephone', dataIndex: 'phone',
key: 'telephone', key: 'phone',
}, },
{ {
title: '公司邮箱', title: '公司邮箱',
...@@ -190,6 +191,9 @@ function Supplier(props) { ...@@ -190,6 +191,9 @@ function Supplier(props) {
}; };
const [request, setrequest] = useState(); const [request, setrequest] = useState();
useEffect(() => { useEffect(() => {
fn();
fn2();
}, []);
const fn = async () => { const fn = async () => {
let res = await doFetch({ let res = await doFetch({
url: '/base/paFormField/queryList', url: '/base/paFormField/queryList',
...@@ -227,9 +231,6 @@ function Supplier(props) { ...@@ -227,9 +231,6 @@ function Supplier(props) {
} ?? {}, } ?? {},
); );
}; };
fn();
fn2();
}, []);
return ( return (
<> <>
<ProDescriptions dataSource={request} columns={columns} /> <ProDescriptions dataSource={request} columns={columns} />
...@@ -238,8 +239,8 @@ function Supplier(props) { ...@@ -238,8 +239,8 @@ function Supplier(props) {
columns={[ columns={[
{ {
title: '联系人', title: '联系人',
dataIndex: 'userName', dataIndex: 'contactsName',
key: 'userName', key: 'contactsName',
search: false, search: false,
formItemProps: { formItemProps: {
rules: [ rules: [
...@@ -253,8 +254,8 @@ function Supplier(props) { ...@@ -253,8 +254,8 @@ function Supplier(props) {
{ {
title: '手机号码', title: '手机号码',
search: false, search: false,
dataIndex: 'telephone', dataIndex: 'mobilePhone',
key: 'telephone', key: 'mobilePhone',
}, },
{ {
title: '邮箱', title: '邮箱',
...@@ -265,8 +266,8 @@ function Supplier(props) { ...@@ -265,8 +266,8 @@ function Supplier(props) {
{ {
title: '职务', title: '职务',
search: false, search: false,
dataIndex: 'title', dataIndex: 'postName',
key: 'title', key: 'postName',
fieldProps: { fieldProps: {
placeholder: '请选择', placeholder: '请选择',
}, },
...@@ -280,7 +281,7 @@ function Supplier(props) { ...@@ -280,7 +281,7 @@ function Supplier(props) {
}, },
}, },
]} ]}
dataSource={request?.supplierUserList} dataSource={request?.supplierContactsList}
resizeable={false} resizeable={false}
pagination={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