Commit 2c4a903a authored by TZW's avatar TZW

12051737

parent e02a2378
export default [ export default [
{ {
"path": "/welcome", path: '/welcome',
"name": "欢迎", name: '欢迎',
"icon": "smile", icon: 'smile',
"component": "./Welcome" component: './Welcome',
}, },
{ {
"name": "基础设置", name: '基础设置',
"icon": "setting", icon: 'setting',
"path": "/setting", path: '/setting',
"routes": [ routes: [
{ {
"name": "用户管理", name: '用户管理',
"path": "/setting/users", path: '/setting/users',
"component": "./setting/users" component: './setting/users',
}, },
{ {
"name": "角色管理", name: '角色管理',
"path": "/setting/role", path: '/setting/role',
"component": "./setting/role" component: './setting/role',
}, },
{ {
"name": "组织管理", name: '组织管理',
"path": "/setting/organization", path: '/setting/organization',
"component": "./setting/organization" component: './setting/organization',
}, },
{ {
"name": "工厂管理", name: '工厂管理',
"path": "/setting/factory", path: '/setting/factory',
"component": "./setting/factory" component: './setting/factory',
}, },
{ {
"name": "车间管理", name: '车间管理',
"path": "/setting/workshop", path: '/setting/workshop',
"component": "./setting/workshop" component: './setting/workshop',
}, },
{ {
"name": "工段管理", name: '工段管理',
"path": "/setting/section", path: '/setting/section',
"component": "./setting/section" component: './setting/section',
}, },
{ {
"name": "产线管理", name: '产线管理',
"path": "/setting/production", path: '/setting/production',
"component": "./setting/production" component: './setting/production',
} },
] ],
}, },
{ {
"name": "设备管理", name: '设备管理',
"icon": "bulb", icon: 'bulb',
"path": "/device", path: '/device',
"routes": [ routes: [
{ {
"name": "设备台账", name: '设备台账',
"path": "/device/account", path: '/device/account',
"component": "./device/account" component: './device/account',
}, },
{ {
"name": "设备类型", name: '设备类型',
"path": "/device/type", path: '/device/type',
"component": "./device/type" component: './device/type',
}, },
{ {
"name": "设备型号", name: '设备型号',
"path": "/device/model", path: '/device/model',
"component": "./device/model" component: './device/model',
}, },
{ {
"name": "设备供应商", name: '设备供应商',
"path": "/device/supplier", path: '/device/supplier',
"component": "./device/supplier" component: './device/supplier',
} },
] ],
}, },
{ {
"name": "维修管理", name: '维修管理',
"path": "/repair", path: '/repair',
"icon": "tool", icon: 'tool',
"routes": [ routes: [
{ {
"name": "故障报修", name: '接单平台',
"path": "/repair/failure", path: '/repair/platform',
"icon": "", icon: '',
"component": "./repair/failure" component: './repair/platform',
}, },
{ {
"name": "接单平台", name: '故障报修',
"path": "/repair/platform", path: '/repair/failure',
"icon": "", icon: '',
"component": "./repair/platform" component: './repair/failure',
}, },
{ {
"name": "故障设置", name: '故障设置',
"path": "/repair/fault", path: '/repair/fault',
"icon": "", icon: '',
"component": "./repair/fault" component: './repair/fault',
}, },
{ {
"name": "外协工单", name: '外协工单',
"path": "/repair/outsourcing", path: '/repair/outsourcing',
"icon": "", icon: '',
"component": "./repair/outsourcing" component: './repair/outsourcing',
}, },
{ {
"name": "维修工单", name: '维修工单',
"path": "/repair/order", path: '/repair/order',
"icon": "", icon: '',
"component": "./repair/order" component: './repair/order',
}, },
{ {
"name": "追踪工单", name: '追踪工单',
"path": "/repair/track", path: '/repair/track',
"icon": "", icon: '',
"component": "./repair/track" component: './repair/track',
} },
] ],
}, },
{ {
"name": "系统管理", name: '系统管理',
"path": "/system", path: '/system',
"icon": "desktop", icon: 'desktop',
"routes": [ routes: [
{ {
"name": "数据字典", name: '数据字典',
"path": "/system/dictionary", path: '/system/dictionary',
"icon": "", icon: '',
"component": "./system/dictionary" component: './system/dictionary',
}, },
{ {
"name": "扩展字段", name: '扩展字段',
"path": "/system/field", path: '/system/field',
"icon": "", icon: '',
"component": "./system/field" component: './system/field',
}, },
{ {
"name": "编号规则", name: '编号规则',
"path": "/system/rules", path: '/system/rules',
"icon": "", icon: '',
"component": "./system/rules" component: './system/rules',
} },
] ],
} },
]; ];
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44 * @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-15 10:13:24 * @Last Modified time: 2022-12-05 16:43:45
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -175,7 +175,6 @@ function Type(props) { ...@@ -175,7 +175,6 @@ function Type(props) {
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setDrawer); let defcolumn = getcolumns(setDrawer);
console.log(drawer);
if (drawer?.val == 'add' || drawer?.val == 'edit') { if (drawer?.val == 'add' || drawer?.val == 'edit') {
defcolumn[1].hideInForm = true; defcolumn[1].hideInForm = true;
} else { } else {
...@@ -191,7 +190,7 @@ function Type(props) { ...@@ -191,7 +190,7 @@ function Type(props) {
remove(text, row, _, action), remove(text, row, _, action),
], ],
}); });
}, [drawer.val]); }, [drawer?.val]);
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
...@@ -202,6 +201,7 @@ function Type(props) { ...@@ -202,6 +201,7 @@ function Type(props) {
actionRef={actionRef} actionRef={actionRef}
pageextra={'add'} pageextra={'add'}
resizeable={false} resizeable={false}
rowKey={'key'}
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
...@@ -213,8 +213,11 @@ function Type(props) { ...@@ -213,8 +213,11 @@ function Type(props) {
visible: true, visible: true,
item: null, item: null,
title: '新增', title: '新增',
detailpath: '',
params: {},
val: 'add', val: 'add',
onFinish: async (vals) => { onFinish: async (vals) => {
console.log(drawer);
let params = { let params = {
...vals, ...vals,
parentId: 0, parentId: 0,
......
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';
const pathconfig = { const pathconfig = {
"enableadd": true, enableadd: true,
"enableedit": true, enableedit: true,
"enabledelete": true, enabledelete: true,
"enabledetail": true, enabledetail: true,
"add": "/repair/umFaultSetting/save", add: '/repair/umFaultSetting/save',
"edit": "/repair/umFaultSetting/save", edit: '/repair/umFaultSetting/save',
"list": "/repair/umFaultSetting/queryList", list: '/repair/umFaultSetting/queryList',
"delete": "/repair/umFaultSetting/deleteById", delete: '/repair/umFaultSetting/deleteById',
"detail": "" detail: '',
}; };
function Fault(props) { function Fault(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
...@@ -121,7 +121,7 @@ import * as React from 'react'; ...@@ -121,7 +121,7 @@ import * as React from 'react';
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'}
...@@ -169,6 +169,6 @@ import * as React from 'react'; ...@@ -169,6 +169,6 @@ import * as React from 'react';
/> />
</div> </div>
); );
} }
export default Fault; export default Fault;
\ No newline at end of file
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-05 11:13:26 * @Date: 2022-12-05 11:13:26
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-05 14:29:57 * @Last Modified time: 2022-12-05 16:31:25
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
const App = ({ type, id }) => { import { doFetch } from '@/utils/doFetch';
const App = ({ type, id, actionRef, url, setdrawer }) => {
let columns = []; let columns = [];
if (type == 'jd') { if (type == 'wxjd') {
columns = [ columns = [
{ {
title: '协助维修人员', title: '协助维修人员',
...@@ -17,9 +18,14 @@ const App = ({ type, id }) => { ...@@ -17,9 +18,14 @@ const App = ({ type, id }) => {
key: 'repairAssistList', key: 'repairAssistList',
valueType: 'select', valueType: 'select',
options: { path: '/repair/umRepairOrder/selection', params: { id } }, options: { path: '/repair/umRepairOrder/selection', params: { id } },
fieldProps: {
placeholder: '请选择',
showSearch: true,
mode: 'multiple',
},
}, },
]; ];
} else if (type == 'pd') { } else if (type == 'wxpd') {
columns = [ columns = [
{ {
title: '维修人员', title: '维修人员',
...@@ -35,6 +41,33 @@ const App = ({ type, id }) => { ...@@ -35,6 +41,33 @@ const App = ({ type, id }) => {
key: 'faultDescription', key: 'faultDescription',
valueType: 'select', valueType: 'select',
options: { path: '/repair/umRepairOrder/selection', params: { id } }, options: { path: '/repair/umRepairOrder/selection', params: { id } },
fieldProps: {
placeholder: '请选择',
showSearch: true,
mode: 'multiple',
},
},
];
} else if (type == 'zzpd') {
columns = [
{
title: '追踪人员',
dataIndex: 'trackAssistList',
key: 'trackAssistList',
valueType: 'select',
options: { path: '/auth/sysUser/selection' },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
];
} else if (type == 'wpd') {
columns = [
{
title: '外协人员',
dataIndex: 'otherUnitsAssistList',
key: 'otherUnitsAssistList',
valueType: 'select',
options: { path: '/auth/sysUser/selection' },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
}, },
]; ];
} }
...@@ -44,17 +77,22 @@ const App = ({ type, id }) => { ...@@ -44,17 +77,22 @@ const App = ({ type, id }) => {
fields={columns} fields={columns}
onFinish={async (vals) => { onFinish={async (vals) => {
console.log(vals); console.log(vals);
vals.repairAssistList = vals?.repairAssistList.map((it) => {
return {
assistUserId: it,
};
});
let params = { let params = {
...vals, ...vals,
id, id,
}; };
let res = await doFetch({ let res = await doFetch({
url: urlParams.save, url,
params, params,
}); });
if (res.code === '0000') { if (res.code === '0000') {
message.success('操作成功!'); message.success('操作成功!');
setDrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: false, visible: false,
})); }));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-05 10:13:42 * @Date: 2022-12-05 10:13:42
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-05 13:17:26 * @Last Modified time: 2022-12-05 17:32:09
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -60,7 +60,74 @@ function Platform(props) { ...@@ -60,7 +60,74 @@ function Platform(props) {
}; };
// 接单按钮 // 接单按钮
const receiveBtn = (text, row, _, action) => { const receiveBtn = (text, row, _, action, activeTab) => {
if (row?.status == 0 || row?.status == 1) {
if (activeTab == '2') {
// 追踪
return (
<PremButton
btn={{
size: 'small',
type: 'primary',
onClick: async () => {
debugger;
// setdrawer((s) => ({
// ...s,
// type: null,
// }));
console.log('zzjd');
let params = {
id: row?.id,
};
let res = await doFetch({
url: '/repair/umTrackOrder/orderReceiving',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}}
>
接单2
</PremButton>
);
} else if (activeTab == '3') {
return (
<PremButton
btn={{
size: 'small',
type: 'primary',
onClick: async () => {
let params = {
...vals,
id,
};
let res = await doFetch({
url: '/repair/umOtherUnitsOrder/orderReceiving',
params,
});
if (res.code === '0000') {
message.success('操作成功!');
setdrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}}
>
接单3
</PremButton>
);
} else if (activeTab == '1') {
// 维修
return ( return (
<PremButton <PremButton
btn={{ btn={{
...@@ -73,18 +140,17 @@ function Platform(props) { ...@@ -73,18 +140,17 @@ function Platform(props) {
item: row, item: row,
title: '接单', title: '接单',
val: 'only', val: 'only',
type: 'jd', type: 'wxjd',
})); }));
}, },
}} }}
> >
接单 接单1
</PremButton> </PremButton>
); );
}; }
} else {
// 派单按钮 if (activeTab == '2') {
const dispatchBtn = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
btn={{ btn={{
...@@ -96,7 +162,8 @@ function Platform(props) { ...@@ -96,7 +162,8 @@ function Platform(props) {
open: true, open: true,
item: row, item: row,
title: '派单', title: '派单',
val: 'add', type: 'zzpd',
val: 'only',
})); }));
}, },
}} }}
...@@ -104,23 +171,63 @@ function Platform(props) { ...@@ -104,23 +171,63 @@ function Platform(props) {
派单 派单
</PremButton> </PremButton>
); );
} else if (activeTab == '1') {
// 维修
return (
<PremButton
btn={{
size: 'small',
type: 'primary',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '派单',
type: 'wxpd',
val: 'only',
}));
},
}}
>
派单
</PremButton>
);
} else if (activeTab == '3') {
return (
<PremButton
btn={{
size: 'small',
type: 'primary',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '派单',
type: 'wpd',
val: 'only',
}));
},
}}
>
派单
</PremButton>
);
}
}
}; };
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 defcolumn.concat({ let actions = {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => { render: (text, row, _, action) => receiveBtn(text, row, _, action, activeTabKey),
if (row?.status == 0 || row?.status == 1) { };
return [receiveBtn(text, row, _, action)]; return defcolumn.concat(actions);
} else {
return [dispatchBtn(text, row, _, action)];
}
},
});
}, [activeTabKey]); }, [activeTabKey]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
...@@ -130,10 +237,46 @@ function Platform(props) { ...@@ -130,10 +237,46 @@ function Platform(props) {
function selectType(type) { function selectType(type) {
switch (type) { switch (type) {
case 'jd': case 'wxjd':
return <OrderHandle type="jd" id={drawer?.item.id} />; return (
case 'pd': <OrderHandle
return <OrderHandle type="pd" id={drawer?.item.id} />; type="wxjd"
id={drawer?.item.id}
url={'/repair/umRepairOrder/orderReceiving'}
actionRef={actionRef}
setdrawer={setdrawer}
/>
);
case 'wxpd':
return (
<OrderHandle
type="wxpd"
actionRef={actionRef}
setdrawer={setdrawer}
id={drawer?.item.id}
url={'/repair/umRepairOrder/dispatchById'}
/>
);
case 'zzpd':
return (
<OrderHandle
type="zzpd"
actionRef={actionRef}
setdrawer={setdrawer}
id={drawer?.item.id}
url={'/repair/umTrackOrder/dispatchById'}
/>
);
case 'wpd':
return (
<OrderHandle
type="wpd"
setdrawer={setdrawer}
actionRef={actionRef}
id={drawer?.item.id}
url={'/repair/umOtherUnitsOrder/dispatchById'}
/>
);
default: default:
break; break;
} }
...@@ -145,8 +288,8 @@ function Platform(props) { ...@@ -145,8 +288,8 @@ function Platform(props) {
columns={columns} columns={columns}
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} resizeable={false}
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-24 11:16:02 * @Date: 2022-11-24 11:16:02
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-28 15:43:36 * @Last Modified time: 2022-12-05 16:20:22
*/ */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
...@@ -202,6 +202,7 @@ function Type(props) { ...@@ -202,6 +202,7 @@ function Type(props) {
columns={columns} columns={columns}
path={urlParams.list} path={urlParams.list}
actionRef={actionRef} actionRef={actionRef}
rowKey={'key'}
pageextra={'add'} pageextra={'add'}
resizeable={false} resizeable={false}
addconfig={{ addconfig={{
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-24 11:16:02 * @Date: 2022-11-24 11:16:02
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-30 14:02:16 * @Last Modified time: 2022-12-05 16:20:55
*/ */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
...@@ -200,6 +200,7 @@ function Type(props) { ...@@ -200,6 +200,7 @@ function Type(props) {
columns={columns} columns={columns}
path={urlParams.list} path={urlParams.list}
actionRef={actionRef} actionRef={actionRef}
rowKey={'key'}
resizeable={false} resizeable={false}
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
......
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