Commit 5f10de68 authored by 左玲玲's avatar 左玲玲 😬

1720

parent b252d3b5
...@@ -39,7 +39,7 @@ const Mtable = (props) => { ...@@ -39,7 +39,7 @@ const Mtable = (props) => {
activeTabKey, //激活的tabKey 拖拽表格唯一标识使用 其他情况用不到 activeTabKey, //激活的tabKey 拖拽表格唯一标识使用 其他情况用不到
refreshDep, //依赖刷新 (已废弃) refreshDep, //依赖刷新 (已废弃)
getDefaultSelected, //存在默认选中向上返回选中值 getDefaultSelected, //存在默认选中向上返回选中值
resizeable = true, resizeable = false,
dataSource, dataSource,
} = props; } = props;
...@@ -101,6 +101,7 @@ const Mtable = (props) => { ...@@ -101,6 +101,7 @@ const Mtable = (props) => {
if (Array.isArray(it.options)) { if (Array.isArray(it.options)) {
options = { options = {
fieldProps: { fieldProps: {
...it?.fieldProps,
options: [...it.options], options: [...it.options],
}, },
}; };
...@@ -162,6 +163,7 @@ const Mtable = (props) => { ...@@ -162,6 +163,7 @@ const Mtable = (props) => {
if (Array.isArray(it.options)) { if (Array.isArray(it.options)) {
options = { options = {
fieldProps: { fieldProps: {
...it?.fieldProps,
options: [...it.options], options: [...it.options],
}, },
}; };
......
...@@ -509,3 +509,7 @@ ol { ...@@ -509,3 +509,7 @@ ol {
.ant-input-number { .ant-input-number {
width: 100%; width: 100%;
} }
.ant-form-item-label {
pointer-events: none;
}
\ No newline at end of file
function getcolumns(setdrawer) { import { Popconfirm, Switch } from 'antd';
function getcolumns(setdrawer, run) {
return [ return [
{ {
"tab": "未完成", tab: '未完成',
"key": "1", key: 1,
"columns": [ columns: [
{ {
"title": "维修单号", title: '点检计划单号',
"dataIndex": "repairOrderNo", dataIndex: 'checkNo',
"key": "repairOrderNo" key: 'checkNo',
hideInForm: true,
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'detail',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.checkNo}
</a>
);
},
}, },
{ {
"title": "设备名称", title: '设备编号',
"dataIndex": "equipmentName", dataIndex: 'equipmentNo',
"key": "equipmentName" key: 'equipmentNo',
hideInForm: true,
}, },
{ {
"title": "故障描述", title: '设备名称',
"dataIndex": "faultDescription", dataIndex: 'equipmentName',
"key": "faultDescription" key: 'equipmentName',
hideInForm: true,
}, },
{ {
"title": "报修人员", title: '工厂名称',
"dataIndex": "repairUserName", dataIndex: 'factoryName',
"key": "repairUserName" key: 'factoryId',
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
}, },
{ {
"title": "设备编号", title: '车间名称',
"dataIndex": "equipmentNo", dataIndex: 'shopName',
"key": "equipmentNo" key: 'shopId',
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '',
},
}, },
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
valueType: 'select',
options: [
{ {
"title": "报修时间", label: '制造点检',
"dataIndex": "repairTime", value: 1,
"key": "repairTimeList",
"valueType": "dateTimeRange"
}, },
{ {
"title": "报修单号", label: '设备点检',
"dataIndex": "repairNo", value: 2,
"key": "repairNo"
}, },
],
formItemProps: {
rules: [
{ {
"title": "工单状态", required: true,
"dataIndex": "statusName", message: '此项为必填项',
"key": "statusName" },
}
], ],
"pathconfig": { },
"enableadd": false,
"enableedit": false,
"enabledelete": false,
"enabledetail": false,
"add": "",
"edit": "",
"list": "/repair/umRepairOrder/queryRepairOrderList",
"delete": "",
"detail": ""
}
}, },
{ {
"tab": "已完成", title: '计划类型',
"key": "2", dataIndex: 'checkLoopName',
"columns": [ key: 'checkLoop',
formItemProps: {
rules: [
{ {
"title": "维修单号", required: true,
"dataIndex": "repairOrderNo", message: '此项为必填项',
"key": "repairOrderNo" },
],
}, },
valueType: 'radio',
searchValueType: 'select',
options: [
{ {
"title": "设备编号", label: '单次',
"dataIndex": "equipmentNo", value: 1,
"key": "equipmentNo"
}, },
{ {
"title": "设备名称", label: '周期',
"dataIndex": "equipmentName", value: 2,
"key": "equipmentName" },
],
}, },
{ {
"title": "故障描述", title: '周期(天)',
"dataIndex": "faultDescription", dataIndex: 'checkCycle',
"key": "faultDescription" key: 'checkCycle',
hideInSearch: true,
valueType: 'digit',
hideInForm: {
checkLoop: [1],
},
}, },
{ {
"title": "报修人员", title: '下次点检日期',
"dataIndex": "repairUserName", dataIndex: 'planCheckDate',
"key": "repairUserName" key: 'planCheckDateList',
hideInForm: true,
valueType: 'dateRange',
}, },
{ {
"title": "报修时间", title: '状态',
"dataIndex": "repairTime", dataIndex: 'statusName',
"key": "repairTimeList", key: 'status',
"valueType": "dateTimeRange" hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
}, },
options: [
{ {
"title": "报修单号", label: '未开始',
"dataIndex": "repairNo", value: 1,
"key": "repairNo"
}, },
{ {
"title": "工单状态", label: '执行中',
"dataIndex": "statusName", value: 2,
"key": "statusName" },
}
], ],
"pathconfig": { },
"enableadd": false, {
"enableedit": false, title: '启用/停用',
"enabledelete": false, dataIndex: 'checkEnable',
"enabledetail": false, key: 'checkEnable',
"add": "", hideInForm: true,
"edit": "", hideInSearch: true,
"list": "/repair/umRepairOrder/queryRepairOrderList", valueType: 'switch',
"delete": "", render: (text, row, _, action) => {
"detail": "" return <Popconfirm
} title="是否开启或停用?"
onConfirm={() => {
if (row.checkEnable == 1) {
run({ url: "/check/umEquipmentCheckPlan/enable", params: { id: row.id, checkEnable: 2 } })
} }
]; }}
okText="确定"
cancelText="取消"
>
< Switch checked={row.checkEnable == 1 ? true : false} checkedChildren="开启" unCheckedChildren="停用" defaultChecked={false} />
</Popconfirm>
} }
export default getcolumns; },
{
\ No newline at end of file title: '选择设备',
dataIndex: 'equipmentId',
key: 'equipmentId',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
hideInSearch: true,
hideInTable: true,
valueType: 'formSelectList',
colProps: {
span: 24,
},
},
],
pathconfig: {
enableadd: true,
enableedit: false,
enabledelete: true,
enabledetail: true,
add: '/check/umEquipmentCheckPlan/save',
edit: '',
list: '/check/umEquipmentCheckPlan/queryNoComplete',
delete: '/check/umEquipmentCheckPlan/deleteById',
detail: '/check/umEquipmentCheckPlan/queryDetails',
},
},
{
tab: '已完成',
key: 2,
columns: [
{
title: '点检计划单号',
dataIndex: 'checkNo',
key: 'checkNo',
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
valueType: 'select',
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
params: {},
},
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
valueType: 'select',
options: [
{
label: '制造点检',
value: 1,
},
{
label: '设备点检',
value: 2,
},
],
},
{
title: '计划类型',
dataIndex: 'checkLoopName',
key: 'checkLoop',
valueType: 'select',
options: [
{
label: '单次',
value: 1,
},
{
label: '周期',
value: 2,
},
],
},
{
title: '周期(天)',
dataIndex: 'checkCycle',
key: 'checkCycle',
hideInSearch: true,
},
{
title: '关单日期',
dataIndex: 'endDate',
key: 'endDateList',
valueType: 'dateRange',
},
{
title: '状态',
dataIndex: 'statusName',
key: 'statusName',
hideInSearch: true,
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: true,
add: '',
edit: '',
list: '/check/umEquipmentCheckPlan/queryYesComplete',
delete: '',
detail: '/check/umEquipmentCheckPlan/queryDetails',
},
},
];
}
export default getcolumns;
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
import getcolumns from './columns'; import getcolumns from './columns';
import { useRequest } from 'ahooks'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
function Plan(props) { function Plan(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
...@@ -94,18 +94,17 @@ import * as React from 'react'; ...@@ -94,18 +94,17 @@ import * as React from 'react';
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer, run).filter((it) => it.key == activeTabKey)[0]?.columns;
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer, run).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({ return activeTabKey == 1 ? defcolumn.concat({
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => [
defpath?.enabledetail && detail(text, row, _, action),
defpath?.enableedit && edit(text, row, _, action), defpath?.enableedit && edit(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action), defpath?.enabledelete && remove(text, row, _, action),
], ],
}); }) : defcolumn;
}, [activeTabKey]); }, [activeTabKey]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
...@@ -121,7 +120,6 @@ import * as React from 'react'; ...@@ -121,7 +120,6 @@ import * as React from 'react';
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
actionRef={actionRef} actionRef={actionRef}
pageextra={pathconfig?.enableadd ? 'add' : null} pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={true}
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
...@@ -169,7 +167,6 @@ import * as React from 'react'; ...@@ -169,7 +167,6 @@ import * as React from 'react';
/> />
</div> </div>
); );
} }
export default Plan;
export default Plan;
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