浏览代码

fix:表格完善

xuemingyang 3 年之前
父节点
当前提交
672f27b7f0

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_free_ent_project_news.html

@@ -185,7 +185,7 @@
               </el-table>
             </div>
             </template>
-            <div v-show="colList">
+            <div v-show="isShowMoreBtn">
               <div class="more">
                 <span @click.stop="onExport">查看更多</span>
               </div>

+ 61 - 16
src/web/staticres/common-module/big-member/js/ent_project_news.js

@@ -103,7 +103,8 @@ var vConfig = {
         isSC:0,
         idx:[],
         list:[],
-        seclects:[]
+        seclects:[],
+        isShowMoreBtn:false
     },
     computed: {
         projectNewUrl: function () {
@@ -148,6 +149,7 @@ var vConfig = {
             // this.getFilterInfo()
             this.getEntInfo()
             this.onLoad()
+            this.onLoadTable()
             this.getEntFollowState()
         } else {
             this.initSelector(this.filterInitData)
@@ -307,9 +309,51 @@ var vConfig = {
             }
           })
         },
-      goEntInfo: function(id) {
-          location.href = '/jyapp/big/page/ent_portrait?eId=' + encodeURIComponent(id)
-      },
+        goEntInfo: function(id) {
+            location.href = '/jyapp/big/page/ent_portrait?eId=' + encodeURIComponent(id)
+        },
+        //表格数据
+        onLoadTable(){
+          var _this = this
+          var storageSet = JSON.parse(sessionStorage.getItem('winner_high_set'))
+          var url = this.projectNewUrl
+          var data = {
+            entId: _this.entInfo.eid,
+            pageNum: _this.listState.pageNum,
+            pageSize: 20,
+          }
+          $.ajax({
+          type: 'POST',
+          url: url,
+          data: storageSet ? Object.assign(data, storageSet) : data,
+          success: function (res) {
+            if (res.data) {
+
+              // 列表赋值
+              if(res.data.count > 20){
+                _this.isShowMoreBtn = true
+              }
+              _this.colList = res.data.list
+              _this.colList.forEach((item)=>{
+                item.bidstatus = item.bidstatus
+                item.bidsta = item.bidstatus + "公告"
+                if(item.winner && item.winner.length>0){
+                  item.winner = item.winner[0]
+                }
+              })
+              _this.colList.forEach((val)=>{
+                _this.list.push(val.id)
+              })
+              } else {
+                _this.$toast('请求失败')
+              }
+            },
+            error: function (error) {
+              console.log(error)
+            }
+          })
+        },
+        //
         onLoad: function () {
             var _this = this
             var t = this.listState
@@ -340,18 +384,18 @@ var vConfig = {
 
                         // 列表赋值
                         var list = res.data.list
-                        _this.colList = res.data.list
-                        _this.colList.forEach((item)=>{
-                          item.createtime = new Date(Number(item.firsttime + '000')).pattern('yyyy/MM/dd');
-                          item.bidstatus = item.bidstatus
-                          item.bidsta = item.bidstatus + "公告"
-                          if(item.winner && item.winner.length>0){
-                            item.winner = item.winner[0]
-                          }
-                        })
-                        _this.colList.forEach((val)=>{
-                          _this.list.push(val.id)
-                        })
+                        // _this.colList = res.data.list
+                        // _this.colList.forEach((item)=>{
+                        //   item.createtime = new Date(Number(item.firsttime + '000')).pattern('yyyy/MM/dd');
+                        //   item.bidstatus = item.bidstatus
+                        //   item.bidsta = item.bidstatus + "公告"
+                        //   if(item.winner && item.winner.length>0){
+                        //     item.winner = item.winner[0]
+                        //   }
+                        // })
+                        // _this.colList.forEach((val)=>{
+                        //   _this.list.push(val.id)
+                        // })
                         var count = res.data.count
                         if (Array.isArray(list)) {
                             _this.preSortList(list)
@@ -405,6 +449,7 @@ var vConfig = {
             this.listState.loading = true
             // 请求数据
             this.onLoad()
+            this.onLoadTable()
         },
         resetState: function () {
             var rState = {