Commit c08a9aa5 authored by TZW's avatar TZW

12081752

parent ab6d67e8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-07 11:19:30 * @Date: 2022-12-07 11:19:30
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-08 15:48:49 * @Last Modified time: 2022-12-08 16:06:42
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -142,6 +142,14 @@ function Fault(props) { ...@@ -142,6 +142,14 @@ function Fault(props) {
title: '故障名称', title: '故障名称',
dataIndex: 'faultDetailName', dataIndex: 'faultDetailName',
key: 'faultDetailName', key: 'faultDetailName',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
}, },
{ {
title: '故障代码', title: '故障代码',
...@@ -152,11 +160,13 @@ function Fault(props) { ...@@ -152,11 +160,13 @@ function Fault(props) {
title: '故障描述', title: '故障描述',
dataIndex: 'faultPhenomenon', dataIndex: 'faultPhenomenon',
key: 'faultPhenomenon', key: 'faultPhenomenon',
valueType: 'textarea',
}, },
{ {
title: '解决方案', title: '解决方案',
dataIndex: 'faultSolution', dataIndex: 'faultSolution',
key: 'faultSolution', key: 'faultSolution',
valueType: 'textarea',
search: false, search: false,
}, },
]; ];
...@@ -171,9 +181,42 @@ function Fault(props) { ...@@ -171,9 +181,42 @@ function Fault(props) {
}, []); }, []);
return ( return (
<> <>
<ProDescriptions dataSource={request} columns={columns} /> <ProDescriptions
dataSource={request}
columns={[
{
title: '故障类型',
dataIndex: 'faultType',
key: 'faultType',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '故障代码',
dataIndex: 'faultCode',
key: 'faultCode',
},
{
title: '设备类型',
dataIndex: 'equipmentTypeName',
key: 'equipmentTypeId',
valueType: 'treeSelect',
options: {
path: '/asset/equipmentType/queryTreeList',
params: {},
},
},
]}
/>
<AutoTable <AutoTable
columns={columns} columns={columns}
formRef={gzmcref}
path="/repair/umFaultSettingDetail/queryById" path="/repair/umFaultSettingDetail/queryById"
params={{ id: drawer?.item.id }} params={{ id: drawer?.item.id }}
pageextra={'add'} pageextra={'add'}
...@@ -186,12 +229,26 @@ function Fault(props) { ...@@ -186,12 +229,26 @@ function Fault(props) {
setdrawergz((s) => ({ setdrawergz((s) => ({
...s, ...s,
open: true, open: true,
item: { title: '新建故障名称',
isShutdown: 1,
},
title: '新建追踪工单',
val: 'add', val: 'add',
type: 'add', onFinish: async (vals) => {
let params = {
...vals,
id: drawer?.item.id,
};
let res = await doFetch({
url: '/repair/umFaultSettingDetail/save',
params,
});
if (res.code === '0000') {
message.success('新增成功!');
setdrawergz((s) => ({
...s,
open: false,
}));
gzmcref.current.reload();
}
},
})); }));
}, },
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,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: 2022-12-08 09:02:50 * @Last Modified time: 2022-12-08 17:52:09
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -14,6 +14,7 @@ import getcolumns from './columns'; ...@@ -14,6 +14,7 @@ import getcolumns from './columns';
import { useRequest } from 'ahooks'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { Dropdown, Menu, Button } from 'antd'; import { Dropdown, Menu, Button } from 'antd';
import InitForm from '@/components/InitForm';
function Failure(props) { function Failure(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -101,6 +102,7 @@ function Failure(props) { ...@@ -101,6 +102,7 @@ function Failure(props) {
); );
}; };
// 更多
const more = (text, row, _, action) => { const more = (text, row, _, action) => {
const menu = ( const menu = (
<Menu <Menu
...@@ -109,9 +111,9 @@ function Failure(props) { ...@@ -109,9 +111,9 @@ function Failure(props) {
label: ( label: (
<a <a
onClick={() => { onClick={() => {
setDrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: true, open: true,
type: 'editChildEquipment', type: 'editChildEquipment',
item: { item: {
id: row.id, id: row.id,
...@@ -130,9 +132,9 @@ function Failure(props) { ...@@ -130,9 +132,9 @@ function Failure(props) {
// }); // });
// if (res.code === '0000') { // if (res.code === '0000') {
// message.success('新增成功!'); // message.success('新增成功!');
// setDrawer((s) => ({ // setdrawer((s) => ({
// ...s, // ...s,
// visible: false, // open: false,
// })); // }));
// actionRef.current.reload(); // actionRef.current.reload();
// } // }
...@@ -149,15 +151,15 @@ function Failure(props) { ...@@ -149,15 +151,15 @@ function Failure(props) {
label: ( label: (
<a <a
onClick={() => { onClick={() => {
setDrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: true, open: true,
type: 'resume', type: 'wcwx',
item: { item: {
id: row.id, id: row.id,
}, },
val: 'only', val: 'only',
title: '履历登记', title: '完成维修',
// onFinish: async (vals) => { // onFinish: async (vals) => {
// //console.log(1); // //console.log(1);
// let params = { // let params = {
...@@ -170,9 +172,9 @@ function Failure(props) { ...@@ -170,9 +172,9 @@ function Failure(props) {
// }); // });
// if (res.code === '0000') { // if (res.code === '0000') {
// message.success('新增成功!'); // message.success('新增成功!');
// setDrawer((s) => ({ // setdrawer((s) => ({
// ...s, // ...s,
// visible: false, // open: false,
// })); // }));
// actionRef.current.reload(); // actionRef.current.reload();
// } // }
...@@ -232,6 +234,142 @@ function Failure(props) { ...@@ -232,6 +234,142 @@ function Failure(props) {
); );
}; };
// ++++++下拉菜单+++++++
// 接单
const Recevive = () => {};
// 完成维修
const Finishrepair = () => {
const columns = [
{
title: '故障类型',
dataIndex: 'faultSettingId',
key: 'faultSettingId',
valueType: 'select',
options: {
path: '/repair/umFaultSetting/selected/queryList',
params: {
equipmentId: drawer?.item.id,
},
},
},
{
title: '故障名称',
dataIndex: 'faultDetailId',
key: 'faultDetailId',
valueType: 'select',
options: {
path: '/repair/umFaultSettingDetail/selected/queryList',
linkParams: {
faultSettingId: '',
},
},
},
{
title: '故障原因',
dataIndex: 'faultDescription',
key: 'faultDescription',
valueType: 'textarea',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '开始维修时间',
dataIndex: 'equipmentId',
key: 'equipmentId',
fieldProps: {
disabled: true,
},
},
{
title: '维修类型',
dataIndex: 'equipmentId',
key: 'equipmentId',
valueType: 'select',
options: { path: '/asset/equipment/selection/user/shop', params: {} },
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '是否停机维修',
dataIndex: 'isShutdown',
key: 'isShutdown',
valueType: 'radio',
options: [
{
value: 1,
label: '是',
},
{
value: 2,
label: '否',
},
],
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '维修内容',
dataIndex: 'repairContent',
key: 'repairContent',
valueType: 'textarea',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '协助维修人员',
dataIndex: 'repairAssistList',
key: 'repairAssistList',
valueType: 'select',
options: { path: '/repair/umRepairOrder/selection', params: { id: drawer?.item.id } },
fieldProps: {
placeholder: '请选择',
showSearch: true,
mode: 'multiple',
},
},
];
return (
<>
<InitForm
fields={columns}
onFinish={(vals) => {
console.log(vals);
}}
{...drawer}
/>
</>
);
};
const selectType = {
jd: <Recevive />,
wcwx: <Finishrepair />,
};
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 ?? {};
...@@ -248,14 +386,6 @@ function Failure(props) { ...@@ -248,14 +386,6 @@ function Failure(props) {
return defpath; return defpath;
}, [activeTabKey]); }, [activeTabKey]);
const selectType = (type) => {
switch (type) {
case 'add':
return;
default:
break;
}
};
const containderef = useRef(); const containderef = useRef();
return ( return (
<div style={{ position: 'relative' }} ref={containderef}> <div style={{ position: 'relative' }} ref={containderef}>
...@@ -313,7 +443,7 @@ function Failure(props) { ...@@ -313,7 +443,7 @@ function Failure(props) {
} }
}} }}
> >
{selectType(drawer?.type)} {selectType[drawer?.type]}
</DrawerPro> </DrawerPro>
</div> </div>
); );
......
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