From d873c5ee1eb9218341b73c116c02a456d0f2973a Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期四, 12 六月 2025 16:52:12 +0800
Subject: [PATCH] qx

---
 src/views/system/comp/index.vue |  449 +++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 299 insertions(+), 150 deletions(-)

diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue
index a81a3a7..ce09f16 100644
--- a/src/views/system/comp/index.vue
+++ b/src/views/system/comp/index.vue
@@ -37,7 +37,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table border v-loading="loading" :data="compList" @selection-change="handleSelectionChange">
+    <el-table border v-loading="loading" :data="compList" @selection-change="handleSelectionChange" ref="tab">
       <el-table-column fixed="left" type="selection" width="40px" align="center" />
       <el-table-column label="搴忓彿" align="center" prop="newID" :show-overflow-tooltip="true" width="50px" fixed="left" />
       <el-table-column label="鍗曚綅鍚嶇О" align="center" prop="cnName" width="240px" />
@@ -128,6 +128,12 @@
                 <el-form-item label="绛剧害閲戦" prop="signingPrice">
                   <el-input v-model="form.signingPrice" placeholder="璇疯緭鍏ョ绾﹂噾棰�" />
                 </el-form-item>
+                 <el-form-item label="鐥呯" prop="bz" v-if="dwlxs == 1">
+                <el-select v-model="form.bz" placeholder="璇烽�夋嫨鐥呯" style="width: 130px" clearable>
+                  <el-option v-for="dict in dict.type.reservation_pay_type" :key="dict.value" :label="dict.label"
+                    :value="dict.value" />
+                </el-select>
+              </el-form-item>
               </el-form>
               <el-row :gutter="10" class="mb8">
                 <el-col :span="1.5">
@@ -140,7 +146,7 @@
                 </el-col>
               </el-row>
               <el-table ref="tb" v-loading="loading" :data="deptList" @selection-change="handleSelection" border
-                style="width: 320px" height="350">
+                style="width: 320px" height="300">
                 <el-table-column type="selection" width="40px" align="center" />
                 <el-table-column label="濂楅鍚嶇О" align="center" prop="dwDeptName" />
               </el-table>
@@ -179,6 +185,7 @@
                     :value="dict.value" />
                 </el-select>
               </el-form-item>
+             
               <el-form-item label="骞撮緞娈�">
                 <el-col :span="7">
                   <el-input v-model="forms.ltAge" style="width: 53px" />
@@ -188,10 +195,6 @@
                   <el-input v-model="forms.gtAge" style="width: 54px" />
                 </el-col>
               </el-form-item>
-
-
-
-
             </el-form>
 
             <el-row :gutter="10" class="mb8">
@@ -247,7 +250,6 @@
               </el-form-item>
               <el-form-item>
                 <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearch">鎼滅储</el-button>
-
               </el-form-item>
             </el-form>
             <el-table ref="tbone" border v-loading="loading" :data="newpacName" @selection-change="handleChangeOne"
@@ -289,10 +291,11 @@
                 </template>
               </el-table-column>
             </el-table>
-            <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{
-              OnenewpacName.length
-            }}</span>鏉�</div>
-
+            <div style="font-size: 16px; margin-top: 10px">
+              褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700">{{
+                OnenewpacName.length
+              }}</span>鏉�
+            </div>
           </el-col>
           <el-col :span="2" :xs="24">
             <div style="margin: 240% 16%">
@@ -327,8 +330,27 @@
 
     <div>
       <el-dialog :title="title" :visible.sync="openOne" width="1400px" append-to-body :close-on-click-modal="false">
+        <div class="info-header" style="
+            margin-bottom: 15px;
+            padding: 10px;
+            background-color: #f5f7fa;
+            border-radius: 4px;
+          ">
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <span>椤圭洰鍚嶇О锛歿{ forms.groupingName }}</span>
+            </el-col>
+            <el-col :span="8">
+              <span>鎬у埆锛歿{
+                forms.sex === "1" ? "濂�" : forms.sex === "0" ? "鐢�" : "鏈煡"
+              }}</span>
+            </el-col>
+            <el-col :span="8">
+              <span>骞撮緞鑼冨洿锛歿{ forms.ltAge }}-{{ forms.gtAge }}宀�</span>
+            </el-col>
+          </el-row>
+        </div>
         <el-row :gutter="24" v-if="!isTableVisible">
-
           <el-col :span="15" :xs="24">
             <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="46px"
               style="height: 50px" @submit.native.prevent>
@@ -346,11 +368,13 @@
               <el-form-item>
                 <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button>
               </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">閫夋嫨濂楅</el-button>
+              </el-form-item>
             </el-form>
             <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" height="478"
               :cell-style="{ padding: '5px 0' }">
               <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" width="410">
-
                 <template slot-scope="scope">
                   {{ scope.row.proName }}
                 </template>
@@ -372,10 +396,11 @@
                 </template>
               </el-table-column>
             </el-table>
-            <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{
-              OnenewpacName.length
-            }}</span>鏉�</div>
-
+            <div style="font-size: 16px; margin-top: 10px">
+              褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700">{{
+                OnenewpacName.length
+              }}</span>鏉�
+            </div>
           </el-col>
           <!-- <el-col :span="2" :xs="24">
             <div style="margin: 240% 16%" class="btntoleft">
@@ -390,9 +415,6 @@
           <el-col :span="7" :xs="24">
             <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch"
               label-width="68px" @submit.native.prevent>
-              <el-form-item>
-                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">閫夋嫨濂楅</el-button>
-              </el-form-item>
               <el-form-item label="椤圭洰鍚嶇О" prop="proName">
                 <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable
                   @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -404,12 +426,11 @@
             <el-table border v-loading="loading" ref="tre" :data="Treedata" @selection-change="handleChangesingle"
               height="478" style="width: 100%">
               <el-table-column type="selection" width="40px" align="center" />
-              <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" />
-              <el-table-column label="椤圭洰浠锋牸/鍏�" align="center" prop="proPrice" />
+              <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" width="230px" />
+              <el-table-column label="椤圭洰浠锋牸/鍏�" align="center" prop="proPrice" width="100px" />
             </el-table>
           </el-col>
         </el-row>
-        <!-- -=----------------------------------------------------- -->
         <el-row :gutter="24" v-else>
           <el-col :span="6" :xs="24">
             <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"
@@ -438,8 +459,11 @@
                 </template>
               </el-table-column>
             </el-table>
-            <div style="font-size: 16px;margin-top: 10px;">椤圭洰鎬绘潯鏁帮細<span style="font-weight: 700;margin-right: 5px;">{{
-              newpacName.length }}</span>鏉�</div>
+            <div style="font-size: 16px; margin-top: 10px">
+              椤圭洰鎬绘潯鏁帮細<span style="font-weight: 700; margin-right: 5px">{{
+                newpacName.length
+              }}</span>鏉�
+            </div>
           </el-col>
           <el-col :span="8" :xs="24">
             <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="46px"
@@ -450,11 +474,13 @@
               <el-form-item>
                 <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button>
               </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">閫夋嫨濂楅</el-button>
+              </el-form-item>
             </el-form>
             <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" height="478"
               :cell-style="{ padding: '5px 0' }">
               <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" width="170">
-
                 <template slot-scope="scope">
                   {{ scope.row.proName }}
                 </template>
@@ -467,10 +493,11 @@
                 </template>
               </el-table-column>
             </el-table>
-            <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{
-              OnenewpacName.length
-            }}</span>鏉�</div>
-
+            <div style="font-size: 16px; margin-top: 10px">
+              褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700">{{
+                OnenewpacName.length
+              }}</span>鏉�
+            </div>
           </el-col>
           <!-- <el-col :span="2" :xs="24">
             <div style="margin: 240% 16%">
@@ -482,9 +509,6 @@
           <el-col :span="8" :xs="24">
             <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch"
               label-width="68px" @submit.native.prevent>
-              <el-form-item>
-                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">閫夋嫨濂楅</el-button>
-              </el-form-item>
               <el-form-item label="椤圭洰鍚嶇О" prop="proName">
                 <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable
                   @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -508,8 +532,7 @@
       </el-dialog>
     </div>
 
-
-    <el-dialog title="閫夋嫨濂楅" :visible.sync="taocan" width="70%" height="700px" :close-on-click-modal="false">
+    <el-dialog  :visible.sync="taocan" width="70%" height="700px" :close-on-click-modal="false">
       <!-- <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" label-width="auto">
         <el-form-item label="濂楅鍚嶇О" prop="pacName">
           <el-input v-model="queryParam.pacName" placeholder="璇疯緭鍏ュ椁愬悕绉�" clearable @keyup.enter.native="handle"
@@ -519,6 +542,11 @@
           <el-button type="primary" icon="el-icon-search" size="mini" @click="handle">鎼滅储</el-button>
         </el-form-item>
       </el-form> -->
+
+       <el-radio-group v-model="tjStatus" @input="radioChange" style="margin-left: 10px;margin-bottom: 20px;">
+      <el-radio-button label="0">鍩虹濂楅</el-radio-button>
+      <el-radio-button label="1">鍗曚綅濂楅</el-radio-button>
+    </el-radio-group>
       <el-table v-loading="loading" element-loading-text="姝e湪鍔犺浇涓�..." element-loading-spinner="el-icon-loading" border
         :data="newpacName1" @selection-change="handleSelectionChange1" height="450px" ref="tb">
         <el-table-column type="selection" width="40px" align="center" label="閫夋嫨" />
@@ -534,13 +562,20 @@
 
     <!-- 娣诲姞鎴栦慨鏀逛綋妫�鍗曚綅淇℃伅缁存姢瀵硅瘽妗� -->
     <div class="dia">
-      <el-dialog :title="title" :visible.sync="open" width="1340px" append-to-body>
-        <el-form ref="form" :model="form" :rules="rules" label-width="106px" :inline="true" @submit.native.prevent>
+      <el-dialog :title="title" :visible.sync="open" width="1330px" append-to-body>
+        <el-form ref="form" :model="form" :rules="rules" label-width="98px" :inline="true" @submit.native.prevent>
+          <el-form-item label="鍗曚綅绫诲瀷" prop="dwlx">
+            <el-radio-group v-model="form.dwlx" @input="radioChange">
+              <el-radio :label="0">鏅�氬崟浣�</el-radio>
+              <el-radio :label="1">鑱屼笟鐥呭崟浣�</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <br />
           <el-form-item label="鍗曚綅鍚嶇О" prop="cnName">
-            <el-input v-model="form.cnName" placeholder="璇疯緭鍏ヤ腑鏂囧悕绉�" style="width: 520px" />
+            <el-input v-model="form.cnName" placeholder="璇疯緭鍏ヤ腑鏂囧悕绉�" style="width:510px" />
           </el-form-item>
           <el-form-item label="缁熶竴淇$敤浠g爜" prop="taxNumber">
-            <el-input v-model="form.taxNumber" placeholder="璇疯緭鍏ョ粺涓�淇$敤浠g爜" style="width: 520px" />
+            <el-input v-model="form.taxNumber" placeholder="璇疯緭鍏ョ粺涓�淇$敤浠g爜" style="width: 510px" />
           </el-form-item>
           <el-form-item label="娉曚汉浠h〃" prop="legalPerson">
             <el-input v-model="form.legalPerson" placeholder="璇疯緭鍏ユ硶浜�" />
@@ -560,16 +595,51 @@
         </el-form-item> -->
 
           <el-form-item label="娉ㄥ唽鍦板潃" prop="registerAddress">
-            <el-input v-model="form.registerAddress" placeholder="璇疯緭鍏ユ敞鍐屽湴鍧�" style="width: 1157px" />
+            <el-input v-model="form.registerAddress" placeholder="璇疯緭鍏ユ敞鍐屽湴鍧�" style="width: 1128px" />
           </el-form-item>
           <el-form-item label="閫氳鍦板潃" prop="mailingAddress">
-            <el-input v-model="form.mailingAddress" placeholder="璇疯緭鍏ラ�氳鍦板潃" style="width: 1157px" />
+            <el-input v-model="form.mailingAddress" placeholder="璇疯緭鍏ラ�氳鍦板潃" style="width: 1128px" />
           </el-form-item>
+          <el-form-item label="鎵�灞炲湴鍖�" prop="ssdq" v-if="form.dwlx == 1">
+            <el-input v-model="form.ssdq" placeholder="璇疯緭鍏ユ墍灞炲湴鍖�" />
+          </el-form-item>
+          <el-form-item label="闅跺睘鍏崇郴" prop="lsgx" v-if="form.dwlx == 1">
+            <!-- <el-input
+              v-model="form.industryType"
+              placeholder="璇疯緭鍏ラ毝灞炲叧绯�"
+            /> -->
+            <el-select filterable v-model="form.lsgx" placeholder="璇烽�夋嫨闅跺睘鍏崇郴" clearable style="width: 198px">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="dict.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="缁忔祹绫诲瀷" prop="jjlx" v-if="form.dwlx == 1">
+            <el-select filterable v-model="form.jjlx" placeholder="璇烽�夋嫨缁忔祹绫诲瀷" clearable style="width: 199px">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="dict.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="浼佷笟瑙勬ā" prop="qygm" v-if="form.dwlx == 1">
+            <el-input v-model="form.qygm" placeholder="璇疯緭鍏ヤ紒涓氳妯�" />
+          </el-form-item>
+          <el-form-item label="琛屼笟鍒嗙被" prop="hyfl" v-if="form.dwlx == 1">
+            <el-select filterable v-model="form.hyfl" placeholder="璇烽�夋嫨琛屼笟鍒嗙被" clearable style="width: 199px">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="dict.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="椋庨櫓璇勪及" prop="fxpg" v-if="form.dwlx == 1">
+            <el-select filterable v-model="form.fxpg" placeholder="璇烽�夋嫨椋庨櫓璇勪及" clearable style="width: 198px">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="dict.value" />
+            </el-select>
+          </el-form-item>
+          <br />
           <el-form-item label="寮�鎴烽摱琛�" prop="bankAccount">
-            <el-input v-model="form.bankAccount" placeholder="璇疯緭鍏ュ紑鎴烽摱琛�" style="width: 520px" />
+            <el-input v-model="form.bankAccount" placeholder="璇疯緭鍏ュ紑鎴烽摱琛�" style="width: 510px" />
           </el-form-item>
           <el-form-item label="閾惰璐︽埛" prop="countNum">
-            <el-input v-model="form.countNum" placeholder="璇疯緭鍏ラ摱琛岃处鎴�" style="width: 520px" />
+            <el-input v-model="form.countNum" placeholder="璇疯緭鍏ラ摱琛岃处鎴�" style="width: 510px" />
           </el-form-item>
           <el-form-item label="鑱旂郴閭" prop="email">
             <el-input v-model="form.email" placeholder="璇疯緭鍏ラ偖绠�" />
@@ -582,7 +652,10 @@
           </el-form-item>
 
           <el-form-item label="琛屾斂鍖哄垝鍚嶇О" prop="areaName">
-            <el-input v-model="form.areaName" placeholder="璇疯緭鍏ヨ鏀垮尯鍒掑悕绉�" />
+            <el-select filterable v-model="form.areaName" placeholder="璇烽�夋嫨琛屾斂鍖哄垝鍚嶇О" clearable style="width: 198px">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="dict.value" />
+            </el-select>
           </el-form-item>
 
           <el-form-item label="澶囨敞" prop="remark">
@@ -603,7 +676,7 @@
 </template>
 
 <script>
-import Big from 'big.js';
+import Big from "big.js";
 import {
   listComp,
   getComp,
@@ -620,7 +693,11 @@
   delegrouping,
   getDetails,
 } from "@/api/system/comp";
-import { deptTreeSelect, projectGetList, getconfigKey } from "@/api/system/tijian";
+import {
+  deptTreeSelect,
+  projectGetList,
+  getconfigKey,
+} from "@/api/system/tijian";
 import { getInfo } from "@/api/login";
 export default {
   name: "Comp",
@@ -629,6 +706,7 @@
     "dict_data_status",
     "sys_user_sex",
     "reservation_pay_type",
+    "sys_yes_no",
   ],
   data() {
     let checkPhoneNum = (rule, value, callback) => {
@@ -648,8 +726,8 @@
       id: "",
       // 閫変腑鏁扮粍
       ids: [],
-      newpacName1 : [],
-      taocan:false,
+      newpacName1: [],
+      taocan: false,
       // 鎺у埗鎬у埆閫夋嫨妗嗘槸鍚︾鐢�
       isSexDisabled: false,
       dwIds: [],
@@ -671,6 +749,7 @@
       multiple: true,
       // 鏄剧ず鎼滅储鏉′欢
       showSearch: true,
+      dwlxs: null,
       // 鎬绘潯鏁�
       total: 0,
       // 浣撴鍗曚綅淇℃伅缁存姢琛ㄦ牸鏁版嵁
@@ -696,13 +775,14 @@
         code: null,
         price: null,
         xianprice: null,
-        limits: null
+        limits: null,
       },
-
 
       id: "",
       // 琛ㄥ崟鍙傛暟
-      form: {},
+      form: {
+        isZybUnit: 0,
+      },
       lastXianPrice: 0,
       forms: {
         limits: 10,
@@ -713,8 +793,8 @@
         payType: "1",
         sex: "2",
       },
-      sfzs: '',
-      youhui: '',
+      sfzs: "",
+      youhui: "",
       // 琛ㄥ崟鏍¢獙
       rules: {
         cnName: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
@@ -725,7 +805,9 @@
           { required: true, validator: checkPhoneNum, trigger: "blur" },
         ],
         gtAge: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
-        limits: [{ required: false, validator: checkPhoneNum, trigger: "blur" }],
+        limits: [
+          { required: false, validator: checkPhoneNum, trigger: "blur" },
+        ],
         ltAge: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
         /*  pacName: [
           { required: true, validator: checkPhoneNum, trigger: "blur" },
@@ -775,9 +857,10 @@
   computed: {
     // 鏍规嵁 sfzs 瀛楁鐨勫�兼潵鎺у埗琛ㄦ牸鏄惁鏄剧ず
     isTableVisible() {
-      return this.sfzs === 'Y';
-    }
+      return this.sfzs === "Y";
+    },
   },
+
   created() {
     this.getList();
   },
@@ -787,9 +870,11 @@
       this.updateProPrice(row);
     },
     validateDiscount(row) {
-      if (this.queryParams.xianprice !== undefined &&
+      if (
+        this.queryParams.xianprice !== undefined &&
         !isNaN(this.queryParams.xianprice) &&
-        this.queryParams.xianprice !== this.lastXianPrice) {
+        this.queryParams.xianprice !== this.lastXianPrice
+      ) {
         // 鍙湁鍦ㄧ幇浠峰疄闄呯敱鐢ㄦ埛杈撳叆淇敼鏃舵墠鏇存柊
         this.updateProPrice1(row);
         this.lastXianPrice = this.queryParams.xianprice;
@@ -798,36 +883,53 @@
     updateProPrice(row) {
       const proPrice = new Big(row.proPrice);
       const limits = new Big(row.limits);
-      const result = proPrice.times(limits.div(10)).toNumber();  // ordPrice * (discount / 10)
+      const result = proPrice.times(limits.div(10)).toNumber(); // ordPrice * (discount / 10)
       row.ysPrice = result.toFixed(2);
       this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => {
-        return sum.plus(new Big(item.ysPrice || '0'));
+        return sum.plus(new Big(item.ysPrice || "0"));
       }, new Big(0)).toNumber();
-      this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10
+      this.youhui =
+        (Math.floor(
+          (this.queryParams.xianprice / this.queryParams.price) * 100
+        ) /
+          100) *
+        10;
     },
     updateProPrice1(row) {
       const proPrice = new Big(row.proPrice);
       const limits = new Big(row.limits);
-      const result = proPrice.times(limits.div(10)).toNumber();  // ordPrice * (discount / 10)
+      const result = proPrice.times(limits.div(10)).toNumber(); // ordPrice * (discount / 10)
       row.ysPrice = result.toFixed(2);
       const totalYsPrice = this.OnenewpacName.reduce((sum, item) => {
-        return sum.plus(new Big(item.ysPrice || '0'));
+        return sum.plus(new Big(item.ysPrice || "0"));
       }, new Big(0));
       const totalYsPriceNum = totalYsPrice.toNumber();
-      if (this.queryParams.xianprice !== undefined && !isNaN(this.queryParams.xianprice)) {
+      if (
+        this.queryParams.xianprice !== undefined &&
+        !isNaN(this.queryParams.xianprice)
+      ) {
         const xianPrice = new Big(this.queryParams.xianprice);
         const diff = xianPrice.minus(totalYsPriceNum);
         if (!diff.eq(0) && this.OnenewpacName.length > 0) {
           const lastItem = this.OnenewpacName[this.OnenewpacName.length - 1];
           const newYsPrice = new Big(lastItem.ysPrice).plus(diff).toNumber();
-          this.$set(this.OnenewpacName[this.OnenewpacName.length - 1], 'ysPrice', newYsPrice);
+          this.$set(
+            this.OnenewpacName[this.OnenewpacName.length - 1],
+            "ysPrice",
+            newYsPrice
+          );
         }
       }
 
       // Update youhui calculation
 
       if (this.queryParams.price !== 0 && this.queryParams.xianprice !== 0) {
-        this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10;
+        this.youhui =
+          (Math.floor(
+            (this.queryParams.xianprice / this.queryParams.price) * 100
+          ) /
+            100) *
+          10;
       } else {
         this.youhui = 10;
       }
@@ -841,7 +943,12 @@
     changeXianjia() {
       // 鍘熷鎶樻墸鐜囪绠�
       if (this.queryParams.price !== 0) {
-        this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10;
+        this.youhui =
+          (Math.floor(
+            (this.queryParams.xianprice / this.queryParams.price) * 100
+          ) /
+            100) *
+          10;
       }
     },
 
@@ -874,7 +981,7 @@
     cancell() {
       this.openss = false;
       this.openOne = false;
-      this.youhui = 10
+      this.youhui = 10;
       // this.reset();
     },
     // 琛ㄥ崟閲嶇疆
@@ -931,10 +1038,10 @@
       this.handleQuery();
     },
     resetQuerys() {
-      this.OnenewpacName = [],
-        this.queryParams.price = 0,
-        this.queryParams.xianprice = 0,
-        this.youhui = 0
+      (this.OnenewpacName = []),
+        (this.queryParams.price = 0),
+        (this.queryParams.xianprice = 0),
+        (this.youhui = 0);
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
@@ -944,6 +1051,11 @@
       this.ids = selection.map((item) => item.drugManufacturerId);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
+      if (selection.length > 1) {
+        // 濡傛灉閫夋嫨浜嗗琛岋紝淇濈暀鏈�鍚庝竴琛�
+        this.$refs.tab.clearSelection(); // 娓呯┖鎵�鏈夐�夋嫨
+        this.$refs.tab.toggleRowSelection(selection[selection.length - 1]); // 閲嶆柊閫夋嫨鏈�鍚庝竴椤�
+      }
     },
     // 閮ㄩ棬琛ㄦ牸鍗曡鑾峰彇
     handleSelection(selection) {
@@ -976,6 +1088,7 @@
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
       this.reset();
+      this.form.isZybUnit = 0;
       this.open = true;
       this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢";
     },
@@ -984,7 +1097,11 @@
       this.reset();
       const drugManufacturerId = row.drugManufacturerId || this.ids;
       getComp(drugManufacturerId).then((response) => {
-        this.form = response.data;
+        // 涓嶈鐩存帴璧嬪�兼暣涓� response.data锛岃�屾槸閫愪釜灞炴�ц祴鍊�
+        Object.assign(this.form, response.data);
+        this.form.isZybUnit = response.data.isZybUnit === true ? 1 : 0;
+         this.form.dwlx= Number(response.data.dwlx)
+        console.log("淇敼鏃剁殑 isZybUnit 鍊�:", this.form.isZybUnit);
         this.open = true;
         this.title = "淇敼浣撴鍗曚綅淇℃伅缁存姢";
       });
@@ -994,12 +1111,11 @@
       this.opens = true;
 
       this.groupingList = [];
-
+      this.dwlxs = this.form.dwlx
       if (this.form.drugManufacturerId) {
         this.beCurrentDept();
       }
       this.title = "濂楅鍒嗙粍缁存姢" + "( " + this.form.cnName + ")";
-
     },
     numberChange(currentValue, oldValue) {
       this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", {
@@ -1011,26 +1127,29 @@
           this.youhui = currentValue;
 
           this.OnenewpacName.forEach((item) => {
-            item.limits = this.youhui
+            item.limits = this.youhui;
             const proPrice = new Big(item.proPrice);
             const limits = new Big(item.limits);
-            const result = proPrice.times(limits.div(10));  // ordPrice * (discount / 10)
+            const result = proPrice.times(limits.div(10)); // ordPrice * (discount / 10)
             item.ysPrice = result.toNumber();
-            this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => {
-              return sum.plus(new Big(item.ysPrice || '0'));
-            }, new Big(0)).toNumber();
-          })
-          // ----------------------------------------------------------
-
+            this.queryParams.xianprice = this.OnenewpacName.reduce(
+              (sum, item) => {
+                return sum.plus(new Big(item.ysPrice || "0"));
+              },
+              new Big(0)
+            ).toNumber();
+          });
         })
         .catch(() => {
           this.youhui = oldValue;
         });
-
     },
     numberChangeXianPrice(currentValue, oldValue) {
       // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥�
-      if (this.queryParams.xianprice === this.lastXianPrice || !this.queryParams.xianprice) {
+      if (
+        this.queryParams.xianprice === this.lastXianPrice ||
+        !this.queryParams.xianprice
+      ) {
         return;
       }
 
@@ -1049,19 +1168,28 @@
             item.limits = this.youhui;
             const proPrice = new Big(item.proPrice);
             const limits = new Big(item.limits);
-            const result = proPrice.times(limits.div(10));  // ordPrice * (discount / 10)
+            const result = proPrice.times(limits.div(10)); // ordPrice * (discount / 10)
             item.ysPrice = result.toNumber();
             totalYsprice = totalYsprice.plus(new Big(item.ysPrice));
           });
           // 濡傛灉鎬荤殑 ysPrice 鍜屾煡璇㈠弬鏁颁腑鐨� xianprice 涓嶄竴鑷达紝杩涜璋冩暣
           if (!totalYsprice.eq(this.queryParams.xianprice)) {
-            const diff = new Big(this.queryParams.xianprice).minus(totalYsprice);
+            const diff = new Big(this.queryParams.xianprice).minus(
+              totalYsprice
+            );
             // 濡傛灉 OnenewpacName 鏁扮粍涓嶄负绌猴紝璋冩暣鏈�鍚庝竴椤圭殑 ysPrice
             if (this.OnenewpacName.length > 0) {
-              const lastItem = this.OnenewpacName[this.OnenewpacName.length - 1];
-              const newYsPrice = new Big(lastItem.ysPrice).plus(diff).toNumber();
+              const lastItem =
+                this.OnenewpacName[this.OnenewpacName.length - 1];
+              const newYsPrice = new Big(lastItem.ysPrice)
+                .plus(diff)
+                .toNumber();
               // 浣跨敤 $set 纭繚鍝嶅簲鎬ф洿鏂�
-              this.$set(this.OnenewpacName[this.OnenewpacName.length - 1], 'ysPrice', newYsPrice);
+              this.$set(
+                this.OnenewpacName[this.OnenewpacName.length - 1],
+                "ysPrice",
+                newYsPrice
+              );
             }
           }
           // 鏇存柊 lastXianPrice 浠ヤ究涓嬫姣旇緝
@@ -1072,7 +1200,6 @@
           this.youhui = oldValue;
         });
     },
-
 
     changegroupingName() {
       if (this.selectionList.length <= 0) {
@@ -1096,7 +1223,6 @@
               index +
               1;
           });
-
         });
       } else {
         deptTreeSelect().then((response) => {
@@ -1108,7 +1234,6 @@
               index +
               1;
           });
-
         });
       }
       getProjectList().then((response) => {
@@ -1152,15 +1277,15 @@
     },
     handleSearchFor() {
       // 鍒ゆ柇鏄惁涓烘眽瀛�
-      const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char)
+      const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char);
       if (isChineseChar(this.queryParams1.proName)) {
-        this.queryParams1.pym = null
+        this.queryParams1.pym = null;
         getProjectList(this.queryParams1).then((response) => {
           this.Treedata = response.data;
         });
       } else {
-        this.queryParams1.pym = this.queryParams1.proName
-        this.queryParams1.proName = null
+        this.queryParams1.pym = this.queryParams1.proName;
+        this.queryParams1.proName = null;
         getProjectList(this.queryParams1).then((response) => {
           this.Treedata = response.data;
         });
@@ -1170,7 +1295,7 @@
     handleChangesingle(selection) {
       if (selection) {
         this.dataList = selection;
-        this.resetright()
+        this.resetright();
       }
     },
     resetright() {
@@ -1186,11 +1311,13 @@
         this.dataList.forEach((item) => {
           this.$refs.tre.toggleRowSelection(item, false); // 鍙栨秷閫変腑鐘舵��
           // 浣跨敤 $set 纭繚鍝嶅簲鎬�
-          this.$set(item, 'limits', 10); // 璁剧疆闄愬埗鏁伴噺
-          this.$set(item, 'ysPrice', item.proPrice); // 璁剧疆鐜颁环涓哄師浠�
+          this.$set(item, "limits", 10); // 璁剧疆闄愬埗鏁伴噺
+          this.$set(item, "ysPrice", item.proPrice); // 璁剧疆鐜颁环涓哄師浠�
 
           // 妫�鏌ユ槸鍚﹀凡缁忓瓨鍦ㄧ浉鍚岀殑椤圭洰
-          const existingItem = this.OnenewpacName.find(existing => existing.proId === item.proId);
+          const existingItem = this.OnenewpacName.find(
+            (existing) => existing.proId === item.proId
+          );
           if (!existingItem) {
             newItemsToAdd.push(item); // 濡傛灉涓嶅瓨鍦ㄧ浉鍚岄」鐩紝鍒欐坊鍔犲埌鏂版暟缁�
             this.updateProPrice(item);
@@ -1201,7 +1328,11 @@
         this.OnenewpacName.push(...newItemsToAdd);
 
         // 鍒犻櫎閲嶅椤圭洰锛岃繖閲屾垜浠彧闇�澶勭悊鏂版坊鍔犵殑椤圭洰鍜屽師鏈夐」鐩箣闂寸殑閲嶅
-        for (let i = this.OnenewpacName.length - newItemsToAdd.length; i < this.OnenewpacName.length - 1; i++) {
+        for (
+          let i = this.OnenewpacName.length - newItemsToAdd.length;
+          i < this.OnenewpacName.length - 1;
+          i++
+        ) {
           for (let j = i + 1; j < this.OnenewpacName.length; j++) {
             if (this.OnenewpacName[i].proId === this.OnenewpacName[j].proId) {
               this.OnenewpacName.splice(j, 1); // 鍒犻櫎閲嶅鐨勯」鐩�
@@ -1209,17 +1340,22 @@
             }
           }
         }
-        this.queryParams.price = 0
-        this.queryParams.xianprice = 0
+        this.queryParams.price = 0;
+        this.queryParams.xianprice = 0;
         // 閲嶆柊璁$畻鎬讳环鍜岀幇浠�
         this.OnenewpacName.forEach((item) => {
           this.queryParams.price += item.proPrice; // 绱姞鍘熶环
           //this.queryParams.xianprice += item.ysPrice || 0;  绱姞鐜颁环锛屽鏋測sPrice涓簎ndefined鍒欑疮鍔�0
         });
         this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => {
-          return sum.plus(new Big(item.ysPrice || '0'));
+          return sum.plus(new Big(item.ysPrice || "0"));
         }, new Big(0)).toNumber();
-        this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10
+        this.youhui =
+          (Math.floor(
+            (this.queryParams.xianprice / this.queryParams.price) * 100
+          ) /
+            100) *
+          10;
       }
     },
     handledbelete(row) {
@@ -1228,7 +1364,9 @@
       this.youhui = 0; // 鍒濆鍖栦紭鎯�
 
       // 鍏堟壘鍒板苟鍒犻櫎椤圭洰
-      this.OnenewpacName = this.OnenewpacName.filter(item => item.proId !== row.proId);
+      this.OnenewpacName = this.OnenewpacName.filter(
+        (item) => item.proId !== row.proId
+      );
 
       // 鐒跺悗鏇存柊鎬讳环鍜岀幇浠�
       this.OnenewpacName.forEach((item) => {
@@ -1240,7 +1378,12 @@
 
       // 璁$畻浼樻儬
       if (this.queryParams.price > 0) {
-        this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10;
+        this.youhui =
+          (Math.floor(
+            (this.queryParams.xianprice / this.queryParams.price) * 100
+          ) /
+            100) *
+          10;
       } else {
         this.youhui = 10;
       }
@@ -1249,8 +1392,8 @@
     submitrighr() {
       this.openOne = false;
       this.forms.price = this.queryParams.price;
-      this.forms.ysPrice = this.queryParams.xianprice
-      this.forms.limits = this.youhui
+      this.forms.ysPrice = this.queryParams.xianprice;
+      this.forms.limits = this.youhui;
       let mapList = [];
       this.OnenewpacName.forEach((item) => {
         mapList.push({
@@ -1258,7 +1401,7 @@
           proId: item.proId,
           proPrice: item.proPrice,
           limits: item.limits,
-          ysPrice: item.ysPrice
+          ysPrice: item.ysPrice,
         });
       });
 
@@ -1281,7 +1424,7 @@
         mapList: mapList,
         price: this.forms.price,
         ysPrice: this.forms.ysPrice,
-        id: this.groupList[0] ? this.groupList[0].id : ''
+        id: this.groupList[0] ? this.groupList[0].id : "",
       };
 
       // 鍙戦�佽姹備繚瀛樻暟鎹�
@@ -1359,7 +1502,7 @@
           this.forms.groupingName = item.groupingName;
           this.forms.gtAge = item.gtAge;
           this.forms.limits = item.limits;
-          this.youhui = item.limits
+          this.youhui = item.limits;
           this.forms.ltAge = item.ltAge;
           this.forms.pacName = item.pacName;
           this.forms.payType = item.payType;
@@ -1377,14 +1520,14 @@
       this.singlegg = !selection.length;
     },
     handleBeforeClose(done) {
-      this.$confirm('纭鍏抽棴锛�')
+      this.$confirm("纭鍏抽棴锛�")
         .then(() => done())
-        .catch(() => { /* 鍙栨秷鍏抽棴 */ });
+        .catch(() => {
+          /* 鍙栨秷鍏抽棴 */
+        });
     },
     xiangmuWh() {
-      if (!this.forms.groupingName ||
-        !this.forms.sex ||
-        !this.forms.payType) {
+      if (!this.forms.groupingName || !this.forms.sex || !this.forms.payType) {
         this.$modal.msgError("璇峰厛濉啓鎵�鏈夊繀濉」!");
         return; // Stop execution if any required field is empty
       }
@@ -1394,7 +1537,7 @@
       this.queryParams.price = 0;
       this.loading = true;
       if (this.groupList[0]) {
-        let id = this.groupList[0].id || '';
+        let id = this.groupList[0].id || "";
         getDetails(id).then((res) => {
           this.OnenewpacName = res.data.groupingProList;
           // this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => {
@@ -1404,12 +1547,12 @@
           // this.OnenewpacName.forEach((item, index) => {
           //   this.queryParams.price += item.proPrice;
           // });
-          // 
+          //
 
           // this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10
-          this.queryParams.xianprice = res.data.ysPrice
-          this.queryParams.price = res.data.price
-          this.youhui = res.data.limits
+          this.queryParams.xianprice = res.data.ysPrice;
+          this.queryParams.price = res.data.price;
+          this.youhui = res.data.limits;
         });
       }
       // console.log(this.groupList[0].id, 9966);
@@ -1417,10 +1560,8 @@
         this.sfzs = res.msg;
       });
 
-
-
       if (this.forms.sex) {
-        console.log('杩涙潵浜唅f');
+        console.log("杩涙潵浜唅f");
 
         deptTreeSelect(this.forms.sex).then((response) => {
           // 濂楅鍚嶇О
@@ -1434,7 +1575,7 @@
           });
         });
       } else {
-        console.log('杩涙潵浜唀lse');
+        console.log("杩涙潵浜唀lse");
 
         deptTreeSelect().then((response) => {
           this.newpacName = response.rows;
@@ -1506,7 +1647,6 @@
         price: "",
         ysPrice: "",
       };
-
     },
     beCurrent() {
       let data = {
@@ -1564,35 +1704,40 @@
       }
     },
 
-
     tableRowClassName({ row, rowIndex }) {
       row.index = rowIndex;
     },
-
 
     Package() {
       this.taocan = true;
       deptTreeSelect(this.forms.sex).then((res) => {
         if (res.rows) {
-          this.newpacName1 = res.rows
+          this.newpacName1 = res.rows;
         }
       });
     },
 
-
     handle() {
       this.loading = true;
-      deptTreeSelect(this.forms.sex, this.queryParam).then((res) => {
-        if (res.rows) {
-          this.newpacName1 = res.rows; // 鏇存柊濂楅鍒楄〃
-        } else {
-          this.newpacName1 = [];
-        }
-        this.loading = false;
-      }).catch(() => {
-        this.loading = false;
-        this.$modal.msgError("鎼滅储澶辫触锛岃绋嶅悗閲嶈瘯");
-      });
+      deptTreeSelect(this.forms.sex, this.queryParam)
+        .then((res) => {
+          if (res.rows) {
+            this.newpacName1 = res.rows; // 鏇存柊濂楅鍒楄〃
+          } else {
+            this.newpacName1 = [];
+          }
+          this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
+          this.$modal.msgError("鎼滅储澶辫触锛岃绋嶅悗閲嶈瘯");
+        });
+    },
+
+
+    radioChange(val) {
+      this.reset();
+      this.form.dwlx = val
     },
 
     /** 鎻愪氦鎸夐挳 */
@@ -1656,10 +1801,10 @@
 
       // 灏嗛�変腑鐨勫椁愰」鐩坊鍔犲埌宸︿晶琛ㄦ牸
       this.loading = true;
-      newProjects.forEach(project => {
+      newProjects.forEach((project) => {
         // 涓烘瘡涓」鐩缃粯璁ゆ姌鎵e拰鐜颁环
-        this.$set(project, 'limits', 10); // 榛樿鎶樻墸 10锛堝嵆鍘熶环锛�
-        this.$set(project, 'ysPrice', project.proPrice); // 鐜颁环鍒濆鍖栦负鍘熶环
+        this.$set(project, "limits", 10); // 榛樿鎶樻墸 10锛堝嵆鍘熶环锛�
+        this.$set(project, "ysPrice", project.proPrice); // 鐜颁环鍒濆鍖栦负鍘熶环
         this.OnenewpacName.push(project);
       });
 
@@ -1673,9 +1818,14 @@
       }, 0);
 
       // 鏇存柊浼樻儬鍊�
-      this.youhui = this.queryParams.price > 0
-        ? (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10
-        : 0;
+      this.youhui =
+        this.queryParams.price > 0
+          ? (Math.floor(
+            (this.queryParams.xianprice / this.queryParams.price) * 100
+          ) /
+            100) *
+          10
+          : 0;
 
       // 鍏抽棴瀵硅瘽妗�
       this.taocan = false;
@@ -1685,7 +1835,6 @@
     cancel1() {
       this.taocan = false;
     },
-
 
     handleSelectionChange1(selection) {
       // 瀹炵幇鍗曢�夐�昏緫

--
Gitblit v1.8.0