فهرست منبع

条文设置添加配置合作单位功能

code4eat 3 سال پیش
والد
کامیت
00758c5ddb

+ 1 - 1
src/components/MccsEditableTable/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-27 10:45:50
- * @LastEditTime: 2022-01-04 16:51:39
+ * @LastEditTime: 2022-03-15 15:41:18
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsEditableTable/index.tsx

+ 18 - 15
src/components/MccsTable/index.less

@@ -1,22 +1,25 @@
 
 
-.mwc-ant-card-body {
-    padding: 0;
-}
-
+.MccsTable {
+    .mwc-ant-card-body {
+        padding: 0;
+    }
+    
+    
+    .mwc-ant-pro-table-search {
+        padding-bottom: 24px;
+        .ant-form-item {
+            margin-bottom: 0;
+        }
+    }
+    
+    .formGroup {
+        margin-bottom: 20px;
+    }
 
-.mwc-ant-pro-table-search {
-    padding: 0;
-    padding-bottom: 24px;
-    .ant-form-item {
+    .mwc-ant-form-item {
         margin-bottom: 0;
     }
+    
 }
 
-.formGroup {
-    margin-bottom: 20px;
-}
-
-.mwc-ant-form-item {
-    margin-bottom: 0;
-}

+ 3 - 2
src/components/MccsTable/index.tsx

@@ -2,8 +2,8 @@
  * @Author: your name
 <<<<<<< HEAD
  * @Date: 2022-03-09 10:08:00
- * @LastEditTime: 2022-03-09 14:13:03
- * @LastEditors: your name
+ * @LastEditTime: 2022-03-15 15:41:42
+ * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 =======
  * @Date: 2021-09-14 11:14:06
@@ -54,6 +54,7 @@ const MccsTable=React.forwardRef<MccsTable.MccsTableRef,MccsTable.MccsTable>((pr
         <React.Fragment >
             <div className='container'>
             <ProTable
+                  className='MccsTable'
                   columns={processColumns(columns)}
                   toolBarRender={false}
                   formRef={formRef}

+ 1 - 1
src/global.less

@@ -3,7 +3,7 @@
 html,
 body,
 #root {
-  height: 100vh;
+  height:calc(100vh - 48px);
   min-width:1100px;
 }
 

+ 112 - 94
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/drawer/index.tsx

@@ -1,13 +1,22 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-07 11:05:19
+ * @LastEditTime: 2022-03-15 17:43:41
+ * @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
+ */
 
 
 
 import MccsDrawerForm from '@/components/MccsDrawerForm/index';
-import { ProFormDependency, ProFormInstance, ProFormSelect } from '@ant-design/pro-form';
+import {ProFormInstance } from '@ant-design/pro-form';
 import MccsClickableTabs from '@/components/MccsClickableTabs/index';
-import { useRef } from 'react'
+import { useEffect, useRef, useState } from 'react'
 
 import { Form, Row, Col } from 'antd'
 import { useModel } from 'umi';
+import MultiResponsibilitySelecter from './multi';
 
 
 
@@ -25,27 +34,29 @@ const SetDrawer = () => {
         setCurrentActivedTree,
         scoreList,
         getDepartmentRequest,
-        departmentManagers,
-        getDepartmentUsers,
+
         ...restModelData
     } = articleManagement;
 
     const drawerFormRef = useRef<ProFormInstance>();
 
+    const [ifsetTargetScore, setifsetTargetScore] = useState(true); //设置目标分数是否必填
+    const [rows,setrows] = useState(0);
+    const [respDepartmentList,setrespDepartmentList] = useState<{label:string;value:any}[]|[]>([]);  //可选单位
 
 
     const onVisibleChangeHandle = (visible: boolean) => {
         //drawer展示控制
-        if(visible){
-            if(restModelData.leafData){
-                getDepartmentUsers(restModelData.leafData?.reviewArticle.responsibilityDepartmentId);
+        if (visible) {
+            if (restModelData.leafData) {
+                // getDepartmentUsers(restModelData.leafData?.reviewArticle.responsibilityDepartmentId);
             }
         }
-        !visible && articleManagement.setArticleSettingFormInit({});//清空默认值
+        !visible && restModelData.setArticleSettingFormInit(undefined);//清空默认值
         restModelData.setDrawerVisible(visible);
     }
-    
-    const setTitle = (type:string) => {
+
+    const setTitle = () => {
 
         if (restModelData.drawerFormType == 'ARTICLE_SET') {
             return '条文设置'
@@ -53,10 +64,11 @@ const SetDrawer = () => {
         if (restModelData.drawerFormType == 'BATCHSETTING') {
             return '批量设置'
         }
+        return ''
     }
 
-    const onFinishHandle = (values:any)=>{
-        
+    const onFinishHandle = (values: any) => {
+
         if (restModelData.drawerFormType == 'ARTICLE_SET') {
             restModelData.setArticle(values)
         }
@@ -65,96 +77,102 @@ const SetDrawer = () => {
         }
     }
 
+    const setRespDepartment =async () => {
+          const data = await getDepartmentRequest();
+          setrespDepartmentList(data);
+    }
+
+
+    useEffect(() => {
+        if (articleManagement.articleSettingFormInit && articleManagement.articleSettingFormInit.targetScores) {
+            setifsetTargetScore(true);
+        } else {
+            setifsetTargetScore(false);
+        }
+    }, [articleManagement.articleSettingFormInit?.targetScores]);
+
+
+
+    useEffect(()=>{
+        setRespDepartment();
+    },[])
+
+
+
     return (
         <MccsDrawerForm
-            title={setTitle(restModelData.drawerFormType?restModelData.drawerFormType:'')}
+            title={setTitle()}
             width={500}
             formRef={drawerFormRef}
             visible={restModelData.drawerVisible}
-            initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleManagement.articleSettingFormInit } : {}}
+            initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { 
+                ...articleManagement.articleSettingFormInit,
+                main_DepartmentAndManager:[{
+                    responsibilityDepartment:articleManagement.articleSettingFormInit?.responsibilityDepartment,
+                    responsibilityUser:articleManagement.articleSettingFormInit?.responsibilityUser
+                }]
+            } : undefined}
             onFinish={(values: any) => onFinishHandle(values)}
             onVisibleChange={onVisibleChangeHandle}
         >
-                    <div>
-                        <div className='formItemTitle'>负责人及单位</div>
-                        <Row gutter={16}>
-                            <Col className="gutter-row" span={10}>
-                                <ProFormSelect
-                                    name="responsibilityDepartment"
-                                    width='sm'
-                                    showSearch
-                                    request={getDepartmentRequest}
-                                    placeholder="选择单位"
-                                    fieldProps={{
-                                        labelInValue: true,
-                                        onChange: (item, option) => {
-                                            //责任单位修改时清空责任人
-                                            console.log
-                                            drawerFormRef.current?.setFieldsValue({ ...articleManagement.articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
-                                            getDepartmentUsers(item.value, option)
-                                        }
-                                    }}
-                                    rules={[{ required: true, message: '请选择单位!' }]}
-                                />
-                            </Col>
-
-                            <Col className="gutter-row" span={8}>
-                                <ProFormDependency name={['responsibilityDepartment']}>
-                                    {({ responsibilityDepartment }) => {
-                                        return (
-                                            <ProFormSelect
-                                                name="responsibilityUser"
-                                                width='sm'
-                                                disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
-                                                options={departmentManagers}
-                                                placeholder="选择负责人"
-                                                fieldProps={{
-                                                    labelInValue: true,
-                                                }}
-                                                rules={[{ required: true, message: '请选择负责人!' }]}
-                                            />
-                                        )
-                                    }}
-                                </ProFormDependency>
-                            </Col>
-                        </Row>
-                        <div className='formItemTitle'>目标分数</div>
-                        <Row >
-                            <Col span={24}>
-                                <Form.Item name='targetScores' rules={[
-                                    {
-                                        required: true,
-                                        message: '请选择目标分数!',
-                                    },
-                                ]}>
-                                    <MccsClickableTabs
-                                        data={restModelData.targetScores}
-                                    />
-                                </Form.Item>
-                            </Col>
-                        </Row>
-                        {
-                            true && (
-                                <>
-                                    <div className='formItemTitle'>条文组别</div>
-                                    <Row>
-                                        <Col span={24}>
-                                            <Form.Item name='articleType' rules={[
-                                                {
-                                                    required: true,
-                                                    message: '请选择条文组别!',
-                                                },
-                                            ]}>
-                                                <MccsClickableTabs
-                                                    data={restModelData.ruleTypes}
-                                                />
-                                            </Form.Item>
-                                        </Col>
-                                    </Row>
-                                </>
-                            )
-                        }
-                    </div>
+            <div>
+                <div className='formItemTitle require'>负责人及单位</div>
+                <Row >
+                    <Col span={24}>
+                           <Form.Item name='main_DepartmentAndManager'>
+                               <MultiResponsibilitySelecter options={respDepartmentList}  rows={1}  />
+                           </Form.Item>
+                    </Col>
+                </Row>
+                
+
+                <div className='formItemTitle'>合作负责人及单位<span onClick={() => setrows(rows+1)}>添加</span></div>
+                <Row >
+                    <Col span={24}>
+                           <Form.Item name='Co_DepartmentAndManager'>
+                               <MultiResponsibilitySelecter options={respDepartmentList} editable={true}  rows={rows}  />
+                           </Form.Item>
+                    </Col>
+                </Row>
+
+                <div className={ifsetTargetScore ? 'formItemTitle require' : 'formItemTitle'}>目标分数{ifsetTargetScore && <span onClick={() => setifsetTargetScore(false)}>暂不设置</span>}</div>
+                <Row >
+                    <Col span={24}>
+                        <Form.Item name='targetScores' rules={[
+                            {
+                                required: true,
+                                message: '请选择目标分数!',
+                            },
+                        ]}>
+                            <MccsClickableTabs
+                                clear={!ifsetTargetScore}
+                                data={restModelData.targetScores}
+                            />
+                        </Form.Item>
+                    </Col>
+                </Row>
+                {
+                    true && (
+                        <>
+                            <div className='formItemTitle require'>条文组别</div>
+                            <Row>
+                                <Col span={24}>
+                                    <Form.Item name='articleType' rules={[
+                                        {
+                                            required: true,
+                                            message: '请选择条文组别!',
+                                        },
+                                    ]}>
+                                        <MccsClickableTabs
+                                            data={restModelData.ruleTypes}
+                                        />
+                                    </Form.Item>
+                                </Col>
+                            </Row>
+                        </>
+                    )
+                }
+            </div>
         </MccsDrawerForm>
     )
 }

+ 221 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/drawer/multi.tsx

@@ -0,0 +1,221 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-14 11:17:12
+ * @LastEditTime: 2022-03-15 18:29:47
+ * @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/drawer/multi.tsx
+ */
+
+import { ProFormSelect } from "@ant-design/pro-form";
+import { Button, Col,Empty } from "antd";
+import { useEffect, useState } from "react";
+import { getDepartmentList } from "../../../server";
+
+
+export type DataItemType = {
+    id: number;
+    responsibilityDepartment: { label: string; value: number };
+    responsibilityUser: { label: string; value: number };
+    // selectableUsers:{label: string; value: number}[];   //供可选的下拉列表
+    [key: string]: any
+}
+
+type PayloadType = {
+    key?: number;
+    label: string;
+    value: number;
+}
+
+export type MultiResponsibilitySelecterValueType = {
+    responsibilityDepartment: { label: string; value: number };
+    responsibilityUser: { label: string; value: number };
+
+}
+
+//多级责任人及单位设置
+const MultiResponsibilitySelecter = ({ 
+    rows = 0, options = [], value,onChange,editable=false
+}: { 
+    rows: number;
+    options: any[],
+    editable?:boolean;
+    value?: MultiResponsibilitySelecterValueType[],
+    onChange?: (val: DataItemType[]) => void 
+}) => {
+
+    const [data, setdata] = useState<DataItemType[] | []>([]);
+
+    const setDepartmentUsers = async (editItemId: number, payload: any, currentEditItem?: DataItemType) => {
+        // 获取责任单位对应的责任人
+
+        const index = data.findIndex(t => t.id == editItemId);
+
+        if (!payload && currentEditItem) {
+            const resp = await getDepartmentList({ responsibilityDepartmentId: currentEditItem.responsibilityDepartment?.value });
+
+            if (resp) {
+
+                const { list = [] } = resp;
+
+                if (list.length > 0) {
+                    const tempPeople = list[0].sysEmployeeVOList.map((item) => ({
+                        label: item ? item.name : '-',
+                        value: item ? item.id : 0,
+                    }));
+                    
+                    currentEditItem['responsibilityUser'] = tempPeople[0];
+                    // currentEditItem['selectableUsers'] = tempPeople;
+
+                    if (index >= 0) {
+                        const _data = data;
+                        _data.splice(index, 1, currentEditItem);
+                        setdata([..._data]);
+                    }
+
+                }
+            }
+
+        } else {
+            let a = data.filter((v: DataItemType) => v.id == editItemId);
+
+            if (a[0]) {
+                a[0]['responsibilityUser'] = payload;
+                const _data = data;
+                _data.splice(index, 1, a[0]);
+                setdata([..._data]);
+            }
+        }
+
+    };
+
+    const getSelecterTwoList = async (id:number) => {
+        const resp = await getDepartmentList({ responsibilityDepartmentId:id});
+        if (resp) {
+            const { list = [] } = resp;
+            if (list.length > 0) {
+                const tempList = list[0].sysEmployeeVOList.map((item) => ({
+                    label: item ? item.name : '-',
+                    value: item ? item.id : 0,
+                }));
+                return tempList;
+            }
+        }
+        return [];
+    }
+
+    const editDataItem = (id: number, payload: PayloadType) => {
+
+        let currentEditItem = data.filter((v: DataItemType) => v.id == id);
+
+        if (currentEditItem[0]) {
+
+            currentEditItem[0]['responsibilityDepartment'] = payload;
+            setDepartmentUsers(id, undefined, currentEditItem[0]);
+
+        }
+
+    }
+
+    const delhandle = (id:number)=>{
+        const index = data.findIndex(t => t.id == id);
+        const _data = data;
+        _data.splice(index, 1);
+        setdata([..._data]);
+    }
+
+
+    const SelectFormItem = ({ itemData }: { itemData: DataItemType }) => {
+  
+        return (
+            <div style={{ display: 'flex', flexDirection: 'row' }}>
+                <Col className="gutter-row" span={12}>
+                    <ProFormSelect
+                        width='sm'
+                        showSearch
+                        placeholder="选择单位"
+                        options={options}
+                        fieldProps={{
+                            labelInValue: true,
+                            defaultValue: itemData.responsibilityDepartment,
+                            onChange: (item, option) => {
+                                editDataItem(itemData.id, item)
+                            }
+                        }}
+                        rules={[{ required: true, message: '请选择单位!' }]}
+                    />
+                </Col>
+                <Col className="gutter-row" span={editable?8:10}>
+                    <ProFormSelect
+                        width='sm'
+                        // disabled={true}
+                        params={{}}
+                        request={()=>getSelecterTwoList(itemData.responsibilityDepartment.value)}
+                        // options={itemData.selectableUsers}
+                        placeholder="选择负责人"
+                        fieldProps={{
+                            labelInValue: true,
+                            value: itemData.responsibilityUser,
+                            onChange: (item, option) => {
+                                setDepartmentUsers(itemData.id, item)
+                            }
+                        }}
+                        rules={[{ required: true, message: '请选择负责人!' }]}
+                    />
+                </Col>
+                {editable&&<Col><Button onClick={()=>delhandle(itemData.id)} style={{fontSize:14}}>-</Button></Col>}
+            </div>
+        )
+    }
+    
+  
+
+    useEffect(() => {
+        if (rows > 0) {
+            setdata([...data, { id: Math.random(),responsibilityDepartment:{label:'-',value:-1},responsibilityUser:{label:'-',value:-1}}])
+        }
+    }, [rows]);
+
+    useEffect(()=>{
+        onChange&&onChange(data);
+    },[data]);
+
+    useEffect(() => {
+
+        const _value = value?.map(v => {
+            
+            return { 
+            id: Math.random(),
+            // selectableUsers:[],
+             ...v 
+            }
+         });
+
+        if (_value) {
+            setdata(_value);
+        }
+
+    }, []);
+
+
+    return (
+        <div style={{ display: 'flex', flexDirection: 'column' }}>
+            {
+                data.length>0?(
+                    [...data].map((v, k) => {
+                        return (
+                            <SelectFormItem key={k} itemData={v} />
+                        )
+                    })
+                ):(
+                    <div style={{border:'1px solid #eee',height:100,width:'91%',display:'flex',alignItems:'center',justifyContent:'center'}}>
+                         <Empty  image={Empty.PRESENTED_IMAGE_SIMPLE} />
+                    </div>
+                )
+                
+            }
+        </div>
+    )
+}
+
+export default MultiResponsibilitySelecter;

+ 30 - 13
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-03-08 10:41:15
- * @LastEditTime: 2022-03-14 15:56:40
+ * @LastEditTime: 2022-03-15 16:53:03
  * @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
@@ -56,14 +56,8 @@ const ArticleDetail = ({ isModeTwo = false }) => {
 
     const {
         isLeaf,
-        treeData,
-        getTableData,
         currentActivedTree,
-        setCurrentActivedTree,
         scoreList,
-        getDepartmentRequest,
-        departmentManagers,
-        getDepartmentUsers,//获取责任单位人
         currentSelectedActObj,
         ...restModelData
     } = articleManagement;
@@ -262,9 +256,34 @@ const ArticleDetail = ({ isModeTwo = false }) => {
     }
 
 
+    const setDrawerFormInit =  ()=>{
+        if (restModelData.leafData) {
+            const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType,pfmReviewArticleDepartList } = restModelData.leafData.reviewArticle;
+            if (responsibilityDepartmentName && responsibilityDepartmentId) {
+
+                restModelData.setArticleSettingFormInit({
+                    Co_DepartmentAndManager:pfmReviewArticleDepartList.map(t=>({
+                        responsibilityDepartment:{label:t.responsibilityDepartmentName,value:t.responsibilityDepartmentId},
+                        responsibilityUser:{label:t.responsibilityUserName,value:t.responsibilityUserId}
+                    })),
+                    responsibilityDepartment: { label: responsibilityDepartmentName, value: responsibilityDepartmentId },
+                    responsibilityUser: { label: responsibilityUserName, value: responsibilityUserId },
+                    targetScores: { label: targetEvaluation, value: targetEvaluation },
+                    articleType: { label: accountType, value: accountType },
+                });
+            }
+
+            restModelData.getGradeOptions();  //获取可选档次
+            restModelData.getAccoutTypeOptions(); //可选类型
+
+        }
+    }
+
+
     const articleSetBtnHandle = () => {
         //条文设置
         restModelData.setDrawerFormType('ARTICLE_SET');
+        setDrawerFormInit();
         restModelData.setDrawerVisible(true);
 
     }
@@ -314,7 +333,8 @@ const ArticleDetail = ({ isModeTwo = false }) => {
             {
                 //抽屉
             }
-            <SetDrawer />
+
+            {restModelData.drawerVisible&&<SetDrawer />}
             
             {
                 isLeaf && (
@@ -419,17 +439,14 @@ const ArticleDetail = ({ isModeTwo = false }) => {
                                         <div className='card' key={index} style={{ marginBottom: isModeTwo ? 0 : '16px', paddingBottom: isModeTwo ? 0 : '16px', paddingTop: isModeTwo ? 0 : '16px' }}>
                                             <div className='cardTitle' style={{ marginBottom: isModeTwo ? '8px' : '16px' }}>{`执行情况说明(等级${item.level})`}</div>
 
-                                            <TextArea  showCount maxLength={2000}
-                                                className='aticleTextarea'
+                                            <TextArea showCount maxLength={2000}
                                                 autoSize={{
                                                     minRows: 5,
                                                     maxRows: 20
                                                 }}
-                
                                                 disabled={!restModelData.editMode} value={item.note}
                                                 onChange={e => onTextAreaChange(e, item.level)}
-                                                style={{ marginBottom: 20,width:'100%' }} 
-                                            />
+                                                style={{ marginBottom: 20 }} />
 
                                             {
                                                 !isModeTwo && (

+ 9 - 7
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/style.less

@@ -1,10 +1,5 @@
 
-.aticleTextarea {
-   
-  textarea {
-    width: 100% !important;
-  }
-}
+
 
 .articleDetailContainer {
       
@@ -236,5 +231,12 @@
           height:55px;
           overflow-y: hidden;
         }
-      }
+    }
+    .cardWrap {
+         .card {
+          textarea {
+            width: 100%;
+          }
+         }
+    }
 }

+ 147 - 93
src/pages/GradeHospitalAccreditation/articleManagement/index.less

@@ -1,4 +1,3 @@
-
 .ArticleManagement {
       //overwrite antd css
 .mwc-ant-col-6 {
@@ -9,10 +8,6 @@
   align-items: flex-start;
 }
 
-.mwc-ant-pro-table-search {
-  padding-bottom: 0;
-}
-
 .mwc-ant-pro-page-container-warp {
   display: none !important;
 }
@@ -29,70 +24,43 @@ textarea.mwc-ant-input {
   color: #525866 !important;
 }
 
-//----------------
 
+  .ant-pro-page-container-warp {
+    display: none !important;
+  }
 
-.onlyMyselfFilter {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 16px;
-  padding: 0 8px;
-  &>span {
-    font-size: 14px;
+  .ant-pro-card-col {
+    transition: width 0.2s ease-in;
+    transform: translate3d(0, 0, 0);
+  }
+
+  textarea.ant-input {
+    font-size: 14px !important;
     font-family: SourceHanSansCN-Normal, SourceHanSansCN;
     font-weight: 400;
-    color: #525966;
+    color: #525866 !important;
   }
-}
 
+  //----------------
 
-.selfEvaluationWrap {
-    padding: 16px;
-    background: #FFFFFF;
-    border-radius: 2px;
-    margin-bottom: 16px;
-    margin-top: 16px;
-  .selfEvaluation {
+
+  .onlyMyselfFilter {
     display: flex;
-    height: 28px;
     flex-direction: row;
+    justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    padding: 0 8px;
 
-    span {
-      font-size: 20px;
-      font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-      font-weight: 500;
-      padding-left: 16px;
-    }
-  }
-  .wrap {
-    .tab {
-      width: 20%;
-      height: 28px;
-      cursor: pointer;
-      text-align: center;
-      line-height: 28px;
-      background: #F7F8FA;
-      border-radius: 14px;
+    &>span {
       font-size: 14px;
       font-family: SourceHanSansCN-Normal, SourceHanSansCN;
       font-weight: 400;
-      color: #525866;
-      margin-right: 16px;
-
-      &.on {
-        color: #3377FF;
-        background: #EBF1FF;
-      }
-
-      &:last-child {
-        margin-right: 0;
-      }
+      color: #525966;
     }
   }
 
+
 }
 .cardWrap {
   overflow-y: scroll;
@@ -101,80 +69,166 @@ textarea.mwc-ant-input {
     background: #FFFFFF;
     border-radius: 2px;
     margin-bottom: 16px;
+    margin-top: 16px;
 
-    .cardTitle {
-      font-size: 14px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      color: #292C33;
+    .selfEvaluation {
+      display: flex;
+      height: 28px;
+      flex-direction: row;
+      align-items: center;
+
+      span {
+        font-size: 20px;
+        font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+        font-weight: 500;
+        padding-left: 16px;
+      }
+    }
+
+    .wrap {
+      .tab {
+        width: 20%;
+        height: 28px;
+        cursor: pointer;
+        text-align: center;
+        line-height: 28px;
+        background: #F7F8FA;
+        border-radius: 14px;
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        color: #525866;
+        margin-right: 16px;
+
+        &.on {
+          color: #3377FF;
+          background: #EBF1FF;
+        }
+
+        &:last-child {
+          margin-right: 0;
+        }
+      }
+    }
+
+  }
+
+  .cardWrap {
+    overflow-y: scroll;
+
+    .card {
+      padding: 16px;
+      background: #FFFFFF;
+      border-radius: 2px;
       margin-bottom: 16px;
+
+      .cardTitle {
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        color: #292C33;
+        margin-bottom: 16px;
+      }
+
+      &:last-child {
+        margin-bottom: 0 !important;
+
+      }
     }
 
+    &.isModeTwo {
+      padding-top: 16px;
+      background-color: #FFFFFF;
+    }
+
+
     
 
     &:last-child {
       margin-bottom: 0 !important;
-    
+    .ant-form-item {
+      margin-bottom: 0;
     }
   }
 
-  &.isModeTwo {
-    padding-top: 16px;
+  .card {
+    padding: 16px;
     background-color: #FFFFFF;
   }
 
+
   .mwc-ant-form-item {
     margin-bottom: 0;
   }
 }
 
-.card {
-  padding: 16px;
-  background-color: #FFFFFF;
-}
 
 
+  .selfEvolutionTitle {
+    text-align: left;
+    font-size: 16px;
+    font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+    font-weight: 400;
+    color: #7A8599;
+    margin-top: 20px;
 
-.selfEvolutionTitle {
-  text-align: left;
-  font-size: 16px;
-  font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-  font-weight: 400;
-  color: #7A8599;
-  margin-top: 20px;
+  }
 
-}
+  .selfEvolutionArea {
+    text-align: center;
+    line-height: 50px;
+    background: #FFFFFF;
+    border-radius: 10px;
+    border: 1px dashed #DADEE6;
+    margin-top: 20px;
+    margin-bottom: 40px;
+    padding: 10px;
+    padding-top: 40px;
+  }
 
-.selfEvolutionArea {
-  text-align: center;
-  line-height: 50px;
-  background: #FFFFFF;
-  border-radius: 10px;
-  border: 1px dashed #DADEE6;
-  margin-top: 20px;
-  margin-bottom: 40px;
-  padding: 10px;
-  padding-top: 40px;
-}
+  .tabWrap {
+    justify-content: space-around;
+  }
+
+  .formItemTitle {
+    font-size: 16px;
+    font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+    font-weight: 400;
+    color: #7A8599;
+    margin-bottom: 16px;
+  }
 
-.tabWrap {
-  justify-content: space-around;
 }
 
 .formItemTitle {
+  position: relative;
   font-size: 16px;
   font-family: SourceHanSansCN-Normal, SourceHanSansCN;
   font-weight: 400;
   color: #7A8599;
   margin-bottom: 16px;
-}
 
-}
+  &>span {
+       position: absolute;
+       right:42px;
+       top:6px;
+       font-size: 12px;
+       color: #598cf0;
+       cursor: pointer;
+       &:hover {
+           color: #3377FF;
+       }
+  }
 
-.formItemTitle {
-  font-size: 16px;
-  font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-  font-weight: 400;
-  color: #7A8599;
-  margin-bottom: 16px;
+  &.require {
+    &::before {
+      display: inline-block;
+      position: relative;
+      top: -2px;
+      content: '*';
+      margin-right: 4px;
+      color: rgb(255, 77, 79);
+      font-size: 14px;
+    }
+  }
 }

+ 10 - 24
src/pages/GradeHospitalAccreditation/articleManagement/index.tsx

@@ -1,4 +1,12 @@
 
+/*
+ * @Author: your name
+ * @Date: 2021-09-14 10:22:09
+ * @LastEditTime: 2022-03-15 16:35:22
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
+ */
 
 
 
@@ -65,9 +73,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         currentActivedTree,
         setCurrentActivedTree,
         scoreList,
-        getDepartmentRequest,
-        departmentManagers,
-        getDepartmentUsers,//获取责任单位人
         currentSelectedActObj,
         setdetailDrawerVisible,
         detailDrawerVisible,
@@ -251,7 +256,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         //左侧树节点点击回调
         setCurrentActivedTree(data);
         restModelData.setCurrentSelectedActObj(data);
-        articleManagement.setArticleSettingFormInit({});//清空默认值
+        articleManagement.setArticleSettingFormInit(undefined);//清空默认值
         //重新获取数据
         tableRef?.current?.getTableRef().current?.reload();
     }
@@ -310,26 +315,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     }, [restModelData]);
 
 
-    useEffect(() => {
-        //点击叶子结点时回调
-        if (restModelData.leafData) {
-            const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType } = restModelData.leafData.reviewArticle;
-            if (responsibilityDepartmentName && responsibilityDepartmentId) {
-
-                articleManagement.setArticleSettingFormInit({
-                    responsibilityDepartment: { label: responsibilityDepartmentName, value: responsibilityDepartmentId },
-                    responsibilityUser: { label: responsibilityUserName, value: responsibilityUserId },
-                    targetScores: { label: targetEvaluation, value: targetEvaluation },
-                    articleType: { label: accountType, value: accountType },
-                });
-            }
-
-            restModelData.getGradeOptions();  //获取可选档次
-            restModelData.getAccoutTypeOptions(); //可选类型
-
-        }
-
-    }, [restModelData.leafData]);
+  
 
 
     useEffect(() => {

+ 65 - 43
src/pages/GradeHospitalAccreditation/articleManagement/model.ts

@@ -1,4 +1,13 @@
 
+/*
+ * @Author: your name
+ * @Date: 2021-09-14 10:46:45
+ * @LastEditTime: 2022-03-15 16:49:41
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
+ */
+
 
 import { useState, useEffect } from 'react';
 import {
@@ -25,6 +34,7 @@ import {
 } from '@/pages/PlatformMana/generalSetting/serve';
 
 import { notification } from 'antd';
+import { DataItemType, MultiResponsibilitySelecterValueType } from './components/articleDetailModule/drawer/multi';
 
 export interface ImplementationDataItem {
   level: string;
@@ -40,9 +50,7 @@ const articleManagement = () => {
   const [isLeaf, setIsLeaf] = useState(false);
   const [scoreList, setScoreList] = useState<{ label: string; value: string }[]>([]);
   const [leafData, setLeafData] = useState<API.LeafDataType>(); // 叶子结点数据
-  const [departmentManagers, setDepartmentManagers] = useState<{ label: string; value: number }[]>(
-    [],
-  );
+  
 
   const [targetScores, setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
   const [ruleTypes, setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
@@ -90,7 +98,14 @@ const articleManagement = () => {
 
   const [gradeOptions, setGradeOptions] = useState<{ label: string, value: string | number }[]>([]);
   const [accountTypeOptions, setAccountTypeOptions] = useState<{ label: string, value: string | number }[]>([]);
-  const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  //条文设置表单回显默认值
+  const [articleSettingFormInit, setArticleSettingFormInit] = useState<{
+    responsibilityDepartment:{label:string;value:any};
+    responsibilityUser:{label:string;value:any};
+    Co_DepartmentAndManager:MultiResponsibilitySelecterValueType[];
+    targetScores:{label:string;value:any};
+    articleType:{label:string;value:any};
+    
+  }|undefined>(undefined);  //条文设置表单回显默认值
 
   const [currentSelectedActObj, setCurrentSelectedActObj] = useState<any>(undefined);  //当前正在操作的对象,例如当前选中的树中层级数据,点击详情的的行数据
 
@@ -166,7 +181,8 @@ const articleManagement = () => {
               responsibilityUserName: '-',
               accountType: '-',
               hospId: -1,
-              userId: -1
+              userId: -1,
+              pfmReviewArticleDepartList:[]
             },
             pfmViewRuleDetailDataVoList: [],
             pfmImplementations: [],
@@ -193,33 +209,47 @@ const articleManagement = () => {
 
   type FormValueType = {
     articleType: { label: string; value: any };
-    responsibilityDepartment: { label: string; value: number;[key: string]: any };
-    responsibilityUser: { label: string; value: number;[key: string]: any };
+
+    Co_DepartmentAndManager:DataItemType[];
+    main_DepartmentAndManager:DataItemType[];
+
     targetScores: { label: string; value: any };
   };
 
   const batchSetting = async (values: FormValueType) => {
     // 批量设置
-    const resp = await batchSettingArticle({
-      ruleIds: selectedRowKeys,
-      responsibilityDepartmentId: values.responsibilityDepartment.value,
-      responsibilityDepartmentName: values.responsibilityDepartment.label,
-      responsibilityUserId: values.responsibilityUser.value,
-      responsibilityUserName: values.responsibilityUser.label,
-      targetEvaluation: values.targetScores.value,
-      articleType: values.articleType.value,
-    });
-
-    if (resp) {
+    const {main_DepartmentAndManager,Co_DepartmentAndManager} = values;
+    
+    if(main_DepartmentAndManager[0]){
+      const resp = await batchSettingArticle({
+        ruleIds: selectedRowKeys,
+        responsibilityDepartmentId: main_DepartmentAndManager[0].responsibilityDepartment.value,
+        responsibilityDepartmentName: main_DepartmentAndManager[0].responsibilityDepartment.label,
+        responsibilityUserId: main_DepartmentAndManager[0].responsibilityUser.value,
+        responsibilityUserName:main_DepartmentAndManager[0].responsibilityUser.label,
+        targetEvaluation: values.targetScores.value,
+        articleType: values.articleType.value,
+        responsibilityList:Co_DepartmentAndManager.map(t=>({
+          responsibilityDepartmentId: t.responsibilityDepartment.value,
+          responsibilityDepartmentName: t.responsibilityDepartment.label,
+          responsibilityUserId: t.responsibilityUser.value,
+          responsibilityUserName:t.responsibilityUser.label,
+        }))
+      });
+  
+      if (resp) {
+    
+        setReloadRightContent(true);
   
-      setReloadRightContent(true);
-      return true;
+        return true;
+      }
     }
+    
   };
 
   const setArticle = async (values: FormValueType) => {
     // 条文设置
-
+    
     setifHasEdit(true);
 
     if (currentActivedTree && leafData) {
@@ -235,15 +265,23 @@ const articleManagement = () => {
 
       const { id } = leafData.reviewArticle;
 
+      const {main_DepartmentAndManager,Co_DepartmentAndManager} = values;
+
       const paramsData = {
         id,
         ruleId: ruleId,
-        responsibilityDepartmentId: values.responsibilityDepartment.value,
-        responsibilityDepartmentName: values.responsibilityDepartment.label,
-        responsibilityUserId: values.responsibilityUser.value,
-        responsibilityUserName: values.responsibilityUser.label,
+        responsibilityDepartmentId: main_DepartmentAndManager[0].responsibilityDepartment.value,
+        responsibilityDepartmentName: main_DepartmentAndManager[0].responsibilityDepartment.label,
+        responsibilityUserId: main_DepartmentAndManager[0].responsibilityUser.value,
+        responsibilityUserName:main_DepartmentAndManager[0].responsibilityUser.label,
         targetEvaluation: values.targetScores.value,
         articleType: values.articleType.value,
+        responsibilityList:Co_DepartmentAndManager.map(t=>({
+          responsibilityDepartmentId: t.responsibilityDepartment.value,
+          responsibilityDepartmentName: t.responsibilityDepartment.label,
+          responsibilityUserId: t.responsibilityUser.value,
+          responsibilityUserName:t.responsibilityUser.label,
+        }))
       };
 
       const resp = await settingArticle(paramsData);
@@ -262,20 +300,7 @@ const articleManagement = () => {
     }
   };
 
-  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 : '-',
-          value: item ? item.id : 0,
-        }));
-        setDepartmentManagers(tempPeople);
-      }
-    }
-  };
+  
 
   const getSelfEvaluationRecordList = async (id: number) => {
     const resp = await getSelfEvaluation(id);
@@ -576,8 +601,7 @@ const articleManagement = () => {
   }
 
   useEffect(()=>{
-       console.log({detailDrawerVisible});
-
+  
        if(!detailDrawerVisible&&ifHasEdit){
             //详情抽屉关闭时刷新table
             setReloadRightContent(true);
@@ -693,8 +717,6 @@ const articleManagement = () => {
     setCurrentActivedTree,
     scoreList, // 评分
     getDepartmentRequest,
-    departmentManagers,
-    getDepartmentUsers,
     targetScores,
     ruleTypes,
     leafData,

+ 19 - 1
src/pages/GradeHospitalAccreditation/articleManagement/typings.d.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:42
- * @LastEditTime: 2021-12-31 14:51:31
+ * @LastEditTime: 2022-03-15 16:50:59
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/typings.d.ts
@@ -82,6 +82,12 @@ declare namespace API {
     accountType: string; // 条文组别
     hospId: number;
     userId: number,
+    pfmReviewArticleDepartList:{
+      responsibilityDepartmentId:number;
+      responsibilityDepartmentName:string;
+      responsibilityUserId:number;
+      responsibilityUserName:string;
+    }[];  //合作单位及负责人
     // recordDay: number;
     // createTime: number;
     // updateTime: number;
@@ -103,6 +109,12 @@ declare namespace API {
     responsibilityUserName: string;
     targetEvaluation: string;
     articleType: string;
+    responsibilityList:{
+      responsibilityDepartmentId:number;
+      responsibilityDepartmentName:string;
+      responsibilityUserId:number;
+      responsibilityUserName:string;
+    }[];
   };
 
   type tableDataItemType = {
@@ -126,6 +138,12 @@ declare namespace API {
     responsibilityUserName: string;
     targetEvaluation: string;
     articleType: string;
+    responsibilityList:{
+      responsibilityDepartmentId:number;
+      responsibilityDepartmentName:string;
+      responsibilityUserId:number;
+      responsibilityUserName:string;
+    }[];
   };
 
   type GetSelfEvaluationRequestType = {

+ 1 - 4
src/pages/reports/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-03-03 18:04:40
- * @LastEditTime: 2022-03-11 18:36:56
+ * @LastEditTime: 2022-03-15 16:55:26
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/reports/index.tsx
@@ -22,7 +22,6 @@ export default () => {
 
   useEffect(() => {
     setloading(true);
-    console.log({initialState});
     if (initialState && initialState.spacicalPageParamsType && initialState.currentUser) {
       const {
         spacicalPageParamsType,
@@ -31,8 +30,6 @@ export default () => {
       const { pathname } = location;
       const spacialPage = spacicalPageParamsType.filter((t) => `/app1${t.path}` == pathname);
 
-      console.log({pathname,spacialPage,spacicalPageParamsType,initialState});
-
       if (spacialPage.length > 0) {
         //当前页面属于有数数据展示页面
         console.log(`${spacialPage[0].url}&token=${youshuToken}`);