From a2c6e0da9d51c37ceff8d0d7e1bb7f4f85f1deb5 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期三, 16 四月 2025 14:15:24 +0800
Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb

---
 src/views/system/comp/index.vue |  124 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 122 insertions(+), 2 deletions(-)

diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue
index 4902c6e..ce1944f 100644
--- a/src/views/system/comp/index.vue
+++ b/src/views/system/comp/index.vue
@@ -345,6 +345,10 @@
               </el-form-item>
               <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"
@@ -390,6 +394,7 @@
           <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 label="椤圭洰鍚嶇О" prop="proName">
                 <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable
                   @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -401,8 +406,8 @@
             <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>
@@ -447,6 +452,9 @@
               <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' }">
@@ -479,6 +487,7 @@
           <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 label="椤圭洰鍚嶇О" prop="proName">
                 <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable
                   @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -501,6 +510,30 @@
         </div>
       </el-dialog>
     </div>
+
+
+    <el-dialog title="閫夋嫨濂楅" :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"
+            style="width: 200px" />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handle">鎼滅储</el-button>
+        </el-form-item>
+      </el-form> -->
+      <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="閫夋嫨" />
+        <el-table-column label="濂楅鍚嶇О" align="center" prop="pacName" width="120px" />
+        <el-table-column label="濂楅浠锋牸" align="center" prop="price" width="120px" />
+        <el-table-column label="濂楅鏄庣粏" align="center" prop="allProName" :show-overflow-tooltip="true" />
+      </el-table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancel1">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submit">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
 
     <!-- 娣诲姞鎴栦慨鏀逛綋妫�鍗曚綅淇℃伅缁存姢瀵硅瘽妗� -->
     <div class="dia">
@@ -618,6 +651,8 @@
       id: "",
       // 閫変腑鏁扮粍
       ids: [],
+      newpacName1 : [],
+      taocan:false,
       // 鎺у埗鎬у埆閫夋嫨妗嗘槸鍚︾鐢�
       isSexDisabled: false,
       dwIds: [],
@@ -1537,6 +1572,32 @@
       row.index = rowIndex;
     },
 
+
+    Package() {
+      this.taocan = true;
+      deptTreeSelect(this.forms.sex).then((res) => {
+        if (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("鎼滅储澶辫触锛岃绋嶅悗閲嶈瘯");
+      });
+    },
+
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
       this.$refs["form"].validate((valid) => {
@@ -1583,6 +1644,65 @@
         })
         .catch(() => { });
     },
+
+    submit() {
+      if (!this.selectedPackage) {
+        this.$modal.msgError("璇峰厛閫夋嫨涓�涓椁�");
+        return;
+      }
+
+      // 娓呯┖宸︿晶琛ㄦ牸
+      this.OnenewpacName = [];
+
+      // 鑾峰彇閫変腑鐨勫椁愰」鐩垪琛�
+      const newProjects = this.selectedPackage.tjProjectList || [];
+
+      // 灏嗛�変腑鐨勫椁愰」鐩坊鍔犲埌宸︿晶琛ㄦ牸
+      this.loading = true;
+      newProjects.forEach(project => {
+        // 涓烘瘡涓」鐩缃粯璁ゆ姌鎵e拰鐜颁环
+        this.$set(project, 'limits', 10); // 榛樿鎶樻墸 10锛堝嵆鍘熶环锛�
+        this.$set(project, 'ysPrice', project.proPrice); // 鐜颁环鍒濆鍖栦负鍘熶环
+        this.OnenewpacName.push(project);
+      });
+
+      // 鏇存柊鎬讳环鍜岀幇浠�
+      this.queryParams.price = this.OnenewpacName.reduce((sum, item) => {
+        return sum + (item.proPrice || 0);
+      }, 0);
+
+      this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => {
+        return sum + (item.ysPrice || 0);
+      }, 0);
+
+      // 鏇存柊浼樻儬鍊�
+      this.youhui = this.queryParams.price > 0
+        ? (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10
+        : 0;
+
+      // 鍏抽棴瀵硅瘽妗�
+      this.taocan = false;
+      this.loading = false;
+      this.$modal.msgSuccess("娣诲姞鎴愬姛");
+    },
+    cancel1() {
+      this.taocan = false;
+    },
+
+
+    handleSelectionChange1(selection) {
+      // 瀹炵幇鍗曢�夐�昏緫
+      if (selection.length > 1) {
+        const lastSelected = selection[selection.length - 1];
+        this.$refs.tb.clearSelection();
+        this.$refs.tb.toggleRowSelection(lastSelected, true);
+        this.selectedPackage = lastSelected;
+      } else if (selection.length === 1) {
+        this.selectedPackage = selection[0];
+      } else {
+        this.selectedPackage = null;
+      }
+    },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
       this.download(

--
Gitblit v1.8.0