code4eat 3 роки тому
батько
коміт
902ab38669

+ 10 - 12
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/drawer/index.tsx

@@ -1,11 +1,3 @@
-/*
- * @Author: your name
- * @Date: 2022-03-07 11:05:19
- * @LastEditTime: 2022-03-09 18:01:50
- * @LastEditors: Please set LastEditors
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/drawer/set.tsx
- */
 
 
 
@@ -34,7 +26,7 @@ const SetDrawer = () => {
         scoreList,
         getDepartmentRequest,
         departmentManagers,
-        getDepartment,//获取责任单位
+        getDepartmentUsers,
         ...restModelData
     } = articleManagement;
 
@@ -44,11 +36,17 @@ const SetDrawer = () => {
 
     const onVisibleChangeHandle = (visible: boolean) => {
         //drawer展示控制
+        if(visible){
+            if(restModelData.leafData){
+                getDepartmentUsers(restModelData.leafData?.reviewArticle.responsibilityDepartmentId);
+            }
+        }
         !visible && articleManagement.setArticleSettingFormInit({});//清空默认值
         restModelData.setDrawerVisible(visible);
     }
     
     const setTitle = (type:string) => {
+
         if (restModelData.drawerFormType == 'ARTICLE_SET') {
             return '条文设置'
         }
@@ -89,10 +87,11 @@ const SetDrawer = () => {
                                     placeholder="选择单位"
                                     fieldProps={{
                                         labelInValue: true,
-                                        onChange: (value, option) => {
+                                        onChange: (item, option) => {
                                             //责任单位修改时清空责任人
+                                            console.log
                                             drawerFormRef.current?.setFieldsValue({ ...articleManagement.articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
-                                            getDepartment(value, option)
+                                            getDepartmentUsers(item.value, option)
                                         }
                                     }}
                                     rules={[{ required: true, message: '请选择单位!' }]}
@@ -111,7 +110,6 @@ const SetDrawer = () => {
                                                 placeholder="选择负责人"
                                                 fieldProps={{
                                                     labelInValue: true,
-                                                    // onChange:(value,option)=>getManagers(value,option)
                                                 }}
                                                 rules={[{ required: true, message: '请选择负责人!' }]}
                                             />

+ 5 - 2
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx

@@ -1,7 +1,11 @@
 /*
  * @Author: your name
  * @Date: 2022-03-08 10:41:15
+<<<<<<< HEAD
  * @LastEditTime: 2022-03-09 18:14:12
+=======
+ * @LastEditTime: 2022-03-10 11:44:00
+>>>>>>> master
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx
@@ -63,7 +67,7 @@ const ArticleDetail = ({ isModeTwo = false }) => {
         scoreList,
         getDepartmentRequest,
         departmentManagers,
-        getDepartment,//获取责任单位
+        getDepartmentUsers,//获取责任单位
         currentSelectedActObj,
         ...restModelData
     } = articleManagement;
@@ -264,7 +268,6 @@ const ArticleDetail = ({ isModeTwo = false }) => {
 
     const articleSetBtnHandle = () => {
         //条文设置
-        // console.log({ articleSettingFormInit });
         restModelData.setDrawerFormType('ARTICLE_SET');
         restModelData.setDrawerVisible(true);
 

+ 4 - 11
src/pages/GradeHospitalAccreditation/articleManagement/index.tsx

@@ -1,10 +1,4 @@
-/*
- * @Author: your name
- * @Date: 2021-09-14 10:22:09
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
- */
+
 
 
 
@@ -73,7 +67,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         scoreList,
         getDepartmentRequest,
         departmentManagers,
-        getDepartment,//获取责任单位
+        getDepartmentUsers,//获取责任单位
         currentSelectedActObj,
         setdetailDrawerVisible,
         detailDrawerVisible,
@@ -271,7 +265,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
     const onModalVisibleChange = (visible: boolean) => {
         //表单弹窗
-        //  console.log('uploadFormInitValue',restModelData.uploadFormInitValue);
+
         !visible && restModelData.setUploadFormInitValue(undefined);
         restModelData.setModalVisible(visible);
 
@@ -474,8 +468,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                         }
                     </div>
                     <div style={{ padding: 0, width: restModelData.editMode ? '100%' : '75%', transition: 'width 0.2s ease-in' }}>
-
-                        <div className='card' style={{ display: currentActivedTree?.isLeaf ? 'none' : 'block' }}>
+                        <div className='card' style={{ display: currentActivedTree?.isLeaf ? 'none' : 'block',height:'85vh' }}>
                             <MccsTable
                                 ref={tableRef}
                                 columns={columnsFromProps.length > 0 ? columnsFromProps : columns}

+ 33 - 26
src/pages/GradeHospitalAccreditation/articleManagement/model.ts

@@ -1,11 +1,4 @@
-/*
- * @Author: your name
- * @Date: 2021-09-14 10:46:45
- * @LastEditTime: 2022-03-09 18:17:18
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
- */
+
 
 import { useState, useEffect } from 'react';
 import {
@@ -64,7 +57,7 @@ const articleManagement = () => {
    * BATCHSETTING 批量设置
    */
 
-  const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING' | undefined>(undefined);
+  const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING'|undefined>(undefined);
 
   const [reloadRightContent, setReloadRightContent] = useState(false);
 
@@ -103,6 +96,8 @@ const articleManagement = () => {
 
   const [detailDrawerVisible, setdetailDrawerVisible] = useState(false);   //条文详情抽屉
 
+  const [ifHasEdit,setifHasEdit] = useState(false);   //是否操作了条文设置或者编辑操作
+
 
 
 
@@ -216,18 +211,17 @@ const articleManagement = () => {
     });
 
     if (resp) {
-      // 重新刷新表格
-      if (!detailDrawerVisible) {
-        //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新
-        setReloadRightContent(true);
-      }
+  
+      setReloadRightContent(true);
       return true;
     }
   };
 
   const setArticle = async (values: FormValueType) => {
     // 条文设置
-    // console.log({values});
+
+    setifHasEdit(true);
+
     if (currentActivedTree && leafData) {
 
       let ruleId = 0;
@@ -251,26 +245,31 @@ const articleManagement = () => {
         targetEvaluation: values.targetScores.value,
         articleType: values.articleType.value,
       };
+
       const resp = await settingArticle(paramsData);
       if (resp) {
         // 更新界面信息
-        if (!detailDrawerVisible) {
-          //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新
+        if (detailDrawerVisible) {
+          //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新,只刷新详情数据
+          getTableData({id:currentSelectedActObj.id});
+    
+        }else{
           getTableData();
         }
-        return true;
+        
+        setDrawerVisible(false);
       }
     }
   };
 
-  const getDepartment = async (item: any, option: any) => {
-    // 获取责任单位
-    const resp = await getDepartmentList({ responsibilityDepartmentId: item.value });
+  const getDepartmentUsers = async (id:number, option?: any) => {
+    // 获取责任单位对应的责任人
+    const resp = await getDepartmentList({ responsibilityDepartmentId: id});
     if (resp) {
       const { list = [] } = resp;
       if (list.length > 0) {
         const tempPeople = list[0].sysEmployeeVOList.map((item) => ({
-          label: item ? item.name : 'null',
+          label: item ? item.name : '-',
           value: item ? item.id : 0,
         }));
         setDepartmentManagers(tempPeople);
@@ -481,7 +480,6 @@ const articleManagement = () => {
   const accreditationGroupType = async () => {
     // 获取条文组别
     const data = await getAccreditationTypeData();
-    console.log({ data });
     const tempArr = data.map((t: any) => ({ label: t.categoryType, value: t.categoryType }));
     return Promise.resolve(tempArr);
   };
@@ -577,6 +575,17 @@ const articleManagement = () => {
     }
   }
 
+  useEffect(()=>{
+       console.log({detailDrawerVisible});
+
+       if(!detailDrawerVisible&&ifHasEdit){
+            //详情抽屉关闭时刷新table
+            setReloadRightContent(true);
+            //更新完数据,重置状态
+            setifHasEdit(false);
+       }
+
+  },[detailDrawerVisible])
 
   useEffect(() => {
     if (!drawerVisible) {
@@ -584,7 +593,6 @@ const articleManagement = () => {
     }
   }, [drawerVisible]);
 
-
   useEffect(() => {
     // 叶子结点数据变化后相关回调
     if (leafData) {
@@ -626,7 +634,6 @@ const articleManagement = () => {
 
   useEffect(() => {
     // 当抽屉类型改变时
-    console.log('drawerFormType changed');
     if (drawerFormType == 'BATCHSETTING' || drawerFormType == 'ARTICLE_SET') {
       getScoreList().then((data) => {
         const dataFilted = data.filter((t: any) => t.configStatus != 0); // 去掉不启动
@@ -689,7 +696,7 @@ const articleManagement = () => {
     scoreList, // 评分
     getDepartmentRequest,
     departmentManagers,
-    getDepartment,
+    getDepartmentUsers,
     targetScores,
     ruleTypes,
     leafData,

+ 6 - 44
src/pages/GradeHospitalAccreditation/ledgerUpload/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2022-03-07 13:58:03
+ * @LastEditTime: 2022-03-10 10:54:42
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -34,30 +34,6 @@ type LedgerUploadPropsType = {
 const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
     const columns = [
-        // {
-        //     key: 'articleType',
-        //     hideInTable: true,
-        //     renderFormItem: (item: any, { type }: any, form: any) => {
-
-        //         if (type === 'form') {
-        //             return null;
-        //         }
-        //         return (
-
-        //                 <ProFormSelect
-        //                     width='sm'
-        //                     options={[
-        //                         { label: '全部', value: 'all' },
-        //                         { label: '未解决', value: 'open' },
-        //                         { label: '已解决', value: 'closed' },
-        //                         { label: '解决中', value: 'processing' },
-        //                     ]}
-        //                     placeholder="台账状态"
-        //                 />
-
-        //         )
-        //     },
-        // },
         {
             hideInTable: true,
             renderFormItem: (item: any, { type }: any, form: any) => {
@@ -92,12 +68,12 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
             key: 'numStr',
             dataIndex: 'numStr',
             hideInSearch: true,
-
         },
         {
             title: '条文',
             dataIndex: 'name',
             hideInSearch: true,
+            ellipsis: true,
             width: '35%'
         },
         {
@@ -156,9 +132,6 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
     const { ...restLedgerUploadModelData } = ledgerUpload;
 
-    // const [tabKey, setTabKey] = useState<string | number>();  //antd Tab切换
-
-
     const openDrawerHandle = (record: any) => {
         restLedgerUploadModelData.setCurrentRecord(record)
         restLedgerUploadModelData.setDrawerVisible(true);
@@ -171,16 +144,17 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
         restLedgerUploadModelData.delRuleHandle(id);
         restArticleManagementModelData.getArticleTreeData();  // 刷新树结构
         restArticleManagementModelData.setReloadRightContent(true);  // 刷新表格数据
+
     }
 
     const onVisibleChangeHandle = (visible: boolean) => {
-        console.log(visible)
         restLedgerUploadModelData.setDrawerVisible(visible);
     }
 
     const upLoadFileHandle = (formInitData?: any) => {
         // 因为modalForm开启了request+params获取表单默认值,
         // 所以必须先设置默认值才能开启弹窗
+
         if (formInitData) {
             const { fileUrl, recordTypeName, fileName, accountType, cateId } = formInitData;
             restArticleManagementModelData.setUploadFormInitValue({
@@ -204,18 +178,6 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
         restArticleManagementModelData.setModalVisible(true);
     }
 
-    const actionNodeFunc = (data: any) => {
-        // 渲染记录列表操作按钮
-        // console.log({ data });
-        const reupload = () => {
-
-            upLoadFileHandle(data);
-        }
-
-        return <a onClick={reupload}>重新上传</a>
-    }
-
-
     useEffect(()=>{
         
         const {drawerVisible} = restLedgerUploadModelData;
@@ -224,6 +186,7 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
         if(!drawerVisible){
             restArticleManagementModelData.setEditMode(false);
         }
+
     },[restLedgerUploadModelData.drawerVisible]);
 
     useEffect(() => {
@@ -234,8 +197,7 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
     }, [restArticleManagementModelData.modalVisible]);
 
-
-
+    
     return (
         <React.Fragment>
             <ArticleManagementCopy