|
@@ -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: 2022-03-10 15:45:59
|
|
|
|
|
|
+ * @LastEditTime: 2022-03-15 15:16:59
|
|
* @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
|
|
@@ -32,6 +32,7 @@ import {
|
|
} from '@/pages/PlatformMana/generalSetting/serve';
|
|
} from '@/pages/PlatformMana/generalSetting/serve';
|
|
|
|
|
|
import { notification } from 'antd';
|
|
import { notification } from 'antd';
|
|
|
|
+import { DataItemType } from './components/articleDetailModule/drawer/multi';
|
|
|
|
|
|
export interface ImplementationDataItem {
|
|
export interface ImplementationDataItem {
|
|
level: string;
|
|
level: string;
|
|
@@ -47,9 +48,7 @@ const articleManagement = () => {
|
|
const [isLeaf, setIsLeaf] = useState(false);
|
|
const [isLeaf, setIsLeaf] = useState(false);
|
|
const [scoreList, setScoreList] = useState<{ label: string; value: string }[]>([]);
|
|
const [scoreList, setScoreList] = useState<{ label: string; value: string }[]>([]);
|
|
const [leafData, setLeafData] = useState<API.LeafDataType>(); // 叶子结点数据
|
|
const [leafData, setLeafData] = useState<API.LeafDataType>(); // 叶子结点数据
|
|
- const [departmentManagers, setDepartmentManagers] = useState<{ label: string; value: number }[]>(
|
|
|
|
- [],
|
|
|
|
- );
|
|
|
|
|
|
+
|
|
|
|
|
|
const [targetScores, setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
|
|
const [targetScores, setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
|
|
const [ruleTypes, setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
|
|
const [ruleTypes, setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
|
|
@@ -97,7 +96,13 @@ const articleManagement = () => {
|
|
|
|
|
|
const [gradeOptions, setGradeOptions] = useState<{ label: string, value: string | number }[]>([]);
|
|
const [gradeOptions, setGradeOptions] = useState<{ label: string, value: string | number }[]>([]);
|
|
const [accountTypeOptions, setAccountTypeOptions] = 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:{responsibilityDepartment:{label:string;value:any};responsibilityUser:{label:string;value:any};}[];
|
|
|
|
+ targetScores:{label:string;value:any};
|
|
|
|
+ articleType:{label:string;value:any};
|
|
|
|
+ }|undefined>(undefined); //条文设置表单回显默认值
|
|
|
|
|
|
const [currentSelectedActObj, setCurrentSelectedActObj] = useState<any>(undefined); //当前正在操作的对象,例如当前选中的树中层级数据,点击详情的的行数据
|
|
const [currentSelectedActObj, setCurrentSelectedActObj] = useState<any>(undefined); //当前正在操作的对象,例如当前选中的树中层级数据,点击详情的的行数据
|
|
|
|
|
|
@@ -173,7 +178,8 @@ const articleManagement = () => {
|
|
responsibilityUserName: '-',
|
|
responsibilityUserName: '-',
|
|
accountType: '-',
|
|
accountType: '-',
|
|
hospId: -1,
|
|
hospId: -1,
|
|
- userId: -1
|
|
|
|
|
|
+ userId: -1,
|
|
|
|
+ pfmReviewArticleDepartList:[]
|
|
},
|
|
},
|
|
pfmViewRuleDetailDataVoList: [],
|
|
pfmViewRuleDetailDataVoList: [],
|
|
pfmImplementations: [],
|
|
pfmImplementations: [],
|
|
@@ -200,34 +206,47 @@ const articleManagement = () => {
|
|
|
|
|
|
type FormValueType = {
|
|
type FormValueType = {
|
|
articleType: { label: string; value: any };
|
|
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 };
|
|
targetScores: { label: string; value: any };
|
|
};
|
|
};
|
|
|
|
|
|
const batchSetting = async (values: FormValueType) => {
|
|
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,
|
|
|
|
+ }))
|
|
|
|
+ });
|
|
|
|
|
|
- setReloadRightContent(true);
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
|
|
+ if (resp) {
|
|
|
|
+
|
|
|
|
+ setReloadRightContent(true);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
const setArticle = async (values: FormValueType) => {
|
|
const setArticle = async (values: FormValueType) => {
|
|
// 条文设置
|
|
// 条文设置
|
|
-
|
|
|
|
|
|
+
|
|
setifHasEdit(true);
|
|
setifHasEdit(true);
|
|
|
|
|
|
if (currentActivedTree && leafData) {
|
|
if (currentActivedTree && leafData) {
|
|
@@ -244,15 +263,23 @@ const articleManagement = () => {
|
|
|
|
|
|
const { id } = leafData.reviewArticle;
|
|
const { id } = leafData.reviewArticle;
|
|
|
|
|
|
|
|
+ const {main_DepartmentAndManager,Co_DepartmentAndManager} = values;
|
|
|
|
+
|
|
const paramsData = {
|
|
const paramsData = {
|
|
id,
|
|
id,
|
|
ruleId: ruleId,
|
|
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,
|
|
targetEvaluation: values.targetScores.value,
|
|
articleType: values.articleType.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);
|
|
const resp = await settingArticle(paramsData);
|
|
@@ -271,20 +298,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 getSelfEvaluationRecordList = async (id: number) => {
|
|
const resp = await getSelfEvaluation(id);
|
|
const resp = await getSelfEvaluation(id);
|
|
@@ -585,8 +599,7 @@ const articleManagement = () => {
|
|
}
|
|
}
|
|
|
|
|
|
useEffect(()=>{
|
|
useEffect(()=>{
|
|
- console.log({detailDrawerVisible});
|
|
|
|
-
|
|
|
|
|
|
+
|
|
if(!detailDrawerVisible&&ifHasEdit){
|
|
if(!detailDrawerVisible&&ifHasEdit){
|
|
//详情抽屉关闭时刷新table
|
|
//详情抽屉关闭时刷新table
|
|
setReloadRightContent(true);
|
|
setReloadRightContent(true);
|
|
@@ -702,8 +715,6 @@ const articleManagement = () => {
|
|
setCurrentActivedTree,
|
|
setCurrentActivedTree,
|
|
scoreList, // 评分
|
|
scoreList, // 评分
|
|
getDepartmentRequest,
|
|
getDepartmentRequest,
|
|
- departmentManagers,
|
|
|
|
- getDepartmentUsers,
|
|
|
|
targetScores,
|
|
targetScores,
|
|
ruleTypes,
|
|
ruleTypes,
|
|
leafData,
|
|
leafData,
|