Commit a8aaeab0 authored by TZW's avatar TZW

ccc

parent 557da31f
...@@ -182,7 +182,7 @@ function InitForm(props) { ...@@ -182,7 +182,7 @@ function InitForm(props) {
}} }}
> >
<FormRender <FormRender
fields={fields.filter((it) => it.valueType != 'option')} fields={fields?.filter((it) => it.valueType != 'option')}
colProps={colProps} colProps={colProps}
proformRef={proformRef} proformRef={proformRef}
/> />
......
...@@ -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-01-31 15:25:02 * @Last Modified time: 2023-01-31 17:38:49
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -12,7 +12,18 @@ import AutoTable from '@/components/AutoTable'; ...@@ -12,7 +12,18 @@ import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
import getcolumns from './columns'; import getcolumns from './columns';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { message, Dropdown, Menu, Layout, Button, Image, Space, Divider, Tabs } from 'antd'; import {
message,
Dropdown,
Menu,
Layout,
Button,
Image,
Space,
Divider,
Tabs,
Tooltip,
} from 'antd';
import TreeRender from '@/components/TreeRender'; import TreeRender from '@/components/TreeRender';
import { ProDescriptions } from '@ant-design/pro-components'; import { ProDescriptions } from '@ant-design/pro-components';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
...@@ -30,6 +41,7 @@ function Model(props) { ...@@ -30,6 +41,7 @@ function Model(props) {
[currDrawer, setCurrDrawer] = useState({ [currDrawer, setCurrDrawer] = useState({
visible: false, visible: false,
}), }),
[resumeTab, setresumeTab] = useState(null),
currfields = { currfields = {
1: [ 1: [
{ {
...@@ -549,8 +561,8 @@ function Model(props) { ...@@ -549,8 +561,8 @@ function Model(props) {
url: '/asset/equipmentLog/getAllResumeType', url: '/asset/equipmentLog/getAllResumeType',
params: { equipmentId: row?.id }, params: { equipmentId: row?.id },
}); });
console.log(res); await setresumeTab(res?.data?.dataList);
setDrawer((s) => ({ await setDrawer((s) => ({
...s, ...s,
visible: true, visible: true,
type: 'resume', type: 'resume',
...@@ -1499,7 +1511,6 @@ function Model(props) { ...@@ -1499,7 +1511,6 @@ function Model(props) {
const Resume = () => { const Resume = () => {
const [selectArr, setSelectArr] = useState([]); const [selectArr, setSelectArr] = useState([]);
const [activeTab, setactiveTab] = useState(1); const [activeTab, setactiveTab] = useState(1);
useEffect(() => { useEffect(() => {
const fun = async () => { const fun = async () => {
const result = await doFetch({ const result = await doFetch({
...@@ -1512,363 +1523,520 @@ function Model(props) { ...@@ -1512,363 +1523,520 @@ function Model(props) {
} }
}; };
fun(); fun();
let dis = resumeTab?.filter((it) => it?.disabled);
if (dis.length > 0 && dis[0].key == 1) {
setactiveTab(
menulist?.filter((it) => !dis?.map((item) => item.key).includes(it?.key))[0]?.key,
);
} else {
setactiveTab(1);
}
}, []); }, []);
const fields = { const menulist = useMemo(() => {
1: [ console.log(activeTab);
{ const fields = {
title: '改造日期', 1: [
dataIndex: 'reformDate', {
key: 'reformDate', title: '改造日期',
valueType: 'date', dataIndex: 'reformDate',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, key: 'reformDate',
}, valueType: 'date',
{ formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
title: '改造承包商',
dataIndex: 'supplierId',
key: 'supplierId',
valueType: 'select',
options: {
path: '/asset/equipmentSupplier/query/selection',
params: {},
}, },
formItemProps: { {
rules: [ title: '改造承包商',
{ dataIndex: 'supplierId',
required: true, key: 'supplierId',
message: '此项为必填项', valueType: 'select',
}, options: {
], path: '/asset/equipmentSupplier/query/selection',
params: {},
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
}, },
}, {
{ title: '改造内容',
title: '改造内容', dataIndex: 'reformContent',
dataIndex: 'reformContent', key: 'reformContent',
key: 'reformContent', valueType: 'textarea',
valueType: 'textarea', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '上传文件(上限为5个)',
key: 'urlIds',
valueType: 'UploadDragger',
// colProps: { span: 24 },
fieldProps: {
maxCount: 5,
name: 'file',
}, },
formItemProps: { {
rules: [ title: '上传文件(上限为5个)',
{ key: 'urlIds',
required: false, valueType: 'UploadDragger',
message: '此项为必填项', // colProps: { span: 24 },
}, fieldProps: {
], maxCount: 5,
name: 'file',
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
}, },
}, ],
], 2: [
2: [ {
{ title: '报废日期',
title: '报废日期', dataIndex: 'scrapDate',
dataIndex: 'scrapDate', key: 'scrapDate',
key: 'scrapDate', valueType: 'date',
valueType: 'date', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '报废原因',
dataIndex: 'scrapReason',
key: 'scrapReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '上传文件(上限为5个)',
key: 'urlIds',
valueType: 'UploadDragger',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
}, },
fieldProps: { {
name: 'file', title: '报废原因',
maxCount: 5, dataIndex: 'scrapReason',
key: 'scrapReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
}, },
}, {
], title: '上传文件(上限为5个)',
3: [ key: 'urlIds',
{ valueType: 'UploadDragger',
title: '调入公司', formItemProps: {
dataIndex: 'organizationName', rules: [
key: 'toOrganizationId', {
valueType: 'select', required: false,
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} }, message: '此项为必填项',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, },
}, ],
{ },
title: '调入部门', fieldProps: {
valueType: 'treeSelect', name: 'file',
dataIndex: 'departmentName', maxCount: 5,
key: 'toDepartmentId',
options: {
path: '/auth/sysDepartment/query/children/tree',
linkParams: {
toOrganizationId: 'parentId',
}, },
}, },
}, ],
{ 3: [
title: '调入工厂', {
dataIndex: 'factoryName', title: '调入公司',
key: 'toFactoryId', dataIndex: 'organizationName',
valueType: 'select', key: 'toOrganizationId',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, valueType: 'select',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
}, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
{ },
title: '调入车间', {
dataIndex: 'shopName', title: '调入部门',
valueType: 'select', valueType: 'treeSelect',
options: { dataIndex: 'departmentName',
path: '/auth/sysShop/getShopSelectionByFactory', key: 'toDepartmentId',
linkParams: { options: {
toFactoryId: 'factoryId', path: '/auth/sysDepartment/query/children/tree',
linkParams: {
toOrganizationId: 'parentId',
},
}, },
}, },
key: 'toShopId', {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, title: '调入工厂',
}, dataIndex: 'factoryName',
{ key: 'toFactoryId',
title: '调入工段', valueType: 'select',
dataIndex: 'sectionName', options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
key: 'toSectionId', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', },
options: { {
path: '/auth/sysSection/getAllSectionSelectionByShop', title: '调入车间',
linkParams: { dataIndex: 'shopName',
toShopId: 'shopId', valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
toFactoryId: 'factoryId',
},
}, },
key: 'toShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
}, },
}, {
{ title: '调入工段',
title: '调入产线', dataIndex: 'sectionName',
dataIndex: 'productionLines', key: 'toSectionId',
valueType: 'select', valueType: 'select',
key: 'toProductLineId', options: {
options: { path: '/auth/sysSection/getAllSectionSelectionByShop',
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop', linkParams: {
linkParams: { toShopId: 'shopId',
toShopId: 'shopId', },
}, },
}, },
}, {
{ title: '调入产线',
title: '调入位置号', dataIndex: 'productionLines',
dataIndex: 'toPositionNo', valueType: 'select',
valueType: 'input', key: 'toProductLineId',
key: 'toPositionNo', options: {
}, path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
{ linkParams: {
title: '调拨日期', toShopId: 'shopId',
dataIndex: 'transferDate', },
key: 'transferDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '调拨原因',
dataIndex: 'transferReason',
key: 'transferReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
4: [
{
title: '借用公司',
dataIndex: 'organizationName',
key: 'toOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用部门',
valueType: 'treeSelect',
dataIndex: 'departmentName',
key: 'toDepartmentId',
options: {
path: '/auth/sysDepartment/query/children/tree',
linkParams: {
toOrganizationId: 'parentId',
}, },
}, },
}, {
{ title: '调入位置号',
title: '借用工厂', dataIndex: 'toPositionNo',
dataIndex: 'factoryName', valueType: 'input',
key: 'toFactoryId', key: 'toPositionNo',
valueType: 'select', },
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, title: '调拨日期',
}, dataIndex: 'transferDate',
{ key: 'transferDate',
title: '借用车间', valueType: 'date',
dataIndex: 'shopName', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', },
options: { {
path: '/auth/sysShop/getShopSelectionByFactory', title: '调拨原因',
linkParams: { dataIndex: 'transferReason',
toFactoryId: 'factoryId', key: 'transferReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
4: [
{
title: '借用公司',
dataIndex: 'organizationName',
key: 'toOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用部门',
valueType: 'treeSelect',
dataIndex: 'departmentName',
key: 'toDepartmentId',
options: {
path: '/auth/sysDepartment/query/children/tree',
linkParams: {
toOrganizationId: 'parentId',
},
}, },
}, },
key: 'toShopId', {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, title: '借用工厂',
}, dataIndex: 'factoryName',
{ key: 'toFactoryId',
title: '借用工段', valueType: 'select',
dataIndex: 'sectionName', options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
key: 'toSectionId', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', },
options: { {
path: '/auth/sysSection/getAllSectionSelectionByShop', title: '借用车间',
linkParams: { dataIndex: 'shopName',
toShopId: 'shopId', valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
toFactoryId: 'factoryId',
},
}, },
key: 'toShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
}, },
}, {
{ title: '借用工段',
title: '借用产线', dataIndex: 'sectionName',
dataIndex: 'productionLines', key: 'toSectionId',
valueType: 'select', valueType: 'select',
key: 'toProductLineId', options: {
options: { path: '/auth/sysSection/getAllSectionSelectionByShop',
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop', linkParams: {
linkParams: { toShopId: 'shopId',
toShopId: 'shopId', },
}, },
}, },
}, {
{ title: '借用产线',
title: '借用位置号', dataIndex: 'productionLines',
dataIndex: 'toPositionNo', valueType: 'select',
valueType: 'input', key: 'toProductLineId',
key: 'toPositionNo', options: {
}, path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
{ linkParams: {
title: '借用日期', toShopId: 'shopId',
dataIndex: 'borrowDate', },
key: 'borrowDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '预计归还日期',
dataIndex: 'planReturnDate',
key: 'planReturnDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用原因',
dataIndex: 'borrowReason',
key: 'borrowReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
5: [
{
title: '接收公司',
dataIndex: 'returnOrganizationId',
key: 'returnOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收部门',
valueType: 'treeSelect',
dataIndex: 'returnDepartmentId',
key: 'returnDepartmentId',
options: {
path: '/auth/sysDepartment/query/children/tree',
linkParams: {
returnOrganizationId: 'parentId',
}, },
}, },
}, {
{ title: '借用位置号',
title: '接收工厂', dataIndex: 'toPositionNo',
dataIndex: 'returnFactoryId', valueType: 'input',
key: 'returnFactoryId', key: 'toPositionNo',
valueType: 'select', },
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, title: '借用日期',
}, dataIndex: 'borrowDate',
{ key: 'borrowDate',
title: '接收车间', valueType: 'date',
dataIndex: 'returnShopId', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', },
options: { {
path: '/auth/sysShop/getShopSelectionByFactory', title: '预计归还日期',
linkParams: { dataIndex: 'planReturnDate',
returnFactoryId: 'factoryId', key: 'planReturnDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '借用原因',
dataIndex: 'borrowReason',
key: 'borrowReason',
valueType: 'textarea',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
],
5: [
{
title: '接收公司',
dataIndex: 'returnOrganizationId',
key: 'returnOrganizationId',
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '接收部门',
valueType: 'treeSelect',
dataIndex: 'returnDepartmentId',
key: 'returnDepartmentId',
options: {
path: '/auth/sysDepartment/query/children/tree',
linkParams: {
returnOrganizationId: 'parentId',
},
}, },
}, },
key: 'returnShopId', {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, title: '接收工厂',
}, dataIndex: 'returnFactoryId',
{ key: 'returnFactoryId',
title: '接收工段', valueType: 'select',
dataIndex: 'returnSectionId', options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
key: 'returnSectionId', formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', },
options: { {
path: '/auth/sysSection/getAllSectionSelectionByShop', title: '接收车间',
linkParams: { dataIndex: 'returnShopId',
returnShopId: 'shopId', valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
returnFactoryId: 'factoryId',
},
}, },
key: 'returnShopId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
}, },
}, {
{ title: '接收工段',
title: '接收产线', dataIndex: 'returnSectionId',
dataIndex: 'returnProductLineId', key: 'returnSectionId',
valueType: 'select', valueType: 'select',
key: 'returnProductLineId', options: {
options: { path: '/auth/sysSection/getAllSectionSelectionByShop',
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop', linkParams: {
linkParams: { returnShopId: 'shopId',
returnShopId: 'shopId', },
}, },
}, },
{
title: '接收产线',
dataIndex: 'returnProductLineId',
valueType: 'select',
key: 'returnProductLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
returnShopId: 'shopId',
},
},
},
{
title: '接收位置号',
dataIndex: 'returnPositionNo',
valueType: 'input',
key: 'returnPositionNo',
},
{
title: '实际归还日期',
dataIndex: 'realReturnDate',
key: 'realReturnDate',
valueType: 'date',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
valueType: 'textarea',
formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
},
],
};
let arr = [
{
label: '改造',
key: 1,
children: activeTab == 1 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '1', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
}, // remember to pass the key prop
{
label: '报废',
key: 2,
children: activeTab == 2 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '2', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '调拨',
key: 3,
children: activeTab == 3 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '3', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '借用',
key: 4,
children: activeTab == 4 && (
<InitForm
defaultFormValue={drawer?.item}
fields={fields[activeTab]}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '4', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '归还',
key: 5,
children: activeTab == 5 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '5', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
}, },
{ ];
title: '接收位置号', let dis = resumeTab?.filter((it) => it?.disabled);
dataIndex: 'returnPositionNo', arr.forEach((item) => {
valueType: 'input', dis?.forEach((it) => {
key: 'returnPositionNo', if (item?.key == it?.key) {
}, let string = item.label;
{ item.disabled = true;
title: '实际归还日期', item.label = (
dataIndex: 'realReturnDate', <Tooltip placement="topLeft" title={it.disabledReason}>
key: 'realReturnDate', <span>{string}</span>
valueType: 'date', </Tooltip>
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, );
}, }
{ });
title: '备注', });
dataIndex: 'remark', return arr;
key: 'remark', }, [activeTab]);
valueType: 'textarea',
formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
},
],
};
return ( return (
<> <>
...@@ -1942,141 +2110,7 @@ function Model(props) { ...@@ -1942,141 +2110,7 @@ function Model(props) {
]} ]}
/> />
<Divider /> <Divider />
<Tabs <Tabs activeKey={activeTab} onChange={setactiveTab} items={menulist} />
activeKey={activeTab}
onChange={setactiveTab}
items={[
{
label: '改造',
key: 1,
children: activeTab == 1 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '1', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
}, // remember to pass the key prop
{
label: '报废',
key: 2,
children: activeTab == 2 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '2', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '调拨',
key: 3,
children: activeTab == 3 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '3', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '借用',
key: 4,
children: activeTab == 4 && (
<InitForm
defaultFormValue={drawer?.item}
fields={fields[activeTab]}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '4', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
{
label: '归还',
key: 5,
children: activeTab == 5 && (
<InitForm
fields={fields[activeTab]}
defaultFormValue={drawer?.item}
onFinish={async (vals) => {
//console.log(vals);
let res = await doFetch({
url: urlParams_resume.save,
params: { ...vals, type: '5', equipmentId: drawer?.item?.id },
});
if (res.code === '0000') {
message.success('登记成功!');
await setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
actionRef.current.reload();
}
}}
/>
),
},
]}
/>
</> </>
); );
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-31 15:14:34 * @Last Modified time: 2023-01-31 17:43:42
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -1077,7 +1077,7 @@ function Failure(props) { ...@@ -1077,7 +1077,7 @@ function Failure(props) {
valueType: 'radio', valueType: 'radio',
options: [ options: [
{ label: '通过', value: '1' }, { label: '通过', value: '1' },
{ label: '不通过', value: '2' }, { label: '不通过', value: '0' },
], ],
formItemProps: { formItemProps: {
rules: [ rules: [
...@@ -1160,7 +1160,7 @@ function Failure(props) { ...@@ -1160,7 +1160,7 @@ function Failure(props) {
valueType: 'radio', valueType: 'radio',
options: [ options: [
{ label: '通过', value: '1' }, { label: '通过', value: '1' },
{ label: '不通过', value: '2' }, { label: '不通过', value: '0' },
], ],
formItemProps: { formItemProps: {
rules: [ rules: [
...@@ -1240,7 +1240,7 @@ function Failure(props) { ...@@ -1240,7 +1240,7 @@ function Failure(props) {
valueType: 'radio', valueType: 'radio',
options: [ options: [
{ label: '通过', value: '1' }, { label: '通过', value: '1' },
{ label: '不通过', value: '2' }, { label: '不通过', value: '0' },
], ],
formItemProps: { formItemProps: {
rules: [ rules: [
...@@ -1320,7 +1320,7 @@ function Failure(props) { ...@@ -1320,7 +1320,7 @@ function Failure(props) {
valueType: 'radio', valueType: 'radio',
options: [ options: [
{ label: '通过', value: '1' }, { label: '通过', value: '1' },
{ label: '不通过', value: '2' }, { label: '不通过', value: '0' },
], ],
formItemProps: { formItemProps: {
rules: [ rules: [
......
...@@ -80,7 +80,7 @@ function getcolumns(setdrawer, bus) { ...@@ -80,7 +80,7 @@ function getcolumns(setdrawer, bus) {
<span <span
style={{ style={{
color: `${ color: `${
row.nextTrackDate.valueOf() < dayjs().format('YYYY-MM-DD').valueOf() row?.nextTrackDate?.valueOf() < dayjs().format('YYYY-MM-DD').valueOf()
? '#f50' ? '#f50'
: 'rgba(0, 0, 0, 0.85)' : 'rgba(0, 0, 0, 0.85)'
}`, }`,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-31 09:20:37 * @Last Modified time: 2023-01-31 15:46:59
*/ */
import * as React from 'react'; import * as React from 'react';
......
...@@ -179,6 +179,7 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -179,6 +179,7 @@ function getcolumns(setDrawer, ifs, formRef) {
width: 120, width: 120,
valueType: 'treeSelect', valueType: 'treeSelect',
dataIndex: 'departmentName', dataIndex: 'departmentName',
search: false,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'departmentId', key: 'departmentId',
options: { options: {
...@@ -188,6 +189,22 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -188,6 +189,22 @@ function getcolumns(setDrawer, ifs, formRef) {
}, },
}, },
}, },
{
title: '部门名称',
width: 120,
valueType: 'select',
dataIndex: 'departmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'departmentId',
options: {
path: '/auth/sysDepartment/query/all/department/selection',
},
fieldProps: {
showSearch: true,
},
hideInForm: true,
hideInTable: true,
},
{ {
title: '角色名称', title: '角色名称',
dataIndex: 'roleNames', dataIndex: 'roleNames',
......
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