From bc44c8e3c9d85691ce3fa73ef1300a6fae46e365 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 18 三月 2025 19:07:08 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/views/business/costStatistics/index.vue |   75 ++++++++++++++++++++++++++++---------
 1 files changed, 56 insertions(+), 19 deletions(-)

diff --git a/src/views/business/costStatistics/index.vue b/src/views/business/costStatistics/index.vue
index 78d5a12..6cbb466 100644
--- a/src/views/business/costStatistics/index.vue
+++ b/src/views/business/costStatistics/index.vue
@@ -1,4 +1,8 @@
 <style scoped>
+.costStatistics {
+  width: 100%;
+  height: 100%;
+}
 .title {
   height: 60px;
   line-height: 60px;
@@ -49,15 +53,20 @@
 </style>
 
 <template>
-  <div class="inspection_order">
-    <div style="width: 100%; height: 100%">
+  <div>
+    <div class="costStatistics bg-1">
       <div>
         <el-row class="title">
           <el-col :span="12" style="padding-left: 20px; text-align: left"
             >璐圭敤缁熻</el-col
           >
           <el-col :span="12" style="text-align: right">
-            <el-button size="small" type="primary">OA鎺ㄩ��</el-button>
+            <el-button
+              size="small"
+              type="primary"
+              v-hasPermi="['business:costStatistics:OA']"
+              >OA鎺ㄩ��</el-button
+            >
           </el-col>
         </el-row>
       </div>
@@ -83,8 +92,6 @@
         <div class="search_thing" style="width: 340px">
           <div class="search_label">濮旀墭鍗曚綅锛�</div>
           <div class="search_input">
-            <!--            <el-input size="small" placeholder="璇疯緭鍏�" clearable-->
-            <!--               @keyup.enter.native="refreshTable()"></el-input>-->
             <el-select
               @focus="getCompanyOptions"
               @change="refreshTable()"
@@ -109,7 +116,6 @@
             >鏌� 璇�</el-button
           >
         </div>
-        <!-- <div class="search_thing" style="padding-left: 70px;">鎬讳环锛歿{total}}</div> -->
         <div class="search_thing" style="margin-left: 50px">
           <div style="width: 100%; text-align: right">鎬讳环锛�</div>
           <el-statistic
@@ -125,24 +131,18 @@
             type="primary"
             @click="handleDown"
             :loading="outLoading"
+            v-hasPermi="['business:costStatistics:export']"
             >瀵煎嚭</el-button
           >
         </div>
       </div>
       <div class="table">
-        <!-- <ValueTable
-          ref="ValueTable"
-          :url="$api.insOrder.costStatistics"
-          :componentData="componentData"
-          :key="upIndex"
-          @handleWeave="handleWeave"
-          :column-min-width="'140'"
-        /> -->
         <lims-table
           :tableData="tableData"
+          :parentSpanMethod="spanMethod"
           :column="column"
           :tableLoading="tableLoading"
-          :height="'calc(100vh - 270px)'"
+          :height="tableHeight"
           :page="page"
           @pagination="pagination"
         ></lims-table>
@@ -178,6 +178,7 @@
   },
   data() {
     return {
+      tableHeight: "",
       tableData: [],
       column: [
         {
@@ -237,12 +238,48 @@
       outLoading: false,
     };
   },
+  created() {
+    this.getTableHeight();
+  },
   mounted() {
     this.getDates();
     this.refreshTable();
     this.entityCopy = this.HaveJson(this.entity);
   },
   methods: {
+    // 鍚堝苟鍗曞厓鏍�
+    spanMethod({row, column, rowIndex, columnIndex}) {
+      // 濮旀墭鍗曞彿鐩稿悓鐨勮繘琛屼竴涓垪鍚堝苟
+      const mergeColumns = [1,2,8,9]
+      if (
+        mergeColumns.includes(columnIndex)
+      ) {
+        // 濡傛灉鏄涓�琛岋紝 鎴栬�呬笂涓�琛屾暟鎹殑濮旀墭鍗曞彿鍜屽綋鍓嶈鐨勫鎵樺崟鍙蜂笉涓�鏍�
+        if (
+          rowIndex == 0 ||
+          row.entrustCode != this.tableData[rowIndex - 1].entrustCode
+        ) {
+          // 璁$畻闇�瑕佸悎骞剁殑琛屾暟
+          let rowspan = 1;
+          while (
+            rowIndex + rowspan < this.tableData.length &&
+            row.entrustCode == this.tableData[rowIndex + rowspan].entrustCode
+          ) {
+            rowspan++;
+          }
+          return [rowspan, 1];
+        } else {
+          return [0, 0];
+        }
+      } else {
+        // 鍏朵粬鍒椾笉鍚堝苟
+        return [1, 1];
+      }
+    },
+    getTableHeight() {
+      const windowHeight = window.innerHeight;
+      this.tableHeight = windowHeight - 50 - 46 - 60 - 80 - 60 - 32 + "";
+    },
     getData() {
       this.tableLoading = true;
       let params = { ...this.page, ...this.entity };
@@ -252,15 +289,15 @@
         this.tableLoading = false;
       });
     },
-    pagination({ cutPage, size }) {
-      this.page.current = cutPage;
-      this.page.size = size;
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
       this.refreshTable();
     },
 
     handleDown() {
       let data = {
-        company: this.entity.company ? this.entity.company : '',
+        company: this.entity.company ? this.entity.company : "",
         startTime: this.dates[0],
         endTime: this.dates[1],
       };

--
Gitblit v1.9.3