From 00212ed8e808fc7b76c04389224e65f27f074fb2 Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期五, 26 四月 2024 15:30:04 +0800
Subject: [PATCH] su

---
 src/views/hosp/order/index.vue |  765 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 492 insertions(+), 273 deletions(-)

diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 9f9542a..88b2a51 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -26,6 +26,7 @@
           style="width: 170px"
           clearable
           @keyup.enter.native="handleQuery"
+          @blur="hb"
         />
       </el-form-item>
       <el-form-item label="鐧昏鏃堕棿" prop="createTimeList">
@@ -37,7 +38,7 @@
           style="width: 300px"
           start-placeholder="寮�濮嬫棩鏈�"
           end-placeholder="缁撴潫鏃ユ湡"
-          :default-time="['00:00:00', '23:00:00']"
+          :default-time="['00:00:00', '23:59:00']"
           format="yyyy-MM-dd HH:mm"
           value-format="yyyy-MM-dd HH:mm"
           @change="dateChangebirthday1"
@@ -171,6 +172,7 @@
           <template slot-scope="scope">
             <span v-if="scope.row.tjCustomerSex == '0'">鐢�</span>
             <span v-if="scope.row.tjCustomerSex == '1'">濂�</span>
+            <span v-if="scope.row.tjCustomerSex == '2'">鏈煡</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -318,7 +320,7 @@
               title="浣撴鎶ュ憡"
               @click="viewReport(scope.row)"
             ></el-button> -->
-               <!-- <el-button
+            <!-- <el-button
               type="text"
               size="mini"
               class="btn"
@@ -327,7 +329,7 @@
               v-if="scope.row.tjCategory == '02'"
               @click="viewReport(scope.row)"
             ></el-button> -->
-            
+
             <el-button
               type="text"
               size="mini"
@@ -410,145 +412,170 @@
     <el-dialog
       :title="title"
       :visible.sync="Projectopen"
-      width="980px"
+      width="1100px"
       style="height: 860px"
       append-to-body
     >
       <el-row type="flex" class="row-bg" justify="space-around">
         <el-col :span="6">
-          <div style="text-align: center; margin-bottom: 10px;margin-top:10px">椤圭洰鍒楄〃</div>
+          <div
+            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
+          >
+            椤圭洰鍒楄〃
+          </div>
+          <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
+          </el-input>
           <div class="tab3">
-            <div class="outside1">
+           
               <el-tree
+                class="filter-tree"
+                v-loading="loading"
                 :data="Treedata"
+                :props="defaultProps"
                 show-checkbox
                 node-key="proId"
-                :props="defaultProps"
-                @check-change="handleCurrentChecked"
+                @check="handleCurrentChecked"
+                :default-checked-keys="checkedkey"
+                :filter-node-method="filterNode"
+                ref="tree"
               >
               </el-tree>
+           
+          </div>
+        </el-col>
+        <el-col :span="5">
+          <div
+            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
+          >
+            鏄庣粏椤圭洰鍒楄〃
+          </div>
+          <div class="tab3">
+              <el-tree
+                class="filter-tree"
+                v-loading="loading"
+                :data="TreedataList"
+                node-key="proId"
+                :props="defaultProps"
+                :filter-node-method="filterNode"
+                show-checkbox
+                @check-change="handleCurrentChecked1"
+                :default-checked-keys="checkedListkey"
+              >
+              </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="DataList"
+                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="handleDelete(scope.row)"
+                      title="鍒犻櫎"
+                      ></el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-collapse v-model="activeName" accordion v-if="list1">
+                <div>
+                  <el-collapse-item title="璇烽�夋嫨椤圭洰">
+                    <el-table :data="DataList" border style="width: 100%">
+                      <el-table-column prop="proName" label="椤圭洰" width="180">
+                      </el-table-column>
+                      <el-table-column prop="ordPrice" label="鍘熶环">
+                      </el-table-column>
+                    </el-table>
+                  </el-collapse-item>
+                </div>
+              </el-collapse>
+            <template>
+              <el-form :model="form">
+                <el-form-item label="浣撴绫诲瀷" prop="tjType">
+                  <el-radio-group v-model="form.tjType">
+                    <el-radio :label="1">鍥㈤槦</el-radio>
+                    <el-radio :label="2">涓汉</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-form>
+            </template>
+
+            <div class="outside">
+              <el-form :inline="true" class="outside1">
+                <el-form-item label="鍘熶环">
+                  <el-input
+                    placeholder="鍘熶环"
+                    :value="TotalPrice1"
+                    disabled
+                    style="width: 90px"
+                  ></el-input>
+                </el-form-item>
+                <el-form-item label="鎶樻墸璁惧畾">
+                  <el-input
+                    style="width: 90px"
+                    type="number"
+                    v-model="discount"
+                    :value="discount"
+                  ></el-input>
+                </el-form-item>
+                <el-form-item label="搴斾粯閲戦">
+                  <el-input
+                    placeholder="搴斾粯閲戦"
+                    :value="TotalPrice1 * (discount / 10)"
+                    style="width: 90px"
+                  ></el-input>
+                </el-form-item>
+                <el-form-item label="浠樻绫诲瀷" prop="payType">
+                  <el-select
+                    style="width: 120px"
+                    v-model="payType"
+                    placeholder="璇烽�夋嫨浠樻绫诲瀷"
+                  >
+                    <el-option
+                      v-for="dict in dict.type.dict_pay_type"
+                      :key="dict.value"
+                      :label="dict.label"
+                      :value="dict.value"
+                    ></el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item>
+                  <el-button
+                    type="primary"
+                    @click="submitPrice"
+                    :disabled="confirm"
+                    style="margin-top: 34px"
+                    >鏀惰垂</el-button
+                  >
+                </el-form-item>
+              </el-form>
             </div>
           </div>
         </el-col>
-        <div>
-          <el-col :span="18">
-            <div class="grid-content bg-purple">
-              <template>
-                <el-form :model="form">
-                  <el-form-item label="浣撴绫诲瀷" prop="tjType">
-                    <el-radio-group v-model="form.tjType">
-                      <el-radio :label="1">鍥㈤槦</el-radio>
-                      <el-radio :label="2">涓汉</el-radio>
-                    </el-radio-group>
-                  </el-form-item>
-                </el-form>
-              </template>
-
-              <div class="outside">
-                <el-form :inline="true" class="outside1">
-                  <el-form-item label="鍘熶环">
-                    <el-input
-                      placeholder="鍘熶环"
-                      :value="TotalPrice1"
-                      disabled
-                      style="width: 90px"
-                    ></el-input>
-                  </el-form-item>
-                  <el-form-item label="鎶樻墸璁惧畾">
-                    <el-input
-                      style="width: 90px"
-                      type="number"
-                      v-model="discount"
-                      :value="discount"
-                    ></el-input>
-                  </el-form-item>
-                  <el-form-item label="搴斾粯閲戦">
-                    <el-input
-                      placeholder="搴斾粯閲戦"
-                      :value="TotalPrice1 * (discount / 10)"
-                      style="width: 90px"
-                    ></el-input>
-                  </el-form-item>
-                  <el-form-item label="浠樻绫诲瀷" prop="payType">
-                    <el-select
-                      style="width: 120px"
-                      v-model="payType"
-                      placeholder="璇烽�夋嫨浠樻绫诲瀷"
-                    >
-                      <el-option
-                        v-for="dict in dict.type.dict_pay_type"
-                        :key="dict.value"
-                        :label="dict.label"
-                        :value="dict.value"
-                      ></el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item>
-                    <el-button
-                      type="primary"
-                      @click="submitPrice"
-                      :disabled="confirm"
-                      style="margin-top: 34px"
-                      >鏀惰垂</el-button
-                    >
-                  </el-form-item>
-                </el-form>
-              </div>
-              <div style="text-align: center; margin-bottom: 10px">
-                宸查�夐」鐩垪琛�
-              </div>
-              <div
-                style="
-                  padding: 0px 6px;
-                  border: 1px solid #e6ebf5;
-                  max-height: 420px;
-                  overflow: auto;
-                "
-              >
-                <el-collapse v-model="activeName" accordion>
-                  <div v-for="(item, index) in DataList" :key="index">
-                    <el-collapse-item>
-                      <template slot="title">
-                        {{ item.proName + "(" + "鍘熶环" + item.proPrice + ")" }}
-                      </template>
-                      <el-table
-                        :data="item.tjProjectList"
-                        border
-                        style="width: 100%"
-                        height="250"
-                      >
-                        <el-table-column
-                          prop="proName"
-                          label="椤圭洰"
-                          width="180"
-                        >
-                        </el-table-column>
-                        <el-table-column prop="proPrice" label="鍘熶环">
-                        </el-table-column>
-                      </el-table>
-                    </el-collapse-item>
-                  </div>
-                </el-collapse>
-                <el-collapse v-model="activeName" accordion v-if="list1">
-                  <div>
-                    <el-collapse-item title="璇烽�夋嫨椤圭洰">
-                      <el-table :data="DataList" border style="width: 100%">
-                        <el-table-column
-                          prop="proName"
-                          label="椤圭洰"
-                          width="180"
-                        >
-                        </el-table-column>
-                        <el-table-column prop="ordPrice" label="鍘熶环">
-                        </el-table-column>
-                      </el-table>
-                    </el-collapse-item>
-                  </div>
-                </el-collapse>
-              </div>
-            </div>
-          </el-col>
-        </div>
       </el-row>
     </el-dialog>
 
@@ -556,29 +583,110 @@
     <el-dialog
       :title="title"
       :visible.sync="Projectopen1"
-      width="980px"
+      width="1100px"
       style="height: 860px"
       append-to-body
     >
       <el-row type="flex" class="row-bg" justify="space-around">
         <el-col :span="6">
-          <div style="text-align: center; margin-bottom: 10px;margin-top:10px">椤圭洰鍒楄〃</div>
+          <div
+            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
+          >
+            椤圭洰鍒楄〃
+          </div>
+          <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
+          </el-input>
+          <div class="tab3">
+           
+              <el-tree
+                class="filter-tree"
+                v-loading="loading"
+                :data="Treedata"
+                :props="defaultProps"
+                show-checkbox
+                node-key="proId"
+                @check="handleCurrentChecked"
+                :default-checked-keys="checkedkey"
+                :filter-node-method="filterNode"
+                ref="tree"
+              >
+              </el-tree>
+           
+          </div>
+        </el-col>
+        <el-col :span="5">
+          <div
+            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
+          >
+          鏄庣粏椤圭洰鍒楄〃
+          </div>
           <div class="tab3">
             <div class="outside1">
               <el-tree
-                :data="Treedata"
-                show-checkbox
+                class="filter-tree"
+                v-loading="loading"
+                :data="TreedataList"
                 node-key="proId"
                 :props="defaultProps"
-                @check-change="handleCurrentChecked"
+                :filter-node-method="filterNode"
+                show-checkbox
+                @check-change="handleCurrentChecked1"
+                :default-checked-keys="checkedListkey"
               >
               </el-tree>
             </div>
           </div>
         </el-col>
-
-        <el-col :span="18">
+        <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="DataList"
+                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="handleDelete(scope.row)"
+                      title="鍒犻櫎"
+                    ></el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-collapse v-model="activeName" accordion v-if="list1">
+                <div>
+                  <el-collapse-item title="璇烽�夋嫨椤圭洰">
+                    <el-table :data="DataList" border style="width: 100%" height="400"  :span-method="objectSpanMethod">
+                      <el-table-column prop="proName" label="椤圭洰" width="180">
+                      </el-table-column>
+                      <el-table-column prop="ordPrice" label="鍘熶环">
+                      </el-table-column>
+                    </el-table>
+                  </el-collapse-item>
+                </div>
+              </el-collapse>
+            
             <template>
               <el-form :model="form">
                 <el-form-item label="浣撴绫诲瀷" prop="tjType">
@@ -640,50 +748,6 @@
                 </el-form-item>
               </el-form>
             </div>
-            <div style="text-align: center; margin-bottom: 10px">
-              宸查�夐」鐩垪琛�
-            </div>
-            <div
-              style="
-                padding: 0px 6px;
-                border: 1px solid #e6ebf5;
-                max-height: 420px;
-                overflow: auto;
-              "
-            >
-              <el-collapse v-model="activeName" accordion>
-                <div v-for="(item, index) in DataList" :key="index">
-                  <el-collapse-item>
-                    <template slot="title">
-                      {{ item.proName + "(" + "鍘熶环" + item.proPrice + ")" }}
-                    </template>
-                    <el-table
-                      :data="item.tjProjectList"
-                      border
-                      style="width: 100%"
-                      height="250"
-                    >
-                      <el-table-column prop="proName" label="椤圭洰" width="180">
-                      </el-table-column>
-                      <el-table-column prop="proPrice" label="鍘熶环">
-                      </el-table-column>
-                    </el-table>
-                  </el-collapse-item>
-                </div>
-              </el-collapse>
-              <el-collapse v-model="activeName" accordion v-if="list1">
-                <div>
-                  <el-collapse-item title="璇烽�夋嫨椤圭洰">
-                    <el-table :data="DataList" border style="width: 100%">
-                      <el-table-column prop="proName" label="椤圭洰" width="180">
-                      </el-table-column>
-                      <el-table-column prop="ordPrice" label="鍘熶环">
-                      </el-table-column>
-                    </el-table>
-                  </el-collapse-item>
-                </div>
-              </el-collapse>
-            </div>
           </div>
         </el-col>
       </el-row>
@@ -733,17 +797,21 @@
 
 <script>
 import {
-  listOrder,
   getNumber,
-  hasReportEnd,
   hasReport,
-  gettoPdf,
   getPdf,
   getOrderList,
+  getNewDateList,
 } from "@/api/hosp/order";
+import moment from "moment";
 import { getwater } from "@/api/hosp/customer";
 import ViewPdf from "@/components/ViewPdf";
-import { projectGetList, getaddtTransition } from "@/api/system/tijian";
+import {
+  projectGetList,
+  getaddtTransition,
+  getProParentIdDxList,
+  getProSonDxList,
+} from "@/api/system/tijian";
 export default {
   components: {
     ViewPdf,
@@ -752,6 +820,7 @@
   name: "Order",
   data() {
     return {
+      filterText: "",
       orderIds: "",
       tjnumbers: "",
       cusIds: "",
@@ -773,10 +842,13 @@
       flag: true,
       bill: null,
       Treedata: [],
+      checkedkey: [],
+      checkedListkey: [],
       defaultProps: {
-        children: "tjProjectList",
+        children: [],
         label: "proName",
       },
+      TreedataList: [],
       discount: 10,
       DataList: [],
       // 濂楅鎻愪氦鎸夐挳
@@ -791,6 +863,7 @@
       loading: true,
       // 閫変腑鏁扮粍
       ids: [],
+      dataObj:{},
       // 闈炲崟涓鐢�
       single: true,
       // 闈炲涓鐢�
@@ -860,9 +933,15 @@
       },
     };
   },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
   created() {
-    this.getNowTime();
-    this.getList();
+    // this.getNowTime();
+
+    this.getdate();
   },
   mounted() {
     this.$nextTick(() => {
@@ -870,37 +949,52 @@
     });
   },
   methods: {
+    getdate() {
+      getNewDateList().then((res) => {
+        if (res.data) {
+          this.createTimeList = [
+            moment(res.data).format("YYYY-MM-DD 00:00:00"),
+            moment(res.data).format("YYYY-MM-DD 23:59:00"),
+          ];
+          this.getList();
+        }
+      });
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.proName.indexOf(value) !== -1;
+    },
     // / 澶勭悊榛樿閫変腑褰撳墠鏃ユ湡
-    getNowTime() {
-      var curDate = new Date(new Date().setHours(0, 0, 0, 0)).getTime();
-      var dayNum = 7 * 24 * 3600 * 1000;
-      var threeDays = curDate - dayNum;
-      var sDay = this.getLocalTime(threeDays);
-      var end = this.getLocalTime(curDate);
-      this.createTimeList = [sDay, end];
-    },
-    add0(m) {
-      return m < 10 ? "0" + m : m;
-    },
-    getLocalTime(nS) {
-      var time = new Date(nS);
-      var y = time.getFullYear();
-      var m = time.getMonth() + 1;
-      var d = time.getDate();
-      var h = time.getHours();
-      var mm = time.getMinutes();
-      return (
-        y +
-        "-" +
-        this.add0(m) +
-        "-" +
-        this.add0(d) +
-        " " +
-        this.add0(h) +
-        ":" +
-        this.add0(mm)
-      );
-    },
+    // getNowTime() {
+    //   var curDate = new Date(new Date().setHours(0, 0, 0, 0)).getTime();
+    //   var dayNum = 7 * 24 * 3600 * 1000;
+    //   var threeDays = curDate - dayNum;
+    //   var sDay = this.getLocalTime(threeDays);
+    //   var end = this.getLocalTime(curDate);
+    //   this.createTimeList = [sDay, end];
+    // },
+    // add0(m) {
+    //   return m < 10 ? "0" + m : m;
+    // },
+    // getLocalTime(nS) {
+    //   var time = new Date(nS);
+    //   var y = time.getFullYear();
+    //   var m = time.getMonth() + 1;
+    //   var d = time.getDate();
+    //   var h = time.getHours();
+    //   var mm = time.getMinutes();
+    //   return (
+    //     y +
+    //     "-" +
+    //     this.add0(m) +
+    //     "-" +
+    //     this.add0(d) +
+    //     " " +
+    //     this.add0(h) +
+    //     ":" +
+    //     this.add0(mm)
+    //   );
+    // },
     dateChangebirthday1(val) {
       this.startTime = val;
     },
@@ -909,10 +1003,21 @@
     },
     /** 鏌ヨ浣撴璁板綍鍒楄〃 */
     getList() {
-      this.queryParams.djbeginTime = this.startTime[0];
-      this.queryParams.djendTime = this.startTime[1];
-      this.queryParams.bgbeginTime = this.startTime1[0];
-      this.queryParams.bgendTime = this.startTime1[1];
+      if (this.startTime) {
+        this.queryParams.djbeginTime = this.startTime[0];
+        this.queryParams.djendTime = this.startTime[1];
+      } else if (this.createTimeList) {
+        this.queryParams.djbeginTime = this.createTimeList[0];
+        this.queryParams.djendTime = this.createTimeList[1];
+      } else if (this.createTimeList == null) {
+        this.queryParams.djbeginTime = null;
+        this.queryParams.djendTime = null;
+      }
+      if (this.startTime1) {
+        this.queryParams.bgbeginTime = this.startTime1[0];
+        this.queryParams.bgendTime = this.startTime1[1];
+      }
+
       this.loading = true;
       getOrderList(this.queryParams).then((response) => {
         this.orderList = response.data.list;
@@ -1038,6 +1143,11 @@
       };
       this.resetForm("form");
     },
+    hb() {
+      if (this.queryParams.tjNum != undefined) {
+        this.handleQuery();
+      }
+    },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -1045,6 +1155,9 @@
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
+      this.startTime = [];
+      this.startTime1 = [];
+      this.createTimeList = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -1097,6 +1210,8 @@
 
     // 琛ュ綍椤圭洰
     handleProject(row) {
+      this.loading = true;
+      this.DataList = [];
       this.orderId = row.orderId;
       this.cusId = row.tjCusIdCard;
       this.userId = row.userId;
@@ -1112,14 +1227,41 @@
         this.form.tjType = 0;
       }
       /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
-      projectGetList().then((response) => {
-        this.Treedata = response.data.list;
-      });
+      this.getDataList();
       this.Projectopen = true;
       this.title = "琛ュ綍椤圭洰";
     },
+
+    getDataList() {
+      getProParentIdDxList().then((response) => {
+        this.Treedata = response.data.list;
+        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;
+
+          if (this.DataList.length != 0) {
+            this.list1 = false;
+            this.DataList.forEach((item) => {
+              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+            });
+          }
+        });
+        this.loading = false;
+      });
+    },
     // 琛ュ綍椤圭洰
-    handleProject1(row) {
+    handleProject1() {
+      this.loading = true;
+      this.DataList = [];
       this.orderId = this.ids;
       this.cusId = this.cusIds;
       this.userId = this.userIds;
@@ -1129,56 +1271,130 @@
         cusPhone: this.cusPhone,
         cusSex: this.cusSex,
       };
-      if (row.tjType) {
-        this.form.tjType = parseInt(row.tjType);
-      } else {
-        this.form.tjType = 0;
-      }
       /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
-      projectGetList().then((response) => {
-        this.Treedata = response.data.list;
-      });
+      this.getDataList();
       this.Projectopen1 = true;
       this.title = "琛ュ綍椤圭洰";
     },
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
-      if (!data.tjProjectList) {
-        return;
-      }
-      if (checked === true) {
-        this.DataList.push(data);
-      } else {
-        this.DataList.pop(data);
-        this.list1 = true;
-      }
-      // let DataList = selectedobj.checkedNodes
-      // if (DataList.length>0) {
-      //   DataList.forEach(item => {
-      //     if (nodeobj.proId === item.proId) {
-      //       this.DataList = []
-      //       this.DataList.push(item)
-
-      //       this.list1 = false;
-      //     }
-      //   })
-      // }else{
-      //   this.DataList = []
-      //   this.list1 = true;
-      // }
-      this.TotalPrice1 = 0;
-      this.proIds = [];
-      if (this.DataList.length != 0) {
-        this.list1 = false;
-        this.DataList.forEach((item) => {
-          this.TotalPrice1 = item.proPrice + this.TotalPrice1;
-          this.proIds.push(item.proId);
+      this.dataObj = data
+      if (checked.checkedNodes.length != 0) {
+        this.$refs.tree.setCheckedKeys([data.proId]);
+        let proId = data.proId;
+        getProSonDxList(proId).then((res) => {
+          this.TreedataList = res.data.list;
+          this.TreedataList.forEach((item) => {
+            this.checkedListkey.push(item.proId);
+            this.DataList.push(item);
+            this.spliceData();
+            this.DataList.forEach((item1) => {
+              if (item1.proParentId == data.proId) {
+                item1.propinName = data.proName;
+              }
+            });
+          });
+          this.TotalPrice1 = 0;
+          if (this.DataList.length != 0) {
+            this.list1 = false;
+            this.DataList.forEach((item) => {
+              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+            });
+          }
         });
+      } else if (checked.checkedNodes.length == 0) {
+        let proId = data.proId;
+        getProSonDxList(proId).then((res) => {
+          this.TreedataList = res.data.list;
+          this.checkedListkey = [];
+        });
+        
+      }
+    },
+
+    spliceData() {
+      for (var i = 0; i < this.DataList.length; i++) {
+        for (var j = i + 1; j < this.DataList.length; j++) {
+          if (this.DataList[i].proId == this.DataList[j].proId) {
+            //濡傛灉绗竴涓瓑浜庣浜屼釜锛宻plice鏂规硶鍒犻櫎绗簩涓�
+            this.DataList.splice(j, 1);
+            j--;
+          }
+        }
+      }
+      return this.DataList;
+    },
+
+    // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
+    handleCurrentChecked1(data, checked, checkedNodes) {
+      if (checked == false) {
+        this.DataList.forEach((item, index) => {
+          if (item.proId == data.proId) {
+            this.DataList.splice(index, 1);
+            this.TotalPrice1 = 0;
+            this.DataList.forEach((item1) => {
+              this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+            });
+          }
+        });
+      } else if (checked == true) {
+        this.DataList.push(data);
+        this.DataList.forEach((item1) => {
+              if (item1.proParentId == this.dataObj.proId) {
+                item1.propinName = this.dataObj.proName;
+              }
+            });
+        this.spliceData()
+        this.TotalPrice1 = 0;
+        this.DataList.forEach((item1) => {
+          this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+        });
+      }
+    },
+
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+    handleDelete(row) {
+      this.DataList.forEach((item, index) => {
+        if (item.proId == row.proId) {
+          this.DataList.splice(index, 1);
+          this.TotalPrice1 = 0;
+          this.DataList.forEach((item1) => {
+            this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+          });
+        }
+      });
+    },
+
+     //  // 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 }
+     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)) {
+        let prevRow = this.DataList[rowIndex - 1];
+        let nextRow = this.DataList[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.DataList[++countRowspan + rowIndex];
+          }
+          if (countRowspan > 1) {
+            return { rowspan: countRowspan, colspan: 1 };
+          }
+        }
       }
     },
 
     // 鏀惰垂鎸夐挳
     submitPrice() {
+      this.proIds = [];
+      if (this.DataList.length != 0) {
+        this.DataList.forEach((item) => {
+          this.proIds.push(item.proId);
+        });
+      }
       let data = {
         cusId: this.cusId,
         proIds: this.proIds,
@@ -1214,6 +1430,12 @@
     },
     // 鏀惰垂鎸夐挳
     submitPrice1() {
+      this.proIds = [];
+      if (this.DataList.length != 0) {
+        this.DataList.forEach((item) => {
+          this.proIds.push(item.proId);
+        });
+      }
       let data = {
         cusId: this.cusIds,
         proIds: this.proIds,
@@ -1268,16 +1490,7 @@
     //     }
     //   });
     // },
-    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
-    // handleDelete(row) {
-    //   const orderIds = row.orderId || this.ids;
-    //   this.$modal.confirm('鏄惁纭鍒犻櫎浣撴璁板綍缂栧彿涓�"' + orderIds + '"鐨勬暟鎹」锛�').then(function() {
-    //     return delOrder(orderIds);
-    //   }).then(() => {
-    //     this.getList();
-    //     this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-    //   }).catch(() => {});
-    // },
+
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
       this.download(
@@ -1344,13 +1557,19 @@
 // }
 
 .outside {
-  width: 700px;
+  width: 500px;
   display: flex;
   margin-top: 8px;
 }
 
+.tab3 {
+  max-height: 500px;
+  overflow-y: auto;
+  border: 1px solid #d9d9d9;
+}
+
 .outside1 {
-  width: 700px;
+  width: 500px;
   display: flex;
   margin-top: 8px;
 }

--
Gitblit v1.8.0