Kaynağa Gözat

fix: 修改页面跳转

username 1 hafta önce
ebeveyn
işleme
1405dd3e8d

+ 1 - 1
src/components/UserPageTable/index.vue

@@ -86,7 +86,7 @@ const getTime = day => {
         @keyup.enter="postOrganizationUserPageApi"
       />
       <slot name="add-button" />
-      <!-- <el-button type="primary" @click="AddPerson">添加员</el-button> -->
+      <!-- <el-button type="primary" @click="AddPerson">添加员</el-button> -->
     </div>
     <el-table
       v-if="(tableData.params.organizationType = 'dept')"

+ 8 - 8
src/views/background/framework/proson/prosonDepartment.vue

@@ -22,10 +22,10 @@ const newDepartmentShow = ref(false);
 // 编辑部门
 const prosonEditDrawerRef = ref(null);
 const prosonEditDrawerShow = ref(false);
-// 添加
+// 添加
 const addPersonDrawerRef = ref(null);
 const addPersonDrawerShow = ref(false);
-// 员详情
+// 员详情
 const personDetailsDrawerRef = ref(null);
 const personDetailsDrawerShow = ref(false);
 // 配置角色
@@ -113,7 +113,7 @@ const deleteDepartment = node => {
       // catch error
     });
 };
-// 添加员弹窗
+// 添加员弹窗
 const AddPerson = () => {
   // postOrganizationUserPageApi
 
@@ -203,9 +203,9 @@ watch(realName, val => {
       v-model="newDepartmentShow"
       @handleClick="postListTreeApi"
     />
-    <!-- 添加员 -->
+    <!-- 添加员 -->
     <addPerson ref="addPersonDrawerRef" v-model="addPersonDrawerShow" />
-    <!-- 员详情 -->
+    <!-- 员详情 -->
     <personDetailsDrawer
       ref="personDetailsDrawerRef"
       v-model="personDetailsDrawerShow"
@@ -291,12 +291,12 @@ watch(realName, val => {
     <div class="box-right">
       <UserPageTable ref="UserTable">
         <template #add-button>
-          <Auth :value="['添加员']">
+          <Auth :value="['添加员']">
             <el-button type="primary" @click="AddPerson">新建人员</el-button>
           </Auth>
         </template>
         <template #actions="{ row }">
-          <Auth :value="['编辑员']">
+          <Auth :value="['编辑员']">
             <el-dropdown trigger="click" class="mr-2">
               <el-icon @click="personDetails(row)">
                 <View />
@@ -309,7 +309,7 @@ watch(realName, val => {
             </el-icon>
             <template #dropdown>
               <el-dropdown-menu class="setting">
-                <Auth :value="['删除员']">
+                <Auth :value="['删除员']">
                   <el-dropdown-item>
                     <el-link type="danger" @click="deletePerson(row)"
                       >删除</el-link

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

@@ -155,7 +155,7 @@ const deleteRole = item => {
 // 标签选择
 const activeName = ref("first");
 
-// 添加角色组
+// 添加角色组
 const AddRolesPerson = () => {
   if (rolesList.rolesName) {
     addPersonRef.value.open(rolesList.addPerson);
@@ -164,7 +164,7 @@ const AddRolesPerson = () => {
     ElMessage.warning("请先选择角色");
   }
 };
-// 删除角色组
+// 删除角色组
 const deltetePerson = item => {
   ElMessageBox.confirm(
     `人员删除后不能恢复,是否确认删除【${item.realName}】吗?`,
@@ -183,7 +183,7 @@ const deltetePerson = item => {
       });
     });
 };
-// 员管理
+// 员管理
 const paramsPageUser = reactive({
   pageNumber: 1,
   pageSize: 10,
@@ -419,7 +419,7 @@ const roleShowClick = (item, type: any) => {
       v-model="addRoleShow"
       @handleClick="postPageRoleApi"
     />
-    <!-- 新增角色组员 -->
+    <!-- 新增角色组员 -->
     <addPerson
       ref="addPersonRef"
       v-model="addPersonShow"
@@ -539,7 +539,7 @@ const roleShowClick = (item, type: any) => {
     <div class="box-right">
       <h3>{{ rolesList.rolesName }}</h3>
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
-        <el-tab-pane label="员管理" name="first">
+        <el-tab-pane label="员管理" name="first">
           <div class="flex justify-between mb-3">
             <el-input
               v-model="paramsPageUser.realName"
@@ -549,9 +549,9 @@ const roleShowClick = (item, type: any) => {
               :prefix-icon="Search"
               @change="postPageUserByRoleApi"
             />
-            <Auth :value="['添加员']">
+            <Auth :value="['添加员']">
               <el-button type="primary" @click="AddRolesPerson"
-                >添加员</el-button
+                >添加员</el-button
               >
             </Auth>
           </div>
@@ -564,7 +564,7 @@ const roleShowClick = (item, type: any) => {
             <el-table-column label="操作">
               <template #default="{ row }">
                 <el-dropdown trigger="click" class="mr-2">
-                  <Auth :value="['移除员']">
+                  <Auth :value="['移除员']">
                     <el-text type="danger" @click="deltetePerson(row)">
                       移除
                     </el-text>

+ 4 - 4
src/views/background/framework/users/index.vue

@@ -147,7 +147,7 @@ const addPersonClickList = () => {
 
 <template>
   <div class="flex w-full h-full">
-    <!-- 添加员 -->
+    <!-- 添加员 -->
     <addPerson
       ref="addPersonRef"
       v-model="addPersonShow"
@@ -246,15 +246,15 @@ const addPersonClickList = () => {
       <h3>{{ rolesList.rolesName }}</h3>
       <UserPageTable ref="UserTable">
         <template #add-button>
-          <Auth :value="['添加员']">
+          <Auth :value="['添加员']">
             <el-button type="primary" @click="AddUsersPerson"
-              >添加员</el-button
+              >添加员</el-button
             >
           </Auth>
         </template>
         <template #actions="{ row }">
           <el-dropdown trigger="click" class="mr-2">
-            <Auth :value="['移出员']">
+            <Auth :value="['移出员']">
               <el-text type="danger" @click="deltetePerson(row)">
                 移除
               </el-text>

+ 65 - 12
src/views/draw/children/department/componements/seach.vue

@@ -9,6 +9,7 @@ import {
   getModelListByAssessmentId,
   getUserListObjectByModelId
 } from "@/api/draw";
+import { useRouter, useRoute } from "vue-router";
 
 const $emit = defineEmits(["handClick"]);
 
@@ -24,6 +25,7 @@ const dataList = reactive({
     assessmentObjectId: ""
   }
 });
+
 // 考核模板
 const getTemplateInfoListApi = async selectedItem => {
   const { data, code } = await getModelListByAssessmentId(selectedItem);
@@ -39,23 +41,12 @@ const userPageWhitOrganizationApi = async selectedItem => {
     assessmentId: selectedItem.assessmentId,
     modelId: selectedItem.assessmentModelId
   });
-  console.log("1111", data);
   if (code === 200) {
     dataList.personList = data;
   }
 };
 // userPageWhitOrganizationApi();
-// 考核活动
-const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentList({
-    type: 1
-  });
-  if (code === 200) {
-    dataList.magList = data;
-  }
-  console.log("await", data);
-};
-getAssessmentPageListApi();
+
 // 部门
 const postListTreeApi = async () => {
   const { data, code } = await postListTree();
@@ -97,6 +88,7 @@ const handClickInit2 = value => {
     ...init
   });
 };
+
 const handClickInit3 = value => {
   if (value) {
     const selectedItem = dataList.teplist.find(
@@ -111,6 +103,67 @@ const handClickInit3 = value => {
     ...init
   });
 };
+
+const route = useRoute();
+const getSearchFrom = () => {
+  route
+    ? console.log(route.query, "获取的路由信息")
+    : console.log("获得的路由信息为空", route);
+  if (Object.keys(route.query).length > 0) {
+    const {
+      assessmentId,
+      assessmentModelId,
+      assessmentObjectId,
+      assessmentName,
+      assessmentModelName,
+      assessmentObjectName
+    } = route.query;
+    const obj = ["assessmentId", "assessmentModelId", "assessmentObjectId"];
+    const initObj = [
+      "assessmentName",
+      "assessmentModelName",
+      "assessmentObjectName"
+    ];
+    obj.map(item => {
+      dataList.params[item] = route.query[item];
+    });
+    initObj.map(item => {
+      init[item] = route.query[item];
+    });
+    // dataList.params.assessmentId = assessmentId
+    // dataList.params.assessmentModelId = assessmentModelId
+    // dataList.params.assessmentObjectId = assessmentObjectId
+    // init.assessmentName = assessmentName;
+    // init.assessmentModelName = assessmentModelName
+    // init.assessmentObjectName = assessmentObjectName
+    const selectedItem = dataList.magList.find(
+      item => item.id === assessmentId
+    );
+    getTemplateInfoListApi(selectedItem);
+    const selectedItems = dataList.teplist.find(
+      item => item.assessmentModelId === dataList.params.assessmentModelId
+    );
+    userPageWhitOrganizationApi(selectedItems);
+    setTimeout(() => {
+      $emit("handClick", {
+        ...dataList.params,
+        ...init
+      });
+    }, 100);
+  }
+};
+
+// 考核活动
+const getAssessmentPageListApi = async () => {
+  const { data, code } = await getAssessmentList({
+    type: 1
+  });
+  if (code === 200) {
+    dataList.magList = data;
+    getSearchFrom();
+  }
+};
+getAssessmentPageListApi();
 </script>
 
 <template>

+ 72 - 11
src/views/draw/children/head/componements/seach.vue

@@ -9,7 +9,7 @@ import {
   getModelListByAssessmentId,
   getUserListObjectByModelId
 } from "@/api/draw";
-
+import { useRouter, useRoute } from "vue-router";
 const $emit = defineEmits(["handClick"]);
 
 const dataList = reactive({
@@ -45,16 +45,16 @@ const userPageWhitOrganizationApi = async () => {
 };
 userPageWhitOrganizationApi();
 // 考核活动
-const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentList({
-    type: 3
-  });
-  if (code === 200) {
-    dataList.magList = data;
-  }
-  console.log("await", data);
-};
-getAssessmentPageListApi();
+// const getAssessmentPageListApi = async () => {
+//   const { data, code } = await getAssessmentList({
+//     type: 3
+//   });
+//   if (code === 200) {
+//     dataList.magList = data;
+//   }
+//   console.log("await", data);
+// };
+// getAssessmentPageListApi();
 // 部门
 const postListTreeApi = async () => {
   const { data, code } = await postListTree();
@@ -113,6 +113,67 @@ const handClickInit3 = value => {
     ...init
   });
 };
+
+const route = useRoute();
+const getSearchFrom = () => {
+  route
+    ? console.log(route.query, "获取的路由信息")
+    : console.log("获得的路由信息为空", route);
+  if (Object.keys(route.query).length > 0) {
+    const {
+      assessmentId,
+      assessmentModelId,
+      assessmentObjectId,
+      assessmentName,
+      assessmentModelName,
+      assessmentObjectName
+    } = route.query;
+    const obj = ["assessmentId", "assessmentModelId", "assessmentObjectId"];
+    const initObj = [
+      "assessmentName",
+      "assessmentModelName",
+      "assessmentObjectName"
+    ];
+    obj.map(item => {
+      dataList.params[item] = route.query[item];
+    });
+    initObj.map(item => {
+      init[item] = route.query[item];
+    });
+    // dataList.params.assessmentId = assessmentId
+    // dataList.params.assessmentModelId = assessmentModelId
+    // dataList.params.assessmentObjectId = assessmentObjectId
+    // init.assessmentName = assessmentName;
+    // init.assessmentModelName = assessmentModelName
+    // init.assessmentObjectName = assessmentObjectName
+    const selectedItem = dataList.magList.find(
+      item => item.id === assessmentId
+    );
+    getTemplateInfoListApi(selectedItem);
+    const selectedItems = dataList.teplist.find(
+      item => item.assessmentModelId === dataList.params.assessmentModelId
+    );
+    userPageWhitOrganizationApi(selectedItems);
+    setTimeout(() => {
+      $emit("handClick", {
+        ...dataList.params,
+        ...init
+      });
+    }, 100);
+  }
+};
+
+// 考核活动
+const getAssessmentPageListApi = async () => {
+  const { data, code } = await getAssessmentList({
+    type: 3
+  });
+  if (code === 200) {
+    dataList.magList = data;
+    getSearchFrom();
+  }
+};
+getAssessmentPageListApi();
 </script>
 
 <template>

+ 74 - 10
src/views/draw/children/health/componements/seach.vue

@@ -10,6 +10,7 @@ import {
   getModelListByAssessmentId,
   getUserListObjectByModelId
 } from "@/api/draw";
+import { useRouter, useRoute } from "vue-router";
 const $emit = defineEmits(["handClick"]);
 
 const dataList = reactive({
@@ -33,18 +34,19 @@ const getTemplateInfoListApi = async selectedItem => {
 getTemplateInfoListApi();
 
 // 考核活动
-const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentList({
-    type: 2
-  });
-  if (code === 200) {
-    dataList.magList = data;
-  }
-  console.log("await", data);
-};
-getAssessmentPageListApi();
+// const getAssessmentPageListApi = async () => {
+//   const { data, code } = await getAssessmentList({
+//     type: 2
+//   });
+//   if (code === 200) {
+//     dataList.magList = data;
+//   }
+//   console.log("await", data);
+// };
+// getAssessmentPageListApi();
 // 用户组-用户组-医疗组
 const postPageGroupApi = async selectedItem => {
+  console.log(selectedItem, "传给医疗组的数据");
   const { data, code } = await getUserListObjectByModelId({
     modelId: selectedItem.assessmentModelId,
     assessmentId: selectedItem.assessmentId,
@@ -52,6 +54,7 @@ const postPageGroupApi = async selectedItem => {
   });
   if (code === 200) {
     dataList.userList = data;
+    console.log(data, "获取的医疗组");
   }
 };
 // postPageGroupApi();
@@ -99,6 +102,67 @@ const handClickInit3 = value => {
     ...init
   });
 };
+
+const route = useRoute();
+const getSearchFrom = () => {
+  route
+    ? console.log(route.query, "获取的路由信息")
+    : console.log("获得的路由信息为空", route);
+  if (Object.keys(route.query).length > 0) {
+    const {
+      assessmentId,
+      assessmentModelId,
+      assessmentObjectId,
+      assessmentName,
+      assessmentModelName,
+      assessmentObjectName
+    } = route.query;
+    const obj = ["assessmentId", "assessmentModelId", "assessmentObjectId"];
+    const initObj = [
+      "assessmentName",
+      "assessmentModelName",
+      "assessmentObjectName"
+    ];
+    obj.map(item => {
+      dataList.params[item] = route.query[item];
+    });
+    initObj.map(item => {
+      init[item] = route.query[item];
+    });
+    const selectedItem = dataList.magList.find(
+      item => item.id === assessmentId
+    );
+    getTemplateInfoListApi(selectedItem);
+    const selectedItems = dataList.teplist.find(
+      item => item.assessmentModelId === dataList.params.assessmentModelId
+    );
+    console.log(
+      selectedItems,
+      "获取的模板信息",
+      dataList.params.assessmentModelId,
+      dataList.teplist
+    );
+    postPageGroupApi(selectedItems);
+    setTimeout(() => {
+      $emit("handClick", {
+        ...dataList.params,
+        ...init
+      });
+    }, 100);
+  }
+};
+
+// 考核活动
+const getAssessmentPageListApi = async () => {
+  const { data, code } = await getAssessmentList({
+    type: 2
+  });
+  if (code === 200) {
+    dataList.magList = data;
+    getSearchFrom();
+  }
+};
+getAssessmentPageListApi();
 </script>
 
 <template>

+ 49 - 13
src/views/draw/children/worker/componements/seach.vue

@@ -9,6 +9,7 @@ import {
   getModelListByAssessmentId,
   getUserListObjectByModelId
 } from "@/api/draw";
+import { useRouter, useRoute } from "vue-router";
 
 const value = ref("");
 const $emit = defineEmits(["handClick"]);
@@ -26,11 +27,10 @@ const dataList = reactive({
 });
 
 // 搜索框----------------------------------------------------
-// 考核模
+// 考核模
 const getTemplateInfoListApi = async selectedItem => {
   const { data, code } = await getModelListByAssessmentId(selectedItem);
   if (code === 200) {
-    console.log(111111111, data);
     dataList.teplist = data;
   }
 };
@@ -46,17 +46,7 @@ const userPageWhitOrganizationApi = async selectedItem => {
     dataList.personList = data;
   }
 };
-// userPageWhitOrganizationApi();
-// 考核活动
-const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentList({
-    type: 0
-  });
-  if (code === 200) {
-    dataList.magList = data;
-  }
-};
-getAssessmentPageListApi();
+
 // 部门
 const postListTreeApi = async selectedItem => {
   const { data, code } = await getUserListObjectByModelId({
@@ -127,6 +117,52 @@ const handClickInit4 = value => {
     ...init
   });
 };
+
+const route = useRoute();
+const getSearchFrom = () => {
+  route
+    ? console.log(route.query, "获取的路由信息")
+    : console.log("获得的路由信息为空", route);
+  if (Object.keys(route.query).length > 0) {
+    const {
+      assessmentId,
+      assessmentModelId,
+      assessmentObjectId,
+      assessmentName,
+      assessmentModelName,
+      assessmentObjectName
+    } = route.query;
+    dataList.params.assessmentId = assessmentId;
+    dataList.params.assessmentModelId = assessmentModelId;
+    dataList.params.assessmentObjectId = assessmentObjectId;
+    init.assessmentName = assessmentName;
+    init.assessmentModelName = assessmentModelName;
+    init.assessmentObjectName = assessmentObjectName;
+    const selectedItem = dataList.magList.find(
+      item => item.id === assessmentId
+    );
+    getTemplateInfoListApi(selectedItem);
+    userPageWhitOrganizationApi(selectedItem);
+    setTimeout(() => {
+      $emit("handClick", {
+        ...dataList.params,
+        ...init
+      });
+    }, 100);
+  }
+};
+
+// 考核活动
+const getAssessmentPageListApi = async () => {
+  const { data, code } = await getAssessmentList({
+    type: 0
+  });
+  if (code === 200) {
+    dataList.magList = data;
+    getSearchFrom();
+  }
+};
+getAssessmentPageListApi();
 </script>
 
 <template>

+ 1 - 0
src/views/evaluate/children/change/components/editMould.vue

@@ -216,6 +216,7 @@ defineExpose({
                 v-model="formLabelAlign.dimWeight"
                 style="max-width: 150px"
                 :disabled="!dimWeight"
+                oninput="value=value.replace(/\D/g,'')"
               >
                 <template #append>%</template>
               </el-input>

+ 3 - 1
src/views/evaluate/children/change/components/newAdd.vue

@@ -287,6 +287,7 @@ const importIndexOne = async row => {
   let formula = JSON.stringify({
     noConditionFormula: ""
   });
+  console.log(row, "获取的数据");
   const { code, data, msg } = await postAddDisposableQuota({ name: "" });
   if (code == 200) {
     const res = await postAddRelationList([
@@ -295,7 +296,8 @@ const importIndexOne = async row => {
         indId: data.id,
         tpId: row.tpId,
         formula,
-        scoreStandard: 0
+        scoreStandard: 0,
+        order: row.tableData.length + 1
       }
     ]);
     if (res.code === 200) {

+ 29 - 14
src/views/evaluate/children/change/mould/manageObject.vue

@@ -289,6 +289,7 @@ const dialogVisibleAddShow = () => {
 };
 // 跳转对应科室
 const GoView = row => {
+  console.log(row, "路由跳转信息展示", messageData.value);
   const arr = {
     "0": "/draw/children/worker/workerDrak",
     "1": "/draw/children/department/departmentDrank",
@@ -299,15 +300,19 @@ const GoView = row => {
     if ($props.message.assessmentType == key) {
       router.push({
         path: arr[key],
-        query: { ...messageData.value, deptId: row.deptId }
+        query: {
+          assessmentId: messageData.value.id,
+          assessmentModelId: row.assessmentModelId,
+          assessmentObjectId: row.assessmentObjectId,
+          assessmentName: row.assessmentModelName,
+          assessmentModelName: row.assessmentModelName,
+          assessmentName: messageData.value.name,
+          assessmentObjectName: row.assessmentObjectName
+        }
       });
       return;
     }
   }
-  // router.push({
-  //   name: "departmentDrank",
-  //   query: { ...messageData.value,  },
-  // });
 };
 // 考核对象
 const objList = ref([]);
@@ -391,6 +396,16 @@ const addPerson = async () => {
     closePerson();
   }
 };
+
+const changTitle = () => {
+  const obj = {
+    0: "添加被考核人",
+    1: "添加被考核科室",
+    2: "添加被考核医疗组",
+    3: "添加被考核部门负责人"
+  };
+  return obj[$props.message.assessmentType];
+};
 </script>
 
 <template>
@@ -462,9 +477,9 @@ const addPerson = async () => {
               </el-button>
             </Auth>
             <Auth :value="['添加被考核人']">
-              <el-button type="primary" plain @click="dialogVisibleAddShow"
-                >添加被考核人</el-button
-              >
+              <el-button type="primary" plain @click="dialogVisibleAddShow">{{
+                changTitle()
+              }}</el-button>
             </Auth>
           </div>
         </div>
@@ -475,25 +490,25 @@ const addPerson = async () => {
         >
           <el-table-column type="selection" width="55" />
           <el-table-column
-            v-if="state.tableType == 1 || state.tableType == 2"
+            v-if="state.tableType == 0 || state.tableType == 3"
             prop="realName"
             label="人员"
             width="100"
           />
           <el-table-column
-            v-if="state.tableType == 3"
+            v-if="state.tableType == 2"
             prop="assessmentObjectName"
             label="医疗组"
             width="100"
           />
           <el-table-column
-            v-if="state.tableType == 1 || state.tableType == 2"
+            v-if="state.tableType == 0 || state.tableType == 3"
             prop="userName"
             label="工号"
             width="180"
           />
           <el-table-column
-            v-if="state.tableType != 3"
+            v-if="state.tableType != 2"
             prop="deptName"
             label="科室"
             width="180"
@@ -649,7 +664,7 @@ const addPerson = async () => {
       </el-tab-pane>
     </el-tabs>
     <!-- 添加被考核人 -->
-    <el-dialog v-model="dialogVisibleAdd" title="添加被考核人" width="500">
+    <el-dialog v-model="dialogVisibleAdd" :title="changTitle()" width="500">
       <div>
         <el-form
           ref="ruleFormRef"
@@ -657,7 +672,7 @@ const addPerson = async () => {
           label-width="auto"
           :model="addPersonParams"
         >
-          <el-form-item label="维度权重" label-position="top">
+          <el-form-item label="" label-position="top">
             <el-tree-select
               v-if="$props.message.assessmentType == 0"
               ref="assessmentTypeRef"