|
@@ -1,6 +1,6 @@
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
|
|
|
|
-import { getCookie, disabledDate } from '@utils/index'
|
|
|
|
|
|
+import { useSelector, useDispatch } from 'react-redux';
|
|
|
|
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message, Spin } from 'antd';
|
|
import '@common/common.less';
|
|
import '@common/common.less';
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
import "moment/locale/zh-cn"
|
|
import "moment/locale/zh-cn"
|
|
@@ -8,22 +8,18 @@ import './index.less'
|
|
import apiObj from '@api/index';
|
|
import apiObj from '@api/index';
|
|
import EditProblem from './editProblem';
|
|
import EditProblem from './editProblem';
|
|
import ProblemContext from './problem-context';
|
|
import ProblemContext from './problem-context';
|
|
-import { getValueFromEvent } from '@utils/index'
|
|
|
|
|
|
+import { getValueFromEvent, disabledDate, getDaysBetween } from '@utils/index'
|
|
const { post, api, xPost } = apiObj;
|
|
const { post, api, xPost } = apiObj;
|
|
-const { RangePicker } = DatePicker;
|
|
|
|
const { Option } = Select;
|
|
const { Option } = Select;
|
|
function FieldProblem() {
|
|
function FieldProblem() {
|
|
- useEffect(() => {
|
|
|
|
- getColumnResultPage();
|
|
|
|
- getColumnResultNumber(date)
|
|
|
|
- getModeName()
|
|
|
|
- }, []);
|
|
|
|
|
|
+
|
|
const [logList, setLogList] = useState([]);
|
|
const [logList, setLogList] = useState([]);
|
|
const [total, setTotal] = useState(0);
|
|
const [total, setTotal] = useState(0);
|
|
const [type, setType] = useState(0);//1新增 2修改
|
|
const [type, setType] = useState(0);//1新增 2修改
|
|
const [visible, setVisible] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
const [size, setSize] = useState(15);
|
|
const [size, setSize] = useState(15);
|
|
const [current, setCurrent] = useState(1);
|
|
const [current, setCurrent] = useState(1);
|
|
|
|
+ const [loading, setLoading] = useState(false);
|
|
const [probleData, setProbleData] = useState({});
|
|
const [probleData, setProbleData] = useState({});
|
|
const [problemDetail, setProblemDetail] = useState(null);//详情数据
|
|
const [problemDetail, setProblemDetail] = useState(null);//详情数据
|
|
const [title, setTitle] = useState();//正则式数据
|
|
const [title, setTitle] = useState();//正则式数据
|
|
@@ -32,38 +28,55 @@ function FieldProblem() {
|
|
pages: 1,
|
|
pages: 1,
|
|
current: 1,
|
|
current: 1,
|
|
size: 15,
|
|
size: 15,
|
|
- asc:['isSolved'],
|
|
|
|
- desc: ['solveTime'],
|
|
|
|
|
|
+ asc: ['isSolved'],
|
|
|
|
+ desc: ['solveTime', 'behospitalCode'],
|
|
behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
|
|
behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
|
|
- behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
|
|
|
|
|
|
+ behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:59:59'
|
|
});
|
|
});
|
|
const [form] = Form.useForm();
|
|
const [form] = Form.useForm();
|
|
let data = {
|
|
let data = {
|
|
pages: 1,
|
|
pages: 1,
|
|
current: 1,
|
|
current: 1,
|
|
- size: size,
|
|
|
|
- asc:['isSolved'],
|
|
|
|
- desc: ['solveTime'],
|
|
|
|
|
|
+ size: 15,
|
|
|
|
+ asc: ['isSolved'],
|
|
|
|
+ desc: ['solveTime', 'behospitalCode'],
|
|
behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
|
|
behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
|
|
- behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
|
|
|
|
|
|
+ behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:59:59'
|
|
}
|
|
}
|
|
let date = {
|
|
let date = {
|
|
behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
|
|
behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
|
|
- behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
|
|
|
|
|
|
+ behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:59:59'
|
|
}
|
|
}
|
|
|
|
+ const { problemNum } = useSelector((state) => {
|
|
|
|
+ return state.userInfo;
|
|
|
|
+ });
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ setCurrent(1)
|
|
|
|
+ setSize(15)
|
|
|
|
+ setParams(data)
|
|
|
|
+ form.resetFields();
|
|
|
|
+ getColumnResultPage(data);
|
|
|
|
+ getColumnResultNumber(date)
|
|
|
|
+ getModeName()
|
|
|
|
+ }, [problemNum]);
|
|
//表格数据
|
|
//表格数据
|
|
function getColumnResultPage(param) {
|
|
function getColumnResultPage(param) {
|
|
|
|
+ const hide = message.loading('加载中...', 0);
|
|
post(api.getColumnResultPage, param || params).then((res) => {
|
|
post(api.getColumnResultPage, param || params).then((res) => {
|
|
|
|
+ hide()
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
const data = res.data.data;
|
|
const data = res.data.data;
|
|
setLogList(data.records);
|
|
setLogList(data.records);
|
|
setTotal(data.total)
|
|
setTotal(data.total)
|
|
|
|
+ setLoading(false)
|
|
}
|
|
}
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ hide()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
function getColumnResultNumber(param) {
|
|
function getColumnResultNumber(param) {
|
|
post(api.getColumnResultNumber, {
|
|
post(api.getColumnResultNumber, {
|
|
- hospitalId: getCookie('hospitalId'),
|
|
|
|
|
|
+ hospitalId: localStorage.getItem('hospitalId'),
|
|
...param
|
|
...param
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
@@ -85,7 +98,6 @@ function FieldProblem() {
|
|
function onSearch(val) {
|
|
function onSearch(val) {
|
|
getModeName(val)
|
|
getModeName(val)
|
|
}
|
|
}
|
|
- //修改
|
|
|
|
function showModal(title, row, type) {
|
|
function showModal(title, row, type) {
|
|
setVisible(true)
|
|
setVisible(true)
|
|
setProblemDetail(row)
|
|
setProblemDetail(row)
|
|
@@ -98,6 +110,9 @@ function FieldProblem() {
|
|
setProblemDetail(null)
|
|
setProblemDetail(null)
|
|
}
|
|
}
|
|
function userChange() {
|
|
function userChange() {
|
|
|
|
+ params.current = 1
|
|
|
|
+ setParams(params)
|
|
|
|
+ setCurrent(1)
|
|
setVisible(false)
|
|
setVisible(false)
|
|
getColumnResultPage();
|
|
getColumnResultPage();
|
|
getColumnResultNumber({ behospitalStartDate: params.behospitalStartDate, behospitalEndDate: params.behospitalEndDate })
|
|
getColumnResultNumber({ behospitalStartDate: params.behospitalStartDate, behospitalEndDate: params.behospitalEndDate })
|
|
@@ -109,7 +124,6 @@ function FieldProblem() {
|
|
setSize(pageSize)
|
|
setSize(pageSize)
|
|
setCurrent(current)
|
|
setCurrent(current)
|
|
setParams(params)
|
|
setParams(params)
|
|
- getColumnResultPage()
|
|
|
|
}
|
|
}
|
|
function changePage(page, pageSize) {
|
|
function changePage(page, pageSize) {
|
|
params.current = page
|
|
params.current = page
|
|
@@ -119,13 +133,18 @@ function FieldProblem() {
|
|
getColumnResultPage()
|
|
getColumnResultPage()
|
|
}
|
|
}
|
|
const onFinish = (value) => {
|
|
const onFinish = (value) => {
|
|
- if (value.time) {
|
|
|
|
- value.behospitalStartDate = moment(value.time[0]).format('YYYY-MM-DD 00:00:00');
|
|
|
|
- value.behospitalEndDate = moment(value.time[1]).format('YYYY-MM-DD 23:23:59');
|
|
|
|
|
|
+ value.behospitalStartDate = moment(value.behospitalStartDate).format('YYYY-MM-DD 00:00:00');
|
|
|
|
+ value.behospitalEndDate = moment(value.behospitalEndDate).format('YYYY-MM-DD 23:59:59');
|
|
|
|
+ if (value.behospitalStartDate > value.behospitalEndDate) {
|
|
|
|
+ message.warning('开始时间不能大于结束时间');
|
|
|
|
+ return
|
|
|
|
+ } else if (getDaysBetween(value.behospitalStartDate, value.behospitalEndDate) > 364) {
|
|
|
|
+ message.warning('开始时间与结束时间相差不能超过一年');
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- delete value.time
|
|
|
|
|
|
+ params.current = 1
|
|
const param = {
|
|
const param = {
|
|
- ...data,
|
|
|
|
|
|
+ ...params,
|
|
...value,
|
|
...value,
|
|
}
|
|
}
|
|
setCurrent(1)
|
|
setCurrent(1)
|
|
@@ -135,6 +154,7 @@ function FieldProblem() {
|
|
};
|
|
};
|
|
const onReset = () => {
|
|
const onReset = () => {
|
|
setCurrent(1)
|
|
setCurrent(1)
|
|
|
|
+ setSize(15)
|
|
setParams(data)
|
|
setParams(data)
|
|
form.resetFields();
|
|
form.resetFields();
|
|
getColumnResultPage(data);
|
|
getColumnResultPage(data);
|
|
@@ -152,8 +172,16 @@ function FieldProblem() {
|
|
const columns = [
|
|
const columns = [
|
|
{ title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },
|
|
{ title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },
|
|
{ title: '住院序号', dataIndex: 'behospitalCode', key: 'behospitalCode' },
|
|
{ title: '住院序号', dataIndex: 'behospitalCode', key: 'behospitalCode' },
|
|
- { title: '文书编号', dataIndex: 'hosptialDatatmpCode', key: 'hosptialDatatmpCode' },
|
|
|
|
- { title: '文书标题', dataIndex: 'hosptialDatatmpName', key: 'hosptialDatatmpName' },
|
|
|
|
|
|
+ {
|
|
|
|
+ title: '文书编号', dataIndex: 'hosptialDatatmpCode', key: 'hosptialDatatmpCode', render: (text, record) => {
|
|
|
|
+ return record.hosptialDatatmpCode || '-';
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '文书标题', dataIndex: 'hosptialDatatmpName', key: 'hosptialDatatmpName', render: (text, record) => {
|
|
|
|
+ return record.hosptialDatatmpName || '-';
|
|
|
|
+ }
|
|
|
|
+ },
|
|
{ title: '质控模块名称', dataIndex: 'modeName', key: 'modeName' },
|
|
{ title: '质控模块名称', dataIndex: 'modeName', key: 'modeName' },
|
|
{ title: '表名称(中文)', dataIndex: 'tableCname', key: 'tableCname' },
|
|
{ title: '表名称(中文)', dataIndex: 'tableCname', key: 'tableCname' },
|
|
{ title: '表名称(英文)', dataIndex: 'tableEname', key: 'tableEname' },
|
|
{ title: '表名称(英文)', dataIndex: 'tableEname', key: 'tableEname' },
|
|
@@ -161,7 +189,7 @@ function FieldProblem() {
|
|
{ title: '字段名称(英文)', dataIndex: 'columnEname', key: 'columnEname' },
|
|
{ title: '字段名称(英文)', dataIndex: 'columnEname', key: 'columnEname' },
|
|
{
|
|
{
|
|
title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal', render: (text, record) => {
|
|
title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal', render: (text, record) => {
|
|
- return record.tableVal || '-';
|
|
|
|
|
|
+ return record.tableVal ? record.tableVal.length > 8 ? <span title={record.tableVal}>{record.tableVal.substring(0, 8) + '...'}</span> : record.tableVal : '-';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -175,8 +203,8 @@ function FieldProblem() {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '更新时间', dataIndex: 'solveTime', key: 'solveTime', render: (text, record) => {
|
|
|
|
- return record.solveTime || '-';
|
|
|
|
|
|
+ title: '更新时间', dataIndex: 'gmtModified', key: 'gmtModified', render: (text, record) => {
|
|
|
|
+ return record.gmtModified || '-';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -201,59 +229,67 @@ function FieldProblem() {
|
|
name="normal_login"
|
|
name="normal_login"
|
|
onFinish={onFinish}
|
|
onFinish={onFinish}
|
|
initialValues={{
|
|
initialValues={{
|
|
- isSolved: '', type: '', time: [moment(getCurrentDataFront()), moment(getCurrentData())]
|
|
|
|
|
|
+ isSolved: '', type: '', behospitalStartDate: moment(getCurrentDataFront()), behospitalEndDate: moment(getCurrentData())
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
<Row gutter={24}>
|
|
<Row gutter={24}>
|
|
- <Col span={6} key={0}>
|
|
|
|
- <Form.Item label="日期" name="time">
|
|
|
|
- <RangePicker
|
|
|
|
- allowClear={false}
|
|
|
|
- disabledDate={disabledDate}
|
|
|
|
- placeholder={['开始时间', '结束时间']}
|
|
|
|
- />
|
|
|
|
|
|
+ <Col span={7} key={0}>
|
|
|
|
+ <Form.Item label="日期" >
|
|
|
|
+ <Form.Item name="behospitalStartDate" className='times'>
|
|
|
|
+ <DatePicker
|
|
|
|
+ allowClear={false}
|
|
|
|
+ disabledDate={disabledDate}
|
|
|
|
+ placeholder="请选择开始日期"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <span style={{ margin: '0 5px', position: 'relative', top: '2px' }}>-</span>
|
|
|
|
+ <Form.Item name="behospitalEndDate" className='times'>
|
|
|
|
+ <DatePicker
|
|
|
|
+ allowClear={false}
|
|
|
|
+ disabledDate={disabledDate}
|
|
|
|
+ placeholder="请选择结束日期"
|
|
|
|
+ />
|
|
|
|
+ </Form.Item>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={1}>
|
|
<Col span={5} key={1}>
|
|
<Form.Item label="住院序号" name="behospitalCode" getValueFromEvent={getValueFromEvent}>
|
|
<Form.Item label="住院序号" name="behospitalCode" getValueFromEvent={getValueFromEvent}>
|
|
- <Input placeholder="住院序号" autoComplete='off' allowClear maxLength='30' />
|
|
|
|
|
|
+ <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30' />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={2}>
|
|
<Col span={5} key={2}>
|
|
<Form.Item label="文书编号" name="hosptialDatatmpCode" getValueFromEvent={getValueFromEvent}>
|
|
<Form.Item label="文书编号" name="hosptialDatatmpCode" getValueFromEvent={getValueFromEvent}>
|
|
- <Input placeholder="文书编号" autoComplete='off' allowClear maxLength='30' />
|
|
|
|
|
|
+ <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30' />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={3}>
|
|
<Col span={5} key={3}>
|
|
<Form.Item label="文书标题" name="hosptialDatatmpName" getValueFromEvent={getValueFromEvent}>
|
|
<Form.Item label="文书标题" name="hosptialDatatmpName" getValueFromEvent={getValueFromEvent}>
|
|
- <Input placeholder="文书标题" autoComplete='off' allowClear maxLength='30' />
|
|
|
|
- </Form.Item>
|
|
|
|
- </Col>
|
|
|
|
- <Col span={5} key={4}>
|
|
|
|
- <Form.Item label="质控模块名称" name="modeName" >
|
|
|
|
- <Select showSearch allowClear onSearch={onSearch} placeholder="请选择">
|
|
|
|
- {modeList.map((item, i) => {
|
|
|
|
- return (
|
|
|
|
- <Option value={item} key={i}>{item}</Option>
|
|
|
|
- )
|
|
|
|
- })}
|
|
|
|
- </Select>
|
|
|
|
|
|
+ <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30' />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Col>
|
|
</Col>
|
|
- <Col span={5} key={5}>
|
|
|
|
- <Form.Item label="问题类型" name="type">
|
|
|
|
- <Select
|
|
|
|
- placeholder="请选择"
|
|
|
|
- allowClear
|
|
|
|
- >
|
|
|
|
- <Option value="" key={0}>全部</Option>
|
|
|
|
- <Option value="1" key={1}>数据缺失</Option>
|
|
|
|
- <Option value="2" key={2}>非标准值</Option>
|
|
|
|
- <Option value="3" key={3}>正则校验失败</Option>
|
|
|
|
- </Select>
|
|
|
|
- </Form.Item>
|
|
|
|
- </Col>
|
|
|
|
- <Col span={5} key={7}>
|
|
|
|
|
|
+ <Form.Item label="质控模块名称" name="modeName" >
|
|
|
|
+ <Select showSearch allowClear onSearch={onSearch} placeholder="请选择" style={{ width: '159px' }}>
|
|
|
|
+ {modeList.map((item, i) => {
|
|
|
|
+ return (
|
|
|
|
+ <Option value={item} key={i}>{item}</Option>
|
|
|
|
+ )
|
|
|
|
+ })}
|
|
|
|
+ </Select>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Form.Item label="问题类型" name="type" style={{ marginLeft: '15px' }}>
|
|
|
|
+ <Select
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ allowClear
|
|
|
|
+ style={{ width: '159px' }}
|
|
|
|
+ >
|
|
|
|
+ <Option value="" key={0}>全部</Option>
|
|
|
|
+ <Option value="1" key={1}>数据缺失</Option>
|
|
|
|
+ <Option value="2" key={2}>非标准值</Option>
|
|
|
|
+ <Option value="3" key={3}>正则校验失败</Option>
|
|
|
|
+ </Select>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Col span={4} key={7}>
|
|
<Form.Item label="状态" name="isSolved">
|
|
<Form.Item label="状态" name="isSolved">
|
|
<Select
|
|
<Select
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
@@ -283,7 +319,7 @@ function FieldProblem() {
|
|
<div className="table-header">
|
|
<div className="table-header">
|
|
<h2 className="table-title">字段校验问题明细</h2>
|
|
<h2 className="table-title">字段校验问题明细</h2>
|
|
<Space size="middle">
|
|
<Space size="middle">
|
|
- <Button type="primary" onClick={() => showModal('数据校验设置', { behospitalCode: '', time: '' }, 1)}>数据校验</Button>
|
|
|
|
|
|
+ <Button type="primary" onClick={() => showModal('数据校验设置', { behospitalCode: '', startDate: null,endDate:null }, 1)}>数据校验</Button>
|
|
</Space>
|
|
</Space>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -341,6 +377,7 @@ function FieldProblem() {
|
|
total: total,
|
|
total: total,
|
|
showQuickJumper:true,
|
|
showQuickJumper:true,
|
|
}} />
|
|
}} />
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{visible && problemDetail ?
|
|
{visible && problemDetail ?
|