From b6a8dc4f0f93ba6628b41cf801e2a899672eecce Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期二, 31 十二月 2024 19:12:27 +0800
Subject: [PATCH] lsat

---
 src/views/system/comp/index.vue |  552 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 498 insertions(+), 54 deletions(-)

diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue
index 819277a..bd31423 100644
--- a/src/views/system/comp/index.vue
+++ b/src/views/system/comp/index.vue
@@ -291,6 +291,7 @@
         :visible.sync="opens"
         width="1350px"
         append-to-body
+        :close-on-click-modal="false"
       >
         <el-row :gutter="20">
           <el-col :span="7" :xs="24">
@@ -378,6 +379,7 @@
                   placeholder="璇烽�夋嫨鎬у埆"
                   style="width: 120px"
                   clearable
+                  :disabled="isSexDisabled"
                 >
                   <el-option
                     v-for="dict in dict.type.sys_user_sex"
@@ -387,39 +389,14 @@
                   />
                 </el-select>
               </el-form-item>
-              <el-form-item label="濂楅鍚嶇О" prop="pacName">
+              <!-- <el-form-item label="濂楅鍚嶇О" prop="pacName">
                 <el-input
                   v-model="forms.pacName"
                   placeholder="璇疯緭鍏ュ椁愬悕绉�"
                   @focus="changeName"
                   style="width: 130px"
                 />
-              </el-form-item>
-              <el-form-item label="鍘熶环" prop="price">
-                <el-input
-                  v-model="forms.price"
-                  placeholder="璇疯緭鍏ュ師浠�"
-                  style="width: 130px"
-                />
-              </el-form-item>
-              <el-form-item label="鎶樻墸" prop="limits">
-                <el-input
-                  v-model="forms.limits"
-                  placeholder="璇疯緭鍏ユ姌鎵�"
-                  style="width: 130px"
-                  :disabled="isfalse"
-                  @change="numberChange"
-                />
-              </el-form-item>
-
-              <el-form-item label="搴旀敹" prop="ysPrice">
-                <el-input
-                  v-model="forms.ysPrice"
-                  placeholder="璇疯緭鍏ュ簲鏀�"
-                  style="width: 120px"
-                  disabled
-                />
-              </el-form-item>
+              </el-form-item> -->
               <el-form-item label="缁撶畻鏂瑰紡" prop="payType">
                 <el-select
                   v-model="forms.payType"
@@ -444,6 +421,31 @@
                   <el-input v-model="forms.gtAge" style="width: 54px" />
                 </el-col>
               </el-form-item>
+              <el-form-item label="鍘熶环" prop="price">
+                <el-input
+                  v-model="forms.price"
+                  placeholder="璇疯緭鍏ュ師浠�"
+                  style="width: 130px"
+                />
+              </el-form-item>
+              <el-form-item label="鎶樻墸" prop="limits">
+                <el-input
+                  v-model="forms.limits"
+                  placeholder="璇疯緭鍏ユ姌鎵�"
+                  style="width: 130px"
+                  @change="numberChange"
+                />
+                <!-- :disabled="isfalse" -->
+              </el-form-item>
+
+              <el-form-item label="浼樻儬浠�" prop="ysPrice">
+                <el-input
+                  v-model="forms.ysPrice"
+                  placeholder="璇疯緭鍏ュ簲鏀�"
+                  style="width: 120px"
+                />
+              </el-form-item>
+            
             </el-form>
 
             <el-row :gutter="10" class="mb8">
@@ -454,6 +456,16 @@
                   size="mini"
                   @click="handleGroup"
                   >淇濆瓨</el-button
+                >
+              </el-col>
+              <el-col :span="1.5">
+                <el-button
+                  type="primary"
+                  icon="el-icon-edit"
+                  size="mini"
+                  :disabled="singlegg"
+                  @click="xiangmuWh"
+                  >椤圭洰缁存姢</el-button
                 >
               </el-col>
               <el-col :span="1.5">
@@ -528,6 +540,7 @@
         :visible.sync="openss"
         width="1400px"
         append-to-body
+        :close-on-click-modal="false"
       >
         <el-row :gutter="24">
           <el-col :span="8" :xs="24">
@@ -604,8 +617,13 @@
                 />
               </el-form-item>
               <el-form-item>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button>
-      </el-form-item>
+                <el-button
+                  icon="el-icon-refresh"
+                  size="mini"
+                  @click="resetQuerys"
+                  >閲嶇疆</el-button
+                >
+              </el-form-item>
             </el-form>
             <!-- <div style="color: red; font-size: 8px">
               娉ㄩ噴锛氶紶鏍囧乏閿弻鍑婚�変腑琛屽彲鍒犻櫎
@@ -627,6 +645,7 @@
                   {{ scope.row.proName + "/" + scope.row.proPrice }}
                 </template>
               </el-table-column>
+
               <el-table-column label="鎿嶄綔" align="center" width="68">
                 <template slot-scope="scope">
                   <el-button
@@ -700,6 +719,203 @@
         </el-row>
         <div slot="footer" class="dialog-footer1">
           <el-button type="primary" @click="submitrighr">纭� 瀹�</el-button>
+          <el-button @click="cancell">鍙� 娑�</el-button>
+        </div>
+      </el-dialog>
+    </div>
+
+    <div>
+      <el-dialog
+        :title="title"
+        :visible.sync="openOne"
+        width="1400px"
+        append-to-body
+        :close-on-click-modal="false"
+      >
+        <el-row :gutter="24">
+          <el-col :span="8" :xs="24">
+            <el-form
+              :model="queryParams"
+              ref="queryForm"
+              size="small"
+              :inline="true"
+              label-width="68px"
+            >
+              <el-form-item label="濂楅鍚嶇О" prop="pacName">
+                <el-input
+                  ref="inputName"
+                  v-model="queryParams.pacName"
+                  placeholder="璇疯緭鍏ュ椁愬悕绉�"
+                  clearable
+                  @keyup.enter.native="handleSearch"
+                  style="width: 140px"
+                />
+              </el-form-item>
+              <el-form-item>
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  size="mini"
+                  @click="handleSearch"
+                  >鎼滅储</el-button
+                >
+                <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> -->
+              </el-form-item>
+            </el-form>
+            <el-table
+              ref="tbone"
+              border
+              v-loading="loading"
+              :data="newpacName"
+              @selection-change="handleChangeOne"
+              height="478"
+            >
+              <el-table-column type="selection" width="40px" align="center" />
+              <el-table-column
+                label="搴忓彿"
+                align="center"
+                prop="newID"
+                width="50px"
+              />
+              <el-table-column
+                label="濂楅鍚嶇О/浠锋牸/鍏�"
+                align="center"
+                prop="pacName"
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.pacName + "/" + scope.row.price }}
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-col>
+          <el-col :span="6" :xs="24">
+            <el-form
+              :model="queryParams"
+              ref="queryForm"
+              size="small"
+              :inline="true"
+              label-width="46px"
+              style="height: 35px"
+            >
+              <el-form-item label="鍚堣" prop="price">
+                <el-input
+                  ref="inputName"
+                  v-model="queryParams.price"
+                  placeholder="鍚堣"
+                  clearable
+                  style="width: 140px"
+                />
+              </el-form-item>
+              <el-form-item>
+                <el-button
+                  icon="el-icon-refresh"
+                  size="mini"
+                  @click="resetQuerys"
+                  >閲嶇疆</el-button
+                >
+              </el-form-item>
+            </el-form>
+            <!-- <div style="color: red; font-size: 8px">
+              娉ㄩ噴锛氶紶鏍囧乏閿弻鍑婚�変腑琛屽彲鍒犻櫎
+            </div> -->
+            <!--       @row-dblclick="dbclick" -->
+            <el-table
+              border
+              v-loading="loading"
+              :data="OnenewpacName"
+              :row-class-name="tableRowClassName"
+              height="478"
+            >
+              <el-table-column
+                label="椤圭洰鍚嶇О/浠锋牸/鍏�"
+                align="center"
+                prop="proName"
+              >
+             
+                <template slot-scope="scope">
+                  {{ scope.row.proName + "/" + scope.row.proPrice }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="鍘熶环"
+                align="center"
+                prop="proPrice"
+              ></el-table-column>
+              <el-table-column label="鎿嶄綔" align="center" width="68">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handledbelete(scope.row)"
+                    >鍒犻櫎</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-col>
+          <el-col :span="2" :xs="24">
+            <div style="margin: 240% 6%">
+              <el-button
+                type="primary"
+                size="medium "
+                icon="el-icon-back"
+                @click="resetright"
+                ></el-button
+              >
+            </div>
+          </el-col>
+          <el-col :span="8" :xs="24">
+            <el-form
+              :model="queryParams"
+              ref="queryForm"
+              size="small"
+              :inline="true"
+              v-show="showSearch"
+              label-width="68px"
+            >
+              <el-form-item label="椤圭洰鍚嶇О" prop="proName">
+                <el-input
+                  ref="inputName"
+                  v-model="queryParams.proName"
+                  placeholder="璇疯緭鍏ラ」鐩悕绉�"
+                  clearable
+                  @keyup.enter.native="handleSearchFor"
+                  style="width: 140px"
+                />
+              </el-form-item>
+              <el-form-item>
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  size="mini"
+                  @click="handleSearchFor"
+                  >鎼滅储</el-button
+                >
+              </el-form-item>
+            </el-form>
+            <el-table
+              border
+              v-loading="loading"
+              ref="tre"
+              :data="Treedata"
+              @selection-change="handleChangesingle"
+              height="478"
+              style="width: 70%"
+            >
+              <el-table-column type="selection" width="40px" align="center" />
+              <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" width="130" />
+              <el-table-column
+                label="椤圭洰浠锋牸/鍏�"
+                align="center"
+                prop="proPrice"
+                width="100"
+              />
+            </el-table>
+          </el-col>
+        </el-row>
+        <div slot="footer" class="dialog-footer1">
+          <el-button type="primary" @click="submitrighr">纭骞朵繚瀛�</el-button>
           <el-button @click="cancell">鍙� 娑�</el-button>
         </div>
       </el-dialog>
@@ -911,6 +1127,7 @@
   getProjectList,
   getPackageList,
   delegrouping,
+  getDetails,
 } from "@/api/system/comp";
 import { deptTreeSelect, projectGetList } from "@/api/system/tijian";
 import { getInfo } from "@/api/login";
@@ -941,6 +1158,8 @@
       id: "",
       // 閫変腑鏁扮粍
       ids: [],
+      // 鎺у埗鎬у埆閫夋嫨妗嗘槸鍚︾鐢�
+      isSexDisabled: false,
       dwIds: [],
       groupIds: [],
       deptList: [],
@@ -971,6 +1190,7 @@
       open: false,
       opens: false,
       openss: false,
+      openOne: false,
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
@@ -1005,9 +1225,9 @@
         gtAge: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
         limits: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
         ltAge: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
-        pacName: [
+        /*  pacName: [
           { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
+        ], */
         payType: [
           { required: true, validator: checkPhoneNum, trigger: "blur" },
         ],
@@ -1062,6 +1282,7 @@
         (this.loading = true);
       listComp(this.queryParams).then((response) => {
         this.compList = response.rows;
+        
         response.rows.forEach((item, index) => {
           item.newID =
             (this.queryParams.pageNum - 1) * this.queryParams.pageSize +
@@ -1082,6 +1303,7 @@
     // 鍙栨秷濂楅
     cancell() {
       this.openss = false;
+      this.openOne = false;
       this.reset();
     },
     // 琛ㄥ崟閲嶇疆
@@ -1137,10 +1359,10 @@
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    resetQuerys(){
-      this.OnenewpacName = [],
-      this.queryParams.price = 0,
-       this.$refs.tbone.toggleRowSelection(this.pacList[0], false);
+    resetQuerys() {
+      (this.OnenewpacName = []),
+        (this.queryParams.price = 0),
+        this.$refs.tbone.toggleRowSelection(this.pacList[0], false);
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
@@ -1160,9 +1382,24 @@
       }
       this.dwIds = selection.map((item) => item.id);
       this.singleg = !selection.length;
-      if (this.selectionList[0].id) {
+      if (this.selectionList.length && this.selectionList[0].id) {
         this.beCurrent();
+      } else {
+        this.GroupUpdate();
       }
+
+      /* if (this.selectionList.length) {
+        // 濡傛灉绗竴涓〃鏍兼湁閫変腑椤癸紝閫変腑绗簩涓〃鏍煎搴旂殑鏁版嵁
+        const selectedDeptId = this.selectionList[0].id; // 鍋囪姣忎釜椤规湁涓�涓敮涓�鐨� id
+        const correspondingGroups = this.groupingList.filter(
+          (group) => group.deptId === selectedDeptId
+        );
+        this.groupList = correspondingGroups;
+      } else {
+        // 濡傛灉娌℃湁閫変腑浠讳綍椤癸紝娓呯┖绗簩涓〃鏍肩殑閫変腑椤�
+        this.groupList = [];
+        this.$refs.tbs.clearSelection();
+      } */
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
@@ -1183,6 +1420,9 @@
     // 缁存姢閮ㄩ棬
     mainDepartment() {
       this.opens = true;
+
+      this.groupingList = [];
+
       if (this.form.drugManufacturerId) {
         this.beCurrentDept();
       }
@@ -1195,15 +1435,19 @@
       });
     },
     // 鎶樻墸
-    numberChange(currentValue, oldValue) {
+    numberChange(currentValue) {
       this.forms.limits = currentValue;
-      if (this.forms.limits > this.getInfodis) {
+      /* if (this.forms.limits > this.getInfodis) {
         this.forms.limits = this.getInfodis;
         this.forms.ysPrice = (
           this.forms.price *
           (this.forms.limits / 10)
         ).toFixed(2);
-      }
+      } */
+      this.forms.ysPrice = (
+        this.forms.price *
+        (this.forms.limits / 10)
+      ).toFixed(2);
     },
 
     changegroupingName() {
@@ -1302,6 +1546,7 @@
       }
       getProjectList().then((response) => {
         this.Treedata = response.data;
+        
       });
     },
 
@@ -1373,10 +1618,10 @@
         this.queryParams.price += item.proPrice;
       });
     },
-    handledbelete(row){
+    handledbelete(row) {
       this.queryParams.price = 0;
-      this.OnenewpacName.forEach((item,index) => {
-        if(item.proId == row.proId){
+      this.OnenewpacName.forEach((item, index) => {
+        if (item.proId == row.proId) {
           this.OnenewpacName.splice(index, 1);
         }
       });
@@ -1384,7 +1629,7 @@
         this.queryParams.price += item.proPrice;
       });
     },
-    submitrighr() {
+    /*  submitrighr() {
       if (this.pacList.length >= 1) {
         this.openss = false;
         this.forms.pacName = this.pacList[0].pacName;
@@ -1396,6 +1641,62 @@
       } else {
         this.$modal.msgError("璇烽�夋嫨濂楅");
       }
+    }, */
+    submitrighr() {
+      this.openOne = false;
+      // this.forms.pacName = this.pacList[0].pacName;
+      this.forms.price = this.queryParams.price;
+      this.forms.ysPrice = (
+        this.forms.price *
+        (this.forms.limits / 10)
+      ).toFixed(2);
+      // console.log(this.groupingList, 555);
+
+      let mapList = [];
+      this.OnenewpacName.forEach((item) => {
+        mapList.push({
+          proName: item.proName,
+          proId: item.proId,
+          proPrice: item.proPrice,
+        });
+      });
+
+      // 濡傛灉 selectionList 涓虹┖锛屼娇鐢� mapList 缁х画淇濆瓨
+      if (this.OnenewpacName.length === 0) {
+        this.$modal.msgError("璇峰厛閫変腑椤圭洰");
+        return; // 鎻愮ず鐢ㄦ埛閫変腑椤圭洰
+      }
+
+      let data = {
+        groupingName: this.forms.groupingName,
+        gtAge: this.forms.gtAge,
+        limits: this.forms.limits,
+        ltAge: this.forms.ltAge,
+        pacName: this.forms.pacName,
+        payType: this.forms.payType,
+        sex: this.forms.sex,
+        dwDeptId: this.selectionList.length > 0 ? this.selectionList[0].id : "", // 濡傛灉娌℃湁閫変腑閮ㄩ棬锛岃缃负绌�
+        dwId: this.selectionList.length > 0 ? this.selectionList[0].dwId : "",
+        mapList: mapList,
+        price: this.forms.price,
+        ysPrice: this.forms.ysPrice,
+        id: this.groupList[0].id,
+      };
+
+      // 鍙戦�佽姹備繚瀛樻暟鎹�
+      dwgrouping(data).then((res) => {
+        if (res.code == 200) {
+          this.beCurrent();
+          this.forms.groupingName = "";
+          this.forms.sex = "";
+          this.forms.pacName = "";
+          this.forms.price = "";
+          this.forms.ysPrice = "";
+          this.forms.payType = "";
+        }
+      });
+
+      // this.handleGroup();
     },
     // 濂楅鍗曢」鑾峰彇
     handleChangeOne(selection) {
@@ -1404,6 +1705,7 @@
         this.$refs.tbone.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
       }
       this.pacList = selection;
+
       this.dataLists = [];
       this.queryParams.price = 0;
       this.pacList.forEach((item) => {
@@ -1454,7 +1756,27 @@
 
     handleChange(selection) {
       this.groupList = selection;
-      this.groupList.forEach((item) => {
+
+      if (selection.length > 0) {
+        this.groupList.forEach((item) => {
+          this.forms.groupingName = item.groupingName;
+          this.forms.gtAge = item.gtAge;
+          this.forms.limits = item.limits;
+          this.forms.ltAge = item.ltAge;
+          this.forms.pacName = item.pacName;
+          this.forms.payType = item.payType;
+          this.forms.sex = item.sex;
+          this.forms.price = item.price;
+          this.forms.ysPrice = item.ysPrice;
+        });
+        this.isSexDisabled = true; // 绂佺敤鎬у埆閫夋嫨
+      } else {
+        // 濡傛灉娌℃湁閫変腑琛岋紝娓呯┖琛ㄥ崟骞跺彇娑堢鐢�
+        this.GroupUpdate();
+        this.isSexDisabled = false; // 鎭㈠鎬у埆閫夋嫨妗嗕负鍙敤
+      }
+
+      /* this.groupList.forEach((item) => {
         this.forms.groupingName = item.groupingName;
         this.forms.gtAge = item.gtAge;
         this.forms.limits = item.limits;
@@ -1469,11 +1791,65 @@
         let del_row = selection.shift();
         this.$refs.tbs.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
       }
+      if(selection.length > 0) {
+        this.isSexDisabled = true;
+      }
+      else {
+        this.isSexDisabled = false;
+      } */
       this.groupIds = selection.map((item) => item.id);
       this.singlegg = !selection.length;
     },
+    xiangmuWh() {
+      this.openOne = true;
+      this.title = "鍒嗙粍椤圭洰缁存姢";
+      this.OnenewpacName = [];
+      this.queryParams.price = 0;
+      this.loading = true;
+      let id = this.groupList[0].id;
+      // console.log(this.groupList[0].id, 9966);
+
+      getDetails(id).then((res) => {
+        this.OnenewpacName = res.data.groupingProList;
+        this.OnenewpacName.forEach((item, index) => {
+          this.queryParams.price += item.proPrice;
+        });
+        // return this.OnenewpacName.forEach((item) => {
+        //   this.queryParams.price += item.proPrice;
+        // });
+      });
+      if (this.forms.sex) {
+        deptTreeSelect(this.forms.sex).then((response) => {
+          // 濂楅鍚嶇О
+          this.newpacName = response.rows;
+
+          this.loading = false;
+          response.rows.forEach((item, index) => {
+            item.newID =
+              (this.queryParams.pageNum - 1) * this.queryParams.pageSize +
+              index +
+              1;
+          });
+        });
+      } else {
+        deptTreeSelect().then((response) => {
+          this.newpacName = response.rows;
+          this.loading = false;
+          response.rows.forEach((item, index) => {
+            item.newID =
+              (this.queryParams.pageNum - 1) * this.queryParams.pageSize +
+              index +
+              1;
+          });
+        });
+      }
+      getProjectList().then((response) => {
+        this.Treedata = response.data;
+        // console.log(this.Treedata,999888);
+      });
+    },
     //淇濆瓨鍒嗙粍
-    handleGroup() {
+    /* handleGroup() {
       if (this.selectionList.length <= 0) {
         this.$modal.msgError("璇峰厛閫変腑閮ㄩ棬鎴栨坊鍔犳柊鐨勯儴闂�");
       } else {
@@ -1525,6 +1901,7 @@
         dwgrouping(data).then((res) => {
           if (res.code == 200) {
             this.beCurrent();
+            this.groupingList = res.data.updatedGroupingList; 
             this.forms.groupingName = "";
             this.forms.sex = "";
             this.forms.pacName = "";
@@ -1534,10 +1911,74 @@
           }
         });
       }
+    }, */
+    handleGroup() {
+      // 濡傛灉娌℃湁閫変腑浠讳綍閮ㄩ棬锛堝嵆娌℃湁 selectionList锛夛紝鍙互鐩存帴浠� OnenewpacName 鑾峰彇鏁版嵁
+      let mapList = [];
+      this.OnenewpacName.forEach((item) => {
+        mapList.push({
+          proName: item.proName,
+          proId: item.proId,
+          proPrice: item.proPrice,
+        });
+      });
+
+      // 濡傛灉 selectionList 涓虹┖锛屼娇鐢� mapList 缁х画淇濆瓨
+      /* if (this.OnenewpacName.length === 0) {
+        this.$modal.msgError("璇峰厛閫変腑椤圭洰");
+        return; // 鎻愮ず鐢ㄦ埛閫変腑椤圭洰
+      } */
+
+      this.forms.ysPrice = (
+        this.forms.price *
+        (this.forms.limits / 10)
+      ).toFixed(2);
+
+      let data = {
+        groupingName: this.forms.groupingName,
+        gtAge: this.forms.gtAge,
+        limits: this.forms.limits,
+        ltAge: this.forms.ltAge,
+        pacName: this.forms.pacName,
+        payType: this.forms.payType,
+        sex: this.forms.sex,
+        dwDeptId: this.selectionList.length > 0 ? this.selectionList[0].id : "", // 濡傛灉娌℃湁閫変腑閮ㄩ棬锛岃缃负绌�
+        dwId: this.selectionList.length > 0 ? this.selectionList[0].dwId : "",
+        mapList: mapList,
+        price: this.forms.price,
+        ysPrice: this.forms.ysPrice,
+        id: this.groupList[0].id,
+      };
+
+      // 鍙戦�佽姹備繚瀛樻暟鎹�
+      dwgrouping(data).then((res) => {
+        if (res.code == 200) {
+          this.beCurrent();
+          this.forms.groupingName = "";
+          this.forms.sex = "";
+          this.forms.pacName = "";
+          this.forms.price = "";
+          this.forms.ysPrice = "";
+          this.forms.payType = "";
+        }
+      });
     },
     // 淇敼鍒嗙粍
     GroupUpdate() {
-      this.forms = {};
+      // this.forms = {};
+      this.forms = {
+        groupingName: "",
+        gtAge: "",
+        limits: "",
+        ltAge: "",
+        pacName: "",
+        payType: "",
+        sex: "",
+        price: "",
+        ysPrice: "",
+      };
+
+      // this.$refs.forms.resetFields();
     },
     beCurrent() {
       let data = {
@@ -1545,6 +1986,7 @@
         dwId: this.selectionList[0].dwId,
       };
       getDwAndDwDept(data).then((response) => {
+        // 閮ㄩ棬鍚嶇О
         this.groupingList = response.data;
         response.data.forEach((item, index) => {
           item.newID =
@@ -1601,7 +2043,6 @@
 
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
-      
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.drugManufacturerId != null) {
@@ -1611,16 +2052,19 @@
               this.getList();
             });
           } else {
-            if(this.form.cnName && this.form.contactPerson && this.form.contactPhone){
+            if (
+              this.form.cnName &&
+              this.form.contactPerson &&
+              this.form.contactPhone
+            ) {
               addComp(this.form).then((response) => {
-              this.$modal.msgSuccess("鏂板鎴愬姛");
-              this.open = false;
-              this.getList();
-            });
-            }else{
+                this.$modal.msgSuccess("鏂板鎴愬姛");
+                this.open = false;
+                this.getList();
+              });
+            } else {
               this.$modal.msgError("璇峰~鍐欏繀浼犻」");
             }
-           
           }
         }
       });

--
Gitblit v1.8.0