From f68fa3bc5fc0a286c88d82ee6eb95e8ad6be0d16 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期四, 27 六月 2024 15:21:55 +0800
Subject: [PATCH] qxtj

---
 src/views/system/tijianall/index.vue |  595 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 501 insertions(+), 94 deletions(-)

diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue
index 40989a3..07335a6 100644
--- a/src/views/system/tijianall/index.vue
+++ b/src/views/system/tijianall/index.vue
@@ -9,7 +9,7 @@
             ref="form"
             :model="form"
             :rules="rules"
-            label-width="84px"
+            label-width="106px"
           >
             <el-form-item
               label="濮撳悕"
@@ -28,7 +28,11 @@
                 },
               ]"
             >
-              <el-input v-model="form.cusName" placeholder="璇疯緭鍏ュ鍚�" />
+              <el-input
+                v-model="form.cusName"
+                placeholder="璇疯緭鍏ュ鍚�"
+                style="width: 99%"
+              />
             </el-form-item>
             <el-form-item label="鎬у埆" prop="cusSex">
               <el-select
@@ -46,7 +50,11 @@
               </el-select>
             </el-form-item>
             <el-form-item label="璇佷欢绫诲瀷" prop="idType">
-              <el-select v-model="form.idType" placeholder="璇烽�夋嫨璇佷欢绫诲瀷">
+              <el-select
+                v-model="form.idType"
+                placeholder="璇烽�夋嫨璇佷欢绫诲瀷"
+                style="width: 93%"
+              >
                 <el-option
                   v-for="dict in dict.type.dict_user_cardtype"
                   :key="dict.value"
@@ -62,23 +70,28 @@
             ref="form"
             :model="form"
             :rules="rules"
-            label-width="84px"
+            label-width="106px"
           >
-          <el-form-item label="姘戞棌" prop="cusNational">
-              <el-select
-                filterable
-                v-model="form.cusNational"
-                placeholder="璇烽�夋嫨姘戞棌"
-                style="width: 96%"
-              >
-                <el-option
-                  v-for="dict in dict.type.dict_user_national"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
+            <el-form-item
+              label="鐢佃瘽"
+              prop="cusPhone"
+              :rules="[
+                {
+                  required: true,
+                  validator: (rule, value, callback) => {
+                    if (!form.cusPhone) {
+                      callback('');
+                    } else if (form.cusPhone) {
+                      callback();
+                    }
+                  },
+                  trigger: 'blur',
+                },
+              ]"
+            >
+              <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ョ數璇�" />
             </el-form-item>
+
             <el-form-item label="濠氬Щ" prop="cusMarryStatus">
               <el-select
                 v-model="form.cusMarryStatus"
@@ -135,38 +148,32 @@
             ref="form"
             :model="form"
             :rules="rules"
-            label-width="84px"
+            label-width="106px"
           >
-         
-            <el-form-item
-              label="鐢佃瘽"
-              prop="cusPhone"
-              :rules="[
-                {
-                  required: true,
-                  validator: (rule, value, callback) => {
-                    if (!form.cusPhone) {
-                      callback('');
-                    } else if (form.cusPhone) {
-                      callback();
-                    }
-                  },
-                  trigger: 'blur',
-                },
-              ]"
-            >
-              <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ョ數璇�" />
-            </el-form-item>
-
             <el-form-item label="閭" prop="cusEmail">
               <el-input v-model="form.cusEmail" placeholder="璇疯緭鍏ラ偖绠�" />
+            </el-form-item>
+            <el-form-item label="姘戞棌" prop="cusNational">
+              <el-select
+                filterable
+                v-model="form.cusNational"
+                placeholder="璇烽�夋嫨姘戞棌"
+                style="width: 93%"
+              >
+                <el-option
+                  v-for="dict in dict.type.dict_user_national"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
             </el-form-item>
 
             <el-form-item label="骞撮緞" prop="age">
               <el-input
                 v-model="form.age"
                 :disabled="isDisabled"
-                style="width: 30%"
+                style="width: 28%"
               />
               <el-select
                 :disabled="isDisabled"
@@ -188,7 +195,7 @@
             ref="form"
             :model="form"
             :rules="rules"
-            label-width="84px"
+            label-width="106px"
           >
             <el-form-item label="鍗″彿" prop="indexCard">
               <el-input v-model="form.indexCard" placeholder="璇疯緭鍏ュ崱鍙�" />
@@ -231,17 +238,17 @@
             ref="form"
             :model="form"
             :rules="rules"
-            label-width="84px"
+            label-width="106px"
           >
             <el-form-item label="鍗曚綅" prop="company">
               <el-input v-model="form.company" placeholder="璇疯緭鍏ュ伐浣滃崟浣�" />
             </el-form-item>
-
-            <el-form-item label="閮ㄩ棬" prop="department">
-              <el-input v-model="form.department" placeholder="璇疯緭鍏ラ儴闂�" />
-            </el-form-item>
             <el-form-item label="浣撴绫诲埆" prop="category">
-              <el-select v-model="form.category" placeholder="璇烽�夋嫨浣撴绫诲埆">
+              <el-select
+                v-model="form.category"
+                placeholder="璇烽�夋嫨浣撴绫诲埆"
+                style="width: 95%"
+              >
                 <el-option
                   v-for="dict in dict.type.dict_tjtype"
                   :key="dict.value"
@@ -251,6 +258,9 @@
               </el-select>
               <!-- <el-input v-model="form.category" placeholder="璇疯緭鍏ヤ綋妫�绫诲埆" /> -->
             </el-form-item>
+            <el-form-item label="閮ㄩ棬" prop="department">
+              <el-input v-model="form.department" placeholder="璇疯緭鍏ラ儴闂�" />
+            </el-form-item>
           </el-form>
           <el-form
             style="margin: 4px 8px"
@@ -258,27 +268,16 @@
             ref="form"
             :model="form"
             :rules="rules"
-            label-width="84px"
+            label-width="106px"
           >
             <el-form-item label="鐜颁綇鍦板潃" prop="cusAddr">
               <el-input v-model="form.cusAddr" placeholder="璇疯緭鍏ョ幇灞呬綇鍦板潃" />
-            </el-form-item>
-            <el-form-item label="棰勭害鏃ユ湡" prop="reservationTime">
-              <el-date-picker
-                v-model="form.reservationTime"
-                type="date"
-                value-format="yyyy-MM-dd"
-                placeholder="閫夋嫨鏃ユ湡"
-                :picker-options="setDisabled"
-                style="width: 94%"
-              >
-              </el-date-picker>
             </el-form-item>
             <el-form-item label="棰勭害鏃堕棿" prop="timeRegion">
               <el-select
                 v-model="form.timeRegion"
                 placeholder="璇烽�夋嫨棰勭害鏃堕棿"
-                style="width: 94%"
+                style="width: 95%"
               >
                 <el-option
                   v-for="dict in dict.type.tj_time_region"
@@ -288,6 +287,17 @@
                 ></el-option>
               </el-select>
             </el-form-item>
+            <el-form-item label="棰勭害鏃ユ湡" prop="reservationTime">
+              <el-date-picker
+                v-model="form.reservationTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="閫夋嫨鏃ユ湡"
+                :picker-options="setDisabled"
+                style="width: 88%"
+              >
+              </el-date-picker>
+            </el-form-item>
           </el-form>
         </div>
       </el-col>
@@ -296,15 +306,16 @@
     <el-dialog
       title="閫夋嫨濂楅"
       :visible.sync="taocan"
-      width="59%"
+      width="80%"
       height="700px"
     >
       <el-tabs
         type="border-card"
         style="height: 538px; margin: 0 10px; width: 100%"
         @tab-click="handleClick"
+        v-model="activeNames"
       >
-        <el-tab-pane label="濂楅">
+        <el-tab-pane label="濂楅" name="first">
           <el-form
             :model="queryParam"
             ref="queryForm"
@@ -390,7 +401,115 @@
                   class="el-icon-d-arrow-right"></i></el-button> -->
           </div>
         </el-tab-pane>
-        <el-tab-pane label="鍗曢」">
+        <el-tab-pane label="缁勫悎" name="third">
+          <div class="tab8">
+            <el-row :gutter="20" style="width: 100%">
+              <el-col :span="8">
+                <div
+                  style="
+                    text-align: center;
+                    margin-bottom: 10px;
+                    margin-top: 10px;
+                  "
+                >
+                  椤圭洰鍒楄〃
+                </div>
+                <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterage">
+                </el-input>
+                <div class="tab3">
+                  <el-tree
+                    class="filter-tree"
+                    v-loading="loading"
+                    :data="packageList"
+                    :props="defaultProp"
+                    show-checkbox
+                    node-key="id"
+                    @check="handlepackage"
+                    :default-checked-keys="checkedkeys"
+                    :filter-node-method="filterpackage"
+                    ref="treas"
+                    :render-content="renderContents"
+                  >
+                  </el-tree>
+                </div>
+              </el-col>
+              <el-col :span="6">
+                <div
+                  style="
+                    text-align: center;
+                    margin-bottom: 10px;
+                    margin-top: 10px;
+                  "
+                >
+                  鏄庣粏椤圭洰鍒楄〃
+                </div>
+                <div class="tab3">
+                  <el-tree
+                    class="filter-tree"
+                    v-loading="loading"
+                    :data="packagedataList"
+                    node-key="proId"
+                    :props="defaultpackProps"
+                    :render-content="renderContent"
+                  >
+                  </el-tree>
+                </div>
+              </el-col>
+              <el-col :span="11">
+                <div class="grid-content bg-purple">
+                  <div
+                    style="
+                      text-align: center;
+                      margin-bottom: 10px;
+                      margin-top: 10px;
+                    "
+                  >
+                    宸查�夐」鐩垪琛�
+                  </div>
+                  <el-table
+                    :data="DataLists"
+                    border
+                    style="width: 100%"
+                    height="400"
+                    :span-method="objectspanmethod"
+                  >
+                    <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+                    </el-table-column>
+                    <el-table-column
+                      prop="proName"
+                      label="鏄庣粏椤圭洰"
+                      width="260px"
+                    >
+                    </el-table-column>
+                    <el-table-column prop="proPrice" label="鍘熶环" width="56px">
+                    </el-table-column>
+
+                    <el-table-column
+                      label="鎿嶄綔"
+                      align="center"
+                      fixed="right"
+                      class-name="small-padding fixed-width"
+                      width="50px"
+                    >
+                      <template slot-scope="scope">
+                        <el-button
+                          size="mini"
+                          type="text"
+                          icon="el-icon-delete"
+                          @click="handleDel(scope.row)"
+                          title="鍒犻櫎"
+                        ></el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+
+                  <h3 style="font-weight: 600">鍚堣锛歿{ marryalls }}鍏�</h3>
+                </div>
+              </el-col>
+            </el-row>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane label="鍗曢」" name="second">
           <div class="tab8">
             <!-- <div class="tab7">
               <v-tree-transfer
@@ -404,8 +523,8 @@
                 @check-change="handleCurrentChecked">
               </el-tree> -->
             <!-- </div> -->
-            <el-row :gutter="20">
-              <el-col :span="6">
+            <el-row :gutter="20" style="width: 100%">
+              <el-col :span="8">
                 <div
                   style="
                     text-align: center;
@@ -429,6 +548,7 @@
                     :default-checked-keys="checkedkey"
                     :filter-node-method="filterNode"
                     ref="tree"
+                    :render-content="renderContent"
                   >
                   </el-tree>
                 </div>
@@ -454,6 +574,7 @@
                     show-checkbox
                     @check-change="handleCurrentChecked1"
                     :default-checked-keys="checkedListkey"
+                    :render-content="renderContent"
                   >
                   </el-tree>
                 </div>
@@ -505,6 +626,7 @@
                       </template>
                     </el-table-column>
                   </el-table>
+
                   <el-collapse v-model="activeName" accordion v-if="list1">
                     <div>
                       <el-collapse-item title="璇烽�夋嫨椤圭洰">
@@ -527,6 +649,9 @@
                       </el-collapse-item>
                     </div>
                   </el-collapse>
+                  <h3 v-else style="font-weight: 600">
+                    鍚堣锛歿{ marryall }}鍏�
+                  </h3>
                 </div>
               </el-col>
             </el-row>
@@ -587,7 +712,7 @@
             <el-form
               :model="form"
               :inline="true"
-              label-width="75px"
+              label-width="100px"
               style="margin-left: 10px"
             >
               <el-form-item label="搴旀敹閲戦" style="margin-right: 20px">
@@ -595,7 +720,6 @@
                   placeholder="搴旀敹閲戦"
                   :value="TotalPrice1 + '.00'"
                   disabled
-                  style="width: 150px"
                 ></el-input>
               </el-form-item>
               <!-- <el-form-item label="浼樻儬鎶樻墸" style="margin-right: 20px">
@@ -603,19 +727,20 @@
                 <el-input-number style="width: 140px" v-model="discount" :precision="2" :step="0.1" :max="10" :min="1"
                   @change="numberChange" :disabled="isfalse"></el-input-number>
               </el-form-item> -->
-              <el-form-item label="瀹炴敹閲戦" style="margin-right: 20px">
+              <el-form-item label="瀹炴敹閲戦">
                 <el-input
                   placeholder="瀹炴敹閲戦"
                   v-model="TotalPrice"
                   disabled
-                  style="width: 190px"
                 ></el-input>
               </el-form-item>
               <el-form-item>
                 <el-button type="primary" @click="Package" size="mini"
                   >閫夋嫨濂楅</el-button
                 >
-
+                <el-button type="primary" @click="resetpackage" size="mini"
+                  >閲嶇疆濂楅</el-button
+                >
                 <el-button
                   type="primary"
                   @click="submitPrice"
@@ -651,8 +776,8 @@
               border: 1px solid #e6ebf5;
               max-height: 420px;
               overflow: auto;
-              width: 1020px;
-              margin-left: 20px;
+              width: 950px;
+              margin-left: 25px;
             "
           >
             <el-collapse v-model="index" accordion>
@@ -670,6 +795,12 @@
                       ".00鍏�)"
                     }}
                   </template>
+                  <el-button
+                    type="primary"
+                    @click="candelete(item)"
+                    style="margin: 5px"
+                    >鍒� 闄�</el-button
+                  >
                   <el-table
                     :data="item.list"
                     border
@@ -821,6 +952,7 @@
 <script>
 import printJS from "print-js";
 import { getInfo } from "@/api/login";
+import { getZhList, getlistByZhId } from "@/api/system/package";
 import {
   deptTreeSelect,
   projectGetList,
@@ -831,10 +963,9 @@
   getProParentIdDxList,
   getProSonDxList,
   getaddTj,
-  getHistryTjOrderByCusIdCard,
   getHistryTjOrderProByCusIdCard,
+  delTbBycusCardIdAndProId,
 } from "@/api/system/tijian";
-import { MessageBox } from "element-ui";
 import VTreeTransfer from "../tijian/TreeTransfer.vue";
 import historyTj from "@/components/historyTj/index";
 export default {
@@ -892,9 +1023,14 @@
     //   }
     // };
     return {
+      marryall: 0,
+      marryalls: 0,
       filterText: "",
+      filterage: "",
       proIdList: [],
       tableDatas: [],
+      packageList: [],
+      checkedkeys: [],
       dialogVisiblese: false,
       lishi: false,
       table: false,
@@ -924,6 +1060,7 @@
       /** 鐓х浉鏈哄脊绐楁ā鍧�-start */
       videoWidth: 200,
       videoHeight: 200,
+      activeNames: "first",
       // canvasWidth:300,
       // canvasHeight:300,
       imgSrc: "",
@@ -985,12 +1122,22 @@
       // 鏍戠姸褰㈢姸
       Treedata: [],
       TreedataList: [],
+      DataLists: [],
       treedataList: [],
       checkedkey: [],
       checkedListkey: [],
       defaultProps: {
         children: [],
         label: "proName",
+      },
+      packagedataList: [],
+      defaultpackProps: {
+        children: [],
+        label: "proName",
+      },
+      defaultProp: {
+        children: [],
+        label: "zhmc",
       },
       formPacId: "",
       dXData: [],
@@ -1090,6 +1237,9 @@
     filterText(val) {
       this.$refs.tree.filter(val);
     },
+    filterage(val) {
+      this.$refs.treas.filter(val);
+    },
   },
   created() {
     this.getList1();
@@ -1145,10 +1295,64 @@
     inputChanges() {
       this.$refs.historyTj.getlist();
     },
+    candelete(item) {
+      let data = {
+        cusCardId: this.form.cusIdcard,
+        proId: item.proPrantId,
+      };
+      delTbBycusCardIdAndProId(data).then((res) => {
+        getTransitionList(this.form.cusIdcard).then((response) => {
+          this.tableData1 = response.data;
+          this.TotalPrice1 = 0;
+          if (this.tableData1) {
+            this.tableData1.forEach((item) => {
+              this.TotalPrice1 += item.nowPrice;
+              if (item.pacName === null) {
+                item.pacName = "鍗曢」";
+              }
+              if (item.pacName == "鍗曢」") {
+                item.list.forEach((item9) => {
+                  this.treeList.push(item9.proId);
+                });
+              }
+              this.pacName = item.pacName;
+            });
 
+            const r = /^\+?[0-9][0-9]*$/; //姝f暣鏁帮紙鍙互0鎵撳ご锛�
+            let TotalPrice = this.TotalPrice1 * (this.discount / 10);
+            if (r.test(TotalPrice)) {
+              this.TotalPrice = TotalPrice + ".00";
+            } else {
+              this.TotalPrice = TotalPrice;
+            }
+
+            this.list1 = false;
+            this.list3 = true;
+          } else {
+            this.list1 = true;
+
+            this.TotalPrice = "0.00";
+          }
+        });
+      });
+    },
     filterNode(value, data) {
       if (!value) return true;
-      return data.proName.indexOf(value) !== -1;
+      // return data.proName.indexOf(value) !== -1;
+      if (data.proName.indexOf(value) !== -1) {
+        return data.proName.indexOf(value) !== -1;
+      } else {
+        return data.proEngName.indexOf(value) !== -1;
+      }
+    },
+
+    filterpackage(value, data) {
+      if (!value) return true;
+      if (data.zhmc.indexOf(value) !== -1) {
+        return data.zhmc.indexOf(value) !== -1;
+      } else {
+        return data.pym.indexOf(value) !== -1;
+      }
     },
     cope() {
       let cusIdCard = this.form.cusIdcard;
@@ -1432,10 +1636,44 @@
     //     return true;
     //   }
     // },
+    resetpackage() {
+      if (this.form.cusIdcard) {
+        var cusId = this.form.cusIdcard;
+      } else {
+        this.$message.warning("璇峰厛濉啓淇℃伅锛屽啀閫変綋妫�鍐呭");
+      }
+      let _this = this;
+      _this.pacId = "";
+      this.proIds = [];
+      let data = {
+        cusId,
+        pacId: _this.pacId,
+        proIds: this.proIds,
+      };
+      getaddtTransition(data).then((response) => {
+        if (response.code === 200) {
+          let cusId = this.form.cusIdcard;
+          this.proIds = [];
+          getTransitionList(cusId).then((response) => {
+            this.tableData1 = response.data;
+            this.TotalPrice1 = 0;
+            if (this.tableData1.length >= 1) {
+              this.list1 = false;
+              this.list3 = true;
+            } else {
+              this.list1 = true;
+
+              this.TotalPrice = "0.00";
+            }
+          });
+        }
+      });
+    },
 
     Package() {
       this.taocan = true;
       let cusSex = this.form.cusSex;
+      this.activeNames = "first";
       this.datekey = Date.now();
       //鍏ㄩ儴濂楅
       this.loading = true;
@@ -1553,10 +1791,61 @@
       }
     },
     handleClick(tab, event) {
-      if (tab.label == "鍗曢」") {
+      if (this.activeNames == "second") {
         this.DataList = [];
         this.getDataList();
+      } else if (this.activeNames == "third") {
+        this.DataLists = [];
+        getZhList().then((response) => {
+          if (response.data) {
+            this.packageList = response.data;
+            this.checkedkeys.push(this.packageList[0].id);
+            let datas = {
+              zhId: this.packageList[0].id,
+            };
+            getlistByZhId(datas).then((res) => {
+              this.packagedataList = res.data.tjProjectList;
+              for (var i = 0; i < this.packagedataList.length; i++) {
+                let proId = this.packagedataList[i].proId;
+                getProSonDxList(proId).then((res) => {
+                  this.TreedataList = res.data.list;
+                  this.TreedataList.forEach((item) => {
+                    this.DataLists.push(item);
+                    if (this.DataLists.length >= 1) {
+                      this.marryalls = 0;
+                      this.DataLists.forEach((item1) => {
+                        this.marryalls += item1.proPrice;
+                        this.packagedataList.forEach((item3) => {
+                          if (item1.proParentId == item3.proId) {
+                            item1.propinName = item3.proName;
+                          }
+                        });
+                      });
+                    }
+                  });
+                });
+              }
+            });
+          }
+          this.loading = false;
+        });
       }
+    },
+    renderContent(h, { node, data, store }) {
+      return (
+        <span class="custom-tree-node">
+          <span>{node.label}</span>
+          <span>({data.proPrice}鍏�)</span>
+        </span>
+      );
+    },
+    renderContents(h, { node, data, store }) {
+      return (
+        <span class="custom-tree-node">
+          <span>{node.label}</span>
+          <span>({data.price}鍏�)</span>
+        </span>
+      );
     },
     getDataList() {
       this.loading = true;
@@ -1571,28 +1860,122 @@
             });
           });
         }
-        this.checkedkey.push(this.Treedata[0].proId);
-        let proId = this.Treedata[0].proId;
-        getProSonDxList(proId).then((res) => {
-          this.TreedataList = res.data.list;
-          this.TreedataList.forEach((item) => {
-            this.checkedListkey.push(item.proId);
-            this.DataList.push(item);
-            this.DataList.forEach((item) => {
-              item.propinName = this.Treedata[0].proName;
+        if (this.DataLists.length != 0) {
+          this.DataLists.forEach((selectionitem) => {
+            this.Treedata.forEach((item) => {
+              if (selectionitem.propinName == item.proName) {
+                item.disabled = true;
+              }
             });
           });
-          this.TotalPrice1 = 0;
+        }
+        // this.checkedkey.push(this.Treedata[0].proId);
+        // let proId = this.Treedata[0].proId;
+        // getProSonDxList(proId).then((res) => {
+        //   this.TreedataList = res.data.list;
+        //   this.TreedataList.forEach((item) => {
+        //     this.checkedListkey.push(item.proId);
+        //     this.DataList.push(item);
+        //     this.DataList.forEach((item) => {
+        //       item.propinName = this.Treedata[0].proName;
+        //     });
+        //   });
+        //   this.TotalPrice1 = 0;
+        //   this.marryall = 0;
+        //   if (this.DataList.length != 0) {
+        //     this.list1 = false;
+        //     this.DataList.forEach((item) => {
+        //       this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+        //       this.marryall += item.proPrice;
+        //     });
+        //   }
+        // });
+        this.loading = false;
+      });
+    },
 
-          if (this.DataList.length != 0) {
-            this.list1 = false;
-            this.DataList.forEach((item) => {
-              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+    handlepackage(data, checked, checkedNodes) {
+      if (checked.checkedNodes.length != 0) {
+        this.$refs.treas.setCheckedKeys([data.id]);
+        let datas = {
+          zhId: data.id,
+        };
+        getlistByZhId(datas).then((res) => {
+          this.packagedataList = res.data.tjProjectList;
+          for (var i = 0; i < this.packagedataList.length; i++) {
+            let proId = this.packagedataList[i].proId;
+            getProSonDxList(proId).then((res) => {
+              this.TreedataList = res.data.list;
+              this.TreedataList.forEach((item) => {
+                this.DataLists.push(item);
+                if (this.DataLists.length >= 1) {
+                  this.marryalls = 0;
+                  this.DataLists.forEach((item1) => {
+                    this.marryalls += item1.proPrice;
+                    this.packagedataList.forEach((item3) => {
+                      if (item1.proParentId == item3.proId) {
+                        item1.propinName = item3.proName;
+                      }
+                    });
+                  });
+                }
+              });
             });
           }
         });
-        this.loading = false;
-      });
+      } else if (checked.checkedNodes.length == 0) {
+        for (var i = 0; i < data.tjProjectList.length; i++) {
+          let proId = data.tjProjectList[i].proId;
+          getProSonDxList(proId).then((res) => {
+            this.TreedataList = res.data.list;
+            this.TreedataList.forEach((item) => {
+              this.DataLists.forEach((item1, index) => {
+                if (item.proId == item1.proId) {
+                  this.DataLists.splice(index, 1);
+                  
+                }
+              });
+            });
+            this.marryalls = 0
+            if(this.DataLists.length != 0){
+              this.DataLists.forEach((item1, index) => {
+              this.marryalls += item1.proPrice;
+              })
+            }
+          });
+        }
+      }
+    },
+
+    objectspanmethod({ row, column, rowIndex, columnIndex }) {
+      let fields = ["propinName"];
+      let cellValue = row[column.property];
+      if (cellValue && fields.includes(column.property)) {
+        let prevRow = this.DataLists[rowIndex - 1];
+        let nextRow = this.DataLists[rowIndex + 1];
+        if (prevRow && prevRow[column.property] === cellValue) {
+          return { rowspan: 0, colspan: 0 };
+        } else {
+          let countRowspan = 1;
+          while (nextRow && nextRow[column.property] === cellValue) {
+            nextRow = this.DataLists[++countRowspan + rowIndex];
+          }
+
+          if (countRowspan > 1) {
+            return { rowspan: countRowspan, colspan: 1 };
+          }
+        }
+      }
+
+      // if (columnIndex == 3) {
+      //   let rowspan = 0;
+      //   this.DataLists.forEach((element) => {
+      //     if (element.propinName === row.propinName) {
+      //       rowspan++;
+      //     }
+      //   });
+      //   return [rowspan, 1];
+      // }
     },
 
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
@@ -1614,10 +1997,12 @@
             });
           });
           this.TotalPrice1 = 0;
+          this.marryall = 0;
           if (this.DataList.length != 0) {
             this.list1 = false;
             this.DataList.forEach((item) => {
               this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+              this.marryall += item.proPrice;
             });
           }
         });
@@ -1650,8 +2035,10 @@
           if (item.proId == data.proId) {
             this.DataList.splice(index, 1);
             this.TotalPrice1 = 0;
+            this.marryall = 0;
             this.DataList.forEach((item1) => {
               this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+              this.marryall += item1.proPrice;
             });
           }
         });
@@ -1664,10 +2051,24 @@
         });
         this.spliceData();
         this.TotalPrice1 = 0;
+        this.marryall = 0;
         this.DataList.forEach((item1) => {
           this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+          this.marryall += item1.proPrice;
         });
       }
+    },
+
+    handleDel(row) {
+      this.DataLists.forEach((item, index) => {
+        if (item.proId == row.proId) {
+          this.DataLists.splice(index, 1);
+          this.marryalls = 0;
+          this.DataLists.forEach((item1) => {
+            this.marryalls += item1.proPrice;
+          });
+        }
+      });
     },
 
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -1675,16 +2076,17 @@
       this.DataList.forEach((item, index) => {
         if (item.proId == row.proId) {
           this.DataList.splice(index, 1);
+          this.marryall = 0;
           this.TotalPrice1 = 0;
           this.DataList.forEach((item1) => {
             this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+            this.marryall += item1.proPrice;
           });
         }
       });
     },
     //  // 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 }
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      console.log(row, column, rowIndex, columnIndex);
       let fields = ["propinName"];
       let cellValue = row[column.property];
       if (cellValue && fields.includes(column.property)) {
@@ -1747,6 +2149,11 @@
           this.proIds.push(item.proId);
         });
       }
+      if (this.DataLists.length != 0) {
+        this.DataLists.forEach((item) => {
+          this.proIds.push(item.proId);
+        });
+      }
       let data = {
         cusId,
         pacId: _this.pacId,

--
Gitblit v1.8.0