Commit 0da2f8a1 authored by wuhao's avatar wuhao 🎯

asd

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