|
@@ -4,7 +4,12 @@ import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import { Calendar } from "@element-plus/icons-vue";
|
|
|
import dayjs from "dayjs";
|
|
|
import { postAddAssessment } from "@/api/assessment";
|
|
|
-import { postListTreeWithUser, postListTree } from "@/api/department";
|
|
|
+import {
|
|
|
+ postListTreeWithUser,
|
|
|
+ postListTree,
|
|
|
+ postListTreeWithUserApi,
|
|
|
+ treeDept
|
|
|
+} from "@/api/department";
|
|
|
import { encryption } from "@/utils/encrypt";
|
|
|
// 人员,医疗组,负责人
|
|
|
import {
|
|
@@ -189,47 +194,21 @@ const monthOne = item => {
|
|
|
// return `从 ${start} 到 ${end}`; // 设置时间区间
|
|
|
};
|
|
|
// 部门人员与考核模板数据
|
|
|
-const treeDept = ref([]);
|
|
|
+const treeDeptList = ref([]);
|
|
|
const templateparams = reactive({
|
|
|
page: 1,
|
|
|
pageSize: 100
|
|
|
});
|
|
|
const resTmp = ref([]);
|
|
|
-const postListTreeWithUserApi = async () => {
|
|
|
- const res = await postListTreeWithUser();
|
|
|
-
|
|
|
- console.log("人员", res.data);
|
|
|
- console.log("人员", transformData(res.data));
|
|
|
- treeDept.value = [];
|
|
|
- let aa = res.data;
|
|
|
- treeDept.value = transformData(aa);
|
|
|
-};
|
|
|
-
|
|
|
-const transformData = data => {
|
|
|
- return data.map(item => {
|
|
|
- const transformedItem = {
|
|
|
- deptName: item.userName || item.deptName,
|
|
|
- deptCode: item.userCode || item.deptCode,
|
|
|
- children: []
|
|
|
- };
|
|
|
+// const postListTreeWithUserApi = async () => {
|
|
|
+// const res = await postListTreeWithUser();
|
|
|
|
|
|
- if (item.childrenRes) {
|
|
|
- transformedItem.children = transformData(item.childrenRes);
|
|
|
- }
|
|
|
-
|
|
|
- if (item.childrenUserRes) {
|
|
|
- item.childrenUserRes.forEach(user => {
|
|
|
- transformedItem.children.push({
|
|
|
- deptName: user.userName,
|
|
|
- deptCode: user.userCode,
|
|
|
- children: []
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- return transformedItem;
|
|
|
- });
|
|
|
-};
|
|
|
+// console.log("人员", res.data);
|
|
|
+// console.log("人员", transformData(res.data));
|
|
|
+// treeDept.value = [];
|
|
|
+// let aa = res.data;
|
|
|
+// treeDept.value = transformData(aa);
|
|
|
+// };
|
|
|
const assessmentTypeRef = ref();
|
|
|
const handleRreeSelect = index => {
|
|
|
const node = assessmentTypeRef.value[index].getCheckedNodes();
|
|
@@ -279,12 +258,12 @@ const assessmentTypeApi = async value => {
|
|
|
pageNumber: 1,
|
|
|
pageSize: 1000
|
|
|
});
|
|
|
- treeDept.value = yiliao.data.records;
|
|
|
+ treeDeptList.value = yiliao.data.records;
|
|
|
break;
|
|
|
case 3:
|
|
|
const fuzhere = await getLeaderList();
|
|
|
console.log(fuzhere);
|
|
|
- treeDept.value = fuzhere.data;
|
|
|
+ treeDeptList.value = fuzhere.data;
|
|
|
}
|
|
|
};
|
|
|
const monthTime = ref("");
|
|
@@ -424,8 +403,8 @@ defineExpose({
|
|
|
:render-after-expand="false"
|
|
|
show-checkbox
|
|
|
:props="{
|
|
|
- label: 'deptName',
|
|
|
- value: 'deptCode',
|
|
|
+ label: 'userNameNew',
|
|
|
+ value: 'userCodeNew',
|
|
|
children: 'children'
|
|
|
}"
|
|
|
style="width: 180px"
|
|
@@ -454,7 +433,7 @@ defineExpose({
|
|
|
@change="handChange"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="(it, id) in treeDept"
|
|
|
+ v-for="(it, id) in treeDeptList"
|
|
|
:key="id"
|
|
|
:label="it.realName"
|
|
|
:value="it.userCode"
|