Commit 72fc86d5 authored by TZW's avatar TZW

点检计划

parent fd466937
...@@ -140,10 +140,7 @@ function Order(props) { ...@@ -140,10 +140,7 @@ function Order(props) {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 120, width: 120,
render: (text, row, _, action) => [ render: (text, row, _, action) => [order(text, row, _, action), close(text, row, _, action)],
order(text, row, _, action),
close(text, row, _, action)
],
}); });
}, []); }, []);
...@@ -168,7 +165,7 @@ function Order(props) { ...@@ -168,7 +165,7 @@ function Order(props) {
hideInForm: true, hideInForm: true,
}, },
]; ];
if (drawer?.val == "detail") { if (drawer?.val == 'detail') {
return [ return [
{ {
title: '计划信息', title: '计划信息',
...@@ -222,7 +219,7 @@ function Order(props) { ...@@ -222,7 +219,7 @@ function Order(props) {
title: '点检截止日期', title: '点检截止日期',
dataIndex: 'checkCloseDate', dataIndex: 'checkCloseDate',
key: 'checkCloseDate', key: 'checkCloseDate',
span: 2 span: 2,
}, },
{ {
title: '点检项目', title: '点检项目',
...@@ -245,15 +242,15 @@ function Order(props) { ...@@ -245,15 +242,15 @@ function Order(props) {
/> />
); );
}, },
} },
] ];
} }
}, [drawer?.val, drawer?.item?.id]); }, [drawer?.val, drawer?.item?.id]);
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<AutoTable <AutoTable
pagetitle="点检接单" pagetitle={<h3 className="page-title">点检接单</h3>}
columns={columns} columns={columns}
actionRef={actionRef} actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
...@@ -277,7 +274,7 @@ function Order(props) { ...@@ -277,7 +274,7 @@ function Order(props) {
/> />
<DrawerPro <DrawerPro
fields={drawer.val == "detail" ? detailsColumns : columns} fields={drawer.val == 'detail' ? detailsColumns : columns}
params={{ id: drawer?.item?.id }} params={{ id: drawer?.item?.id }}
formRef={formRef} formRef={formRef}
placement="right" placement="right"
......
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
import { message, Popconfirm, Switch } from "antd"; import { message, Popconfirm, Switch } from 'antd';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import DetailPro from '@/components/DetailPro'; import DetailPro from '@/components/DetailPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
...@@ -67,7 +67,7 @@ function Plan(props) { ...@@ -67,7 +67,7 @@ function Plan(props) {
item: row, item: row,
title: '调整日期', title: '调整日期',
val: 'detailaddon', val: 'detailaddon',
id: row?.id id: row?.id,
})); }));
}, },
}} }}
...@@ -121,7 +121,8 @@ function Plan(props) { ...@@ -121,7 +121,8 @@ function Plan(props) {
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns;
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return activeTabKey == 1 ? defcolumn.concat([ return activeTabKey == 1
? defcolumn.concat([
{ {
title: '启用/停用', title: '启用/停用',
dataIndex: 'checkEnable', dataIndex: 'checkEnable',
...@@ -131,7 +132,8 @@ function Plan(props) { ...@@ -131,7 +132,8 @@ function Plan(props) {
valueType: 'switch', valueType: 'switch',
render: (text, row, _, action) => { render: (text, row, _, action) => {
//"1停用 2启用 *" //"1停用 2启用 *"
return row.checkEnable == 1 ? <Popconfirm return row.checkEnable == 1 ? (
<Popconfirm
title="是否开启或停用?" title="是否开启或停用?"
onConfirm={async () => { onConfirm={async () => {
if (row.checkEnable == 1) { if (row.checkEnable == 1) {
...@@ -153,7 +155,7 @@ function Plan(props) { ...@@ -153,7 +155,7 @@ function Plan(props) {
disabled={!(row.status == 1 || (row.status == 2 && row.checkLoop == 2))} disabled={!(row.status == 1 || (row.status == 2 && row.checkLoop == 2))}
/> />
</Popconfirm> </Popconfirm>
: ) : (
<Switch <Switch
checked={row.checkEnable == 1 ? true : false} checked={row.checkEnable == 1 ? true : false}
checkedChildren="开启" checkedChildren="开启"
...@@ -166,15 +168,15 @@ function Plan(props) { ...@@ -166,15 +168,15 @@ function Plan(props) {
...s, ...s,
open: true, open: true,
item: row, item: row,
title: '调整日期', title: '启用点检计划',
val: 'detailaddon', val: 'detailaddon',
type: "delay", type: 'delay',
id: row?.id id: row?.id,
})); }));
} }
}} }}
/> />
; );
}, },
hideInDescriptions: true, hideInDescriptions: true,
}, },
...@@ -183,12 +185,14 @@ function Plan(props) { ...@@ -183,12 +185,14 @@ function Plan(props) {
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => [
(row.status == 1 || (row.status == 2 && row.checkLoop == 2)) && editDate(text, row, _, action), (row.status == 1 || (row.status == 2 && row.checkLoop == 2)) &&
editDate(text, row, _, action),
row.status == 2 && close(text, row, _, action), row.status == 2 && close(text, row, _, action),
defpath?.enabledelete && row.status == 1 && remove(text, row, _, action), defpath?.enabledelete && row.status == 1 && remove(text, row, _, action),
], ],
} },
]) : defcolumn; ])
: defcolumn;
}, [activeTabKey]); }, [activeTabKey]);
const editDateColumns = useMemo(() => { const editDateColumns = useMemo(() => {
...@@ -196,7 +200,10 @@ function Plan(props) { ...@@ -196,7 +200,10 @@ function Plan(props) {
if (drawer?.item?.status == 1) { if (drawer?.item?.status == 1) {
return current && current < dayjs().endOf('day'); return current && current < dayjs().endOf('day');
} else { } else {
if (dayjs(drawer?.item?.planCheckDate).endOf('day').valueOf() >= dayjs().endOf('day').valueOf()) { if (
dayjs(drawer?.item?.planCheckDate).endOf('day').valueOf() >=
dayjs().endOf('day').valueOf()
) {
return current && current <= dayjs(drawer?.item?.planCheckDate).endOf('day'); return current && current <= dayjs(drawer?.item?.planCheckDate).endOf('day');
} else { } else {
return current && current < dayjs().endOf('day'); return current && current < dayjs().endOf('day');
...@@ -243,7 +250,7 @@ function Plan(props) { ...@@ -243,7 +250,7 @@ function Plan(props) {
title: '计划类型', title: '计划类型',
dataIndex: 'checkLoopName', dataIndex: 'checkLoopName',
key: 'checkLoop', key: 'checkLoop',
hideInForm: true hideInForm: true,
}, },
{ {
title: '调整信息', title: '调整信息',
...@@ -267,7 +274,7 @@ function Plan(props) { ...@@ -267,7 +274,7 @@ function Plan(props) {
}, },
valueType: 'date', valueType: 'date',
hideInSearch: true, hideInSearch: true,
hideInDescriptions: true hideInDescriptions: true,
}, },
{ {
title: '周期(天)', title: '周期(天)',
...@@ -278,7 +285,6 @@ function Plan(props) { ...@@ -278,7 +285,6 @@ function Plan(props) {
valueType: 'digit', valueType: 'digit',
hideInForm: drawer?.item?.checkLoop == 2 ? false : true, hideInForm: drawer?.item?.checkLoop == 2 ? false : true,
precision: 0, precision: 0,
}, },
]; ];
}, [drawer?.item]); }, [drawer?.item]);
...@@ -304,7 +310,7 @@ function Plan(props) { ...@@ -304,7 +310,7 @@ function Plan(props) {
hideInForm: true, hideInForm: true,
}, },
]; ];
if (drawer?.val == "detail") { if (drawer?.val == 'detail') {
return [ return [
{ {
title: '计划信息', title: '计划信息',
...@@ -334,7 +340,7 @@ function Plan(props) { ...@@ -334,7 +340,7 @@ function Plan(props) {
title: '下次点检日期', title: '下次点检日期',
dataIndex: 'planCheckDate', dataIndex: 'planCheckDate',
key: 'planCheckDate', key: 'planCheckDate',
span: activeTabKey == 1 ? 2 : 1 span: activeTabKey == 1 ? 2 : 1,
}, },
{ {
title: '关单日期', title: '关单日期',
...@@ -385,7 +391,7 @@ function Plan(props) { ...@@ -385,7 +391,7 @@ function Plan(props) {
title: '周期(天)', title: '周期(天)',
dataIndex: 'checkCycle', dataIndex: 'checkCycle',
key: 'checkCycle', key: 'checkCycle',
span: activeTabKey == 1 ? 2 : 2 span: activeTabKey == 1 ? 2 : 2,
}, },
{ {
title: '点检项目', title: '点检项目',
...@@ -429,7 +435,7 @@ function Plan(props) { ...@@ -429,7 +435,7 @@ function Plan(props) {
key: 'shutTime', key: 'shutTime',
hideInDescriptions: drawer?.item?.status != 3 ? true : false, hideInDescriptions: drawer?.item?.status != 3 ? true : false,
}, },
] ];
} }
}, [drawer?.val, activeTabKey, drawer?.item?.id]); }, [drawer?.val, activeTabKey, drawer?.item?.id]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
...@@ -446,7 +452,7 @@ function Plan(props) { ...@@ -446,7 +452,7 @@ function Plan(props) {
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<AutoTable <AutoTable
pagetitle="点检计划" pagetitle={<h3 className="page-title">点检计划</h3>}
columns={columns} columns={columns}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
actionRef={actionRef} actionRef={actionRef}
...@@ -475,7 +481,13 @@ function Plan(props) { ...@@ -475,7 +481,13 @@ function Plan(props) {
/> />
<DrawerPro <DrawerPro
fields={drawer?.val == "detailaddon" ? editDateColumns : drawer?.val == "detail" ? detailsColumns : columns} fields={
drawer?.val == 'detailaddon'
? editDateColumns
: drawer?.val == 'detail'
? detailsColumns
: columns
}
detailpath={pathconfig?.detail || null} detailpath={pathconfig?.detail || null}
defaultFormValue={drawer?.item} defaultFormValue={drawer?.item}
params={{ id: drawer?.item?.id }} params={{ id: drawer?.item?.id }}
...@@ -490,21 +502,24 @@ function Plan(props) { ...@@ -490,21 +502,24 @@ function Plan(props) {
{...drawer} {...drawer}
onFinish={async (vals) => { onFinish={async (vals) => {
let params = JSON.parse(JSON.stringify(vals)); let params = JSON.parse(JSON.stringify(vals));
params.paramList = params?.paramList?.map(it => { params.paramList = params?.paramList?.map((it) => {
return { return {
equipmentId: it.id, equipmentId: it.id,
checkPlanDate: it.checkPlanDate checkPlanDate: it.checkPlanDate,
} };
}); });
let flag = params.paramList?.some(it => !it.checkPlanDate); let flag = params.paramList?.some((it) => !it.checkPlanDate);
if (flag) { if (flag) {
message.warning("下次点检日期必填!") message.warning('下次点检日期必填!');
return; return;
} }
if (drawer?.val == 'add') { if (drawer?.val == 'add') {
await runAsync({ url: pathconfig?.add || '/add', params: { ...params } }); await runAsync({ url: pathconfig?.add || '/add', params: { ...params } });
} else if (drawer?.val == 'edit') { } else if (drawer?.val == 'edit') {
await runAsync({ url: pathconfig?.edit || '/edit', params: { ...params, id: drawer?.item?.id } }); await runAsync({
url: pathconfig?.edit || '/edit',
params: { ...params, id: drawer?.item?.id },
});
} }
}} }}
> >
...@@ -512,12 +527,16 @@ function Plan(props) { ...@@ -512,12 +527,16 @@ function Plan(props) {
fields={editDateColumns} fields={editDateColumns}
defaultFormValue={{ checkCycle: drawer?.item?.checkCycle }} defaultFormValue={{ checkCycle: drawer?.item?.checkCycle }}
onFinish={async (vals) => { onFinish={async (vals) => {
await runAsync({ url: drawer?.type == "delay" ? "/check/umEquipmentCheckPlan/enable" : "/check/umEquipmentCheckPlan/adjustDate", params: { ...vals, id: drawer?.item?.id, checkEnable: 1 } }); await runAsync({
url:
drawer?.type == 'delay'
? '/check/umEquipmentCheckPlan/enable'
: '/check/umEquipmentCheckPlan/adjustDate',
params: { ...vals, id: drawer?.item?.id, checkEnable: 1 },
});
}} }}
/> />
</DrawerPro> </DrawerPro>
</div> </div>
); );
} }
......
...@@ -38,6 +38,7 @@ function getcolumns(id) { ...@@ -38,6 +38,7 @@ function getcolumns(id) {
title: '设备型号', title: '设备型号',
dataIndex: 'equipmentModelName', dataIndex: 'equipmentModelName',
key: 'equipmentModelId', key: 'equipmentModelId',
hideInSearch: true,
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -60,6 +61,30 @@ function getcolumns(id) { ...@@ -60,6 +61,30 @@ function getcolumns(id) {
showSearch: true, showSearch: true,
}, },
}, },
{
title: '设备型号',
dataIndex: 'equipmentModelName',
key: 'equipmentModelId',
hideInForm: true,
hideInTable: true,
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
valueType: 'select',
mode: 'radio',
options: {
path: '/asset/equipmentModel/query/selection',
},
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
},
{ {
title: '备注', title: '备注',
dataIndex: 'remark', dataIndex: 'remark',
......
...@@ -135,7 +135,7 @@ function Standard(props) { ...@@ -135,7 +135,7 @@ function Standard(props) {
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<AutoTable <AutoTable
pagetitle=" 点检标准" pagetitle={<h3 className="page-title">点检标准</h3>}
columns={columns} columns={columns}
actionRef={actionRef} actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
......
This diff is collapsed.
...@@ -40,6 +40,7 @@ function getcolumns(equipmentModelId) { ...@@ -40,6 +40,7 @@ function getcolumns(equipmentModelId) {
dataIndex: 'equipmentModelName', dataIndex: 'equipmentModelName',
key: 'equipmentModelId', key: 'equipmentModelId',
valueType: 'select', valueType: 'select',
hideInSearch: true,
fieldProps: { fieldProps: {
showSearch: true, showSearch: true,
}, },
...@@ -55,13 +56,36 @@ function getcolumns(equipmentModelId) { ...@@ -55,13 +56,36 @@ function getcolumns(equipmentModelId) {
options: { options: {
path: '/maintain/umMaintainStandard/selected/queryList', path: '/maintain/umMaintainStandard/selected/queryList',
linkParams: { linkParams: {
maintainType: 'maintainType', maintainType: '',
}, },
extraParams: { extraParams: {
equipmentModelId, equipmentModelId,
}, },
}, },
}, },
{
title: '设备型号',
dataIndex: 'equipmentModelName',
key: 'equipmentModelId',
hideInForm: true,
hideInTable: true,
valueType: 'select',
fieldProps: {
showSearch: true,
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
mode: 'radio',
options: {
path: '/asset/equipmentModel/query/selection',
},
},
{ {
title: '备注', title: '备注',
dataIndex: 'remark', dataIndex: 'remark',
......
...@@ -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-02-08 11:45:14 * @Last Modified time: 2023-02-08 14:50:40
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -18,8 +18,9 @@ import Addform from '@/components/Addform'; ...@@ -18,8 +18,9 @@ import Addform from '@/components/Addform';
import { Menu, Dropdown, Button, message } from 'antd'; import { Menu, Dropdown, Button, message } from 'antd';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import Detail from '@/components/RepaireDetail/Detail'; import Detail from '@/components/RepaireDetail/Detail';
import { useModel } from '@umijs/max';
function Failure(props) { function Failure(props) {
const { initialState, setInitialState } = useModel('@@initialState');
const actionRef = useRef(), const actionRef = useRef(),
containderef = useRef(), containderef = useRef(),
formRef = useRef(); formRef = useRef();
......
...@@ -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-02-08 13:30:00 * @Last Modified time: 2023-02-08 14:50:08
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -19,8 +19,9 @@ import { Menu, Dropdown, Button, message } from 'antd'; ...@@ -19,8 +19,9 @@ import { Menu, Dropdown, Button, message } from 'antd';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import Detail from '@/components/RepaireDetail/Detail'; import Detail from '@/components/RepaireDetail/Detail';
import OrderHandle from '../platform/RepairOrderHandle'; import OrderHandle from '../platform/RepairOrderHandle';
import { useModel } from '@umijs/max';
function Failure(props) { function Failure(props) {
const { initialState, setInitialState } = useModel('@@initialState');
const actionRef = useRef(), const actionRef = useRef(),
containderef = useRef(), containderef = useRef(),
formRef = useRef(); formRef = useRef();
......
...@@ -107,6 +107,35 @@ function getcolumns(changeState) { ...@@ -107,6 +107,35 @@ function getcolumns(changeState) {
title: '状态', title: '状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
hideInSearch: true,
hideInTable: true,
hideInForm: true,
valueType: 'select',
mode: 'radio',
options: [
{
label: '启用',
value: 1,
},
{
label: '停用',
value: 2,
},
],
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInDescriptions: true,
valueType: 'select', valueType: 'select',
mode: 'radio', mode: 'radio',
options: [ options: [
...@@ -140,10 +169,12 @@ function getcolumns(changeState) { ...@@ -140,10 +169,12 @@ function getcolumns(changeState) {
); );
}, },
}, },
{ {
title: '联系信息', title: '联系信息',
valueType: 'formList', valueType: 'formList',
dataIndex: 'userList', dataIndex: 'userList',
span: 3,
colProps: { colProps: {
xs: 24, xs: 24,
sm: 24, sm: 24,
......
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