Commit fc3688a2 authored by TZW's avatar TZW

plan

parent fd24e336
......@@ -398,6 +398,23 @@ function getcolumns(setdrawer) {
dataIndex: 'maintainNo',
key: 'maintainNo',
hideInForm: true,
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
val: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.maintainNo}
</a>
);
},
},
{
title: '设备编号',
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2023-01-16 15:35:00
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-17 10:51:25
* @Last Modified time: 2023-01-17 11:35:36
*/
import * as React from 'react';
......@@ -62,8 +62,49 @@ function Plan(props) {
}
};
return [
{
title: '计划信息',
valueType: 'split',
hideInForm: true,
},
{
title: '保养计划单号',
dataIndex: 'maintainNo',
key: 'maintainNo',
hideInForm: true,
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
hideInForm: true,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
hideInForm: true,
},
{
title: '保养类型',
dataIndex: 'maintainTypeName',
key: 'maintainTypeName',
hideInForm: true,
},
{
title: '下次保养日期',
dataIndex: 'nextMaintainDate',
key: 'nextMaintainDate',
hideInForm: true,
},
{
title: '调整信息',
valueType: 'split',
hideInForm: true,
},
{
title: '保养频次',
hideInDescriptions: true,
dataIndex: 'maintainFrequencyName',
key: 'maintainFrequency',
fieldProps: {
......@@ -105,6 +146,7 @@ function Plan(props) {
{
title: '计划类型',
dataIndex: 'isCycle',
hideInDescriptions: true,
key: 'isCycle',
fieldProps: {
disabled: true,
......@@ -194,6 +236,157 @@ function Plan(props) {
);
};
const detailsColumns = useMemo(() => {
const columnsc = [
{
title: '保养项目',
dataIndex: 'maintainItemName',
key: 'maintainItemName',
hideInForm: true,
},
{
title: '部位',
dataIndex: 'maintainPosition',
key: 'maintainPosition',
hideInForm: true,
},
{
title: '保养方法',
dataIndex: 'maintainWay',
key: 'maintainWay',
hideInForm: true,
},
];
if (drawer?.val == 'detail') {
return [
{
title: '计划信息',
valueType: 'split',
},
{
title: '保养计划单号',
dataIndex: 'maintainNo',
key: 'maintainNo',
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '状态',
dataIndex: 'maintainStatus',
key: 'maintainStatus',
render: (_, row) => {
return row?.maintainStatus == 1 ? '未开始' : '执行中';
},
},
{
title: '启用/停用',
dataIndex: 'isStopStatusName',
key: 'isStopStatusName',
},
{
title: '下次保养日期',
dataIndex: 'nextMaintainDate',
key: 'nextMaintainDate',
span: activeTabKey == 1 ? 2 : 1,
},
{
title: '关单日期',
dataIndex: 'endDate',
key: 'endDate',
hideInDescriptions: activeTabKey == 1 ? true : false,
},
{
title: '基本信息',
valueType: 'split',
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '设备型号',
dataIndex: 'equipmentModelName',
key: 'equipmentModelName',
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryName',
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopName',
},
{
title: '保养类型',
dataIndex: 'maintainTypeName',
key: 'maintainTypeName',
},
{
title: '计划类型',
dataIndex: 'isCycle',
key: 'isCycle',
span: activeTabKey == 1 ? 3 : 3,
render: (_, row) => {
return row?.isCycle == 1 ? '单次' : '周期';
},
},
{
title: '保养项目',
valueType: 'split',
},
{
dataIndex: 'itemList',
key: 'itemList',
valueType: 'formList',
colProps: {
span: 24,
},
columns,
span: 24,
render: (text, row) => {
return (
<AutoTables
columns={columnsc?.map((it) => ({
...it,
hideInSearch: true,
}))}
dataSource={row?.maintainItemList}
/>
);
},
},
{
title: '关单信息',
valueType: 'split',
hideInDescriptions: drawer?.item?.status != 3 ? true : false,
},
{
title: '关单人员',
dataIndex: 'shutUserName',
key: 'shutUserName',
hideInDescriptions: drawer?.item?.status != 3 ? true : false,
},
{
title: '强制关单时间',
dataIndex: 'shutTime',
key: 'shutTime',
hideInDescriptions: drawer?.item?.status != 3 ? true : false,
},
];
}
}, [drawer?.val, activeTabKey, drawer?.item?.id]);
const close = (text, row, _, action) => {
return (
<PremButton
......@@ -382,9 +575,15 @@ function Plan(props) {
/>
<DrawerPro
fields={columns}
fields={
drawer?.val == 'detailaddon'
? editDateColumns
: drawer?.val == 'detail'
? detailsColumns
: columns
}
detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
// detailData={drawer?.item}
defaultFormValue={drawer?.item}
params={{ id: drawer?.item?.id }}
formRef={formRef}
......@@ -408,7 +607,7 @@ function Plan(props) {
delete params.paramList;
let flag = params.equipmentList?.some((it) => !it.nextMaintainDate);
if (flag) {
message.warning('下次点检日期必填!');
message.warning('下次保养日期必填!');
return;
}
console.log(params);
......
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