瀏覽代碼

问题修改

1178232204@qq.com 3 年之前
父節點
當前提交
3dfa20c4d5

+ 1 - 1
src/common/common.less

@@ -139,7 +139,7 @@ body {
   position: relative;
   left: -10px;
   top: 14px;
-  background: #ff4d4d;
+  background: #22AC76;
   border-radius: 50%;
 }
 .disable {

+ 0 - 1
src/components/ATabs/index.less

@@ -6,7 +6,6 @@
   padding: 0 10px 10px;
   margin:0 10px;
   height: calc(100vh - 60px);
-  overflow-y: auto;
   .ant-tabs-nav{
     height: 40px;
   }

+ 13 - 6
src/components/BlockLossManage/index.js

@@ -14,7 +14,7 @@ const { Option } = Select;
 function BlockLossManage() {
     useEffect(() => {
         getBlockLossPage();
-        blockLossTypeGather()
+        blockLossTypeGather(date)
     }, []);
     const [blockList, setBlockList] = useState([]);
     const [total, setTotal] = useState(0);
@@ -29,6 +29,7 @@ function BlockLossManage() {
         pages: 1,
         current: 1,
         size: 15,
+        desc:['status','gmt_create'],
         startDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
         endDate: getCurrentData().split('/').join('-') + ' 23:23:59'
     });
@@ -37,6 +38,11 @@ function BlockLossManage() {
         pages: 1,
         current: 1,
         size: size,
+        desc:['status','gmt_create'],
+        startDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
+        endDate: getCurrentData().split('/').join('-') + ' 23:23:59'
+    }
+    let date = {
         startDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
         endDate: getCurrentData().split('/').join('-') + ' 23:23:59'
     }
@@ -51,8 +57,8 @@ function BlockLossManage() {
         })
     }
     //丢失量分类汇总
-    function blockLossTypeGather(startDate, endDate) {
-        post(api.blockLossTypeGather, { startDate: startDate || params.startDate, endDate: endDate || params.endDate }).then((res) => {
+    function blockLossTypeGather(param) {
+        post(api.blockLossTypeGather, param).then((res) => {
             if (res.data.code === 200) {
                 const data = res.data.data;
                 setBlockData(data)
@@ -105,13 +111,14 @@ function BlockLossManage() {
         setCurrent(1)
         setParams(param)
         getBlockLossPage(param);
-        blockLossTypeGather(value.startDate, value.endDate)
+        blockLossTypeGather({startDate:value.startDate, endDate:value.endDate})
     };
     const onReset = () => {
         setCurrent(1)
         setParams(data)
         form.resetFields();
         getBlockLossPage(data);
+        blockLossTypeGather(date)
     };
     function getCurrentDataFront() {
         let time = new Date((new Date() - 30 * 24 * 3600 * 1000)).toLocaleDateString()
@@ -149,11 +156,11 @@ function BlockLossManage() {
         },
         {
             title: '状态', key: 'status', render: (text, record) => {
-                return (<span className={(record.status === '已恢复') ? 'Adopt' : 'Delete'}>{record.status == 0 ? '已丢失' : record.status == 1 ? '已恢复' : '-'}</span>);
+                return (<span className={record.status === '0' ? 'Delete' : 'Adopt'}>{record.status == 0 ? '已丢失' : record.status == 1 ? '已恢复' : '-'}</span>);
             }
         },
         {
-            title: '核结果', key: 'isAudited', render: (text, record) => {
+            title: '核结果', key: 'isAudited', render: (text, record) => {
                 return (<span className={(record.isAudited === '0') ? 'delete' : (record.isAudited === '1') ? 'adopt' : 'disable'}>{record.isAudited == 0 ? '审核未通过' : record.isAudited == 1 ? '审核通过' : record.isAudited == 2 ? '未核查' : '-'}</span>);
             }
         },

+ 1 - 1
src/components/FieldProblem/editProblem.js

@@ -89,7 +89,7 @@ function EditBlock(props) {
         <>
             <Form
                 labelCol={type == 3 ? { span: 16 } : { span: 4 }}
-                wrapperCol={{ span: 16 }}
+                wrapperCol={type == 3 ? { span: 12 } : { span: 16 }}
                 form={form}
                 name="register"
                 layout={type == 3 ? 'inline' : 'horizontal'}

+ 23 - 14
src/components/FieldProblem/index.js

@@ -28,15 +28,11 @@ function FieldProblem() {
     const [problemDetail, setProblemDetail] = useState(null);//详情数据
     const [title, setTitle] = useState();//正则式数据
     const [modeList, setModeList] = useState([]);//质控模块
-
     const [params, setParams] = useState({
         pages: 1,
         current: 1,
         size: 15,
-        behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
-        behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
-    });
-    const [date, setDate] = useState({
+        desc:['isSolved','solveTime'],
         behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
         behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
     });
@@ -45,6 +41,11 @@ function FieldProblem() {
         pages: 1,
         current: 1,
         size: size,
+        desc:['isSolved','solveTime'],
+        behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
+        behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
+    }
+    let date = {
         behospitalStartDate: getCurrentDataFront().split('/').join('-') + ' 00:00:00',
         behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:23:59'
     }
@@ -125,7 +126,6 @@ function FieldProblem() {
             ...data,
             ...value,
         }
-        setDate({ behospitalStartDate: value.behospitalStartDate, behospitalEndDate: value.behospitalEndDate })
         setCurrent(1)
         setParams(param)
         getColumnResultPage(param);
@@ -136,6 +136,7 @@ function FieldProblem() {
         setParams(data)
         form.resetFields();
         getColumnResultPage(data);
+        getColumnResultNumber(date)
     };
     function getCurrentDataFront() {
         let time = new Date((new Date() - 30 * 24 * 3600 * 1000)).toLocaleDateString()
@@ -156,10 +157,14 @@ function FieldProblem() {
         { title: '表名称(英文)', dataIndex: 'tableEname', key: 'tableEname' },
         { title: '字段名称(中文)', dataIndex: 'columnCname', key: 'columnCname' },
         { title: '字段名称(英文)', dataIndex: 'columnEname', key: 'columnEname' },
-        { title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal' },
+        {
+            title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal', render: (text, record) => {
+                return record.tableVal || '-';
+            }
+        },
         {
             title: '备注', dataIndex: 'description', key: 'description', render: (text, record) => {
-                return (record.description || "-").length > 20 ? <span title={record.description}>{record.description.substring(0, 20) + '...'}</span> : record.description;
+                return record.description ? record.description.length > 20 ? <span title={record.description}>{record.description.substring(0, 20) + '...'}</span> : record.description : '-';
             }
         },
         {
@@ -167,10 +172,14 @@ function FieldProblem() {
                 return record.type == 1 ? "数据缺失" : record.type == 2 ? "非标准值" : "正则校验失败";
             }
         },
-        { title: '更新时间', dataIndex: 'auditTime', key: 'auditTime' },
+        {
+            title: '更新时间', dataIndex: 'auditTime', key: 'auditTime', render: (text, record) => {
+                return record.auditTime || '-';
+            }
+        },
         {
             title: '状态', dataIndex: 'isRequired', key: 'isRequired', render: (text, record) => {
-                return record.isSolved == 1 ? "已解决" : record.isSolved == 0 ? "未解决" : "-";
+                return record.isSolved == 1 ? "已处理" : record.isSolved == 0 ? "未处理" : "-";
             }
         },
         {
@@ -208,19 +217,19 @@ function FieldProblem() {
                             </Form.Item>
                         </Col>
                         <Col span={5} key={2}>
-                            <Form.Item label="文书编号" name="recId" getValueFromEvent={getValueFromEvent}>
+                            <Form.Item label="文书编号" name="hosptialDatatmpCode" getValueFromEvent={getValueFromEvent}>
                                 <Input placeholder="文书编号" autoComplete='off' allowClear maxLength='30' />
                             </Form.Item>
                         </Col>
                         <Col span={5} key={3}>
-                            <Form.Item label="文书标题" name="recTitle" 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) => {
+                                    {modeList.map((item, i) => {
                                         return (
                                             <Option value={item} key={i}>{item}</Option>
                                         )
@@ -315,7 +324,7 @@ function FieldProblem() {
                 </div>
                 <Table
                     columns={columns}
-                    scroll={{ y: 'calc(100vh - 470px)' }}
+                    scroll={{ y: 'calc(100vh - 510px)' }}
                     dataSource={logList}
                     rowKey={record => record.id}
                     pagination={{

+ 3 - 3
src/components/FieldRules/addRules.js

@@ -12,7 +12,7 @@ const { Option } = Select;
 const { TextArea } = Input;
 function AddRules(props) {
     const [form] = Form.useForm();
-    const { back } = props;
+    const { back,userChange } = props;
     const [visible, setVisible] = useState(false);
     const { type } = useContext(FiledContext);
     function handleOk() {
@@ -36,8 +36,8 @@ function AddRules(props) {
                 <Breadcrumb.Separator />
                 <Breadcrumb.Item>{type == 1 ? "新增字段校验" : "修改字段校验"}</Breadcrumb.Item>
             </Breadcrumb>
-            <div className="add-container">
-                <ContentForm back={goback} form={form} cancel={back}></ContentForm>
+            <div className="add-rules">
+                <ContentForm back={goback} form={form} cancel={userChange}></ContentForm>
             </div>
             <Modal
                 title="提示"

+ 36 - 14
src/components/FieldRules/index.js

@@ -9,13 +9,10 @@ import { getValueFromEvent } from '@utils/index'
 const { post, api, xPost } = apiObj;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
+
 function FieldRules() {
-    useEffect(() => {
-        getRegular()
-        getTableName()
-        getColumnName()
-        getColumnVerifyPage();
-    }, []);
+
+
     const [addVisible, setAddVisible] = useState(false);         //新增页面显示
     const [logList, setLogList] = useState([]);
     const [total, setTotal] = useState(0);
@@ -31,14 +28,22 @@ function FieldRules() {
     const [params, setParams] = useState({
         pages: 1,
         current: 1,
-        size: 15
+        size: 15,
+        desc:['gmt_create']
     });
     const [form] = Form.useForm();
     let data = {
         pages: 1,
         current: 1,
-        size: size
+        size: size,
+        desc:['gmt_create']
     }
+    useEffect(() => {
+        getRegular()
+        getTableName()
+        getColumnName()
+        getColumnVerifyPage();
+    }, []);
     //表格数据
     function getColumnVerifyPage(param) {
         post(api.getColumnVerifyPage, param || params).then((res) => {
@@ -112,6 +117,14 @@ function FieldRules() {
         post(api.delColumnVerify, { ids: selectedRowKeys }).then((res) => {
             if (res.data.code === 200) {
                 //刷新列表
+                const totalPage = Math.ceil((total - 1) / 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);
             } else {
@@ -170,7 +183,7 @@ function FieldRules() {
                     standardValueList: [{
                         tit: data.standardvalue,
                     }],
-                    regularName:data.regular,
+                    regularName: data.regular,
                     ...data
                 }
                 console.log(arr);
@@ -185,6 +198,7 @@ function FieldRules() {
         setCurrent(current)
         setParams(params)
         getColumnVerifyPage()
+        setSelectedRowKeys([])
     }
     function changePage(page, pageSize) {
         params.current = page
@@ -192,6 +206,7 @@ function FieldRules() {
         setParams(params)
         setCurrent(page)
         getColumnVerifyPage()
+        setSelectedRowKeys([])
     }
     function onSelectChange(selectedRowKeys) {
         setSelectedRowKeys(selectedRowKeys);
@@ -201,6 +216,12 @@ function FieldRules() {
         setAddVisible(false);
         setFiledDetail(null)
     }
+    function userChange() {
+        setVisible(false)
+        setFiledDetail(null)
+        getColumnVerifyPage();
+        setSelectedRowKeys([])
+    }
     const onFinish = (value) => {
         const param = {
             ...data,
@@ -209,12 +230,14 @@ function FieldRules() {
         setCurrent(1)
         setParams(param)
         getColumnVerifyPage(param);
+        setSelectedRowKeys([])
     };
     const onReset = () => {
         setCurrent(1)
         setParams(data)
         form.resetFields();
         getColumnVerifyPage(data);
+        setSelectedRowKeys([])
     };
     const columns = [
         { title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1, width: 60 },
@@ -229,7 +252,7 @@ function FieldRules() {
         },
         {
             title: '标准值维护', dataIndex: 'standardvalue', key: 'standardvalue', width: 110, render: (text, record) => {
-                return (record.standardvalue || "-").length > 10 ? <span title={record.standardvalue}>{record.standardvalue.substring(0, 10) + '...'}</span> : record.standardvalue;
+                return record.standardvalue ? record.standardvalue.length > 10 ? <span title={record.standardvalue}>{record.standardvalue.substring(0, 10) + '...'}</span> : record.standardvalue : '-';
             }
         },
         {
@@ -239,7 +262,7 @@ function FieldRules() {
         },
         {
             title: '说明', dataIndex: 'description', key: 'description', render: (text, record) => {
-                return (record.description || "-").length > 20 ? <span title={record.description}>{record.description.substring(0, 20) + '...'}</span> : record.description;
+                return record.description ? record.description.length > 20 ? <span title={record.description}>{record.description.substring(0, 20) + '...'}</span> : record.description : '-';
             }
         },
         {
@@ -257,7 +280,7 @@ function FieldRules() {
     if (addVisible && filedDetail) {
         return (
             <FiledContext.Provider value={{ type, detail: filedDetail }}>
-                <AddRules back={goBack} />
+                <AddRules userChange={userChange} back={goBack} className="aa" />
             </FiledContext.Provider>
         )
     }
@@ -329,7 +352,7 @@ function FieldRules() {
                         </Col>
                         <Col span={5} key={5}>
                             <Form.Item label="标准值" name="standardValue" getValueFromEvent={getValueFromEvent}>
-                                <Input placeholder="标准值" autoComplete='off' allowClear maxLength='30'  />
+                                <Input placeholder="标准值" autoComplete='off' allowClear maxLength='30' />
                             </Form.Item>
                         </Col>
                         <Col span={5} key={6}>
@@ -401,5 +424,4 @@ function FieldRules() {
         </div >
     )
 }
-
 export default FieldRules;

+ 18 - 14
src/components/FieldRules/index.less

@@ -15,21 +15,25 @@
       display: flex;
     }
   }
-  & img{
-      width: 30px;
-      height: 30px;
-      margin-left: 20px;
-      cursor: pointer;
+  & img {
+    width: 30px;
+    height: 30px;
+    margin-left: 20px;
+    cursor: pointer;
   }
 }
 .box-2 {
-    display: flex;
-    overflow: hidden;
-    & img{
-        width: 30px;
-        height: 30px;
-        margin-left: 20px;
-        cursor: pointer;
-    }
+  display: flex;
+  overflow: hidden;
+  & img {
+    width: 30px;
+    height: 30px;
+    margin-left: 20px;
+    cursor: pointer;
   }
-  
+}
+.add-rules{
+  padding: 30px 125px;
+  overflow-y: auto;
+  height: calc(100vh - 190px);
+}

+ 4 - 3
src/components/RegularManage/addRegular.js

@@ -11,12 +11,13 @@ function EditBlock(props) {
     useEffect(() => {
     }, []);
     const [form] = Form.useForm();
-    const [delvisible, setDelVisible] = useState(false);
+    const [visible, setVisible] = useState(false);
     const { regularDetail, type, flag } = useContext(RegularContext);
     const initialValues = regularDetail;
     const onFinish = values => {
+        console.log(flag);
         if (flag == 1) {
-            setDelVisible(true)
+            setVisible(true)
         } else {
             addRegular(values)
         }
@@ -86,7 +87,7 @@ function EditBlock(props) {
                 okText='确定'
                 cancelText='取消'
                 width={400}
-                visible={delvisible}
+                visible={visible}
                 onOk={addRegular}
                 /*confirmLoading={confirmLoading}*/
                 onCancel={() => cancel()}

+ 21 - 5
src/components/RegularManage/index.js

@@ -30,13 +30,15 @@ function RegularManage() {
     const [params, setParams] = useState({
         pages: 1,
         current: 1,
-        size: 15
+        size: 15,
+        desc: ['dri.gmt_create']
     });
     const [form] = Form.useForm();
     let data = {
         pages: 1,
         current: 1,
-        size: size
+        size: size,
+        desc: ['dri.gmt_create']
     }
     //表格数据
     function getRegularPage(param) {
@@ -65,6 +67,13 @@ function RegularManage() {
         post(api.delRegularById, { ids: arr }).then((res) => {
             if (res.data.code === 200) {
                 //刷新列表
+                const totalPage = Math.ceil((total - 1) / 15);
+                //将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
+                const pagenum =
+                    params.current > totalPage ? totalPage : params.current;
+                //避免pagenum变为0
+                params.current = pagenum < 1 ? 1 : pagenum;
+                setParams(params)
                 getRegularPage()
                 message.success(res.data.message);
             } else {
@@ -72,6 +81,7 @@ function RegularManage() {
             }
         });
         showDelModal(false);
+        setSelectedRowKeys([])
     }
     //新增修改跳转
     function showModal(title, type, record) {
@@ -79,6 +89,9 @@ function RegularManage() {
         setTitle(title)
         setType(type)
         setRegularDetail(record)
+        if (type == 2) {
+            setFlag(record.relation)
+        }
     }
     function cancel() {
         setVisible(false)
@@ -88,6 +101,7 @@ function RegularManage() {
         setVisible(false)
         getRegularPage()
         setRegularDetail(null)
+        setSelectedRowKeys([])
     }
     function onSizeChange(current, pageSize) {
         params.current = current
@@ -96,6 +110,7 @@ function RegularManage() {
         setCurrent(current)
         setParams(params)
         getRegularPage()
+        setSelectedRowKeys([])
     }
     function changePage(page, pageSize) {
         params.current = page
@@ -103,6 +118,7 @@ function RegularManage() {
         setParams(params)
         setCurrent(page)
         getRegularPage()
+        setSelectedRowKeys([])
     }
     const rowSelection = {
         selectedRowKeys,
@@ -113,11 +129,9 @@ function RegularManage() {
         selectedRowKeys.forEach(it => {
             arr.push(it.split('-')[1])
         });
-        if (arr.indexOf('1') > 0) {
-            setFlag(1)
+        if (arr.indexOf('1') >= 0) {
             setTip('正则式关联字段校验规则,删除后将取消关联且无法恢复,确认删除这' + selectedRowKeys.length + '条正则式?')
         } else {
-            setFlag(0)
             setTip('正则式删除后将无法恢复,确认删除这' + selectedRowKeys.length + '条正则式?')
         }
 
@@ -131,12 +145,14 @@ function RegularManage() {
         setCurrent(1)
         setParams(param)
         getRegularPage(param);
+        setSelectedRowKeys([])
     };
     const onReset = () => {
         setCurrent(1)
         setParams(data)
         form.resetFields();
         getRegularPage(data);
+        setSelectedRowKeys([])
     };
     const columns = [
         { title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },