|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-09-14 10:46:45
|
|
* @Date: 2021-09-14 10:46:45
|
|
- * @LastEditTime: 2021-09-29 17:39:50
|
|
|
|
|
|
+ * @LastEditTime: 2021-10-11 11:18:22
|
|
* @LastEditors: Please set LastEditors
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: In User Settings Edit
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
|
|
@@ -9,7 +9,7 @@
|
|
|
|
|
|
import { useState, useEffect } from 'react';
|
|
import { useState, useEffect } from 'react';
|
|
import { getTreeFileTableData,getDepartmentList,settingArticle,batchSettingArticle,getSelfEvaluation,
|
|
import { getTreeFileTableData,getDepartmentList,settingArticle,batchSettingArticle,getSelfEvaluation,
|
|
- uploadFilePost,selfEvolutionCommit,delHistoryRecods,getUploadLedgerSelectableType,
|
|
|
|
|
|
+ uploadFilePost,selfEvolutionCommit,delHistoryRecods,getUploadLedgerSelectableType,getCurrentHospSelfScore,
|
|
} from './server';
|
|
} from './server';
|
|
import {getTreeList} from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
|
|
import {getTreeList} from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
|
|
import {getScoreLevelData,getAccreditationTypeData} from '@/pages/PlatformMana/generalSetting/serve';
|
|
import {getScoreLevelData,getAccreditationTypeData} from '@/pages/PlatformMana/generalSetting/serve';
|
|
@@ -48,6 +48,10 @@ const articleManagement = () => {
|
|
|
|
|
|
const [currentSelectedSelefEvolution,setCurrentSelectedSelefEvolution] = useState<{label:string,value:any}>(); //MccsClickableTabs 点击对象
|
|
const [currentSelectedSelefEvolution,setCurrentSelectedSelefEvolution] = useState<{label:string,value:any}>(); //MccsClickableTabs 点击对象
|
|
|
|
|
|
|
|
+ const [uploadLedgerTypeList,setUploadLedgerTypeList] = useState<MccsClickableTabs.TabType[]>([]); //上传台账可选类型
|
|
|
|
+
|
|
|
|
+ const [currentHospSelfScoreAndOthers,setCurrentHospSelfScoreAndOthers] = useState<string>(); //当前医院评分及自评结果
|
|
|
|
+
|
|
const getArticleTreeData = async (keyword?:string|number) => {
|
|
const getArticleTreeData = async (keyword?:string|number) => {
|
|
//获取树数据
|
|
//获取树数据
|
|
const { list = [] } = await getTreeList(keyword);
|
|
const { list = [] } = await getTreeList(keyword);
|
|
@@ -212,18 +216,18 @@ const articleManagement = () => {
|
|
|
|
|
|
const uploadFile = async (values:any)=>{
|
|
const uploadFile = async (values:any)=>{
|
|
console.log({'表单':values});
|
|
console.log({'表单':values});
|
|
-
|
|
|
|
if(leafData){
|
|
if(leafData){
|
|
// console.log({'上传表单':values});
|
|
// console.log({'上传表单':values});
|
|
try{
|
|
try{
|
|
const {files:{fileList=[]},tab} = values;
|
|
const {files:{fileList=[]},tab} = values;
|
|
- const {id} = leafData;
|
|
|
|
|
|
+ const {id,accountType} = leafData;
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
|
|
|
|
formData.append('file',fileList[0]?.originFileObj);
|
|
formData.append('file',fileList[0]?.originFileObj);
|
|
formData.append('id',id.toString());
|
|
formData.append('id',id.toString());
|
|
|
|
+ formData.append('categoryType',accountType);
|
|
|
|
|
|
- if(JSON.stringify(uploadFormInitValue) != '{}'&&uploadFormInitValue){
|
|
|
|
|
|
+ if(uploadFormInitValue&&JSON.stringify(uploadFormInitValue) != '{}'){
|
|
//重新上传不允许修改类型
|
|
//重新上传不允许修改类型
|
|
const {tab} = uploadFormInitValue;
|
|
const {tab} = uploadFormInitValue;
|
|
formData.append('accountType',tab.label);
|
|
formData.append('accountType',tab.label);
|
|
@@ -299,7 +303,7 @@ const articleManagement = () => {
|
|
const getScoreList = async ()=>{
|
|
const getScoreList = async ()=>{
|
|
//条文评级
|
|
//条文评级
|
|
const data = await getScoreLevelData();
|
|
const data = await getScoreLevelData();
|
|
- const tempArr = data.map((t:any)=>({label:t.levelNumber,value:t.levelNumber}));
|
|
|
|
|
|
+ const tempArr = data.map((t:any)=>({label:t.levelNumber,value:t.levelNumber,configStatus:t.configStatus}));
|
|
return Promise.resolve(tempArr);
|
|
return Promise.resolve(tempArr);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -327,6 +331,12 @@ const articleManagement = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const getCurrentHospScore = async ()=>{
|
|
|
|
+ //获取医院评分及自评信息
|
|
|
|
+ const resp = await getCurrentHospSelfScore();
|
|
|
|
+ setCurrentHospSelfScoreAndOthers(resp);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (currentActivedTree) {
|
|
if (currentActivedTree) {
|
|
@@ -335,7 +345,9 @@ const articleManagement = () => {
|
|
getTableData();
|
|
getTableData();
|
|
if(isLeaf){
|
|
if(isLeaf){
|
|
getScoreList().then(data=>{
|
|
getScoreList().then(data=>{
|
|
- setTargetScores(data);
|
|
|
|
|
|
+ const dataFilted = data.filter((t:any)=>t.configStatus != 0); //去掉不启动
|
|
|
|
+ // console.log({data,dataFilted});
|
|
|
|
+ setTargetScores(dataFilted);
|
|
});
|
|
});
|
|
accreditationGroupType().then(data=>{
|
|
accreditationGroupType().then(data=>{
|
|
setRuleTypes(data);
|
|
setRuleTypes(data);
|
|
@@ -399,8 +411,9 @@ const articleManagement = () => {
|
|
fileUrl:val.fileUrl,
|
|
fileUrl:val.fileUrl,
|
|
createTime:val.uploadTime,
|
|
createTime:val.uploadTime,
|
|
recordTypeName:val.accountName,
|
|
recordTypeName:val.accountName,
|
|
|
|
+ accountType:val.accountType,
|
|
historyRecords:val.historyVersionVOList?val.historyVersionVOList.map(t=>({
|
|
historyRecords:val.historyVersionVOList?val.historyVersionVOList.map(t=>({
|
|
- versionName:t.versionName,name:val.uploadUserName,time:val.uploadTime,id:t.id
|
|
|
|
|
|
+ versionName:t.versionName,name:val.uploadUserName,time:t.uploadTime,id:t.id
|
|
})):[]
|
|
})):[]
|
|
|
|
|
|
}))
|
|
}))
|
|
@@ -436,6 +449,24 @@ const articleManagement = () => {
|
|
}
|
|
}
|
|
},[tabKey]);
|
|
},[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(()=>{
|
|
|
|
+ getCurrentHospScore();
|
|
|
|
+ },[]);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
@@ -477,7 +508,10 @@ const articleManagement = () => {
|
|
selectedSelfEvolution,
|
|
selectedSelfEvolution,
|
|
getSelfEvaluationRecordList,
|
|
getSelfEvaluationRecordList,
|
|
delHistoryRecordHandle,
|
|
delHistoryRecordHandle,
|
|
- getUploadLedgerType
|
|
|
|
|
|
+ getUploadLedgerType,
|
|
|
|
+ uploadLedgerTypeList,
|
|
|
|
+ setUploadLedgerTypeList,
|
|
|
|
+ currentHospSelfScoreAndOthers
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
|