1178232204@qq.com hace 3 años
padre
commit
1aaeb0f034

+ 13 - 0
src/api/request.js

@@ -115,14 +115,27 @@ const request = {
     getTableName:'/daqe-center/columnVerifyManagement/getTableName',//获取表名称
     addColumnVerify:'/daqe-center/columnVerifyManagement/addColumnVerify',//新增字段校验规则维护
     delColumnVerify:'/daqe-center/columnVerifyManagement/delColumnVerify',//删除字段校验规则维护
+    getByIdColumnVerify:'/daqe-center/columnVerifyManagement/getByIdColumnVerify',//字段校验规则维护详情
+    getAddUpColumnName:'/daqe-center/columnVerifyManagement/getAddUpColumnName',//新增修改下拉框获取数据库表中列数据字段名称信息
+    updateColumnVerify:'/daqe-center/columnVerifyManagement/updateColumnVerify',//修改
+    
     
     getColumnResultPage:'/daqe-center/columnResultManagement/getColumnResultPage',//字段校验问题明细列表
     getColumnResultNumber:'/daqe-center/columnResultManagement/getColumnResultNumber',//字段校验问题明细数量
+    dataCheck:'/daqe-center/columnResultManagement/dataCheck',//数据校验
+    updateColumnResult:'/daqe-center/columnResultManagement/updateColumnResult',//修改
     
+
     getBlockLossPage:'/daqe-center/blockLossManage/getBlockLossPage',//病历数据丢失明细列表
     upBlockLossById:'/daqe-center/blockLossManage/upBlockLossById',//病历数据丢失明细修改
+    dataCompare:'/daqe-center/blockLossManage/dataCompare',//数据对比
+    blockLossTypeGather:'/daqe-center/blockLossManage/blockLossTypeGather',//丢失量分类汇总
+    
 
     getRegularPage:'/daqe-center/regularManage/getRegularPage',//正则式维护列表
+    addRegular:'/daqe-center/regularManage/addRegular',//新增正则
+    upRegularById:'/daqe-center/regularManage/upRegularById',//修改正则
+    delRegularById:'/daqe-center/regularManage/delRegularById',//修改正则
     
 }
 

+ 84 - 24
src/components/BlockLossManage/editBlock.js

@@ -1,25 +1,57 @@
 import React, {
     useState, useEffect, useContext
 } from 'react';
-import { Form, Col, Select, Button, Radio, TreeSelect, message, Space, Input } from 'antd';
+import { Form, Col, DatePicker, Button, Radio, TreeSelect, message, Space, Input } from 'antd';
 import apiObj from '@api/index';
 import BlockContext from './block-context';
+import moment from "moment";
+import "moment/locale/zh-cn"
+const { RangePicker } = DatePicker;
 const { post, api, xPost } = apiObj;
 const { TextArea } = Input;
 function EditBlock(props) {
     useEffect(() => {
     }, []);
     const [form] = Form.useForm();
-    const { blockDetail } = useContext(BlockContext);
+    const { blockDetail, type } = useContext(BlockContext);
     const initialValues = blockDetail;
-
+    console.log(initialValues);
     const onFinish = values => {
-        let params = values
-        editBlock(params)
+        if (type == 1) {
+
+        } else if (type == 2) {
+            dataCompare(values)
+        } else {
+            editBlock(values)
+        }
 
     };
-    function editBlock(param) {
-        post(api.upBlockLossById, param).then((res) => {
+    function editBlock(values) {
+        let params = {
+            id: blockDetail.id,
+            isAudited: values.isAudited,
+            lossCause: values.lossCause
+        }
+        post(api.upBlockLossById, params).then((res) => {
+            if (res.data.code === 200) {
+                props.userChange()
+                message.success(res.data.message);
+                form.resetFields();
+            } else {
+                message.error(res.data.message);
+            }
+        })
+    }
+    //数据对比
+    function dataCompare(values) {
+        values.startDate = moment(values.time[0]).format('YYYY-MM-DD 00:00:00');
+        values.endDate = moment(values.time[1]).format('YYYY-MM-DD 23:23:59');
+        let params = {
+            behospitalCode: values.behospitalCode,
+            endDate: values.endDate,
+            startDate: values.startDate
+        }
+        post(api.dataCompare, params).then((res) => {
             if (res.data.code === 200) {
                 props.userChange()
                 message.success(res.data.message);
@@ -35,15 +67,15 @@ function EditBlock(props) {
     return (
         <>
             <Form
-                labelCol={{ span: 8 }}
+                labelCol={type == 3 ? { span: 8 } : { span: 4 }}
                 wrapperCol={{ span: 16 }}
                 form={form}
                 name="register"
-                layout="inline"
+                layout={type == 3 ? 'inline' : 'horizontal'}
                 onFinish={onFinish}
                 initialValues={initialValues}
             >
-                <Col span={12}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="behospitalCode"
                         label="住院序号"
@@ -51,7 +83,7 @@ function EditBlock(props) {
                         <span>{initialValues.behospitalCode}</span>
                     </Form.Item>
                 </Col>
-                <Col span={12}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="recId"
                         label="文书编号"
@@ -59,7 +91,7 @@ function EditBlock(props) {
                         <span>{initialValues.recId}</span>
                     </Form.Item>
                 </Col>
-                <Col span={12}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="recTitle"
                         label="文书标题"
@@ -67,33 +99,33 @@ function EditBlock(props) {
                         <span>{initialValues.recTitle}</span>
                     </Form.Item>
                 </Col>
-                <Col span={12}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="lossType"
                         label="丢失类型"
                     >
-                        <span>{initialValues.lossType}</span>
+                        <span>{initialValues.lossType == 0 ? '文书丢失' : initialValues.lossType == 1 ? '病案首页丢失' : initialValues.lossType == 2 ? '患者信息丢失' : ''}</span>
                     </Form.Item>
                 </Col>
-                <Col span={12}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="lossWay"
                         label="丢失途径"
                     >
-                        <span>{initialValues.lossWay}</span>
+                        <span>{initialValues.lossWay == 0 ? '外部丢失' : initialValues.lossWay == 1 ? '内部丢失' : ''}</span>
 
                     </Form.Item>
                 </Col>
-                <Col span={12}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="status"
                         label="状态"
                     >
-                        <span>{initialValues.status}</span>
+                        <span>{initialValues.status == 0 ? '已丢失' : initialValues.status == 1 ? '已恢复' : ''}</span>
 
                     </Form.Item>
                 </Col>
-                <Col span={24}>
+                <Col span={24} hidden={type != 3}>
                     <Form.Item
                         name="isAudited"
                         label="核查结果"
@@ -101,14 +133,13 @@ function EditBlock(props) {
                     >
                         <Radio.Group>
                             <Space size={70} >
-                                <Radio value={1}>核查通过</Radio>
-
-                                <Radio value={0}>核查未通过</Radio>
+                                <Radio value={'1'}>核查通过</Radio>
+                                <Radio value={'0'}>核查未通过</Radio>
                             </Space>
                         </Radio.Group>
                     </Form.Item>
                 </Col>
-                <Col span={24}>
+                <Col span={24} hidden={type != 3}>
                     <Form.Item
                         name="lossCause"
                         label="丢失原因"
@@ -119,7 +150,36 @@ function EditBlock(props) {
                         />
                     </Form.Item>
                 </Col>
-                <Form.Item wrapperCol={{ offset: 24, span: 16 }} style={{ marginTop: 15 }}>
+                <Col span={24} hidden={type == 3}>
+                    <Form.Item label="日期" name="time" rules={[{ required: true }]} labelAlign="right">
+                        <RangePicker
+                            placeholder={['开始时间', '结束时间']}
+                        />
+                    </Form.Item>
+                </Col>
+                <Col span={24} hidden={type == 3} style={{ marginTop: 15 }}>
+                    <Form.Item label="住院序号" name="behospitalCode">
+                        <Input placeholder="请输入" autoComplete='off' />
+                    </Form.Item>
+                </Col>
+                {
+                    type == 1 ?
+                        <div>
+                            提示:<br />
+                            1、补录时间范围限制为30天,每一天数据量的同步时间约为1分钟。<br />
+                            时间范围以患者入院时间为准。<br />
+                            2、当输入住院序号时,补录将不受时间范围限制。<br />
+                        </div>
+                        :
+                        type == 2 ?
+                            <div>
+                                提示:将比对所有【已丢失】状态数据和患者入院在时间范围内的数据。
+                            </div>
+                            : ''
+                }
+
+
+                <Form.Item wrapperCol={type == 3 ? { offset: 24, span: 16 } : { offset: 8, span: 16 }} style={{ marginTop: 15 }}>
                     <Space size="middle" >
                         <Button htmlType="button" onClick={e => cancel()}>
                             取消

+ 119 - 16
src/components/BlockLossManage/index.js

@@ -1,25 +1,27 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space } from 'antd';
-import { PlusOutlined } from '@ant-design/icons';
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
 import moment from "moment";
 import "moment/locale/zh-cn"
 import '@common/common.less';
+import './index.less'
 import apiObj from '@api/index';
 import EditBlock from './editBlock';
 import BlockContext from './block-context';
-import { message } from "antd/lib/index";
 const { post, api, xPost } = apiObj;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
 function BlockLossManage() {
     useEffect(() => {
         getBlockLossPage();
+        blockLossTypeGather()
     }, []);
     const [blockList, setBlockList] = useState([]);
     const [total, setTotal] = useState(0);
+    const [title, setTitle] = useState(0);
     const [visible, setVisible] = useState(false);
     const [size, setSize] = useState(15);
     const [current, setCurrent] = useState(1);
+    const [type, setType] = useState(null);
     const [blockDetail, setBlockDetail] = useState(null);//详情数据
     const [params, setParams] = useState({
         pages: 1,
@@ -37,17 +39,27 @@ function BlockLossManage() {
         post(api.getBlockLossPage, param || params).then((res) => {
             if (res.data.code === 200) {
                 const data = res.data.data;
-                console.log(123);
+                setBlockList(data.records);
+                setTotal(data.total)
+            }
+        })
+    }
+    //丢失量分类汇总
+    function blockLossTypeGather(startDate, endDate) {
+        post(api.blockLossTypeGather, { startDate: startDate || params.startDate, endDate: endDate || params.endDate }).then((res) => {
+            if (res.data.code === 200) {
+                const data = res.data.data;
                 setBlockList(data.records);
                 setTotal(data.total)
             }
         })
     }
     //修改
-    function showModal(row) {
-        console.log(row);
+    function showModal(title, row, type) {
         setVisible(true)
         setBlockDetail(row)
+        setTitle(title)
+        setType(type)
     }
     function onSizeChange(current, pageSize) {
         params.current = current
@@ -64,6 +76,29 @@ function BlockLossManage() {
         setCurrent(page)
         getBlockLossPage()
     }
+    const disabledDate = (current) => {
+        return current && current >= moment().endOf('day'); // 选择时间要大于等于当前天。若今天不能被选择,去掉等号即可。
+    }
+    const range = (start, end) => {
+        const result = [];
+        for (let i = start; i <= end; i++) {
+            result.push(i);
+        }
+        return result;
+    };
+    const disabledDateTime = (dates, partial) => {
+        let hours = moment().hours();//0~23
+        let minutes = moment().minutes();//0~59
+        let seconds = moment().seconds();//0~59
+        //当日只能选择当前时间之后的时间点
+        if (dates && moment(dates[1]).date() === moment().date() && partial == 'end') {
+            return {
+                disabledHours: () => range(hours + 1, 23),
+                disabledMinutes: () => range(minutes + 1, 59),
+                disabledSeconds: () => range(seconds + 1, 59),
+            };
+        }
+    }
     //返回
     function cancel() {
         setVisible(false)
@@ -78,6 +113,7 @@ function BlockLossManage() {
             value.startDate = moment(value.time[0]).format('YYYY-MM-DD 00:00:00');
             value.endDate = moment(value.time[1]).format('YYYY-MM-DD 23:23:59');
         }
+        delete value.time
         const param = {
             ...data,
             ...value,
@@ -85,6 +121,7 @@ function BlockLossManage() {
         setCurrent(1)
         setParams(param)
         getBlockLossPage(param);
+        blockLossTypeGather(value.startDate, value.endDate)
     };
     const onReset = () => {
         setCurrent(1)
@@ -98,23 +135,31 @@ function BlockLossManage() {
         { title: '文书编号', dataIndex: 'recId', key: 'recId' },
         { title: '文书标题', dataIndex: 'recTitle', key: 'recTitle' },
         { title: '丢失原因', dataIndex: 'lossCause', key: 'lossCause' },
-        { title: '丢失类型', dataIndex: 'lossType', key: 'lossType' },
-        { title: '丢失途径', dataIndex: 'lossWay', key: 'lossWay' },
+        {
+            title: '丢失类型', dataIndex: 'lossType', key: 'lossType', render: (text, record) => {
+                return (<span>{record.lossType == 0 ? '文书丢失' : record.lossType == 1 ? '病案首页丢失' : record.lossType == 2 ? '患者信息丢失' : ''}</span>);
+            }
+        },
+        {
+            title: '丢失途径', dataIndex: 'lossWay', key: 'lossWay', render: (text, record) => {
+                return (<span>{record.lossWay == 0 ? '外部丢失' : record.lossWay == 1 ? '内部丢失' : ''}</span>);
+            }
+        },
         { title: '更新时间', dataIndex: 'auditTime', key: 'auditTime' },
         {
             title: '状态', key: 'status', render: (text, record) => {
-                return (<span className={(record.status === '已恢复') ? 'Enable' : 'Disable'}>{record.status}</span>);
+                return (<span className={(record.status === '已恢复') ? 'Enable' : 'Disable'}>{record.status == 0 ? '已丢失' : record.status == 1 ? '已恢复' : ''}</span>);
             }
         },
         {
             title: '审核结果', key: 'isAudited', render: (text, record) => {
-                return (<span className={(record.isAudited === '未通过') ? 'delete' : (record.isAudited === '已通过') ? 'disable' : ''}>{record.isAudited}</span>);
+                return (<span className={(record.isAudited === '0') ? 'delete' : (record.isAudited === '1') ? 'disable' : ''}>{record.isAudited == 0 ? '未通过' : record.isAudited == 1 ? '已通过' : record.isAudited == 2 ? '未核查' : ''}</span>);
             }
         },
         {
             title: '操作', dataIndex: 'key', render: (text, record) => (
                 <Space size="middle">
-                    <a onClick={e => showModal(record)}>修改</a>
+                    <a onClick={e => showModal('修改病历数据块丢失明细', record, 3)}>修改</a>
                 </Space>
             )
         }
@@ -133,6 +178,8 @@ function BlockLossManage() {
                         <Col span={6} key={0}>
                             <Form.Item label="日期" name="time">
                                 <RangePicker
+                                    disabledDate={disabledDate} // 限制日期不可选
+                                    disabledTime={disabledDateTime}
                                     placeholder={['开始时间', '结束时间']}
                                 />
                             </Form.Item>
@@ -220,14 +267,70 @@ function BlockLossManage() {
                 <div className="table-header">
                     <h2 className="table-title">病历数据块丢失明细</h2>
                     <Space size="middle">
-                        <Button type="primary" icon={<PlusOutlined />} onClick={() => showModal(1)}>新增</Button>
+                        <Button type="primary" onClick={() => showModal('数据补录设置', { behospitalCode: '', time: '' }, 1)}>数据补录</Button>
+                        <Button type="primary" onClick={() => showModal('数据对比设置', { behospitalCode: '', time: '' }, 2)}>数据对比</Button>
                     </Space>
 
                 </div>
-
+                <div className="table-data">
+                    <Row className="data-box">
+                        <Col span={6} order={4} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={3} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={2} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={1} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                    </Row>
+                    <Row className="data-box">
+                        <Col span={6} order={4} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={3} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={2} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={1} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                    </Row>
+                    <Row className="data-box">
+                        <Col span={6} order={4} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={3} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={2} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                        <Col span={6} order={1} className="data-item">
+                            <p>1000</p>
+                            <p>His</p>
+                        </Col>
+                    </Row>
+                </div>
                 <Table
                     columns={columns}
-                    scroll={{ y: 'calc(100vh - 380px)' }}
+                    scroll={{ y: 'calc(100vh - 400px)' }}
                     dataSource={blockList}
                     rowKey={record => record.id}
                     pagination={{
@@ -244,7 +347,7 @@ function BlockLossManage() {
             </div>
             {visible && blockDetail ?
                 <Modal
-                    title='修改病历数据块丢失明细'
+                    title={title}
                     okText='确定'
                     cancelText='取消'
                     width="500px"
@@ -253,7 +356,7 @@ function BlockLossManage() {
                     footer={null}
                     forceRender={true}
                 >
-                    <BlockContext.Provider value={{ blockDetail }}>
+                    <BlockContext.Provider value={{ blockDetail, type }}>
                         <EditBlock userChange={userChange} />
                     </BlockContext.Provider>
 

+ 38 - 0
src/components/BlockLossManage/index.less

@@ -0,0 +1,38 @@
+.table-data {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 19px;
+  .data-box {
+    width: 380px;
+    height: 74px;
+    background: #ffffff;
+    box-shadow: 0px 2px 4px 0px rgba(208, 208, 208, 0.5);
+    border-radius: 2px;
+    border: 1px solid #e2e5ef;
+    .data-item{
+        display: flex;
+        flex-flow: column;
+        justify-content: center;
+        align-items: center;
+        & p{
+            margin-bottom: 0;
+        }
+    }
+    .data-item::after {
+        content: '';
+        display: block;
+        width: 6px;
+        height: 12px;
+        background: url(../../images/icon-right.png) no-repeat;
+        background-size: 6px 12px;
+        position: absolute;
+        right: 0;
+        top: 18px;
+    }
+    .data-item :first-child::after {
+        
+        display: none;
+       
+    }
+  }
+}

+ 236 - 0
src/components/FieldProblem/editProblem.js

@@ -0,0 +1,236 @@
+import React, {
+    useState, useEffect, useContext
+} from 'react';
+import { Form, Col, DatePicker, Button, Radio, TreeSelect, message, Space, Input } from 'antd';
+import apiObj from '@api/index';
+import BlockContext from './problem-context';
+import moment from "moment";
+import "moment/locale/zh-cn"
+const { RangePicker } = DatePicker;
+const { post, api, xPost } = apiObj;
+const { TextArea } = Input;
+function EditBlock(props) {
+    useEffect(() => {
+    }, []);
+    const [form] = Form.useForm();
+    const { problemDetail, type } = useContext(BlockContext);
+    const initialValues = problemDetail;
+    const onFinish = values => {
+        if (type == 1) {
+
+        } else if (type == 2) {
+            dataCompare(values)
+        } else {
+            editProblem(values)
+        }
+
+    };
+    function editProblem(values) {
+        let params = {
+            id: problemDetail.id,
+            description: values.description,
+        }
+        post(api.updateColumnResult, params).then((res) => {
+            if (res.data.code === 200) {
+                props.userChange()
+                message.success(res.data.message);
+                form.resetFields();
+            } else {
+                message.error(res.data.message);
+            }
+        })
+    }
+    //数据对比
+    function dataCompare(values) {
+        values.startDate = moment(values.time[0]).format('YYYY-MM-DD 00:00:00');
+        values.endDate = moment(values.time[1]).format('YYYY-MM-DD 23:23:59');
+        let params = {
+            behospitalCode: values.behospitalCode,
+            endDate: values.endDate,
+            startDate: values.startDate
+        }
+        post(api.dataCompare, params).then((res) => {
+            if (res.data.code === 200) {
+                props.userChange()
+                message.success(res.data.message);
+                form.resetFields();
+            } else {
+                message.error(res.data.message);
+            }
+        })
+    }
+    function cancel() {
+        props.userChange()
+    }
+    return (
+        <>
+            <Form
+                labelCol={type == 3 ? { span: 8 } : { span: 4 }}
+                wrapperCol={{ span: 16 }}
+                form={form}
+                name="register"
+                layout={type == 3 ? 'inline' : 'horizontal'}
+                onFinish={onFinish}
+                initialValues={initialValues}
+            >
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="behospitalCode"
+                        label="住院序号"
+                    >
+                        <span>{initialValues.behospitalCode}</span>
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="recId"
+                        label="文书编号"
+                    >
+                        <span>{initialValues.recId}</span>
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="recTitle"
+                        label="文书标题"
+                    >
+                        <span>{initialValues.recTitle}</span>
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="modeName"
+                        label="质控模块名称"
+                    >
+                        <span>{initialValues.modeName}</span>
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="tableCname"
+                        label="表名称(中文)"
+                    >
+                        <span>{initialValues.tableCname}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="tableEname"
+                        label="表名称(英文)"
+                    >
+                        <span>{initialValues.tableEname}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="columnCname"
+                        label="字段名称(中文)"
+                    >
+                        <span>{initialValues.columnCname}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="columnEname"
+                        label="字段名称(英文)"
+                    >
+                        <span>{initialValues.columnEname}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="tableVal"
+                        label="上传字段值"
+                    >
+                        <span>{initialValues.tableVal}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={12} hidden={type != 3}>
+                    <Form.Item
+                        name="type"
+                        label="问题类型"
+                    >
+                        <span>{initialValues.type == 1 ? "数据缺失" : initialValues.type == 2 ? "非标准值" : "正则校验失败"}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={24} hidden={type != 3}>
+                    <Form.Item
+                        name="status"
+                        label="状态"
+                    >
+                        <span>{initialValues.isSolved == 1 ? "已解决" : "未解决"}</span>
+
+                    </Form.Item>
+                </Col>
+                <Col span={24} hidden={type != 3}>
+                    <Form.Item
+                        name="isAudited"
+                        label="核查结果"
+                        wrapperCol={{ span: 18 }}
+                    >
+                        <Radio.Group>
+                            <Space size={70} >
+                                <Radio value={1}>核查通过</Radio>
+                                <Radio value={0}>核查未通过</Radio>
+                            </Space>
+                        </Radio.Group>
+                    </Form.Item>
+                </Col>
+                <Col span={24} hidden={type != 3}>
+                    <Form.Item
+                        name="description"
+                        label="备注"
+                        wrapperCol={{ span: 18 }}
+                    >
+                        <TextArea
+                            autoSize={{ minRows: 5, maxRows: 5 }}
+                        />
+                    </Form.Item>
+                </Col>
+                <Col span={24} hidden={type == 3}>
+                    <Form.Item label="日期" name="time" rules={[{ required: true }]} labelAlign="right">
+                        <RangePicker
+                            placeholder={['开始时间', '结束时间']}
+                        />
+                    </Form.Item>
+                </Col>
+                <Col span={24} hidden={type == 3} style={{ marginTop: 15 }}>
+                    <Form.Item label="住院序号" name="behospitalCode">
+                        <Input placeholder="请输入" autoComplete='off' />
+                    </Form.Item>
+                </Col>
+                {
+                    type == 1 ?
+                        <div>
+                            提示:<br />
+                            1、补录时间范围限制为30天,每一天数据量的同步时间约为1分钟。<br />
+                            时间范围以患者入院时间为准。<br />
+                            2、当输入住院序号时,补录将不受时间范围限制。<br />
+                        </div>
+                        :''
+                }
+
+
+                <Form.Item wrapperCol={type == 3 ? { offset: 24, span: 16 } : { offset: 8, span: 16 }} style={{ marginTop: 15 }}>
+                    <Space size="middle" >
+                        <Button htmlType="button" onClick={e => cancel()}>
+                            取消
+                        </Button>
+                        <Button type="primary" htmlType="submit">
+                            保存
+                        </Button>
+                    </Space>
+                </Form.Item>
+
+            </Form>
+        </>
+    );
+}
+
+export default EditBlock;

+ 89 - 140
src/components/FieldProblem/index.js

@@ -1,12 +1,13 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space } from 'antd';
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
 import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
 import { getCookie } from '@utils/index'
 import '@common/common.less';
+import moment from "moment";
+import "moment/locale/zh-cn"
 import apiObj from '@api/index';
-// import AddRules from './addRules';
-// import FiledContext from './filed-context';
-import { message } from "antd/lib/index";
+import EditProblem from './editProblem';
+import ProblemContext from './problem-context';
 const { post, api, xPost } = apiObj;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
@@ -22,6 +23,8 @@ function FieldProblem() {
     const [visible, setVisible] = useState(false);
     const [size, setSize] = useState(15);
     const [current, setCurrent] = useState(1);
+    const [problemDetail, setProblemDetail] = useState(null);//详情数据
+    const [title, setTitle] = useState();//正则式数据
     const [regularList, setRegularList] = useState([]);//正则式数据
     const [tableList, setTableList] = useState([]);//表名称
     const [colList, setColList] = useState([]);//字段名称
@@ -35,7 +38,7 @@ function FieldProblem() {
     let data = {
         pages: 1,
         current: 1,
-        size: size
+        size: size,
     }
     //表格数据
     function getColumnResultPage(param) {
@@ -66,68 +69,23 @@ function FieldProblem() {
             }
         })
     }
-    //获取字段名
-    function getColumnName(columnCname, columnEname) {
-        const param = {
-            columnCname: columnCname,
-            columnEname: columnEname
-        }
-        post(api.getColumnName, param).then((res) => {
-            if (res.data.code === 200) {
-                const data = res.data.data;
-                setColList([...data]);
-            }
-        })
-    }
-    //获取表名称
-    function getTableName(tableCname, tableEname) {
-        const param = {
-            tableCname: tableCname,
-            tableEname: tableEname
-        }
-        post(api.getTableName, param).then((res) => {
-            if (res.data.code === 200) {
-                const data = res.data.data;
-                setTableList([...data]);
-            }
-        })
-    }
-    //表名称搜索(中文)
-    function cnameSearch(val) {
-        getTableName(val, '')
-    }
-    //表名称搜索(英文)
-    function enameSearch(val) {
-        getTableName('', val)
-    }
-    //字段名称搜索(中文)
-    function colmeSearch(val) {
-        getColumnName(val, '')
-    }
-    //字段名称搜索(英文)
-    function coleneSearch(val) {
-        getColumnName('', val)
-    }
-    //正则式名称搜索
-    function onSearch(val) {
-        getRegular(val)
-    }
+    
 
-    //新增修改跳转
-    function showModal(type) {
-        setAddVisible(true)
+    //修改
+    function showModal(title, row, type) {
+        setVisible(true)
+        setProblemDetail(row)
+        setTitle(title)
         setType(type)
-        setFiledDetail({
-            columnList: [{
-                columnCname: "",
-                columnEname: "",
-                ableCname: "",
-                tableEname: ""
-            }],
-            standardValueList: [{
-                tit: ''
-            }]
-        })
+    }
+    //返回
+    function cancel() {
+        setVisible(false)
+        setProblemDetail(null)
+    }
+    function userChange() {
+        setVisible(false)
+        getColumnResultPage();
     }
     function onSizeChange(current, pageSize) {
         params.current = current
@@ -143,18 +101,13 @@ function FieldProblem() {
         setParams(params)
         setCurrent(page)
         getColumnResultPage()
-    }
-    //返回
-    function goBack() {
-        setAddVisible(false);
-        // setOrgDetail(null)
-        // getTableData();
-    }
-    //保存
-    function addSubFiled() {
-
     }
     const onFinish = (value) => {
+        if (value.time) {
+            value.solveTimeStart = moment(value.time[0]).format('YYYY-MM-DD 00:00:00');
+            value.solveTimeEnd = moment(value.time[1]).format('YYYY-MM-DD 23:23:59');
+        }
+        delete value.time
         const param = {
             ...data,
             ...value,
@@ -179,10 +132,14 @@ function FieldProblem() {
         { title: '表名称(英文)', dataIndex: 'tableEname', key: 'tableEname' },
         { title: '字段名称(中文)', dataIndex: 'columnCname', key: 'columnCname' },
         { title: '字段名称(英文)', dataIndex: 'columnEname', key: 'columnEname' },
-        { title: '上传字段值', dataIndex: 'optimizeCountSql', key: 'optimizeCountSql' },
-        { title: '备注', dataIndex: 'standardValue', key: 'standardValue' },
-        { title: '问题类型', dataIndex: 'regularName', key: 'regularName' },
-        { title: '更新时间', dataIndex: 'regularName', key: 'regularName' },
+        { title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal' },
+        { title: '备注', dataIndex: 'description', key: 'description' },
+        {
+            title: '问题类型', dataIndex: 'type', render: (text, record) => {
+                return record.type == 1 ? "数据缺失" : record.type == 2 ? "非标准值" : "正则校验失败";
+            }
+        },
+        { title: '更新时间', dataIndex: 'auditTime', key: 'auditTime' },
         {
             title: '状态', dataIndex: 'isRequired', key: 'isRequired', render: (text, record) => {
                 return record.isSolved == 1 ? "已解决" : "未解决";
@@ -191,19 +148,12 @@ function FieldProblem() {
         {
             title: '操作', dataIndex: 'key', render: (text, record) => (
                 <Space size="middle">
-                    <a >修改</a>
+                    <a onClick={e => showModal('修改字段校验问题明细', record, 3)}>修改</a>
                 </Space>
             )
         }
     ];
 
-    // if (addVisible && filedDetail) {
-    //     return (
-    //         <FiledContext.Provider value={{ type, save: addSubFiled, detail: filedDetail }}>
-    //             <AddRules back={goBack} />
-    //         </FiledContext.Provider>
-    //     )
-    // }
     return (
         <div className="wrapper">
             <div className="filter-box">
@@ -213,78 +163,59 @@ function FieldProblem() {
                     onFinish={onFinish}
                 >
                     <Row gutter={24}>
-                        <Col span={5} key={0}>
-                            <Form.Item label="表名称(中文)" name="tableCname">
-                                <Select showSearch allowClear onSearch={cnameSearch} placeholder="请选择">
-                                    {tableList.map((item) => {
-                                        return (
-                                            <Option value={item.tableCname} key={item.tableCname}>{item.tableCname}</Option>
-                                        )
-                                    })}
-                                </Select>
+                        <Col span={6} key={0}>
+                            <Form.Item label="日期" name="time">
+                                <RangePicker
+                                    placeholder={['开始时间', '结束时间']}
+                                />
                             </Form.Item>
                         </Col>
                         <Col span={5} key={1}>
-                            <Form.Item label="表名称(英文)" name="tableEname">
-                                <Select showSearch allowClear onSearch={enameSearch} placeholder="请选择">
-                                    {tableList.map((item) => {
-                                        return (
-                                            <Option value={item.tableEname} key={item.tableEname}>{item.tableEname}</Option>
-                                        )
-                                    })}
-                                </Select>
+                            <Form.Item label="住院序号" name="behospitalCode">
+                                <Input placeholder="请输入" autoComplete='off' />
                             </Form.Item>
                         </Col>
                         <Col span={5} key={2}>
-                            <Form.Item label="字段名称(中文)" name="columnCname">
-                                <Select showSearch allowClear onSearch={colmeSearch} placeholder="请选择">
-                                    {colList.map((item) => {
-                                        return (
-                                            <Option value={item.columnCname} key={item.columnCname}>{item.columnCname}</Option>
-                                        )
-                                    })}
-                                </Select>
+                            <Form.Item label="文书编号" name="recId">
+                                <Input placeholder="请输入" autoComplete='off' />
                             </Form.Item>
                         </Col>
                         <Col span={5} key={3}>
-                            <Form.Item label="字段名称(英文)" name="columnEname">
-                                <Select showSearch allowClear onSearch={coleneSearch} placeholder="请选择">
-                                    {colList.map((item) => {
-                                        return (
-                                            <Option value={item.columnEname} key={item.columnEname}>{item.columnEname}</Option>
-                                        )
-                                    })}
-                                </Select>
+                            <Form.Item label="文书标题" name="recTitle">
+                                <Input placeholder="请输入" autoComplete='off' />
                             </Form.Item>
                         </Col>
                         <Col span={5} key={4}>
-                            <Form.Item label="是否必填" name="isRequired">
+                            <Form.Item label="质控模块名称" name="modeName">
+                            <Input placeholder="请输入" autoComplete='off' />
+                            </Form.Item>
+                        </Col>
+                        <Col span={5} key={5}>
+                            <Form.Item label="问题类型" name="type">
                                 <Select
                                     placeholder="请选择"
                                     allowClear
                                 >
-                                    <Option value="1" key={1}>是</Option>
-                                    <Option value="0" key={0}>否</Option>
+                                    <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={5}>
-                            <Form.Item label="标准值" name="standardValue">
-                                <Input placeholder="请输入" autoComplete='off' />
-                            </Form.Item>
-                        </Col>
-                        <Col span={5} key={6}>
-                            <Form.Item label="正则名称" name="regularName">
-                                <Select showSearch allowClear onSearch={onSearch} placeholder="请选择">
-                                    {regularList.map((item) => {
-                                        return (
-                                            <Option value={item.name} key={item.id}>{item.name}</Option>
-                                        )
-                                    })}
+                        <Col span={5} key={7}>
+                            <Form.Item label="状态" name="isSolved">
+                                <Select
+                                    placeholder="请选择"
+                                    allowClear
+                                >
+                                    <Option value="" key={3}>全部</Option>
+                                    <Option value="0" key={0}>未处理</Option>
+                                    <Option value="1" key={1}>已处理</Option>
                                 </Select>
                             </Form.Item>
                         </Col>
-                        <Col span={6} key={7}>
+                        <Col span={4} key={8}>
                             <Form.Item>
                                 <Button type="primary" htmlType="submit">
                                     查询
@@ -300,16 +231,16 @@ function FieldProblem() {
 
             <div className="table">
                 <div className="table-header">
-                    <h2 className="table-title">职务职称变更记录</h2>
+                    <h2 className="table-title">字段校验问题明细</h2>
                     <Space size="middle">
-                        <Button type="primary" icon={<PlusOutlined />} onClick={() => showModal(1)}>新增</Button>
+                        <Button type="primary" onClick={() => showModal(1)}>数据校验</Button>
                     </Space>
 
                 </div>
 
                 <Table
                     columns={columns}
-                    scroll={{ y: 'calc(100vh - 380px)' }}
+                    scroll={{ y: 'calc(100vh - 400px)' }}
                     dataSource={logList}
                     rowKey={record => record.columnId}
                     pagination={{
@@ -324,6 +255,24 @@ function FieldProblem() {
                         total: total
                     }} />
             </div>
+
+            {visible && problemDetail ?
+                <Modal
+                    title={title}
+                    okText='确定'
+                    cancelText='取消'
+                    width="500px"
+                    visible={visible}
+                    onCancel={cancel}
+                    footer={null}
+                    forceRender={true}
+                >
+                    <ProblemContext.Provider value={{ problemDetail, type }}>
+                        <EditProblem userChange={userChange} />
+                    </ProblemContext.Provider>
+
+                </Modal>
+                : ''}
         </div >
     )
 }

+ 4 - 0
src/components/FieldProblem/problem-context.js

@@ -0,0 +1,4 @@
+import {createContext} from 'react';
+const ProblemContext = createContext(null);
+
+export default ProblemContext;

+ 51 - 53
src/components/FieldRules/addRules.js

@@ -58,9 +58,12 @@ function ContentForm(props) {
     const [regularList, setRegularList] = useState([]);//正则式数据
     const [tableList, setTableList] = useState([]);//表名称
     const [colList, setColList] = useState([]);//字段名称
-    const { detail } = useContext(FiledContext);
-    const { back, form,cancel } = props;
+    const [list, setList] = useState([]);
+    const [isChange, seIsChange] = useState(true);
+    const { type,detail } = useContext(FiledContext);
+    const { back, form, cancel } = props;
     const initialValues = detail
+    console.log(initialValues);
     const vilidateRules = {
         required: '${label}不能为空!',
     };
@@ -76,41 +79,36 @@ function ContentForm(props) {
             }
         })
     }
-    //获取字段名
-    function getColumnName(columnCname, columnEname) {
-        const param = {
-            columnCname: columnCname,
-            columnEname: columnEname
-        }
-        post(api.getColumnName, param).then((res) => {
+    function getAddUpColumnName() {
+        post(api.getAddUpColumnName).then((res) => {
             if (res.data.code === 200) {
                 const data = res.data.data;
-                setColList([...data]);
+                let columnList = []
+                data.forEach((item, i) => {
+                    item.getTableNameDTO.index = i
+                    columnList.push(item.getTableNameDTO)
+                });
+                setTableList(columnList);
+                setList(data)
             }
         })
     }
-    //获取表名称
-    function getTableName(tableCname, tableEname) {
-        const param = {
-            tableCname: tableCname,
-            tableEname: tableEname
-        }
-        post(api.getTableName, param).then((res) => {
-            if (res.data.code === 200) {
-                const data = res.data.data;
-                setTableList([...data]);
-            }
-        })
+    //表选择
+    function tablechange(value, options) {
+        let colList = list[options.key].getColumnNameDTOList
+        seIsChange(false)
+        setColList([...colList])
     }
+    //表字段添加
     function modifyData(i) {
         const formData = form.getFieldsValue();
         let columnList = formData.columnList;
         if (i == 0) {
             columnList.push({
-                columnCname: "",
-                columnEname: "",
-                ableCname: "",
-                tableEname: ""
+                columnCname: undefined,
+                columnEname: undefined,
+                ableCname: undefined,
+                tableEname: undefined
             })
         } else {
             columnList.splice(i, 1)
@@ -136,31 +134,15 @@ function ContentForm(props) {
             standardValueList: standardValueList
         });
     }
-
-    //表名称搜索(中文)
-    function cnameSearch(val) {
-        getTableName(val, '')
-    }
-    //表名称搜索(英文)
-    function enameSearch(val) {
-        getTableName('', val)
-    }
-    //字段名称搜索(中文)
-    function colmeSearch(val) {
-        getColumnName(val, '')
-    }
-    //字段名称搜索(英文)
-    function coleneSearch(val) {
-        getColumnName('', val)
-    }
     //正则式名称搜索
     function onSearch(val) {
         getRegular(val)
     }
     //正则式选择获取id
     function onChange(value, options) {
+        console.log(options);
         form.setFieldsValue({
-            regularId: options.key
+            regularId: options ? options.key : ''
         });
     }
     function handleSave() {
@@ -173,11 +155,18 @@ function ContentForm(props) {
     function addColumnVerify() {
         const formData = form.getFieldsValue();
         let arr = []
+        let url
         formData.standardValueList.forEach(it => {
             arr.push(it.tit)
         });
         formData.standardValueList = arr
-        post(api.addColumnVerify, formData).then((res) => {
+        if(type == 1){
+            url = api.addColumnVerify
+        }else{
+            url = api.updateColumnVerify
+            // formData.id = detail.columnId
+        }
+        post(url, formData).then((res) => {
             if (res.data.code === 200) {
                 message.success(res.data.message);
                 cancel()
@@ -188,13 +177,22 @@ function ContentForm(props) {
     }
     useEffect(() => {
         getRegular()
-        getTableName()
-        getColumnName()
+        getAddUpColumnName()
         if (detail) {
             const columnList = detail.columnList
             const standardValueList = detail.standardValueList
             setColumnList(columnList)
             setStandardValueList(standardValueList)
+            seIsChange(false)
+            list.forEach((item, i) => {
+                columnList.forEach(it => {
+                    if (item.getTableNameDTO.tableCname == it.tableCname) {
+                        let colList = list[i].getColumnNameDTOList
+                        setColList([...colList])
+                    }
+                });
+
+            });
         }
     }, []);
 
@@ -216,19 +214,19 @@ function ContentForm(props) {
                                     <div className='item'>
                                         <div className='item-box'>
                                             <Form.Item label="表名称(中文)" rules={[{ required: true }]} style={{ width: '50%' }} name={['columnList', i, 'tableCname']} labelAlign="right" >
-                                                <Select showSearch allowClear onSearch={cnameSearch} style={{ width: 160 }} placeholder="请选择">
+                                                <Select showSearch allowClear onChange={tablechange} style={{ width: 160 }} placeholder="请选择">
                                                     {tableList.map((item) => {
                                                         return (
-                                                            <Option value={item.tableCname} key={item.tableCname}>{item.tableCname}</Option>
+                                                            <Option value={item.tableCname} key={item.index}>{item.tableCname}</Option>
                                                         )
                                                     })}
                                                 </Select>
                                             </Form.Item>
                                             <Form.Item label="表名称(英文)" rules={[{ required: true }]} name={['columnList', i, 'tableEname']} labelAlign="right">
-                                                <Select showSearch allowClear onSearch={enameSearch} style={{ width: 160 }} placeholder="请选择">
+                                                <Select showSearch allowClear onChange={tablechange} style={{ width: 160 }} placeholder="请选择" >
                                                     {tableList.map((item) => {
                                                         return (
-                                                            <Option value={item.tableEname} key={item.tableEname}>{item.tableEname}</Option>
+                                                            <Option value={item.tableEname} key={item.index}>{item.tableEname}</Option>
                                                         )
                                                     })}
                                                 </Select>
@@ -236,7 +234,7 @@ function ContentForm(props) {
                                         </div>
                                         <div className='item-box'>
                                             <Form.Item label="字段名称(中文)" rules={[{ required: true }]} style={{ width: '50%' }} name={['columnList', i, 'columnCname']} labelAlign="right">
-                                                <Select showSearch allowClear onSearch={colmeSearch} style={{ width: 160 }} placeholder="请选择">
+                                                <Select showSearch allowClear style={{ width: 160 }} placeholder="请选择" disabled={isChange}>
                                                     {colList.map((item) => {
                                                         return (
                                                             <Option value={item.columnCname} key={item.columnCname}>{item.columnCname}</Option>
@@ -245,7 +243,7 @@ function ContentForm(props) {
                                                 </Select>
                                             </Form.Item>
                                             <Form.Item label="字段名称(英文)" rules={[{ required: true }]} name={['columnList', i, 'columnEname']} labelAlign="right">
-                                                <Select showSearch allowClear onSearch={coleneSearch} style={{ width: 160 }} placeholder="请选择">
+                                                <Select showSearch allowClear style={{ width: 160 }} placeholder="请选择" disabled={isChange}>
                                                     {colList.map((item) => {
                                                         return (
                                                             <Option value={item.columnEname} key={item.columnEname}>{item.columnEname}</Option>

+ 55 - 35
src/components/FieldRules/index.js

@@ -1,11 +1,10 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space } from 'antd';
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space,message } from 'antd';
 import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
 import '@common/common.less';
 import apiObj from '@api/index';
 import AddRules from './addRules';
 import FiledContext from './filed-context';
-import { message } from "antd/lib/index";
 const { post, api, xPost } = apiObj;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
@@ -129,19 +128,48 @@ function FieldRules() {
         setVisible(flag)
     }
     //新增修改跳转
-    function showModal(type) {
+    function showModal(type,id) {
         setAddVisible(true)
         setType(type)
-        setFiledDetail({
-            columnList: [{
-                columnCname: "",
-                columnEname: "",
-                ableCname: "",
-                tableEname: ""
-            }],
-            standardValueList: [{
-                tit: ''
-            }]
+        if(type == 1){
+            setFiledDetail({
+                columnList: [{
+                    columnCname: undefined,
+                    columnEname: undefined,
+                    ableCname: undefined,
+                    tableEname: undefined
+                }],
+                standardValueList: [{
+                    tit: ''
+                }]
+            })
+        }else{
+            getByIdColumnVerify(id)
+        }
+        
+    }
+    //详情
+    function getByIdColumnVerify(id){
+        const param = {
+            columnId: id,
+        }
+        post(api.getByIdColumnVerify, param).then((res) => {
+            if (res.data.code === 200) {
+                const data = res.data.data;
+                const arr ={
+                    columnList: [{
+                        columnCname: data.columnCname,
+                        columnEname: data.columnEname,
+                        tableCname: data.tableCname,
+                        tableEname: data.tableEname,
+                    }],
+                    standardValueList: [{
+                        tit: data.standardvalue,
+                    }],
+                    ...data
+                }
+                setFiledDetail(arr)
+            }
         })
     }
     function onSizeChange(current, pageSize) {
@@ -158,9 +186,6 @@ function FieldRules() {
         setParams(params)
         setCurrent(page)
         getColumnVerifyPage()
-    }
-    function onTypeChange() {
-
     }
     function onSelectChange(selectedRowKeys) {
         setSelectedRowKeys(selectedRowKeys);
@@ -168,12 +193,6 @@ function FieldRules() {
     //返回
     function goBack() {
         setAddVisible(false);
-        // setOrgDetail(null)
-        // getTableData();
-    }
-    //保存
-    function addSubFiled() {
-
     }
     const onFinish = (value) => {
         const param = {
@@ -201,13 +220,13 @@ function FieldRules() {
                 return record.isRequired == 1 ? "是" : "否";
             }
         },
-        { title: '标准值维护', dataIndex: 'standardValue', key: 'standardValue',width: 110 },
-        { title: '正则式名称', dataIndex: 'regularName', key: 'regularName',width: 110 },
-        { title: '说明', dataIndex: 'regularName', key: 'regularName' },
+        { title: '标准值维护', dataIndex: 'standardvalue', key: 'standardvalue',width: 110 },
+        { title: '正则式名称', dataIndex: 'regular', key: 'regular',width: 110 },
+        { title: '说明', dataIndex: 'description', key: 'description' },
         {
             title: '操作', dataIndex: 'key', render: (text, record) => (
                 <Space size="middle">
-                    <a >修改</a>
+                    <a onClick={() => showModal(2,record.columnId)}>修改</a>
                 </Space>
             )
         }
@@ -218,7 +237,7 @@ function FieldRules() {
     };
     if (addVisible && filedDetail) {
         return (
-            <FiledContext.Provider value={{ type, save: addSubFiled, detail: filedDetail }}>
+            <FiledContext.Provider value={{ type, detail: filedDetail }}>
                 <AddRules back={goBack} />
             </FiledContext.Provider>
         )
@@ -230,9 +249,10 @@ function FieldRules() {
                     form={form}
                     name="normal_login"
                     onFinish={onFinish}
+                    initialValues={{ lossType: '', lossWay: '', isRequired: '', regularName: '' }}
                 >
                     <Row gutter={24}>
-                        <Col span={5} key={0}>
+                        <Col span={6} key={0}>
                             <Form.Item label="表名称(中文)" name="tableCname">
                                 <Select showSearch allowClear onSearch={cnameSearch} placeholder="请选择">
                                     {tableList.map((item) => {
@@ -243,7 +263,7 @@ function FieldRules() {
                                 </Select>
                             </Form.Item>
                         </Col>
-                        <Col span={5} key={1}>
+                        <Col span={6} key={1}>
                             <Form.Item label="表名称(英文)" name="tableEname">
                                 <Select showSearch allowClear onSearch={enameSearch} placeholder="请选择">
                                     {tableList.map((item) => {
@@ -254,7 +274,7 @@ function FieldRules() {
                                 </Select>
                             </Form.Item>
                         </Col>
-                        <Col span={5} key={2}>
+                        <Col span={6} key={2}>
                             <Form.Item label="字段名称(中文)" name="columnCname">
                                 <Select showSearch allowClear onSearch={colmeSearch} placeholder="请选择">
                                     {colList.map((item) => {
@@ -265,7 +285,7 @@ function FieldRules() {
                                 </Select>
                             </Form.Item>
                         </Col>
-                        <Col span={5} key={3}>
+                        <Col span={6} key={3}>
                             <Form.Item label="字段名称(英文)" name="columnEname">
                                 <Select showSearch allowClear onSearch={coleneSearch} placeholder="请选择">
                                     {colList.map((item) => {
@@ -280,9 +300,9 @@ function FieldRules() {
                             <Form.Item label="是否必填" name="isRequired">
                                 <Select
                                     placeholder="请选择"
-                                    onChange={onTypeChange}
                                     allowClear
                                 >
+                                    <Option value="" key={2}>全部</Option>
                                     <Option value="1" key={1}>是</Option>
                                     <Option value="0" key={0}>否</Option>
                                 </Select>
@@ -320,7 +340,7 @@ function FieldRules() {
 
             <div className="table">
                 <div className="table-header">
-                    <h2 className="table-title">职务职称变更记录</h2>
+                    <h2 className="table-title">字段校验规则维护</h2>
                     <Space size="middle">
                         <Button type="primary" icon={<PlusOutlined />} onClick={() => showModal(1)}>新增</Button>
                         <Button type="primary" icon={<DeleteOutlined />} onClick={() => showDelModal(true)} danger>删除</Button>
@@ -331,7 +351,7 @@ function FieldRules() {
                 <Table
                     columns={columns}
                     rowSelection={rowSelection}
-                    scroll={{ y: 'calc(100vh - 380px)' }}
+                    scroll={{ y: 'calc(100vh - 400px)' }}
                     dataSource={logList}
                     rowKey={record => record.columnId}
                     pagination={{
@@ -347,7 +367,7 @@ function FieldRules() {
                     }} />
             </div>
             <Modal
-                title="删除职务职称变更记录"
+                title="删除字段校验规则"
                 okText='确定'
                 cancelText='取消'
                 width={400}

+ 81 - 0
src/components/RegularManage/addRegular.js

@@ -0,0 +1,81 @@
+import React, {
+    useState, useEffect, useContext
+} from 'react';
+import { Form, Col, DatePicker, Button, Radio, TreeSelect, message, Space, Input } from 'antd';
+import apiObj from '@api/index';
+import RegularContext from './regular-context';
+const { post, api, xPost } = apiObj;
+const { TextArea } = Input;
+function EditBlock(props) {
+    useEffect(() => {
+    }, []);
+    const [form] = Form.useForm();
+    const { regularDetail, type } = useContext(RegularContext);
+    const initialValues = regularDetail;
+    const onFinish = values => {
+        addRegular(values)
+    };
+    //添加
+    function addRegular(params) {
+        let url
+        if(type == 1){
+            url = api.addRegular
+        }else{
+            url = api.upRegularById
+            params.id= regularDetail.id
+        }
+        post(url, params).then((res) => {
+            if (res.data.code === 200) {
+                props.userChange()
+                message.success(res.data.message);
+                form.resetFields();
+            } else {
+                message.error(res.data.message);
+            }
+        })
+    }
+
+    function cancel() {
+        props.userChange()
+    }
+    return (
+        <>
+            <Form
+                labelCol={{ span: 6 }}
+                wrapperCol={{ span: 16 }}
+                form={form}
+                name="register"
+                layout='horizontal'
+                onFinish={onFinish}
+                initialValues={initialValues}
+            >
+                <Form.Item label="正则式名称" name="name" rules={[{ required: true }]}>
+                    <Input placeholder="请输入" autoComplete='off' />
+                </Form.Item>
+                <Form.Item label="正则式值" name="val" rules={[{ required: true }]}>
+                    <TextArea
+                        autoSize={{ minRows: 5, maxRows: 5 }}
+                    />
+                </Form.Item>
+                <Form.Item label="说明" name="description">
+                    <TextArea
+                        autoSize={{ minRows: 5, maxRows: 5 }}
+                    />
+                </Form.Item>
+                <Form.Item wrapperCol={{ offset: 8, span: 16 }} style={{ marginTop: 15 }}>
+                    <Space size="middle" >
+                        <Button htmlType="button" onClick={e => cancel()}>
+                            取消
+                        </Button>
+                        <Button type="primary" htmlType="submit">
+                            保存
+                        </Button>
+                    </Space>
+                </Form.Item>
+
+            </Form>
+        </>
+    );
+}
+
+export default EditBlock;

+ 71 - 32
src/components/RegularManage/index.js

@@ -4,8 +4,8 @@ import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
 import { getCookie } from '@utils/index'
 import '@common/common.less';
 import apiObj from '@api/index';
-// import AddRules from './addRules';
-// import FiledContext from './filed-context';
+import AddRegular from './addRegular';
+import RegularContext from './regular-context';
 import { message } from "antd/lib/index";
 const { post, api, xPost } = apiObj;
 const { RangePicker } = DatePicker;
@@ -14,17 +14,15 @@ function RegularManage() {
     useEffect(() => {
         getRegularPage();
     }, []);
-    const [addVisible, setAddVisible] = useState(false);         //新增页面显示
     const [regularList, setRegularList] = useState([]);
     const [total, setTotal] = useState(0);
+    const [title, setTitle] = useState(0);
     const [type, setType] = useState(0);//1新增 2修改
     const [visible, setVisible] = useState(false);
     const [selectedRowKeys, setSelectedRowKeys] = useState([]);
     const [size, setSize] = useState(15);
     const [current, setCurrent] = useState(1);
-    const [tableList, setTableList] = useState([]);//表名称
-    const [colList, setColList] = useState([]);//字段名称
-    const [filedDetail, setFiledDetail] = useState(null);//详情数据
+    const [regularDetail, setRegularDetail] = useState(null);//详情数据
     const [params, setParams] = useState({
         pages: 1,
         current: 1,
@@ -46,22 +44,38 @@ function RegularManage() {
             }
         })
     }
-
+    //删除弹窗确认
+    function showDelModal(flag) {
+        if (flag && !selectedRowKeys.length) {
+            message.warning("请先选择要删除的记录~", 1);
+            return;
+        }
+        setVisible(flag)
+    }
+    //删除记录
+    function delColumnVerify() {
+        post(api.delColumnVerify, { ids: selectedRowKeys }).then((res) => {
+            if (res.data.code === 200) {
+                //刷新列表
+                getRegularPage()
+                message.success(res.data.msg);
+            } else {
+                message.warning(res.data.msg || '操作失败,请重试~');
+            }
+        });
+        showDelModal(false);
+    }
     //新增修改跳转
-    function showModal(type) {
-        setAddVisible(true)
+    function showModal(title, type, record) {
+        setVisible(true)
+        setTitle(title)
         setType(type)
-        setFiledDetail({
-            columnList: [{
-                columnCname: "",
-                columnEname: "",
-                ableCname: "",
-                tableEname: ""
-            }],
-            standardValueList: [{
-                tit: ''
-            }]
-        })
+        setRegularDetail(record)
+    }
+    function cancel() { }
+    function userChange() {
+        setVisible(false)
+        getRegularPage();
     }
     function onSizeChange(current, pageSize) {
         params.current = current
@@ -108,19 +122,12 @@ function RegularManage() {
         {
             title: '操作', dataIndex: 'key', render: (text, record) => (
                 <Space size="middle">
-                    <a >修改</a>
+                    <a onClick={() => showModal('修改正则式', 2, record)}>修改</a>
                 </Space>
             )
         }
     ];
 
-    // if (addVisible && filedDetail) {
-    //     return (
-    //         <FiledContext.Provider value={{ type, save: addSubFiled, detail: filedDetail }}>
-    //             <AddRules back={goBack} />
-    //         </FiledContext.Provider>
-    //     )
-    // }
     return (
         <div className="wrapper">
             <div className="filter-box">
@@ -132,10 +139,10 @@ function RegularManage() {
                     <Row gutter={24}>
                         <Col span={5} key={0}>
                             <Form.Item label="正则式名称" name="name">
-                            <Input placeholder="用户名" autoComplete='off'/>
+                                <Input placeholder="请输入" autoComplete='off' />
                             </Form.Item>
                         </Col>
-            
+
                         <Col span={6} key={7}>
                             <Form.Item>
                                 <Button type="primary" htmlType="submit">
@@ -154,7 +161,8 @@ function RegularManage() {
                 <div className="table-header">
                     <h2 className="table-title">正则式维护</h2>
                     <Space size="middle">
-                        <Button type="primary" icon={<PlusOutlined />} onClick={() => showModal(1)}>新增</Button>
+                        <Button type="primary" icon={<PlusOutlined />} onClick={() => showModal('新增正则式', 1)}>新增</Button>
+                        <Button type="primary" icon={<DeleteOutlined />} onClick={() => showDelModal(true)} danger>删除</Button>
                     </Space>
 
                 </div>
@@ -164,7 +172,7 @@ function RegularManage() {
                     rowSelection={rowSelection}
                     scroll={{ y: 'calc(100vh - 380px)' }}
                     dataSource={regularList}
-                    rowKey={record => record.columnId}
+                    rowKey={record => record.id}
                     pagination={{
                         pageSize: size,
                         size: 'small',
@@ -177,6 +185,37 @@ function RegularManage() {
                         total: total
                     }} />
             </div>
+
+            {visible && regularDetail ?
+                <Modal
+                    title={title}
+                    okText='确定'
+                    cancelText='取消'
+                    width="500px"
+                    visible={visible}
+                    onCancel={cancel}
+                    footer={null}
+                    forceRender={true}
+                >
+                    <RegularContext.Provider value={{ regularDetail, type }}>
+                        <AddRegular userChange={userChange} />
+                    </RegularContext.Provider>
+
+                </Modal>
+                : ''}
+
+            <Modal
+                title="删除职务职称变更记录"
+                okText='确定'
+                cancelText='取消'
+                width={400}
+                visible={visible}
+                onOk={delColumnVerify}
+                /*confirmLoading={confirmLoading}*/
+                onCancel={() => showDelModal(false)}
+            >
+                <p>字段校验规则删除后将无法恢复,确认删除这{selectedRowKeys.length}条变更记录?</p>
+            </Modal>
         </div >
     )
 }

+ 4 - 0
src/components/RegularManage/regular-context.js

@@ -0,0 +1,4 @@
+import {createContext} from 'react';
+const RegularContext = createContext(null);
+
+export default RegularContext;

BIN
src/images/icon-right.png