From eefd1cde0596038eaf81ac23504a8ab4553c844b Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期五, 11 四月 2025 16:33:35 +0800
Subject: [PATCH] 1

---
 src/views/hosp/advicerules/index.vue |  174 ++++++++++++++++++++++-----------------------------------
 1 files changed, 67 insertions(+), 107 deletions(-)

diff --git a/src/views/hosp/advicerules/index.vue b/src/views/hosp/advicerules/index.vue
index 5ffd937..3f305a6 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"
           >瀵煎叆
@@ -153,35 +145,23 @@
         width="200"
         prop="jynr"
       />
+      <el-table-column label="鎬у埆" align="center" prop="xb"  :formatter="formatSex" />
       <el-table-column label="鑼冨洿" align="center" prop="fwz" />
       <el-table-column label="鑼冨洿鏈�灏忓��" align="center" prop="fwzxz" />
       <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 +215,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 +241,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"
           />
@@ -288,6 +269,7 @@
             placeholder="璇疯緭鍏ュ紓甯告爣蹇�"
           />
         </el-form-item>
+
         <el-form-item label="鐤剧梾" prop="sfjb">
           <el-checkbox v-model="form.sfjb" true-label="鏄�" false-label="鍚�">
           </el-checkbox>
@@ -296,37 +278,37 @@
           <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"
+        </el-form-item>
+        <el-form-item label="鎬у埆" prop="xb">
+          <el-select
+            v-model="form.xb"
+            placeholder="璇烽�夋嫨浣撴浜烘�у埆"
             style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚﹂噸澶х柧鐥�"
-          /> -->
+            clearable
+          >
+            <el-option
+              v-for="dict in dict.type.sys_user_sex"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="寤鸿鍚嶇О" prop="jymc" style="display: block">
           <el-input
@@ -511,6 +493,7 @@
 
 export default {
   name: "Advicerules",
+  dicts: ["sys_user_sex"],
   data() {
     return {
       // 閬僵灞�
@@ -552,6 +535,7 @@
         sfcjb: null,
         sfmxb: null,
         sfzdjb: null,
+        sfzdjb: null,
       },
       queryParam1: {
         page: 1,
@@ -564,7 +548,9 @@
         pageSize: 10,
       },
       // 琛ㄥ崟鍙傛暟
-      form: {},
+      form: {
+        xb: "2",
+      },
       // 琛ㄥ崟鏍¢獙
       rules: {},
       upload: {
@@ -596,16 +582,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;
@@ -634,8 +620,11 @@
         createBy: null,
         updateBy: null,
         deleted: null,
+        xb: "2",
       };
-      this.resetForm("form");
+      if (this.$refs.form) {
+        this.$refs.form.resetFields();
+      }
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
@@ -651,9 +640,16 @@
       this.queryParam.nr = ""; // 娓呯┖寤鸿鍐呭
     },
 
+    formatSex(row) {
+      const dictItem = this.dict.type.sys_user_sex.find(
+        (item) => item.value === row.xb
+      );
+      return dictItem ? dictItem.label : "";
+    },
+
     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 +686,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 +707,9 @@
       this.reset();
       this.open = true;
       this.title = "娣诲姞浣撴椤圭洰寤鸿瑙勫垯鏂拌〃";
+      deptTreeSelect().then((response) => {
+        this.departmentOptions = response.data[0].children;
+      });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
@@ -725,41 +720,37 @@
         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 +785,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