Browse Source

2022.5.12 10:08

山水共长天一色 3 years ago
parent
commit
80c8af8f3c

+ 7 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -314,31 +314,31 @@
             <!-- 工时成本预警表 -->
             <!-- 工时成本预警表 -->
             <el-table v-if="ins == 7" :key="ins" border :data="baseCostList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
             <el-table v-if="ins == 7" :key="ins" border :data="baseCostList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
             <!-- 当前总预算,已发生工时成本,xxx成本预算,xxx已发生成本,xxx已发生占比, yyy成本预算,yyy已发生成本,yyy已发生占比。 -->
             <!-- 当前总预算,已发生工时成本,xxx成本预算,xxx已发生成本,xxx已发生占比, yyy成本预算,yyy已发生成本,yyy已发生占比。 -->
-                <el-table-column  prop="projectCode" label="项目编号"  width="120"></el-table-column>
-                <el-table-column  prop="projectName" label="项目名称" width="200"></el-table-column>
-                <el-table-column prop="baseCurcost" label="当前总预算" width="100" align="right">
+                <el-table-column  prop="projectCode" label="项目编号"  width="120" fixed></el-table-column>
+                <el-table-column  prop="projectName" label="项目名称" min-width="200" fixed></el-table-column>
+                <el-table-column prop="baseCurcost" label="当前总预算" min-width="160" align="right">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                     <span>¥{{scope.row.baseCurcost | numberToCurrency}}</span>
                     <span>¥{{scope.row.baseCurcost | numberToCurrency}}</span>
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column prop="feeMan" label="已发生工时成本" width="100" align="right">
+                <el-table-column prop="feeMan" label="已发生工时成本" min-width="160" align="right">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                     <span :class="scope.row.baseCurcost * 0.9 < scope.row.feeMan ? 'warntext' : ''">¥{{scope.row.feeMan | numberToCurrency}}</span>
                     <span :class="scope.row.baseCurcost * 0.9 < scope.row.feeMan ? 'warntext' : ''">¥{{scope.row.feeMan | numberToCurrency}}</span>
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
                 <template v-for="item in baseCostColumns">
                 <template v-for="item in baseCostColumns">
-                  <el-table-column :label="item.name + '成本预算'" width="100" align="right">
+                  <el-table-column :label="item.name + '成本预算'" min-width="200" align="right">
                     <template slot-scope="scope">
                     <template slot-scope="scope">
                       <span>¥{{budgetFilter(scope.row.curcostList,item.id) | numberToCurrency}}</span>
                       <span>¥{{budgetFilter(scope.row.curcostList,item.id) | numberToCurrency}}</span>
                     </template>
                     </template>
                   </el-table-column>
                   </el-table-column>
-                  <el-table-column :label="item.name + '已发生成本'" width="100" align="right">
+                  <el-table-column :label="item.name + '已发生成本'" min-width="200" align="right">
                     <template slot-scope="scope">
                     <template slot-scope="scope">
                       <span :class="percentageFilter(scope.row,item.id) > 90 ? 'warntext' : ''"
                       <span :class="percentageFilter(scope.row,item.id) > 90 ? 'warntext' : ''"
                       >¥{{AlreadyFilter(scope.row.realcostList,item.id) | numberToCurrency}}</span>
                       >¥{{AlreadyFilter(scope.row.realcostList,item.id) | numberToCurrency}}</span>
                     </template>
                     </template>
                   </el-table-column>
                   </el-table-column>
-                  <el-table-column :label="item.name + '已发生占比'" width="100" align="right">
+                  <el-table-column :label="item.name + '已发生占比'" min-width="200" align="right">
                     <template slot-scope="scope">
                     <template slot-scope="scope">
                       <span :class="percentageFilter(scope.row,item.id) > 90 ? 'warntext' : ''"
                       <span :class="percentageFilter(scope.row,item.id) > 90 ? 'warntext' : ''"
                       >{{percentageFilter(scope.row,item.id) == 'NaN' ? '-' : percentageFilter(scope.row,item.id) + '%'}}</span>
                       >{{percentageFilter(scope.row,item.id) == 'NaN' ? '-' : percentageFilter(scope.row,item.id) + '%'}}</span>

+ 81 - 62
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -852,7 +852,8 @@
           </div>
           </div>
 
 
           <el-table ref="hasworkTbl"
           <el-table ref="hasworkTbl"
-            :data="monthworkDateS"
+            :data="monthWorkDataS"
+            v-el-table-infinite-scroll="listScroll"
             border
             border
             :height="500"
             :height="500"
             highlight-current-row
             highlight-current-row
@@ -961,6 +962,8 @@
               </template>
               </template>
             </el-table-column>
             </el-table-column>
           </el-table>
           </el-table>
+          <el-alert v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
+          <el-alert v-if="isMore" title="无更多数据" type="warning" center show-icon></el-alert>
 
 
           <!-- <div slot="title" class="dialog-title selectworktime_title">
           <!-- <div slot="title" class="dialog-title selectworktime_title">
             <label style="font-size: 16px">员工每日已填报工时数</label>
             <label style="font-size: 16px">员工每日已填报工时数</label>
@@ -1021,9 +1024,9 @@
             v-loading="tbload"
             v-loading="tbload"
             lazy
             lazy
           >
           >
-            <el-table-column min-width="300" fixed="left" label="部门" prop="department">
+            <el-table-column min-width="300" label="部门" prop="department">
             </el-table-column>
             </el-table-column>
-            <el-table-column min-width="300" prop="name" fixed="left" label="姓名" >
+            <el-table-column min-width="300" prop="name" label="姓名" >
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
               min-width="300"
               min-width="300"
@@ -1034,7 +1037,7 @@
             </el-table-column>
             </el-table-column>
           </el-table>
           </el-table>
           <el-alert v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
           <el-alert v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
-          <el-alert v-if="isMore" title="无更多数据" type="warning" center show-icon></el-alert>
+          <el-alert v-if="isMore" title="无更多数据" type="success" center show-icon></el-alert>
         </el-tab-pane>
         </el-tab-pane>
       </el-tabs>
       </el-tabs>
     </el-dialog>
     </el-dialog>
@@ -1221,7 +1224,7 @@
                 tbload: false,
                 tbload: false,
                 exportTimeDialog: false,
                 exportTimeDialog: false,
                 searchKeyword: '',
                 searchKeyword: '',
-                monthworkDateS: [],
+                monthWorkDataS: [],
                 monthNotWorkDateS: [],
                 monthNotWorkDateS: [],
                 pickDateArray:[],
                 pickDateArray:[],
       WorktimeDatepickValue: [],
       WorktimeDatepickValue: [],
@@ -1386,10 +1389,10 @@
                 monthTotalPage: 0,
                 monthTotalPage: 0,
                 monthTotalLages: 20,
                 monthTotalLages: 20,
 
 
-                monthworkDate: [],
+                monthWorkData: [],
                 monthNotWorkDate: [],
                 monthNotWorkDate: [],
 
 
-                monthworkDateS1: [],
+                monthWorkDataS1: [],
                 monthnotTotal: 0,
                 monthnotTotal: 0,
                 monthnotTotalPage: 0,
                 monthnotTotalPage: 0,
                 monthnotTotalLages: 20,
                 monthnotTotalLages: 20,
@@ -1452,8 +1455,8 @@
                             this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
                             this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
                         }
                         }
                     }
                     }
-                    if (this.monthNotWorkDateS1.length > 20) {
-                        this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,20);
+                    if (this.monthNotWorkDateS1.length > 50) {
+                        this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
                     }else{
                     }else{
                         this.monthNotWorkDateS = this.monthNotWorkDateS1 
                         this.monthNotWorkDateS = this.monthNotWorkDateS1 
                     }
                     }
@@ -1463,22 +1466,22 @@
                     //     }, 1000);
                     //     }, 1000);
                     // }
                     // }
                 }else{
                 }else{
-                    this.monthworkDateS1 = []
-                    for (let i = 0; i < this.monthworkDate.length; i++) {
-                        if(this.monthworkDate[i].name.indexOf(this.searchKeyword) != -1){
-                            this.monthworkDateS1.push(this.monthworkDate[i])
+                    this.monthWorkDataS1 = []
+                    for (let i = 0; i < this.monthWorkData.length; i++) {
+                        if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
+                            this.monthWorkDataS1.push(this.monthWorkData[i])
                         }
                         }
                     }
                     }
-                    if (this.monthworkDateS1.length > 20) {
-                        this.monthworkDateS = this.monthworkDateS1.slice(0,20);
+                    if (this.monthWorkDataS1.length > 50) {
+                        this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
                     }else{
                     }else{
-                        this.monthworkDateS = this.monthworkDateS1 
-                    }
-                    if (this.monthworkDateS1.length > 0) {
-                        setTimeout(() => {
-                            this.tableListener()
-                        }, 1000);
+                        this.monthWorkDataS = this.monthWorkDataS1 
                     }
                     }
+                    // if (this.monthWorkDataS1.length > 0) {
+                    //     setTimeout(() => {
+                    //         this.tableListener()
+                    //     }, 1000);
+                    // }
                 }
                 }
             },
             },
             addUpload(data) {
             addUpload(data) {
@@ -1991,23 +1994,23 @@
             this.tbload = false;
             this.tbload = false;
             this.pickDateArray = res.data.days;
             this.pickDateArray = res.data.days;
             console.log('dataarray',res.data.days);
             console.log('dataarray',res.data.days);
-            this.monthworkDate = res.data.list;
-            // this.monthworkDateS = this.monthworkDate
-            this.monthworkDateS1 = res.data.list
+            this.monthWorkData = res.data.list;
+            // this.monthWorkDataS = this.monthWorkData
+            // this.monthWorkDataS1 = res.data.list
             this.monthTotal = res.data.list.length
             this.monthTotal = res.data.list.length
-            if (this.monthworkDateS1.length > 20) {
-                this.monthworkDateS = this.monthworkDateS1.slice(0,20);
+            if (this.monthWorkData.length > 50) {
+                this.monthWorkDataS = this.monthWorkData.slice(0,50);
             }else{
             }else{
-                this.monthworkDateS = this.monthworkDateS1 
+                this.monthWorkDataS = this.monthWorkData
             }
             }
-            
-            // this.monthworkDateS = infoList
+            this.searchScreen(0)
+            // this.monthWorkDataS = infoList
             // 判断
             // 判断
-            if (this.monthworkDateS1.length > 0) {
-                setTimeout(() => {
-                    this.tableListener()
-                }, 1000);
-            }
+            // if (this.monthWorkDataS1.length > 0) {
+            //     setTimeout(() => {
+            //         this.tableListener()
+            //     }, 1000);
+            // }
 
 
             this.$nextTick(function(){
             this.$nextTick(function(){
                 this.$refs.hasworkTbl.doLayout();
                 this.$refs.hasworkTbl.doLayout();
@@ -2024,27 +2027,27 @@
         }
         }
       );
       );
     },
     },
-    tableListener(){
-      let that = this;
-      let dom = that.$refs.hasworkTbl.bodyWrapper;
-      	  // 添加scroll监听事件
-          dom.addEventListener("scroll", function () {
-            const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
-            if (scrollDistance < 2) {
-              if (that.monthworkDateS.length < that.monthworkDateS1.length) {
-                that.monthTotalPage++; //当前页数自增
-                console.log(that.monthworkDateS1.length, that.monthworkDateS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
-                var arrList = JSON.parse(JSON.stringify(that.monthworkDateS1))
-                var infoList = arrList.splice(
-                  that.monthTotalPage * that.monthTotalLages,
-                  that.monthTotalLages
-                );
-                // 数据添加
-                that.monthworkDateS = that.monthworkDateS.concat(infoList);
-              }
-            }
-          })
-    },
+    // tableListener(){
+    //   let that = this;
+    //   let dom = that.$refs.hasworkTbl.bodyWrapper;
+    //   	  // 添加scroll监听事件
+    //       dom.addEventListener("scroll", function () {
+    //         const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
+    //         if (scrollDistance < 2) {
+    //           if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
+    //             that.monthTotalPage++; //当前页数自增
+    //             console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
+    //             var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
+    //             var infoList = arrList.splice(
+    //               that.monthTotalPage * that.monthTotalLages,
+    //               that.monthTotalLages
+    //             );
+    //             // 数据添加
+    //             that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
+    //           }
+    //         }
+    //       })
+    // },
     showMonthNotWorkTime() {
     showMonthNotWorkTime() {
       this.monthTotalPage = 0,
       this.monthTotalPage = 0,
         this.tbload = true
         this.tbload = true
@@ -2058,14 +2061,15 @@
           if (res.code == "ok") {
           if (res.code == "ok") {
               this.tbload = false
               this.tbload = false
             this.monthNotWorkDate = res.data;
             this.monthNotWorkDate = res.data;
-            this.monthnotworkDateS1 = res.data
+            // this.monthNotWorkDateS1 = res.data
             this.monthnotTotal = res.data.length
             this.monthnotTotal = res.data.length
             // 2222111
             // 2222111
-            if (this.monthnotworkDateS1.length > 50) {
-                this.monthNotWorkDateS = this.monthnotworkDateS1.slice(0,50);
+            if (this.monthNotWorkDate.length > 50) {
+                this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
             } else {
             } else {
-                this.monthNotWorkDateS = this.monthnotworkDateS1
+                this.monthNotWorkDateS = this.monthNotWorkDate
             }
             }
+            this.searchScreen(1)
             // 判断
             // 判断
             // if (this.monthnotworkDateS1.length > 0) {
             // if (this.monthnotworkDateS1.length > 0) {
             //     setTimeout(() => {
             //     setTimeout(() => {
@@ -2105,20 +2109,35 @@
     //         }
     //         }
     //       })
     //       })
     // },
     // },
+    listScroll(){
+        if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
+            this.isMore = true
+            setTimeout(()=>{
+                this.isMore = false
+            },1000)
+        }else {
+            this.isFlag = true
+            let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
+            this.monthWorkDataS = datalist
+            setTimeout(()=>{
+                this.isFlag = false
+            },300)
+        }
+    },
     notListScroll(){
     notListScroll(){
-        if(this.monthNotWorkDateS.length == this.monthNotWorkDate.length){
+        if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
             this.isMore = true
             this.isMore = true
             setTimeout(()=>{
             setTimeout(()=>{
                 this.isMore = false
                 this.isMore = false
             },1000)
             },1000)
         }else {
         }else {
             this.isFlag = true
             this.isFlag = true
-            let datalist = this.monthNotWorkDate.slice(0,this.monthNotWorkDateS.length + 50)
+            let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
             this.monthNotWorkDateS = datalist
             this.monthNotWorkDateS = datalist
             console.log('length',this.monthNotWorkDateS.length)
             console.log('length',this.monthNotWorkDateS.length)
             setTimeout(()=>{
             setTimeout(()=>{
                 this.isFlag = false
                 this.isFlag = false
-            },1000)
+            },300)
         }
         }
     },
     },
     // 获取默认这zhou日期参数 222
     // 获取默认这zhou日期参数 222