From a8c0679305c980a9878bc44a44408de9c00d3a64 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期四, 03 四月 2025 17:46:22 +0800
Subject: [PATCH] qx

---
 src/views/sampling/sampling/index.vue | 1047 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 556 insertions(+), 491 deletions(-)

diff --git a/src/views/sampling/sampling/index.vue b/src/views/sampling/sampling/index.vue
index 2894c72..a6c2af3 100644
--- a/src/views/sampling/sampling/index.vue
+++ b/src/views/sampling/sampling/index.vue
@@ -1,52 +1,30 @@
 <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="tjNum">
-        <el-input
-          ref="inputName"
-          v-model="queryParams.tjNum"
-          placeholder="璇疯緭鍏ヤ綋妫�鍙�"
-          clearable
-          @keyup.enter.native="handleQuery"
-          @blur="hb"
-          style="width: 170px"
-        />
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="浣撴鍙�" prop="tjNumber">
+        <el-input ref="inputName" v-model="queryParams.tjNumber" placeholder="璇疯緭鍏ヤ綋妫�鍙�" clearable
+          @keyup.enter.native="handleQuery" @blur="hb" style="width: 170px" />
       </el-form-item>
       <el-form-item label="濮撳悕" prop="name">
-        <el-input
-          v-model="queryParams.name"
-          placeholder="璇疯緭鍏ュ鍚�"
-          clearable
-          @keyup.enter.native="handleQuery"
-          style="width: 110px"
-        />
+        <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ュ鍚�" clearable @keyup.enter.native="handleQuery"
+          style="width: 110px" />
       </el-form-item>
       <el-form-item label="鐢宠鏃堕棿" prop="applicationTime">
-        <el-date-picker
-          v-model="createTimeList"
-          @change="dateChangebirthday1"
-          :default-time="['00:00:00', '23:00:00']"
-          format="yyyy-MM-dd HH:mm:ss"
-          value-format="yyyy-MM-dd HH:mm:ss"
-          type="daterange"
-          range-separator="-"
-          start-placeholder="寮�濮嬫棩鏈�"
-          end-placeholder="缁撴潫鏃ユ湡"
-          :picker-options="pickerOptions"
-        ></el-date-picker>
+        <el-date-picker v-model="createTimeList" @change="dateChangebirthday1" :default-time="['00:00:00', '23:00:00']"
+          format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-"
+          start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" :picker-options="pickerOptions"></el-date-picker>
+      </el-form-item>
+      <el-form-item label="鍗曚綅鍚嶇О" prop="compName" style="margin-left: 20px; margin-right: 500px">
+        <el-select :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId"
+          style="width: 200px" remote filterable placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" clearable @change="searchSelect">
+          <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict" />
+        </el-select>
       </el-form-item>
       <!-- <el-form-item label="鏄惁閲囨牱" prop="isSignFor">
-                    <el-select style="width:100px" v-model="queryParams.isSignFor" placeholder="鏄惁閲囨牱">
+                    <el-select1 style="width:100px" v-model="queryParams.isSignFor" placeholder="鏄惁閲囨牱">
                             <el-option v-for="dict in dict.type.sampling_type" :key="dict.value" :label="dict.label"
                                 :value="dict.value"></el-option>
-                        </el-select>
+                        </el-select1>
             </el-form-item> -->
       <!-- <el-form-item label="浣撴鏃堕棿" prop="tjTime">
                 <el-date-picker clearable v-model="queryParams.tjTime" type="date" value-format="yyyy-MM-dd"
@@ -60,13 +38,7 @@
                 <el-input v-model="queryParams.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable @keyup.enter.native="handleQuery" style="width: 140px;"/>
             </el-form-item> -->
       <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-          >鏌ヨ</el-button
-        >
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鏌ヨ</el-button>
         <!-- <el-button
           type="primary"
           icon="el-icon-thumb"
@@ -74,94 +46,45 @@
           @click="Confirmreceipt"
           >纭閲囨牱</el-button
         > -->
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >閲嶇疆</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="10">
-        <el-radio-group
-          v-model="tjStatus"
-          @input="radioChange"
-          style="margin: 10px 15px"
-        >
-          <el-radio-button label="1">鏈噰鏍�</el-radio-button>
-          <el-radio-button label="0">宸查噰鏍�</el-radio-button>
+        <el-radio-group v-model="tjStatus" @input="radioChange" style="margin: 10px 15px">
+          <el-radio-button label="1" :disabled="qiehuan && disabledId === 0">鏈噰鏍�</el-radio-button>
+          <el-radio-button label="0" :disabled="qiehuan && disabledId === 1">宸查噰鏍�</el-radio-button>
         </el-radio-group>
       </el-col>
-      <el-col
-        :span="12"
-        style="margin: 10px 15px"
-        v-if="samplingList.length > 0 && tjStatus == 1"
-      >
+      <el-col :span="12" style="margin: 10px 15px" v-if="samplingList.length > 0 && tjStatus == 1">
         <el-button type="primary" @click="Merging">鍚堝苟椤圭洰</el-button>
-        <el-button
+        <!-- <el-button
           type="primary"
           icon="el-icon-thumb"
           style="margin: 0 15px"
           v-hasPermi="['hosp:detail:add']"
           @click="Confirmreceipt"
           >纭閲囨牱</el-button
-        >
-        <el-button type="primary" :disabled="!disabled" @click="Cancellation"
-          >鎾ら攢鍚堝苟</el-button
-        >
-        <el-button
-          type="primary"
-          :disabled="!selectList.length"
-          @click="Collection"
-          >閲囨牱鎵撶爜</el-button
-        >
+        > -->
+        <el-button type="primary" :disabled="!disabled" @click="Cancellation">鎾ら攢鍚堝苟</el-button>
+        <el-button type="primary" @click="Confirmreceipt" :disabled="!selectList.length">閲囨牱鎵撶爜</el-button>
+        <el-button type="primary" @click="piliangPrint" :disabled="!isAllSelected">鎵归噺鎵撳嵃</el-button>
       </el-col>
-      <el-col
-        :span="12"
-        style="margin: 10px 15px"
-        v-show="samplingList.length > 0 && tjStatus == 0"
-      >
-        <el-button
-          type="primary"
-          :disabled="!selectList.length"
-          @click="Collection"
-          >琛ユ墦鏉$爜</el-button
-        >
-        <el-button type="primary" :disabled="!disabled" @click="Cancellation"
-          >鎾ら攢鍚堝苟</el-button
-        >
+      <el-col :span="12" style="margin: 10px 15px" v-show="samplingList.length > 0 && tjStatus == 0">
+        <el-button type="primary" :disabled="!selectList.length" @click="buda">琛ユ墦鏉$爜</el-button>
+        <!-- @click="Collection" -->
+        <el-button type="primary" :disabled="!disabled" @click="Cancellation">鎾ら攢鍚堝苟</el-button>
       </el-col>
     </el-row>
 
     <div style="width: 100%; margin-left: 10px; display: flex">
       <div style="width: 40%; margin-right: 20px">
-        <el-table
-          id="ta"
-          v-loading="loading1"
-          ref="tb"
-          :data="samplingList"
-          @selection-change="handleSelectionChange"
-          border
-          height="520px"
-          :row-class-name="tableRowClassName"
-        >
-          <el-table-column type="selection" width="40" align="center" />
-          <el-table-column
-            label="浣撴鍙�"
-            align="center"
-            prop="tjNumber"
-            width="160px"
-          />
-          <el-table-column
-            label="濮撳悕"
-            align="center"
-            prop="cusName"
-            width="80px"
-          />
-          <el-table-column
-            label="鎬у埆"
-            align="center"
-            prop="cusSex"
-            width="60px"
-          >
+        <el-table id="ta" v-loading="loading1" ref="tb" :data="samplingList" @selection-change="handleSelectionChange"
+          border height="520px" :row-class-name="tableRowClassName">
+          <el-table-column type="selection" width="40" align="center" :selectable="selectable" />
+          <el-table-column label="浣撴鍙�" align="center" prop="tjNumber" width="160px" />
+          <el-table-column label="濮撳悕" align="center" prop="cusName" width="80px" />
+          <el-table-column label="鎬у埆" align="center" prop="cusSex" width="60px">
             <!-- <template slot-scope="scope">
               {{ scope.row.customer.cusSex === 0 ? "鐢�" : "濂�" }}
             </template> -->
@@ -171,18 +94,9 @@
               <span v-if="scope.row.cusSex == '2'">鏈煡</span>
             </template>
           </el-table-column>
-          <el-table-column
-            label="鎵嬫満鍙�"
-            align="center"
-            prop="cusPhone"
-            width="120px"
-          />
-          <el-table-column
-            label="鐢宠鏃堕棿"
-            align="center"
-            prop="applicationTime"
-            width="210"
-          >
+          <el-table-column label="鎵嬫満鍙�" align="center" prop="cusPhone" width="120px" />
+          <el-table-column label="鍗曚綅鍚嶇О" align="center" prop="compName" width="120px" />
+          <el-table-column label="鐢宠鏃堕棿" align="center" prop="applicationTime" width="210">
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.applicationTime) }}</span>
             </template>
@@ -190,16 +104,9 @@
         </el-table>
       </div>
       <div style="width: 50%">
-        <el-table
-          v-loading="loading"
-          :data="tableList"
-          :span-method="objectSpanMethod"
-          @selection-change="handleChange"
-          border
-          height="520px"
-          ref="tab1"
-          :row-class-name="tableRowClassName"
-        >
+        <!-- v-if="this.rightTabShow" -->
+        <el-table :row-key="getRowKey" v-if="tableList.length > 0" v-loading="loading" :data="tableList" @selection-change="handleChange"
+          :span-method="objectSpanMethod" ref="tab1" :row-class-name="tableRowClassName" border height="520px">
           <el-table-column type="selection" width="40" align="center" />
           <!--  :selectable="selectEnable" -->
           <!-- <el-table-column label="鏄惁绛炬敹" align="center" prop="isSignFor" /> -->
@@ -208,20 +115,9 @@
                     <span>{{ parseTime(scope.row.tjTime, '{y}-{m}-{d}') }}</span>
                 </template>
             </el-table-column> -->
-          <el-table-column
-            label="鏍囨湰绫诲瀷"
-            align="center"
-            prop="specimenType"
-            width="120"
-          >
+          <el-table-column label="鏍囨湰绫诲瀷" align="center" prop="specimenType" width="120">
           </el-table-column>
-          <el-table-column
-            label="閲囨牱缂栧彿"
-            align="center"
-            prop="jyxh"
-            :show-overflow-tooltip="true"
-            width="120"
-          />
+          <el-table-column label="閲囨牱缂栧彿" align="center" prop="jyxh" :show-overflow-tooltip="true" width="120" />
           <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" />
           <!-- <el-table-column
             label="鎬у埆"
@@ -229,16 +125,9 @@
             prop="proSex"
             width="90"
           /> -->
-          <el-table-column
-            label="鏄惁鍚堝苟"
-            align="center"
-            prop="isMerge"
-            width="90"
-          >
+          <el-table-column label="鏄惁鍚堝苟" align="center" prop="isMerge" width="90">
             <template slot-scope="scope">
-              <span
-                :style="{ color: scope.row.isMerge === 0 ? '' : '#409EFF' }"
-              >
+              <span :style="{ color: scope.row.isMerge === 0 ? '' : '#409EFF' }">
                 {{ scope.row.isMerge === 0 ? "鏈悎骞�" : "宸插悎骞�" }}
               </span>
             </template>
@@ -274,7 +163,14 @@
         <!-- 鍔ㄦ�佺敓鎴愬涓潯褰㈢爜鐨勫鍣� -->
         <div v-for="(item, index) in selectList" :key="index">
           <svg :id="'barcode' + index"></svg>
-          <div class="name">{{ item.proName }}</div>
+          <div class="name">{{ getTruncatedName(item.proName).truncated }}</div>
+          <div class="name1">
+            {{ getTruncatedName(item.proName).remaining }}
+          </div>
+          <!-- <div class="name">{{ item.proName.slice(0, msg) }}</div>
+          <div class="name1">
+            {{ item.proName.slice(msg) }}
+          </div> -->
           <div class="last">
             <p>{{ item.cusName }}</p>
             <div>
@@ -284,7 +180,9 @@
           </div>
           <div class="tj">
             <span>浣撴涓績</span>
-            <span>{{ item.cardId.substring(0, 14) }}</span>
+            <!-- <span>{{ item.cardId.slice(0, 14) }}</span> -->
+            <!-- <span>{{ item.cardId }}</span> -->
+            <span>{{ item.cardId ? item.cardId.substring(0, 14) : "" }}</span>
           </div>
           <div class="tj">
             <span>{{ item.jyxh }}</span>
@@ -299,39 +197,15 @@
                 :limit.sync="queryParams.pageSize" @pagination="getList" />
         </div> -->
 
-    <div style="margin-right: 70%">
+    <div style="margin-right: 50%">
       <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
                 :page-sizes="pageSize" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="total">
             </el-pagination> -->
-      <pagination
-        v-show="total > 0"
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="getList"
-      />
+      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+        @pagination="getList" />
     </div>
 
-    <!-- 娣诲姞鎴栦慨鏀逛綋妫�閲囨牱绠$悊瀵硅瘽妗� -->
-    <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-            <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-                <el-form-item label="鐢宠鏃堕棿" prop="applicationTime">
-                    <el-date-picker clearable v-model="form.applicationTime" type="date" value-format="yyyy-MM-dd"
-                        placeholder="璇烽�夋嫨鐢宠鏃堕棿">
-                    </el-date-picker>
-                </el-form-item>
-                <el-form-item label="椤圭洰id鐖堕」" prop="proId">
-                    <el-input v-model="form.proId" placeholder="璇疯緭鍏ラ」鐩甶d鐖堕」" />
-                </el-form-item>
-                <el-form-item label="椤圭洰鍚嶇О" prop="proName">
-                    <el-input v-model="form.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
-                <el-button @click="cancel">鍙� 娑�</el-button>
-            </div>
-        </el-dialog> -->
+
   </div>
 </template>
 
@@ -347,11 +221,17 @@
   getCusCyList,
   mergeCaiYang,
   chexiaoCaiYang,
+  getTxmmccd,
+  getTxmkd,
 } from "@/api/sampling/sampling";
 import { getNewDateList } from "@/api/hosp/order";
 import moment from "moment";
-import ItemVue from "../../../layout/components/Sidebar/Item.vue";
-
+import {
+  SubmitCompany,
+  getCompany,
+  queryCompany,
+  addbatch,
+} from "@/api/team/tuanti";
 export default {
   dicts: [
     "sys_user_sex",
@@ -363,6 +243,14 @@
   name: "Sampling",
   data() {
     return {
+      CheckBox: {},
+
+      CompanyList: [],
+      piliangList: [],
+      msg: "",
+      getNumbr: null,
+      valueUrl: "ws://127.0.0.1/websocket",
+      webSocket: null,
       list: [],
       selectList: [],
       selectedRows: [],
@@ -374,6 +262,9 @@
       ids: [],
       // 缁戝畾鍗曢�夋寜閽�
       tjStatus: "1",
+      dayinData: [],
+      jsonObj: {},
+
       // 闈炲崟涓鐢�
       single: true,
       // 闈炲涓鐢�
@@ -398,7 +289,7 @@
         pageNum: 1,
         pageSize: 20,
         name: null,
-        tjNum: null,
+        tjNumber: null,
         applicationTime: null,
         isSignFor: null,
         tjTime: null,
@@ -442,11 +333,22 @@
       form: {},
       // 琛ㄥ崟鏍¢獙
       rules: {},
+      // rightTabShow: false
+      allSelected: false,
+      disableSelections: false, // 鎺у埗閫夋嫨绂佺敤鐘舵��
     };
   },
   created() {
     // this.getNowTime();
+    getTxmmccd().then((res) => {
+      this.msg = Number(res.msg);
+      console.log(res, 444);
+    });
+    getCompany(this.queryParams).then((response) => {
+      this.CompanyList = response.data;
 
+      this.loading = false;
+    });
     this.getdate();
   },
   mounted() {
@@ -461,8 +363,127 @@
         this.selectList[this.selectList.length - 1].isMerge === 1
       );
     },
+    qiehuan() {
+      return this.selectList.length > 0;
+    },
+    disabledId() {
+      return this.tjStatus == "1" ? 1 : 0;
+    },
+    isAllSelected() {
+      return this.samplingList.length > 0 && this.selectedRows.length === this.samplingList.length;
+    },
   },
+
   methods: {
+    // 閫夋鏁版嵁
+    searchSelect(val) {
+      this.CheckBox = val;
+      this.queryParams.dw = this.CheckBox.drugManufacturerId;
+      console.log(this.CheckBox, 9999);
+    },
+    getRemoteData(query) {
+      if (query) {
+        let compName = query;
+        queryCompany(compName).then((response) => {
+          this.CompanyList = response.data;
+          this.CompanyList.forEach((item) => {
+            this.queryParams = item;
+          });
+        });
+      }
+    },
+    async piliangPrint() {
+      // 妫�鏌ユ槸鍚︽湁閫変腑鐨勬暟鎹�
+      if (this.piliangList.length === 0) {
+        this.$message.warning('璇峰厛閫夋嫨瑕佹墦鍗扮殑鏁版嵁');
+        return;
+      }
+
+      const loadingInstance = this.$loading({
+        lock: true,
+        text: '鎵撳嵃涓�...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255, 255, 255, 0.7)'
+      });
+
+      try {
+        for (const item of this.piliangList) {
+          try {
+            // 鑾峰彇鏁版嵁锛屽苟绛夊緟鏁版嵁鏇存柊瀹屾垚
+            const tableList = await this.fetchData(item.tjNumber);
+
+            // 妫�鏌� tableList 鏄惁鏈夋暟鎹�
+            if (!tableList || tableList.length === 0) {
+              console.error(`浣撴鍙� ${item.tjNumber} 鏃犵浉鍏虫暟鎹甡);
+              continue;
+            }
+
+            // 鐩存帴浣跨敤鎵�鏈夋暟鎹�
+            this.selectList = tableList;
+
+            // 妫�鏌� selectList 鏄惁鏈夋暟鎹�
+            if (this.selectList.length === 0) {
+              console.error(`浣撴鍙� ${item.tjNumber} 鐨� selectList 涓虹┖锛岃烦杩� WebSocket 鎿嶄綔`);
+              continue;
+            }
+
+            // 浣跨敤鏇存柊鍚庣殑 tableList 鑾峰彇 ids
+            let ids = this.selectList.map(row => row.id);
+            if (ids.length === 0) {
+              console.error(`浣撴鍙� ${item.tjNumber} 鏃犳湁鏁� ID`);
+              continue;
+            }
+
+            // 纭閲囨牱
+            await this.Confirmreceipt1(ids);
+
+            // 绛夊緟涓�娈垫椂闂�
+            await new Promise(resolve => setTimeout(resolve, 5000));
+          } catch (error) {
+            console.error(`澶勭悊浣撴鍙� ${item.tjNumber} 鏃跺嚭閿�:`, error);
+          }
+        }
+      } finally {
+        this.ids = []; // 娓呯┖ ids
+        this.selectList = []; // 娓呯┖ selectList
+        loadingInstance.close();
+      }
+    },
+    getTruncatedName(proName) {
+      // 鍘绘帀鎵�鏈夌┖鏍�
+      const trimmedProName = proName.replace(/\s+/g, "");
+
+      const number = this.msg;
+
+      const truncated =
+        trimmedProName.length > number
+          ? trimmedProName.slice(0, number)
+          : trimmedProName;
+      let remaining =
+        trimmedProName.length > number ? trimmedProName.slice(number) : "";
+
+      if (remaining.length > number) {
+        remaining = remaining.slice(0, number) + "...";
+      }
+      return { truncated, remaining }; // 杩斿洖缁撴灉
+    },
+
+    /* getTruncatedName(proName) {
+      const trimmedProName = proName.replace(/\s+/g, ""); // 鍘绘帀鎵�鏈夌┖鏍�
+      const truncated =
+        trimmedProName.length > 35
+          ? trimmedProName.slice(0, 35)
+          : trimmedProName;
+      const remaining =
+        trimmedProName.length > 35 ? trimmedProName.slice(35) : "";
+      return { truncated, remaining };
+    }, */
+
+    // 绀轰緥鐨勬棩鏈熸牸寮忓寲鏂规硶
+    formatDate(date) {
+      const options = { year: "numeric", month: "2-digit", day: "2-digit" };
+      return new Date(date).toLocaleDateString(undefined, options);
+    },
     getdate() {
       getNewDateList().then((res) => {
         this.createTimeList = [
@@ -511,72 +532,42 @@
       return ""; // 濡傛灉 applicationTime 鏃犳晥锛岃繑鍥炵┖瀛楃涓�
     },
     /** 鏌ヨ浣撴閲囨牱绠$悊鍒楄〃 */
-    getList() {
-      this.loading1 = true;
-      this.queryParams.isSignFor = this.tjStatus;
+    /** 鏌ヨ浣撴閲囨牱绠$悊鍒楄〃 */
+getList() {
+  this.queryParams.compId = this.CheckBox.drugManufacturerId;
+  this.loading1 = true;
+  this.queryParams.isSignFor = this.tjStatus;
 
-      if (this.createTimeList) {
-        this.queryParams.beginTime = this.createTimeList[0];
-        this.queryParams.endTime = this.createTimeList[1];
-      } else if (this.createTimeList == null) {
-        this.queryParams.beginTime = null;
-        this.queryParams.endTime = null;
+  if (this.createTimeList) {
+    this.queryParams.beginTime = this.createTimeList[0];
+    this.queryParams.endTime = this.createTimeList[1];
+  } else {
+    this.queryParams.beginTime = null;
+    this.queryParams.endTime = null;
+  }
+
+  getList(this.queryParams).then((response) => {
+    this.loading1 = false;
+    if (response.data && response.data.list && response.data.list.length > 0) {
+      this.samplingList = response.data.list;
+      this.total = response.data.total;
+      // 绉婚櫎榛樿閫変腑绗竴琛岀殑閫昏緫
+      // this.$nextTick(() => {
+      //   this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 榛樿閫変腑绗竴琛�
+      //   this.fetchData(this.samplingList[0].tjNumber); // 鍒锋柊鍙充晶琛ㄦ牸
+      // });
+    } else {
+      this.samplingList = [];
+      this.tableList = [];
+      this.selectList = []; // 娓呯┖ selectList
+      this.ids = []; // 娓呯┖ ids
+      if (this.$refs.tab1) {
+        this.$refs.tab1.clearSelection(); // 娓呯┖鍙充晶琛ㄦ牸閫変腑鐘舵��
       }
-      getList(this.queryParams).then((response) => {
-        this.loading1 = false;
-        if (response.data) {
-          if (!response.data.list || response.data.list.length === 0) {
-            this.samplingList = [];
-            this.tableList = [];
-            this.loading1 = false;
-            this.loading = false;
-            return;
-          } else {
-            this.samplingList = response.data.list;
-            console.log(this.samplingList, 888);
-            // 鍒ゆ柇鏄惁闇�瑕佸埛鏂板彸杈硅〃鏍�
-            this.$nextTick(() => {
-              this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
-              this.fetchData(this.samplingList[0].cusId);
-            });
-          }
-          this.total = response.data.total;
-          this.loading1 = false;
-        } else {
-          this.samplingList = [];
-          this.tableList = [];
-          this.loading1 = false;
-        }
-      });
-
-      /* getList(this.queryParams).then((response) => {
-        if (response.data) {
-          if (response.data.list == null) {
-            this.samplingList = [];
-            this.tableList = [];
-            this.loading = false;
-          } else {
-            this.samplingList = response.data.list;
-            console.log(this.samplingList,888);
-            
-            this.loading = false;
-            if (this.samplingList.length != 0) {
-              this.$nextTick(() => {
-                this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
-              });
-            } else {
-              this.$refs.tb.clearSelection();
-            }
-          }
-          this.total = response.data.total;
-          this.loading = false;
-        } else {
-          this.samplingList = [];
-          this.tableList = [];
-          this.loading = false;
-        }
-      }); */
-    },
+    }
+    this.loading1 = false;
+  });
+},
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
@@ -587,7 +578,7 @@
       this.form = {
         id: null,
         samplingNumber: null,
-        cusId: null,
+        tjNumber: null,
         applicationTime: null,
         isSignFor: null,
         tjTime: null,
@@ -600,11 +591,9 @@
         updateTime: null,
         deleted: null,
       };
-      this.resetForm("form");
     },
     hb() {
-      // console.log(this.queryParams.tjNum);
-      if (this.queryParams.tjNum != null) {
+      if (this.queryParams.tjNumber != null) {
         this.handleQuery();
       }
     },
@@ -615,111 +604,102 @@
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
-      this.createTimeList = [];
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 鍗曢�夋閫変腑鏁版嵁
-    /* handleSelectionChange(selection) {
-      this.selectList = selection;
-      selection.forEach((element) => {
-        this.tableList = element.list;
-        console.log(this.tableList, 111);
-
-        if (this.tableList.length != 0) {
-          this.$nextTick(() => {
-            this.$refs.tab1.toggleAllSelection(this.tableList, true);
-          });
-        } else {
-          this.$refs.tab1.clearSelection();
-        }
-      });
-      // this.ids = selection.map(item => item.id)
-      if (selection.length > 1) {
-        let del_row = selection.shift();
-        this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
+      this.createTimeList = []; // 娓呯┖鏃ユ湡鑼冨洿
+      this.queryParams.tjNumber = null; // 娓呯┖浣撴鍙�
+      this.queryParams.name = null; // 娓呯┖濮撳悕
+      this.queryParams.tjCompName = null; // 娓呯┖鍗曚綅鍚嶇О
+      this.selectList = []; // 娓呯┖鍙充晶閫変腑椤�
+      this.selectedRows = []; // 娓呯┖宸︿晶閫変腑椤�
+      this.tableList = []; // 娓呯┖鍙充晶琛ㄦ牸鏁版嵁
+      this.ids = []; // 娓呯┖閫変腑鐨� ID
+      this.$refs.tb.clearSelection(); // 娓呯┖宸︿晶琛ㄦ牸閫変腑鐘舵��
+      if (this.$refs.tab1) {
+        this.$refs.tab1.clearSelection(); // 娓呯┖鍙充晶琛ㄦ牸閫変腑鐘舵��
       }
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
-    }, */
+      this.handleQuery(); // 閲嶆柊鏌ヨ
+    },
 
     handleSelectionChange(selection) {
-      // 娓呯┖鍙充晶琛ㄦ牸鐨勬暟鎹�
-      this.tableList = [];
+      this.piliangList = selection;
+      const selectedCount = selection.length;
+      const totalCount = this.samplingList.length;
 
-      // 鍙湁涓�涓汉琚�変腑鏃惰繘琛屾搷浣�
-      if (selection.length === 1) {
-        const selectedPerson = selection[0]; // 鑾峰彇閫変腑鐨勯偅涓汉
-        const cusId = selectedPerson.cusId; // 鍋囪cusId鍦ㄩ�変腑鐨勫璞′腑
-
-        this.fetchData(cusId);
+      // 濡傛灉鍙湁涓�鏉℃暟鎹紝涓嶈绂佺敤閫夋嫨锛屽苟灞曠ず鍙充晶鍒楄〃
+      if (selectedCount === 1) {
+        this.disableSelections = false;
+        const selectedPerson = selection[0];
+        const tjNumber = selectedPerson.tjNumber;
+        console.log(`閫変腑鐨勪綋妫�鍙�: ${tjNumber}`);
+        this.fetchData(tjNumber);
+      } else if (selectedCount === totalCount && selectedCount > 1) {
+        // 鍏ㄩ�夋椂绂佺敤閫夋嫨鏂拌
+        this.disableSelections = true;
+        this.tableList = [];
+        this.$message.info('宸插叏閫夋墍鏈夎');
       } else {
-        // 濡傛灉閫変腑澶氫汉锛屽垯鍙栨秷閫変腑
-        if (selection.length > 1) {
+        // 闈炲叏閫夋椂鍚敤閫夋嫨
+        this.disableSelections = false;
+        if (selectedCount > 1) {
+          // 淇濈暀鍗曢�夊姛鑳斤紝鍙栨秷澶氶��
           let del_row = selection.shift();
-          this.$refs.tb.toggleRowSelection(del_row, false); // 璁剧疆杩欎竴琛屽彇娑堥�変腑
+          this.$refs.tb.toggleRowSelection(del_row, false);
         }
       }
 
-      // 鏇存柊閫夋嫨鐘舵��
-      this.single = selection.length === 1;
-      this.multiple = selection.length === 0;
+      if (selectedCount === 0) {
+        this.tableList = [];
+      }
 
+      // 鏇存柊鍗曢�夊拰澶氶�夌姸鎬�
+      this.single = selectedCount === 1;
+      this.multiple = selectedCount === 0;
+
+      // 鏇存柊閫変腑鐨勮
       this.selectedRows = selection;
+
+      // 璋冭瘯鏃ュ織
+      console.log(`褰撳墠閫変腑鏁伴噺: ${selectedCount}`);
+      console.log(`鏄惁绂佺敤閫夋嫨: ${this.disableSelections}`);
     },
 
-    fetchData(cusId) {
-      this.loading = true; // 鏄剧ず鍔犺浇鐘舵��
-
-      console.log(this.tjStatus, 999);
-
-      getCusCyList(cusId, this.tjStatus) // 璋冪敤API鑾峰彇鏁版嵁
-        .then((response) => {
-          if (response.data) {
-            this.tableList = response.data; // 纭 list 瀛樺湪鍚庡啀杩涜璧嬪��
-            console.log(this.tableList, 123);
-          } else {
-            // 濡傛灉娌℃湁鏁版嵁鎴� list 涓虹┖锛屾竻绌鸿〃鏍煎苟鎻愮ず
-            this.tableList = [];
-          }
-        })
-        .catch((error) => {
-          console.error("Error fetching data:", error);
-        })
-        .finally(() => {
-          this.loading = false; // 闅愯棌鍔犺浇鐘舵��
-        });
+    getRowKey(row) {
+      return row.id; // 蹇呴』鍞竴涓旂ǔ瀹�
     },
 
-    /* 鐐瑰嚮鍚堝苟鎸夐挳 */
-    /* Merging() {
-      // 妫�鏌ユ槸鍚﹂�変腑浜嗘暟鎹�
-      if (this.selectedRows.length === 0) {
-        this.$message.error("鑷冲皯閫変腑涓�涓汉");
-        return;
-      }
+    fetchData(tjNumber) {
+      return new Promise((resolve, reject) => {
+        this.loading = true;
+        getCusCyList(tjNumber, this.tjStatus)
+          .then((response) => {
+            if (response.data) {
+              this.tableList = response.data;
+              this.$nextTick(() => {
+                if (this.$refs.tab1) {
+                  this.$refs.tab1.doLayout(); // 淇敼涓烘纭殑 ref 鍚嶇О
+                  this.$refs.tab1.clearSelection(); // 娓呯┖閫変腑鐘舵��
+                }
+              });
+              resolve(this.tableList);
+            } else {
+              this.tableList = [];
+              this.selectList = [];
+              this.ids = [];
+              if (this.$refs.tab1) {
+                this.$refs.tab1.clearSelection();
+              }
+              resolve([]);
+            }
+          })
+          .catch((error) => {
+            console.error("Error fetching data:", error);
+            reject(error);
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      });
+    },
 
-      if (this.selectList.length === 0) {
-        this.$message.error("璇烽�夋嫨瑕佸悎骞堕」鐩�");
-        return;
-      }
-
-      // 鑾峰彇 tableList 绗竴琛岀殑 specimenTypeCode 浣滀负鍩哄噯
-      const baseSpecimenTypeCode = this.selectList[0].specimenTypeCode;
-
-      // 妫�鏌� specimenTypeCode 鏄惁涓�鑷�
-      const canMergeBySpecimenTypeCode = this.selectList.every(
-        (row) => row.specimenTypeCode === baseSpecimenTypeCode
-      );
-
-      // 鏍规嵁 canMergeBySpecimenTypeCode 鍒ゆ柇鏄惁鍚堝苟
-      if (canMergeBySpecimenTypeCode) {
-        this.$message.success("鍚堝苟鎴愬姛銆�");
-        console.log("鍚堝苟鐨勮:", this.selectedRows);
-      } else {
-        this.$message.error("椤圭洰鐨� 涓嶄竴鑷达紝鏃犳硶鍚堝苟锛�");
-      }
-    }, */
     /* 鐐瑰嚮鍚堝苟鎸夐挳 */
     Merging() {
       // 妫�鏌ユ槸鍚﹂�変腑浜嗘暟鎹�
@@ -745,9 +725,9 @@
 
           mergeCaiYang(data).then((response) => {
             this.$message.success("鍚堝苟鎴愬姛銆�");
-            console.log("鍚堝苟鐨勮:", this.selectedRows);
+            // console.log("鍚堝苟鐨勮:", this.selectedRows);
             // this.getList();
-            this.fetchData(this.selectedRows[0].cusId);
+            this.fetchData(this.selectedRows[0].tjNumber);
           });
         } else {
           this.$message.error("鏍囨湰绫诲瀷涓嶄竴鑷达紝鏃犳硶鍚堝苟锛�");
@@ -767,7 +747,7 @@
         return;
       }
 
-      console.log("鎾ら攢鐨勫凡鍚堝苟椤圭洰ID:", data);
+      // console.log("鎾ら攢鐨勫凡鍚堝苟椤圭洰ID:", data);
 
       // 璋冪敤鎾ら攢閲囨牱鐨勬帴鍙�
       chexiaoCaiYang(data)
@@ -776,7 +756,7 @@
             this.$message.success("鎾ら攢鎴愬姛锛�");
             // 鍒锋柊鏁版嵁鍒楄〃鎴栬繘琛屽叾浠栨搷浣�
             // this.getList();
-            this.fetchData(this.selectedRows[0].cusId);
+            this.fetchData(this.selectedRows[0].tjNumber);
           } else {
             this.$message.error(res.msg || "鎾ら攢澶辫触锛岃閲嶈瘯锛�");
           }
@@ -784,20 +764,17 @@
         .catch((error) => {
           this.$message.error("璇锋眰澶辫触锛岃閲嶈瘯锛�");
         });
-
-      // chexiaoCaiYang(data).then((res) => {});
     },
 
     /** 鐐瑰嚮琛ユ墦鏉$爜鎸夐挳 **/
-    Collection() {
+    async Collection() {
       const jyxh = this.selectList.map((item) => item.jyxh);
-      // const selectedData = this.selectList.map((item) => ({
-      //   jyxh: item.jyxh,
-      // }));
-      console.log(this.selectList, 999);
-      // console.log(selectedData, 888);
+      console.log("jyxh:", jyxh);
+      try {
+        // 璇锋眰鎺ュ彛骞惰幏鍙栧搴﹀��
+        const widthResponse = await getTxmkd();
+        const barcodeWidth = `${Number(widthResponse.msg)}%` || "70%"; // 鑾峰彇瀹藉害鍊硷紝榛樿浣跨敤 70%
 
-      this.$nextTick(() => {
         jyxh.forEach((number, index) => {
           const barcodeContent = number; // 纭繚 jyxh 鏄湁鏁堢殑
           if (barcodeContent && barcodeContent !== "鏈彁渚涗綋妫�鍙�") {
@@ -811,16 +788,15 @@
             console.log(`鏉″舰鐮佸唴瀹规棤鏁�: ${barcodeContent}`); // 璋冭瘯杈撳嚭
           }
         });
-      });
 
-      this.$nextTick(() => {
-        const barcodeElement = document.querySelector("#barcode");
-        // const barcodeElements = selectedData.map((_, index) =>
-        //   document.querySelector(`#barcode${index}`)
-        // );
+        // await this.$nextTick();
 
-        if (barcodeElement) {
-          barcodeElement.forEach((element) => {
+        const barcodeElements = jyxh.map((_, index) =>
+          document.querySelector(`#barcode${index}`)
+        );
+
+        if (barcodeElements) {
+          barcodeElements.forEach((element) => {
             if (element) {
               console.log(element.innerHTML); // 鎵撳嵃鏉″舰鐮佺殑鍐呭锛岀湅鐪嬫槸鍚︾敓鎴愭垚鍔�
             }
@@ -828,83 +804,98 @@
         } else {
           console.log("鏉″舰鐮佸厓绱犳湭鎵惧埌");
         }
+
         const newWindow = window.open("", "_blank", "width=800,height=600");
         const printContents = document.getElementById("printSection").innerHTML;
 
         console.log(printContents);
         newWindow.document.write(`
-       <html>
+      <html>
         <head>
           <title>Print Barcode</title>
           <style>
             @media print {
-             * {
-                 margin: 0;
-                 padding: 0; /* 閲嶇疆鎵�鏈夊厓绱犵殑 margin 鍜� padding */
-                 box-sizing: border-box; /* 浣垮唴杈硅窛鍜岃竟妗嗗寘鍚湪鍏冪礌鐨勬�诲搴﹀拰楂樺害鍐� */
-               }
-               body {
-                  margin: 0;
-                  padding: 0;
-                }
-                .barcode-container {
-                  width: 100%; /* 鏍规嵁闇�瑕佽皟鏁� */
-                  text-align: center; /* 纭繚鏉″舰鐮佸眳涓� */
-                }
-                .name {
-                  padding: 0;
-                  margin: -5px auto 0;
-                  padding-left: 20px;
-                  font-size: 18px;
-                  width: 90%;
-                  display: -webkit-box;      
-                  -webkit-box-orient: vertical;  
-                  -webkit-line-clamp: 2;  
-                  overflow: hidden;           
-                  white-space: normal;       
-                }
+              * {
+                margin: 0;
+                padding: 0; /* 閲嶇疆鎵�鏈夊厓绱犵殑 margin 鍜� padding */
+                box-sizing: border-box; /* 浣垮唴杈硅窛鍜岃竟妗嗗寘鍚湪鍏冪礌鐨勬�诲搴﹀拰楂樺害鍐� */
+              }
+              .name, .name1, .last, .tj, .last div span, .last p, .tj span {
+                font-family: Arial, sans-serif !important; /* 閲嶆柊鎸囧畾瀛椾綋 */
+                font-weight: bold !important; /* 寮哄埗鍔犵矖 */
+              }
+              body {
+                margin: 0;
+                padding: 0;
+              }
+              .barcode-container {
+                // width: 100%; /* 鏍规嵁闇�瑕佽皟鏁� */
+                // text-align: center; /* 纭繚鏉″舰鐮佸眳涓� */
+              }
+              .name, .name1 {
+                padding: 0;
+                font-size: 18px;
+                width: 70%;
+                font-family: "Arial Black", sans-serif; /* 璁剧疆榛戜綋 */
+              }
+              p {
+                margin: 0;
+                padding: 0;
+              }
+              svg {
+                display: block;
+                width: ${barcodeWidth}; /* 浣跨敤浠庢帴鍙h幏鍙栫殑瀹藉害 */
+                margin-left: 10mm;
+                height: auto;
+                margin-bottom: 0;
+              }
+              .last {
+                width: 66%;
+                display: flex;
+                font-size: 19px;
+                justify-content: space-between;
+                // font-weight: bold;
+                // font-family: "Arial Black", sans-serif !important; 
+              }
+              .last div span {
+              // font-weight: bold;
+                margin-left: 10px;
+                // font-family: "Arial Black", sans-serif !important;
+              }
+              .last p {
+              // font-weight: bold;
+                margin-left: 1px; 
+                // font-family: "Arial Black", sans-serif !important; 
+              }
                 p {
-                  margin: 0;
-                  padding: 0;
-                }
-                svg {
-                  display: block;
-                  width: 70%;
-                  margin: 0 auto;
-                  height: auto;
-                  margin-bottom: 0;
-                }
-                .last {
-                  width: 66%;
-                  display: flex;
-                  font-size: 19px;
-                  margin-left: 20px;
-                  justify-content: space-between;
-                }
-                  .last div span{
-                  margin-left: 10px
-                  }
-                .tj{
-                  width: 70%;
-                  display: flex;
-                  font-size: 19px;
-                  margin-left: 10px;
-                  justify-content: space-between;
-                }
-                .tj span{
-                  margin-left:10px;
-                }
+                margin-left: 1px; 
+                // font-weight: bold;
+                // font-family: "Arial Black", sans-serif !important;  
+              }
+              .tj {
+                width: 70%;
+                display: flex;
+                font-size: 19px;
+                justify-content: space-between;
+                // font-weight: bold;
+                 font-family: "Arial Black", sans-serif !important; 
+              }
+              .tj span {
+                margin-left: 1px;
+              }
             }
           </style>
         </head>
         <body>${printContents}</body>
       </html>
-      `);
+    `);
         newWindow.document.close();
         newWindow.focus();
         newWindow.print();
         newWindow.close();
-      });
+      } catch (error) {
+        console.error("鑾峰彇瀹藉害鏃跺嚭閿�:", error); // 鎹曡幏閿欒
+      }
     },
 
     tableRowClassName({ row, rowIndex }) {
@@ -916,69 +907,131 @@
     },
 
     handleChange(selection) {
-      console.log(selection);
- 
       this.selectList = selection;
-
-      this.ids = selection.map((item) => item.id);
+      var array = selection;
+      this.ids = array.map((item) => item.id);
     },
+    buda() {
+      var websocket = null;
+      var url = this.valueUrl;
+      if ("WebSocket" in window) {
+        websocket = new WebSocket(url);
+      } else if ("MozWebSocket" in window) {
+        websocket = new MozWebSocket(url);
+      }
+      if (websocket == null) {
+        alert("鍒涘缓WebSocket瀵硅薄澶辫触");
+      }
+      websocket.onerror = function () {
+        alert("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父");
+      };
+      websocket.onopen = () => {
+        this.websocket = websocket;
+        console.log(this.selectList, "this.selectList")
+        this.dayinData = this.selectList.map((item) => ({
+          jyxh: item.jyxh,
+          proName: item.proName,
+          cusName: item.cusName,
+          cusSex: item.customer.cusSex,
+          age: item.customer.age,
+          cardId: item.cardId,
+          tjTime: item.createTime,
+        }));
 
-    // 绂侀��
-    // selectEnable(row, rowIndex) {
-    //     if(row.isSignFor === "0"){
-    //         return false
-    //     }else{
-    //         return true
-    //     }
-    // },
 
-    // 纭畾鎸夐挳
-    submitForm() {},
+        // 杩炴帴璁惧
+        this.jsonObj = {
+          type: "3",
+          array: {
+            data: this.dayinData,
+          },
+        };
+        var jStr = JSON.stringify(this.jsonObj);
+        console.log(jStr, "jStr");
 
+        this.websocket.send(jStr);
+        this.$refs.tab1.clearSelection(); // 娓呴櫎鍙充晶琛ㄦ牸鐨勯�変腑鐘舵��
+        this.selectList = []; // 娓呯┖ selectList
+        this.ids = []; // 娓呯┖ ids
+        this.jsonObj = {};
+        // this.dialogVisible = false;
+      };
+      // this.getList();
+    },
     // 纭閲囨牱
     Confirmreceipt() {
-      let data = this.ids;
-      if (data.length === 0) {
-        // 濡傛灉娌℃湁宸插悎骞剁殑椤圭洰锛岀粰鍑烘彁绀轰俊鎭�
-        this.$message.error("娌℃湁宸插悎骞剁殑椤圭洰鍙互鎾ら攢锛�");
-        return;
-      }
-      confirmSampling(data).then((res) => {
-        this.$modal.msgSuccess("閲囨牱鎴愬姛");
-        this.getList();
+      const loadingInstance = this.$loading({
+        lock: true,
+        text: "鍔犺浇涓�...",
+        spinner: "el-icon-loading",
+        background: "rgba(255, 255, 255, 0.7)",
       });
-    },
+      confirmSampling(this.ids)
+        .then((res) => {
+          if (res.code === 200) {
+            this.buda(); // 鎵撳嵃鏉$爜
 
-    // 鍗曢�夋寜閽�
-    radioChange(value) {
-      this.loading = true;
-      this.queryParams.isSignFor = value;
-      getList(this.queryParams).then((response) => {
-        if (response.data) {
-          if (response.data.list == null) {
-            this.samplingList = [];
-            this.tableList = [];
-            this.loading = false;
+            this.getList(); // 鍒锋柊宸︿晶琛ㄦ牸
+            console.log("閲囨牱鍚� - selectList:", this.selectList, "qiehuan:", this.qiehuan);
           } else {
-            this.samplingList = response.data.list;
-            this.loading = false;
-            if (this.samplingList.length != 0) {
-              this.$nextTick(() => {
-                this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
-              });
-            } else {
-              this.$refs.tb.clearSelection();
-            }
+            this.$message.error(res.msg);
           }
-          this.total = response.data.total;
-          this.loading = false;
-        } else {
-          this.samplingList = [];
-          this.tableList = [];
-          this.loading = false;
-        }
-      });
+        })
+        .catch((error) => {
+          console.error("閲囨牱澶辫触:", error);
+        })
+        .finally(() => {
+          loadingInstance.close();
+        });
     },
+    Confirmreceipt1(ids) {
+      confirmSampling(ids)
+        .then((res) => {
+          if (res.code === 200) {
+            this.buda();
+            this.getList();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+        .catch((error) => {
+        })
+        .finally(() => {
+          loadingInstance.close();
+        });
+    },
+    // 鍗曢�夋寜閽�
+   // 鍗曢�夋寜閽�
+radioChange(value) {
+  this.loading = true;
+  this.queryParams.isSignFor = value;
+  getList(this.queryParams).then((response) => {
+    if (response.data) {
+      if (response.data.list == null) {
+        this.samplingList = [];
+        this.tableList = [];
+        this.loading = false;
+      } else {
+        this.samplingList = response.data.list;
+        this.loading = false;
+        // 绉婚櫎榛樿閫変腑绗竴琛岀殑閫昏緫
+        // if (this.samplingList.length != 0) {
+        //   this.$nextTick(() => {
+        //     this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
+        //   });
+        // } else {
+        //   this.$refs.tb.clearSelection();
+        // }
+      }
+      this.total = response.data.total;
+      this.loading = false;
+    } else {
+      this.samplingList = [];
+      this.tableList = [];
+      this.loading = false;
+    }
+  });
+},
 
     // 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 }
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@@ -1002,27 +1055,39 @@
     },
 
     // 瀵煎嚭
-    handleExport() {},
+    handleExport() { },
+
+    /** 鎺у埗琛屾槸鍚﹀彲閫� */
+    selectable(row, index) {
+      if (this.disableSelections) {
+        // 浠呭厑璁稿彇娑堝凡閫変腑鐨勮
+        return this.selectedRows.some(selectedRow => selectedRow.id === row.id);
+      }
+      return true; // 鍏佽閫夋嫨鎵�鏈夎
+    },
+
+    resetSelection() {
+      this.$refs.tb.clearSelection();
+      this.disableSelections = false;
+      this.selectedRows = [];
+      this.single = false;
+      this.multiple = true;
+      this.tableList = [];
+
+      // 璋冭瘯鏃ュ織
+      console.log(`閲嶇疆閫夋嫨锛屾槸鍚︾鐢ㄩ�夋嫨: ${this.disableSelections}`);
+    },
   },
 };
 </script>
 
 <style>
 #ta .el-table__header-wrapper .el-checkbox {
-  display: none;
+  /* display: none; */
 }
 
 .el-table .warning-row {
   background-color: #e5f3ff !important;
+  /* font-weight: bold; */
 }
-/* .last {
-  display: flex;
-  justify-content: space-around;
-  justify-content: space-evenly;
-  background-color:aqua
-} */
-/* .last p:nth-child(2) {
-  margin: 20px;
-  font-size: 16px;
-} */
 </style>

--
Gitblit v1.8.0