From a84a399991afc41e97fecdabf35deffa75668761 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期三, 22 一月 2025 16:14:10 +0800
Subject: [PATCH] 111

---
 src/views/hosp/advicerules/index.vue |  140 +++++++++++-----------------------------------
 1 files changed, 34 insertions(+), 106 deletions(-)

diff --git a/src/views/hosp/advicerules/index.vue b/src/views/hosp/advicerules/index.vue
index 5ffd937..a4c9279 100644
--- a/src/views/hosp/advicerules/index.vue
+++ b/src/views/hosp/advicerules/index.vue
@@ -8,14 +8,6 @@
       v-show="showSearch"
       label-width="68px"
     >
-      <!-- <el-form-item label="缂栫爜" prop="bm">
-        <el-input
-          v-model="queryParams.bm"
-          placeholder="璇疯緭鍏ョ紪鐮�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item> -->
       <el-form-item label="绉戝" prop="ks">
         <el-input
           v-model="queryParams.ks"
@@ -94,7 +86,7 @@
         <el-button
           type="warning"
           plain
-          icon="el-icon-download"
+          icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
           >瀵煎叆
@@ -158,30 +150,17 @@
       <el-table-column label="鑼冨洿鏈�澶у��" align="center" prop="fwzdz" />
       <el-table-column label="寮傚父鏍囧織" align="center" prop="ycbz" />
       <el-table-column label="鏄惁鐤剧梾" align="center" prop="sfjb">
-        <!-- <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.sfjb" />
-        </template> -->
       </el-table-column>
       <el-table-column label="鏄惁甯歌鐥�" align="center" prop="sfcjb">
-        <!-- <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.sfcjb" />
-        </template> -->
       </el-table-column>
       <el-table-column label="鏄惁鎱㈡�х梾" align="center" prop="sfmxb">
-        <!-- <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.sfmxb" />
-        </template> -->
       </el-table-column>
       <el-table-column
         label="鏄惁閲嶅ぇ鐤剧梾"
         align="center"
         width="120"
         prop="sfzdjb"
-      >
-        <!-- <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.sfzdjb" />
-        </template> -->
-      </el-table-column>
+      ></el-table-column>
       <el-table-column
         label="鎿嶄綔"
         align="center"
@@ -235,13 +214,14 @@
           <el-select
             v-model="form.ks"
             placeholder="璇烽�夋嫨绉戝"
-            style="width: 200"
+            style="width: 200px"
+            @change="idFn"
           >
             <el-option
               v-for="item in departmentOptions"
-              :key="item.value"
+              :key="item.id"
               :label="item.label"
-              :value="item.value"
+              :value="item.label"
             />
           </el-select>
         </el-form-item>
@@ -260,9 +240,9 @@
           />
         </el-form-item>
 
-        <el-form-item label="鑼冨洿" prop="fw">
+        <el-form-item label="鑼冨洿" prop="fwz">
           <el-input
-            v-model="form.fw"
+            v-model="form.fwz"
             placeholder="璇疯緭鍏ヨ寖鍥�"
             style="width: 200px"
           />
@@ -296,37 +276,22 @@
           <el-checkbox
             v-model="form.sfcjb"
             true-label="鏄�"
-            false-label="鍚�"
+            false-label=""
           ></el-checkbox>
-          <!--  <el-input
-            v-model="form.sfcjb"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚﹀父瑙佺梾"
-          /> -->
         </el-form-item>
         <el-form-item label="鎱㈡�х梾" prop="sfmxb">
           <el-checkbox
             v-model="form.sfmxb"
             true-label="鏄�"
-            false-label="鍚�"
+            false-label=""
           ></el-checkbox>
-          <!-- <el-input
-            v-model="form.sfmxb"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚︽參鎬х梾"
-          /> -->
         </el-form-item>
         <el-form-item label="閲嶅ぇ鐤剧梾" prop="sfzdjb">
           <el-checkbox
             v-model="form.sfzdjb"
             true-label="鏄�"
-            false-label="鍚�"
+            false-label=""
           ></el-checkbox>
-          <!-- <el-input
-            v-model="form.sfzdjb"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚﹂噸澶х柧鐥�"
-          /> -->
         </el-form-item>
         <el-form-item label="寤鸿鍚嶇О" prop="jymc" style="display: block">
           <el-input
@@ -596,16 +561,16 @@
         this.total = response.total;
         this.loading = false;
       });
-      deptTreeSelect().then((response) => {
-        this.departmentOptions = response.data[0].children;
-        console.log(response, 999);
+    },
+
+    idFn(value) {
+      console.log("Selected Value:", value);
+      this.departmentOptions.forEach((item) => {
+        if (item.value == value) {
+          this.form.ks = item.label;
+        }
       });
     },
-    /* getDeptTree() {
-      deptTreeSelect().then((response) => {
-        this.deptOption = response.data;
-      });
-    }, */
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
@@ -653,7 +618,7 @@
 
     handleSelectionChange1(selection) {
       this.ChangeList = selection;
-      this.ids = selection.map((item) => item.aid);
+      this.ids = selection.map((item) => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
       if (selection.length > 1) {
@@ -690,12 +655,8 @@
 
     /* 寮规纭畾鎸夐挳 */
     submit() {
-      console.log(this.ChangeList, 123);
-
       this.ChangeList.forEach((item) => {
-        console.log(item.title, 6363);
         this.form.jymc = item.title;
-        console.log(this.form.adviceBt, 2525);
 
         this.form.jynr = item.advice;
         // this.sfxmId = parseInt(item.id);
@@ -715,6 +676,9 @@
       this.reset();
       this.open = true;
       this.title = "娣诲姞浣撴椤圭洰寤鸿瑙勫垯鏂拌〃";
+      deptTreeSelect().then((response) => {
+        this.departmentOptions = response.data[0].children;
+      });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
@@ -725,41 +689,36 @@
         this.open = true;
         this.title = "淇敼浣撴椤圭洰寤鸿瑙勫垯鏂拌〃";
       });
+      deptTreeSelect().then((response) => {
+        this.departmentOptions = response.data[0].children;
+      });
     },
+
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          this.columns.forEach((column) => {
-            if (column.htmlType === "checkbox") {
-              // 灏嗛�変腑鐨� checkbox 鍊肩敤閫楀彿鍒嗛殧
-              this.form[column.javaField] =
-                this.form[column.javaField].join(",");
-            }
-          });
-          if (this.table.sub) {
-            this.form.subclassNameList = this.subclassNameList; // 鍋囪 subclassNameList 鏄瓙琛ㄦ牸鐨勬暟鎹�
-          }
-          if (this.form[pkColumn.javaField] != null) {
+          if (this.form.id != null) {
             updateAdvicerules(this.form).then((response) => {
+              console.log(response, 1111333);
+
               this.$modal.msgSuccess("淇敼鎴愬姛");
               this.open = false;
-              this.getList(); // 鍒锋柊鍒楄〃
+              this.getList();
             });
           } else {
-            // 濡傛灉涓婚敭瀛楁涓虹┖锛岃繘琛屾柊澧炴搷浣�
             addAdvicerules(this.form).then((response) => {
               this.$modal.msgSuccess("鏂板鎴愬姛");
               this.open = false;
-              this.getList(); // 鍒锋柊鍒楄〃
+              this.getList();
             });
           }
         }
       });
     },
     handleDelete(row) {
-      const pkValue = row[pkColumn.javaField] || this.ids; // 鑾峰彇涓婚敭鍊硷紝濡傛灉row涓病鏈変富閿�硷紝鍒欎娇鐢╰his.ids
+      const pkValue = row.id || this.ids; // 鑾峰彇涓婚敭鍊硷紝濡傛灉row涓病鏈変富閿�硷紝鍒欎娇鐢╰his.ids
       this.$modal
-        .confirm(`鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"${pkValue}"鐨勬暟鎹」锛焋)
+        .confirm(`鏄惁纭鍒犻櫎"${pkValue}"鐨勬暟鎹」锛焋)
         .then(() => {
           return delAdvicerules(pkValue); // 璋冪敤鍒犻櫎鎺ュ彛锛屼紶鍏ヤ富閿��
         })
@@ -794,43 +753,12 @@
           dangerouslyUseHTMLString: true,
         });
       }
-      /*  this.ListObj = response.data;
-      this.advicerulesList = response.data.list;
-
-      this.userList.forEach((item) => {
-        this.CompanyList.forEach((item1) => {
-          if (item1.drugManufacturerId == this.objs.drugManufacturerId) {
-            item.company = item1.cnName;
-          }
-        });
-      }); */
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
       this.leftList = response.msg;
       console.log(response.code);
 
-      /*  if (this.leftList == "鎿嶄綔澶辫触") {
-        this.isdisabled = true;
-        this.$alert(
-          "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-            response.msg +
-            "<div style='br;margin:10px'>" +
-            response.data[0] +
-            "韬唤璇佹垨鎵嬫満鍙风爜鏈夎" +
-            "</div>",
-          "瀵煎叆缁撴灉",
-          { dangerouslyUseHTMLString: true }
-        );
-      } else {
-        this.isdisabled = false;
-        this.$alert(
-          "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-            response.msg,
-          { dangerouslyUseHTMLString: true }
-        );
-        this.rightList = response;
-      } */
       for (let i = 0; i < fileList.length; i++) {
         if (file.name != fileList[i].name) {
           this.fileList.push({

--
Gitblit v1.8.0