Commit e22207dd authored by TZW's avatar TZW

Merge branch 'master' of http://47.100.234.193:9527/wuhao/ems3.3

parents 81dff650 60f06539
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
dev: { dev: {
[defaultSetting.proxypath]: { [defaultSetting.proxypath]: {
// 要代理的地址 // 要代理的地址
target: 'http://192.168.40.64:28001', //jf哥 target: 'http://192.168.40.64:28000', //jf哥
// target: 'http://192.168.40.64:28000', //gc哥 // target: 'http://192.168.40.64:28000', //gc哥
// target: 'http://192.168.40.203:8000', //dj哥 // target: 'http://192.168.40.203:8000', //dj哥
changeOrigin: true, changeOrigin: true,
......
...@@ -14,9 +14,11 @@ body, ...@@ -14,9 +14,11 @@ body,
.ant-layout { .ant-layout {
min-height: 100vh; min-height: 100vh;
} }
.ant-popover-inner-content {
padding: 0 !important; .ant-pro-core-field-dropdown-overlay {
margin: -12px -16px;
} }
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed { .ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
left: unset; left: unset;
} }
...@@ -60,13 +62,14 @@ ol { ...@@ -60,13 +62,14 @@ ol {
width: 100%; width: 100%;
overflow-x: auto; overflow-x: auto;
&-thead > tr, &-thead>tr,
&-tbody > tr { &-tbody>tr {
> th,
> td { >th,
>td {
white-space: pre; white-space: pre;
> span { >span {
display: block; display: block;
} }
} }
...@@ -121,7 +124,7 @@ ol { ...@@ -121,7 +124,7 @@ ol {
font-size: 16px !important; font-size: 16px !important;
.ant-tabs-tab-btn { .ant-tabs-tab-btn {
color: @primary-color !important; color: @primary-color !important;
} }
} }
...@@ -315,7 +318,7 @@ ol { ...@@ -315,7 +318,7 @@ ol {
} }
.lightblue { .lightblue {
> td:first-child { >td:first-child {
position: relative; position: relative;
&::before { &::before {
...@@ -337,14 +340,14 @@ ol { ...@@ -337,14 +340,14 @@ ol {
width: 100%; width: 100%;
padding-left: 0 !important; padding-left: 0 !important;
> span:first-child { >span:first-child {
flex: 1; flex: 1;
> span:first-child { >span:first-child {
display: none !important; display: none !important;
} }
> .ant-spin-nested-loading { >.ant-spin-nested-loading {
width: 100%; width: 100%;
} }
} }
...@@ -403,7 +406,7 @@ ol { ...@@ -403,7 +406,7 @@ ol {
} }
.runtime-keep-alive-layout { .runtime-keep-alive-layout {
> div { >div {
height: 100% !important; height: 100% !important;
} }
} }
...@@ -451,7 +454,7 @@ ol { ...@@ -451,7 +454,7 @@ ol {
min-height: 100% !important; min-height: 100% !important;
overflow: hidden !important; overflow: hidden !important;
> div { >div {
height: 100%; height: 100%;
min-height: calc(100vh - 96px); min-height: calc(100vh - 96px);
} }
...@@ -463,12 +466,12 @@ ol { ...@@ -463,12 +466,12 @@ ol {
// 横向滚动条 // 横向滚动条
.scrollHoriz { .scrollHoriz {
> div { >div {
display: flex !important; display: flex !important;
flex-wrap: nowrap !important; flex-wrap: nowrap !important;
align-items: center !important; align-items: center !important;
> div { >div {
flex-shrink: 0 !important; flex-shrink: 0 !important;
} }
} }
...@@ -516,4 +519,4 @@ ol { ...@@ -516,4 +519,4 @@ ol {
.container___gD5n4 { .container___gD5n4 {
z-index: 9999 !important; z-index: 9999 !important;
} }
\ No newline at end of file
import { doFetch } from '@/utils/doFetch';
import dayjs from "dayjs";
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return { return {
"pathconfig": { columns: [
"enableadd": false, {
"enableedit": false, title: '点检单号',
"enabledelete": false, dataIndex: 'taskNo',
"enabledetail": false, key: 'taskNo',
"add": "", hideInForm: false,
"edit": "", render: (text, row, _, action) => {
"list": "/repair/umRepairOrder/queryRepairOrderList", return (
"delete": "", <a
"detail": "" onClick={async () => {
}, let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } });
"columns": [ if (res.code == "0000") {
{ setdrawer((s) => ({
"title": "维修单号", ...s,
"dataIndex": "repairOrderNo", open: true,
"key": "repairOrderNo" val: 'detail',
}, title: '详细信息',
{ item: {
"title": "设备编号", ...res?.data?.basics
"dataIndex": "equipmentNo", }
"key": "equipmentNo" }));
}, }
{
"title": "设备名称",
"dataIndex": "equipmentName",
"key": "equipmentName"
},
{
"title": "故障描述",
"dataIndex": "faultDescription",
"key": "faultDescription"
},
{
"title": "报修人员",
"dataIndex": "repairUserName",
"key": "repairUserName"
},
{
"title": "报修时间",
"dataIndex": "repairTime",
"key": "repairTimeList",
"valueType": "dateTimeRange"
},
{
"title": "报修单号",
"dataIndex": "repairNo",
"key": "repairNo"
},
{
"title": "工单状态",
"dataIndex": "statusName",
"key": "statusName"
}
]
};
}}
>
{row?.taskNo}
</a>
);
},
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
valueType: 'select',
hideInForm: true,
options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
valueType: 'dateRange',
render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span>
}
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: true,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckOrders',
delete: '',
detail: '',
},
};
} }
export default getcolumns; export default getcolumns;
\ No newline at end of file
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 AutoTables from '@/components/AutoTable/mtable';
import getcolumns from './columns'; import PremButton from '@/components/PremButton';
import { useRequest } from 'ahooks'; import getcolumns from './columns';
import { doFetch } from '@/utils/doFetch'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch';
function Order(props) {
const actionRef = useRef(),
formRef = useRef();
const [drawer, setdrawer] = useState({
open: false,
});
const pathconfig = useMemo(() => {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf;
}, []);
const { run, loading, runAsync } = useRequest(doFetch, {
manual: true,
onSuccess: (res, params) => {
if (res?.code == '0000') {
actionRef?.current?.reload();
setdrawer((s) => ({
...s,
open: false,
}));
}
},
});
function Order(props) { const detail = (text, row, _, action) => {
const actionRef = useRef(), return (
formRef = useRef(); <PremButton
const [drawer, setdrawer] = useState({ btn={{
open: false, size: 'small',
}); type: 'link',
const pathconfig = useMemo(() => { onClick: () => {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {}; setdrawer((s) => ({
return pathconf; ...s,
}, []); open: true,
const { run, loading } = useRequest(doFetch, { item: row,
manual: true, title: '详情',
onSuccess: (res, params) => { val: 'detail',
if (res?.code == '0000') { title: '详细信息',
actionRef?.current?.reload(); }));
setdrawer((s) => ({ },
...s, }}
open: false, >
})); 详情
} </PremButton>
}, );
};
const edit = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '编辑',
val: 'edit',
}));
},
}}
>
编辑
</PremButton>
);
};
const remove = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否删除?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const order = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否接单?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
await runAsync({ url: '/check/umEquipmentCheckTask/meet', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
}}
>
接单
</PremButton>
);
};
const close = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否关单?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
await runAsync({ url: '/check/umEquipmentCheckTask/shut', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
关单
</PremButton>
);
};
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer)?.columns;
return defcolumn.concat({
title: '操作',
valueType: 'option',
width: 120,
render: (text, row, _, action) => [
order(text, row, _, action),
close(text, row, _, action)
],
}); });
}, []);
const detail = (text, row, _, action) => { const detailsColumns = useMemo(() => {
return ( const columnsc = [
<PremButton {
btn={{ title: '点检项目',
size: 'small', dataIndex: 'checkItem',
type: 'link', key: 'checkItem',
onClick: () => { hideInForm: true,
setdrawer((s) => ({ },
...s, {
open: true, title: '部位',
item: row, dataIndex: 'checkPosition',
title: '详情', key: 'checkPosition',
val: 'detail', hideInForm: true,
title: '详细信息', },
})); {
}, title: '点检方法',
}} dataIndex: 'checkWay',
> key: 'checkWay',
详情 hideInForm: true,
</PremButton> },
); ];
}; if (drawer?.val == "detail") {
return [
{
title: '计划信息',
valueType: 'split',
},
{
title: '点检单号',
dataIndex: 'taskNo',
key: 'taskNo',
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '工单状态',
dataIndex: 'statusName',
key: 'statusName',
},
{
title: '点检计划单号',
dataIndex: 'planNo',
key: 'planNo',
},
{
title: '基本信息',
valueType: 'split',
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '设备型号',
dataIndex: 'equipmentModelName',
key: 'equipmentModelName',
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkTypeName',
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDate',
span: 2
},
{
title: '点检项目',
dataIndex: 'item',
key: 'item',
valueType: 'formList',
colProps: {
span: 24,
},
columns,
span: 3,
render: (text, row) => {
return (
<AutoTables
columns={columnsc?.map((it) => ({
...it,
hideInSearch: true,
}))}
dataSource={row?.item}
/>
);
},
}
]
}
}, [drawer?.val, drawer?.item?.id]);
const edit = (text, row, _, action) => { return (
return ( <div style={{ position: 'relative' }}>
<PremButton <AutoTable
btn={{ pagetitle="点检接单"
size: 'small', columns={columns}
actionRef={actionRef}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={false}
addconfig={{
// access: 'sysDepartment_save',
btn: {
disabled: false,
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
item: row, item: null,
title: '编辑', title: '新增',
val: 'edit', val: 'add',
})); }));
}, },
}} },
> }}
编辑 />
</PremButton>
);
};
const remove = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否删除?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const columns = useMemo(() => { <DrawerPro
let defcolumn = getcolumns(setdrawer)?.columns; fields={drawer.val == "detail" ? detailsColumns : columns}
return defcolumn.concat({ params={{ id: drawer?.item?.id }}
title: '操作', formRef={formRef}
valueType: 'option', placement="right"
width: 150, detailpath={pathconfig?.detail || null}
render: (text, row, _, action) => [ detailData={drawer?.item}
pathconfig?.enabledetail && detail(text, row, _, action), defaultFormValue={drawer?.item}
pathconfig?.enableedit && edit(text, row, _, action), onClose={() => {
pathconfig?.enabledelete && remove(text, row, _, action), setdrawer((s) => ({
], ...s,
}); open: false,
}, []); }));
}}
return ( {...drawer}
<div style={{ position: 'relative' }}> onFinish={(vals) => {
<AutoTable if (drawer?.val == 'add') {
pagetitle="点检接单" run({ url: pathconfig?.add || '/add', params: { ...vals } });
columns={columns} } else if (drawer?.val == 'edit') {
actionRef={actionRef} run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} }
pageextra={pathconfig?.enableadd ? 'add' : null} }}
resizeable={true} />
addconfig={{ </div>
// access: 'sysDepartment_save', );
btn: { }
disabled: false,
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: null,
title: '新增',
val: 'add',
}));
},
},
}}
/>
<DrawerPro
fields={columns}
params={{ id: drawer?.item?.id }}
formRef={formRef}
placement="right"
detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
defaultFormValue={drawer?.item}
onClose={() => {
setdrawer((s) => ({
...s,
open: false,
}));
}}
{...drawer}
onFinish={(vals) => {
if (drawer?.val == 'add') {
run({ url: pathconfig?.add || '/add', params: { ...vals } });
} else if (drawer?.val == 'edit') {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
}
}}
/>
</div>
);
}
export default Order; export default Order;
\ No newline at end of file
\ No newline at end of file
...@@ -84,9 +84,7 @@ function getcolumns(setdrawer) { ...@@ -84,9 +84,7 @@ function getcolumns(setdrawer) {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
title: '详情',
val: 'detail', val: 'detail',
type: 'detail',
title: '详细信息', title: '详细信息',
item: row, item: row,
})); }));
...@@ -136,9 +134,7 @@ function getcolumns(setdrawer) { ...@@ -136,9 +134,7 @@ function getcolumns(setdrawer) {
}, },
options: { options: {
path: '/auth/sysShop/getAllShopSelection', path: '/auth/sysShop/getAllShopSelection',
linkParams: { params: {},
factoryId: '',
},
}, },
}, },
{ {
...@@ -332,9 +328,7 @@ function getcolumns(setdrawer) { ...@@ -332,9 +328,7 @@ function getcolumns(setdrawer) {
}, },
options: { options: {
path: '/auth/sysShop/getAllShopSelection', path: '/auth/sysShop/getAllShopSelection',
linkParams: { params: {},
factoryId: '',
},
}, },
}, },
{ {
...@@ -399,7 +393,7 @@ function getcolumns(setdrawer) { ...@@ -399,7 +393,7 @@ function getcolumns(setdrawer) {
add: '', add: '',
edit: '', edit: '',
list: '/check/umEquipmentCheckPlan/queryYesComplete', list: '/check/umEquipmentCheckPlan/queryYesComplete',
delete: '', delete: '/check/umEquipmentCheckPlan/deleteByI',
detail: '/check/umEquipmentCheckPlan/queryDetails', detail: '/check/umEquipmentCheckPlan/queryDetails',
}, },
}, },
......
...@@ -2,7 +2,9 @@ import * as React from 'react'; ...@@ -2,7 +2,9 @@ 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 AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import AutoTables from '@/components/AutoTable/mtable';
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';
...@@ -278,8 +280,157 @@ function Plan(props) { ...@@ -278,8 +280,157 @@ function Plan(props) {
}, },
]; ];
}, [drawer?.item]) }, [drawer?.item]);
const detailsColumns = useMemo(() => {
const columnsc = [
{
title: '点检项目',
dataIndex: 'checkItem',
key: 'checkItem',
hideInForm: true,
},
{
title: '部位',
dataIndex: 'checkPosition',
key: 'checkPosition',
hideInForm: true,
},
{
title: '点检方法',
dataIndex: 'checkWay',
key: 'checkWay',
hideInForm: true,
},
];
if (drawer?.val == "detail") {
return [
{
title: '计划信息',
valueType: 'split',
},
{
title: '点检计划单号',
dataIndex: 'checkNo',
key: 'checkNo',
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '状态',
dataIndex: 'statusName',
key: 'statusName',
},
{
title: '启用/停用',
dataIndex: 'checkEnableName',
key: 'checkEnableName',
},
{
title: '下次点检日期',
dataIndex: 'planCheckDate',
key: 'planCheckDate',
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: 'checkTypeName',
key: 'checkTypeName',
},
{
title: '计划类型',
dataIndex: 'checkLoopName',
key: 'checkLoopName',
},
{
title: '周期(天)',
dataIndex: 'checkCycle',
key: 'checkCycle',
span: activeTabKey == 1 ? 2 : 2
},
{
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?.itemList}
/>
);
},
},
{
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 pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defpath; return defpath;
...@@ -323,9 +474,8 @@ function Plan(props) { ...@@ -323,9 +474,8 @@ function Plan(props) {
/> />
<DrawerPro <DrawerPro
fields={drawer?.val == "detailaddon" ? editDateColumns : columns} fields={drawer?.val == "detailaddon" ? editDateColumns : drawer?.val == "detail" ? detailsColumns : columns}
detailpath={pathconfig?.detail || null} detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
defaultFormValue={drawer?.item} defaultFormValue={drawer?.item}
params={{ id: drawer?.item?.id }} params={{ id: drawer?.item?.id }}
formRef={formRef} formRef={formRef}
...@@ -366,6 +516,7 @@ function Plan(props) { ...@@ -366,6 +516,7 @@ function Plan(props) {
/> />
</DrawerPro> </DrawerPro>
</div> </div>
); );
} }
......
...@@ -29,7 +29,11 @@ function getcolumns(id) { ...@@ -29,7 +29,11 @@ function getcolumns(id) {
"label": "设备点检", "label": "设备点检",
"value": 2 "value": 2
} }
] ],
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
}, },
{ {
"title": "设备型号", "title": "设备型号",
...@@ -51,7 +55,11 @@ function getcolumns(id) { ...@@ -51,7 +55,11 @@ function getcolumns(id) {
"checkType": "", "checkType": "",
}, },
"extraParams": { id } "extraParams": { id }
} },
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
}, },
{ {
"title": "备注", "title": "备注",
......
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return { return [
"pathconfig": { {
"enableadd": false, tab: '我的待办',
"enableedit": false, key: '1',
"enabledelete": false, columns: [
"enabledetail": false, {
"add": "", title: '点检单号',
"edit": "", dataIndex: 'taskNo',
"list": "/repair/umRepairOrder/queryRepairOrderList", key: 'taskNo',
"delete": "", hideInForm: true,
"detail": "" },
}, {
"columns": [ title: '设备编号',
{ dataIndex: 'equipmentNo',
"title": "维修单号", key: 'equipmentNo',
"dataIndex": "repairOrderNo", hideInForm: true,
"key": "repairOrderNo" },
}, {
{ title: '设备名称',
"title": "设备编号", dataIndex: 'equipmentName',
"dataIndex": "equipmentNo", key: 'equipmentName',
"key": "equipmentNo" hideInForm: true,
}, },
{ {
"title": "设备名称", title: '点检类型',
"dataIndex": "equipmentName", dataIndex: 'checkTypeName',
"key": "equipmentName" key: 'checkType',
}, hideInForm: true,
{ valueType: 'select',
"title": "故障描述", options: [
"dataIndex": "faultDescription", {
"key": "faultDescription" label: '制造点检',
}, value: '1',
{ },
"title": "报修人员", {
"dataIndex": "repairUserName", label: '设备点检',
"key": "repairUserName" value: '2',
}, },
{ ],
"title": "报修时间", },
"dataIndex": "repairTime", {
"key": "repairTimeList", title: '点检截止日期',
"valueType": "dateTimeRange" dataIndex: 'checkCloseDate',
}, key: 'checkCloseDateList',
{ hideInForm: true,
"title": "报修单号", valueType: 'dateRange',
"dataIndex": "repairNo", },
"key": "repairNo" {
}, title: '接单时间',
{ dataIndex: 'checkStartTime',
"title": "工单状态", key: 'checkStartTime',
"dataIndex": "statusName", hideInForm: true,
"key": "statusName" hideInSearch: true,
} },
] {
}; title: '点检人',
dataIndex: 'checkUserName',
key: 'checkUserName',
hideInForm: true,
valueType: 'input',
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '待接单',
value: '1',
},
{
label: '点检中',
value: '2',
},
],
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckUndone',
delete: '',
detail: '',
},
},
{
tab: '未完成',
key: '2',
columns: [
{
title: '点检单号',
dataIndex: 'taskNo',
key: 'taskNo',
hideInForm: true,
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
hideInForm: true,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
hideInForm: true,
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
hideInForm: true,
valueType: 'select',
options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
hideInForm: true,
valueType: 'dateRange',
},
{
title: '接单时间',
dataIndex: 'checkStartTime',
key: 'checkStartTime',
hideInForm: true,
},
{
title: '点检人',
dataIndex: 'checkUserName',
key: 'checkUserId',
hideInSearch: false,
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysUser/selection',
params: {},
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '待接单',
value: '1',
},
{
label: '点检中',
value: '2',
},
],
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckUndoneAll',
delete: '',
detail: '',
},
},
{
tab: '已完成',
key: '3',
columns: [
{
title: '点检单号',
dataIndex: 'taskNo',
key: 'taskNo',
hideInForm: true,
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
hideInForm: true,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
hideInForm: true,
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
hideInForm: true,
valueType: 'select',
options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
hideInForm: true,
valueType: 'dateRange',
},
{
title: '接单时间',
dataIndex: 'checkStartTime',
key: 'checkStartTime',
hideInForm: true,
},
{
title: '关单时间',
dataIndex: 'endTime',
key: 'endDateList',
hideInForm: true,
valueType: 'dateRange',
},
{
title: '点检人',
dataIndex: 'checkUserName',
key: 'checkUserId',
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysUser/selection',
params: {},
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '已关单',
value: '3',
},
{
label: '已完成',
value: '4',
},
{
label: '超时关单',
value: '5',
},
],
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/check/umEquipmentCheckTaskHis/queryCheckCompleted',
delete: '',
detail: '',
},
},
];
} }
export default getcolumns; export default getcolumns;
\ No newline at end of file
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 Task(props) { function Task(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
}); }),
const pathconfig = useMemo(() => { [activeTabKey, setactiveTabKey] = useState("1");
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf; const { run, loading } = useRequest(doFetch, {
}, []); manual: true,
const { run, loading } = useRequest(doFetch, { onSuccess: (res, params) => {
manual: true, if (res?.code == '0000') {
onSuccess: (res, params) => { actionRef?.current?.reload();
if (res?.code == '0000') { setdrawer((s) => ({
actionRef?.current?.reload(); ...s,
setdrawer((s) => ({ open: false,
...s, }));
open: false, }
})); },
} });
},
const detail = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
type: 'link',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
},
}}
>
详情
</PremButton>
);
};
const edit = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '编辑',
val: 'edit',
}));
},
}}
>
编辑
</PremButton>
);
};
const remove = (text, row, _, action) => {
return (
<PremButton
pop={{
title: '是否删除?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns;
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defcolumn.concat({
title: '操作',
valueType: 'option',
width: 150,
render: (text, row, _, action) => [
defpath?.enabledetail && detail(text, row, _, action),
defpath?.enableedit && edit(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action),
],
}); });
}, [activeTabKey]);
const detail = (text, row, _, action) => { const pathconfig = useMemo(() => {
return ( let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
<PremButton return defpath;
btn={{ }, [activeTabKey]);
size: 'small',
type: 'link',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
},
}}
>
详情
</PremButton>
);
};
const edit = (text, row, _, action) => { return (
return ( <div style={{ position: 'relative' }}>
<PremButton <AutoTable
btn={{ pagetitle="点检工单"
size: 'small', columns={columns}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
actionRef={actionRef}
pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={true}
addconfig={{
// access: 'sysDepartment_save',
btn: {
disabled: false,
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
item: row, item: null,
title: '编辑', title: '新增',
val: 'edit', val: 'add',
})); }));
}, },
}} },
> }}
编辑 tabList={getcolumns()}
</PremButton> activeTabKey={activeTabKey}
); onTabChange={(key) => {
}; setactiveTabKey(key);
}}
const remove = (text, row, _, action) => { />
return (
<PremButton
pop={{
title: '是否删除?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
},
}}
btn={{
size: 'small',
type: 'danger',
}}
>
删除
</PremButton>
);
};
const columns = useMemo(() => { <DrawerPro
let defcolumn = getcolumns(setdrawer)?.columns; fields={columns}
return defcolumn.concat({ detailpath={pathconfig?.detail || null}
title: '操作', detailData={drawer?.item}
valueType: 'option', defaultFormValue={drawer?.item}
width: 150, params={{ id: drawer?.item?.id }}
render: (text, row, _, action) => [ formRef={formRef}
pathconfig?.enabledetail && detail(text, row, _, action), placement="right"
pathconfig?.enableedit && edit(text, row, _, action), onClose={() => {
pathconfig?.enabledelete && remove(text, row, _, action), setdrawer((s) => ({
], ...s,
}); open: false,
}, []); }));
}}
return ( {...drawer}
<div style={{ position: 'relative' }}> onFinish={(vals) => {
<AutoTable if (drawer?.val == 'add') {
pagetitle="点检工单" run({ url: pathconfig?.add || '/add', params: { ...vals } });
columns={columns} } else if (drawer?.val == 'edit') {
actionRef={actionRef} run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} }
pageextra={pathconfig?.enableadd ? 'add' : null} }}
resizeable={true} />
addconfig={{ </div>
// access: 'sysDepartment_save', );
btn: { }
disabled: false,
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: null,
title: '新增',
val: 'add',
}));
},
},
}}
/>
<DrawerPro
fields={columns}
params={{ id: drawer?.item?.id }}
formRef={formRef}
placement="right"
detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
defaultFormValue={drawer?.item}
onClose={() => {
setdrawer((s) => ({
...s,
open: false,
}));
}}
{...drawer}
onFinish={(vals) => {
if (drawer?.val == 'add') {
run({ url: pathconfig?.add || '/add', params: { ...vals } });
} else if (drawer?.val == 'edit') {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
}
}}
/>
</div>
);
}
export default Task; export default Task;
\ No newline at end of file
...@@ -22,8 +22,8 @@ function Failure(props) { ...@@ -22,8 +22,8 @@ function Failure(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
...@@ -492,7 +492,6 @@ function Failure(props) { ...@@ -492,7 +492,6 @@ function Failure(props) {
<InitForm <InitForm
fields={columns} fields={columns}
onFinish={async (vals) => { onFinish={async (vals) => {
console.log(vals);
let params = { let params = {
repairComplete: { repairComplete: {
faultType: vals.faultSettingId, faultType: vals.faultSettingId,
...@@ -546,7 +545,6 @@ function Failure(props) { ...@@ -546,7 +545,6 @@ function Failure(props) {
}, },
]} ]}
onFinish={async (vals) => { onFinish={async (vals) => {
console.log(vals);
let params = { let params = {
repairInfo: { ...vals }, repairInfo: { ...vals },
id: drawer?.item.id, id: drawer?.item.id,
......
...@@ -61,7 +61,6 @@ function Factory(props) { ...@@ -61,7 +61,6 @@ function Factory(props) {
url: '/auth/sysShop/checkShopRelation', url: '/auth/sysShop/checkShopRelation',
params: { id: drawer?.id }, params: { id: drawer?.id },
}); });
console.log(data);
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: true, visible: true,
......
...@@ -11,8 +11,8 @@ function Instore(props) { ...@@ -11,8 +11,8 @@ function Instore(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
...@@ -116,9 +116,6 @@ function Instore(props) { ...@@ -116,9 +116,6 @@ function Instore(props) {
let res = await doFetch({ url: '/sparepart/sparePart/queryAllSelect', params: {} }); let res = await doFetch({ url: '/sparepart/sparePart/queryAllSelect', params: {} });
return res?.data?.dataList; return res?.data?.dataList;
}); });
console.log(data);
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<AutoTable <AutoTable
......
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