Commit 729e1d5e authored by TZW's avatar TZW

detail

parent fc3688a2
......@@ -26,6 +26,7 @@ let handlEmptyChild = (tree = []) => {
const Mtable = (props) => {
const {
headerTitle,
actionRef, //表格动作
formRef, //表单Ref
rowKey, // key
......@@ -42,7 +43,7 @@ const Mtable = (props) => {
resizeable = false,
dataSource,
} = props;
console.log(dataSource);
const actionRefs = actionRef ?? useRef(),
formRefs = formRef ?? useRef(),
ifspagination = pagination == 'false' || pagination === false,
......
import { ProDescriptions } from '@ant-design/pro-components';
import { Divider } from 'antd';
import React, { useState, useEffect } from 'react';
const DetailNode = (props) => {
const { data, index, columns, hasTable = false, operationType } = props;
console.log(props);
return (
<>
<div className="fault-detail">
<div style={{ flex: 1, display: 'flex', flexDirection: 'row' }}>
<div className="fault-index">{Number(index) + 1}</div>
<div style={{ display: 'flex', flexDirection: 'column' }}>
<label style={{ width: '80px', fontSize: 18, fontWeight: 600 }}>
{data?.operationTypeName}
</label>
<span>{data?.updateUserName}</span>
<span>{data?.updateTime}</span>
</div>
</div>
<div style={{ flex: 6 }}>
<div>
<h2 className="page-title" style={{ marginBottom: 16 }}>
{operationType == 0 ? '基础信息' : data?.operationTypeName}
</h2>
</div>
<ProDescriptions dataSource={data} columns={columns} />
{hasTable ? props.children : null}
<Divider />
</div>
</div>
</>
);
};
export default DetailNode;
/* eslint-disable react/jsx-key */
import { doFetch } from '@/utils/doFetch';
import { useRequest } from 'ahooks';
import { Divider } from 'antd';
import React, { useState, useEffect } from 'react';
import { ProDescriptions } from '@ant-design/pro-components';
import DetailNode from './detailnode';
import AutoTable from '../AutoTable/mtable';
const Detail = (props) => {
console.log(props);
const { path, params, titleColumns, detailKey, columns } = props;
let [firstcolumns, ...mescolumns] = titleColumns;
// columns?.forEach((it) => {
// if (it?.valueType == 'table') {
// tableColumns.push(it);
// } else {
// detailColumns.push(it);
// }
// });
const detailData = useRequest(async () => {
let res = await doFetch({ url: path, params });
return res?.data?.dataList;
});
console.log(columns);
return (
<>
<h2 style={{ fontWeight: 700, marginBottom: 16 }}>
{firstcolumns?.title}{detailData?.data?.[0]?.[firstcolumns?.dataIndex] || '--'}
</h2>
<ProDescriptions columns={mescolumns} dataSource={detailData?.data?.[0]} />
<Divider />
<div>
{detailData?.data?.map((it, index) => {
console.log(it);
const detailColumns = [],
tableColumns = [];
columns[it?.operationType]?.forEach((it) => {
if (it?.valueType == 'table') {
tableColumns.push(it);
} else {
detailColumns.push(it);
}
});
return (
<DetailNode
key={it?.id}
data={it}
index={index}
operationType={it?.operationType}
columns={detailColumns}
hasTable={true}
>
{tableColumns?.map((t) => {
return (
<div style={{ marginTop: 8, marginBottom: 8 }}>
<b>{t?.title}</b>
<AutoTable
dataSource={it[t?.key]}
columns={t?.columns}
style={{ marginTop: 8 }}
/>
</div>
);
})}
</DetailNode>
);
})}
</div>
</>
);
};
export default Detail;
......@@ -25,7 +25,7 @@ let Diyrule = (props) => {
defval?.other || {
noRuleCode: '',
sort: null,
formatType: 3,
formatType: null,
increaseList: [],
}
);
......@@ -34,7 +34,7 @@ let Diyrule = (props) => {
useEffect(() => {
onChange(defval);
});
console.log('other.sort :', other?.sort);
let { data, loading } = useRequest(() => {
return doFetch({ url: '/base/bmNoRule/querySelect', params: {} });
});
......@@ -520,9 +520,10 @@ let Diyrule = (props) => {
value={other?.sort}
options={Array.apply(null, { length: value ? value.length : 0 }).map((it, i) => ({
label: `第${i + 1}个`,
value: i + 2,
value: i + 1,
}))}
onChange={(val) => {
console.log('改变的val', val);
onChange({
value: value,
other: {
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-19 14:18:44
* @Last Modified time: 2023-01-18 15:25:43
*/
import * as React from 'react';
......
import dayjs from 'dayjs';
import { doFetch } from '@/utils/doFetch';
function getcolumns(setdrawer) {
return {
"pathconfig": {
"enableadd": false,
"enableedit": false,
"enabledelete": false,
"enabledetail": false,
"add": "",
"edit": "",
"list": "/repair/umRepairOrder/queryRepairOrderList",
"delete": "",
"detail": ""
},
"columns": [
{
"title": "维修单号",
"dataIndex": "repairOrderNo",
"key": "repairOrderNo"
},
{
"title": "设备编号",
"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"
}
]
};
columns: [
{
title: '保养单号',
dataIndex: 'taskNo',
key: 'taskNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
val: 'only',
title: '详细信息',
item: row,
}));
}}
>
{row?.maintainNo}
</a>
);
},
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '保养类型',
dataIndex: 'maintainTypeName',
key: 'maintainType',
valueType: 'select',
mode: 'radio',
options: [
{
label: '自主保养',
value: '1',
},
{
label: '专业保养',
value: '2',
},
],
},
{
title: '保养频次',
dataIndex: 'maintainFrequencyName',
key: 'maintainFrequency',
valueType: 'select',
mode: 'radio',
options: [
{
label: '周',
value: '0',
},
{
label: '月度',
value: '1',
},
{
label: '季度',
value: '2',
},
{
label: '半年',
value: '3',
},
{
label: '一年',
value: '4',
},
],
},
{
title: '保养截至日期',
dataIndex: 'planMaintainDate',
key: 'planMaintainDateList',
valueType: 'dateRange',
render: (text, row, _, action) => {
return (
<span
style={{
color: `${
dayjs(row.planMaintainDate).valueOf() < dayjs().format('YYYY-MM-DD').valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.planMaintainDate}
</span>
);
},
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/maintain/umMaintainTask/queryReceivingList',
delete: '',
detail: '',
},
};
}
export default getcolumns;
\ No newline at end of file
export default getcolumns;
This diff is collapsed.
......@@ -385,7 +385,7 @@ function getcolumns(setdrawer) {
add: '/maintain/umMaintainPlan/save',
edit: '/maintain/umMaintainPlan/save',
list: '/maintain/umMaintainPlan/queryList',
delete: '/maintain/umMaintainPlan/enableDeactivate',
delete: '/maintain/umMaintainPlan/deleteById',
detail: '/maintain/umMaintainPlan/queryById',
},
},
......@@ -564,7 +564,7 @@ function getcolumns(setdrawer) {
add: '/maintain/umMaintainPlan/save',
edit: '/maintain/umMaintainPlan/save',
list: '/maintain/umMaintainPlan/queryList',
delete: '/maintain/umMaintainPlan/enableDeactivate',
delete: '/maintain/umMaintainPlan/deleteById',
detail: '/maintain/umMaintainPlan/queryById',
},
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2023-01-16 15:35:00
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-17 11:35:36
* @Last Modified time: 2023-01-18 15:20:30
*/
import * as React from 'react';
......
This diff is collapsed.
import dayjs from 'dayjs';
const getcolumns = {
0: [
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '设备型号',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '保养类型',
dataIndex: 'maintainTypeName',
key: 'maintainType',
},
{
title: '保养频次',
dataIndex: 'maintainFrequencyName',
key: 'maintainFrequency',
},
{
title: '保养截止日期',
dataIndex: 'planMaintainDate',
key: 'planMaintainDateList',
},
{
title: '保养项目',
key: 'maintainTaskItemList',
valueType: 'table',
dataIndex: 'maintainTaskItemList',
columns: [
{
title: '保养项目',
dataIndex: 'maintainItemName',
key: 'maintainItemName',
},
{
title: '部位',
dataIndex: 'maintainPosition',
key: 'maintainPosition',
},
{
title: '保养方法',
dataIndex: 'maintainMethod',
key: 'maintainMethod',
},
],
},
],
1: [
{
title: '保养人员',
dataIndex: 'maintainUserName',
key: 'maintainUserName',
},
{
title: '接单时间',
dataIndex: 'maintainStartTime',
key: 'maintainStartTime',
},
],
2: [
{
title: '关单人员',
dataIndex: 'customsUserName',
key: 'customsUserName',
},
{
title: '强制关单时间',
dataIndex: 'offSingleDate',
key: 'offSingleDate',
},
],
3: [
{
title: '完成保养时间',
dataIndex: 'maintainEndTime',
key: 'maintainEndTime',
},
{
title: '保养项目',
key: 'maintainTaskItemList',
valueType: 'table',
dataIndex: 'maintainTaskItemList',
columns: [
{
title: '保养项目',
dataIndex: 'maintainItemName',
key: 'maintainItemName',
},
{
title: '部位',
dataIndex: 'maintainPosition',
key: 'maintainPosition',
},
{
title: '保养方法',
dataIndex: 'maintainMethod',
key: 'maintainMethod',
},
{
title: '结果',
dataIndex: 'judgeResultName',
key: 'judgeResultName',
},
{
title: '下限值',
dataIndex: 'lowerLimit',
key: 'lowerLimit',
},
{
title: '上限值',
dataIndex: 'upperLimit',
key: 'upperLimit',
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
},
],
},
{
title: '非寿命件消耗',
key: 'maintainTaskItemList',
valueType: 'table',
dataIndex: 'maintainTaskItemList',
columns: [
{
title: '备件料号',
dataIndex: 'sparePartNo',
key: 'sparePartNo',
},
{
title: '备件名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
},
{
title: '供应商编号',
dataIndex: 'supplierNo',
key: 'supplierNo',
},
{
title: '供应商名称',
dataIndex: 'supplierName',
key: 'supplierName',
},
{
title: '消耗数量',
dataIndex: 'remark',
key: 'remark',
},
],
},
{
title: '寿命件更换',
key: 'maintainTaskItemList',
valueType: 'table',
dataIndex: 'maintainTaskItemList',
columns: [
{
title: '备件料号',
dataIndex: 'sparePartNo',
key: 'sparePartNo',
},
{
title: '备件名称',
dataIndex: 'sparePartName',
key: 'sparePartName',
},
{
title: '供应商编号',
dataIndex: 'supplierNo',
key: 'supplierNo',
},
{
title: '供应商名称',
dataIndex: 'supplierName',
key: 'supplierName',
},
{
title: '安装部位',
dataIndex: 'remark',
key: 'remark',
},
{
title: '更换数量',
dataIndex: 'remark',
key: 'remark',
},
],
},
],
4: [
{
title: '验证人员',
dataIndex: 'reviewerName',
key: 'reviewerName',
},
{
title: '验证时间',
dataIndex: 'reviewerName',
key: 'reviewerName',
},
{
title: '验证结果',
dataIndex: 'reviewerName',
key: 'reviewerName',
},
{
title: '备注',
dataIndex: 'reviewerName',
key: 'reviewerName',
},
],
};
export default getcolumns;
This diff is collapsed.
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-11 19:37:17
* @Last Modified time: 2023-01-17 09:30:00
*/
import * as React from 'react';
......@@ -182,21 +182,6 @@ function Rules(props) {
onFinish: async (vals) => {
console.log('新增:', vals);
let params = { ...vals };
//console.log('vals:', vals);
// for (let i in vals) {
// if (i == 'nrList') {
// let reshow = {
// value: vals[i].filter((it) => it.noRuleCode != 'increasing_order'),
// other: vals[i].filter((it) => it.noRuleCode == 'increasing_order')[0] || {},
// };
// reshow.other.increaseList = reshow.other.increaseList.maps((it) => {
// return reshow.value.filter((item) => item.sort == it)[0].id;
// });
// reshow.other.sort =
// reshow.other.sort == 1 ? reshow.other.sort : reshow.other.sort - 1;
// //console.log('reshow', reshow);
// }
// }
params.nrList = [];
params.nrList = params.nrList.concat(vals?.nrList.value);
if (vals?.nrList.other.sort) {
......
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