Ver Fonte

2022.5.11 21:37

山水共长天一色 há 3 anos atrás
pai
commit
77716cc380

+ 10 - 10
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,18 +1,18 @@
 var path = require('path')
 
 //  var ip = '127.0.0.1'
-var ip = '192.168.2.29'
+// var ip = '192.168.2.29'
 // var ip = '192.168.2.12'// var ip = '47.100.37.243' 
 
-// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-// for (var i in ifaces) {
-//     for (var j in ifaces[i]) {
-//         var val = ifaces[i][j]
-//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-//             ip = val.address
-//         }
-//     }
-// }
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
+}
 
 module.exports = {
   build: {

+ 19 - 2
fhKeeper/formulahousekeeper/timesheet/package-lock.json

@@ -2813,6 +2813,23 @@
       "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==",
       "dev": true
     },
+    "el-table-infinite-scroll": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/el-table-infinite-scroll/-/el-table-infinite-scroll-2.0.0.tgz",
+      "integrity": "sha512-zDmsGvce4V0wx7j4CBdYi2wgMsv66SbQBp7984gk25Jc8b2nKdjBYrXpFLfMDZ0iYjTDpxkH9+5iEhCgM3+byw==",
+      "requires": {
+        "core-js": "^3.x",
+        "element-ui": "^2.12.0",
+        "vue": "^2.6.14"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "3.22.5",
+          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.22.5.tgz",
+          "integrity": "sha512-VP/xYuvJ0MJWRAobcmQ8F2H6Bsn+s7zqAAjFaHGBMc5AQm7zaelhD1LGduFn2EehEcQcU+br6t+fwbpQ5d1ZWA=="
+        }
+      }
+    },
     "electron-to-chromium": {
       "version": "1.4.71",
       "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz",
@@ -5201,7 +5218,7 @@
     },
     "normalize-wheel": {
       "version": "1.0.1",
-      "resolved": "https://registry.nlark.com/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
+      "resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
       "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
     },
     "npmlog": {
@@ -5218,7 +5235,7 @@
     },
     "nprogress": {
       "version": "0.2.0",
-      "resolved": "https://registry.npm.taobao.org/nprogress/download/nprogress-0.2.0.tgz",
+      "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz",
       "integrity": "sha1-y480xTIT2JVyP8urkH6UIq28r7E="
     },
     "nth-check": {

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/package.json

@@ -16,6 +16,7 @@
     "dhtmlx-gantt": "^7.1.6",
     "dingtalk-jsapi": "^2.13.42",
     "echarts": "^3.8.5",
+    "el-table-infinite-scroll": "^2.0.0",
     "element-ui": "^2.15.3",
     "font-awesome": "^4.7.0",
     "jquery": "^3.4.1",

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -5,6 +5,8 @@ import ElementUI from 'element-ui'
 // 全局修改默认配置,点击空白处不能关闭弹窗
 ElementUI.Dialog.props.closeOnClickModal.default = false
 Vue.use(ElementUI)
+import elTableInfiniteScroll from 'el-table-infinite-scroll'
+Vue.use(elTableInfiniteScroll)
 // import Vuex from 'vuex'
 // Vue.use(Vuex)
 // import echarts from 'echarts'
@@ -56,6 +58,7 @@ import router from './routes'
  
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
+import Vue from 'vue'
 
 var addRouFlag = false; 
 //角色权限对应关系

+ 44 - 15
fhKeeper/formulahousekeeper/timesheet/src/views/project/CostBaseline.vue

@@ -9,9 +9,9 @@
                             <label class="lableTxt">总成本基线<el-link v-if="permissions.projectCorrection" @click="correctBase" style="float:right;"><i class="el-icon-edit"  ></i></el-link></label>
                             <div class="lableCon" v-for="item in projectBaseCostData" :key="item.id">
                                 <div><span class="gray_label">{{item.baseName}}:</span></div>
-                                <div><span style="padding-right:20px;float:right;">¥{{item.baseAmount | numberToCurrency}}</span></div>
+                                <div><span style="float:right;">¥{{item.baseAmount | numberToCurrency}}</span></div>
                                 <div>
-                                    <span style="padding-right:15px;float:right;">剩余可下拨 <span :style="item.baseAmount * 0.9 < baseCostFilter(item.baseId) ? 'color:red;' : ''">¥{{(item.baseAmount - baseCostFilter(item.baseId)) | numberToCurrency}}</span></span>
+                                    <span style="float:right;">剩余可下拨 <span :style="item.baseAmount * 0.9 < baseCostFilter(item.baseId) ? 'color:red;' : ''">¥{{(item.baseAmount - baseCostFilter(item.baseId)) | numberToCurrency}}</span></span>
                                 </div>
                             </div>
                             <div style="height:24px">
@@ -25,9 +25,12 @@
                         <label class="lableTxt">当前成本基线</label>
                             <div class="lableCon" v-for="item in nowBaseList" :key="item.id">
                                 <div><span class="gray_label">{{item.baseName}}:</span></div>
-                                <div><span style="padding-right:20px;float:right;">¥{{item.baseAmount==null?'-':item.baseAmount | numberToCurrency}}</span></div>
-                                <div>
-                                    <span style="padding-right:15px;float:right;">剩余 <span :style="item.baseAmount * 0.9 < item.realCost ? 'color:red;' : ''">¥{{(item.baseAmount - item.realCost) | numberToCurrency}}</span></span>
+                                <div><span style="float:right;">¥{{item.baseAmount==null?'-':item.baseAmount | numberToCurrency}}</span></div>
+                                <div class="nowBase_div3">
+                                    <span style="float:right;">已<span>¥{{item.realCost | numberToCurrency}}</span></span>
+                                </div>
+                                <div class="nowBase_div4">
+                                    <span style="float:right;">余<span :style="item.baseAmount * 0.9 < item.realCost ? 'color:red;' : ''">¥{{(item.baseAmount - item.realCost) | numberToCurrency}}</span></span>
                                 </div>
                             </div>
                             <div style="height:24px">
@@ -65,11 +68,11 @@
 
         <el-dialog title="下拨成本预算" v-if="addCostAddDialog" :visible.sync="addCostAddDialog" :close-on-click-modal="false" width="600px">
             <el-form>
-                <el-form-item v-for="item in modBaseCostData" :key="item.id" :label="item.baseName" label-width="200px">
-                    <el-input :id="'nowBaseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('nowBaseCost'+index)"></el-input>
+                <el-form-item v-for="item,index in modBaseCostData" :key="item.id" :label="item.baseName" label-width="150px">
+                    <el-input :id="'nowBaseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('nowBaseCost'+index)" style="width:350px"></el-input>
                 </el-form-item>
-                <el-form-item label="备注" label-width="200px">
-                    <el-input v-model="remark"  placeholder="请输入下拨备注" ></el-input>
+                <el-form-item label="备注" label-width="150px">
+                    <el-input v-model="remark"  placeholder="请输入下拨备注" style="width:350px"></el-input>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -80,11 +83,11 @@
         </el-dialog>
         <el-dialog title="校正成本基线" v-if="correctBaseDialog" :visible.sync="correctBaseDialog" :close-on-click-modal="false" width="600px">
             <el-form>
-                <el-form-item v-for="item in correctBaseCostData" :key="item.id" :label="item.baseName" label-width="200px">
-                    <el-input :id="'baseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input>
+                <el-form-item v-for="item,index in correctBaseCostData" :key="item.id" :label="item.baseName" label-width="150px">
+                    <el-input :id="'baseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('baseCost'+index)" style="width:350px"></el-input>
                 </el-form-item>
-                <el-form-item label="备注" label-width="200px">
-                    <el-input v-model="remark"  placeholder="请输入校正原因" ></el-input>
+                <el-form-item label="备注" label-width="150px">
+                    <el-input v-model="remark"  placeholder="请输入校正原因" style="width:350px"></el-input>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -232,18 +235,30 @@
             addCostAddSure(){
                 this.addLoading = true
                 let itemList = []
+                let isAll0 = true
                 for(let i=0; i<this.modBaseCostData.length; i++){
                     // let itemListItem = {
                     //     baseId: this.modBaseCostData[i].baseId,
                     //     baseName: this.modBaseCostData[i].baseName,
                     //     baseAmount: this.modBaseCostData[i].baseAmount
                     // }
+                    if(this.modBaseCostData[i].baseAmount != 0){
+                        isAll0 = false
+                    }
                     itemList.push({
                         baseId: this.modBaseCostData[i].baseId,
                         baseName: this.modBaseCostData[i].baseName,
                         baseAmount: this.modBaseCostData[i].baseAmount
                     })
                 }
+                if(isAll0){
+                    this.$message({
+                        message: '下拨成本至少一项不能为0',
+                        type: 'warning'
+                    })
+                    this.addLoading = false
+                    return
+                }
                 this.http.post('/project-addcost-record/add',{
                     projectId: this.curProjectId,
                     userId: this.user.id,
@@ -446,11 +461,25 @@
     float: left;
 }
 .lableCon div:nth-child(2){
-    width: 30%;
+    width: 20%;
     float: left;
 }
 .lableCon div:nth-child(3){
-    width: 40%;
+    width: 50%;
+    float: left;
+    font-size: 13px;
+    color: #999;
+    line-height: 20px;
+}
+.lableCon .nowBase_div3{
+    width: 25% !important;
+    float: left;
+    font-size: 13px;
+    color: #999;
+    line-height: 20px;
+}
+.lableCon .nowBase_div4{
+    width: 25%;
     float: left;
     font-size: 13px;
     color: #999;

+ 53 - 31
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1013,6 +1013,7 @@
           <el-table
             ref="hasworkTbl2"
             :data="monthNotWorkDateS"
+            v-el-table-infinite-scroll="notListScroll"
             border
             :height="500"
             highlight-current-row
@@ -1032,6 +1033,8 @@
             >
             </el-table-column>
           </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>
         </el-tab-pane>
       </el-tabs>
     </el-dialog>
@@ -1391,7 +1394,10 @@
                 monthnotTotalPage: 0,
                 monthnotTotalLages: 20,
                 monthNotWorkDateS1: [],
-                deptMembDataText: ''
+                deptMembDataText: '',
+
+                isFlag: false,
+                isMore: false
             };
         },
         watch: {
@@ -1451,11 +1457,11 @@
                     }else{
                         this.monthNotWorkDateS = this.monthNotWorkDateS1 
                     }
-                    if (this.monthNotWorkDateS1.length > 0) {
-                        setTimeout(() => {
-                            this.tableListener()
-                        }, 1000);
-                    }
+                    // if (this.monthNotWorkDateS1.length > 0) {
+                    //     setTimeout(() => {
+                    //         this.tableListenernot()
+                    //     }, 1000);
+                    // }
                 }else{
                     this.monthworkDateS1 = []
                     for (let i = 0; i < this.monthworkDate.length; i++) {
@@ -2055,17 +2061,17 @@
             this.monthnotworkDateS1 = res.data
             this.monthnotTotal = res.data.length
             // 2222111
-            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 {
                 this.monthNotWorkDateS = this.monthnotworkDateS1
             }
             // 判断
-            if (this.monthnotworkDateS1.length > 0) {
-                setTimeout(() => {
-                    this.tableListenernot()
-                }, 1000);
-            }
+            // if (this.monthnotworkDateS1.length > 0) {
+            //     setTimeout(() => {
+            //         this.tableListenernot()
+            //     }, 1000);
+            // }
             this.$nextTick(function(){
                 this.$refs.hasworkTbl2.doLayout();
             });
@@ -2080,24 +2086,40 @@
         }
       );
     },
-    tableListenernot(){
-      let that = this;
-      let dom = that.$refs.hasworkTbl2.bodyWrapper;
-          dom.addEventListener("scroll", function () {
-          // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
-            const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
-            if (scrollDistance2 < 2) {
-              if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
-                that.monthnotTotalPage++; //当前页数自增
-                var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
-                var infoList = arrList.splice(
-                  that.monthnotTotalPage * that.monthnotTotalLages,
-                  that.monthnotTotalLages
-                );
-                that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
-              }
-            }
-          })
+    // tableListenernot(){
+    //   let that = this;
+    //   let dom = that.$refs.hasworkTbl2.bodyWrapper;
+    //       dom.addEventListener("scroll", function () {
+    //       // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
+    //         const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
+    //         if (scrollDistance2 < 2) {
+    //           if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
+    //             that.monthnotTotalPage++; //当前页数自增
+    //             var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
+    //             var infoList = arrList.splice(
+    //               that.monthnotTotalPage * that.monthnotTotalLages,
+    //               that.monthnotTotalLages
+    //             );
+    //             that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
+    //           }
+    //         }
+    //       })
+    // },
+    notListScroll(){
+        if(this.monthNotWorkDateS.length == this.monthNotWorkDate.length){
+            this.isMore = true
+            setTimeout(()=>{
+                this.isMore = false
+            },1000)
+        }else {
+            this.isFlag = true
+            let datalist = this.monthNotWorkDate.slice(0,this.monthNotWorkDateS.length + 50)
+            this.monthNotWorkDateS = datalist
+            console.log('length',this.monthNotWorkDateS.length)
+            setTimeout(()=>{
+                this.isFlag = false
+            },1000)
+        }
     },
     // 获取默认这zhou日期参数 222
     getLastWeek(e){