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

1740

parent a155993d
...@@ -628,7 +628,7 @@ function NolinkSelect({ item, colProps, curindex = 0 }) { ...@@ -628,7 +628,7 @@ function NolinkSelect({ item, colProps, curindex = 0 }) {
if (Array.isArray(curoption)) { if (Array.isArray(curoption)) {
options = { options = {
options: item.showAll ? [{ label: '全部', value: 'all' }] : [...curoption], options: item.showAll ? [{ label: '全部', value: 'all' }, ...curoption] : [...curoption],
}; };
} else if (curoption) { } else if (curoption) {
options = { options = {
......
...@@ -100,10 +100,12 @@ function getcolumns(setdrawer) { ...@@ -100,10 +100,12 @@ function getcolumns(setdrawer) {
{ {
title: '所属区域', title: '所属区域',
dataIndex: 'regionName', dataIndex: 'regionName',
key: 'regionId', key: 'regionIdList',
colProps: { span: 8 }, colProps: { span: 8 },
valueType: 'select', valueType: 'select',
mode: 'multiple', fieldProps: {
mode: 'multiple'
},
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
options: { path: '/lease/umLeaseCustomer/getAllShopSelection', params: {} }, options: { path: '/lease/umLeaseCustomer/getAllShopSelection', params: {} },
hideInSearch: true, hideInSearch: true,
......
...@@ -20,8 +20,8 @@ const Devicedata = () => { ...@@ -20,8 +20,8 @@ const Devicedata = () => {
[extraparams, setextraparams] = useState({}), [extraparams, setextraparams] = useState({}),
[activeKey, catk] = useState('item-1'), [activeKey, catk] = useState('item-1'),
[item2extraparams, citp] = useState({}), [item2extraparams, citp] = useState({}),
[searchParams, csp] = useState({}), [searchParams, csp] = useState({});
[leaseList, clea] = useState([]); // [leaseList, clea] = useState([]);
const { allWebsocket: { commonWebsocket, commonWebmsg } } = useModel('useGlobal'); const { allWebsocket: { commonWebsocket, commonWebmsg } } = useModel('useGlobal');
const { run, loading, runAsync } = useRequest(doFetch, { const { run, loading, runAsync } = useRequest(doFetch, {
manual: true, manual: true,
...@@ -34,43 +34,43 @@ const Devicedata = () => { ...@@ -34,43 +34,43 @@ const Devicedata = () => {
})); }));
} }
}, },
}), });
tableData = useRequest(() => doFetch({ url: '/lease/umLeaseLedger/queryLeaseList', params: { ...searchParams, ...extraparams } }), { // tableData = useRequest(() => doFetch({ url: '/lease/umLeaseLedger/queryLeaseList', params: { ...searchParams, ...extraparams } }), {
refreshDeps: [extraparams, searchParams], // refreshDeps: [extraparams, searchParams],
onSuccess: (res, params) => { // onSuccess: (res, params) => {
if (res.code == '0000') { // if (res.code == '0000') {
clea(res?.data?.dataList ?? []) // clea(res?.data?.dataList ?? [])
} // }
} // }
}); // });
useEffect(() => { // useEffect(() => {
const msg = commonWebmsg?.msg; // const msg = commonWebmsg?.msg;
if (commonWebmsg?.wsMsgModel == 'LEASE') { // if (commonWebmsg?.wsMsgModel == 'LEASE') {
let newList = JSON.parse(JSON.stringify(leaseList)); // let newList = JSON.parse(JSON.stringify(leaseList));
newList = newList?.map(it => { // newList = newList?.map(it => {
if (it.id == msg.id) { // if (it.id == msg.id) {
it.collectStatusName = msg.collectStatusName; // it.collectStatusName = msg.collectStatusName;
it.collectStatus = msg.collectStatus; // it.collectStatus = msg.collectStatus;
} // }
return it // return it
}); // });
clea(newList); // clea(newList);
} // }
}, [commonWebmsg]); // }, [commonWebmsg]);
useEffect(() => { // useEffect(() => {
try { // try {
commonWebsocket && commonWebsocket.emit("sendMessage", { // commonWebsocket && commonWebsocket.emit("sendMessage", {
"wsMsgModel": "LEASE", // "wsMsgModel": "LEASE",
"subId": dayjs().valueOf(), // "subId": dayjs().valueOf(),
param: '', // param: '',
unsubscribe: false, // unsubscribe: false,
}); // });
} catch (error) { // } catch (error) {
} // }
}, []); // }, []);
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer, activeKey)?.columns ?? []; let defcolumn = getcolumns(setdrawer, activeKey)?.columns ?? [];
return defcolumn; return defcolumn;
...@@ -83,23 +83,24 @@ const Devicedata = () => { ...@@ -83,23 +83,24 @@ const Devicedata = () => {
key: 'item-1', key: 'item-1',
children: <AutoTable children: <AutoTable
columns={columns} columns={columns}
dataSource={leaseList} // dataSource={leaseList}
path='/lease/umLeaseLedger/queryList'
actionRef={actionRef} actionRef={actionRef}
resizeable={false} resizeable={false}
bordered={false} bordered={false}
x={1500} x={1500}
formRef={formRef} formRef={formRef}
dataSourceFieldsChange={(val) => { // dataSourceFieldsChange={(val) => {
csp({ ...val }) // csp({ ...val })
}} // }}
extraparams={extraparams} extraparams={extraparams}
pagination={false} // pagination={false}
toolBarRender={true} // toolBarRender={true}
options={{ // options={{
reload: () => { // reload: () => {
tableData.run() // tableData.run()
} // }
}} // }}
/> />
}, },
{ {
...@@ -108,7 +109,7 @@ const Devicedata = () => { ...@@ -108,7 +109,7 @@ const Devicedata = () => {
children: <Account boxRef={boxRef} extraparams={item2extraparams} /> children: <Account boxRef={boxRef} extraparams={item2extraparams} />
} }
] ]
}, [extraparams, leaseList]); }, [extraparams]);
const items = useMemo(() => { const items = useMemo(() => {
if (drawer.val == 'only') { if (drawer.val == 'only') {
if (activeKey == 'item-1') { if (activeKey == 'item-1') {
......
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