增加待办弹窗
This commit is contained in:
parent
39133b3adc
commit
b62f972e18
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'dva';
|
import { connect } from 'dva';
|
||||||
import { initFilter } from '../../../utils/common';
|
import { initFilter } from '../../../utils/common';
|
||||||
import { Table, Row, Spin, Card } from 'antd';
|
import { Table, Row, Spin, Card, Modal } from 'antd';
|
||||||
|
|
||||||
class BI064FormRunAnalysis extends React.Component {
|
class BI064FormRunAnalysis extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -12,6 +12,55 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
loading: true,
|
loading: true,
|
||||||
tableData: [], // 处理后的表格数据
|
tableData: [], // 处理后的表格数据
|
||||||
columns: [], // 动态生成的列
|
columns: [], // 动态生成的列
|
||||||
|
scoreVisible: false,
|
||||||
|
scoreTitle: '',
|
||||||
|
standardScoreTemp: [],
|
||||||
|
scoreColumns: [
|
||||||
|
// {
|
||||||
|
// title: '序号',
|
||||||
|
// render: (text, record, index) => `${index + 1}`
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '待办名称',
|
||||||
|
dataIndex: 'NOTICE_TITLE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'USER_NAME',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '开始时间',
|
||||||
|
dataIndex: 'TASK_STARTDT',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '结束时间',
|
||||||
|
dataIndex: 'TASK_ENDDT',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '实际处理时间',
|
||||||
|
dataIndex: 'TASK_DT',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '处理状态',
|
||||||
|
dataIndex: 'NOTICE_STATUS',
|
||||||
|
render: (text, record) => {
|
||||||
|
const currentTime = new Date();
|
||||||
|
const endTime = new Date(record.TASK_ENDDT);
|
||||||
|
|
||||||
|
if (text == 1) {
|
||||||
|
return '正常完成';
|
||||||
|
} else if (text == 2) {
|
||||||
|
return '超时完成';
|
||||||
|
} else if (text == 0 && endTime >= currentTime) {
|
||||||
|
return '进行中';
|
||||||
|
} else if (text == 0 && endTime < currentTime) {
|
||||||
|
return '超期未完成';
|
||||||
|
} else {
|
||||||
|
return '未知状态';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +172,7 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
// 100
|
// 100
|
||||||
// ).toFixed(0)
|
// ).toFixed(0)
|
||||||
// : '0';
|
// : '0';
|
||||||
|
rowData[`${companyDataKey}_details`] = formData.details || []; // 假设返回数据中有details字段
|
||||||
rowData[`${companyDataKey}_total`] = formData.TOTAL_QTY;
|
rowData[`${companyDataKey}_total`] = formData.TOTAL_QTY;
|
||||||
rowData[`${companyDataKey}_normal`] = formData.NORMAL_FINISH;
|
rowData[`${companyDataKey}_normal`] = formData.NORMAL_FINISH;
|
||||||
rowData[`${companyDataKey}_overtime`] = formData.OVER_FINISH;
|
rowData[`${companyDataKey}_overtime`] = formData.OVER_FINISH;
|
||||||
@ -134,6 +183,8 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
rowData[`${companyDataKey}_normalRate`] = formData.NORMAL_RATE;
|
rowData[`${companyDataKey}_normalRate`] = formData.NORMAL_RATE;
|
||||||
} else {
|
} else {
|
||||||
// 如果没有数据,设置默认值
|
// 如果没有数据,设置默认值
|
||||||
|
// 如果没有数据,设置默认值
|
||||||
|
rowData[`${companyDataKey}_details`] = [];
|
||||||
rowData[`${companyDataKey}_total`] = 0;
|
rowData[`${companyDataKey}_total`] = 0;
|
||||||
rowData[`${companyDataKey}_normal`] = 0;
|
rowData[`${companyDataKey}_normal`] = 0;
|
||||||
rowData[`${companyDataKey}_overtime`] = 0;
|
rowData[`${companyDataKey}_overtime`] = 0;
|
||||||
@ -244,6 +295,11 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
key: `${companyDataKey}_total`,
|
key: `${companyDataKey}_total`,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
<a onClick={() => this.showDetail(record, 1, companyName)}>{record[`${companyDataKey}_total`]}</a>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '正常完成',
|
title: '正常完成',
|
||||||
@ -251,6 +307,11 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
key: `${companyDataKey}_normal`,
|
key: `${companyDataKey}_normal`,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
<a onClick={() => this.showDetail(record, 2, companyName)}>{record[`${companyDataKey}_normal`]}</a>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '超时完成',
|
title: '超时完成',
|
||||||
@ -258,6 +319,11 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
key: `${companyDataKey}_overtime`,
|
key: `${companyDataKey}_overtime`,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
<a onClick={() => this.showDetail(record, 3, companyName)}>{record[`${companyDataKey}_overtime`]}</a>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '进行中',
|
title: '进行中',
|
||||||
@ -265,6 +331,11 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
key: `${companyDataKey}_doing`,
|
key: `${companyDataKey}_doing`,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
<a onClick={() => this.showDetail(record, 4, companyName)}>{record[`${companyDataKey}_doing`]}</a>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '超期未完成',
|
title: '超期未完成',
|
||||||
@ -272,6 +343,13 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
key: `${companyDataKey}_overUnfinish`,
|
key: `${companyDataKey}_overUnfinish`,
|
||||||
width: '80px',
|
width: '80px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
<a onClick={() => this.showDetail(record, 5, companyName)}>
|
||||||
|
{record[`${companyDataKey}_overUnfinish`]}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '完成率',
|
title: '完成率',
|
||||||
@ -297,6 +375,54 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
|
|
||||||
return baseColumns;
|
return baseColumns;
|
||||||
};
|
};
|
||||||
|
showDetail = (record, type, companyName) => {
|
||||||
|
const currentTime = new Date();
|
||||||
|
const companyDataKey = companyName.replace(/\s+/g, '');
|
||||||
|
|
||||||
|
// 从record中获取该公司的明细数据
|
||||||
|
const details = record[`${companyDataKey}_details`] || [];
|
||||||
|
|
||||||
|
let filteredDetails = [];
|
||||||
|
switch (type) {
|
||||||
|
case 1: // 总任务数
|
||||||
|
filteredDetails = details;
|
||||||
|
break;
|
||||||
|
case 2: // 正常完成
|
||||||
|
filteredDetails = details.filter((item) => item.NOTICE_STATUS == 1);
|
||||||
|
break;
|
||||||
|
case 3: // 超时完成
|
||||||
|
filteredDetails = details.filter((item) => item.NOTICE_STATUS == 2);
|
||||||
|
break;
|
||||||
|
case 4: // 进行中
|
||||||
|
filteredDetails = details.filter((item) => item.NOTICE_STATUS == 0 && new Date(item.TASK_ENDDT) >= currentTime);
|
||||||
|
break;
|
||||||
|
case 5: // 超期未完成
|
||||||
|
filteredDetails = details.filter((item) => item.NOTICE_STATUS == 0 && new Date(item.TASK_ENDDT) < currentTime);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
filteredDetails = details;
|
||||||
|
}
|
||||||
|
|
||||||
|
const typeTitles = {
|
||||||
|
1: '总任务数',
|
||||||
|
2: '正常完成',
|
||||||
|
3: '超时完成',
|
||||||
|
4: '进行中',
|
||||||
|
5: '超期未完成',
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
standardScoreTemp: filteredDetails,
|
||||||
|
scoreVisible: true,
|
||||||
|
scoreTitle: `${companyName} - ${record.module} - ${record.form} 的${typeTitles[type]}明细`,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
clearScoreData = () => {
|
||||||
|
this.setState({
|
||||||
|
scoreVisible: false,
|
||||||
|
// standardScore: [],//newtmpData
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { tableData, columns, loading } = this.state;
|
const { tableData, columns, loading } = this.state;
|
||||||
@ -315,6 +441,23 @@ class BI064FormRunAnalysis extends React.Component {
|
|||||||
padding: '20px',
|
padding: '20px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<Modal
|
||||||
|
visible={this.state.scoreVisible}
|
||||||
|
title={this.state.scoreTitle}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={this.clearScoreData}
|
||||||
|
footer={null}
|
||||||
|
className="antd-modal-fullscreen"
|
||||||
|
closeModal={this.clearScoreData}
|
||||||
|
>
|
||||||
|
<Table
|
||||||
|
dataSource={this.state.standardScoreTemp}
|
||||||
|
columns={this.state.scoreColumns}
|
||||||
|
pagination={false}
|
||||||
|
bordered
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
<h1
|
<h1
|
||||||
style={{
|
style={{
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user