Commit 0da2f8a1 authored by wuhao's avatar wuhao 🎯

asd

parent 029f1993
...@@ -392,8 +392,8 @@ const Mtable = (props) => { ...@@ -392,8 +392,8 @@ const Mtable = (props) => {
}} }}
columns={ columns={
resizeable resizeable
? columnes?.filter?.((it) => it.valueType != 'split') ?? [] ? columnes?.filter?.((it) => ['split', 'nosubmit'].indexOf(it.valueType) == -1) ?? []
: columncs?.filter?.((it) => it.valueType != 'split') ?? [] : columncs?.filter?.((it) => ['split', 'nosubmit'].indexOf(it.valueType) == -1) ?? []
} }
style={style || {}} style={style || {}}
actionRef={actionRefs} actionRef={actionRefs}
......
...@@ -59,33 +59,35 @@ function DetailPro(props) { ...@@ -59,33 +59,35 @@ function DetailPro(props) {
return ( return (
<ProDescriptions column={3} {...dataProps} title={props.title}> <ProDescriptions column={3} {...dataProps} title={props.title}>
{fields?.filter(it => !it.hideInDescriptions && it?.valueType != "option")?.map((it, i) => { {fields
const dataIndexs = ?.filter((it) => !it.hideInDescriptions && it?.valueType != 'option')
!it?.render || it?.valueType == 'option' ?.map((it, i) => {
? { dataIndex: it.dataIndex, valueType: it.valueType } const dataIndexs =
: {}; !it?.render || it?.valueType == 'option'
if (it.valueType == 'split') { ? { dataIndex: it.dataIndex, valueType: it.valueType }
: {};
if (it.valueType == 'split') {
return (
<>
<Col span={24}>
<div className={styles.title} style={{ borderWidth: i == 0 ? 0 : 1 }}>
{it.title}
</div>
</Col>
</>
);
}
return ( return (
<> <Item
<Col span={24}> span={it?.span ? it?.span : fields[i + 1]?.valueType == 'split' ? 3 : 1}
<div className={styles.title} style={{ borderWidth: i == 0 ? 0 : 1 }}> key={it.dataIndex}
{it.title} label={it.title}
</div> {...dataIndexs}
</Col> >
</> {it?.render ? it?.render?.(curitem[it.dataIndex], curitem) : ''}
</Item>
); );
} })}
return (
<Item
span={it?.span ? it?.span : fields[i + 1]?.valueType == 'split' ? 3 : 1}
key={it.dataIndex}
label={it.title}
{...dataIndexs}
>
{it?.render ? it?.render?.(curitem[it.dataIndex], curitem) : ''}
</Item>
);
})}
</ProDescriptions> </ProDescriptions>
); );
} }
......
This diff is collapsed.
...@@ -13,6 +13,7 @@ import { doFetch } from '@/utils/doFetch'; ...@@ -13,6 +13,7 @@ import { doFetch } from '@/utils/doFetch';
import styles from './index.less'; import styles from './index.less';
import FormItems from './FormItems'; import FormItems from './FormItems';
import ExtendField from '@/components/ExtendField'; import ExtendField from '@/components/ExtendField';
import { Input, Col } from 'antd';
function upperCase(str) { function upperCase(str) {
const newStr = str.slice(0, 1).toUpperCase() + str.slice(1); const newStr = str.slice(0, 1).toUpperCase() + str.slice(1);
...@@ -35,6 +36,15 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => { ...@@ -35,6 +36,15 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
</div> </div>
); );
} }
if (item?.valueType == 'nosubmit') {
return (
<Col {...(item.colProps ?? { span: 12 })} style={{ marginBottom: 24 }}>
<label style={{ marginBottom: 8, display: 'block' }}>{item?.title}</label>
<Input disabled value={item?.initialValue} />
</Col>
);
}
if (hideInForm && Object.keys(hideInForm)) { if (hideInForm && Object.keys(hideInForm)) {
return ( return (
<ProFormDependency name={Object.keys(hideInForm)}> <ProFormDependency name={Object.keys(hideInForm)}>
......
...@@ -158,6 +158,13 @@ function getcolumns(setdrawer) { ...@@ -158,6 +158,13 @@ function getcolumns(setdrawer) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -322,6 +329,13 @@ function getcolumns(setdrawer) { ...@@ -322,6 +329,13 @@ function getcolumns(setdrawer) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
......
...@@ -139,6 +139,13 @@ function getcolumns(setdrawer) { ...@@ -139,6 +139,13 @@ function getcolumns(setdrawer) {
], ],
}, },
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -317,6 +324,13 @@ function getcolumns(setdrawer) { ...@@ -317,6 +324,13 @@ function getcolumns(setdrawer) {
], ],
}, },
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(type) { function getcolumns(type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -82,6 +82,14 @@ function getcolumns(type) { ...@@ -82,6 +82,14 @@ function getcolumns(type) {
}, },
], ],
}, },
{
title: '入库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '入库仓库', title: '入库仓库',
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
...@@ -95,6 +103,13 @@ function getcolumns(type) { ...@@ -95,6 +103,13 @@ function getcolumns(type) {
}, },
hideInForm: type == 1, hideInForm: type == 1,
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -147,6 +162,7 @@ function getcolumns(type) { ...@@ -147,6 +162,7 @@ function getcolumns(type) {
key: 'status', key: 'status',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
span: 3,
options: [ options: [
{ {
label: '待审批', label: '待审批',
...@@ -279,6 +295,14 @@ function getcolumns(type) { ...@@ -279,6 +295,14 @@ function getcolumns(type) {
}, },
], ],
}, },
{
title: '入库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '入库仓库', title: '入库仓库',
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
...@@ -292,6 +316,13 @@ function getcolumns(type) { ...@@ -292,6 +316,13 @@ function getcolumns(type) {
}, },
hideInForm: type == 1, hideInForm: type == 1,
}, },
{
title: '出库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -355,6 +386,7 @@ function getcolumns(type) { ...@@ -355,6 +386,7 @@ function getcolumns(type) {
key: 'status', key: 'status',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
span: 3,
options: [ options: [
{ {
label: '已驳回', label: '已驳回',
......
...@@ -9,6 +9,7 @@ import { useRequest } from 'ahooks'; ...@@ -9,6 +9,7 @@ import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import { message, Divider } from 'antd'; import { message, Divider } from 'antd';
import { useModel } from '@umijs/max';
function Requisition(props) { function Requisition(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -17,6 +18,9 @@ function Requisition(props) { ...@@ -17,6 +18,9 @@ function Requisition(props) {
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const {
initialState: { currentUser },
} = useModel('@@initialState');
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
manual: true, manual: true,
...@@ -134,7 +138,9 @@ function Requisition(props) { ...@@ -134,7 +138,9 @@ function Requisition(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(drawer?.type, currentUser?.fullName).filter(
(it) => it.key == activeTabKey,
)[0]?.columns;
let defpath = let defpath =
getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ return defcolumn.concat({
......
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(type) { function getcolumns(type, fullName) {
const columns = [ const columns = [
{ {
title: '备件料号', title: '备件料号',
...@@ -96,6 +96,21 @@ function getcolumns(type) { ...@@ -96,6 +96,21 @@ function getcolumns(type) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{
title: '出库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
...@@ -308,6 +323,21 @@ function getcolumns(type) { ...@@ -308,6 +323,21 @@ function getcolumns(type) {
key: 'inWarehouseName', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{
title: '入库仓库',
dataIndex: 'nosubmits',
initialValue: '备件仓库',
valueType: 'nosubmit',
hideInDescriptions: true,
},
{
title: '出库仓库(个人)',
dataIndex: 'nosubmit',
initialValue: fullName,
valueType: 'nosubmit',
hideInForm: type !== 1,
hideInDescriptions: true,
},
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
......
...@@ -8,6 +8,7 @@ import { useRequest } from 'ahooks'; ...@@ -8,6 +8,7 @@ import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import { message, Divider } from 'antd'; import { message, Divider } from 'antd';
import { useModel } from '@umijs/max';
function Spareback(props) { function Spareback(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -16,7 +17,9 @@ function Spareback(props) { ...@@ -16,7 +17,9 @@ function Spareback(props) {
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const {
initialState: { currentUser },
} = useModel('@@initialState');
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
manual: true, manual: true,
onSuccess: (res, params) => { onSuccess: (res, params) => {
...@@ -133,7 +136,9 @@ function Spareback(props) { ...@@ -133,7 +136,9 @@ function Spareback(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(drawer?.type, currentUser?.fullName).filter(
(it) => it.key == activeTabKey,
)[0]?.columns;
let defpath = let defpath =
getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; getcolumns(drawer?.type).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ return defcolumn.concat({
......
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