ystl_myq 6 hónapja
szülő
commit
131ee8a0bb

+ 6 - 0
src/api/assessment.ts

@@ -68,3 +68,9 @@ export const updateAssessmentQuotaDetails = data => {
     }
   );
 };
+// 查询考核信息详情(考核指标)前先调用此接口,插入类型是自动采集的完成值
+export const alterFinishValue = params => {
+  return http.request<addDept>("get", "assessment/alterFinishValue", {
+    params
+  });
+};

+ 14 - 0
src/api/download.ts

@@ -91,3 +91,17 @@ export const getListTable = async data => {
     }
   });
 };
+// 考核管理导入指标名单回显数据
+export const importAssessmentQuotaDisplayBackData = async data => {
+  const token = localStorage.getItem("token") || "";
+  return axios.post(
+    `${FLIE_URL}/assessment/importAssessmentQuotaDisplayBackData`,
+    data,
+    {
+      headers: {
+        "Content-Type": "multipart/form-data", // 指定内容类型
+        satoken: token // 将 Token 添加到请求头
+      }
+    }
+  );
+};

+ 2 - 0
src/components/echarts/bar.vue

@@ -84,6 +84,8 @@ const dataList = reactive({
   data: []
 });
 const init = (item?: any) => {
+  dataList.title = [];
+  dataList.data = [];
   if (item && item.length > 0) {
     item.sort((a, b) => a.ranking - b.ranking);
     item.map((it, id) => {

+ 2 - 0
src/components/echarts/barDim.vue

@@ -26,6 +26,8 @@ const dataList = reactive({
   data: []
 });
 const init = async (item?: any, type?: number) => {
+  dataList.title = [];
+  dataList.data = [];
   const { data, code } = await getPersonDimensionChartsRanking({
     ...item,
     type

+ 2 - 0
src/components/echarts/radar.vue

@@ -15,6 +15,8 @@ const rankName = ref([]);
 const rankValue = ref([]);
 // 根据配置项渲染ECharts
 const initChart = (item?: any) => {
+  rankName.value = [];
+  rankValue.value = [];
   console.log("根据配置项渲染ECharts", item);
   if (item && item.length != 0) {
     item.map(itx => {

+ 82 - 72
src/components/import/index.vue

@@ -4,6 +4,7 @@ import { useRoute, useRouter } from "vue-router";
 import * as XLSX from "xlsx";
 import {
   assessmentDownloadDataRosterTemplateApi,
+  importAssessmentQuotaDisplayBackData,
   postImportAssessmentTemplate
 } from "@/api/download";
 import { ElMessage } from "element-plus";
@@ -31,64 +32,75 @@ const tableData = ref<any>([
   { type: "" },
   { from: "" }
 ]);
-const handleUploadChange = (file: File) => {
+const handleUploadChange = async (file: File) => {
   fileDocument.value = file; // 保存文件
+  const formData = new FormData();
+  formData.append("file", fileDocument.value);
+  const fileToSend = formData.get("file");
+  const { code, data, msg } = await importAssessmentQuotaDisplayBackData({
+    file: fileToSend,
+    type: route.query.assessmentType,
+    assessmentId: route.query.id
+  });
   const reader = new FileReader();
   let fileType = file.name.slice(-4);
   if (fileType == "xlsx") {
-    console.log(query.value.assessmentType, "打印type值");
-    reader.onload = e => {
-      const data = new Uint8Array(e.target?.result as ArrayBuffer);
-      const workbook = XLSX.read(data, { type: "array" }); // 读取 Excel 文件
-      const firstSheetName = workbook.SheetNames[0]; // 获取第一个工作表名
-      const worksheet = workbook.Sheets[firstSheetName]; // 获取第一个工作表
-      const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); // 将工作表转为 JSON
-      if (
-        jsonData[1].length == 6 &&
-        (query.value.assessmentType == 0 || query.value.assessmentType == 1)
-      ) {
-        tableHeaders.value = jsonData[1];
-        const arr = jsonData.slice(2).map(row => {
-          if (row[0] && row[1] && row[2] && row[3]) {
-            const rowData = {};
-            tableHeaders.value.forEach((header, index) => {
-              if (row[index]) {
-                rowData[header] = row[index];
-              }
-            });
-            return rowData;
-          }
-        });
-        tableData.value = arr.filter(item => item);
-        ElMessage.success("文件上传成功");
-        uploadShow.value = false; // 隐藏上传区域,显示数据表
-      } else if (query.value.assessmentType == 2) {
-        tableHeaders.value = [
-          "用户组",
-          "用户组编号",
-          "考核模板",
-          "指标名称",
-          "完成值",
-          "得分"
-        ]; // 表头
-        const arr = jsonData.slice(2).map(row => {
-          if (row[0] && row[1] && row[2] && row[3]) {
-            const rowData = {};
-            tableHeaders.value.forEach((header, index) => {
-              if (row[index]) {
-                rowData[header] = row[index];
-              }
-            });
-            return rowData;
-          }
-        });
-        tableData.value = arr.filter(item => item);
-        ElMessage.success("文件上传成功");
-        uploadShow.value = false; // 隐藏上传区域,显示数据表
-      } else {
-        ElMessage.error("文件为空或格式不正确");
-      }
-    };
+    if (data.code == 200) {
+      reader.onload = e => {
+        const data = new Uint8Array(e.target?.result as ArrayBuffer);
+        const workbook = XLSX.read(data, { type: "array" }); // 读取 Excel 文件
+        const firstSheetName = workbook.SheetNames[0]; // 获取第一个工作表名
+        const worksheet = workbook.Sheets[firstSheetName]; // 获取第一个工作表
+        const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); // 将工作表转为 JSON
+        if (
+          jsonData[1].length == 6 &&
+          (query.value.assessmentType == 0 || query.value.assessmentType == 1)
+        ) {
+          tableHeaders.value = jsonData[1];
+          const arr = jsonData.slice(2).map(row => {
+            if (row[0] && row[1] && row[2] && row[3]) {
+              const rowData = {};
+              tableHeaders.value.forEach((header, index) => {
+                if (row[index]) {
+                  rowData[header] = row[index];
+                }
+              });
+              return rowData;
+            }
+          });
+          tableData.value = arr.filter(item => item);
+          ElMessage.success("文件上传成功");
+          uploadShow.value = false; // 隐藏上传区域,显示数据表
+        } else if (query.value.assessmentType == 2) {
+          tableHeaders.value = [
+            "用户组",
+            "用户组编号",
+            "考核模板",
+            "指标名称",
+            "完成值",
+            "得分"
+          ]; // 表头
+          const arr = jsonData.slice(2).map(row => {
+            if (row[0] && row[1] && row[2] && row[3]) {
+              const rowData = {};
+              tableHeaders.value.forEach((header, index) => {
+                if (row[index]) {
+                  rowData[header] = row[index];
+                }
+              });
+              return rowData;
+            }
+          });
+          tableData.value = arr.filter(item => item);
+          ElMessage.success("文件上传成功");
+          uploadShow.value = false; // 隐藏上传区域,显示数据表
+        } else {
+          ElMessage.error("文件为空或格式不正确");
+        }
+      };
+    } else {
+      ElMessage.error(data.msg);
+    }
   } else {
     ElMessage.error("请上传xlsx文件");
   }
@@ -104,26 +116,25 @@ const postImportAssessmentTemplateApi = async data => {
   try {
     const formData = new FormData();
 
-    // 将 tableData 转换为 JSON 字符串
-    const jsonTableData = JSON.stringify(tableData.value);
+    // 将 tableData 转换为 XLSX 格式
+    // const ws = XLSX.utils.json_to_sheet(tableData.value); // 将表格数据转为工作表
+    // const wb = XLSX.utils.book_new(); // 创建一个新的工作簿
+    // XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); // 将工作表添加到工作簿
+    // // 将工作簿转换为二进制的 XLSX 文件数据
+    // const xlsxData = XLSX.write(wb, { bookType: "xlsx", type: "array" });
 
-    // 创建一个 Blob 对象,将 JSON 数据作为二进制文件上传
-    const blob = new Blob([jsonTableData], { type: "application/json" });
+    // // 创建一个 Blob 对象,指定 MIME 类型为 XLSX 格式
+    // const blob = new Blob([xlsxData], {
+    //   type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+    // });
 
-    // 创建一个文件对象
-    const file = new File([blob], "tableData.json", {
-      type: "application/json"
-    });
+    // // 创建一个文件对象
+    // const file = new File([blob], "tableData.xlsx", {
+    //   type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+    // });
 
     // 将生成的文件添加到 FormData 中
-    formData.append("file", file);
-
-    // 你可以在这里使用 FileReader 进一步处理文件数据
-    const reader = new FileReader();
-    reader.onload = function (event) {
-      const arrayBuffer = event.target.result;
-      // 如果需要在上传前处理文件的二进制数据,可以在这里做
-    };
+    formData.append("file", fileDocument.value);
 
     // 获取文件并执行上传
     const fileToSend = formData.get("file");
@@ -133,12 +144,11 @@ const postImportAssessmentTemplateApi = async data => {
       type: route.query.assessmentType,
       assessmentId: route.query.id
     });
+
     if (data.code === 200) {
       // 根据后端返回的 code 判断是否成功
       ElMessage.success(data.msg);
       // 重置上传状态
-      // uploadShow.value = true;
-      // $router.push("/IndexDefine/children/define");
       router.back();
       uploadShow.value = !uploadShow.value;
       tableHeaders.value = []; // 清空表头

+ 16 - 4
src/components/personList/index.vue

@@ -16,12 +16,24 @@
 </template>
 
 <script lang="ts" setup>
-import { ref } from "vue";
+import { ref, nextTick } from "vue";
 const tableData = ref([]);
-const init = async data => {
-  // const {data,code}
-  tableData.value = data.dimensionList[0].quotaList;
+const init = (data?: any) => {
+  if (data) {
+    console.log("data1111", data);
+    tableData.value = [];
+    setTimeout(() => {
+      nextTick(() => {
+        tableData.value = data[0]?.dimensionList[0].quotaList;
+        // tableData.value = data;
+        console.log("tableData.value", tableData.value);
+      });
+    }, 0);
+  }
 };
+// nextTick(() => {
+//   init();
+// });
 defineExpose({
   init
 });

+ 25 - 2
src/components/rankTable/draw.vue

@@ -27,10 +27,14 @@
   <vxe-table
     v-if="$route.name != 'workerDrak'"
     border
-    show-overflow
     style="width: 100%"
     height="400"
+    show-overflow
+    show-header-overflow
+    show-footer-overflow
     :data="tableData"
+    :column-config="{ resizable: true }"
+    :scroll-x="{ enabled: true, gt: 0 }"
     :merge-cells="mergeCells"
   >
     <vxe-column field="index" title="排名" width="80" fixed="left">
@@ -95,7 +99,7 @@
     show-overflow
     style="width: 100%"
     height="400"
-    :data="tableData"
+    :data="tableDataNewValue"
   >
     <vxe-column field="index" title="排名" width="80" fixed="left">
       <template #default="scope">
@@ -136,6 +140,7 @@
         >
           <template v-for="it in item.quotaList" :key="it.quotaId">
             <vxe-column
+              v-if="!isDuplicate(item)"
               :field="it.quotaScore"
               :title="`${it.quotaName}(${soreRate(it.quotaWeight)}%)`"
               width="150"
@@ -181,8 +186,13 @@ onMounted(() => {
     imgIndex.value = 2;
   }
 });
+function isDuplicate(item) {
+  // 根据您的标准添加逻辑以检查重复项
+  return tableData.value.some(td => td.dimId === item.dimId);
+}
 const init = (item, deptNames, names) => {
   tableData.value = item;
+  item.map((it, id) => {});
   deptName.value = deptNames;
   name.value = names;
   if ($route.name != "workerDrak") {
@@ -191,6 +201,19 @@ const init = (item, deptNames, names) => {
   console.log("item111", item);
   console.log("tableData", tableData.value);
 };
+const tableDataNewValue = computed(() => {
+  const seen = new Set();
+  return tableData.value.map(ita => ({
+    ...ita,
+    dimensionList: ita.dimensionList.filter(item => {
+      if (seen.has(item.dimId)) {
+        return false; // 如果已经存在,则不返回此项
+      }
+      seen.add(item.dimId);
+      return true; // 否则返回此项
+    })
+  }));
+});
 const soreRate = row => {
   if (row) {
     return row;

+ 6 - 3
src/components/rankTable/index.vue

@@ -1,10 +1,13 @@
 <template>
   <vxe-table
     border
-    show-overflow
     style="width: 100%"
-    height="400"
     :data="tableData"
+    show-overflow
+    show-header-overflow
+    show-footer-overflow
+    :column-config="{ resizable: true }"
+    :scroll-x="{ enabled: true, gt: 0 }"
     :merge-cells="mergeCells"
   >
     <vxe-column field="index" title="排名" width="80" fixed="left">
@@ -15,7 +18,7 @@
         >
           平均得分
         </div>
-        <div v-if="scope._rowIndex > 2" class="diamond">
+        <div v-if="scope._rowIndex > 3" class="diamond">
           {{ scope.row.ranking }}
         </div>
         <div v-else class="text-center">

+ 6 - 0
src/views/background/framework/proson/components/changeRole.vue

@@ -48,8 +48,10 @@ const rolesData = async () => {
 };
 const changeRoles = (val = []) => {
   rolesList.assignmentParams.targetCodes = [];
+  // rolesList.assignmentParams.sourceCodes = [];
   val.forEach(item => {
     rolesList.assignmentParams.targetCodes.push(item);
+    // rolesList.assignmentParams.sourceCodes.push(item);
   });
 };
 // 添加部门保存
@@ -61,9 +63,13 @@ const open = (item, user) => {
   if (user == "用户") {
     rolesList.assignmentParams.sourceCodes = [];
     rolesList.assignmentParams.sourceCodes.push(item.userCode);
+    // rolesList.assignmentParams.targetCodes = [];
+    // rolesList.assignmentParams.targetCodes.push(item.userCode);
   } else {
     rolesList.assignmentParams.sourceCodes = [];
     rolesList.assignmentParams.sourceCodes.push(item.data.deptCode);
+    // rolesList.assignmentParams.targetCodes = [];
+    // rolesList.assignmentParams.targetCodes.push(item.data.deptCode);
   }
   rolesData();
 };

+ 12 - 10
src/views/background/framework/proson/components/personDetailsDrawer.vue

@@ -41,12 +41,14 @@ const handleClose = (done: () => void) => {
   editShow.value = true;
 };
 function cancelClick() {
-  formRef.value.validate(valid => {
-    if (valid) {
-      disabledValue.value = true;
-      editShow.value = true;
-    }
-  });
+  // formRef.value.validate(valid => {
+  //   if (valid) {
+  disabledValue.value = true;
+  editShow.value = true;
+  formRef.value.clearValidate(); // 清除验证错误
+  formRef.value.resetFields(); // 重置表单字段
+  // }
+  // });
 }
 function confirmClick() {
   formRef.value.validate(valid => {
@@ -67,10 +69,10 @@ const postUpdateUserInfoApi = async () => {
     drawer.value = !drawer.value;
     postOrganizationUserPage.value();
   } else {
-    ElMessage({
-      message: msg,
-      type: "error"
-    });
+    // ElMessage({
+    //   message: msg,
+    //   type: "error"
+    // });
   }
 };
 const open = (row, postOrganizationUserPageApi) => {

+ 8 - 8
src/views/background/framework/proson/components/prosonEditDrawer.vue

@@ -54,12 +54,14 @@ const handleClose = (done: () => void) => {
 };
 function cancelClick() {
   // drawer.value = false;
-  formRef.value.validate(valid => {
-    if (valid) {
-      disabledValue.value = true;
-      editShow.value = true;
-    }
-  });
+  // formRef.value.validate(valid => {
+  //   if (valid) {
+  disabledValue.value = true;
+  editShow.value = true;
+  formRef.value.clearValidate(); // 清除验证错误
+  formRef.value.resetFields(); // 重置表单字段
+  //   }
+  // });
 }
 const postUpdateDeptApi = async () => {
   const res = await postUpdateDept(formLabelAlign);
@@ -82,7 +84,6 @@ function confirmClick() {
   });
 }
 const open = row => {
-  console.log(row, "0000000");
   // formLabelAlign = row.data;
   formLabelAlign.deptName = row.data.deptName;
   formLabelAlign.deptCode = row.data.deptCode;
@@ -90,7 +91,6 @@ const open = row => {
   formLabelAlign.parentCode = row.data.parentCode;
   formLabelAlign.leader = row.data.leader;
   // console.log("数据", row.data);
-  console.log("数据", row);
   postListTreeApi();
   postUserListApi();
   drawer.value = true;

+ 9 - 2
src/views/background/framework/proson/prosonDepartment.vue

@@ -223,8 +223,8 @@ watch(realName, val => {
       />
       <el-tree
         ref="treeRef"
-        class="m-2 mr-8"
-        style="max-width: 600px"
+        class="m-2 mr-8 infinite-list"
+        style="max-width: 600px; max-height: 500px; overflow-y: auto"
         :data="dataTree"
         :props="defaultProps"
         node-key="id"
@@ -375,4 +375,11 @@ watch(realName, val => {
   color: #0052d9;
   background-color: #ecf2fe !important;
 }
+
+/* 隐藏滚动条 */
+.infinite-list::-webkit-scrollbar {
+  display: none;
+
+  /* 对于 Webkit 浏览器(Chrome, Safari等) */
+}
 </style>

+ 1 - 0
src/views/background/framework/users/index.vue

@@ -43,6 +43,7 @@ const load = () => {
 const postPageGroupApi = async () => {
   const { code, data } = await postPageGroup(rolesList.params);
   if (code === 200) {
+    console.log("用户组", data);
     rolesList.data = [];
     data.records.forEach((item, index) => {
       rolesList.data.push({

+ 1 - 3
src/views/draw/children/department/componements/seach.vue

@@ -113,8 +113,6 @@ const handClickInit3 = value => {
     const selectedItem = dataList.deptList.find(
       item => item.assessmentObjectId === value
     );
-    console.log("12321321", selectedItem);
-    console.log("12321321", value);
     init.assessmentObjectName = selectedItem.assessmentObjectName;
     // init.deptName = value.deptName;
   }
@@ -231,7 +229,7 @@ getAssessmentPageListApi();
         <div class="flex mr-2">
           <div class="text-sm leading-8 mr-3">科室</div>
           <el-select
-            v-model="dataList.params.deptCode"
+            v-model="dataList.params.assessmentObjectId"
             clearable
             filterable
             placeholder="请选择"

+ 32 - 11
src/views/draw/children/department/departmentDrank.vue

@@ -26,7 +26,7 @@ const showLength = ref(0);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
     ...seachParams.value,
-    type: 0
+    type: 1
   });
   if (code == 200) {
     showLength.value = data.length;
@@ -47,18 +47,13 @@ const dataList = reactive({
   dimName: []
 });
 const seachParams = ref();
-const getPersonDimensionChartsListApi = async (
-  dimensionName?: string,
-  dimId?: number | string
-) => {
+const getPersonDimensionChartsListApiDimList = async () => {
   const { code, data } = await getPersonDimensionChartsList({
     ...seachParams.value,
-    dimId,
-    dimensionName,
     type: 1
   });
-
   if (code == 200) {
+    dataList.dimName = [];
     if (data.length > 0) {
       data.map(it => {
         it.dimensionList.map(item => {
@@ -68,10 +63,27 @@ const getPersonDimensionChartsListApi = async (
           });
         });
       });
+    }
+  }
+};
+const getPersonDimensionChartsListApi = async (
+  dimensionName?: string,
+  dimId?: number | string,
+  index?: any
+) => {
+  const { code, data } = await getPersonDimensionChartsList({
+    ...seachParams.value,
+    dimId,
+    dimensionName,
+    type: 1
+  });
+  let tabIndex = Number(index);
+  if (code == 200) {
+    if (data.length > 0) {
       if (dimensionName && dimId) {
         setTimeout(() => {
           nextTick(() => {
-            personListRef.value.init(data);
+            personListRef.value[tabIndex - 1].init(data);
           });
         }, 500);
       } else {
@@ -107,12 +119,21 @@ const init = (item, type) => {
   if (Number(type)) {
     getPersonDimensionChartsListApi();
     getPersonDimensionChartsRankingApi();
+    getPersonDimensionChartsListApiDimList();
     getChartsListApi();
   }
   setTimeout(() => {
     nextTick(() => {
       if (barDimEchartsRef.value) {
-        barDimEchartsRef.value.init(seachParams.value, 1);
+        if (barDimEchartsRef.value) {
+          if (Array.isArray(barDimEchartsRef.value)) {
+            dataList.dimName.map((it, id) => {
+              barDimEchartsRef.value[id - 1].init(seachParams.value, 1);
+            });
+          } else {
+            barDimEchartsRef.value.init(seachParams.value, 1);
+          }
+        }
       }
     });
   }, 500);
@@ -125,7 +146,7 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
     getPersonDimensionChartsRankingApi();
     getChartsListApi();
   } else {
-    getPersonDimensionChartsListApi(tab.props.label, tab.props.name);
+    getPersonDimensionChartsListApi(tab.props.label, tab.props.name, tab.index);
     getPersonDimensionChartsRankingApi(tab.props.label, tab.props.name);
   }
   barEchartsRef.value.init(tab.props);

+ 31 - 11
src/views/draw/children/head/headDrank.vue

@@ -25,7 +25,7 @@ const chartList = ref([]);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
     ...seachParams.value,
-    type: 0
+    type: 3
   });
   if (code == 200) {
     showLength.value = data.length;
@@ -47,18 +47,13 @@ const dataList = reactive({
   dimName: []
 });
 const seachParams = ref();
-const getPersonDimensionChartsListApi = async (
-  dimensionName?: string,
-  dimId?: number | string
-) => {
+const getPersonDimensionChartsListApiDimList = async () => {
   const { code, data } = await getPersonDimensionChartsList({
     ...seachParams.value,
-    dimId,
-    dimensionName,
     type: 3
   });
-
   if (code == 200) {
+    dataList.dimName = [];
     if (data.length > 0) {
       data.map(it => {
         it.dimensionList.map(item => {
@@ -68,10 +63,28 @@ const getPersonDimensionChartsListApi = async (
           });
         });
       });
+    }
+  }
+};
+const getPersonDimensionChartsListApi = async (
+  dimensionName?: string,
+  dimId?: number | string,
+  index?: any
+) => {
+  const { code, data } = await getPersonDimensionChartsList({
+    ...seachParams.value,
+    dimId,
+    dimensionName,
+    type: 3
+  });
+  let tabIndex = Number(index);
+
+  if (code == 200) {
+    if (data.length > 0) {
       if (dimensionName && dimId) {
         setTimeout(() => {
           nextTick(() => {
-            personListRef.value.init(data);
+            personListRef.value[tabIndex - 1].init(data);
           });
         }, 500);
       } else {
@@ -108,12 +121,19 @@ const init = (item, type) => {
   if (Number(type)) {
     getPersonDimensionChartsListApi();
     getPersonDimensionChartsRankingApi();
+    getPersonDimensionChartsListApiDimList();
     getChartsListApi();
   }
   setTimeout(() => {
     nextTick(() => {
       if (barDimEchartsRef.value) {
-        barDimEchartsRef.value.init(seachParams.value, 0);
+        if (Array.isArray(barDimEchartsRef.value)) {
+          dataList.dimName.map((it, id) => {
+            barDimEchartsRef.value[id - 1].init(seachParams.value, 0);
+          });
+        } else {
+          barDimEchartsRef.value.init(seachParams.value, 0);
+        }
       }
     });
   }, 500);
@@ -127,7 +147,7 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
     getPersonDimensionChartsRankingApi();
     getChartsListApi();
   } else {
-    getPersonDimensionChartsListApi(tab.props.label, tab.props.name);
+    getPersonDimensionChartsListApi(tab.props.label, tab.props.name, tab.index);
     getPersonDimensionChartsRankingApi(tab.props.label, tab.props.name);
   }
   barEchartsRef.value.init(tab.props);

+ 34 - 12
src/views/draw/children/health/healthDrank.vue

@@ -30,7 +30,7 @@ const chartList = ref([]);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
     ...seachParams.value,
-    type: 0
+    type: 2
   });
   if (code == 200) {
     showLength.value = data.length;
@@ -47,17 +47,11 @@ const getChartsListApi = async () => {
 const dataList = reactive({
   dimName: []
 });
-const getPersonDimensionChartsListApi = async (
-  dimensionName?: string,
-  dimId?: number | string
-) => {
+const getPersonDimensionChartsListApiDimList = async () => {
   const { code, data } = await getPersonDimensionChartsList({
     ...seachParams.value,
-    dimId,
-    dimensionName,
     type: 2
   });
-
   if (code == 200) {
     dataList.dimName = [];
     if (data.length > 0) {
@@ -69,10 +63,30 @@ const getPersonDimensionChartsListApi = async (
           });
         });
       });
+      console.log("data", data);
+      console.log("data", dataList.dimName);
+    }
+  }
+};
+const getPersonDimensionChartsListApi = async (
+  dimensionName?: string,
+  dimId?: number | string,
+  index?: any
+) => {
+  let tabIndex = Number(index);
+  const { code, data } = await getPersonDimensionChartsList({
+    ...seachParams.value,
+    dimId,
+    dimensionName,
+    type: 2
+  });
+
+  if (code == 200) {
+    if (data.length > 0) {
       if (dimensionName && dimId) {
         setTimeout(() => {
           nextTick(() => {
-            personListRef.value.init(data);
+            personListRef.value[tabIndex - 1].init(data);
           });
         }, 500);
       } else {
@@ -110,12 +124,20 @@ const init = (item, type) => {
   if (Number(type)) {
     getPersonDimensionChartsListApi();
     getPersonDimensionChartsRankingApi();
+    getPersonDimensionChartsListApiDimList();
     getChartsListApi();
   }
   setTimeout(() => {
     nextTick(() => {
       if (barDimEchartsRef.value) {
-        barDimEchartsRef.value.init(seachParams.value, 0);
+        // barDimEchartsRef.value[0].init(seachParams.value, 0);
+        if (Array.isArray(barDimEchartsRef.value)) {
+          dataList.dimName.map((it, id) => {
+            barDimEchartsRef.value[id - 1].init(seachParams.value, 0);
+          });
+        } else {
+          barDimEchartsRef.value.init(seachParams.value, 0);
+        }
       }
     });
   }, 500);
@@ -128,10 +150,10 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
     getPersonDimensionChartsRankingApi();
     getChartsListApi();
   } else {
-    getPersonDimensionChartsListApi(tab.props.label, tab.props.name);
+    getPersonDimensionChartsListApi(tab.props.label, tab.props.name, tab.index);
     getPersonDimensionChartsRankingApi(tab.props.label, tab.props.name);
   }
-  barEchartsRef.value.init(tab.props);
+  // barEchartsRef.value.init(tab.props);
 };
 const fullBig = (item: any) => {
   router.push({

+ 62 - 34
src/views/draw/children/worker/workerDrak.vue

@@ -2,7 +2,7 @@
 defineOptions({
   name: "workerDrak"
 });
-import { ref, reactive, nextTick } from "vue";
+import { ref, reactive, nextTick, onMounted } from "vue";
 import { useRouter } from "vue-router";
 import radar from "@/components/echarts/radar.vue";
 import barEcharts from "@/components/echarts/bar.vue";
@@ -48,17 +48,11 @@ const getChartsListApi = async () => {
 const dataList = reactive({
   dimName: []
 });
-const getPersonDimensionChartsListApi = async (
-  dimensionName?: string,
-  dimId?: number | string
-) => {
+const getPersonDimensionChartsListApiDimList = async () => {
   const { code, data } = await getPersonDimensionChartsList({
     ...seachParams.value,
-    dimId,
-    dimensionName,
     type: 0
   });
-
   if (code == 200) {
     dataList.dimName = [];
     if (data.length > 0) {
@@ -70,24 +64,45 @@ const getPersonDimensionChartsListApi = async (
           });
         });
       });
-      if (dimensionName && dimId) {
-        setTimeout(() => {
-          nextTick(() => {
-            personListRef.value.init(data);
-          });
-        }, 500);
-      } else {
-        setTimeout(() => {
-          nextTick(() => {
-            radarRef.value.initChart(data);
-          });
-        }, 500);
-      }
+      console.log("data", data);
+      console.log("data", dataList.dimName);
     }
   }
+};
+const getPersonDimensionChartsListApi = async (
+  dimensionName?: string,
+  dimId?: number | string,
+  index?: any
+) => {
+  const { code, data } = await getPersonDimensionChartsList({
+    ...seachParams.value,
+    dimId,
+    dimensionName,
+    type: 0
+  });
+  let tabIndex = Number(index);
 
-  // console.log(res);
+  if (code == 200) {
+    if (dimensionName && dimId) {
+      setTimeout(() => {
+        nextTick(() => {
+          if (personListRef.value) {
+            personListRef.value[tabIndex - 1].init(data);
+          }
+        });
+      }, 0);
+    } else {
+      setTimeout(() => {
+        nextTick(() => {
+          radarRef.value.initChart(data);
+        });
+      }, 500);
+    }
+  }
 };
+
+// console.log(res);
+
 // 柱状图
 const getPersonDimensionChartsRankingApi = async (
   dimensionName?: string,
@@ -107,17 +122,22 @@ const getPersonDimensionChartsRankingApi = async (
 };
 const init = (item, type) => {
   seachParams.value = item;
-  console.log("type", type);
-  console.log("type", typeof type);
   if (Number(type)) {
     getPersonDimensionChartsListApi();
     getPersonDimensionChartsRankingApi();
+    getPersonDimensionChartsListApiDimList();
     getChartsListApi();
   }
   setTimeout(() => {
     nextTick(() => {
       if (barDimEchartsRef.value) {
-        barDimEchartsRef.value.init(seachParams.value, 0);
+        if (Array.isArray(barDimEchartsRef.value)) {
+          dataList.dimName.map((it, id) => {
+            barDimEchartsRef.value[id - 1].init(seachParams.value, 0);
+          });
+        } else {
+          barDimEchartsRef.value.init(seachParams.value, 0);
+        }
       }
     });
   }, 500);
@@ -131,10 +151,20 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
     getPersonDimensionChartsRankingApi();
     getChartsListApi();
   } else {
-    getPersonDimensionChartsListApi(tab.props.label, tab.props.name);
+    getPersonDimensionChartsListApi(tab.props.label, tab.props.name, tab.index);
     getPersonDimensionChartsRankingApi(tab.props.label, tab.props.name);
   }
-  barEchartsRef.value.init(tab.props);
+  // setTimeout(() => {
+  //   nextTick(() => {
+  //     if (barDimEchartsRef.value) {
+  //       if (Array.isArray(barDimEchartsRef.value)) {
+  //         barEchartsRef.value[tabIndex - 1]?.init(tab.props);
+  //       } else {
+  //         barEchartsRef.value?.init(tab.props);
+  //       }
+  //     }
+  //   });
+  // }, 500);
 };
 const fullBig = (item: any) => {
   router.push({
@@ -167,13 +197,11 @@ const fullBig = (item: any) => {
               <barEcharts ref="barEchartsRef" :title="'总得分'" />
             </div>
             <!-- 维度得分 -->
-            <div
-              v-for="(item, index) in dataList.dimName"
-              :key="index"
-              class="flex justify-between flex-wrap items-center"
-            >
-              <div class="mt-5 pr-8 w-1/2 h-60">
-                <barDimEcharts ref="barDimEchartsRef" :title="item.name" />
+            <div class="flex justify-between flex-wrap items-center">
+              <div v-for="(item, index) in dataList.dimName" :key="index">
+                <div class="mt-5 pr-8 h-60 w-[600px]">
+                  <barDimEcharts ref="barDimEchartsRef" :title="item.name" />
+                </div>
               </div>
             </div>
           </el-tab-pane>

+ 3 - 2
src/views/evaluate/children/change/components/importIndex.vue

@@ -116,7 +116,7 @@ const handleSelectionChange = selectedRows => {
   // this.selectedRows = selectedRows;
   indexParams.tableIndex = [];
   selectedNums.value = selectedRows.length;
-  selectedRows.forEach(item => {
+  selectedRows.forEach((item, index) => {
     indexParams.tableIndex.push({
       dimId: indexParams.Relation.dimId,
       indId: item.id,
@@ -129,7 +129,8 @@ const handleSelectionChange = selectedRows => {
       startValue: "",
       datasoure: item.datasoure,
       weight: "",
-      scoreValue: ""
+      scoreValue: "",
+      order: indexParams.parentList.tableData.length + index
     });
   });
   // indexParams.tableIndex = selectedRows;

+ 28 - 45
src/views/evaluate/children/change/components/settingIndexDrawer.vue

@@ -110,32 +110,32 @@ const postUpdateApi = async () => {
         addmanyChange.outerConditionValue;
     }
     addmanyChange.innerConditionExpression.map(inn => {
-      if (containsKeywordInScore(inn.startValue, GONG_SHI)) {
+      if (containsKeywordInScore(inn?.startValue, GONG_SHI)) {
         inn.startExpress = inn.startValue;
       }
-      if (containsKeywordInScore(inn.endValue, GONG_SHI)) {
+      if (containsKeywordInScore(inn?.endValue, GONG_SHI)) {
         inn.endExpress = inn.endValue;
       }
-      if (containsKeywordInScore(inn.innerScore, GONG_SHI)) {
+      if (containsKeywordInScore(inn?.innerScore, GONG_SHI)) {
         inn.innerScoreExpress = inn.innerScore;
       }
       if (
         containsKeywordInScore(
-          inn.scoreRuleMoreInnerVO[0].innerConditionValue,
+          inn?.scoreRuleMoreInnerVO[0]?.innerConditionValue,
           GONG_SHI
         )
       ) {
         inn.scoreRuleMoreInnerVO[0].innerConditionValueExpress =
           inn.scoreRuleMoreInnerVO[0].innerConditionValue;
       }
-      inn.scoreRuleMoreInnerVO[0].scoreRules.map(isc => {
-        if (containsKeywordInScore(isc.score, GONG_SHI)) {
+      inn?.scoreRuleMoreInnerVO[0]?.scoreRules.map(isc => {
+        if (containsKeywordInScore(isc?.score, GONG_SHI)) {
           isc.scoreExpress = isc.score;
         }
-        if (containsKeywordInScore(isc.startValue, GONG_SHI)) {
+        if (containsKeywordInScore(isc?.startValue, GONG_SHI)) {
           isc.startExpress = isc.startValue;
         }
-        if (containsKeywordInScore(isc.endValue, GONG_SHI)) {
+        if (containsKeywordInScore(isc?.endValue, GONG_SHI)) {
           isc.endExpress = isc.endValue;
         }
       });
@@ -269,8 +269,10 @@ const countComputed = async () => {
         });
       }
     } else if (params.formulaType == 1) {
-      const oldValue = addmanyChange;
-      let newValue = reverseReplace(formulaForm.value, oldValue);
+      let oldValue = {};
+      Object.assign(oldValue, addmanyChange);
+      let formListNum = formulaForm.value;
+      let newValue = reverseReplace(formListNum, oldValue);
       const { code, msg, data } =
         await calculateScoreByConditionMoCondition(newValue);
       if (code == 200) {
@@ -550,7 +552,7 @@ const addNewItemOldValue = item => {
     startValue: item.endValue,
     select: null,
     endValue: null,
-    comparisonStart: item.comparisonEnd,
+    comparisonStart: item.comparisonEnd == ">" ? "≥" : ">",
     comparisonEnd: null,
     scoreRuleMoreInnerVO: []
   });
@@ -617,8 +619,6 @@ const manyConditions = () => {
   // 提取 addmanyChange 对象中的条件值
   const oldValue = addmanyChange;
   traverseObject(oldValue);
-  console.log("addmanyChange", formulaForm.value);
-  console.log("addmanyChange", addmanyChange);
 };
 // 计算器
 const jishuanqiRef = ref();
@@ -1021,7 +1021,7 @@ const handleRreeSelect = () => {
                           <el-text v-if="item.scoreRuleMoreInnerVO.length == 0"
                             >得分 =
                           </el-text>
-                          <el-input
+                          <!-- <el-input
                             v-if="
                               index + 1 ==
                                 addmanyChange.innerConditionExpression.length &&
@@ -1030,8 +1030,8 @@ const handleRreeSelect = () => {
                             disabled
                             class="ml-2 mr-5"
                             style="width: 100px"
-                          />
-                          <div v-else>
+                          /> -->
+                          <div>
                             <jishuanqi
                               v-if="item.scoreRuleMoreInnerVO.length == 0"
                               ref="jishuanqiRef"
@@ -1054,18 +1054,12 @@ const handleRreeSelect = () => {
                         >
                           <div class="flex mt-2 ml-20">
                             <div class="mr-2">条件值{{ index + 1 }} =</div>
-                            <el-input
-                              v-if="
-                                index + 1 ==
-                                  addmanyChange.innerConditionExpression
-                                    .length && index >= 1
-                              "
-                              disabled
-                              class="ml-2 mr-6"
-                              style="width: 208px"
-                            />
+                            <!-- <el-input v-if="
+                              index + 1 ==
+                              addmanyChange.innerConditionExpression
+                                .length && index >= 1
+                            " disabled class="ml-2 mr-6" style="width: 208px" /> -->
                             <jishuanqi
-                              v-else
                               ref="jishuanqiRef"
                               :index="index"
                               :outerConditionValue="itemVO.innerConditionValue"
@@ -1103,8 +1097,7 @@ const handleRreeSelect = () => {
                                 style="width: 60px"
                                 placeholder=""
                                 :disabled="
-                                  indexList + 1 == itemVO.scoreRules.length &&
-                                  index >= 1
+                                  indexList + 1 == itemVO.scoreRules.length
                                     ? true
                                     : false
                                 "
@@ -1118,8 +1111,7 @@ const handleRreeSelect = () => {
                                 style="width: 80px"
                                 placeholder=""
                                 :disabled="
-                                  indexList + 1 == itemVO.scoreRules.length &&
-                                  index >= 1
+                                  indexList + 1 == itemVO.scoreRules.length
                                     ? true
                                     : false
                                 "
@@ -1128,10 +1120,7 @@ const handleRreeSelect = () => {
                                 <el-option label="公式" value="公式" />
                               </el-select>
                               <el-input
-                                v-if="
-                                  indexList + 1 == itemVO.scoreRules.length &&
-                                  index >= 1
-                                "
+                                v-if="indexList + 1 == itemVO.scoreRules.length"
                                 disabled
                                 class="ml-2"
                                 style="width: 80px"
@@ -1159,17 +1148,11 @@ const handleRreeSelect = () => {
                               >
                                 <div>得分</div>
                                 <div>=</div>
-                                <el-input
-                                  v-if="
-                                    indexList + 1 == itemVO.scoreRules.length &&
-                                    index >= 1
-                                  "
-                                  disabled
-                                  class="ml-2"
-                                  style="width: 80px"
-                                />
+                                <!-- <el-input v-if="
+                                  indexList + 1 == itemVO.scoreRules.length &&
+                                  index >= 1
+                                " disabled class="ml-2" style="width: 80px" /> -->
                                 <jishuanqi
-                                  v-else
                                   ref="jishuanqiRef"
                                   :index="index"
                                   :indexList="indexList"

+ 1 - 1
src/views/evaluate/children/change/manage/addExam.vue

@@ -412,7 +412,7 @@ const idList = ref([]);
           >
             <el-option label="员工" :value="0" />
             <el-option label="部门" :value="1" />
-            <el-option label="医疗" :value="2" />
+            <el-option label="医疗" :value="2" />
             <el-option label="部门负责人" :value="3" />
           </el-select>
         </el-form-item>

+ 23 - 7
src/views/evaluate/children/change/mould/manageObject.vue

@@ -3,13 +3,14 @@ defineOptions({
   name: "evaluateChangeManageObject"
 });
 import { getState, getStateType, assessmentStatus } from "@/config/tag";
-import { ref, reactive, onMounted } from "vue";
+import { ref, reactive, onMounted, watch } from "vue";
 import {
   getAssessmentQuotaDetails,
   delAssessmentObject,
   getAssessmentObjectDetails,
   postAddAssessmentObject,
-  updateAssessmentQuotaDetails
+  updateAssessmentQuotaDetails,
+  alterFinishValue
 } from "@/api/assessment";
 import { getTemplateInfoList } from "@/api/templateInfo";
 import { useRouter } from "vue-router";
@@ -162,6 +163,13 @@ const assessmentTypeApi = async value => {
       treeDeptList.value = fuzhere.data;
   }
 };
+// 查询考核信息详情(考核指标)前先调用此接口,插入类型是自动采集的完成值
+const alterFinishValueApi = async () => {
+  const { code, msg } = await alterFinishValue(initParams.indexParams);
+  if (code != 200) {
+    ElMessage.error(msg);
+  }
+};
 // 指标分页查询
 const getAssessmentQuotaDetailsApi = async () => {
   const res = await getAssessmentQuotaDetails(initParams.indexParams);
@@ -169,6 +177,7 @@ const getAssessmentQuotaDetailsApi = async () => {
     console.log("指标分页查询", res);
     initParams.Indexlist = res.data.records;
     initParams.total1 = res.data.totalRow;
+    alterFinishValueApi();
   }
 };
 // 考核模板
@@ -367,17 +376,23 @@ const updateAssessmentQuotaDetailsApi = async row => {
 const tableVxeRef = ref();
 const editConfig = ref({
   trigger: "click",
-  mode: "cell"
+  mode: "cell",
+  showStatus: true
 });
 const editClosedEvent = ({ row, column }) => {
   const $table = tableVxeRef.value;
   if ($table) {
-    updateAssessmentQuotaDetailsApi(row);
-    // Object.assign(indexOf, row);
-    // postUpdateApi();
+    const updateRecords = $table.getUpdateRecords();
+    if (updateRecords.length > 0) {
+      if (
+        updateRecords[-1]?.score != row?.score ||
+        updateRecords[-1]?.finalValue != row?.finalValue
+      ) {
+        updateAssessmentQuotaDetailsApi(row);
+      }
+    }
   }
 };
-
 // 关闭弹窗
 const closePerson = () => {
   Object.assign(addPersonParams, {
@@ -582,6 +597,7 @@ const changTitle = () => {
           ref="tableVxeRef"
           class="mt-3"
           show-overflow
+          keep-source
           :edit-config="editConfig"
           :data="initParams.Indexlist"
           @edit-closed="editClosedEvent"

+ 19 - 18
src/views/indexDefine/children/import/index.vue

@@ -26,36 +26,38 @@ const uploadFile = async () => {
 
   try {
     const formData = new FormData();
-    // 将 tableData 转换为 JSON 字符串
-    const jsonTableData = JSON.stringify(tableData.value);
 
-    // 创建一个 Blob 对象,将 JSON 数据作为二进制文件上传
-    const blob = new Blob([jsonTableData], { type: "application/json" });
+    // // 将 tableData 转换为 XLSX 格式
+    // const ws = XLSX.utils.json_to_sheet(tableData.value); // 将表格数据转为工作表
+    // const wb = XLSX.utils.book_new(); // 创建一个新的工作簿
+    // XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); // 将工作表添加到工作簿
 
-    // 创建一个文件对象
-    const file = new File([blob], "tableData.json", {
-      type: "application/json"
-    });
+    // // 将工作簿转换为二进制的 XLSX 文件数据
+    // const xlsxData = XLSX.write(wb, { bookType: "xlsx", type: "array" });
 
-    // 将生成的文件添加到 FormData 中
-    formData.append("file", file);
+    // // 创建一个 Blob 对象,指定 MIME 类型为 XLSX 格式
+    // const blob = new Blob([xlsxData], {
+    //   type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+    // });
+
+    // // 创建一个文件对象
+    // const file = new File([blob], "tableData.xlsx", {
+    //   type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+    // });
 
-    // 你可以在这里使用 FileReader 进一步处理文件数据
-    const reader = new FileReader();
-    reader.onload = function (event) {
-      const arrayBuffer = event.target.result;
-      // 如果需要在上传前处理文件的二进制数据,可以在这里做
-    };
+    // 将生成的文件添加到 FormData 中
+    formData.append("file", fileDocument.value);
 
     // 获取文件并执行上传
     const fileToSend = formData.get("file");
+
     // 调用 API 上传文件
     const { data } = await postUpdateDeptApi({ file: fileToSend });
+    // const { data } = await postUpdateDeptApi({ file: formData });
     if (data.code === 200) {
       // 根据后端返回的 code 判断是否成功
       ElMessage.success("文件上传并导入成功");
       // 重置上传状态
-      // uploadShow.value = true;
       backDefine();
       $router.push("/indexDefine/children/define");
       tableHeaders.value = []; // 清空表头
@@ -80,7 +82,6 @@ const handleUploadChange = async (file: File) => {
   fileDocument.value = file; // 保存文件
   const reader = new FileReader();
   let fileType = file.name.slice(-4);
-  console.log("文件", file.name.slice(-4));
   if (fileType == "xlsx") {
     const formData = new FormData();
     formData.append("file", fileDocument.value); // 将文件添加到表单数据