From 7a2d49aeff16e1122ed33ebb858f093a379fb960 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期二, 15 四月 2025 17:11:03 +0800
Subject: [PATCH] wx

---
 src/views/hosp/advicerules/index.vue |  693 +++++++++++++++++++++------------------------------------
 1 files changed, 254 insertions(+), 439 deletions(-)

diff --git a/src/views/hosp/advicerules/index.vue b/src/views/hosp/advicerules/index.vue
index 5ffd937..8c18cfb 100644
--- a/src/views/hosp/advicerules/index.vue
+++ b/src/views/hosp/advicerules/index.vue
@@ -1,358 +1,170 @@
 <template>
   <div class="app-container">
-    <el-form
-      :model="queryParams"
-      ref="queryForm"
-      size="small"
-      :inline="true"
-      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 :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="绉戝" prop="ks">
-        <el-input
-          v-model="queryParams.ks"
-          placeholder="璇疯緭鍏ョ瀹�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-input v-model="queryParams.ks" placeholder="璇疯緭鍏ョ瀹�" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="妫�鏌ラ」鐩�" prop="jcxm">
-        <el-input
-          v-model="queryParams.jcxm"
-          placeholder="璇疯緭鍏ユ鏌ラ」鐩�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-input v-model="queryParams.jcxm" placeholder="璇疯緭鍏ユ鏌ラ」鐩�" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="涓昏璇婃柇" prop="zyzd">
-        <el-input
-          v-model="queryParams.zyzd"
-          placeholder="璇疯緭鍏ヤ富瑕佽瘖鏂�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-input v-model="queryParams.zyzd" placeholder="璇疯緭鍏ヤ富瑕佽瘖鏂�" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-          >鎼滅储</el-button
-        >
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >閲嶇疆</el-button
-        >
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['hosp:advicerules:add']"
-          >鏂板
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
+          v-hasPermi="['hosp:advicerules:add']">鏂板
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['hosp:advicerules:edit']"
-          >淇敼
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
+          v-hasPermi="['hosp:advicerules:edit']">淇敼
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['hosp:advicerules:remove']"
-          >鍒犻櫎
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
+          v-hasPermi="['hosp:advicerules:remove']">鍒犻櫎
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleImport"
-          >瀵煎叆
+        <el-button type="warning" plain icon="el-icon-upload2" size="mini" @click="handleImport">瀵煎叆
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['hosp:advicerules:export']"
-          >瀵煎嚭
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
+          v-hasPermi="['hosp:advicerules:export']">瀵煎嚭
         </el-button>
       </el-col>
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table
-      v-loading="loading"
-      :data="advicerulesList"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="搴忓彿" width="50" align="center">
-        <template slot-scope="scope">
-          {{ scope.$index + 1 }}
-          <!-- 浣跨敤 $index 鏉ユ樉绀哄簭鍙凤紝浠�1寮�濮� -->
-        </template>
-      </el-table-column>
-      <el-table-column label="缂栫爜" align="center" prop="bm" />
-      <el-table-column label="绉戝" align="center" prop="ks" />
-      <el-table-column label="妫�鏌ラ」鐩�" align="center" prop="jcxm" />
-      <el-table-column
-        label="涓昏璇婃柇"
-        align="center"
-        :show-overflow-tooltip="true"
-        width="120"
-        prop="zyzd"
-      />
-      <el-table-column
-        label="寤鸿鍚嶇О"
-        align="center"
-        :show-overflow-tooltip="true"
-        width="150"
-        prop="jymc"
-      />
-      <el-table-column
-        label="寤鸿鍐呭"
-        align="center"
-        :show-overflow-tooltip="true"
-        width="200"
-        prop="jynr"
-      />
-      <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
-        label="鎿嶄綔"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['hosp:advicerules:edit']"
-          >
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['hosp:advicerules:remove']"
-          >
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+    <el-row :gutter="20" style="display: flex">
+      <el-col :span="5" :xs="24">
+        <div class="head-container">
+          <el-input v-model="xmmc" placeholder="璇疯緭鍏ラ」鐩悕" clearable size="small" prefix-icon="el-icon-search"
+            style="margin-bottom: 20px" />
+        </div>
+        <div class="scrollable-container">
+          <div class="content">
+            <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
+              :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId"
+              highlight-current @node-click="handleNodeClick" />
+          </div>
+        </div>
+      </el-col>
+      <el-col :span="19" :xs="24">
 
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+        <el-table v-loading="loading" :data="advicerulesList" @selection-change="handleSelectionChange" height="520">
+          <el-table-column type="selection" width="55" align="center" />
+          <el-table-column label="搴忓彿" width="50" align="center">
+            <template slot-scope="scope">
+              {{ scope.$index + 1 }}
+              <!-- 浣跨敤 $index 鏉ユ樉绀哄簭鍙凤紝浠�1寮�濮� -->
+            </template>
+          </el-table-column>
+          <el-table-column label="缂栫爜" align="center" prop="bm" />
+          <el-table-column label="绉戝" align="center" prop="ks" />
+          <el-table-column label="妫�鏌ラ」鐩�" align="center" prop="jcxm" />
+          <el-table-column label="涓昏璇婃柇" align="center" :show-overflow-tooltip="true" width="120" prop="zyzd" />
+          <el-table-column label="寤鸿鍚嶇О" align="center" :show-overflow-tooltip="true" width="150" prop="jymc" />
+          <el-table-column label="寤鸿鍐呭" align="center" :show-overflow-tooltip="true" 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">
+          </el-table-column>
+          <el-table-column label="鏄惁甯歌鐥�" align="center" prop="sfcjb">
+          </el-table-column>
+          <el-table-column label="鏄惁鎱㈡�х梾" align="center" prop="sfmxb">
+          </el-table-column>
+          <el-table-column label="鏄惁閲嶅ぇ鐤剧梾" align="center" width="120" prop="sfzdjb"></el-table-column>
+          <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+            <template slot-scope="scope">
+              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+                v-hasPermi="['hosp:advicerules:edit']">
+              </el-button>
+              <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+                v-hasPermi="['hosp:advicerules:remove']">
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="pag">
+      <div class="pag1">
+        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize" @pagination="getListByXmId" />
+      </div>
+    </div>
+      </el-col>
+    </el-row>
+   
 
     <!-- 娣诲姞鎴栦慨鏀逛綋妫�椤圭洰寤鸿瑙勫垯鏂拌〃瀵硅瘽妗� -->
-    <el-dialog
-      :title="title"
-      :visible.sync="open"
-      width="1000px"
-      append-to-body
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="80px"
-        :inline="true"
-      >
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true">
         <el-form-item label="绉戝" prop="ks">
-          <el-select
-            v-model="form.ks"
-            placeholder="璇烽�夋嫨绉戝"
-            style="width: 200"
-          >
-            <el-option
-              v-for="item in departmentOptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            />
+          <el-select v-model="form.ks" placeholder="璇烽�夋嫨绉戝" style="width: 200px" @change="idFn">
+            <el-option v-for="item in departmentOptions" :key="item.id" :label="item.label" :value="item.label" />
           </el-select>
         </el-form-item>
         <el-form-item label="妫�鏌ラ」鐩�" prop="jcxm">
-          <el-input
-            v-model="form.jcxm"
-            placeholder="璇疯緭鍏ユ鏌ラ」鐩�"
-            style="width: 200px"
-          />
+          <el-input v-model="form.jcxm" placeholder="璇疯緭鍏ユ鏌ラ」鐩�" style="width: 200px" />
         </el-form-item>
         <el-form-item label="涓昏璇婃柇" prop="zyzd">
-          <el-input
-            v-model="form.zyzd"
-            placeholder="璇疯緭鍏ヤ富瑕佽瘖鏂�"
-            style="width: 200px"
-          />
+          <el-input v-model="form.zyzd" placeholder="璇疯緭鍏ヤ富瑕佽瘖鏂�" style="width: 200px" />
         </el-form-item>
 
-        <el-form-item label="鑼冨洿" prop="fw">
-          <el-input
-            v-model="form.fw"
-            placeholder="璇疯緭鍏ヨ寖鍥�"
-            style="width: 200px"
-          />
+        <el-form-item label="鑼冨洿" prop="fwz">
+          <el-input v-model="form.fwz" placeholder="璇疯緭鍏ヨ寖鍥�" style="width: 200px" />
         </el-form-item>
         <el-form-item label="鏈�灏忓��" prop="fwzxz">
-          <el-input
-            v-model="form.fwzxz"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ヨ寖鍥存渶灏忓��"
-          />
+          <el-input v-model="form.fwzxz" style="width: 200px" placeholder="璇疯緭鍏ヨ寖鍥存渶灏忓��" />
         </el-form-item>
         <el-form-item label="鏈�澶у��" prop="fwzdz">
-          <el-input
-            v-model="form.fwzdz"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ヨ寖鍥存渶澶у��"
-          />
+          <el-input v-model="form.fwzdz" style="width: 200px" placeholder="璇疯緭鍏ヨ寖鍥存渶澶у��" />
         </el-form-item>
         <el-form-item label="寮傚父鏍囧織" prop="ycbz">
-          <el-input
-            v-model="form.ycbz"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ュ紓甯告爣蹇�"
-          />
+          <el-input v-model="form.ycbz" style="width: 200px" placeholder="璇疯緭鍏ュ紓甯告爣蹇�" />
         </el-form-item>
+
         <el-form-item label="鐤剧梾" prop="sfjb">
           <el-checkbox v-model="form.sfjb" true-label="鏄�" false-label="鍚�">
           </el-checkbox>
         </el-form-item>
         <el-form-item label="甯歌鐥�" prop="sfcjb">
-          <el-checkbox
-            v-model="form.sfcjb"
-            true-label="鏄�"
-            false-label="鍚�"
-          ></el-checkbox>
-          <!--  <el-input
-            v-model="form.sfcjb"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚﹀父瑙佺梾"
-          /> -->
+          <el-checkbox v-model="form.sfcjb" true-label="鏄�" false-label=""></el-checkbox>
         </el-form-item>
         <el-form-item label="鎱㈡�х梾" prop="sfmxb">
-          <el-checkbox
-            v-model="form.sfmxb"
-            true-label="鏄�"
-            false-label="鍚�"
-          ></el-checkbox>
-          <!-- <el-input
-            v-model="form.sfmxb"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚︽參鎬х梾"
-          /> -->
+          <el-checkbox v-model="form.sfmxb" true-label="鏄�" false-label=""></el-checkbox>
         </el-form-item>
         <el-form-item label="閲嶅ぇ鐤剧梾" prop="sfzdjb">
-          <el-checkbox
-            v-model="form.sfzdjb"
-            true-label="鏄�"
-            false-label="鍚�"
-          ></el-checkbox>
-          <!-- <el-input
-            v-model="form.sfzdjb"
-            style="width: 200px"
-            placeholder="璇疯緭鍏ユ槸鍚﹂噸澶х柧鐥�"
-          /> -->
+          <el-checkbox v-model="form.sfzdjb" true-label="鏄�" false-label=""></el-checkbox>
+        </el-form-item>
+        <el-form-item label="鎬у埆" prop="xb">
+          <el-select v-model="form.xb" placeholder="璇烽�夋嫨浣撴浜烘�у埆" style="width: 200px" 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
-            v-model="form.jymc"
-            placeholder="璇疯緭鍏ュ缓璁悕绉�"
-            style="width: 200px"
-          />
+          <el-input v-model="form.jymc" placeholder="璇疯緭鍏ュ缓璁悕绉�" style="width: 200px" />
         </el-form-item>
 
         <el-form-item label="寤鸿鍐呭" prop="jynr">
-          <span
-            slot="label"
-            style="display: inline-block; border-bottom: 2px solid blue"
-            @click="getDetailed"
-          >
+          <span slot="label" style="display: inline-block; border-bottom: 2px solid blue" @click="getDetailed">
             寤鸿鍐呭
           </span>
 
-          <el-input
-            v-if="key !== 'N'"
-            style="width: 782px"
-            type="textarea"
-            :rows="3"
-            v-model="form.jynr"
-            placeholder="璇疯緭鍏ュ缓璁唴瀹�"
-          >
+          <el-input v-if="key !== 'N'" style="width: 782px" type="textarea" :rows="3" v-model="form.jynr"
+            placeholder="璇疯緭鍏ュ缓璁唴瀹�">
           </el-input>
         </el-form-item>
       </el-form>
@@ -362,25 +174,10 @@
       </div>
     </el-dialog>
 
-    <el-dialog
-      :title="upload.title"
-      :visible.sync="upload.open"
-      width="400px"
-      append-to-body
-    >
-      <el-upload
-        ref="upload"
-        :limit="1"
-        accept=".xlsx, .xls"
-        :headers="upload.headers"
-        :data="data"
-        :action="upload.url"
-        :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
-        :auto-upload="false"
-        drag
-      >
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :data="data"
+        :action="upload.url" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess" :auto-upload="false" drag>
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
         <div class="el-upload__tip text-center" slot="tip">
@@ -405,87 +202,32 @@
     </el-dialog>
 
     <!-- 寤鸿鍐呭鍙婂缓璁悕绉板脊妗� -->
-    <el-dialog
-      title="寤鸿鍐呭"
-      :visible.sync="dialogTableVisible"
-      width="80%"
-      :close-on-click-modal="false"
-      @close="clearForm"
-    >
+    <el-dialog title="寤鸿鍐呭" :visible.sync="dialogTableVisible" width="80%" :close-on-click-modal="false"
+      @close="clearForm">
       <div class="app-container">
-        <el-form
-          :model="form"
-          ref="queryForm"
-          size="small"
-          :inline="true"
-          v-show="showSearch"
-          label-width="68px"
-        >
+        <el-form :model="form" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
           <el-form-item label="鏍囬" prop="title">
-            <el-input
-              v-model="queryParam1.bt"
-              placeholder="璇疯緭鍏ユ爣棰�"
-              clearable
-              @keyup.enter.native="handlecharge"
-            />
+            <el-input v-model="queryParam1.bt" placeholder="璇疯緭鍏ユ爣棰�" clearable @keyup.enter.native="handlecharge" />
           </el-form-item>
           <el-form-item label="寤鸿鍐呭" prop="jynr">
-            <el-input
-              v-model="queryParam1.nr"
-              placeholder="璇疯緭鍏ュ缓璁�"
-              clearable
-              @keyup.enter.native="handlecharge"
-            />
+            <el-input v-model="queryParam1.nr" placeholder="璇疯緭鍏ュ缓璁�" clearable @keyup.enter.native="handlecharge" />
           </el-form-item>
           <el-form-item>
-            <el-button
-              type="primary"
-              icon="el-icon-search"
-              size="mini"
-              @click="handlecharge"
-              >鎼滅储</el-button
-            >
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="handlecharge">鎼滅储</el-button>
           </el-form-item>
         </el-form>
 
-        <el-table
-          v-loading="loading"
-          :data="adviceList"
-          ref="tb"
-          @selection-change="handleSelectionChange1"
-          border
-        >
+        <el-table v-loading="loading" :data="adviceList" ref="tb" @selection-change="handleSelectionChange1" border>
           <el-table-column type="selection" align="center" fixed />
-          <el-table-column
-            label="搴忓彿"
-            align="center"
-            width="60"
-            prop="newID"
-          />
-          <el-table-column
-            label="鏍囬"
-            align="center"
-            prop="title"
-            width="120"
-            :show-overflow-tooltip="true"
-          />
-          <el-table-column
-            label="寤鸿"
-            align="center"
-            prop="advice"
-            :show-overflow-tooltip="true"
-          />
+          <el-table-column label="搴忓彿" align="center" width="60" prop="newID" />
+          <el-table-column label="鏍囬" align="center" prop="title" width="120" :show-overflow-tooltip="true" />
+          <el-table-column label="寤鸿" align="center" prop="advice" :show-overflow-tooltip="true" />
         </el-table>
 
         <div class="pag">
           <div class="pag1">
-            <pagination
-              v-show="total > 0"
-              :total="total"
-              :page.sync="queryParam1.page"
-              :limit.sync="queryParam1.pageSize"
-              @pagination="getlistJynr"
-            />
+            <pagination v-show="total > 0" :total="total" :page.sync="queryParam1.page"
+              :limit.sync="queryParam1.pageSize" @pagination="getlistJynr" />
           </div>
         </div>
       </div>
@@ -504,6 +246,7 @@
   delAdvicerules,
   addAdvicerules,
   updateAdvicerules,
+  getTjProAdvicerulesKsList,
 } from "@/api/hosp/advicerules";
 import { listAdvice } from "@/api/advice/advice";
 import { getToken } from "@/utils/auth";
@@ -511,6 +254,7 @@
 
 export default {
   name: "Advicerules",
+  dicts: ["sys_user_sex"],
   data() {
     return {
       // 閬僵灞�
@@ -529,8 +273,11 @@
       // 浣撴椤圭洰寤鸿瑙勫垯鏂拌〃琛ㄦ牸鏁版嵁
       advicerulesList: [],
       adviceList: [],
+      deptOptions: [],
+      treeId: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
+      xmmc: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
       key: "",
@@ -538,6 +285,10 @@
       businessName: "exampleBusiness", // 绀轰緥涓氬姟鍚�
       objs: {},
       departmentOptions: [],
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
@@ -552,6 +303,7 @@
         sfcjb: null,
         sfmxb: null,
         sfzdjb: null,
+        sfzdjb: null,
       },
       queryParam1: {
         page: 1,
@@ -564,7 +316,9 @@
         pageSize: 10,
       },
       // 琛ㄥ崟鍙傛暟
-      form: {},
+      form: {
+        xb: "2",
+      },
       // 琛ㄥ崟鏍¢獙
       rules: {},
       upload: {
@@ -587,25 +341,83 @@
   created() {
     this.getList();
   },
+  watch: {
+    // 鏍规嵁鍚嶇О绛涢�夐儴闂ㄦ爲
+    xmmc(val) {
+      this.$refs.tree.filter(val);
+    },
+    treeId(newVal, oldVal) {
+      if (newVal) {
+        this.$nextTick(() => {
+          document
+            .querySelector(".el-tree-node__children .el-tree-node__content")
+            .click();
+        });
+      }
+    },
+  },
   methods: {
     /** 鏌ヨ浣撴椤圭洰寤鸿瑙勫垯鏂拌〃鍒楄〃 */
     getList() {
-      this.loading = true;
+      /* this.loading = true;
       listAdvicerules(this.queryParams).then((response) => {
         this.advicerulesList = response.rows;
         this.total = response.total;
         this.loading = false;
-      });
-      deptTreeSelect().then((response) => {
-        this.departmentOptions = response.data[0].children;
-        console.log(response, 999);
+      }); */
+      getTjProAdvicerulesKsList().then((response) => {
+        this.deptOptions = response.data.map((name, index) => {
+          return {
+            id: index + 1, // 鍙嚜瀹氫箟鍞竴 ID
+            label: name, // el-tree 榛樿鐨勬樉绀哄瓧娈�
+          };
+        });
+
+        // 璁剧疆榛樿灞曞紑椤�
+        this.treeId = [this.deptOptions[0]?.id];
+        this.queryParams.proId = this.deptOptions[0]?.id;
+        this.getListByXmId();
       });
     },
-    /* getDeptTree() {
-      deptTreeSelect().then((response) => {
-        this.deptOption = response.data;
+    getListByXmId() {
+      this.loading = true;
+      listAdvicerules(this.queryParams).then((response) => {
+        response.rows.forEach((item, index) => {
+          item.newID =
+            (this.queryParams.pageNum - 1) * this.queryParams.pageSize +
+            index +
+            1;
+        });
+        this.advicerulesList = response.rows;
+        this.total = response.total;
+        this.loading = false;
       });
-    }, */
+    },
+    handleNodeClick(data) {
+      this.formIn = data;
+      this.queryParams.ks = data.label;
+      this.getListByXmId();
+    },
+
+    // 绛涢�夎妭鐐�
+    filterNode(value, data) {
+      if (!value) return true;
+      // return data.label.indexOf(value) !== -1;
+      return (
+        data.label &&
+        typeof data.label === "string" &&
+        data.label.indexOf(value) !== -1
+      );
+    },
+
+    idFn(value) {
+      console.log("Selected Value:", value);
+      this.departmentOptions.forEach((item) => {
+        if (item.value == value) {
+          this.form.ks = item.label;
+        }
+      });
+    },
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
@@ -634,8 +446,11 @@
         createBy: null,
         updateBy: null,
         deleted: null,
+        xb: "2",
       };
-      this.resetForm("form");
+      if (this.$refs.form) {
+        this.$refs.form.resetFields();
+      }
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
@@ -651,9 +466,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 +512,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 +533,9 @@
       this.reset();
       this.open = true;
       this.title = "娣诲姞浣撴椤圭洰寤鸿瑙勫垯鏂拌〃";
+      deptTreeSelect().then((response) => {
+        this.departmentOptions = response.data[0].children;
+      });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
@@ -725,41 +546,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 +611,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({
@@ -860,4 +646,33 @@
   },
 };
 </script>
+<style scoped>
+.scrollable-container {
+  width: 260px;
+  /* 璁剧疆瀹瑰櫒鐨勫搴� */
+  height: 520px;
+  /* 璁剧疆瀹瑰櫒鐨勯珮搴� */
+  overflow: auto;
+  /* 鍏佽鍐呭婧㈠嚭鏃舵樉绀烘粴鍔ㄦ潯 */
+  border: 1px solid #ccc;
+  /* 鍙�夛細娣诲姞杈规浠ユ洿濂藉湴鏄剧ず瀹瑰櫒 */
+  position: relative;
+  /* 鍙�夛細浣垮鍣ㄥ唴鐨勭粷瀵瑰畾浣嶅厓绱犺兘澶熸纭樉绀� */
+}
 
+.content {
+  width: 1000px;
+  /* 璁剧疆鍐呭鐨勫搴︼紝浠ヨЕ鍙戞按骞虫粴鍔ㄦ潯 */
+  height: 420px;
+  /* 璁剧疆鍐呭鐨勯珮搴︼紝浠ヨЕ鍙戝瀭鐩存粴鍔ㄦ潯 */
+}
+.pag {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+}
+
+.pag1 {
+  width: 65%;
+}
+</style>

--
Gitblit v1.8.0