Browse Source

fix: 修改考核模版处新增回显问题

username 2 weeks ago
parent
commit
fd41e284fe

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

@@ -141,7 +141,7 @@ const handClickInit3 = value => {
           </el-select>
           </el-select>
         </div>
         </div>
         <div class="flex mr-2">
         <div class="flex mr-2">
-          <div class="text-sm leading-8 mr-3">科</div>
+          <div class="text-sm leading-8 mr-3">科主任</div>
           <el-tree-select
           <el-tree-select
             v-model="dataList.params.deptCode"
             v-model="dataList.params.deptCode"
             :data="dataList.deptList"
             :data="dataList.deptList"

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

@@ -86,7 +86,7 @@ const handClickInit3 = value => {
     const selectedItem = dataList.magList.find(
     const selectedItem = dataList.magList.find(
       item => item.groupCode === value
       item => item.groupCode === value
     );
     );
-    init.assessmentName = selectedItem.groupName;
+    init.deptName = selectedItem.groupName;
   }
   }
   $emit("handClick", {
   $emit("handClick", {
     ...dataList.params,
     ...dataList.params,
@@ -138,7 +138,7 @@ const handClickInit3 = value => {
         <div class="flex mr-2">
         <div class="flex mr-2">
           <div class="text-sm leading-8 mr-3">医疗组</div>
           <div class="text-sm leading-8 mr-3">医疗组</div>
           <el-select
           <el-select
-            v-model="dataList.params.assessmentModelId"
+            v-model="dataList.params.deptCode"
             clearable
             clearable
             filterable
             filterable
             placeholder="请选择"
             placeholder="请选择"

+ 3 - 2
src/views/draw/children/health/healthDrank.vue

@@ -51,6 +51,7 @@ const getPersonDimensionChartsListApi = async (
   });
   });
 
 
   if (code == 200) {
   if (code == 200) {
+    console.log("触发事件", data);
     if (data.length > 0) {
     if (data.length > 0) {
       data.dimensionList.map(item => {
       data.dimensionList.map(item => {
         dataList.dimName.push({
         dataList.dimName.push({
@@ -89,8 +90,8 @@ const getPersonDimensionChartsRankingApi = async (
 const init = item => {
 const init = item => {
   seachParams.value = item;
   seachParams.value = item;
   getPersonDimensionChartsListApi();
   getPersonDimensionChartsListApi();
-  getPersonDimensionChartsRankingApi();
-  getChartsListApi();
+  // getPersonDimensionChartsRankingApi();
+  // getChartsListApi();
   barDimEchartsRef.value.init(seachParams.value, 0);
   barDimEchartsRef.value.init(seachParams.value, 0);
 };
 };
 // 维度表格
 // 维度表格

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

@@ -95,8 +95,8 @@ const saveCopy = async () => {
     ElMessage.success("复制成功");
     ElMessage.success("复制成功");
     dialogVisibleCopy.value = false;
     dialogVisibleCopy.value = false;
     getAssessmentPageListApi();
     getAssessmentPageListApi();
-  } else {
-    ElMessage.error(msg);
+    // } else {
+    //   ElMessage.error(msg);
   }
   }
 };
 };
 </script>
 </script>
@@ -136,7 +136,6 @@ const saveCopy = async () => {
         <el-table
         <el-table
           :data="params.tableData"
           :data="params.tableData"
           style="width: 100%"
           style="width: 100%"
-          max-height="250"
           @row-click="handleRowClick"
           @row-click="handleRowClick"
         >
         >
           <el-table-column prop="name" label="考核名称" width="300" fixed />
           <el-table-column prop="name" label="考核名称" width="300" fixed />

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

@@ -35,9 +35,7 @@ const form = reactive({
   ]
   ]
 });
 });
 const rules = reactive({
 const rules = reactive({
-  name: [
-    { required: true, message: "Please input Activity name", trigger: "blur" }
-  ]
+  name: [{ required: true, message: "请输入考核名称", trigger: "blur" }]
 });
 });
 const formLeftRules = reactive({
 const formLeftRules = reactive({
   left: [{ required: true, message: "请选择考核指标", trigger: "blur" }],
   left: [{ required: true, message: "请选择考核指标", trigger: "blur" }],
@@ -63,6 +61,7 @@ const saveDepartment = async () => {
   form.cycleValue = dayjs(form.cycleValue).format(format.value);
   form.cycleValue = dayjs(form.cycleValue).format(format.value);
   //
   //
   console.log("form", dayjs(form.cycleValue).format(format.value));
   console.log("form", dayjs(form.cycleValue).format(format.value));
+  console.log(form, "获取的数据");
   const { code, msg } = await postAddAssessment(form);
   const { code, msg } = await postAddAssessment(form);
   if (code === 200) {
   if (code === 200) {
     ElMessage({
     ElMessage({
@@ -231,18 +230,24 @@ const transformData = data => {
     return transformedItem;
     return transformedItem;
   });
   });
 };
 };
-const handleRreeSelect = (node, index) => {
-  console.log(node.deptName, index);
-  form.assessmentObjectList.assessmentObjectName = node.deptName;
+const assessmentTypeRef = ref();
+const handleRreeSelect = index => {
+  const node = assessmentTypeRef.value[index].getCheckedNodes();
+  form.assessmentObjectList[index].assessmentObjectName =
+    node[node.length - 1].deptName;
 };
 };
-const handleSelect = (node, index) => {
-  console.log(node, index);
-  resTmp.value.map(item => {
-    console.log(item);
-    if (item.id == node) {
-      form.assessmentObjectList.assessmentModelName = item.tpName;
-    }
-  });
+const handleSelect = index => {
+  // console.log(index,'form.assessmentObjectList',form.assessmentObjectList[index].am);
+  form.assessmentObjectList[index].assessmentModelName =
+    form.assessmentObjectList[index].am.tpName;
+  form.assessmentObjectList[index].assessmentModelId =
+    form.assessmentObjectList[index].am.id;
+  // resTmp.value.map(item => {
+  //   console.log(item);
+  //   if (item.id == node) {
+  //     form.assessmentObjectList.assessmentModelName = item.tpName;
+  //   }
+  // });
 };
 };
 const aaaa = a => {
 const aaaa = a => {
   console.log(a);
   console.log(a);
@@ -412,6 +417,7 @@ defineExpose({
                   >
                   >
                     <el-tree-select
                     <el-tree-select
                       v-if="form.assessmentType === 1"
                       v-if="form.assessmentType === 1"
+                      ref="assessmentTypeRef"
                       v-model="item.assessmentObjectId"
                       v-model="item.assessmentObjectId"
                       :data="treeDept"
                       :data="treeDept"
                       :render-after-expand="false"
                       :render-after-expand="false"
@@ -422,11 +428,12 @@ defineExpose({
                         children: 'children'
                         children: 'children'
                       }"
                       }"
                       style="width: 180px"
                       style="width: 180px"
-                      @check-change="handleRreeSelect"
+                      @check-change="handleRreeSelect(index)"
                     />
                     />
                     <el-select
                     <el-select
                       v-if="form.assessmentType != 1"
                       v-if="form.assessmentType != 1"
                       v-model="item.assessmentObjectId"
                       v-model="item.assessmentObjectId"
+                      @change="handChange"
                     >
                     >
                       <el-option
                       <el-option
                         v-for="(it, id) in treeDept"
                         v-for="(it, id) in treeDept"
@@ -452,17 +459,18 @@ defineExpose({
                     class="w-full flex mt-1"
                     class="w-full flex mt-1"
                   >
                   >
                     <el-select
                     <el-select
-                      v-model="item.assessmentModelId"
+                      v-model="item.am"
                       placeholder="请选择"
                       placeholder="请选择"
                       filterable
                       filterable
                       style="width: 180px"
                       style="width: 180px"
-                      @change="handleSelect"
+                      value-key="id"
+                      @change="handleSelect(index)"
                     >
                     >
                       <el-option
                       <el-option
                         v-for="itemTmp in resTmp"
                         v-for="itemTmp in resTmp"
                         :key="itemTmp.id"
                         :key="itemTmp.id"
                         :label="itemTmp.tpName"
                         :label="itemTmp.tpName"
-                        :value="itemTmp.id"
+                        :value="itemTmp"
                         style="width: 180px"
                         style="width: 180px"
                       />
                       />
                     </el-select>
                     </el-select>

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

@@ -127,7 +127,6 @@ const formattedTime = time => {
         v-loading="tableLoading"
         v-loading="tableLoading"
         :data="data.records"
         :data="data.records"
         style="width: 100%"
         style="width: 100%"
-        max-height="250"
       >
       >
         <el-table-column prop="tpName" label="考核模板" />
         <el-table-column prop="tpName" label="考核模板" />
         <el-table-column
         <el-table-column

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

@@ -304,8 +304,8 @@ const handleCurrentIndexChange = (val: number) => {
             />
             />
           </div>
           </div>
           <div class="mr-10">
           <div class="mr-10">
-            <el-button type="primary" plain>批量调整执行人</el-button>
-            <el-button type="primary" plain>批量重置流程</el-button>
+            <!-- <el-button type="primary" plain>批量调整执行人</el-button>
+            <el-button type="primary" plain>批量重置流程</el-button> -->
             <Auth :value="['批量删除']">
             <Auth :value="['批量删除']">
               <el-button type="primary" plain @click="delAssessmentObjectApi">
               <el-button type="primary" plain @click="delAssessmentObjectApi">
                 批量删除
                 批量删除
@@ -321,7 +321,6 @@ const handleCurrentIndexChange = (val: number) => {
         <el-table
         <el-table
           :data="objList"
           :data="objList"
           style="width: 100%"
           style="width: 100%"
-          max-height="250"
           @selection-change="changeSelection"
           @selection-change="changeSelection"
         >
         >
           <el-table-column type="selection" width="55" />
           <el-table-column type="selection" width="55" />

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

@@ -158,11 +158,10 @@ const postListTreeWithUserApi = async () => {
   const res = await postListTreeWithUser();
   const res = await postListTreeWithUser();
   const { data, code } = await getTemplateInfoList(templateparams);
   const { data, code } = await getTemplateInfoList(templateparams);
   resTmp.value = data.records;
   resTmp.value = data.records;
-  console.log(data);
   treeDept.value = [];
   treeDept.value = [];
   treeDept.value = transformData(res.data);
   treeDept.value = transformData(res.data);
 };
 };
-
+postListTreeWithUserApi();
 function transformData(arr) {
 function transformData(arr) {
   return arr.map(item => {
   return arr.map(item => {
     const {
     const {