|
@@ -1,18 +1,31 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-14 10:46:45
|
|
|
- * @LastEditTime: 2021-11-12 18:05:38
|
|
|
+ * @LastEditTime: 2021-12-27 18:07:40
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
|
|
|
*/
|
|
|
|
|
|
import { useState, useEffect } from 'react';
|
|
|
-import { getTreeFileTableData,getDepartmentList,settingArticle,batchSettingArticle,getSelfEvaluation,
|
|
|
- uploadFilePost,selfEvolutionCommit,delHistoryRecods,getUploadLedgerSelectableType,getCurrentHospSelfScore,getRuleChildrens,
|
|
|
+import {
|
|
|
+ getTreeFileTableData,
|
|
|
+ getDepartmentList,
|
|
|
+ settingArticle,
|
|
|
+ batchSettingArticle,
|
|
|
+ getSelfEvaluation,
|
|
|
+ uploadFilePost,
|
|
|
+ selfEvolutionCommit,
|
|
|
+ delHistoryRecods,
|
|
|
+ getUploadLedgerSelectableType,
|
|
|
+ getCurrentHospSelfScore,
|
|
|
+ getRuleChildrens,
|
|
|
} from './server';
|
|
|
-import {getTreeList} from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
|
|
|
-import {getScoreLevelData,getAccreditationTypeData} from '@/pages/PlatformMana/generalSetting/serve';
|
|
|
+import { getTreeList } from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
|
|
|
+import {
|
|
|
+ getScoreLevelData,
|
|
|
+ getAccreditationTypeData,
|
|
|
+} from '@/pages/PlatformMana/generalSetting/serve';
|
|
|
import { notification } from 'antd';
|
|
|
|
|
|
//articleManagement
|
|
@@ -21,80 +34,86 @@ const articleManagement = () => {
|
|
|
// const [tableData, setTableData] = useState([]);
|
|
|
const [currentActivedTree, setCurrentActivedTree] = useState<MccsFileTree.childTree>();
|
|
|
const [isLeaf, setIsLeaf] = useState(false);
|
|
|
- const [scoreList, setScoreList] = useState<any[]>([]);
|
|
|
+ const [scoreList, setScoreList] = useState<{ label: string; value: string }[]>([]);
|
|
|
const [leafData, setLeafData] = useState<API.LeafDataType>(); //叶子结点数据
|
|
|
- const [departmentManagers, setDepartmentManagers] = useState([]);
|
|
|
- const [selectedDepartment,setSelectedDepartment] = useState<any>();
|
|
|
- const [targetScores,setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
|
|
|
- const [ruleTypes,setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
|
|
|
- const [records,setRecords]=useState<MccsRecordList.MccsRecordListType>([]);
|
|
|
- const [selfEvaluationRecords,setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); //自评记录
|
|
|
- const [selectedRowKeys,setSelectedRowKeys] = useState<number[]|string[]>([]);
|
|
|
+ const [departmentManagers, setDepartmentManagers] = useState<{label:string,value:number}[]>([]);
|
|
|
+ const [selectedDepartment, setSelectedDepartment] = useState<any>();
|
|
|
+ const [targetScores, setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
|
|
|
+ const [ruleTypes, setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
|
|
|
+ const [records, setRecords] = useState<MccsRecordList.MccsRecordListType>([]);
|
|
|
+ const [selfEvaluationRecords, setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); //自评记录
|
|
|
+ const [selectedRowKeys, setSelectedRowKeys] = useState<number[] | string[]>([]);
|
|
|
|
|
|
const [drawerVisible, setDrawerVisible] = useState(false);
|
|
|
- const [drawerFormType,setDrawerFormType] = useState<'ARTICLE_SET'|'BATCHSETTING'>('ARTICLE_SET');
|
|
|
+ const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING'>(
|
|
|
+ 'ARTICLE_SET',
|
|
|
+ );
|
|
|
|
|
|
- const [reloadRightContent,setReloadRightContent] = useState(false);
|
|
|
+ const [reloadRightContent, setReloadRightContent] = useState(false);
|
|
|
|
|
|
- const [moduleMode,setModuleMode] = useState(false); //true台账上传 false条文管理
|
|
|
+ const [moduleMode, setModuleMode] = useState(false); //true台账上传 false条文管理
|
|
|
|
|
|
- const [tabKey,setTabKey] = useState<string|number>(); //antd Tab切换
|
|
|
+ const [tabKey, setTabKey] = useState<string | number>(); //antd Tab切换
|
|
|
|
|
|
- const [modalVisible,setModalVisible] = useState(false);
|
|
|
+ const [modalVisible, setModalVisible] = useState(false);
|
|
|
|
|
|
const [uploadFormInitValue, setUploadFormInitValue] = useState<any>();
|
|
|
|
|
|
- const [selectedSelfEvolution,setSelectedSelfEvolution] = useState<{label:string,value:any}>(); //MccsClickableTabs value值
|
|
|
+ const [selectedSelfEvolution, setSelectedSelfEvolution] =
|
|
|
+ useState<{ label: string; value: any }>(); //MccsClickableTabs value值
|
|
|
|
|
|
- const [currentSelectedSelefEvolution,setCurrentSelectedSelefEvolution] = useState<{label:string,value:any}>(); //MccsClickableTabs 点击对象
|
|
|
+ const [currentSelectedSelefEvolution, setCurrentSelectedSelefEvolution] = useState<{ label: string; value: any }>(); //当前选中自评 点击对象
|
|
|
|
|
|
- const [uploadLedgerTypeList,setUploadLedgerTypeList] = useState<MccsClickableTabs.TabType[]>([]); //上传台账可选类型
|
|
|
+ const [uploadLedgerTypeList, setUploadLedgerTypeList] = useState<MccsClickableTabs.TabType[]>([]); //上传台账可选类型
|
|
|
|
|
|
- const [currentHospSelfScoreAndOthers,setCurrentHospSelfScoreAndOthers] = useState<string>(); //当前医院评分及自评结果
|
|
|
+ const [currentHospSelfScoreAndOthers, setCurrentHospSelfScoreAndOthers] = useState<string>(); //当前医院评分及自评结果
|
|
|
|
|
|
- const getArticleTreeData = async (keyword?:string|number) => {
|
|
|
- //获取树数据
|
|
|
- const { list = [] } = await getTreeList(keyword);
|
|
|
- setTreeData(list);
|
|
|
+ const [editMode,setEditMode] = useState(false); //编辑模式,台帐上传页面用到
|
|
|
+
|
|
|
+
|
|
|
+ const getArticleTreeData = async (keyword?: string | number) => {
|
|
|
+ //获取树数据
|
|
|
+ const { list = [] } = await getTreeList(keyword);
|
|
|
+ setTreeData(list);
|
|
|
};
|
|
|
-
|
|
|
|
|
|
const getTableData = async (params?: any, sorter?: any, filter?: any) => {
|
|
|
//根据选中树结构的id获取对应的详情
|
|
|
// console.log({params});
|
|
|
|
|
|
- let specifyId:number|null = null;
|
|
|
+ let specifyId: number | null = null;
|
|
|
|
|
|
- if(params&¶ms.id){
|
|
|
+ if (params && params.id) {
|
|
|
//当存在指定id
|
|
|
- specifyId = params.id
|
|
|
+ specifyId = params.id;
|
|
|
}
|
|
|
|
|
|
- if (currentActivedTree||specifyId) {
|
|
|
- const resp = await getTreeFileTableData(specifyId?{
|
|
|
- //传入树结构id指定获取某一节点对应数据
|
|
|
- ...params,
|
|
|
- id:specifyId
|
|
|
- }:{
|
|
|
- //直接拿树结构id
|
|
|
- ...params,
|
|
|
- id: currentActivedTree ? currentActivedTree.id : 0,
|
|
|
- },moduleMode);
|
|
|
-
|
|
|
+ if (currentActivedTree || specifyId) {
|
|
|
+ const resp = await getTreeFileTableData(
|
|
|
+ specifyId
|
|
|
+ ? {
|
|
|
+ //传入树结构id指定获取某一节点对应数据
|
|
|
+ ...params,
|
|
|
+ id: specifyId,
|
|
|
+ }
|
|
|
+ : {
|
|
|
+ //直接拿树结构id
|
|
|
+ ...params,
|
|
|
+ id: currentActivedTree ? currentActivedTree.id : 0,
|
|
|
+ },
|
|
|
+ moduleMode,
|
|
|
+ );
|
|
|
+
|
|
|
if (resp) {
|
|
|
- const {
|
|
|
- page,
|
|
|
- leafData,
|
|
|
- isLeaf,
|
|
|
- } = resp;
|
|
|
+ const { page, leafData, isLeaf } = resp;
|
|
|
|
|
|
- if (!isLeaf&&page) {
|
|
|
+ if (!isLeaf && page) {
|
|
|
//非叶子结点返回table数据
|
|
|
- const { list = [],totalCount } = page;
|
|
|
+ const { list = [], totalCount } = page;
|
|
|
return {
|
|
|
data: list,
|
|
|
success: true,
|
|
|
- total:totalCount
|
|
|
+ total: totalCount,
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -106,387 +125,327 @@ const articleManagement = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
- const getDepartmentRequest = async ()=>{
|
|
|
- //获取单位列表
|
|
|
- const resp = await getDepartmentList();
|
|
|
- if(resp){
|
|
|
- const {list=[]} = resp;
|
|
|
- return list.map((item:any)=>({
|
|
|
- label:item.name,
|
|
|
- value:item.id
|
|
|
- }))
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ const getDepartmentRequest = async () => {
|
|
|
+ //获取单位列表
|
|
|
+ const resp = await getDepartmentList();
|
|
|
+ if (resp) {
|
|
|
+ const { list = [] } = resp;
|
|
|
+ return list.map((item: any) => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ }));
|
|
|
+ }else{
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
type FormValueType = {
|
|
|
- articleType:{label:string,value:any},
|
|
|
- responsibilityDepartment:{label:string,value:number,[key:string]:any},
|
|
|
- responsibilityUser:{label:string,value:number,[key:string]:any},
|
|
|
- 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){
|
|
|
- //重新刷新表格
|
|
|
- setReloadRightContent(true);
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ articleType: { label: string; value: any };
|
|
|
+ responsibilityDepartment: { label: string; value: number; [key: string]: any };
|
|
|
+ responsibilityUser: { label: string; value: number; [key: string]: any };
|
|
|
+ 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) {
|
|
|
+ //重新刷新表格
|
|
|
+ setReloadRightContent(true);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
- const setArticle = async (values:FormValueType)=>{
|
|
|
+ const setArticle = async (values: FormValueType) => {
|
|
|
//条文设置
|
|
|
// console.log({values});
|
|
|
- if(currentActivedTree&&leafData){
|
|
|
- const { id:ruleId } = currentActivedTree;
|
|
|
- const {id} = leafData;
|
|
|
+ if (currentActivedTree && leafData) {
|
|
|
+ const { id: ruleId } = currentActivedTree;
|
|
|
+ const { id } = leafData.reviewArticle;
|
|
|
|
|
|
let paramsData = {
|
|
|
id,
|
|
|
- ruleId:Number(ruleId),
|
|
|
- responsibilityDepartmentId:values.responsibilityDepartment.value,
|
|
|
- responsibilityDepartmentName:values.responsibilityDepartment.label,
|
|
|
- responsibilityUserId:values.responsibilityUser.value,
|
|
|
- responsibilityUserName:values.responsibilityUser.label,
|
|
|
- targetEvaluation:values.targetScores.value,
|
|
|
- articleType:values.articleType.value
|
|
|
- }
|
|
|
+ ruleId: Number(ruleId),
|
|
|
+ responsibilityDepartmentId: values.responsibilityDepartment.value,
|
|
|
+ responsibilityDepartmentName: values.responsibilityDepartment.label,
|
|
|
+ responsibilityUserId: values.responsibilityUser.value,
|
|
|
+ responsibilityUserName: values.responsibilityUser.label,
|
|
|
+ targetEvaluation: values.targetScores.value,
|
|
|
+ articleType: values.articleType.value,
|
|
|
+ };
|
|
|
const resp = await settingArticle(paramsData);
|
|
|
- if(resp){
|
|
|
+ if (resp) {
|
|
|
//更新界面信息
|
|
|
getTableData();
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
- const getDepartment = async (item:any,option:any)=>{
|
|
|
+ const getDepartment = async (item: any, option: any) => {
|
|
|
//获取责任单位
|
|
|
setSelectedDepartment(option);
|
|
|
|
|
|
- const resp = await getDepartmentList({'responsibilityDepartmentId':item.value});
|
|
|
- if(resp){
|
|
|
- const {list=[]} = resp;
|
|
|
- const tempPeople = list.map((item:any)=>({
|
|
|
- label:item.deptManagerName,
|
|
|
- value:item.deptManagerId
|
|
|
- }));
|
|
|
- setDepartmentManagers(tempPeople);
|
|
|
+ const resp = await getDepartmentList({ responsibilityDepartmentId: item.value });
|
|
|
+ if (resp) {
|
|
|
+ const { list = [] } = resp;
|
|
|
+ if (list.length > 0) {
|
|
|
+ const tempPeople = list[0].sysEmployeeVOList.map((item) => ({
|
|
|
+ label: item?item.name:'null',
|
|
|
+ value: item?item.id:0,
|
|
|
+ }));
|
|
|
+ setDepartmentManagers(tempPeople);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- const getSelfEvaluationRecordList = async (id:number)=>{
|
|
|
-
|
|
|
- const resp = await getSelfEvaluation(id);
|
|
|
-
|
|
|
- if(resp){
|
|
|
- const {list}:{list:API.GetSelfEvaluationRequestType} = resp;
|
|
|
- const tempArr = list.map(t =>({
|
|
|
- evaluation:t.selfEvaluation,
|
|
|
- details:[{
|
|
|
- name:t.userName,
|
|
|
- fileName:t.selfEvaluation,
|
|
|
- fileUrl:'',
|
|
|
- historyRecords:[],
|
|
|
+ const getSelfEvaluationRecordList = async (id: number) => {
|
|
|
+ const resp = await getSelfEvaluation(id);
|
|
|
+
|
|
|
+ if (resp) {
|
|
|
+ const { list }: { list: API.GetSelfEvaluationRequestType } = resp;
|
|
|
+ const tempArr = list.map((t) => ({
|
|
|
+ evaluation: t.selfEvaluation,
|
|
|
+ details: [
|
|
|
+ {
|
|
|
+ name: t.userName,
|
|
|
+ fileName: t.selfEvaluation,
|
|
|
+ fileUrl: '',
|
|
|
+ historyRecords: [],
|
|
|
// recordTypeName:t.selfEvaluation,
|
|
|
- createTime:t.createDate
|
|
|
- }]
|
|
|
- }));
|
|
|
- setSelfEvaluationRecords(tempArr)
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- const uploadFile = async (values:any)=>{
|
|
|
- console.log({'表单':values});
|
|
|
-
|
|
|
- if(leafData){
|
|
|
- // console.log({'上传表单':values});
|
|
|
- try{
|
|
|
- const {files:{fileList=[]},tab,publicCateId} = values;
|
|
|
- const {id,accountType} = leafData;
|
|
|
- let formData = new FormData();
|
|
|
- fileList.map((t:MccsUpload.UploadFile)=>{
|
|
|
- formData.append('file',t.originFileObj);
|
|
|
- });
|
|
|
- formData.append('id',id.toString());
|
|
|
- formData.append('categoryType',accountType);
|
|
|
- //应产品要求‘制度’是不可变,根据制度获取对应关系
|
|
|
- tab.value.label == '制度'&&formData.append('publicCateId',publicCateId);
|
|
|
-
|
|
|
- if(uploadFormInitValue&&JSON.stringify(uploadFormInitValue) != '{}'){
|
|
|
- //重新上传不允许修改类型
|
|
|
- const {tab} = uploadFormInitValue;
|
|
|
- formData.append('accountType',tab.label);
|
|
|
- formData.append('accountName',tab.value.label);
|
|
|
-
|
|
|
- }else{
|
|
|
- formData.append('accountType',tab.label);
|
|
|
- formData.append('accountName',tab.value.label);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- const resp = await uploadFilePost(formData);
|
|
|
- if(resp){
|
|
|
- //上传成功,获取最新台账记录
|
|
|
- getTableData();
|
|
|
- }
|
|
|
- setModalVisible(false);
|
|
|
- //每次提交完清空表单默认值
|
|
|
- setUploadFormInitValue(undefined);
|
|
|
- }catch(err){
|
|
|
- console.log({err});
|
|
|
- }
|
|
|
-
|
|
|
+ createTime: t.createDate,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }));
|
|
|
+ setSelfEvaluationRecords(tempArr);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const uploadFile = async (values: any) => {
|
|
|
+ console.log({ 表单: values });
|
|
|
+
|
|
|
+ if (leafData) {
|
|
|
+ // console.log({'上传表单':values});
|
|
|
+ try {
|
|
|
+ const {
|
|
|
+ files: { fileList = [] },
|
|
|
+ tab,
|
|
|
+ publicCateId,
|
|
|
+ } = values;
|
|
|
+ const { id, accountType } = leafData.reviewArticle;
|
|
|
+ let formData = new FormData();
|
|
|
+ fileList.map((t: MccsUpload.UploadFile) => {
|
|
|
+ formData.append('file', t.originFileObj);
|
|
|
+ });
|
|
|
+ formData.append('id', id.toString());
|
|
|
+ formData.append('categoryType', accountType);
|
|
|
+ //应产品要求‘制度’是不可变,根据制度获取对应关系
|
|
|
+ tab.value.label == '制度' && formData.append('publicCateId', publicCateId);
|
|
|
+
|
|
|
+ if (uploadFormInitValue && JSON.stringify(uploadFormInitValue) != '{}') {
|
|
|
+ //重新上传不允许修改类型
|
|
|
+ const { tab } = uploadFormInitValue;
|
|
|
+ formData.append('accountType', tab.label);
|
|
|
+ formData.append('accountName', tab.value.label);
|
|
|
+ } else {
|
|
|
+ formData.append('accountType', tab.label);
|
|
|
+ formData.append('accountName', tab.value.label);
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
- const onSelfEvolutionTabChange = (value:{label:string,value:any})=>{
|
|
|
+ const resp = await uploadFilePost(formData);
|
|
|
+ if (resp) {
|
|
|
+ //上传成功,获取最新台账记录
|
|
|
+ getTableData();
|
|
|
+ }
|
|
|
+ setModalVisible(false);
|
|
|
+ //每次提交完清空表单默认值
|
|
|
+ setUploadFormInitValue(undefined);
|
|
|
+ } catch (err) {
|
|
|
+ console.log({ err });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const onSelfEvolutionTabChange = (value: { label: string; value: any }) => {
|
|
|
//自评tab切换回调
|
|
|
// console.log({value});
|
|
|
- value&&setCurrentSelectedSelefEvolution(value);
|
|
|
- value&&setSelectedSelfEvolution(value);
|
|
|
- }
|
|
|
+ value && setCurrentSelectedSelefEvolution(value);
|
|
|
+ value && setSelectedSelfEvolution(value);
|
|
|
+ };
|
|
|
|
|
|
- const commitSelfEvolution = async ()=>{
|
|
|
+ const commitSelfEvolution = async () => {
|
|
|
//提交自评
|
|
|
- if(leafData&¤tSelectedSelefEvolution){
|
|
|
+ if (leafData && currentSelectedSelefEvolution) {
|
|
|
//存在详情信息,且已选择评分
|
|
|
- const {id} = leafData;
|
|
|
+ const { id } = leafData.reviewArticle;
|
|
|
let _userData = localStorage.getItem('userData');
|
|
|
- if(_userData){
|
|
|
- let userData:{name:string,userId:number} = JSON.parse(_userData)
|
|
|
+ if (_userData) {
|
|
|
+ let userData: { name: string; userId: number } = JSON.parse(_userData);
|
|
|
const params = {
|
|
|
- id:Number(id),
|
|
|
- selfEvaluation:`${currentSelectedSelefEvolution?currentSelectedSelefEvolution.value:'null'}`,
|
|
|
- userId:userData?.userId,
|
|
|
- userName:userData?.name,
|
|
|
- }
|
|
|
- const resp = await selfEvolutionCommit(params);
|
|
|
- if(resp&¤tActivedTree){
|
|
|
- //刷新自评记录
|
|
|
+ id: Number(id),
|
|
|
+ selfEvaluation: `${
|
|
|
+ currentSelectedSelefEvolution ? currentSelectedSelefEvolution.value : 'null'
|
|
|
+ }`,
|
|
|
+ userId: userData?.userId,
|
|
|
+ userName: userData?.name,
|
|
|
+ };
|
|
|
+ const resp = await selfEvolutionCommit(params);
|
|
|
+ if (resp && currentActivedTree) {
|
|
|
+ //刷新自评记录
|
|
|
getSelfEvaluationRecordList(Number(currentActivedTree.id));
|
|
|
- setSelectedSelfEvolution({label:'null',value:'null'}); //清空选中项
|
|
|
+ setSelectedSelfEvolution({ label: 'null', value: 'null' }); //清空选中项
|
|
|
setCurrentSelectedSelefEvolution(undefined);
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
notification['info']({
|
|
|
message: '请选择评分!',
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
- const delHistoryRecordHandle = async (historyRecords:MccsRecordList.historyRecordsItem)=>{
|
|
|
+ const delHistoryRecordHandle = async (historyRecords: MccsRecordList.historyRecordsItem) => {
|
|
|
//删除台账记录
|
|
|
const resp = await delHistoryRecods(historyRecords.id);
|
|
|
- if(resp){
|
|
|
+ if (resp) {
|
|
|
getTableData();
|
|
|
}
|
|
|
+ };
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- const getScoreList = async ()=>{
|
|
|
- //条文评级
|
|
|
- const data = await getScoreLevelData();
|
|
|
- const tempArr = data.map((t:any)=>({label:t.levelNumber,value:t.levelNumber,configStatus:t.configStatus}));
|
|
|
- return Promise.resolve(tempArr);
|
|
|
- }
|
|
|
-
|
|
|
- const accreditationGroupType = async ()=>{
|
|
|
- //获取条文组别
|
|
|
- const data = await getAccreditationTypeData();
|
|
|
- const tempArr = data.map((t:any)=>({label:t.categoryType,value:t.categoryType}));
|
|
|
- return Promise.resolve(tempArr);
|
|
|
- }
|
|
|
-
|
|
|
- const getUploadLedgerType = async ()=>{
|
|
|
- //台账类型
|
|
|
- const data = await getUploadLedgerSelectableType();
|
|
|
- if(data){
|
|
|
- const tempArr = data.map((t:API.RuleChildsItemType)=>{
|
|
|
- const tempList = t.generalNameList.map(a=>{
|
|
|
- return {
|
|
|
- label:a.generalName,
|
|
|
- value:a.id
|
|
|
- }
|
|
|
- });
|
|
|
- return {label:t.levelNumber,list:tempList}
|
|
|
- });
|
|
|
- return Promise.resolve(tempArr);
|
|
|
- }
|
|
|
- }
|
|
|
+ const getScoreList = async () => {
|
|
|
+ //条文评级
|
|
|
+ const data = await getScoreLevelData();
|
|
|
+ const tempArr = data.map((t: any) => ({
|
|
|
+ label: t.levelNumber,
|
|
|
+ value: t.levelNumber,
|
|
|
+ configStatus: t.configStatus,
|
|
|
+ }));
|
|
|
+ return Promise.resolve(tempArr);
|
|
|
+ };
|
|
|
|
|
|
- const getCurrentHospScore = async ()=>{
|
|
|
- //获取医院评分及自评信息
|
|
|
- const resp = await getCurrentHospSelfScore();
|
|
|
- setCurrentHospSelfScoreAndOthers(resp);
|
|
|
- }
|
|
|
+ const accreditationGroupType = async () => {
|
|
|
+ //获取条文组别
|
|
|
+ const data = await getAccreditationTypeData();
|
|
|
+ const tempArr = data.map((t: any) => ({ label: t.categoryType, value: t.categoryType }));
|
|
|
+ return Promise.resolve(tempArr);
|
|
|
+ };
|
|
|
|
|
|
- const getSelectableSelfScoreList = async ()=>{
|
|
|
+ const getUploadLedgerType = async () => {
|
|
|
+ //台账类型
|
|
|
+ const data = await getUploadLedgerSelectableType();
|
|
|
+ if (data) {
|
|
|
+ const tempArr = data.map((t: API.RuleChildsItemType) => {
|
|
|
+ const tempList = t.generalNameList.map((a) => {
|
|
|
+ return {
|
|
|
+ label: a.generalName,
|
|
|
+ value: a.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return { label: t.levelNumber, list: tempList };
|
|
|
+ });
|
|
|
+ return Promise.resolve(tempArr);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const getCurrentHospScore = async () => {
|
|
|
+ //获取医院评分及自评信息
|
|
|
+ const resp = await getCurrentHospSelfScore();
|
|
|
+ setCurrentHospSelfScoreAndOthers(resp);
|
|
|
+ };
|
|
|
+
|
|
|
+ const getSelectableSelfScoreList = async () => {
|
|
|
//获取自评可选列表
|
|
|
const resp = await getScoreLevelData();
|
|
|
- const listFilted = resp.filter((t:any)=>t.configStatus != 0);
|
|
|
- const list = listFilted.map((t:any)=>({label:t.levelNumber,value:t.levelNumber}));
|
|
|
+ const listFilted = resp.filter((t: any) => t.configStatus != 0);
|
|
|
+ const list = listFilted.map((t: any) => ({ label: t.levelNumber, value: t.levelNumber }));
|
|
|
setTargetScores(list);
|
|
|
- }
|
|
|
-
|
|
|
- const getSelectableRuleChilds = async (id:number)=>{
|
|
|
- //获取台账上传时可选下拉类型
|
|
|
- const resp = await getRuleChildrens(id);
|
|
|
- return resp.map((t:{id:number,name:string})=>({label:t.name,value:t.id}));
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
+ const getSelectableRuleChilds = async (id: number) => {
|
|
|
+ //获取台账上传时可选下拉类型
|
|
|
+ const resp = await getRuleChildrens(id);
|
|
|
+ return resp.map((t: { id: number; name: string }) => ({ label: t.name, value: t.id }));
|
|
|
+ };
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (currentActivedTree) {
|
|
|
- const { isLeaf} = currentActivedTree;
|
|
|
+ const { isLeaf } = currentActivedTree;
|
|
|
setIsLeaf(isLeaf);
|
|
|
getTableData();
|
|
|
- if(isLeaf){
|
|
|
- getScoreList().then(data=>{
|
|
|
- const dataFilted = data.filter((t:any)=>t.configStatus != 0); //去掉不启动
|
|
|
+ if (isLeaf) {
|
|
|
+ getScoreList().then((data) => {
|
|
|
+ const dataFilted = data.filter((t: any) => t.configStatus != 0); //去掉不启动
|
|
|
// console.log({data,dataFilted});
|
|
|
setTargetScores(dataFilted);
|
|
|
});
|
|
|
- accreditationGroupType().then(data=>{
|
|
|
+ accreditationGroupType().then((data) => {
|
|
|
setRuleTypes(data);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}, [currentActivedTree]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
+ //叶子结点数据变化后相关回调
|
|
|
if (leafData) {
|
|
|
- const { systemEvaluation, targetEvaluation, selfEvaluation, siteEvaluation,records=[],accountRecords=[] } = leafData;
|
|
|
+
|
|
|
+ const {
|
|
|
+ systemEvaluation,
|
|
|
+ targetEvaluation,
|
|
|
+ selfEvaluation,
|
|
|
+ } = leafData.reviewArticle;
|
|
|
+
|
|
|
const tempScoreList = [
|
|
|
+ {
|
|
|
+ label: '目标',
|
|
|
+ value: targetEvaluation ? targetEvaluation : '-',
|
|
|
+ },
|
|
|
{
|
|
|
label: '自评',
|
|
|
- value: selfEvaluation?selfEvaluation:'-',
|
|
|
+ value: selfEvaluation ? selfEvaluation : '-',
|
|
|
},
|
|
|
// {
|
|
|
// label: '现场查核',
|
|
|
// value: siteEvaluation?siteEvaluation:'-',
|
|
|
// },
|
|
|
- {
|
|
|
- label: '目标',
|
|
|
- value: targetEvaluation?targetEvaluation:'-',
|
|
|
- },
|
|
|
{
|
|
|
label: '系统评分',
|
|
|
- value: systemEvaluation?systemEvaluation:'-',
|
|
|
+ value: systemEvaluation ? systemEvaluation : '-',
|
|
|
},
|
|
|
];
|
|
|
- // console.log({tempScoreList});
|
|
|
- let recordsArray:API.RecordsItemType[]=[];
|
|
|
-
|
|
|
- records&&records.length>0&&(recordsArray=records); //条文管理
|
|
|
- accountRecords&&accountRecords.length>0&&(recordsArray=accountRecords); //台账上传
|
|
|
- // console.log({recordsArray,accountRecords,records});
|
|
|
- const tempRecords = recordsArray.map((item)=>{
|
|
|
-
|
|
|
- if(item.details){
|
|
|
- //条文下
|
|
|
- const tempArr:MccsRecordList.MccsRecordListItemInnerDetail[] = item.details.map(val=>({
|
|
|
- name:val.userName,
|
|
|
- fileName:val.fileName,
|
|
|
- fileUrl:val.fileUrl,
|
|
|
- createTime:val.createTime,
|
|
|
- recordTypeName:val.recordTypeName,
|
|
|
- //条文管理无台账记录
|
|
|
- historyRecords:[]
|
|
|
- }))
|
|
|
- return {
|
|
|
- evaluation:item.evaluation,
|
|
|
- details:tempArr
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(item.records){
|
|
|
- //台账下
|
|
|
- const tempArr:MccsRecordList.MccsRecordListItemInnerDetail[] = item.records.map(val=>({
|
|
|
-
|
|
|
- name:val.uploadUserName,
|
|
|
- fileName:val.fileName,
|
|
|
- fileUrl:val.fileUrl,
|
|
|
- createTime:val.uploadTime,
|
|
|
- recordTypeName:val.accountName,
|
|
|
- accountType:val.accountType,
|
|
|
- cateId:val.cateId,
|
|
|
- historyRecords:val.historyVersionVOList?val.historyVersionVOList.map(t=>({
|
|
|
- versionName:t.versionName,name:val.uploadUserName,time:t.uploadTime,id:t.id
|
|
|
- })):[]
|
|
|
-
|
|
|
- }))
|
|
|
-
|
|
|
- return {
|
|
|
- evaluation:item.evaluation,
|
|
|
- details:tempArr
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //后台接口字段缺失,保证组件正常运行
|
|
|
- return {
|
|
|
- evaluation:'null',
|
|
|
- details:[]
|
|
|
- };
|
|
|
- });
|
|
|
+
|
|
|
|
|
|
+
|
|
|
setScoreList(tempScoreList);
|
|
|
- setRecords(tempRecords);
|
|
|
+ getSelectableSelfScoreList();
|
|
|
+ // setRecords(tempRecords);
|
|
|
}
|
|
|
}, [leafData]);
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
- //tab切换时
|
|
|
- //tab切换时重置
|
|
|
- setSelectedSelfEvolution({label:'',value:''});
|
|
|
- setCurrentSelectedSelefEvolution(undefined);
|
|
|
- if(tabKey==2){
|
|
|
- //切换为自评记录
|
|
|
- getSelfEvaluationRecordList(Number(currentActivedTree?.id)); //获取自评记录列表
|
|
|
- getSelectableSelfScoreList();
|
|
|
-
|
|
|
- }
|
|
|
- },[tabKey]);
|
|
|
-
|
|
|
- useEffect(()=>{
|
|
|
- //当抽屉类型改变时
|
|
|
- if(drawerFormType == 'BATCHSETTING'){
|
|
|
- getScoreList().then(data=>{
|
|
|
- const dataFilted = data.filter((t:any)=>t.configStatus != 0); //去掉不启动
|
|
|
- setTargetScores(dataFilted);
|
|
|
- });
|
|
|
- accreditationGroupType().then(data=>{
|
|
|
- setRuleTypes(data);
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- },[drawerFormType]);
|
|
|
-
|
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
+ //当抽屉类型改变时
|
|
|
+ if (drawerFormType == 'BATCHSETTING') {
|
|
|
+ getScoreList().then((data) => {
|
|
|
+ const dataFilted = data.filter((t: any) => t.configStatus != 0); //去掉不启动
|
|
|
+ setTargetScores(dataFilted);
|
|
|
+ });
|
|
|
+ accreditationGroupType().then((data) => {
|
|
|
+ setRuleTypes(data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, [drawerFormType]);
|
|
|
+
|
|
|
return {
|
|
|
isLeaf,
|
|
|
treeData,
|
|
@@ -496,7 +455,7 @@ const articleManagement = () => {
|
|
|
currentActivedTree,
|
|
|
setCurrentActivedTree,
|
|
|
scoreList, //评分
|
|
|
- records,//台账记录
|
|
|
+ records, //台账记录
|
|
|
getDepartmentRequest,
|
|
|
departmentManagers,
|
|
|
getDepartment,
|
|
@@ -514,8 +473,6 @@ const articleManagement = () => {
|
|
|
setReloadRightContent,
|
|
|
setModuleMode,
|
|
|
moduleMode,
|
|
|
- tabKey,
|
|
|
- setTabKey,
|
|
|
selfEvaluationRecords,
|
|
|
modalVisible,
|
|
|
setModalVisible,
|
|
@@ -533,6 +490,8 @@ const articleManagement = () => {
|
|
|
currentHospSelfScoreAndOthers,
|
|
|
getCurrentHospScore,
|
|
|
getSelectableRuleChilds,
|
|
|
+ editMode,
|
|
|
+ setEditMode,
|
|
|
};
|
|
|
};
|
|
|
|