Commit 059d7fee authored by TZW's avatar TZW

优化

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