Browse Source

问题修改

1178232204@qq.com 3 năm trước cách đây
mục cha
commit
58de1cb6ff

+ 3 - 3
src/api/index.js

@@ -2,7 +2,7 @@ import api from './request';
 import { getCookie,setCookie } from '@utils/index'
 import { Modal } from 'antd';
 const axios=require('axios');
-axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
+//axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
 const CancelToken = axios.CancelToken;
 const source = CancelToken.source();
 const post=(url,data)=>{
@@ -47,8 +47,8 @@ function interceptors(){
 //拦截所有请求添加token
     axios.interceptors.request.use(function (config) {
         const tokenStr = localStorage.getItem('token');
-        const sysId = getCookie('systemId');
-        const hisId = getCookie('hospitalId');
+        const sysId = localStorage.getItem('systemId');
+        const hisId = localStorage.getItem('hospitalId');
 	    const isOverTime = localStorage.getItem("overTime");
         if(isOverTime){
 		  config.cancelToken = source.token;

+ 19 - 5
src/components/BlockLossManage/editBlock.js

@@ -18,6 +18,7 @@ function EditBlock(props) {
     }, []);
     const [form] = Form.useForm();
     const [dates, setDates] = useState([]);
+    const [disable, setDisable] = useState(true);
     const [limit, setLimit] = useState(false);
     const { blockDetail, type } = useContext(BlockContext);
     const initialValues = blockDetail;
@@ -31,7 +32,16 @@ function EditBlock(props) {
         }
 
     };
+    function onChange(e) {
+        const formData = form.getFieldsValue();
+        if (formData.behospitalCode || formData.time != '') {
+            setDisable(false)
+        } else {
+            setDisable(true)
+        }
+    }
     function change(e) {
+        const formData = form.getFieldsValue();
         const { value } = e.target;
         if (type == 1) {
             if (value) {
@@ -40,7 +50,11 @@ function EditBlock(props) {
                 setLimit(false)
             }
         }
-
+        if (formData.behospitalCode || formData.time != '') {
+            setDisable(false)
+        } else {
+            setDisable(true)
+        }
     }
     function editBlock(values) {
         let params = {
@@ -211,6 +225,7 @@ function EditBlock(props) {
                                 placeholder={['开始时间', '结束时间']}
                                 disabledDate={disabledDate}
                                 onCalendarChange={val => setDates(val)}
+                                onChange={onChange}
                             />
                         </Form.Item>
                         : ''}
@@ -224,14 +239,13 @@ function EditBlock(props) {
                     type == 1 ?
                         <div style={{ color: '#1690FF' }}>
                             提示:<br />
-                            1、补录时间范围限制为30天,每一天数据量的同步时间约为1分钟。<br />
-                            时间范围以患者入院时间为准。<br />
+                            1、数据补录时间较长,请耐心等待。<br />
                             2、当输入住院序号时,补录将不受时间范围限制。<br />
                         </div>
                         :
                         type == 2 ?
                             <div style={{ color: '#1690FF' }}>
-                                提示:将比对所有【已丢失】状态数据和患者入院在时间范围内的数据
+                                提示:当输入住院序号时,对比将不受时间范围限制
                             </div>
                             : ''
                 }
@@ -240,7 +254,7 @@ function EditBlock(props) {
                         <Button htmlType="button" onClick={e => cancel()}>
                             取消
                         </Button>
-                        <Button type="primary" htmlType="submit">
+                        <Button type="primary" htmlType="submit" disabled={disable}>
                             {type == 3 ? '保存' : '确定'}
                         </Button>
                     </Space>

+ 27 - 12
src/components/FieldProblem/editProblem.js

@@ -15,6 +15,7 @@ function EditBlock(props) {
     }, []);
     const [form] = Form.useForm();
     const [dates, setDates] = useState([]);
+    const [disable, setDisable] = useState(true);
     const [limit, setLimit] = useState(false);
     const { problemDetail, type } = useContext(BlockContext);
     const initialValues = problemDetail;
@@ -26,13 +27,27 @@ function EditBlock(props) {
         }
 
     };
+    function onChange(e) {
+        const formData = form.getFieldsValue();
+        if (formData.behospitalCode || formData.time != '') {
+            setDisable(false)
+        } else {
+            setDisable(true)
+        }
+    }
     function change(e) {
+        const formData = form.getFieldsValue();
         const { value } = e.target;
         if (value) {
             setLimit(true)
         } else {
             setLimit(false)
         }
+        if (formData.behospitalCode || formData.time != '') {
+            setDisable(false)
+        } else {
+            setDisable(true)
+        }
     }
     function editProblem(values) {
         let params = {
@@ -57,7 +72,7 @@ function EditBlock(props) {
             behospitalCode: values.behospitalCode,
             dateEnd: values.endDate,
             dateStart: values.startDate,
-            isPlacefile:getCookie('isPlacefile')
+            isPlacefile: getCookie('isPlacefile')
         }
         post(api.dataCheck, params).then((res) => {
             if (res.data.code === 200) {
@@ -75,12 +90,12 @@ function EditBlock(props) {
         }
         const tooLate = dates[0] && current.diff(dates[0], 'days') > 29;
         const tooEarly = dates[1] && dates[1].diff(current, 'days') > 29;
-        if(!limit){
+        if (!limit) {
             return current && current >= moment().endOf('day') || tooEarly || tooLate;
-        }else{
+        } else {
             return current && current >= moment().endOf('day');
         }
-        
+
     };
     function cancel() {
         props.cancel()
@@ -198,7 +213,7 @@ function EditBlock(props) {
                         name="description"
                         label="备注"
                         wrapperCol={{ span: 18 }}
-						rules={[{ max: 200,message:'备注不能超过200个字符' }]}
+                        rules={[{ max: 200, message: '备注不能超过200个字符' }]}
                     >
                         <TextArea
                             autoSize={{ minRows: 5, maxRows: 5 }}
@@ -207,27 +222,27 @@ function EditBlock(props) {
                 </Col>
                 <Col span={24} hidden={type == 3}>
                     {type != 3 ?
-                        <Form.Item label="日期" name="time" rules={[{ required: true }]} labelAlign="right">
+                        <Form.Item label="日期" name="time" labelAlign="right">
                             <RangePicker
-                            allowClear={false}
+                                allowClear={false}
                                 placeholder={['开始时间', '结束时间']}
                                 disabledDate={disabledDate}
                                 onCalendarChange={val => setDates(val)}
+                                onChange={onChange}
                             />
                         </Form.Item>
                         : ''}
                 </Col>
                 <Col span={24} hidden={type == 3} style={{ marginTop: 15 }}>
-                    <Form.Item label="住院序号" name="behospitalCode" rules={[{ max: 30,message:'住院序号不能超过30个字符' }]}>
-                        <Input placeholder="请输入" autoComplete='off' onChange={change}/>
+                    <Form.Item label="住院序号" name="behospitalCode" rules={[{ max: 30, message: '住院序号不能超过30个字符' }]}>
+                        <Input placeholder="请输入" autoComplete='off' onChange={change} />
                     </Form.Item>
                 </Col>
                 {
                     type == 1 ?
                         <div style={{ color: '#1690FF' }}>
                             提示:<br />
-                            1、校验时间范围限制为30天,每一天数据量的校验时间约为1分钟。<br />
-                            时间范围以患者入院时间为准。<br />
+                            1、1、数据补录时间较长,请耐心等待。<br />
                             2、当输入住院序号时,校验将不受时间范围限制。<br />
                         </div>
                         : ''
@@ -239,7 +254,7 @@ function EditBlock(props) {
                         <Button htmlType="button" onClick={e => cancel()}>
                             取消
                         </Button>
-                        <Button type="primary" htmlType="submit">
+                        <Button type="primary" htmlType="submit" disabled={disable}>
                             {type == 1 ? '确定' : '保存'}
                         </Button>
                     </Space>

+ 6 - 2
src/components/FieldProblem/index.js

@@ -152,8 +152,12 @@ function FieldProblem() {
     const columns = [
         { title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },
         { 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: 'tableCname', key: 'tableCname' },
         { title: '表名称(英文)', dataIndex: 'tableEname', key: 'tableEname' },

+ 21 - 4
src/components/FieldRules/addRules.js

@@ -126,12 +126,21 @@ function ContentForm(props) {
             disable[i] = true
             seDisable([...disable])
             setColList([...colList])
+            getAddUpColumnName()
         }
         let columnList = formData.columnList;
         if(ins == 1){
-            columnList[i].tableEname = options.val
+            if (value) {
+                columnList[i].tableEname = options.val
+            }else{
+                columnList[i].tableEname = undefined
+            }
         }else{
-            columnList[i].tableCname = options.val
+            if (value) {
+                columnList[i].tableCname = options.val
+            }else{
+                columnList[i].tableCname = undefined
+            }
         }
         columnList[i].columnCname = undefined
         columnList[i].columnEname = undefined
@@ -145,9 +154,17 @@ function ContentForm(props) {
         let columnList = formData.columnList;
         columnList[i].id = options.key
         if(ins == 1){
-            columnList[i].columnEname = options.val
+            if (value) {
+                columnList[i].columnEname = options.val
+            }else{
+                columnList[i].columnEname = undefined
+            }
         }else{
-            columnList[i].columnCname = options.val
+            if (value) {
+                columnList[i].columnCname = options.val
+            }else{
+                columnList[i].columnCname = undefined
+            }
         }
         form.setFieldsValue({
             columnList: columnList

+ 12 - 11
src/components/FieldRules/index.js

@@ -11,8 +11,6 @@ const { RangePicker } = DatePicker;
 const { Option } = Select;
 
 function FieldRules() {
-
-
     const [addVisible, setAddVisible] = useState(false);         //新增页面显示
     const [logList, setLogList] = useState([]);
     const [total, setTotal] = useState(0);
@@ -122,13 +120,12 @@ function FieldRules() {
         post(api.delColumnVerify, { ids: selectedRowKeys }).then((res) => {
             if (res.data.code === 200) {
                 //刷新列表
-                const totalPage = Math.ceil((total - 1) / 15);
+                const totalPage = Math.ceil((total - selectedRowKeys.length) / 15);
                 //将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
                 const pagenum =
                     params.current > totalPage ? totalPage : params.current;
                 //避免pagenum变为0
                 params.current = pagenum < 1 ? 1 : pagenum;
-                console.log(pagenum < 1 ? 1 : pagenum);
                 setParams(params)
                 getColumnVerifyPage()
                 message.success(res.data.message);
@@ -137,9 +134,11 @@ function FieldRules() {
             }
         });
         showDelModal(false);
+        setSelectedRowKeys([])
     }
     //删除弹窗确认
     function showDelModal(flag) {
+        console.log(selectedRowKeys.length);
         if (flag && !selectedRowKeys.length) {
             message.warning("请先选择要删除的记录~", 1);
             return;
@@ -226,9 +225,7 @@ function FieldRules() {
         setSelectedRowKeys(selectedRowKeys);
     };
     function tableCnameChange(value, option) {
-        const formData = form.getFieldsValue();
         setTableCname(value)
-
         getColumnName('', '', value, '')
         if (value) {
             form.setFieldsValue({
@@ -242,6 +239,7 @@ function FieldRules() {
                 columnEname: undefined,
             })
             setDisable(true)
+            getTableName()
         }
 
     }
@@ -260,6 +258,7 @@ function FieldRules() {
                 columnEname: undefined,
             })
             setDisable(true)
+            getTableName()
         }
     }
     function colchange(value, option, ins) {
@@ -272,6 +271,7 @@ function FieldRules() {
                 form.setFieldsValue({
                     columnEname: undefined
                 })
+                getColumnName('', '', '', '')
             }
         } else {
             if (value) {
@@ -282,6 +282,7 @@ function FieldRules() {
                 form.setFieldsValue({
                     columnCname: undefined
                 })
+                getColumnName('', '', '', '')
             }
         }
     }
@@ -370,7 +371,7 @@ function FieldRules() {
                     <Row gutter={24}>
                         <Col span={6} key={0}>
                             <Form.Item label="表名称(中文)" name="tableCname">
-                                <Select showSearch allowClear onChange={(value, option) => tableCnameChange(value, option)} onSearch={cnameSearch} placeholder="请选择">
+                                <Select showSearch allowClear onChange={(value, option) => tableCnameChange(value, option)} onSearch={cnameSearch} style={{ maxWidth: '159px' }} placeholder="请选择">
                                     {tableList.map((item) => {
                                         return (
                                             <Option value={item.tableCname} val={item.tableEname} key={item.tableCname}>{item.tableCname}</Option>
@@ -381,7 +382,7 @@ function FieldRules() {
                         </Col>
                         <Col span={6} key={1}>
                             <Form.Item label="表名称(英文)" name="tableEname">
-                                <Select showSearch allowClear onChange={(value, option) => tableEnameChange(value, option)} onSearch={enameSearch} placeholder="请选择">
+                                <Select showSearch allowClear onChange={(value, option) => tableEnameChange(value, option)} onSearch={enameSearch} style={{ maxWidth: '159px' }} placeholder="请选择">
                                     {tableList.map((item) => {
                                         return (
                                             <Option value={item.tableEname} val={item.tableCname} key={item.tableEname}>{item.tableEname}</Option>
@@ -392,7 +393,7 @@ function FieldRules() {
                         </Col>
                         <Col span={6} key={2}>
                             <Form.Item label="字段名称(中文)" name="columnCname">
-                                <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 1)} onSearch={colmeSearch} placeholder="请选择" disabled={disable}>
+                                <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 1)} onSearch={colmeSearch} style={{ maxWidth: '159px' }} placeholder="请选择" disabled={disable}>
                                     {colList.map((item, i) => {
                                         return (
                                             <Option value={item.columnCname} val={item.columnEname} key={item.columnCname}>{item.columnCname}</Option>
@@ -403,7 +404,7 @@ function FieldRules() {
                         </Col>
                         <Col span={6} key={3}>
                             <Form.Item label="字段名称(英文)" name="columnEname">
-                                <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 2)} onSearch={coleneSearch} placeholder="请选择" disabled={disable}>
+                                <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 2)} onSearch={coleneSearch} placeholder="请选择" style={{ maxWidth: '159px' }} disabled={disable}>
                                     {colList.map((item, i) => {
                                         return (
                                             <Option value={item.columnEname} val={item.columnCname} key={item.columnEname}>{item.columnEname}</Option>
@@ -493,7 +494,7 @@ function FieldRules() {
                 onCancel={() => showDelModal(false)}
                 maskClosable={false}
             >
-                <p>字段校验规则删除后将无法恢复,确认删除这{selectedRowKeys.length}条变更记录?</p>
+                <p>字段校验规则删除后将无法恢复,确认删除这{selectedRowKeys.length}条数据?</p>
             </Modal>
         </div >
     )

+ 2 - 1
src/components/RegularManage/index.js

@@ -67,13 +67,14 @@ function RegularManage() {
         post(api.delRegularById, { ids: arr }).then((res) => {
             if (res.data.code === 200) {
                 //刷新列表
-                const totalPage = Math.ceil((total - 1) / 15);
+                const totalPage = Math.ceil((total - selectedRowKeys.length) / 15);
                 //将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
                 const pagenum =
                     params.current > totalPage ? totalPage : params.current;
                 //避免pagenum变为0
                 params.current = pagenum < 1 ? 1 : pagenum;
                 setParams(params)
+                console.log(params.current );
                 getRegularPage()
                 message.success(res.data.message);
             } else {

+ 2 - 2
src/components/SysChoose/index.js

@@ -74,8 +74,8 @@ function SysChoose({history}) {
     //点击进入
     function getIn(id, type, sysid){
         dispatch(setSys({sysId,sysName,hisId:id}));
-        setCookie('systemId', sysId || sysid);
-        setCookie('hospitalId',id);
+        localStorage.setItem('systemId', sysId || sysid);
+        localStorage.setItem('hospitalId',id);
 	    setCookie('systemName',sysName);
         setCookie('hosType', type);
         interceptors();