Commit 059d7fee authored by TZW's avatar TZW

优化

parent ee682445
...@@ -13,9 +13,11 @@ export default { ...@@ -13,9 +13,11 @@ export default {
dev: { dev: {
[defaultSetting.proxypath]: { [defaultSetting.proxypath]: {
// 要代理的地址 // 要代理的地址
// target: 'http://192.168.40.64:28000', //jf哥 target: 'http://192.168.40.64:28000', //jf哥
// target: 'http://192.168.40.248:8080', //jf哥
// target: 'http://192.168.40.64:28000', //gc哥 // target: 'http://192.168.40.64:28000', //gc哥
target: 'http://192.168.40.203:8000', //dj哥 // target: 'http://192.168.40.203:8000', //dj哥
// target: 'http://192.168.40.35:8001', //测试
changeOrigin: true, changeOrigin: true,
}, },
'/token': { '/token': {
......
...@@ -71,7 +71,7 @@ function DetailPro(props) { ...@@ -71,7 +71,7 @@ function DetailPro(props) {
<> <>
<Col span={24}> <Col span={24}>
<div className={styles.title} style={{ borderWidth: i == 0 ? 0 : 1 }}> <div className={styles.title} style={{ borderWidth: i == 0 ? 0 : 1 }}>
{it.title} {it?.render ? it?.render?.(curitem[it.dataIndex], curitem) : it.title}
</div> </div>
</Col> </Col>
</> </>
......
...@@ -166,6 +166,17 @@ function InitForm(props) { ...@@ -166,6 +166,17 @@ function InitForm(props) {
} }
: {}; : {};
const supplierList = res?.data?.data?.supplierList
? {
supplierList: res?.data?.data?.supplierList?.map?.((it, i) => {
return {
...it,
id: it?.supplierId,
};
}),
}
: {};
let result = res?.data?.data; let result = res?.data?.data;
if (result?.nrList) { if (result?.nrList) {
result.nrList = result?.nrList?.map((it) => { result.nrList = result?.nrList?.map((it) => {
...@@ -178,6 +189,7 @@ function InitForm(props) { ...@@ -178,6 +189,7 @@ function InitForm(props) {
...defaultFormValue, ...defaultFormValue,
...(result ?? {}), ...(result ?? {}),
...relationSupplierList, ...relationSupplierList,
...supplierList,
}; };
} else { } else {
// console.log({ // console.log({
......
...@@ -28,6 +28,7 @@ const TagView = ({ children, home }) => { ...@@ -28,6 +28,7 @@ const TagView = ({ children, home }) => {
// 初始化 visitedViews,设置首页 // 初始化 visitedViews,设置首页
const initTags = (routeContext) => { const initTags = (routeContext) => {
// console.log(routeContext);
const { menuData } = routeContext; const { menuData } = routeContext;
if (tagList.length === 0 && menuData) { if (tagList.length === 0 && menuData) {
const allarr = []; const allarr = [];
...@@ -56,6 +57,7 @@ const TagView = ({ children, home }) => { ...@@ -56,6 +57,7 @@ const TagView = ({ children, home }) => {
// 监听路由改变 // 监听路由改变
const handleOnChange = (routeContext) => { const handleOnChange = (routeContext) => {
const { currentMenu } = routeContext; const { currentMenu } = routeContext;
// console.log(tagList);
// tags初始化 // tags初始化
if (tagList.length === 0) { if (tagList.length === 0) {
return initTags(routeContext); return initTags(routeContext);
...@@ -69,6 +71,7 @@ const TagView = ({ children, home }) => { ...@@ -69,6 +71,7 @@ const TagView = ({ children, home }) => {
//console.log(item); //console.log(item);
hasOpen = true; hasOpen = true;
// 刷新浏览器时,重新覆盖当前 path 的 children // 刷新浏览器时,重新覆盖当前 path 的 children
// console.log(item);
return { ...item, active: true, children: item.children }; return { ...item, active: true, children: item.children };
} else { } else {
return { ...item, active: false }; return { ...item, active: false };
......
...@@ -529,4 +529,10 @@ ol { ...@@ -529,4 +529,10 @@ ol {
>div:first-child>div ul { >div:first-child>div ul {
z-index: 1001 !important; z-index: 1001 !important;
} }
}
.ant-descriptions-row {
.ant-table-small {
margin: 0 !important;
}
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56 * @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-03 10:01:31 * @Last Modified time: 2023-02-15 10:50:14
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -37,6 +37,7 @@ function Model(props) { ...@@ -37,6 +37,7 @@ function Model(props) {
// Can not select days before today and today // Can not select days before today and today
return current && current > dayjs().endOf('day'); return current && current > dayjs().endOf('day');
}; };
const [activeTab, setactiveTab] = useState(1);
let actionRef = useRef(), let actionRef = useRef(),
formRef = useRef(), formRef = useRef(),
[drawer, setDrawer] = useState({ [drawer, setDrawer] = useState({
...@@ -615,7 +616,6 @@ function Model(props) { ...@@ -615,7 +616,6 @@ function Model(props) {
//设备详情 //设备详情
const Detail = () => { const Detail = () => {
const [activeTab, setactiveTab] = useState(1);
// 基础信息 // 基础信息
const BaseInfo = () => { const BaseInfo = () => {
const columns1 = [ const columns1 = [
...@@ -2368,8 +2368,9 @@ function Model(props) { ...@@ -2368,8 +2368,9 @@ function Model(props) {
<DrawerPro <DrawerPro
placement="right" placement="right"
onClose={() => { onClose={async () => {
setCurrDrawer((s) => ({ await setactiveTab(3);
await setCurrDrawer((s) => ({
...s, ...s,
visible: false, visible: false,
item: null, item: null,
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
import { ProDescriptions } from '@ant-design/pro-components';
import { Divider } from 'rc-menu';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
const columns = [ const columns = [
{ {
...@@ -24,7 +25,7 @@ function getcolumns(setdrawer) { ...@@ -24,7 +25,7 @@ function getcolumns(setdrawer) {
path: '/sparepart/sparePart/queryAllSelect', path: '/sparepart/sparePart/queryAllSelect',
params: {}, params: {},
}, },
render: (text, row) => row?.sparePartNo + '/' + row?.sparePartName, render: (text, row) => `${row?.sparePartNo || '--'}/${row?.sparePartName}`,
}, },
{ {
title: '供应商编号/名称', title: '供应商编号/名称',
...@@ -49,7 +50,7 @@ function getcolumns(setdrawer) { ...@@ -49,7 +50,7 @@ function getcolumns(setdrawer) {
params: {}, params: {},
}, },
render: (text, row) => { render: (text, row) => {
return row?.supplierNo || '--' + '/' + row?.supplierName; return `${row?.supplierNo || '--'}/${row?.supplierName}`;
}, },
}, },
{ {
...@@ -107,6 +108,24 @@ function getcolumns(setdrawer) { ...@@ -107,6 +108,24 @@ function getcolumns(setdrawer) {
fieldProps: { fieldProps: {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '入库类型', title: '入库类型',
...@@ -290,6 +309,24 @@ function getcolumns(setdrawer) { ...@@ -290,6 +309,24 @@ function getcolumns(setdrawer) {
fieldProps: { fieldProps: {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '入库类型', title: '入库类型',
...@@ -449,7 +486,11 @@ function getcolumns(setdrawer) { ...@@ -449,7 +486,11 @@ function getcolumns(setdrawer) {
], ],
}, },
{ {
title: '备件信息', title: (
<div>
<span style={{ color: 'red' }}>* </span>备件信
</div>
),
dataIndex: 'details', dataIndex: 'details',
key: 'details', key: 'details',
valueType: 'split', valueType: 'split',
...@@ -481,80 +522,33 @@ function getcolumns(setdrawer) { ...@@ -481,80 +522,33 @@ function getcolumns(setdrawer) {
{ {
dataIndex: 'splias', dataIndex: 'splias',
valueType: 'split', valueType: 'split',
title: '入库信息', title: '入库/关单信息',
hideInForm: true,
key: 'splisa', key: 'splisa',
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true, hideInForm: true,
span: 1,
hideInTable: true,
search: false,
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
width: 120,
options: [
{ label: '已入库', value: 2 },
{ label: '已关单', value: 3 },
],
render: (_, row) => { render: (_, row) => {
return row?.status == 2 ? '已入库' : '--'; return row?.status == 2 ? '入库信息' : '关单信息';
}, },
}, },
{ {
title: '操作人',
dataIndex: 'operateUserName',
key: 'operateUserName',
hideInSearch: true,
hideInTable: true,
hideInForm: true,
render: (_, row) => {
return row?.status == 2 ? row?.operateUserName : '--';
},
},
{
title: '操作时间',
dataIndex: 'operateTime',
key: 'operateTime',
hideInSearch: true,
hideInTable: true,
hideInForm: true,
render: (_, row) => {
return row?.status == 2 ? row?.operateTime : '--';
},
},
{
dataIndex: 'splias',
valueType: 'split',
hideInForm: true,
title: '关单信息',
key: 'splisa',
},
{
title: '状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status',
hideInForm: true,
hideInTable: true,
span: 1,
search: false,
valueType: 'select', valueType: 'select',
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 120, dropdownMatchSelectWidth: 120,
}, },
width: 120, title: '状态',
span: 1,
key: 'status',
options: [ options: [
{ label: '已入库', value: 2 }, {
{ label: '已关单', value: 3 }, label: '已出库',
value: 2,
},
{
label: '已关单',
value: 3,
},
], ],
render: (_, row) => { hideInForm: true,
return row?.status == 3 ? '已关单' : '--';
},
}, },
{ {
title: '操作人', title: '操作人',
...@@ -563,9 +557,6 @@ function getcolumns(setdrawer) { ...@@ -563,9 +557,6 @@ function getcolumns(setdrawer) {
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
hideInForm: true, hideInForm: true,
render: (_, row) => {
return row?.status == 3 ? row?.operateUserName : '--';
},
}, },
{ {
title: '操作时间', title: '操作时间',
...@@ -574,9 +565,6 @@ function getcolumns(setdrawer) { ...@@ -574,9 +565,6 @@ function getcolumns(setdrawer) {
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
hideInForm: true, hideInForm: true,
render: (_, row) => {
return row?.status == 3 ? row?.operateTime : '--';
},
}, },
], ],
pathconfig: { pathconfig: {
......
...@@ -95,16 +95,20 @@ function Instore(props) { ...@@ -95,16 +95,20 @@ function Instore(props) {
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns;
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ if (activeTabKey == 1) {
title: '操作', return defcolumn.concat({
valueType: 'option', title: '操作',
width: 150, valueType: 'option',
render: (text, row, _, action) => [ width: 150,
defpath?.enabledetail && detail(text, row, _, action), render: (text, row, _, action) => [
defpath?.enableedit && edit(text, row, _, action), // defpath?.enabledetail && detail(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action), defpath?.enableedit && edit(text, row, _, action),
], defpath?.enabledelete && remove(text, row, _, action),
}); ],
});
} else {
return defcolumn;
}
}, [activeTabKey]); }, [activeTabKey]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
......
...@@ -79,6 +79,24 @@ function getcolumns(setdrawer) { ...@@ -79,6 +79,24 @@ function getcolumns(setdrawer) {
fieldProps: { fieldProps: {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '出库类型', title: '出库类型',
...@@ -285,6 +303,24 @@ function getcolumns(setdrawer) { ...@@ -285,6 +303,24 @@ function getcolumns(setdrawer) {
fieldProps: { fieldProps: {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '出库类型', title: '出库类型',
...@@ -487,6 +523,9 @@ function getcolumns(setdrawer) { ...@@ -487,6 +523,9 @@ function getcolumns(setdrawer) {
title: '出库/关单信息', title: '出库/关单信息',
key: 'splisa', key: 'splisa',
hideInForm: true, hideInForm: true,
render: (_, row) => {
return row?.status == 2 ? '出库信息' : '关单信息';
},
}, },
{ {
dataIndex: 'statusName', dataIndex: 'statusName',
......
...@@ -63,19 +63,19 @@ function Outstore(props) { ...@@ -63,19 +63,19 @@ function Outstore(props) {
size: 'small', size: 'small',
onClick: () => { onClick: () => {
actionRef.current.reload(); actionRef.current.reload();
// doFetch({ doFetch({
// url: '/sparepart/outWarehouseTask/queryByBeforeOut', url: '/sparepart/outWarehouseTask/queryByBeforeOut',
// params: { id: row?.id }, params: { id: row?.id },
// }).then((res) => { }).then((res) => {
// setdrawer((s) => ({ setdrawer((s) => ({
// ...s, ...s,
// open: true, open: true,
// item: row, item: row,
// title: '出库', title: '出库',
// val: 'only', val: 'only',
// submitdata: res?.data?.data?.taskSpareList ?? [], submitdata: res?.data?.data?.taskSpareList ?? [],
// })); }));
// }); });
}, },
}} }}
> >
...@@ -108,16 +108,20 @@ function Outstore(props) { ...@@ -108,16 +108,20 @@ function Outstore(props) {
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns;
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ if (activeTabKey == 1) {
title: '操作', return defcolumn.concat({
valueType: 'option', title: '操作',
width: 150, valueType: 'option',
render: (text, row, _, action) => [ width: 150,
defpath?.enabledetail && detail(text, row, _, action), render: (text, row, _, action) => [
defpath?.enableedit && edit(text, row, _, action), // defpath?.enabledetail && detail(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action), defpath?.enableedit && edit(text, row, _, action),
], defpath?.enabledelete && remove(text, row, _, action),
}); ],
});
} else {
return defcolumn;
}
}, [activeTabKey]); }, [activeTabKey]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
...@@ -230,7 +234,7 @@ function Outstore(props) { ...@@ -230,7 +234,7 @@ function Outstore(props) {
expandable={{ expandable={{
expandedRowRender: (record) => { expandedRowRender: (record) => {
return ( return (
<div style={{ padding: '4px 4px 4px 36px', backgroundColor: '#cccccc' }}> <div>
<EditTable <EditTable
resizeable={false} resizeable={false}
alwaysShowAlert={false} alwaysShowAlert={false}
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(type, fullName) { function getcolumns(setdrawer, type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -58,6 +58,24 @@ function getcolumns(type, fullName) { ...@@ -58,6 +58,24 @@ function getcolumns(type, fullName) {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
key: 'taskNo', key: 'taskNo',
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '申请原因', title: '申请原因',
...@@ -304,6 +322,24 @@ function getcolumns(type, fullName) { ...@@ -304,6 +322,24 @@ function getcolumns(type, fullName) {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
key: 'taskNo', key: 'taskNo',
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '申请原因', title: '申请原因',
...@@ -481,7 +517,7 @@ function getcolumns(type, fullName) { ...@@ -481,7 +517,7 @@ function getcolumns(type, fullName) {
hideInForm: true, hideInForm: true,
}, },
{ {
title: '备件', // title: '备件',
dataIndex: 'detailsList', dataIndex: 'detailsList',
key: 'detailsList', key: 'detailsList',
valueType: 'formSelectList', valueType: 'formSelectList',
......
...@@ -138,21 +138,25 @@ function Requisition(props) { ...@@ -138,21 +138,25 @@ function Requisition(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(drawer?.type, currentUser?.fullName).filter( let defcolumn = getcolumns(setdrawer,drawer?.type, currentUser?.fullName).filter(
(it) => it.key == activeTabKey, (it) => it.key == activeTabKey,
)[0]?.columns; )[0]?.columns;
let defpath = let defpath =
getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; getcolumns(setdrawer,drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ if (activeTabKey == 1) {
title: '操作', return defcolumn.concat({
valueType: 'option', title: '操作',
width: 150, valueType: 'option',
render: (text, row, _, action) => [ width: 150,
defpath?.enabledetail && detail(text, row, _, action), render: (text, row, _, action) => [
defpath?.enableedit && edit(text, row, _, action), // defpath?.enabledetail && detail(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action), defpath?.enableedit && edit(text, row, _, action),
], defpath?.enabledelete && remove(text, row, _, action),
}); ],
});
} else {
return defcolumn;
}
}, [activeTabKey, drawer?.type]); }, [activeTabKey, drawer?.type]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
......
...@@ -46,6 +46,24 @@ function getcolumns(setdrawer) { ...@@ -46,6 +46,24 @@ function getcolumns(setdrawer) {
}, },
], ],
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.sparePartNo}
</a>
);
},
}, },
{ {
title: '备件名称', title: '备件名称',
......
...@@ -106,7 +106,7 @@ function Setting(props) { ...@@ -106,7 +106,7 @@ function Setting(props) {
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => [
pathconfig?.enabledetail && detail(text, row, _, action), // pathconfig?.enabledetail && detail(text, row, _, action),
pathconfig?.enableedit && edit(text, row, _, action), pathconfig?.enableedit && edit(text, row, _, action),
pathconfig?.enabledelete && remove(text, row, _, action), pathconfig?.enabledelete && remove(text, row, _, action),
], ],
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(type, fullName) { function getcolumns(setdrawer,type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -70,6 +70,24 @@ function getcolumns(type, fullName) { ...@@ -70,6 +70,24 @@ function getcolumns(type, fullName) {
fieldProps: { fieldProps: {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '申请原因', title: '申请原因',
...@@ -307,6 +325,24 @@ function getcolumns(type, fullName) { ...@@ -307,6 +325,24 @@ function getcolumns(type, fullName) {
fieldProps: { fieldProps: {
placeholder: '不填系统自动生成', placeholder: '不填系统自动生成',
}, },
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.taskNo}
</a>
);
},
}, },
{ {
title: '申请原因', title: '申请原因',
......
...@@ -136,21 +136,26 @@ function Spareback(props) { ...@@ -136,21 +136,26 @@ function Spareback(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(drawer?.type, currentUser?.fullName).filter( let defcolumn = getcolumns(setdrawer, drawer?.type, currentUser?.fullName).filter(
(it) => it.key == activeTabKey, (it) => it.key == activeTabKey,
)[0]?.columns; )[0]?.columns;
let defpath = let defpath =
getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; getcolumns(setdrawer, drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ??
return defcolumn.concat({ {};
title: '操作', if (activeTabKey == 1) {
valueType: 'option', return defcolumn.concat({
width: 150, title: '操作',
render: (text, row, _, action) => [ valueType: 'option',
defpath?.enabledetail && detail(text, row, _, action), width: 150,
defpath?.enableedit && edit(text, row, _, action), render: (text, row, _, action) => [
defpath?.enabledelete && remove(text, row, _, action), // defpath?.enabledetail && detail(text, row, _, action),
], defpath?.enableedit && edit(text, row, _, action),
}); defpath?.enabledelete && remove(text, row, _, action),
],
});
} else {
return defcolumn;
}
}, [activeTabKey, drawer?.type]); }, [activeTabKey, drawer?.type]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
......
...@@ -10,7 +10,7 @@ import AutoTables from '@/components/AutoTable/mtable'; ...@@ -10,7 +10,7 @@ import AutoTables from '@/components/AutoTable/mtable';
function ExtraTable({ spareStockId }) { function ExtraTable({ spareStockId }) {
return ( return (
<div style={{ padding: '4px 4px 4px 36px', backgroundColor: '#cccccc' }}> <div>
<AutoTables <AutoTables
path={'/sparepart/spareSupplierStock/queryBySpareStockId'} path={'/sparepart/spareSupplierStock/queryBySpareStockId'}
extraparams={{ spareStockId: spareStockId }} extraparams={{ spareStockId: spareStockId }}
......
import { Switch } from 'antd'; import { Switch } from 'antd';
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(changeState) { function getcolumns(setdrawer, changeState) {
let columns = [ let columns = [
{ {
title: '联系人名称', title: '联系人名称',
...@@ -50,6 +50,24 @@ function getcolumns(changeState) { ...@@ -50,6 +50,24 @@ function getcolumns(changeState) {
title: '供应商编号', title: '供应商编号',
dataIndex: 'supplierNo', dataIndex: 'supplierNo',
key: 'supplierNo', key: 'supplierNo',
render: (_, row) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
}}
>
{row?.supplierNo}
</a>
);
},
}, },
{ {
title: '供应商名称', title: '供应商名称',
......
...@@ -24,7 +24,7 @@ function Supplier(props) { ...@@ -24,7 +24,7 @@ function Supplier(props) {
]); ]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
let pathconf = getcolumns(changeState)?.pathconfig ?? {}; let pathconf = getcolumns(setdrawer, changeState)?.pathconfig ?? {};
return pathconf; return pathconf;
}, []); }, []);
...@@ -124,7 +124,7 @@ function Supplier(props) { ...@@ -124,7 +124,7 @@ function Supplier(props) {
...it, ...it,
hideInSearch: true, hideInSearch: true,
})); }));
let defcolumn = getcolumns(changeState)?.columns ?? []; let defcolumn = getcolumns(setdrawer, changeState)?.columns ?? [];
setcolumns([ setcolumns([
...defcolumn, ...defcolumn,
...extracolumns, ...extracolumns,
...@@ -133,7 +133,7 @@ function Supplier(props) { ...@@ -133,7 +133,7 @@ function Supplier(props) {
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => [
pathconfig?.enabledetail && detail(text, row, _, action), // pathconfig?.enabledetail && detail(text, row, _, action),
pathconfig?.enableedit && edit(text, row, _, action), pathconfig?.enableedit && edit(text, row, _, action),
pathconfig?.enabledelete && remove(text, row, _, action), pathconfig?.enabledelete && remove(text, row, _, action),
], ],
......
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