Quellcode durchsuchen

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

username vor 1 Woche
Ursprung
Commit
40b9a91e28

+ 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({

+ 24 - 3
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: ""
@@ -338,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">

+ 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 }">