1
0

2 کامیت‌ها 7191d6aa95 ... 3072aa8621

نویسنده SHA1 پیام تاریخ
  username 3072aa8621 Merge branch 'dev' of http://111.2.21.141:33001/ystl_myq/hospital-project into dev 3 ماه پیش
  username fca2e51c89 fix: 修改考核模版处bug 3 ماه پیش

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

@@ -51,6 +51,7 @@ const formLabelAlign = reactive({
 const changeIndexList = ref([]);
 const handleClose = () => {
   Object.assign(formLabelAlign, {});
+  ruleFormRef.value.resetFields();
   drawer.value = false;
 };
 function confirmClick() {

+ 6 - 1
src/views/evaluate/children/change/components/jishuanqi.vue

@@ -276,6 +276,10 @@ const count = item => {
     $props.indexList
   );
 };
+// 暴露数据给父组件
+const exposeData = () => {
+  return params.formula.noConditionFormula;
+};
 const handleClose = () => {
   console.log("关闭");
 };
@@ -290,7 +294,8 @@ const handleMouseLeave = blo => {
   }
 };
 defineExpose({
-  params
+  params,
+  exposeData
 });
 </script>
 

+ 15 - 6
src/views/evaluate/children/change/components/settingIndexDrawer.vue

@@ -72,7 +72,8 @@ const params = reactive({
   scoreValue: "",
   formula: {
     noConditionFormula: ""
-  }
+  },
+  personList: ""
 });
 // 详情信息
 const getIndexInfoApi = async id => {
@@ -82,10 +83,12 @@ const getIndexInfoApi = async id => {
     Object.assign(params, data);
     if (data.designatedPersonnel) {
       params.personList = data.designatedPersonnel.split(",");
+    } else {
+      params.personList = "";
     }
     if (isValidJSON(data.formula)) {
       if (params.formulaType == 0) {
-        params.formula = JSON.parse(data.formula);
+        params.formula = isValidJSON(data.formula);
       } else if (params.formulaType == 1) {
         let aa = JSON.parse(data.formula);
         let bb = JSON.parse(aa.noConditionFormula);
@@ -399,8 +402,12 @@ const countComputed = async () => {
 // 判断是否为json
 function isValidJSON(str) {
   try {
-    JSON.parse(str);
-    return true; // 如果解析成功,返回true
+    if (!str.includes("\\")) {
+      return JSON.parse(str);
+    } else {
+      return JSON.parse(JSON.parse(str));
+    }
+    // return true; // 如果解析成功,返回true
   } catch (e) {
     return false; // 如果解析失败,返回false
   }
@@ -436,7 +443,8 @@ function cancelClick() {
     scoreValue: "",
     formula: {
       noConditionFormula: ""
-    }
+    },
+    personList: ""
   });
   disabledValue.value = true;
   editShow.value = true;
@@ -468,7 +476,8 @@ const open = row => {
     scoreValue: "",
     formula: {
       noConditionFormula: ""
-    }
+    },
+    personList: ""
   });
   Object.assign(addmanyChange, {
     outerConditionValue: "",

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

@@ -13,7 +13,7 @@ import {
 import { conditionVerify } from "@/api/formula";
 import jishuanqi from "@/views/evaluate/children/change/components/jishuanqi.vue";
 import manyFormula from "@/components/formula/manyFormula.vue";
-const emit = defineEmits(["updateDialog"]);
+const emit = defineEmits(["updateDialog", "getAssessmentQuotaDetailsApi"]);
 const formRef = ref();
 const drawer = ref(false);
 // 延迟组件传递数据
@@ -49,8 +49,10 @@ const open = row => {
   drawer.value = true;
   showData.value = true;
 };
+const jishuanqiRef = ref();
 // 公式
 const countNoConditionFormulaClick = (data: any) => {
+  console.log(data, "data");
   formulaOne.value = data;
 };
 defineExpose({
@@ -59,6 +61,26 @@ defineExpose({
 const handleClose = () => {
   showData.value = false;
   drawer.value = false;
+  Object.assign(formLabelAlign, {
+    relationId: "",
+    targetValue: 0,
+    finalValue: 0,
+    addValue: 0,
+    decValue: 0,
+    challengeValue: 0,
+    startValue: 0,
+    upperValue: 0,
+    agupperValue: 0,
+    dataSource: "",
+    score: 0,
+    assessmentObjectId: "",
+    assessmentModelId: "",
+    id: "",
+    dimId: "",
+    assessmentId: "",
+    formulaType: 0,
+    formula: ""
+  });
 };
 // 公式验证
 const dialogFormVisibleFormula = ref(false);
@@ -161,6 +183,13 @@ const countComputed = async () => {
 };
 // 确认
 const confirmClick = () => {
+  console.log(
+    "jishuanqiRef.value.exposeData",
+    jishuanqiRef.value.exposeData(),
+    "打印ref",
+    jishuanqiRef.value
+  );
+  countNoConditionFormulaClick(jishuanqiRef.value.exposeData());
   postUpdateApi();
 };
 // 更新模板指标关联
@@ -197,6 +226,9 @@ const postUpdateApi = async () => {
   const { code, msg } = await postUpdateAssessmentFormulas(params);
   if (code === 200) {
     ElMessage.success("修改成功");
+    setTimeout(() => {
+      emit("getAssessmentQuotaDetailsApi");
+    }, 800);
     drawer.value = false;
   } else {
     // ElMessage.error(msg);
@@ -294,6 +326,7 @@ const postUpdateApi = async () => {
                 <div class="mr-4"><el-text>得分 =</el-text></div>
                 <jishuanqi
                   v-if="showData"
+                  ref="jishuanqiRef"
                   :outerConditionValue="formulaOne"
                   @handClick="countNoConditionFormulaClick"
                 />

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

@@ -1287,7 +1287,10 @@ const selectAllChangeEvent = row => {
 <template>
   <div class="w-full">
     <!-- 指标编辑 -->
-    <editIndex ref="editIndexShow" />
+    <editIndex
+      ref="editIndexShow"
+      @getAssessmentQuotaDetailsApi="getAssessmentQuotaDetailsApi"
+    />
     <div class="w-full flex items-center justify-between">
       <div class="flex items-center justify-between mt-2">
         <div class="bg-icon">