Commit 5a96565d authored by TZW's avatar TZW

12121503

parent 0e498a97
...@@ -13,13 +13,13 @@ export default { ...@@ -13,13 +13,13 @@ export default {
dev: { dev: {
[defaultSetting.proxypath]: { [defaultSetting.proxypath]: {
// 要代理的地址 // 要代理的地址
// target: 'http://192.168.40.117:8000', //jf哥 target: 'http://192.168.40.64:28001', //jf哥
target: 'http://192.168.40.203:8000', //dj哥 // target: 'http://192.168.40.203:8000', //dj哥
changeOrigin: true, changeOrigin: true,
}, },
'/token': { '/token': {
// 要代理的地址 // 要代理的地址
target: 'http://192.168.40.203:8000', target: 'http://192.168.40.64:28001',
changeOrigin: true, changeOrigin: true,
}, },
'/staticfile/': { '/staticfile/': {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-29 14:03:07 * @Date: 2022-11-29 14:03:07
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-09 13:14:11 * @Last Modified time: 2022-12-12 15:00:10
*/ */
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
...@@ -22,6 +22,7 @@ const App = ({ ...@@ -22,6 +22,7 @@ const App = ({
}) => { }) => {
const [value, setValue] = useState(''); const [value, setValue] = useState('');
const [fieldscolumns, setfieldscolumns] = useState(columns); const [fieldscolumns, setfieldscolumns] = useState(columns);
console.log('22222', drawer, urlParams);
const selectValueType = (type, options) => { const selectValueType = (type, options) => {
switch (type) { switch (type) {
case 1: case 1:
......
...@@ -1334,6 +1334,7 @@ function FormList({ item, colProps, formRef }) { ...@@ -1334,6 +1334,7 @@ function FormList({ item, colProps, formRef }) {
return <ProForm.Group>{doms}</ProForm.Group>; return <ProForm.Group>{doms}</ProForm.Group>;
}} }}
alwaysShowItemLabel={false} alwaysShowItemLabel={false}
copyIconProps={false}
> >
{(f, index, action) => { {(f, index, action) => {
return ( return (
......
import React, { useState, useEffect } from 'react';
import { ProDescriptions } from '@ant-design/pro-components';
import { Divider, Image } from 'antd';
export default ({ index, title, dataSource, columns, hidden }) => {
const [flag, setflag] = useState(true);
// 0:报修 1:接单 2:派单 3:完成维修 4:转追踪 5:转外协 6:转单 7:退单 8:追踪审核 9:外协审核 10:退单审核 11:效果验证
const columns_mes = {
sbxx: [
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '设备型号',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '公司名称',
dataIndex: 'organizationName',
key: 'organizationId',
},
{
title: '部门名称',
dataIndex: 'departmentName',
key: 'departmentId',
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
},
{
title: '工段名称',
dataIndex: 'sectionName',
key: 'sectionId',
},
{
title: '产线名称',
dataIndex: 'productLineName',
key: 'productLineName',
},
],
gzxx: [
{
title: '报修人员',
dataIndex: 'repairUserName',
key: 'repairUserName',
},
{
title: '报修时间',
dataIndex: 'repairTime',
key: 'repairTime',
},
{
title: '是否停机',
dataIndex: 'isShutdown',
key: 'isShutdown',
render: (text, row, _, action) => {
return row?.isShutdown == '1' ? '是' : '否';
},
},
{
title: '故障类型',
dataIndex: 'faultType',
key: 'faultType',
},
{
title: '故障名称',
dataIndex: 'faultDetailName',
key: 'faultDetailName',
},
{
title: '故障描述',
dataIndex: 'faultDescription',
key: 'faultDescription',
},
{
title: '故障图片',
dataIndex: 'pictureUrl',
key: 'pictureUrl',
render: (text, row, _, action) => {
if (row?.pictureUrl) {
return <Image width={70} src={row.pictureUrl} />;
} else {
return '暂无';
}
},
},
],
};
useEffect(() => {
setflag(hidden);
}, []);
console.log('datasource', dataSource);
return (
<>
{flag ? (
<div>
{index == 0 ? (
<div>
<div>
<h2 className="page-title">{title}</h2>
</div>
<Divider orientation="left">设备信息</Divider>
<ProDescriptions dataSource={dataSource?.equipment} columns={columns_mes['sbxx']} />
<Divider orientation="left">故障信息</Divider>
<ProDescriptions dataSource={dataSource} columns={columns_mes['gzxx']} />
</div>
) : (
<div>
<div style={{ borderLeft: '1px solid #ccc' }}>
<span
style={{ border: '1px solid #ccc', backgroundColor: 'white', borderRidus: '30%' }}
>
{index}
</span>
</div>
<ProDescriptions dataSource={dataSource} columns={columns} />
</div>
)}
</div>
) : null}
</>
);
};
...@@ -2,25 +2,31 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,25 +2,31 @@ import React, { useState, useEffect } from 'react';
import { ProDescriptions } from '@ant-design/pro-components'; import { ProDescriptions } from '@ant-design/pro-components';
import { Divider } from 'antd'; import { Divider } from 'antd';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { useRequest } from 'ahooks';
import DesItem from './DesItem';
export default (props) => { export default (props) => {
const { detailpath, params, columns } = props; const { type, detailpath, params, baseRow, basecolumns, title, titleno } = props;
const request = async () => { const request = useRequest(async () => {
const res = await doFetch({ url: detailpath, params }); let res = await doFetch({ url: detailpath, params });
console.log(res); return res?.data.data || {};
return { });
success: true,
data: res?.data?.data, console.log(request);
};
const selectType = {
gzbx: <DesItem index="0" dataSource={request?.data} title="基本信息" hidden={true} />,
}; };
return ( return (
<> <>
<div> <div>
<h3>单号</h3> <h2 style={{ fontWeight: 700 }}>
{title}{titleno}
</h2>
</div> </div>
<ProDescriptions request={request} columns={columns} /> <ProDescriptions columns={basecolumns} dataSource={request.data} />
<Divider /> <Divider />
{selectType['gzbx']}
</> </>
); );
}; };
...@@ -5,6 +5,7 @@ body, ...@@ -5,6 +5,7 @@ body,
#root { #root {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
.colorWeak { .colorWeak {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56 * @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-09 15:56:35 * @Last Modified time: 2022-12-12 14:29:17
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -476,7 +476,7 @@ function Model(props) { ...@@ -476,7 +476,7 @@ function Model(props) {
visible: true, visible: true,
title: '编辑', title: '编辑',
val: 'only', val: 'only',
type: 'add', type: 'edit',
item: row, item: row,
// detailpath: urlParams.detail, // detailpath: urlParams.detail,
// params: { id: row.id }, // params: { id: row.id },
...@@ -2109,6 +2109,51 @@ function Model(props) { ...@@ -2109,6 +2109,51 @@ function Model(props) {
}} }}
/> />
); );
case 'edit':
return (
<ExtendField
setDrawer={setDrawer}
drawer={drawer}
actionRef={actionRef}
columns={columns}
urlParams={urlParams}
formId={'2'}
onFinish={async (vals) => {
let equipmentCharReqList = [];
for (let i in vals) {
if (!isNaN(Number(i))) {
equipmentCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: drawer?.title == '编辑' ? drawer?.item?.id : '',
equipmentCharReqList,
};
//console.log(params, '!!!!');
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
if (drawer?.title == '编辑') {
message.success('编辑成功!');
} else {
message.success('新增成功!');
}
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
}}
/>
);
default: default:
return null; return null;
} }
......
...@@ -200,14 +200,6 @@ function getcolumns(setdrawer) { ...@@ -200,14 +200,6 @@ function getcolumns(setdrawer) {
title: '手机号码', title: '手机号码',
dataIndex: 'telephone', dataIndex: 'telephone',
key: 'telephone', key: 'telephone',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: { colProps: {
sm: 6, sm: 6,
}, },
......
...@@ -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-12-08 15:09:50 * @Last Modified time: 2022-12-12 15:01:27
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -41,43 +41,44 @@ function Supplier(props) { ...@@ -41,43 +41,44 @@ function Supplier(props) {
setDrawer((s) => ({ setDrawer((s) => ({
...s, ...s,
visible: true, visible: true,
detailpath: urlParams.detail, // detailpath: urlParams.detail,
params: { id: row?.id }, // params: { id: row?.id },
title: '编辑', title: '编辑',
val: 'only', val: 'only',
type: 'add', type: 'edit',
onFinish: async (vals) => { item: row,
let equipmentSupplierCharReqList = []; // onFinish: async (vals) => {
//console.log('id:', row.id); // let equipmentSupplierCharReqList = [];
for (let i in vals) { // //console.log('id:', row.id);
if (!isNaN(Number(i))) { // for (let i in vals) {
equipmentSupplierCharReqList.push({ // if (!isNaN(Number(i))) {
fieldId: i, // equipmentSupplierCharReqList.push({
fieldRealValue: vals[i], // fieldId: i,
}); // fieldRealValue: vals[i],
delete vals[i]; // });
} // delete vals[i];
} // }
let params = { // }
...vals, // let params = {
id: row?.id, // ...vals,
shopIdList: vals.shopId, // id: row?.id,
equipmentSupplierCharReqList, // shopIdList: vals.shopId,
}; // equipmentSupplierCharReqList,
delete params.shopId; // };
let res = await doFetch({ // delete params.shopId;
url: urlParams.save, // let res = await doFetch({
params, // url: urlParams.save,
}); // params,
if (res.code === '0000') { // });
message.success('编辑成功!'); // if (res.code === '0000') {
setDrawer((s) => ({ // message.success('编辑成功!');
...s, // setDrawer((s) => ({
visible: false, // ...s,
})); // visible: false,
actionRef.current.reload(); // }));
} // actionRef.current.reload();
}, // }
// },
})); }));
}, },
}} }}
...@@ -255,14 +256,6 @@ function Supplier(props) { ...@@ -255,14 +256,6 @@ function Supplier(props) {
title: '手机号码', title: '手机号码',
dataIndex: 'telephone', dataIndex: 'telephone',
key: 'telephone', key: 'telephone',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
}, },
{ {
title: '邮箱', title: '邮箱',
...@@ -333,6 +326,53 @@ function Supplier(props) { ...@@ -333,6 +326,53 @@ function Supplier(props) {
case 'add': case 'add':
return ( return (
<ExtendField <ExtendField
defaultFormValue={drawer?.item}
setDrawer={setDrawer}
drawer={drawer}
actionRef={actionRef}
columns={columns}
formId={'3'}
// urlParams={urlParams}
onFinish={async (vals) => {
let equipmentSupplierCharReqList = [];
for (let i in vals) {
if (!isNaN(Number(i))) {
equipmentSupplierCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: drawer?.title == '编辑' ? drawer?.item?.id : '',
equipmentSupplierCharReqList,
};
delete params.shopId;
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
if (drawer?.title == '编辑') {
message.success('编辑成功!');
} else {
message.success('新增成功!');
}
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
}}
/>
);
case 'edit':
return (
<ExtendField
// defaultFormValue={drawer?.item}
setDrawer={setDrawer} setDrawer={setDrawer}
drawer={drawer} drawer={drawer}
actionRef={actionRef} actionRef={actionRef}
...@@ -399,6 +439,7 @@ function Supplier(props) { ...@@ -399,6 +439,7 @@ function Supplier(props) {
visible: true, visible: true,
item: { item: {
status: 1, status: 1,
score: 0,
}, },
title: '新增', title: '新增',
detailpath: null, detailpath: null,
......
...@@ -97,6 +97,25 @@ function getcolumns(setdrawer) { ...@@ -97,6 +97,25 @@ function getcolumns(setdrawer) {
title: '报修单号', title: '报修单号',
dataIndex: 'repairNo', dataIndex: 'repairNo',
key: 'repairNo', key: 'repairNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'only',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.repairNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
......
...@@ -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-09 17:54:42 * @Last Modified time: 2022-12-12 13:22:33
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -107,6 +107,52 @@ function Failure(props) { ...@@ -107,6 +107,52 @@ function Failure(props) {
}); });
}, [activeTabKey]); }, [activeTabKey]);
const basecolumns = useMemo(() => {
if (activeTabKey == 1) {
return [
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '工单状态',
dataIndex: 'statusName',
key: 'statusName',
},
{
title: '维修单号',
dataIndex: 'repairOrderNo',
key: 'repairOrderNo',
},
];
} else {
return [
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '工单状态',
dataIndex: 'statusName',
key: 'statusName',
},
{
title: '维修单号',
dataIndex: 'repairOrderNo',
key: 'repairOrderNo',
},
{
title: '关单时间',
dataIndex: 'faultDescription',
key: 'faultDescription',
valueType: 'textarea',
},
];
}
}, [activeTabKey]);
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;
...@@ -120,7 +166,15 @@ function Failure(props) { ...@@ -120,7 +166,15 @@ function Failure(props) {
); );
case 'detail': case 'detail':
return ( return (
<Detail detailpath="/repair/umFailureRepair/queryById" params={{ id: drawer?.item.id }} /> <Detail
title="报修单号"
titleno={drawer?.item.repairNo}
detailpath="/repair/umFailureRepair/queryById"
params={{ id: drawer?.item.id }}
baseRow={drawer?.item}
basecolumns={basecolumns}
type="gzbx"
/>
); );
default: default:
break; break;
...@@ -131,7 +185,7 @@ function Failure(props) { ...@@ -131,7 +185,7 @@ function Failure(props) {
<AutoTable <AutoTable
pagetitle={<h3 className="page-title">故障报修</h3>} pagetitle={<h3 className="page-title">故障报修</h3>}
columns={columns} columns={columns}
path={pathconfig?.list || '/ngic-auth/sysUser/query/page'} path={pathconfig?.list}
actionRef={actionRef} actionRef={actionRef}
pageextra={pathconfig?.enableadd ? 'add' : null} pageextra={pathconfig?.enableadd ? 'add' : null}
resizeable={false} resizeable={false}
......
...@@ -8,6 +8,25 @@ function getcolumns(setdrawer) { ...@@ -8,6 +8,25 @@ function getcolumns(setdrawer) {
title: '维修单号', title: '维修单号',
dataIndex: 'repairOrderNo', dataIndex: 'repairOrderNo',
key: 'repairOrderNo', key: 'repairOrderNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'only',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.repairOrderNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -83,6 +102,25 @@ function getcolumns(setdrawer) { ...@@ -83,6 +102,25 @@ function getcolumns(setdrawer) {
title: '维修单号', title: '维修单号',
dataIndex: 'repairOrderNo', dataIndex: 'repairOrderNo',
key: 'repairOrderNo', key: 'repairOrderNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'only',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.repairOrderNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -158,6 +196,25 @@ function getcolumns(setdrawer) { ...@@ -158,6 +196,25 @@ function getcolumns(setdrawer) {
title: '维修单号', title: '维修单号',
dataIndex: 'repairOrderNo', dataIndex: 'repairOrderNo',
key: 'repairOrderNo', key: 'repairOrderNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'only',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.repairOrderNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
......
...@@ -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-09 17:39:38 * @Last Modified time: 2022-12-12 14:20:44
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -16,6 +16,7 @@ import { Dropdown, Menu, Button, message } from 'antd'; ...@@ -16,6 +16,7 @@ import { Dropdown, Menu, Button, message } from 'antd';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import OrderHandle from '../platform/RepairOrderHandle'; import OrderHandle from '../platform/RepairOrderHandle';
import getcolumns from './columns'; import getcolumns from './columns';
import Detail from '@/components/RepaireDetail/Detail';
function Failure(props) { function Failure(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -1043,6 +1044,57 @@ function Failure(props) { ...@@ -1043,6 +1044,57 @@ function Failure(props) {
); );
}; };
const basecolumns = useMemo(() => {
if (activeTabKey == 1) {
return [
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '工单状态',
dataIndex: 'statusName',
key: 'statusName',
},
{
title: '报修单号',
dataIndex: 'repairNo',
key: 'repairNo',
},
{
title: '最新维修人员',
dataIndex: 'repairNo',
key: 'repairNo',
},
];
} else {
return [
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '工单状态',
dataIndex: 'statusName',
key: 'statusName',
},
{
title: '维修单号',
dataIndex: 'repairOrderNo',
key: 'repairOrderNo',
},
{
title: '关单时间',
dataIndex: 'faultDescription',
key: 'faultDescription',
valueType: 'textarea',
},
];
}
}, [activeTabKey]);
const selectType = { const selectType = {
jd: <Recevive />, jd: <Recevive />,
pd: <disp />, pd: <disp />,
...@@ -1055,6 +1107,17 @@ function Failure(props) { ...@@ -1055,6 +1107,17 @@ function Failure(props) {
zzsh: <Rackaudit />, zzsh: <Rackaudit />,
wxsh: <Outaudit />, wxsh: <Outaudit />,
tdsh: <Backaudit />, tdsh: <Backaudit />,
detail: (
<Detail
title="维修单号"
titleno={drawer?.item?.repairNo}
detailpath="/repair/umRepairOperation/queryOperationList"
params={{ repairOrderId: drawer?.item?.id }}
baseRow={drawer?.item}
basecolumns={basecolumns}
type="wxgd"
/>
),
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
......
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