Commit d14b2459 authored by TZW's avatar TZW

111

parent 72fc86d5
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import dayjs from "dayjs"; import dayjs from 'dayjs';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return { return {
columns: [ columns: [
{ {
title: '点检单号', title: '点检单号',
dataIndex: 'taskNo', dataIndex: 'taskNo',
key: 'taskNo', key: 'taskNo',
hideInForm: false, hideInForm: false,
render: (text, row, _, action) => { render: (text, row, _, action) => {
return ( return (
<a <a
onClick={async () => { onClick={async () => {
let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } }); let res = await doFetch({
if (res.code == "0000") { url: '/check/umEquipmentCheckTask/queryDetails',
setdrawer((s) => ({ params: { id: row.id },
...s, });
open: true, if (res.code == '0000') {
val: 'detail', setdrawer((s) => ({
title: '详细信息', ...s,
item: { open: true,
...res?.data?.basics val: 'detail',
} title: '详细信息',
})); item: {
} ...res?.data?.basics,
}}
>
{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: {
dropdownMatchSelectWidth: 100
}
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
valueType: 'dateRange',
render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().format("YYYY-MM-DD").valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span>
} }
}, }}
>
{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',
},
], ],
pathconfig: { fieldProps: {
enableadd: false, dropdownMatchSelectWidth: 100,
enableedit: false, },
enabledelete: false, },
enabledetail: true, {
add: '', title: '点检截止日期',
edit: '', dataIndex: 'checkCloseDate',
list: '/check/umEquipmentCheckTask/queryCheckOrders', key: 'checkCloseDateList',
delete: '', valueType: 'dateRange',
detail: '', render: (text, row, _, action) => {
return (
<span
style={{
color: `${
dayjs(row.checkCloseDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).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;
import dayjs from "dayjs"; import dayjs from 'dayjs';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return [ return [
{
tab: '我的待办',
key: '1',
columns: [
{ {
tab: '我的待办', title: '点检单号',
key: '1', dataIndex: 'taskNo',
columns: [ key: 'taskNo',
{ hideInForm: true,
title: '点检单号', render: (text, row, _, action) => {
dataIndex: 'taskNo', return (
key: 'taskNo', <a
hideInForm: true, onClick={async () => {
render: (text, row, _, action) => { let res = await doFetch({
return ( url: '/check/umEquipmentCheckTask/queryDetails',
<a params: { id: row.id },
onClick={async () => { });
let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } }); if (res.code == '0000') {
if (res.code == "0000") { const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics;
const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics; setdrawer((s) => ({
setdrawer((s) => ({ ...s,
...s, open: true,
open: true, val: 'detail',
val: 'detail', title: '详细信息',
title: '详细信息', item: {
item: { task: {
task: { taskNo,
taskNo, createTime,
createTime, statusName,
statusName, planNo,
planNo, status,
status
},
...res?.data
}
}));
}
}}
>
{row?.taskNo}
</a>
);
}
},
{
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',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100
}
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
hideInForm: true,
valueType: 'dateRange',
render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().format("YYYY-MM-DD").valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span>
}
},
{
title: '接单时间',
dataIndex: 'checkStartTime',
key: 'checkStartTime',
hideInForm: true,
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',
}, },
{ ...res?.data,
label: '点检中', },
value: '2', }));
}, }
], }}
fieldProps: { >
dropdownMatchSelectWidth: 100 {row?.taskNo}
} </a>
}, );
], },
pathconfig: { },
enableadd: false, {
enableedit: false, title: '设备编号',
enabledelete: false, dataIndex: 'equipmentNo',
enabledetail: false, key: 'equipmentNo',
add: '', hideInForm: true,
edit: '', },
list: '/check/umEquipmentCheckTask/queryCheckUndone', {
delete: '', title: '设备名称',
detail: '', dataIndex: 'equipmentName',
key: 'equipmentName',
hideInForm: true,
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
hideInForm: true,
valueType: 'select',
options: [
{
label: '制造点检',
value: '1',
}, },
{
label: '设备点检',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100,
},
}, },
{ {
tab: '未完成', title: '点检截止日期',
key: '2', dataIndex: 'checkCloseDate',
columns: [ key: 'checkCloseDateList',
{ hideInForm: true,
title: '点检单号', valueType: 'dateRange',
dataIndex: 'taskNo', render: (text, row, _, action) => {
key: 'taskNo', return (
hideInForm: true, <span
render: (text, row, _, action) => { style={{
return ( color: `${
<a dayjs(row.checkCloseDate).valueOf() <
onClick={async () => { dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } }); ? '#f50'
if (res.code == "0000") { : 'rgba(0, 0, 0, 0.85)'
const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics; }`,
setdrawer((s) => ({ }}
...s, >
open: true, {row.checkCloseDate}
val: 'detail', </span>
title: '详细信息', );
item: { },
task: { },
taskNo, {
createTime, title: '接单时间',
statusName, dataIndex: 'checkStartTime',
planNo, key: 'checkStartTime',
status hideInForm: true,
}, hideInSearch: true,
...res?.data },
} {
})); title: '点检人员',
} dataIndex: 'checkUserName',
}} key: 'checkUserName',
> hideInForm: true,
{row?.taskNo} valueType: 'input',
</a> hideInSearch: true,
); },
} {
}, title: '状态',
{ dataIndex: 'statusName',
title: '设备编号', key: 'status',
dataIndex: 'equipmentNo', hideInForm: true,
key: 'equipmentNo', valueType: 'select',
hideInForm: true, options: [
}, {
{ label: '待接单',
title: '设备名称', value: '1',
dataIndex: 'equipmentName', },
key: 'equipmentName', {
hideInForm: true, label: '点检中',
}, value: '2',
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
hideInForm: true,
valueType: 'select',
options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100
}
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
hideInForm: true,
valueType: 'dateRange',
render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().format("YYYY-MM-DD").valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span>
}
},
{
title: '接单时间',
dataIndex: 'checkStartTime',
key: 'checkStartTime',
hideInForm: true,
hideInSearch: true,
},
{
title: '点检人员',
dataIndex: 'checkUserName',
key: 'checkUserId',
hideInSearch: false,
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysUser/selection',
params: {},
},
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '待接单',
value: '1',
},
{
label: '点检中',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100
}
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckUndoneAll',
delete: '',
detail: '',
}, },
],
fieldProps: {
dropdownMatchSelectWidth: 100,
},
}, },
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckUndone',
delete: '',
detail: '',
},
},
{
tab: '未完成',
key: '2',
columns: [
{ {
tab: '已完成', title: '点检单号',
key: '3', dataIndex: 'taskNo',
columns: [ key: 'taskNo',
{ hideInForm: true,
title: '点检单号', render: (text, row, _, action) => {
dataIndex: 'taskNo', return (
key: 'taskNo', <a
hideInForm: true, onClick={async () => {
render: (text, row, _, action) => { let res = await doFetch({
return ( url: '/check/umEquipmentCheckTask/queryDetails',
<a params: { id: row.id },
onClick={async () => { });
let res = await doFetch({ url: "/check/umEquipmentCheckTaskHis/queryDetails", params: { id: row.id } }); if (res.code == '0000') {
if (res.code == "0000") { const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics;
const { taskNo, createTime, statusName, planNo, endTime, status } = res?.data?.basics; setdrawer((s) => ({
let newArr = []; ...s,
if (row.status == 4) { open: true,
newArr = res?.data?.delay?.item?.map(it => { val: 'detail',
return { title: '详细信息',
...it, item: {
result: it.judgeType == 1 ? it.judgeResultQualitative : it.judgeResultRation task: {
} taskNo,
}); createTime,
} statusName,
setdrawer((s) => ({ planNo,
...s, status,
open: true,
val: 'detail',
title: '详细信息',
item: {
task: {
taskNo,
createTime,
statusName,
planNo,
endTime,
status: row.status
},
...res?.data,
delay: res?.data?.delay && {
...res?.data?.delay,
itemlist: newArr
}
}
}));
}
}}
>
{row?.taskNo}
</a>
);
}
},
{
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',
}, },
], ...res?.data,
fieldProps: { },
dropdownMatchSelectWidth: 100 }));
} }
}, }}
{ >
title: '点检截止日期', {row?.taskNo}
dataIndex: 'checkCloseDate', </a>
key: 'checkCloseDateList', );
hideInForm: true, },
valueType: 'dateRange', },
render: (text, row, _, action) => { {
return <span>{row.checkCloseDate}</span> title: '设备编号',
} dataIndex: 'equipmentNo',
}, key: 'equipmentNo',
{ hideInForm: true,
title: '接单时间', },
dataIndex: 'checkStartTime', {
key: 'checkStartTime', title: '设备名称',
hideInForm: true, dataIndex: 'equipmentName',
hideInSearch: true, key: 'equipmentName',
}, hideInForm: true,
{ },
title: '关单时间', {
dataIndex: 'endTime', title: '点检类型',
key: 'endDateList', dataIndex: 'checkTypeName',
hideInForm: true, key: 'checkType',
valueType: 'dateRange', hideInForm: true,
render: (text, row, _, action) => { valueType: 'select',
return <span>{row.endTime}</span> options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100,
},
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
hideInForm: true,
valueType: 'dateRange',
render: (text, row, _, action) => {
return (
<span
style={{
color: `${
dayjs(row.checkCloseDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.checkCloseDate}
</span>
);
},
},
{
title: '接单时间',
dataIndex: 'checkStartTime',
key: 'checkStartTime',
hideInForm: true,
hideInSearch: true,
},
{
title: '点检人员',
dataIndex: 'checkUserName',
key: 'checkUserId',
hideInSearch: false,
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysUser/selection',
params: {},
},
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '待接单',
value: '1',
},
{
label: '点检中',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100,
},
},
],
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,
render: (text, row, _, action) => {
return (
<a
onClick={async () => {
let res = await doFetch({
url: '/check/umEquipmentCheckTaskHis/queryDetails',
params: { id: row.id },
});
if (res.code == '0000') {
const { taskNo, createTime, statusName, planNo, endTime, status } =
res?.data?.basics;
let newArr = [];
if (row.status == 4) {
newArr = res?.data?.delay?.item?.map((it) => {
return {
...it,
result:
it.judgeType == 1 ? it.judgeResultQualitative : it.judgeResultRation,
};
});
} }
}, setdrawer((s) => ({
{ ...s,
title: '点检人员', open: true,
dataIndex: 'checkUserName', val: 'detail',
key: 'checkUserId', title: '详细信息',
hideInForm: true, item: {
valueType: 'select', task: {
options: { taskNo,
path: '/auth/sysUser/selection', createTime,
params: {}, statusName,
}, planNo,
fieldProps: { endTime,
placeholder: '请选择', status: row.status,
showSearch: true,
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '已关单',
value: '3',
}, },
{ ...res?.data,
label: '已完成', delay: res?.data?.delay && {
value: '4', ...res?.data?.delay,
itemlist: newArr,
}, },
{ },
label: '超时关单', }));
value: '5', }
}, }}
], >
fieldProps: { {row?.taskNo}
dropdownMatchSelectWidth: 100 </a>
} );
}, },
], },
pathconfig: { {
enableadd: false, title: '设备编号',
enableedit: false, dataIndex: 'equipmentNo',
enabledelete: false, key: 'equipmentNo',
enabledetail: false, hideInForm: true,
add: '', },
edit: '', {
list: '/check/umEquipmentCheckTaskHis/queryCheckCompleted', title: '设备名称',
delete: '', dataIndex: 'equipmentName',
detail: '', key: 'equipmentName',
hideInForm: true,
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
hideInForm: true,
valueType: 'select',
options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100,
},
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
hideInForm: true,
valueType: 'dateRange',
render: (text, row, _, action) => {
return <span>{row.checkCloseDate}</span>;
},
},
{
title: '接单时间',
dataIndex: 'checkStartTime',
key: 'checkStartTime',
hideInForm: true,
hideInSearch: true,
},
{
title: '关单时间',
dataIndex: 'endTime',
key: 'endDateList',
hideInForm: true,
valueType: 'dateRange',
render: (text, row, _, action) => {
return <span>{row.endTime}</span>;
},
},
{
title: '点检人员',
dataIndex: 'checkUserName',
key: 'checkUserId',
hideInForm: true,
valueType: 'select',
options: {
path: '/auth/sysUser/selection',
params: {},
},
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
},
{
title: '状态',
dataIndex: 'statusName',
key: 'status',
hideInForm: true,
valueType: 'select',
options: [
{
label: '已关单',
value: '3',
},
{
label: '已完成',
value: '4',
},
{
label: '超时关单',
value: '5',
}, },
],
fieldProps: {
dropdownMatchSelectWidth: 100,
},
}, },
]; ],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: false,
add: '',
edit: '',
list: '/check/umEquipmentCheckTaskHis/queryCheckCompleted',
delete: '',
detail: '',
},
},
];
} }
export default getcolumns; export default getcolumns;
...@@ -92,7 +92,8 @@ function getcolumns(setdrawer) { ...@@ -92,7 +92,8 @@ function getcolumns(setdrawer) {
<span <span
style={{ style={{
color: `${ color: `${
dayjs(row.planMaintainDate).valueOf() < dayjs().format('YYYY-MM-DD').valueOf() dayjs(row.planMaintainDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50' ? '#f50'
: 'rgba(0, 0, 0, 0.85)' : 'rgba(0, 0, 0, 0.85)'
}`, }`,
......
...@@ -412,7 +412,8 @@ function getcolumns(setdrawer) { ...@@ -412,7 +412,8 @@ function getcolumns(setdrawer) {
<span <span
style={{ style={{
color: `${ color: `${
dayjs(row.planMaintainDate).valueOf() < dayjs().format('YYYY-MM-DD').valueOf() dayjs(row.planMaintainDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50' ? '#f50'
: 'rgba(0, 0, 0, 0.85)' : 'rgba(0, 0, 0, 0.85)'
}`, }`,
......
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