From 155a30a172e4cf04838dcf7c8bb73ce6b200e574 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期三, 26 三月 2025 14:52:54 +0800
Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region

---
 src/views/doctor/checkAll/index.vue |  227 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 189 insertions(+), 38 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index a67e45e..eac26ad 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -96,17 +96,14 @@
     </template>
 
     <!-- 鐐瑰嚮寮瑰嚭妗� -->
-    <el-drawer custom-class="tanchu"
-  :visible.sync="drawer"
-  :before-close="handleClose"
-  :with-header="false"
-  size="100%"
-  :show-close="true">
-  <div class="top">
-    <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;" cellspacing="4">
-      <caption style="background-color: #f8f8f9; font-size: 18px">
-        {{ tableAll.cusName }}鐨勪綋妫�璧勬枡
-      </caption>
+    <el-drawer custom-class="tanchu" :visible.sync="drawer" :before-close="handleClose" :with-header="false" size="100%"
+      :show-close="true">
+      <div class="top">
+        <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;"
+          cellspacing="4">
+          <caption style="background-color: #f8f8f9; font-size: 18px">
+            {{ tableAll.cusName }}鐨勪綋妫�璧勬枡
+          </caption>
           <tr style="
               border: 1px solid #dfe6ec;
               border-collapse: collapse;
@@ -743,10 +740,10 @@
         <!-- 鍔ㄦ�佸缓璁粍 -->
         <div v-for="(advice, index) in newItem.map" :key="index" class="advice-group">
           <el-form-item label="寤鸿鏍囬" :prop="'map.' + index + '.bt'">
-            <el-input v-model="advice.bt" placeholder="璇疯緭鍏ュ缓璁爣棰�" clearable></el-input>
+            <el-input v-model="advice.bt" placeholder="璇疯緭鍏ュ缓璁爣棰�" clearable @focus="tan"></el-input>
           </el-form-item>
           <el-form-item label="寤鸿鍐呭" :prop="'map.' + index + '.nr'">
-            <el-input v-model="advice.nr" type="textarea" rows="3" placeholder="璇疯緭鍏ュ缓璁唴瀹�" resize="none"></el-input>
+            <el-input v-model="advice.nr" type="textarea" rows="3" placeholder="璇疯緭鍏ュ缓璁唴瀹�" resize="none" @focus="tan"></el-input>
           </el-form-item>
           <el-button v-if="index > 0" type="danger" size="small" @click="removeAdvice(index)"
             style="margin-left: 100px; margin-bottom: 10px;">鍒犻櫎</el-button>
@@ -759,6 +756,36 @@
       <span slot="footer" class="dialog-footer">
         <el-button @click="addNewDialogVisible = false">鍙栨秷</el-button>
         <el-button type="primary" @click="submitNewItem">纭畾</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="蹇嵎寤鸿閫夋嫨" :visible.sync="showjianyi" width="1000px" class="custom-dialog">
+      <!-- 娣诲姞绛涢�変笅鎷夋 -->
+      <div style="margin-bottom: 15px;">
+        <el-form :inline="true">
+          <el-form-item label="绉戝">
+            <el-select v-model="queryParams1.ks" placeholder="璇烽�夋嫨鎴栬緭鍏ョ瀹�" clearable filterable allow-create
+              style="width: 200px" @change="filterAdvices(true)">
+              <el-option v-for="dept in deptList" :key="dept" :label="dept" :value="dept" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <el-table :data="advicerulesList" ref="adviceTable" border highlight-current-row
+        @current-change="handleCurrentChangeAdvice" style="max-height: 400px; overflow-y: auto;">
+        <el-table-column label="绉戝" prop="ks" width="100" align="center" />
+        <el-table-column label="寤鸿鍚嶇О" prop="jymc" align="center" />
+        <el-table-column label="寤鸿鍐呭" prop="jynr" align="center" />
+      </el-table>
+
+
+
+      <!-- 鍒嗛〉缁勪欢 -->
+      <pagination v-show="total1 > 0" :total="total1" :page.sync="queryParams1.pageNum"
+        :limit.sync="queryParams1.pageSize" @pagination="filterAdvices(false)" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showjianyi = false">鍙栨秷</el-button>
+        <el-button type="primary" @click="applySelectedAdvice" :disabled="!selectedAdvice">纭畾</el-button>
       </span>
     </el-dialog>
     <Packages ref="bbb" :baogao="baogao" />
@@ -807,7 +834,9 @@
 import { getconfigKey } from "@/api/login";
 import moment from "moment";
 import { get } from "sortablejs";
-
+import {
+  listAdvicerules,
+} from "@/api/hosp/advicerules";
 export default {
   components: {
     ViewPdf,
@@ -832,6 +861,11 @@
   name: "checkAll",
   data() {
     return {
+      deptList: [], // 鍘婚噸鍚庣殑绉戝鍒楄〃
+      selectedAdvice: null,
+      activeAdviceIndex: 0,
+      advicerulesList: [],
+      showjianyi: false,
       addNewDialogVisible: false,
       newItem: {
         parentName: '',   // 椤圭洰鍒嗙被锛屽搴旀ā鏉夸腑鐨� parentName
@@ -976,6 +1010,12 @@
         tjCategory: undefined,
         payType: undefined,
       },
+      total1: 0,
+      queryParams1: {
+        pageNum: 1,
+        pageSize: 10,
+        ks: ''
+      },
       status1: 0, // 0灞曠ず寮傚父1灞曠ず椤圭洰鎯呭喌
       viewportHeight: 0,
       expends: [],
@@ -996,6 +1036,76 @@
     });
   },
   methods: {
+    handleCurrentChangeAdvice(currentRow) {
+      this.selectedAdvice = currentRow; // 瀛樺偍閫変腑鐨勫缓璁」
+    },
+    applySelectedAdvice() {
+      if (this.selectedAdvice) {
+        this.$set(this.newItem.map, this.activeAdviceIndex, {
+          bt: this.selectedAdvice.jymc, // 寤鸿鍚嶇О璧嬪�肩粰鏍囬
+          nr: this.selectedAdvice.jynr  // 寤鸿鍐呭璧嬪�肩粰鍐呭
+        });
+        this.showjianyi = false; // 鍏抽棴寮圭獥
+        this.selectedAdvice = null; // 娓呯┖閫変腑椤�
+      } else {
+        this.$message.warning('璇峰厛閫夋嫨涓�鏉″缓璁�');
+      }
+    },
+    handleSelectionChange(selection) {
+      console.log(selection);
+
+    },
+    tan(event) {
+      this.activeAdviceIndex = event.target.closest('.advice-group')
+        ? Array.from(event.target.closest('.el-form').querySelectorAll('.advice-group'))
+          .indexOf(event.target.closest('.advice-group'))
+        : 0; // 鑾峰彇褰撳墠寤鸿缁勭殑绱㈠紩
+
+      // 纭繚 projectCategories 宸插姞杞�
+      if (!this.projectCategories || this.projectCategories.length === 0) {
+        cSWebGetPro(this.tjNumber).then((res) => {
+          if (res.data && Array.isArray(res.data)) {
+            this.projectCategories = res.data;
+            // 鎻愬彇鍘婚噸鍚庣殑绉戝鍒楄〃
+            this.deptList = [...new Set(this.projectCategories.map(item => item.deptName))].filter(Boolean);
+          } else {
+            this.$message.warning('鏈幏鍙栧埌椤圭洰鍒嗙被鏁版嵁');
+            this.projectCategories = [];
+            this.deptList = [];
+          }
+        }).catch((error) => {
+          console.error('鑾峰彇椤圭洰鍒嗙被澶辫触:', error);
+          this.$message.error('鑾峰彇椤圭洰鍒嗙被澶辫触');
+          this.projectCategories = [];
+          this.deptList = [];
+        });
+      } else {
+        // 濡傛灉 projectCategories 宸插姞杞斤紝鐩存帴鏇存柊 deptList
+        this.deptList = [...new Set(this.projectCategories.map(item => item.deptName))].filter(Boolean);
+      }
+
+      // 閲嶇疆鍒嗛〉鍙傛暟
+      this.queryParams1.pageNum = 1;
+      this.queryParams1.pageSize = 10;
+
+      // 鍔犺浇蹇嵎寤鸿鍒楄〃
+      this.filterAdvices();
+      this.showjianyi = true;
+    },
+
+    // 涓嬫媺妗嗙瓫閫夊揩鎹峰缓璁紙鍖呭惈鍒嗛〉閫昏緫锛�
+    filterAdvices(resetPage = false) {
+      if (resetPage) {
+        this.queryParams1.pageNum = 1; // 鍒囨崲绉戝鏃堕噸缃〉鐮佷负 1
+      }
+      listAdvicerules(this.queryParams1).then((response) => {
+        this.advicerulesList = response.rows;
+        this.total1 = response.total;
+      }).catch((error) => {
+        console.error('绛涢�夊揩鎹峰缓璁け璐�:', error);
+        this.$message.error('绛涢�夊揩鎹峰缓璁け璐�');
+      });
+    },
     submitNewItem() {
       const data = {
         tjh: this.tableAll.tjNumber, // 浣撴鍙凤紝浠� tableAll 涓幏鍙�
@@ -1049,6 +1159,10 @@
     },
 
     handleCategoryChange(value) {
+
+      const selectedCategory = this.projectCategories.find(item => item.proName === value);
+      console.log(this.projectCategories, selectedCategory);
+      this.queryParams1.ks = selectedCategory.deptName || '';
       if (value) {
         this.newItem.jcxm = value; // 灏嗛�夋嫨鐨勯」鐩垎绫昏祴鍊肩粰妫�娴嬮」鐩�
       }
@@ -1076,34 +1190,42 @@
       shanchu({
         id: row.orderDetailId,
       }).then((res) => {
-        console.log(res);
-        // 鎵惧埌瑕佸垹闄ら」鎵�鍦ㄧ殑鐖剁骇鏁扮粍
-        const parentItem = this.yichangList.find(item =>
-          item.sone.some(soneItem => soneItem.proId === row.proId)
-        );
+        if (res.code === 200) {  // 娣诲姞鎴愬姛鍝嶅簲妫�鏌�
+          // 鎵惧埌瑕佸垹闄ら」鎵�鍦ㄧ殑鐖剁骇鏁扮粍
+          const parentItem = this.yichangList.find(item =>
+            item.sone.some(soneItem => soneItem.proId === row.proId)
+          );
 
-        if (parentItem) {
-          // 浠庣埗绾х殑 sone 鏁扮粍涓垹闄よ椤�
-          const index = parentItem.sone.findIndex(item => item.proId === row.proId);
-          if (index > -1) {
-            parentItem.sone.splice(index, 1);
+          if (parentItem) {
+            // 浠庣埗绾х殑 sone 鏁扮粍涓垹闄よ椤�
+            const index = parentItem.sone.findIndex(item => item.proId === row.proId);
+            if (index > -1) {
+              parentItem.sone.splice(index, 1);
 
-            // 濡傛灉鍒犻櫎鍚� sone 鏁扮粍涓虹┖,鍒欏垹闄ゆ暣涓埗绾ч」
-            if (parentItem.sone.length === 0) {
-              const parentIndex = this.yichangList.indexOf(parentItem);
-              if (parentIndex > -1) {
-                this.yichangList.splice(parentIndex, 1);
+              // 濡傛灉鍒犻櫎鍚� sone 鏁扮粍涓虹┖锛屽垯鍒犻櫎鏁翠釜鐖剁骇椤�
+              if (parentItem.sone.length === 0) {
+                const parentIndex = this.yichangList.indexOf(parentItem);
+                if (parentIndex > -1) {
+                  this.yichangList.splice(parentIndex, 1);
+                }
               }
+
+              // 鏇存柊 expends 鏁扮粍
+              this.getExpends();
+
+              this.$message.success('鍒犻櫎鎴愬姛');
+
+              // 鑷姩鏇存柊寮傚父缁撴灉鏁版嵁
+              this.yichangjieguo();
             }
-
-            // 鏇存柊 expends 鏁扮粍
-            this.getExpends();
-
-            this.$message.success('鍒犻櫎鎴愬姛');
           }
+        } else {
+          this.$message.error('鍒犻櫎澶辫触');
         }
-      })
-
+      }).catch((error) => {
+        console.error('鍒犻櫎澶辫触:', error);
+        this.$message.error('鍒犻櫎鎿嶄綔澶辫触');
+      });
     },
     getConfigKey() {
       getconfigKey("sfkqtwbg").then((res) => {
@@ -2287,10 +2409,20 @@
   width: 100%;
   display: flex;
   justify-content: center;
+  /* 纭繚鍒嗛〉鍣ㄦ暣浣撳眳涓� */
+  align-items: center;
+  /* 鍨傜洿灞呬腑 */
+  margin-top: 15px;
+  /* 涓庤〃鏍肩殑闂磋窛 */
 }
 
 .pag1 {
-  width: 30%;
+  width: auto;
+  /* 绉婚櫎鍥哄畾瀹藉害锛岃鍒嗛〉鍣ㄦ牴鎹唴瀹硅嚜閫傚簲 */
+  min-width: 300px;
+  /* 璁剧疆鏈�灏忓搴︼紝纭繚鍒嗛〉鍣ㄤ笉浼氬お绐� */
+  text-align: center;
+  /* 纭繚鍒嗛〉鍣ㄥ唴閮ㄥ厓绱犲眳涓� */
 }
 
 .dialog-footers {
@@ -2457,4 +2589,23 @@
     }
   }
 }
-</style>
+
+.dialog-pager {
+  display: flex;
+  justify-content: center;
+  /* 姘村钩灞呬腑 */
+  align-items: center;
+  /* 鍨傜洿灞呬腑 */
+  margin-top: 15px;
+  /* 涓庤〃鏍肩殑闂磋窛 */
+  padding: 0 20px;
+  /* 澧炲姞鍐呰竟璺濓紝閬垮厤杩囦簬璐磋竟 */
+  box-sizing: border-box;
+  /* 纭繚鍐呰竟璺濅笉褰卞搷瀹藉害 */
+}
+
+// .dialog-pager-inner {
+//   width: auto; /* 鑷�傚簲瀹藉害 */
+//   min-width: 300px; /* 璁剧疆鏈�灏忓搴︼紝纭繚鍒嗛〉鍣ㄤ笉浼氬お绐� */
+//   text-align: center; /* 纭繚鍒嗛〉鍣ㄥ唴閮ㄥ厓绱犲眳涓� */
+// }</style>

--
Gitblit v1.8.0