Parcourir la source

Merge branch 'dev' of http://111.2.21.141:33001/ystl_myq/hospital-project into dev

haifeng.zhang il y a 1 semaine
Parent
commit
6770691c5a

+ 14 - 2
src/api/download.ts

@@ -40,8 +40,9 @@ export const postUpdateDeptApi = async data => {
 };
 
 // 考核指标下载
-export const assessmentDownloadDataRosterTemplateApi = async () => {
+export const assessmentDownloadDataRosterTemplateApi = async type => {
   const token = localStorage.getItem("token") || "";
+  const params = { type };
   try {
     const response = await axios.get(
       FLIE_URL + "/assessment/downloadAssessmentTemplate",
@@ -49,7 +50,8 @@ export const assessmentDownloadDataRosterTemplateApi = async () => {
         responseType: "blob", // 确保接收的是二进制数据
         headers: {
           satoken: token // 将 token 添加到请求头
-        }
+        },
+        params
       }
     );
     // 创建 Blob 对象并生成下载链接
@@ -69,3 +71,13 @@ export const assessmentDownloadDataRosterTemplateApi = async () => {
     ElMessage.error("模板下载失败,请重试");
   }
 };
+// 上传
+export const postImportAssessmentTemplate = async data => {
+  const token = localStorage.getItem("token") || "";
+  return axios.post(`${FLIE_URL}/assessment/importAssessmentTemplate`, data, {
+    headers: {
+      "Content-Type": "multipart/form-data", // 指定内容类型
+      satoken: token // 将 Token 添加到请求头
+    }
+  });
+};

+ 10 - 0
src/api/templateInfo.ts

@@ -68,3 +68,13 @@ export const postUpdate = data => {
     }
   );
 };
+//  根据条件计算得分
+export const calculateScoreByConditionMoCondition = data => {
+  return http.request<templateInfoList>(
+    "post",
+    `/assessment/calculateScoreByConditionMoCondition`,
+    {
+      data
+    }
+  );
+};

+ 6 - 0
src/api/userSetting.ts

@@ -57,3 +57,9 @@ export const userPageWhitOrganization = data => {
     data
   });
 };
+// 获取所有负责人数据(deptCode不转返回所有)
+export const getLeaderList = (data?: string) => {
+  return http.request<userPageList>("get", "/user/getLeaderList", {
+    data
+  });
+};

+ 53 - 49
src/components/echarts/radar.vue

@@ -13,55 +13,59 @@ const chartRef = ref();
 const { setOptions } = useECharts(chartRef, { theme });
 
 // 根据配置项渲染ECharts
-setOptions({
-  tooltip: {},
-  legend: {
-    // icon: "arrow",
-    itemWidth: 25,
-    itemHeight: 4,
-    data: ["得分率"],
-    top: 10,
-    left: "left"
-  },
-  radar: {
-    radius: "70%", // 调整半径以使雷达图更大
-    indicator: [
-      { name: "数量" },
-      { name: "科研" },
-      { name: "教学" },
-      { name: "强度" },
-      { name: "难度" },
-      { name: "质量" },
-      { name: "效率" }
-    ],
-    axisName: {
-      color: "black"
-    }
-  },
-  series: [
-    {
-      name: "得分率",
-      type: "radar",
-      areaStyle: {
-        normal: {
-          color: "rgba(0, 128, 255, 0.2)" // 设置内部填充颜色和透明度
-        }
-      },
-      lineStyle: {
-        normal: {
-          width: 1, // 设置线条宽度为 1
-          color: "rgba(0, 128, 255, 1)" // 设置线条颜色
-        }
-      },
-      data: [
-        {
-          value: [30, 60, 90, 120, 150, 160, 10],
-          name: "支出"
-        }
-      ]
-    }
-  ]
-});
+const initChart = item => {
+  setOptions({
+    tooltip: {},
+    legend: {
+      // icon: "arrow",
+      itemWidth: 25,
+      itemHeight: 4,
+      data: ["得分率"],
+      top: 10,
+      left: "left"
+    },
+    radar: {
+      radius: "70%", // 调整半径以使雷达图更大
+      indicator: [
+        { name: "数量" },
+        { name: "科研" },
+        { name: "教学" },
+        { name: "强度" },
+        { name: "难度" },
+        { name: "质量" },
+        { name: "效率" }
+      ],
+      axisName: {
+        color: "black"
+      }
+    },
+    series: [
+      {
+        name: "得分率",
+        type: "radar",
+        areaStyle: {
+          normal: {
+            color: "rgba(0, 128, 255, 0.2)" // 设置内部填充颜色和透明度
+          }
+        },
+        lineStyle: {
+          normal: {
+            width: 1, // 设置线条宽度为 1
+            color: "rgba(0, 128, 255, 1)" // 设置线条颜色
+          }
+        },
+        data: [
+          {
+            value: [30, 60, 90, 120, 150, 160, 10],
+            name: "支出"
+          }
+        ]
+      }
+    ]
+  });
+};
+// initChart();
+defineExpose({ initChart });
 </script>
 
 <template>

+ 107 - 33
src/components/import/index.vue

@@ -1,7 +1,12 @@
 <script setup lang="ts">
 import { ref, onMounted } from "vue";
 import { useRoute, useRouter } from "vue-router";
-import { assessmentDownloadDataRosterTemplateApi } from "@/api/download";
+import * as XLSX from "xlsx";
+import {
+  assessmentDownloadDataRosterTemplateApi,
+  postImportAssessmentTemplate
+} from "@/api/download";
+import { ElMessage } from "element-plus";
 defineOptions({
   name: "IndexDefineImport"
 });
@@ -10,35 +15,98 @@ const router = useRouter();
 const emit = defineEmits(["handleImport"]);
 const uploadShow = ref(true);
 const query = ref({});
+const fileDocument = ref<File | null>(null); // 存储文件
+
 onMounted(() => {
-  console.log("111", route.query);
+  // assessmentType
   Object.assign(query.value, route.query);
+  console.log("111", query.value);
 });
-const uploadFile = () => {
-  uploadShow.value = !uploadShow.value;
+const uploadFile = () => {};
+const tableHeaders = ref<any>([]);
+const tableData = ref<any>([
+  { name: "" },
+  { defin: "" },
+  { caliber: "" },
+  { type: "" },
+  { from: "" }
+]);
+const handleUploadChange = (file: File) => {
+  fileDocument.value = file; // 保存文件
+  const reader = new FileReader();
+  let fileType = file.name.slice(-4);
+  console.log("文件", file.name.slice(-4));
+  if (fileType == "xlsx") {
+    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.length > 0) {
+        tableHeaders.value = jsonData[0]; // 表头
+        tableData.value = jsonData.slice(1).map(row => {
+          const rowData = {};
+          tableHeaders.value.forEach((header, index) => {
+            rowData[header] = row[index] !== undefined ? row[index] : null; // 填充缺失值
+          });
+          return rowData;
+        });
+        console.log("表头", tableHeaders.value);
+        ElMessage.success("文件上传成功");
+        uploadShow.value = false; // 隐藏上传区域,显示数据表
+      } else {
+        ElMessage.error("文件为空或格式不正确");
+      }
+    };
+  } else {
+    ElMessage.error("请上传xlsx文件");
+  }
+
+  reader.readAsArrayBuffer(file); // 读取文件为 ArrayBuffer
 };
-const tableData = [
-  {
-    date: "2016-05-03",
-    name: "Tom",
-    address: "No. 189, Grove St, Los Angeles"
-  },
-  {
-    date: "2016-05-02",
-    name: "Tom",
-    address: "No. 189, Grove St, Los Angeles"
-  },
-  {
-    date: "2016-05-04",
-    name: "Tom",
-    address: "No. 189, Grove St, Los Angeles"
-  },
-  {
-    date: "2016-05-01",
-    name: "Tom",
-    address: "No. 189, Grove St, Los Angeles"
+// 上传
+const postImportAssessmentTemplateApi = async data => {
+  if (!fileDocument.value) {
+    ElMessage.error("请先上传文件");
+    return;
   }
-];
+  try {
+    const formData = new FormData();
+    formData.append("file", fileDocument.value); // 将文件添加到表单数据
+
+    // 调用 API 上传文件
+    const { data } = await postImportAssessmentTemplate({
+      formData,
+      type: route.query.assessmentType,
+      assessmentId: route.query.id
+    });
+    console.log("dsada", data);
+    if (data.code === 200) {
+      // 根据后端返回的 code 判断是否成功
+      ElMessage.success("文件上传并导入成功");
+      // 重置上传状态
+      // uploadShow.value = true;
+      // $router.push("/IndexDefine/children/define");
+      router.back();
+      uploadShow.value = !uploadShow.value;
+      tableHeaders.value = []; // 清空表头
+      tableData.value = [
+        { name: "" },
+        { defin: "" },
+        { caliber: "" },
+        { type: "" },
+        { from: "" }
+      ]; // 清空表格数据
+    } else {
+      ElMessage.error(data.msg);
+    }
+  } catch (error) {
+    ElMessage.error("上传失败,请重试");
+    console.error(error);
+  }
+};
 const backDefine = () => {
   router.back();
 };
@@ -52,7 +120,9 @@ const backDefine = () => {
         <p class="text-xs mt-2 text">根据提升信息完善表格内容</p>
         <el-button
           class="mt-2"
-          @click="assessmentDownloadDataRosterTemplateApi()"
+          @click="
+            assessmentDownloadDataRosterTemplateApi(route.query.assessmentType)
+          "
           ><el-icon><Download /></el-icon>下载空的模板表格</el-button
         >
       </div>
@@ -66,7 +136,8 @@ const backDefine = () => {
             class="upload-demo"
             drag
             action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
-            multiple
+            :before-upload="file => handleUploadChange(file)"
+            :show-file-list="false"
           >
             <el-icon class="el-icon--upload"><upload-filled /></el-icon>
             <div class="el-upload__text">
@@ -81,16 +152,19 @@ const backDefine = () => {
             style="width: 100%"
             max-height="250"
           >
-            <el-table-column prop="date" label="指标编号" width="180" />
-            <el-table-column prop="name" label="指标名称" width="180" />
-            <el-table-column prop="address" label="指标分类" />
-            <el-table-column prop="address" label="指标定义" />
-            <el-table-column prop="address" label="指标口径" />
+            <el-table-column
+              v-for="header in tableHeaders"
+              :key="header"
+              :label="header"
+              :prop="header"
+            />
           </el-table>
         </div>
         <div class="float-right">
           <el-button @click="backDefine">取消</el-button>
-          <el-button type="primary" @click="uploadFile">确认</el-button>
+          <el-button type="primary" @click="postImportAssessmentTemplateApi"
+            >确认</el-button
+          >
         </div>
         <p class="h-11 no-select">.</p>
       </div>

+ 0 - 3
src/router/utils.ts

@@ -283,8 +283,6 @@ function initRouter() {
           addAuths(cleanEmptyChildren(menuDataList), btnList.value);
           handleAsyncRoutes(cloneDeep(cleanEmptyChildren(menuDataList)));
           storageLocal().setItem(key, cleanEmptyChildren(menuDataList));
-          console.log("指标没有了2222", cleanEmptyChildren(menuDataList));
-
           resolve(router);
         });
       });
@@ -295,7 +293,6 @@ function initRouter() {
         let menuDataList = matchAndMerge(data, muenList);
         addAuths(cleanEmptyChildren(menuDataList), btnList.value);
         handleAsyncRoutes(cloneDeep(cleanEmptyChildren(menuDataList)));
-        console.log("指标没有了1111", cleanEmptyChildren(menuDataList));
         resolve(router);
       });
     });

+ 11 - 0
src/views/draw/children/worker/componements/seach.vue

@@ -5,6 +5,7 @@ import { userPageWhitOrganization } from "@/api/userSetting";
 import { getAssessmentPageList } from "@/api/manage";
 import { postListTree } from "@/api/department";
 const value = ref("");
+const $emit = defineEmits(["handClick"]);
 const dataList = reactive({
   teplist: [],
   personList: [],
@@ -17,6 +18,12 @@ const dataList = reactive({
     assessmentObjectId: ""
   }
 });
+const handClickInit = value => {
+  const selectedItem = dataList.magList.find(item => item.id === value);
+  console.log("selectedItem", selectedItem);
+  $emit("handClick", dataList.params);
+};
+// 搜索框----------------------------------------------------
 // 考核模板
 const getTemplateInfoListApi = async () => {
   const { data, code } = await getTemplateInfoList({
@@ -96,6 +103,7 @@ const options = [
             filterable
             placeholder="请选择"
             style="width: 200px"
+            @change="handClickInit"
           >
             <el-option
               v-for="item in dataList.magList"
@@ -113,6 +121,7 @@ const options = [
             filterable
             placeholder="请选择"
             style="width: 200px"
+            @change="handClickInit"
           >
             <el-option
               v-for="item in dataList.teplist"
@@ -136,6 +145,7 @@ const options = [
               children: 'childrenRes'
             }"
             style="width: 200px"
+            @change="handClickInit"
           />
         </div>
         <div class="flex mr-2">
@@ -146,6 +156,7 @@ const options = [
             filterable
             placeholder="请选择"
             style="width: 200px"
+            @change="handClickInit"
           >
             <el-option
               v-for="item in dataList.personList"

+ 187 - 157
src/views/draw/children/worker/workerDrak.vue

@@ -12,12 +12,14 @@ import qvanping from "@/assets/rank/qvanping@2x.png";
 import seachData from "./componements/seach.vue";
 import {
   getPersonDimensionChartsList,
+  getPersonDimensionChartsRanking,
   getAssessmentList,
   getChartsList
 } from "@/api/draw";
 import type { TabsPaneContext } from "element-plus";
 const router = useRouter();
 const value = ref("");
+const rankTableRef = ref();
 const activeName = ref("1");
 // 柱状图
 const barEchartsRef = ref();
@@ -37,10 +39,21 @@ const params = reactive({
 });
 const getPersonDimensionChartsListApi = async () => {
   const { code, data } = await getPersonDimensionChartsList(params.params);
-  // barEchartsRef.value.setOption(data);
-  // console.log("data", data);
 };
-getPersonDimensionChartsListApi();
+// 雷达图
+// const drawRank = ref();
+const getPersonDimensionChartsRankingApi = async item => {
+  console.log("item", item);
+  const { code, data } = await getPersonDimensionChartsRanking({
+    ...item,
+    type: 0
+  });
+  if (code == 200) {
+    // drawRank.value = data;
+    rankTableRef.value.initChart(data);
+  }
+};
+// getPersonDimensionChartsListApi();
 // 维度表格
 const personListRef = ref();
 const barEchartsList = reactive({
@@ -104,180 +117,197 @@ const fullBig = (item: any) => {
 <template>
   <div class="w-[100%]">
     <div class="w-[100%]">
-      <seachData />
-      <div class="flex mr-2">
-        <radar />
-      </div>
-      <el-tabs
-        v-model="activeName"
-        class="demo-tabs"
-        :lazy="true"
-        @tab-click="handleClick"
-      >
-        <el-tab-pane label="总览" name="1">
-          <div class="flex mr-8">
-            <rankTable />
-          </div>
-          <!-- 总得分 -->
-          <div class="mt-5 pr-8 w-full h-60">
-            <barEcharts ref="barEchartsRef" :title="barEchartsList.zongfen" />
-          </div>
-          <!-- 维度得分 -->
-          <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
-            <div class="w-1/2 h-full">
-              <barEcharts :title="barEchartsList.shuliang" />
-            </div>
-            <div class="w-1/2 h-full">
-              <barEcharts :title="barEchartsList.xiaolve" />
-            </div>
-          </div>
-          <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
-            <div class="w-1/2 h-full">
-              <barEcharts
-                ref="barEchartsRef"
-                :title="barEchartsList.zhiliang"
-              />
-            </div>
-            <div class="w-1/2 h-full">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.nandu" />
-            </div>
-          </div>
-          <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
-            <div class="w-1/2 h-full">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.qiandu" />
+      <seachData @handClick="getPersonDimensionChartsRankingApi" />
+      <div>
+        <div class="flex mr-2">
+          <radar ref="rankTableRef" />
+        </div>
+        <el-tabs
+          v-model="activeName"
+          class="demo-tabs"
+          :lazy="true"
+          @tab-click="handleClick"
+        >
+          <el-tab-pane label="总览" name="1">
+            <div class="flex mr-8">
+              <rankTable />
             </div>
-            <div class="w-1/2 h-full">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.jiaoxue" />
+            <!-- 总得分 -->
+            <div class="mt-5 pr-8 w-full h-60">
+              <barEcharts ref="barEchartsRef" :title="barEchartsList.zongfen" />
             </div>
-          </div>
-          <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
-            <div class="w-1/2 h-full">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.keyan" />
-            </div>
-            <div class="w-1/2 h-full">
-              <!-- <barEcharts :title="barEchartsList.kexue" /> -->
-            </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="数量" name="2" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.shuliang)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+            <!-- 维度得分 -->
+            <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
+              <div class="w-1/2 h-full">
+                <barEcharts :title="barEchartsList.shuliang" />
               </div>
-            </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts
-                ref="barEchartsRef"
-                :title="barEchartsList.shuliang"
-              />
-            </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="效率" name="3" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.xiaolve)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+              <div class="w-1/2 h-full">
+                <barEcharts :title="barEchartsList.xiaolve" />
               </div>
             </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.xiaolve" />
-            </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="质量" name="4" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.zhiliang)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+            <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
+              <div class="w-1/2 h-full">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.zhiliang"
+                />
+              </div>
+              <div class="w-1/2 h-full">
+                <barEcharts ref="barEchartsRef" :title="barEchartsList.nandu" />
               </div>
             </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts
-                ref="barEchartsRef"
-                :title="barEchartsList.zhiliang"
-              />
+            <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
+              <div class="w-1/2 h-full">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.qiandu"
+                />
+              </div>
+              <div class="w-1/2 h-full">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.jiaoxue"
+                />
+              </div>
             </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="难度" name="5" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.nandu)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+            <div class="mt-5 pr-8 w-full h-60 flex justify-between item-center">
+              <div class="w-1/2 h-full">
+                <barEcharts ref="barEchartsRef" :title="barEchartsList.keyan" />
+              </div>
+              <div class="w-1/2 h-full">
+                <!-- <barEcharts :title="barEchartsList.kexue" /> -->
               </div>
             </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.nandu" />
+          </el-tab-pane>
+          <el-tab-pane label="数量" name="2" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.shuliang)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.shuliang"
+                />
+              </div>
             </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="强度" name="6" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.qiandu)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+          </el-tab-pane>
+          <el-tab-pane label="效率" name="3" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.xiaolve)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.xiaolve"
+                />
               </div>
             </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.qiandu" />
+          </el-tab-pane>
+          <el-tab-pane label="质量" name="4" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.zhiliang)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.zhiliang"
+                />
+              </div>
             </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="教学" name="7" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.jiaoxue)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+          </el-tab-pane>
+          <el-tab-pane label="难度" name="5" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.nandu)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts ref="barEchartsRef" :title="barEchartsList.nandu" />
               </div>
             </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.jiaoxue" />
+          </el-tab-pane>
+          <el-tab-pane label="强度" name="6" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.qiandu)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.qiandu"
+                />
+              </div>
             </div>
-          </div>
-        </el-tab-pane>
-        <el-tab-pane label="科研" name="8" :lazy="true">
-          <div class="w-full">
-            <div class="flex justify-between">
-              <personList ref="personListRef" class="w-11/12" />
-              <div
-                class="w-[30px] h-[30px] mr-10 cursor-pointer"
-                @click="fullBig(barEchartsList.keyan)"
-              >
-                <img class="w-full h-full" :src="qvanping" alt="" />
+          </el-tab-pane>
+          <el-tab-pane label="教学" name="7" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.jiaoxue)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts
+                  ref="barEchartsRef"
+                  :title="barEchartsList.jiaoxue"
+                />
               </div>
             </div>
-            <div class="w-full h-60 mt-5 pr-8">
-              <barEcharts ref="barEchartsRef" :title="barEchartsList.keyan" />
+          </el-tab-pane>
+          <el-tab-pane label="科研" name="8" :lazy="true">
+            <div class="w-full">
+              <div class="flex justify-between">
+                <personList ref="personListRef" class="w-11/12" />
+                <div
+                  class="w-[30px] h-[30px] mr-10 cursor-pointer"
+                  @click="fullBig(barEchartsList.keyan)"
+                >
+                  <img class="w-full h-full" :src="qvanping" alt="" />
+                </div>
+              </div>
+              <div class="w-full h-60 mt-5 pr-8">
+                <barEcharts ref="barEchartsRef" :title="barEchartsList.keyan" />
+              </div>
             </div>
-          </div>
-        </el-tab-pane>
-      </el-tabs>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
     </div>
   </div>
 </template>

+ 10 - 11
src/views/evaluate/children/change/components/editMould.vue

@@ -36,13 +36,17 @@ const formLabelAlign = reactive({
   showFinalValue: 0,
   showChallengeValue: 0,
   showStartValue: 0,
-  remark: ""
+  remark: "",
+  tpId: ""
 });
 const newAddItem = ref();
 const handleClose = (done: () => void) => {
+  done();
   drawer.value = false;
 };
-function cancelClick() {}
+function cancelClick() {
+  drawer.value = false;
+}
 function confirmClick() {
   ruleFormRef.value.validate((valid: boolean) => {
     if (valid) {
@@ -58,7 +62,7 @@ const open = (row: any, title: string, order: number) => {
   dalongTitle.value = title;
   if (title == "新建") {
     Object.assign(formLabelAlign, {
-      id: row.id ? row.id : $route.query.id,
+      tpId: row.id ? row.id : $route.query.id,
       list: [],
       dimName: "",
       dimWeight: 0,
@@ -133,18 +137,13 @@ const showStartValueValue = computed({
 // 分割————————————————————————————————————————————
 // 新建维度
 const postAddDimensionApi = async () => {
-  let tpId = formLabelAlign.id;
-  let dataList = formLabelAlign;
-  delete dataList.id;
-  let list = { tpId: tpId, ...dataList };
-  console.log("dsafasfafwaw", list);
-  const { code, msg } = await postAddDimension(list);
+  const { code, msg } = await postAddDimension(formLabelAlign);
   if (code === 200) {
     ElMessage({
       message: "添加成功",
       type: "success"
     });
-    $emit("handClick");
+    $emit("handClick", formLabelAlign.tpId);
     drawer.value = false;
   } else {
     ElMessage({
@@ -161,7 +160,7 @@ const postUpdateDeptApi = async () => {
       message: "更新成功",
       type: "success"
     });
-    $emit("handClick");
+    $emit("handClick", formLabelAlign.tpId);
     drawer.value = false;
   } else {
     ElMessage({

+ 30 - 4
src/views/evaluate/children/change/components/newAdd.vue

@@ -88,8 +88,29 @@ const postAddTemplateApi = async () => {
 const eaxmCard = ref([]);
 // 获取维度
 const getListByApi = async () => {
-  console.log(tepNameForm.id);
-  const { code, data, msg } = await getListBy(tepNameForm.id);
+  const obj = {
+    tpId: tepNameForm.id
+  };
+  const { code, data, msg } = await getListBy(obj);
+  Object.assign(tepNameForm, {
+    tpName: "",
+    id: ""
+  });
+  if (code === 200) {
+    titleShow.value = true;
+    eaxmCard.value = data;
+    eaxmCard.value.forEach(item => {
+      initializeTableData(item);
+    });
+  } else {
+    ElMessage.error(msg);
+  }
+};
+const getAddListByApi = async id => {
+  const obj = {
+    tpId: id
+  };
+  const { code, data, msg } = await getListBy(obj);
   Object.assign(tepNameForm, {
     tpName: "",
     id: ""
@@ -251,11 +272,16 @@ const importIndexDialog = row => {
 };
 const importIndexOne = async row => {
   // console.log("row", row);
+  let formula = JSON.stringify({
+    noConditionFormula: ""
+  });
   const res = await postAddRelationList([
     {
       dimId: row.id,
       indId: row.tpId,
-      tpId: ""
+      tpId: "",
+      formula,
+      scoreStandard: 0
     }
   ]);
   if (res.code === 200) {
@@ -333,7 +359,7 @@ const postUpdateApi = async (dimId, indId, order) => {
     <editMould
       ref="editDrawer"
       v-model:drawerValue="editDrawerShow"
-      @handClick="getListByApi"
+      @handClick="getAddListByApi"
     />
     <div class="w-[100%] flex justify-evenly">
       <div class="left-box">

+ 215 - 144
src/views/evaluate/children/change/components/settingIndexDrawer.vue

@@ -1,8 +1,12 @@
 <script setup lang="ts">
-import { ref, reactive } from "vue";
+import { ref, reactive, watch } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { calculator } from "./evaluate";
-import { getIndexInfo } from "@/api/templateInfo";
+import {
+  getIndexInfo,
+  postUpdate,
+  calculateScoreByConditionMoCondition
+} from "@/api/templateInfo";
 import { conditionVerify } from "@/api/formula";
 import type { DrawerProps, FormItemProps, FormProps } from "element-plus";
 // const itemLabelPosition = ref<FormItemProps["labelPosition"]>("");
@@ -44,9 +48,47 @@ const getIndexInfoApi = async id => {
   if (code === 200) {
     Object.assign(params, data);
     if (isValidJSON(data.formula)) {
-      params.formula = JSON.parse(data.formula);
+      if (params.formulaType == 0) {
+        params.formula = JSON.parse(data.formula);
+      } else if (params.formulaType == 1) {
+        let aa = JSON.parse(data.formula);
+        let bb = JSON.parse(aa.noConditionFormula);
+        Object.assign(addmanyChange, bb);
+      }
+    }
+    if (!data.formula) {
+      params.formula = {
+        noConditionFormula: ""
+      };
+    } else {
+    }
+    if (!data.formulaType) {
+      params.formulaType = 0;
     }
-    console.log("params", params);
+  } else {
+    ElMessage.error(msg);
+  }
+};
+// 更新指标
+const postUpdateApi = async () => {
+  if (params.formulaType == 0) {
+    params.formula = JSON.stringify(params.formula);
+  } else {
+    params.formula = {
+      noConditionFormula: ""
+    };
+    params.formula.noConditionFormula = JSON.stringify(addmanyChange);
+    params.formula = JSON.stringify(params.formula);
+  }
+  const { msg, code } = await postUpdate(params);
+  if (code === 200) {
+    ElMessage({
+      message: "编辑成功",
+      type: "success"
+    });
+    disabledValue.value = true;
+    editShow.value = true;
+    drawer.value = !drawer.value;
   } else {
     ElMessage.error(msg);
   }
@@ -57,71 +99,105 @@ const formulaForm = ref([]);
 const grade = ref();
 const conditionVerifyApi = async () => {
   dialogFormVisibleFormula.value = true;
-  formulaForm.value = [];
-  grade.value = "";
-  console.log("params", params);
-
-  const keywords = ["完成值", "目标值", "门槛值", "挑战值", "增幅", "降幅"];
-  let str = params.formula.noConditionFormula;
-  // 创建一个正则表达式,匹配这些关键词
-  const regex = new RegExp(keywords.join("|"), "g");
-  // 提取字符串中的所有关键词
-  let matches = str.match(regex);
-  console.log("匹配到的关键词:", matches);
-  matches.forEach(matchItem => {
-    formulaForm.value.push({
-      name: matchItem,
-      value: ""
-    });
-  });
-  let result = str.replace(regex, match => {
-    return `${match}`;
-  });
-  console.log("formula", formulaForm.value);
+  try {
+    formulaForm.value = [];
+    grade.value = "";
+    console.log("params", params);
 
-  // let formula = JSON.stringify(params.formula);
-  // const { code, msg } = await conditionVerify({
-  //   formulaType: params.formulaType,
-  //   formula
-  // });
-};
-// 计算
-const countComputed = async () => {
-  const formula = JSON.stringify(params.formula);
-  const { code, msg } = await conditionVerify({
-    formulaType: params.formulaType,
-    formula
-  });
-  if (code == 200) {
     const keywords = ["完成值", "目标值", "门槛值", "挑战值", "增幅", "降幅"];
     let str = params.formula.noConditionFormula;
     // 创建一个正则表达式,匹配这些关键词
     const regex = new RegExp(keywords.join("|"), "g");
+    // 提取字符串中的所有关键词
+    let matches = str.match(regex);
+    console.log("匹配到的关键词:", matches);
+    matches.forEach(matchItem => {
+      formulaForm.value.push({
+        name: matchItem,
+        value: ""
+      });
+    });
     let result = str.replace(regex, match => {
-      // 在 formulaForm.value 中查找匹配的项
-      let matchedItem = formulaForm.value.find(item => item.name === match);
+      return `${match}`;
+    });
+  } catch (err) {}
+};
+// 计算
+const countComputed = async () => {
+  try {
+    if (params.formulaType == 0) {
+      const formula = JSON.stringify(params.formula);
+      const { code, msg } = await conditionVerify({
+        formulaType: params.formulaType,
+        formula
+      });
+      if (code == 200) {
+        const keywords = [
+          "完成值",
+          "目标值",
+          "门槛值",
+          "挑战值",
+          "增幅",
+          "降幅"
+        ];
+        let str = params.formula.noConditionFormula;
+        // 创建一个正则表达式,匹配这些关键词
+        const regex = new RegExp(keywords.join("|"), "g");
+        let result = str.replace(regex, match => {
+          // 在 formulaForm.value 中查找匹配的项
+          let matchedItem = formulaForm.value.find(item => item.name === match);
 
-      // 如果找到匹配项,返回其 value,否则返回原始匹配值
-      if (matchedItem) {
-        return matchedItem.value; // 替换为对应的值
+          // 如果找到匹配项,返回其 value,否则返回原始匹配值
+          if (matchedItem) {
+            return matchedItem.value; // 替换为对应的值
+          }
+          return match; // 如果没有匹配项,返回原始匹配值
+        });
+        calculator.calculate(result);
+        grade.value = calculator.get();
+      } else {
+        ElMessageBox.confirm(
+          "如果不修改将无法计算得分",
+          "公式计算错误,修改后确认",
+          {
+            type: "warning"
+          }
+        ).then(() => {
+          dialogFormVisibleFormula.value = false;
+        });
       }
-      return match; // 如果没有匹配项,返回原始匹配值
-    });
-    calculator.calculate(result);
-    grade.value = calculator.get();
-  } else {
-    ElMessageBox.confirm("配置项未保存,确认关闭", {
-      type: "warning"
-    }).then(() => {
-      dialogFormVisibleFormula.value = false;
-    });
+    } else if (params.formulaType == 1) {
+      let aa = JSON.parse(JSON.stringify(addmanyChange));
+      aa.outerConditionValue = formulaForm.value[0].value;
+      formulaForm.value.map((item, index) => {
+        console.log("item", aa);
+        if (index > 0) {
+          delete aa.innerConditionExpression[index - 1].select;
+          aa.innerConditionExpression[
+            index - 1
+          ].scoreRuleMoreInnerVO[0].innerConditionValue = item.value;
+        }
+      });
+      const { code, msg, data } =
+        await calculateScoreByConditionMoCondition(aa);
+      console.log("aaa", aa);
+      if (code == 200) {
+        grade.value = data;
+      } else {
+        ElMessageBox.confirm(
+          "如果不修改将无法计算得分",
+          "公式计算错误,修改后确认",
+          {
+            type: "warning"
+          }
+        ).then(() => {
+          dialogFormVisibleFormula.value = false;
+        });
+      }
+    }
+  } catch (err) {
+    console.log(err);
   }
-  // ElMessageBox.confirm("配置项未保存,确认关闭", {
-  //   type: "warning"
-  // }).then(() => {
-
-  // })
-  // console.log();
 };
 // 判断是否为json
 function isValidJSON(str) {
@@ -147,18 +223,44 @@ function cancelClick() {
   editShow.value = true;
 }
 function confirmClick() {
-  console.log(1111);
-  disabledValue.value = true;
-  editShow.value = true;
-  drawer.value = !drawer.value;
-  ElMessage({
-    message: "保存成功",
-    type: "success"
-  });
+  postUpdateApi();
 }
 const open = row => {
   drawer.value = true;
-  // console.log("row", row.id);
+  Object.assign(params, {
+    id: "",
+    tpId: "",
+    dimId: "",
+    indId: "",
+    valueInput: "",
+    scoreStandard: 0,
+    remark: "",
+    scoreRule: "",
+    targetValue: "",
+    finalValue: "",
+    formulaType: 0,
+    challengeValue: "",
+    startValue: "",
+    datasoure: "",
+    weight: "",
+    scoreValue: "",
+    formula: {
+      noConditionFormula: ""
+    }
+  });
+  Object.assign(addmanyChange, {
+    outerConditionValue: "",
+    innerConditionExpression: [
+      {
+        startValue: null,
+        endValue: null,
+        select: null,
+        comparisonStart: null,
+        comparisonEnd: null,
+        scoreRuleMoreInnerVO: []
+      }
+    ]
+  });
   getIndexInfoApi(row.id);
 };
 const editShow = ref(true);
@@ -193,6 +295,14 @@ const rolesList = reactive({
   value: "",
   num: null
 });
+// 监听formulaType变化
+const watchFormulaType = value => {
+  if (value == 0 && typeof params.formula == "string") {
+    let aa = JSON.parse(params.formula);
+    params.formula = aa;
+    params.formula.noConditionFormula = "";
+  }
+};
 const lookRoles = item => {
   bgColor.value = item.id;
   params.formula.noConditionFormula =
@@ -229,65 +339,6 @@ const count = item => {
   }
 };
 // 多条件公式
-const manyChange = reactive({
-  newData: "",
-  dataList: [
-    {
-      compare: "0", // 比较符号
-      compareList: [
-        {
-          value: "0",
-          label: ">"
-        },
-        {
-          value: "1",
-          label: "≥"
-        }
-      ],
-      formula: "0",
-      formulaList: [
-        {
-          value: "0",
-          label: "数值"
-        },
-        {
-          value: "1",
-          label: "公式"
-        }
-      ],
-      value: "",
-      newData: "",
-      dataList: [
-        {
-          compare: "0", // 比较符号
-          compareList: [
-            {
-              value: "0",
-              label: ">"
-            },
-            {
-              value: "1",
-              label: "≥"
-            }
-          ],
-          formula: "0",
-          formulaList: [
-            {
-              value: "0",
-              label: "数值"
-            },
-            {
-              value: "1",
-              label: "公式"
-            }
-          ],
-          value: "",
-          grade: ""
-        }
-      ]
-    }
-  ]
-});
 const addmanyChange = reactive({
   outerConditionValue: "",
   innerConditionExpression: [
@@ -298,19 +349,19 @@ const addmanyChange = reactive({
       comparisonStart: null,
       comparisonEnd: null,
       scoreRuleMoreInnerVO: [
-        {
-          innerConditionValue: null,
-          scoreRules: [
-            {
-              score: null,
-              startValue: null,
-              select: "",
-              endValue: null,
-              comparisonStart: null,
-              comparisonEnd: null
-            }
-          ]
-        }
+        // {
+        //   innerConditionValue: null,
+        //   scoreRules: [
+        //     {
+        //       score: null,
+        //       startValue: null,
+        //       select: "",
+        //       endValue: null,
+        //       comparisonStart: null,
+        //       comparisonEnd: null
+        //     }
+        //   ]
+        // }
       ]
     }
   ]
@@ -385,6 +436,22 @@ const addItemDataList = (
     comparisonEnd: null
   });
 };
+// 多条件公式验证
+const manyConditions = () => {
+  // outerConditionValue
+  dialogFormVisibleFormula.value = true;
+  formulaForm.value = [];
+  formulaForm.value.push({
+    name: addmanyChange.outerConditionValue,
+    value: null
+  });
+  addmanyChange.innerConditionExpression.map((item, index) => {
+    formulaForm.value.push({
+      name: item.scoreRuleMoreInnerVO[0].innerConditionValue,
+      value: null
+    });
+  });
+};
 </script>
 
 <template>
@@ -418,7 +485,11 @@ const addItemDataList = (
             </el-form-item>
             <div v-if="params.scoreStandard === 1">
               <el-form-item label="公式类型" label-position="top">
-                <el-select v-model="params.formulaType" placeholder="请选择">
+                <el-select
+                  v-model="params.formulaType"
+                  placeholder="请选择"
+                  @change="watchFormulaType"
+                >
                   <el-option
                     v-for="item in compute"
                     :key="item.value"
@@ -623,7 +694,7 @@ const addItemDataList = (
               <el-form-item v-else label="公式设置">
                 <div class="w-full">
                   <div class="flex items-center">
-                    <el-text>条件 = </el-text>
+                    <el-text>条件 = </el-text>
                     <el-input
                       v-model="addmanyChange.outerConditionValue"
                       class="ml-2"
@@ -808,7 +879,7 @@ const addItemDataList = (
                       </el-text>
                     </div>
                     <div class="float-right mr-8">
-                      <el-button type="primary" @click="conditionVerifyApi"
+                      <el-button type="primary" @click="manyConditions"
                         >公式验证</el-button
                       >
                     </div>

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

@@ -5,6 +5,14 @@ import { Calendar } from "@element-plus/icons-vue";
 import dayjs from "dayjs";
 import { postAddAssessment } from "@/api/assessment";
 import { postListTreeWithUser } from "@/api/department";
+import { encryption } from "@/utils/encrypt";
+// 人员,医疗组,负责人
+import {
+  postUserList,
+  postOrganizationUserPage,
+  getLeaderList
+} from "@/api/userSetting";
+// 医疗组
 import { getTemplateInfoList } from "@/api/templateInfo";
 import ElPicker from "@/components/ELPicker/index.vue";
 const $emit = defineEmits(["addHandClick"]);
@@ -17,17 +25,6 @@ const form = reactive({
   cycle: "月度",
   cycleValue: "",
   assessmentType: null,
-  // params: {
-  //   id: "",
-  //   tpName: "",
-  //   remark: "",
-  //   isDelete: "",
-  //   createUser: "",
-  //   createTime: "",
-  //   updateUser: "",
-  //   updateTime: "",
-  //   flowId: ""
-  // },
   assessmentObjectList: [
     {
       assessmentObjectId: "",
@@ -79,7 +76,21 @@ const saveDepartment = async () => {
   }
 };
 const open = (item: any, index: string) => {
-  postListTreeWithUserApi();
+  // postListTreeWithUserApi();
+  Object.assign(form, {
+    name: "",
+    cycle: "月度",
+    cycleValue: "",
+    assessmentType: null,
+    assessmentObjectList: [
+      {
+        assessmentObjectId: null,
+        assessmentObjectName: null,
+        assessmentModelId: null,
+        assessmentModelName: null
+      }
+    ]
+  });
   if (item) {
     titleHeader.value = index;
   }
@@ -187,8 +198,7 @@ const templateparams = reactive({
 const resTmp = ref([]);
 const postListTreeWithUserApi = async () => {
   const res = await postListTreeWithUser();
-  const { data, code } = await getTemplateInfoList(templateparams);
-  resTmp.value = data.records;
+
   console.log("人员", res.data);
   console.log("人员", transformData(res.data));
   treeDept.value = [];
@@ -237,6 +247,44 @@ const handleSelect = (node, index) => {
 const aaaa = a => {
   console.log(a);
 };
+// 考核类型
+const assessmentTypeApi = async value => {
+  // 人员,医疗组,负责人
+  const { data, code } = await getTemplateInfoList(templateparams);
+  resTmp.value = data.records;
+  console.log(value);
+  // treeDept
+  //   postUserList,
+  // postOrganizationUserPage,
+  // getLeaderList
+  const password = localStorage.getItem("password");
+  const rolesName = localStorage.getItem("rolesName");
+  switch (value) {
+    case 0:
+      const yuangong = await postUserList({
+        username: encryption(rolesName),
+        password: encryption(password)
+      });
+      console.log(yuangong);
+      treeDept.value = yuangong.data;
+      break;
+    case 1:
+      postListTreeWithUserApi();
+      break;
+    case 2:
+      const yiliao = await postOrganizationUserPage({
+        organizationType: "group",
+        pageNumber: 1,
+        pageSize: 1000
+      });
+      treeDept.value = yiliao.data.records;
+      break;
+    case 3:
+      const fuzhere = await getLeaderList();
+      console.log(fuzhere);
+      treeDept.value = fuzhere.data;
+  }
+};
 const monthTime = ref("");
 defineExpose({
   open
@@ -336,6 +384,7 @@ defineExpose({
           <el-select
             v-model="form.assessmentType"
             placeholder="请选择被考核类型"
+            @change="assessmentTypeApi"
           >
             <el-option label="员工" :value="0" />
             <el-option label="部门" :value="1" />
@@ -362,6 +411,7 @@ defineExpose({
                     class="w-full mt-1"
                   >
                     <el-tree-select
+                      v-if="form.assessmentType === 1"
                       v-model="item.assessmentObjectId"
                       :data="treeDept"
                       :render-after-expand="false"
@@ -374,6 +424,17 @@ defineExpose({
                       style="width: 180px"
                       @check-change="handleRreeSelect"
                     />
+                    <el-select
+                      v-if="form.assessmentType != 1"
+                      v-model="item.assessmentObjectId"
+                    >
+                      <el-option
+                        v-for="(it, id) in treeDept"
+                        :key="id"
+                        :label="it.realName"
+                        :value="it.userCode"
+                      />
+                    </el-select>
                   </div>
                 </el-form-item>
               </el-form>
@@ -402,6 +463,7 @@ defineExpose({
                         :key="itemTmp.id"
                         :label="itemTmp.tpName"
                         :value="itemTmp.id"
+                        style="width: 180px"
                       />
                     </el-select>
                     <div

+ 16 - 2
src/views/evaluate/children/change/mould.vue

@@ -53,17 +53,24 @@ const setCopy = (row: any) => {
 const data = reactive({
   params: {
     pageNumber: 1,
-    pageSize: 5
+    pageSize: 5,
+    // records: {
+    tpName: ""
+    // }
   },
   total: 0,
   records: []
 });
 
 // 分页
+const tableLoading = ref(false);
 const getTemplateInfoListApi = async () => {
+  tableLoading.value = true;
+  console.log("打印数据", data.params);
   const res = await getTemplateInfoList(data.params);
   console.log("1111", res);
   if (res.code == 200) {
+    tableLoading.value = false;
     data.records = res.data.records;
     data.total = res.data.totalRow;
   }
@@ -92,9 +99,12 @@ const handleCurrentChange = (val: number) => {
       <div class="flex mt-2">
         <div class="flex mr-2">
           <el-input
+            v-model="data.params.tpName"
             style="width: 500px"
             placeholder="搜索考核模板"
             :prefix-icon="Search"
+            clearable
+            @change="getTemplateInfoListApi()"
           />
         </div>
       </div>
@@ -107,7 +117,11 @@ const handleCurrentChange = (val: number) => {
       </div>
     </div>
     <div class="mt-8">
-      <el-table :data="data.records" style="width: 100%">
+      <el-table
+        v-loading="tableLoading"
+        :data="data.records"
+        style="width: 100%"
+      >
         <el-table-column prop="tpName" label="考核模板" />
         <el-table-column prop="createTime" label="更新时间" width="160">
           <template #default="{ row }">

+ 12 - 4
src/views/evaluate/children/change/mould/manageObject.vue

@@ -79,7 +79,6 @@ onMounted(() => {
 // 指标分页查询
 const getAssessmentQuotaDetailsApi = async () => {
   const res = await getAssessmentQuotaDetails(initParams.indexParams);
-  console.log("getAssessmentQuotaDetailsApi", res);
   if (res.code === 200) {
     initParams.Indexlist = res.data.records;
     initParams.total1 = res.data.totalRow;
@@ -142,11 +141,17 @@ const changeSelection = val => {
     valSelection.value = true;
     delParams.assessmentId = messageData.value.id;
     addPersonParams.assessmentId = messageData.value.id;
+    let assessmentObjectId;
+    let assessmentObjectName;
     val.forEach((item, index) => {
       delParams.objectAddVoList.forEach((item1, index1) => {
         if (index == index1) {
-          item1.assessmentObjectId = item.id;
-          item1.assessmentObjectName = item.name;
+          assessmentObjectId = item.id;
+          assessmentObjectName = item.realName;
+          delParams.objectAddVoList.push({
+            assessmentObjectId,
+            assessmentObjectName
+          });
         }
       });
     });
@@ -202,7 +207,10 @@ const dialogVisibleAddShow = () => {
 };
 // 跳转对应科室
 const GoView = row => {
-  router.push("/evaluate/children/change/mould/view");
+  router.push({
+    name: "departmentDrank",
+    query: { ...messageData.value, deptId: row.deptId }
+  });
 };
 // 考核对象
 const objList = ref([]);