ystl_myq 1 týždeň pred
rodič
commit
7de17eb1ff

+ 11 - 3
src/components/import/index.vue

@@ -1,13 +1,19 @@
 <script setup lang="ts">
-import { ref } from "vue";
-import { useRouter } from "vue-router";
+import { ref, onMounted } from "vue";
+import { useRoute, useRouter } from "vue-router";
 import { assessmentDownloadDataRosterTemplateApi } from "@/api/download";
 defineOptions({
   name: "IndexDefineImport"
 });
+const route = useRoute();
 const router = useRouter();
 const emit = defineEmits(["handleImport"]);
 const uploadShow = ref(true);
+const query = ref({});
+onMounted(() => {
+  console.log("111", route.query);
+  Object.assign(query.value, route.query);
+});
 const uploadFile = () => {
   uploadShow.value = !uploadShow.value;
 };
@@ -44,7 +50,9 @@ const backDefine = () => {
       <div class="w-full bg p-3">
         <h5>1.下载导入模板</h5>
         <p class="text-xs mt-2 text">根据提升信息完善表格内容</p>
-        <el-button class="mt-2" @click="assessmentDownloadDataRosterTemplateApi"
+        <el-button
+          class="mt-2"
+          @click="assessmentDownloadDataRosterTemplateApi()"
           ><el-icon><Download /></el-icon>下载空的模板表格</el-button
         >
       </div>

+ 19 - 9
src/router/modules/import.ts

@@ -1,20 +1,30 @@
 // 最简代码,也就是这些字段必须有
 export default {
-  path: "/import",
+  path: "/evaluate/children/change",
+  name: "evaluateChange",
   meta: {
-    title: ""
+    title: "考核管理"
+    // filterMenu: true
   },
   children: [
     {
-      path: "/import/index",
-      name: "importIndex",
+      path: "/evaluate/children/change/index",
       meta: {
-        title: "批量导入",
-        // title: "",
-        icon: "ep:home-filled",
-        showLink: false
+        title: "考核指标"
+        // icon: "ri:checkbox-circle-line",
       },
-      component: () => import("@/components/import/index.vue")
+      children: [
+        {
+          path: "/import/index",
+          name: "importIndex",
+          meta: {
+            title: "批量导入",
+            icon: "ep:home-filled",
+            showLink: false
+          },
+          component: () => import("@/components/import/index.vue")
+        }
+      ]
     }
   ]
 } satisfies RouteConfigsTable;

+ 8 - 8
src/routerList/draw.ts

@@ -27,7 +27,7 @@ export default {
           meta: {
             title: "员工画像",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -38,7 +38,7 @@ export default {
           meta: {
             title: "员工排行榜",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -49,7 +49,7 @@ export default {
           meta: {
             title: "科室画像",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -60,7 +60,7 @@ export default {
           meta: {
             title: "科室排行榜",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -70,7 +70,7 @@ export default {
           meta: {
             title: "科室主任画像",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -80,7 +80,7 @@ export default {
           meta: {
             title: "科室主任排行榜",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -91,7 +91,7 @@ export default {
           meta: {
             title: "医疗组画像",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         },
         {
@@ -102,7 +102,7 @@ export default {
           meta: {
             title: "医疗组排行榜",
             showParent: true,
-            keepAlive: true
+            keepAlive: false
           }
         }
       ]

+ 3 - 3
src/routerList/index.ts

@@ -2,7 +2,7 @@
 import server from "@/assets/icon-png/menuList/server (1).svg";
 import menuIndex from "@/assets/svg/layers.svg?component";
 export default {
-  path: "/IndexDefine",
+  path: "/indexDefine",
   meta: {
     title: "指标库",
     icon: menuIndex,
@@ -11,7 +11,7 @@ export default {
   },
   children: [
     {
-      path: "/IndexDefine/index",
+      path: "/indexDefine/index",
       name: "indexIndex",
       meta: {
         title: "指标管理",
@@ -19,7 +19,7 @@ export default {
       },
       children: [
         {
-          path: "/IndexDefine/children/define",
+          path: "/indexDefine/children/define",
           name: "IndexChildrenDefine",
           component: () => import("@/views/indexDefine/children/define.vue"),
           meta: {

+ 15 - 15
src/views/background/framework/roles/rolePower.vue

@@ -205,21 +205,21 @@ const handleClick = (tab, event) => {
   console.log(tab, event);
 };
 
-const postAddMenuListApi = async () => {
-  const { code } = await updateMenu({
-    menuName: "指标库",
-    menuType: "menu",
-    parentCode: "",
-    orderNum: 1,
-    url: "",
-    moduleUrl: "/indexDefine",
-    icon: "",
-    // remark: "",
-    remark: "系统管理",
-    menuCode: "menu340900015906103296"
-  });
-};
-postAddMenuListApi();
+// const postAddMenuListApi = async () => {
+//   const { code } = await updateMenu({
+//     menuName: "指标库",
+//     menuType: "menu",
+//     parentCode: "",
+//     orderNum: 1,
+//     url: "",
+//     moduleUrl: "/indexDefine",
+//     icon: "",
+//     // remark: "",
+//     remark: "系统管理",
+//     menuCode: "menu340900015906103296"
+//   });
+// };
+// postAddMenuListApi();
 // {
 //     menuName: "新建模板",
 //     menuType: "menu",

+ 313 - 190
src/views/evaluate/children/change/components/settingIndexDrawer.vue

@@ -51,12 +51,77 @@ const getIndexInfoApi = async id => {
     ElMessage.error(msg);
   }
 };
+// 公式验证
+const dialogFormVisibleFormula = ref(false);
+const formulaForm = ref([]);
+const grade = ref();
 const conditionVerifyApi = async () => {
-  let formula = JSON.stringify(params.formula);
+  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);
+
+  // 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 result = str.replace(regex, match => {
+      // 在 formulaForm.value 中查找匹配的项
+      let matchedItem = formulaForm.value.find(item => item.name === match);
+
+      // 如果找到匹配项,返回其 value,否则返回原始匹配值
+      if (matchedItem) {
+        return matchedItem.value; // 替换为对应的值
+      }
+      return match; // 如果没有匹配项,返回原始匹配值
+    });
+    calculator.calculate(result);
+    grade.value = calculator.get();
+  } else {
+    ElMessageBox.confirm("配置项未保存,确认关闭", {
+      type: "warning"
+    }).then(() => {
+      dialogFormVisibleFormula.value = false;
+    });
+  }
+  // ElMessageBox.confirm("配置项未保存,确认关闭", {
+  //   type: "warning"
+  // }).then(() => {
+
+  // })
+  // console.log();
 };
 // 判断是否为json
 function isValidJSON(str) {
@@ -68,13 +133,14 @@ function isValidJSON(str) {
   }
 }
 const handleClose = (done: () => void) => {
-  ElMessageBox.confirm("配置项未保存,确认关闭", {
-    type: "warning"
-  }).then(() => {
-    drawer.value = false;
-    disabledValue.value = true;
-    editShow.value = true;
-  });
+  drawer.value = false;
+  disabledValue.value = true;
+  editShow.value = true;
+  // ElMessageBox.confirm("配置项未保存,确认关闭", {
+  //   type: "warning"
+  // }).then(() => {
+
+  // });
 };
 function cancelClick() {
   disabledValue.value = true;
@@ -222,110 +288,101 @@ const manyChange = reactive({
     }
   ]
 });
+const addmanyChange = reactive({
+  outerConditionValue: "",
+  innerConditionExpression: [
+    {
+      startValue: null,
+      endValue: null,
+      select: null,
+      comparisonStart: null,
+      comparisonEnd: null,
+      scoreRuleMoreInnerVO: [
+        {
+          innerConditionValue: null,
+          scoreRules: [
+            {
+              score: null,
+              startValue: null,
+              select: "",
+              endValue: null,
+              comparisonStart: null,
+              comparisonEnd: null
+            }
+          ]
+        }
+      ]
+    }
+  ]
+});
+// 添加子条件
+const addItemFormulaList = (item, index) => {
+  addmanyChange.innerConditionExpression[index].scoreRuleMoreInnerVO = [
+    {
+      innerConditionValue: null,
+      scoreRules: [
+        {
+          score: null,
+          startValue: null,
+          endValue: null,
+          select: null,
+          comparisonStart: null,
+          comparisonEnd: null
+        }
+      ]
+    }
+  ];
+};
+
 const deleteItem = index => {
-  if (manyChange.dataList.length > 1) {
-    manyChange.dataList.splice(index, 1);
-  } else {
-    ElMessage({
-      message: "必须保留一条计算规则",
-      type: "warning"
-    });
-  }
+  addmanyChange.innerConditionExpression.splice(index, 1);
 };
 const dataleListItem = (index, indexList) => {
-  if (manyChange.dataList[index].dataList.length > 1) {
-    manyChange.dataList[index].dataList.splice(indexList, 1);
-  } else {
-    ElMessage({
-      message: "必须保留一条计算规则",
-      type: "warning"
-    });
-  }
+  addmanyChange.innerConditionExpression[
+    index
+  ].scoreRuleMoreInnerVO[0].scoreRules.splice(indexList, 1);
+};
+// 条件变量
+const dataleListItemAll = (item, index) => {
+  item.scoreRuleMoreInnerVO = [];
 };
 const addNewItem = () => {
-  manyChange.dataList.push({
-    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: ""
-      }
-    ]
+  addmanyChange.innerConditionExpression.push({
+    startValue: null,
+    endValue: null,
+    select: null,
+    comparisonStart: null,
+    comparisonEnd: null,
+    scoreRuleMoreInnerVO: []
   });
 };
-const addItemDataList = (index: number, itemListValue: string) => {
-  console.log(index, itemListValue);
-  manyChange.dataList[index].dataList.push({
-    title: itemListValue,
-    compare: "0", // 比较符号
-    compareList: [
-      {
-        value: "0",
-        label: ">"
-      },
-      {
-        value: "1",
-        label: "≥"
-      }
-    ],
-    formula: "0",
-    formulaList: [
-      {
-        value: "0",
-        label: "数值"
-      },
-      {
-        value: "1",
-        label: "公式"
-      }
-    ],
-    value: "",
-    grade: ""
+const addNewItemOldValue = item => {
+  addmanyChange.innerConditionExpression.push({
+    startValue: item.endValue,
+    select: null,
+    endValue: null,
+    comparisonStart: item.comparisonEnd,
+    comparisonEnd: null,
+    scoreRuleMoreInnerVO: []
+  });
+};
+const addItemDataList = (
+  index: number,
+  itemList: any,
+  indexList: number,
+  item
+) => {
+  console.log(index, itemList);
+  console.log(item);
+  addmanyChange.innerConditionExpression[
+    index
+  ].scoreRuleMoreInnerVO[0].scoreRules.push({
+    select: null,
+    score: null,
+    startValue: itemList.endValue,
+    endValue: null,
+    comparisonStart: itemList.comparisonEnd,
+    comparisonEnd: null
   });
 };
 </script>
@@ -568,50 +625,49 @@ const addItemDataList = (index: number, itemListValue: string) => {
                   <div class="flex items-center">
                     <el-text>条件填 = </el-text>
                     <el-input
-                      v-model="manyChange.newData"
+                      v-model="addmanyChange.outerConditionValue"
                       class="ml-2"
                       style="width: 240px"
                     />
                   </div>
                   <div class="w-full mt-2">
                     <div
-                      v-for="(item, index) in manyChange.dataList"
+                      v-for="(
+                        item, index
+                      ) in addmanyChange.innerConditionExpression"
                       :key="index"
-                      class="flex items-center mb-4"
                     >
-                      <div>
+                      <div class="mt-3">
                         <div class="flex">
                           <el-text class="w-[30px]" type="primary">
                             {{ index + 1 }}
                           </el-text>
+                          <div class="w-[40px] ml-2">
+                            {{ item.startValue }}
+                          </div>
+                          <div class="mr-2">
+                            {{ item.comparisonStart }}
+                          </div>
                           <div class="mr-2">条件值</div>
                           <el-select
-                            v-model="item.compare"
+                            v-model="item.comparisonEnd"
                             style="width: 60px"
                             placeholder=""
                           >
-                            <el-option
-                              v-for="compareItem in item.compareList"
-                              :key="compareItem.value"
-                              :label="compareItem.label"
-                              :value="compareItem.value"
-                            />
+                            <el-option label=">" value=">" />
+                            <el-option label="≥" value="≥" />
                           </el-select>
                           <el-select
-                            v-model="item.formula"
+                            v-model="item.select"
                             class="ml-2"
                             style="width: 80px"
                             placeholder=""
                           >
-                            <el-option
-                              v-for="formulaItem in item.formulaList"
-                              :key="formulaItem.value"
-                              :label="formulaItem.label"
-                              :value="formulaItem.value"
-                            />
+                            <el-option label="数值" value="数值" />
+                            <el-option label="公式" value="公式" />
                           </el-select>
                           <el-input
-                            v-model="item.value"
+                            v-model="item.endValue"
                             class="ml-2 mr-5"
                             style="width: 80px"
                           />
@@ -619,95 +675,143 @@ const addItemDataList = (index: number, itemListValue: string) => {
                             <el-icon><Delete /></el-icon>
                           </el-text>
                         </div>
-                        <div class="flex mt-2 ml-7">
-                          <div class="mr-2">条件值{{ index + 1 }} =</div>
-                          <el-input
-                            v-model="item.value"
-                            class="ml-2"
-                            style="width: 240px"
-                          />
-                        </div>
                         <div
-                          v-for="(itemList, indexList) in item.dataList"
-                          :key="indexList"
+                          v-for="(itemVO, indexOV) in item.scoreRuleMoreInnerVO"
+                          :key="indexOV"
                         >
-                          <div class="flex mt-2 ml-7 items-center">
-                            <div class="text_border">{{ indexList + 1 }}</div>
-                            <!-- manyChange.dataList[index].dataList -->
-                            <div class="w-[40px] ml-2">
-                              {{ itemList?.title }}
-                            </div>
-                            <div class="mr-2">></div>
-                            <div class="mr-2">条件值{{ indexList + 1 }}</div>
-                            <el-select
-                              v-model="itemList.compare"
-                              style="width: 60px"
-                              placeholder=""
-                            >
-                              <el-option
-                                v-for="compareItem in itemList.compareList"
-                                :key="compareItem.value"
-                                :label="compareItem.label"
-                                :value="compareItem.value"
-                              />
-                            </el-select>
-                            <el-select
-                              v-model="itemList.formula"
-                              class="ml-2"
-                              style="width: 80px"
-                              placeholder=""
-                            >
-                              <el-option
-                                v-for="formulaItem in itemList.formulaList"
-                                :key="formulaItem.value"
-                                :label="formulaItem.label"
-                                :value="formulaItem.value"
-                              />
-                            </el-select>
+                          <div class="flex mt-2 ml-7">
+                            <div class="mr-2">条件值{{ index + 1 }} =</div>
                             <el-input
-                              v-model="itemList.value"
+                              v-model="itemVO.innerConditionValue"
                               class="ml-2"
-                              style="width: 80px"
+                              style="width: 240px"
                             />
-                            <div
-                              class="w-[100px] ml-2 mr-2 flex justify-between items-center"
-                            >
-                              <div>得分</div>
-                              <div>=</div>
-                              <el-input
-                                v-model="itemList.grade"
-                                class="ml-2"
-                                style="width: 50px"
-                              />
-                            </div>
                             <el-text
                               type="danger"
-                              @click="dataleListItem(index, indexList)"
+                              @click="dataleListItemAll(item, index)"
                             >
                               <el-icon><Delete /></el-icon>
                             </el-text>
                           </div>
                           <div
-                            v-if="indexList + 1 == item.dataList.length"
-                            class="ml-7 mt-1 text-xs cursor-pointer"
+                            v-for="(itemList, indexList) in itemVO.scoreRules"
+                            :key="indexList"
                           >
-                            <el-text
-                              type="primary"
-                              @click="addItemDataList(index, itemList.value)"
+                            <div class="flex mt-2 ml-7 items-center">
+                              <div class="text_border">{{ indexList + 1 }}</div>
+                              <!-- manyChange.dataList[index].dataList -->
+                              <div class="w-[40px] ml-2">
+                                {{ itemList.startValue }}
+                              </div>
+                              <div class="mr-2">
+                                {{ itemList.comparisonStart }}
+                              </div>
+                              <div class="mr-2">条件值{{ index + 1 }}</div>
+                              <el-select
+                                v-model="itemList.comparisonEnd"
+                                style="width: 60px"
+                                placeholder=""
+                              >
+                                <el-option label=">" value=">" />
+                                <el-option label="≥" value="≥" />
+                              </el-select>
+                              <el-select
+                                v-model="itemList.select"
+                                class="ml-2"
+                                style="width: 80px"
+                                placeholder=""
+                              >
+                                <el-option label="数值" value="数值" />
+                                <el-option label="公式" value="公式" />
+                              </el-select>
+                              <el-input
+                                v-model="itemList.endValue"
+                                class="ml-2"
+                                style="width: 80px"
+                              />
+                              <div
+                                class="w-[100px] ml-2 mr-2 flex justify-between items-center"
+                              >
+                                <div>得分</div>
+                                <div>=</div>
+                                <el-input
+                                  v-model="itemList.score"
+                                  class="ml-2"
+                                  style="width: 50px"
+                                />
+                              </div>
+                              <el-text
+                                type="danger"
+                                @click="dataleListItem(index, indexList)"
+                              >
+                                <el-icon><Delete /></el-icon>
+                              </el-text>
+                            </div>
+                            <div
+                              v-if="indexList + 1 == itemVO.scoreRules.length"
+                              class="ml-7 mt-1 text-xs cursor-pointer"
                             >
-                              <el-icon><Plus /></el-icon>
-                              添加子条件
-                            </el-text>
+                              <el-text
+                                type="primary"
+                                @click="
+                                  addItemDataList(
+                                    index,
+                                    itemList,
+                                    indexList,
+                                    item
+                                  )
+                                "
+                              >
+                                <el-icon><Plus /></el-icon>
+                                添加子条件
+                              </el-text>
+                            </div>
                           </div>
                         </div>
                       </div>
+                      <div
+                        v-if="item?.scoreRuleMoreInnerVO?.length == 0"
+                        class="ml-7 mt-1 text-xs cursor-pointer"
+                      >
+                        <el-text
+                          type="primary"
+                          @click="addItemFormulaList(item, index)"
+                        >
+                          <el-icon><Plus /></el-icon>
+                          添加子条件
+                        </el-text>
+                      </div>
+                      <div
+                        v-if="
+                          addmanyChange.innerConditionExpression.length >= 1 &&
+                          index + 1 ==
+                            addmanyChange.innerConditionExpression.length
+                        "
+                        class="mt-5 text-xs cursor-pointer"
+                      >
+                        <el-text
+                          type="primary"
+                          @click="addNewItemOldValue(item)"
+                        >
+                          <el-icon><Plus /></el-icon>
+                          添加条件
+                        </el-text>
+                      </div>
                     </div>
-                    <div class="mt-5 text-xs cursor-pointer">
+                    <div
+                      v-if="addmanyChange.innerConditionExpression.length < 1"
+                      class="mt-5 text-xs cursor-pointer"
+                    >
                       <el-text type="primary" @click="addNewItem">
                         <el-icon><Plus /></el-icon>
                         添加条件
                       </el-text>
                     </div>
+                    <div class="float-right mr-8">
+                      <el-button type="primary" @click="conditionVerifyApi"
+                        >公式验证</el-button
+                      >
+                    </div>
                   </div>
                 </div>
               </el-form-item>
@@ -722,6 +826,25 @@ const addItemDataList = (index: number, itemListValue: string) => {
         </div>
       </template>
     </el-drawer>
+    <!-- 公式验证 -->
+    <el-dialog v-model="dialogFormVisibleFormula" title="完成值" width="500">
+      <el-form :model="formulaForm">
+        <div v-for="(itemF, indexF) in formulaForm" :key="indexF">
+          <el-form-item :label="itemF.name">
+            <el-input v-model="itemF.value" autocomplete="off" />
+          </el-form-item>
+        </div>
+        <el-form-item label="得分">
+          <el-input v-model="grade" class="ml-3" autocomplete="off" disabled />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="dialogFormVisibleFormula = false">取消</el-button>
+          <el-button type="primary" @click="countComputed"> 计算 </el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 <style lang="scss" scoped>

+ 92 - 26
src/views/evaluate/children/change/mould/manageObject.vue

@@ -65,6 +65,7 @@ const initParams = reactive({
   tmpList: []
 });
 onMounted(() => {
+  console.log("dsafa", messageData.value);
   Object.assign(messageData.value, $props.message);
   initParams.params.assessmentId = $props.message.id;
   initParams.objParams.assessmentId = $props.message.id;
@@ -81,6 +82,7 @@ const getAssessmentQuotaDetailsApi = async () => {
   console.log("getAssessmentQuotaDetailsApi", res);
   if (res.code === 200) {
     initParams.Indexlist = res.data.records;
+    initParams.total1 = res.data.totalRow;
   }
 };
 // 考核模板
@@ -180,7 +182,7 @@ const tableData = [
 ];
 // 批量导入
 const addsImport = () => {
-  router.push("/import/index");
+  router.push({ name: "importIndex", query: { ...messageData.value } });
 };
 const publishShow = ref(true);
 const publish = () => {
@@ -214,8 +216,23 @@ const getAssessmentObjectDetailsApi = async () => {
   }
   console.log("考核对象", data);
 };
-const handleSizeChange = val => {};
-const handleCurrentChange = val => {};
+const handleSizeChange = (val: number) => {
+  initParams.objParams.pageSize = val;
+  getAssessmentObjectDetailsApi();
+};
+const handleCurrentChange = (val: number) => {
+  initParams.objParams.pageNumber = val;
+  getAssessmentObjectDetailsApi();
+};
+// 指标
+const handleSizeIndexChange = (val: number) => {
+  initParams.indexParams.pageSize = val;
+  getAssessmentQuotaDetailsApi();
+};
+const handleCurrentIndexChange = (val: number) => {
+  initParams.indexParams.pageNumber = val;
+  getAssessmentQuotaDetailsApi();
+};
 </script>
 
 <template>
@@ -253,12 +270,12 @@ const handleCurrentChange = val => {};
           <div class="w-1/2 flex items-center justify-between">
             <el-text class="w-1/5">考核模板</el-text>
             <el-select
-              v-model="initParams.params.modelName"
+              v-model="initParams.objParams.modelName"
               placeholder="请选择"
               filterable
               clearable
               style="width: 250px"
-              @change="getAssessmentQuotaDetailsApi"
+              @change="getAssessmentObjectDetailsApi"
             >
               <el-option
                 v-for="itemTmp in initParams.tmpList"
@@ -268,12 +285,12 @@ const handleCurrentChange = val => {};
               />
             </el-select>
             <el-input
-              v-model="initParams.params.userName"
+              v-model="initParams.objParams.userName"
               class="ml-2"
               clearable
               placeholder="搜索人员"
               :prefix-icon="Search"
-              @change="getAssessmentQuotaDetailsApi"
+              @change="getAssessmentObjectDetailsApi"
             />
           </div>
           <div class="mr-10">
@@ -292,20 +309,15 @@ const handleCurrentChange = val => {};
           </div>
         </div>
         <el-table
-          :data="initParams.list"
+          :data="objList"
           style="width: 100%"
           max-height="250"
           @selection-change="changeSelection"
         >
           <el-table-column type="selection" width="55" />
-          <el-table-column
-            prop="assessmentModelName"
-            label="考核名称"
-            width="300"
-            fixed
-          />
-          <el-table-column prop="date" label="人员" width="250" />
-          <el-table-column prop="name" label="工号" width="250" />
+          <el-table-column prop="realName" label="人员" width="100" />
+          <el-table-column prop="userName" label="工号" width="180" />
+          <el-table-column prop="deptName" label="科室" width="180" />
           <el-table-column
             prop="assessmentModelName"
             label="考核模板"
@@ -325,14 +337,14 @@ const handleCurrentChange = val => {};
         </el-table>
         <div class="flex justify-between item-center">
           <div class="float-left mt-5 ml-2 total">
-            共{{ initParams.total }}条数据
+            <!-- 共{{ initParams.total }}条数据 -->
           </div>
           <div class="float-right mt-5 mr-8">
             <el-pagination
               v-model:current-page="initParams.objParams.pageNumber"
               v-model:page-size="initParams.objParams.pageSize"
               background
-              layout="prev, pager, next"
+              layout="total, sizes, prev, pager, next, jumper"
               :total="initParams.total"
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
@@ -340,12 +352,23 @@ const handleCurrentChange = val => {};
           </div>
         </div>
       </el-tab-pane>
-      <el-tab-pane label="考核指标" name="second"
-        ><div class="w-full flex items-center justify-between">
+      <el-tab-pane label="考核指标" name="second">
+        <div class="w-full flex items-center justify-between">
           <div class="w-1/2 flex items-center justify-between">
             <el-text class="w-1/5">考核模板</el-text>
-            <el-input class="ml-1" />
-            <el-input class="ml-2" :prefix-icon="Search" />
+            <el-input
+              v-model="initParams.indexParams.userName"
+              class="ml-1"
+              placeholder="搜索人员"
+              @change="getAssessmentQuotaDetailsApi"
+            />
+            <el-input
+              v-model="initParams.indexParams.quotaName"
+              class="ml-2"
+              placeholder="搜索指标名称"
+              :prefix-icon="Search"
+              @change="getAssessmentQuotaDetailsApi"
+            />
           </div>
           <div class="mr-10">
             <Auth :value="['批量导入指标']">
@@ -355,12 +378,55 @@ const handleCurrentChange = val => {};
             </Auth>
           </div>
         </div>
+        <el-table
+          :data="initParams.Indexlist"
+          style="width: 100%"
+          max-height="250"
+          @selection-change="changeSelection"
+        >
+          <el-table-column type="selection" width="55" />
+          <el-table-column prop="realName" label="人员" width="100" />
+          <el-table-column prop="userName" label="工号" width="180" />
+          <el-table-column prop="deptName" label="部门" width="180" />
+          <el-table-column prop="name" label="指标名称" width="180" />
+          <el-table-column prop="scoreRule" label="评价标准" width="180" />
+          <el-table-column prop="source" label="数据来源" width="180" />
+          <el-table-column prop="targetValue" label="目标值" width="180" />
+          <el-table-column prop="finalValue" label="完成值" width="180" />
+          <el-table-column prop="score" label="得分" width="180" />
+          <el-table-column prop="updateTime" label="更新时间" width="150">
+            <template #default="{ row }">
+              {{ dayjs(row.updateTime).format("YYYY-MM-DD HH:mm:ss") }}
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" width="200" fixed="right">
+            <template #default>
+              <!-- <el-icon @click="GoView(row)"><View /></el-icon> -->-
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="flex justify-between item-center">
+          <div class="float-left mt-5 ml-2 total">
+            <!-- 共{{ initParams.total1 }}条数据 -->
+          </div>
+          <div class="float-right mt-5 mr-8">
+            <el-pagination
+              v-model:current-page="initParams.indexParams.pageNumber"
+              v-model:page-size="initParams.indexParams.pageSize"
+              background
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="initParams.total1"
+              @size-change="handleSizeIndexChange"
+              @current-change="handleCurrentIndexChange"
+            />
+          </div>
+        </div>
       </el-tab-pane>
-      <el-tab-pane label="统计分析" name="third">
-        <!--  -->
-      </el-tab-pane>
+      <!-- <el-tab-pane label="统计分析" name="third">
+      </el-tab-pane> -->
       <el-tab-pane label="基础信息" name="fourth">
-        <messagePerson :id="messageData.id" />
+        <!-- 延迟加载获取id -->
+        <messagePerson v-if="messageData.id" :id="messageData.id" />
       </el-tab-pane>
     </el-tabs>
     <!-- 添加被考核人 -->

+ 9 - 3
src/views/evaluate/children/change/mould/message.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, reactive, nextTick } from "vue";
+import { ref, reactive, nextTick, onMounted } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { Calendar } from "@element-plus/icons-vue";
 import { getAssessmentDetails } from "@/api/assessment";
@@ -14,6 +14,12 @@ const $props = defineProps({
     type: String
   }
 });
+const params = reactive({
+  id: $props.id
+});
+onMounted(() => {
+  console.log("onMountedsdada", $props.id);
+});
 const dialogVisibleAdd = ref(false);
 const btn = ref(true);
 const btnShow = () => {
@@ -176,7 +182,7 @@ function transformData(arr) {
 }
 // 详情
 const getAssessmentDetailsApi = async () => {
-  const { data, code, msg } = await getAssessmentDetails($props.id);
+  const { data, code, msg } = await getAssessmentDetails({ id: params.id });
   if (code === 200) {
     Object.assign(form, data);
   } else {
@@ -186,7 +192,7 @@ const getAssessmentDetailsApi = async () => {
 getAssessmentDetailsApi();
 // 修改
 const updateAssessmentApi = async () => {
-  const { code, msg } = await updateAssessment({ id: $props.id, ...form });
+  const { code, msg } = await updateAssessment({ id: params.id, ...form });
   if (code === 200) {
     btn.value = true;
     ElMessage.success("修改成功");

+ 4 - 4
src/views/indexDefine/children/import/index.vue

@@ -28,9 +28,9 @@ const uploadFile = async () => {
     formData.append("file", fileDocument.value); // 将文件添加到表单数据
 
     // 调用 API 上传文件
-    const { code, msg } = await postUpdateDeptApi(formData);
-
-    if (code === 200) {
+    const { data } = await postUpdateDeptApi(formData);
+    console.log("dsada", data);
+    if (data.code === 200) {
       // 根据后端返回的 code 判断是否成功
       ElMessage.success("文件上传并导入成功");
       // 重置上传状态
@@ -45,7 +45,7 @@ const uploadFile = async () => {
         { from: "" }
       ]; // 清空表格数据
     } else {
-      ElMessage.error(msg);
+      ElMessage.error(data.msg);
     }
   } catch (error) {
     ElMessage.error("上传失败,请重试");