Переглянути джерело

fix: 收藏导出全部问题修改

cuiyalong 4 роки тому
батько
коміт
3e3c73aceb

+ 11 - 2
src/web/staticres/css/ele-reset.css

@@ -125,6 +125,7 @@ li.el-select-dropdown__item {
     justify-content: center;
     padding: 10px 50px;
     font-size: 16px;
+    white-space: nowrap;
     color: #686868;
     border: 1px solid #e0e0e0;
     border-radius: 7px;
@@ -145,6 +146,7 @@ li.el-select-dropdown__item {
 
 /* dialog居中布局 */
 .j-el-confirm {
+    width: 380px!important;
     border-radius: 8px;
 }
 .j-el-confirm .el-dialog__header,
@@ -153,18 +155,25 @@ li.el-select-dropdown__item {
     text-align: center;
 }
 .j-el-confirm .el-dialog__header {
-    padding-top: 30px;
+    padding: 30px 32px 10px;
 }
 .j-el-confirm .el-dialog__body {
+    padding: 30px 32px;
     color: #686868;
     font-size: 14px;
     line-height: 22px;
 }
 .j-el-confirm .el-dialog__footer {
+    padding: 10px 32px 20px;
     padding-bottom: 40px;
 }
 .j-el-confirm .dialog-footer {
     display: flex;
     align-items: center;
     justify-content: center;
-}
+}
+
+/* tag */
+.el-tag__close.el-icon-close {
+    font-weight: 700;
+}

+ 2 - 0
src/web/staticres/css/selector/selector.css

@@ -244,6 +244,7 @@
 .area-city-content .el-tag {
     margin: 4px 6px;
     height: 30px;
+    font-size: 14px;
 }
 .area-city-content .select-list {
     position: relative;
@@ -287,6 +288,7 @@
     display: inline-block;
     margin: 0 4px 4px;
     padding: 4px 8px;
+    font-size: 14px;
     border-radius: 4px;
     cursor: pointer;
 }

+ 14 - 3
src/web/staticres/frontRouter/pc/collection/css/index-pc.css

@@ -161,9 +161,9 @@
 .list-item {
     border-bottom: 1px solid #ECECEC;
 }
-.list-item:hover,
-.list-item:hover .a-i-title {
-    color: #2abed1;
+.list-item:hover {
+    background-color: #F5F6F7;
+    box-shadow: inset 0px -1px 0px rgb(0,0,0,.05);
 }
 
 .list-index {
@@ -249,10 +249,21 @@
     margin: 6px;
     padding: 1px 8px;
     height: auto;
+    color: #1d1d1d;
     background-color: #f5f6f7;
     border: 1px solid #ececec;
     border-radius: 5px;
     line-height: 22px;
+    cursor: pointer;
+}
+.tag-drawer .el-tag:hover {
+    color: #2CB7CA;
+    border-color: #2CB7CA;
+}
+.tag-drawer .el-tag:hover .el-icon-close {
+    color: #2CB7CA;
+    background-color: transparent;
+
 }
 .tag-drawer .el-tag .el-icon-close {
     font-weight: 700;

+ 95 - 13
src/web/staticres/frontRouter/pc/collection/js/index-pc.js

@@ -10,6 +10,7 @@ var vm = new Vue({
     },
     data: function () {
         return {
+            sessKey: '$data-collection-index',
             powerInfo: {},
             power: false,
             powerLoaded: false,
@@ -36,9 +37,14 @@ var vm = new Vue({
             ],
             filterState: {
                 tags: [],
-                timeStart: 0,
-                timeEnd: 0,
+                selectTime: '',
+                timeSelectorObj: {
+                    start: '',
+                    end: '',
+                    exact: ''
+                },
                 buyerclass: [],
+                buyerclassObj: {}, // buyerclass原始选中数据
                 buyerPhone: 0, // 采购单位联系方式
                 bidPhone: 0, // 中标企业联系方式
             },
@@ -52,6 +58,7 @@ var vm = new Vue({
                 list: [] // 查询请求返回的数据
             },
             currentPageAllChecked: false,
+            currentSelectItems: [],
             tagDrawer: {
                 dialogShow: false,
                 toastShow: false,
@@ -61,12 +68,24 @@ var vm = new Vue({
         }
     },
     created: function () {
+        var _this = this
         this.getPower(function () {
-            this.getTagList()
-            this.getList()
-        }.bind(this))
+            if (_this.hasRestoreState()) {
+                // 等TagList请求完成后在恢复数据
+                _this.getTagList(function () {
+                    setTimeout(function () {
+                        var $data = _this.restorePageState()
+                        if (!$data) {
+                            _this.getList()
+                        }
+                    }, 0)
+                })
+            } else {
+                _this.getTagList()
+                _this.getList()
+            }
+        })
     },
-    mounted: function () {},
     methods: {
         showToast: function (content, timer, callback) {
             content = content || '暂无数据'
@@ -100,7 +119,7 @@ var vm = new Vue({
                 this.listState.pageSize = 100
             }
         },
-        getTagList: function () {
+        getTagList: function (callback) {
             $.ajax({
                 url: '/publicapply/bidcoll/getLabel',
                 type: 'POST',
@@ -108,6 +127,7 @@ var vm = new Vue({
                     if (res.error_code === 0 && res.data) {
                         this.tagList = res.data
                         this.initSelectTagList()
+                        callback && callback()
                     }
                 }.bind(this)
             })
@@ -118,12 +138,11 @@ var vm = new Vue({
                 pagenum: this.listState.pageNum,
                 pagesize: this.listState.pageSize,
                 label: this.filterState.tags.join(','),
-                selectTime: this.filterState.timeStart / 1000 + '_' + this.filterState.timeEnd / 1000,
+                selectTime: this.filterState.selectTime,
                 buyerclass: this.filterState.buyerclass.join(','),
                 buyPhone: this.filterState.buyPhone ? this.filterState.buyPhone : 0,
                 bidPhone: this.filterState.bidPhone ? this.filterState.bidPhone : 0
             }
-
             this.listState.loading = true
             this.listState.loaded = false
 
@@ -215,12 +234,24 @@ var vm = new Vue({
             this.doQuery()
         },
         dateTimeFilterChange: function (t) {
-            this.filterState.timeStart = t.start
-            this.filterState.timeEnd = t.end
+            this.filterState.timeSelectorObj = t
+            var arr = []
+            if (t.start) {
+                arr.push(t.start / 1000)
+            }
+            if (t.end) {
+                arr.push(t.end / 1000)
+            }
+            if (arr.length === 0) {
+                this.filterState.selectTime = ''
+            } else {
+                this.filterState.selectTime = arr.join('_')
+            }
             this.doQuery()
         },
         buyerClassFilterChange: function (buyerclass) {
             var buyerclassArr = []
+            this.filterState.buyerclassObj = buyerclass
             for (var key in buyerclass) {
                 buyerclassArr = buyerclassArr.concat(buyerclass[key])
             }
@@ -236,9 +267,33 @@ var vm = new Vue({
         dataExport: function () {
             var info = this.getSelectedIdArr()
             var ids = info.ids
-            if (ids.length !== 0) {
-                return window.open('/front/dataExport/superSearchExport?selectIds=' + ids.join(','))
+            var data = null
+            if (ids.length === 0) {
+                data = {
+                    label: this.filterState.tags.join(','),
+                    selectTime: this.filterState.selectTime,
+                    buyerclass: this.filterState.buyerclass.join(','),
+                    buyPhone: this.filterState.buyPhone ? this.filterState.buyPhone : 0,
+                    bidPhone: this.filterState.bidPhone ? this.filterState.bidPhone : 0
+                }
+            } else {
+                data = {
+                    selectIds: ids.join(',')
+                }
             }
+            $.ajax({
+                url: '/publicapply/dataexpoet/bycollection',
+                type: 'POST',
+                data: data,
+                success: function (res) {
+                    if (res.error_code === 0) {
+                        if (res.data._id) {
+                            this.savePageState()
+                            location.href = '/front/dataExport/toCreateOrderPage/' + res.data._id
+                        }
+                    }
+                }.bind(this)
+            })
         },
         // 批量取消收藏
         unStarSelected: function () {
@@ -276,6 +331,7 @@ var vm = new Vue({
                     ids.push(item._id)
                 }
             })
+            this.currentSelectItems = ids
             return {
                 ids: ids,
                 arr: arr
@@ -377,5 +433,31 @@ var vm = new Vue({
                 }.bind(this)
             })
         },
+        savePageState: function () {
+            var data = {
+                filterState: this.filterState,
+                listState: this.listState,
+                currentSelectItems: this.currentSelectItems,
+                currentPageAllChecked: this.currentPageAllChecked
+            }
+            sessionStorage.setItem(this.sessKey, JSON.stringify(data))
+        },
+        hasRestoreState: function () {
+            return !!sessionStorage.getItem(this.sessKey)
+        },
+        restorePageState: function () {
+            var $data = sessionStorage.getItem(this.sessKey)
+            if ($data) {
+                $data = JSON.parse($data)
+                // 恢复数据
+                Object.assign(this.filterState, $data.filterState || {})
+                Object.assign(this.listState, $data.listState || {})
+                Object.assign(this.currentSelectItems, $data.currentSelectItems || {})
+                // 恢复页面状态
+                this.currentPageAllChecked = $data.currentPageAllChecked
+                sessionStorage.removeItem(this.sessKey)
+            }
+            return !!$data
+        }
     }
 })

+ 44 - 13
src/web/staticres/js/ent-search-index-pc.js

@@ -22,14 +22,14 @@ var vm = new Vue({
                     label: '法定代表人',
                     value: 'B'
                 },
-                {
-                    label: '股东',
-                    value: 'C'
-                },
-                {
-                    label: '高管',
-                    value: 'D'
-                },
+                // {
+                //     label: '股东',
+                //     value: 'C'
+                // },
+                // {
+                //     label: '高管',
+                //     value: 'D'
+                // },
                 {
                     label: '中标项目/标的物',
                     value: 'E'
@@ -138,7 +138,7 @@ var vm = new Vue({
                 ],
             },
             filterState: {
-                searchType: [],
+                searchType: ['A'],
                 entArea: [],
                 entCity: [],
                 entType: [],
@@ -184,7 +184,7 @@ var vm = new Vue({
     },
     computed: {
         preSearchListShow: function () {
-            return this.searchContent.trim().length > 2 && this.preSearch.list.length && (this.preSearch.focus || this.preSearch.hover)
+            return this.searchContent.trim().length >= 2 && this.preSearch.list.length && (this.preSearch.focus || this.preSearch.hover)
         },
         buttonText: function () {
             if (this.power) {
@@ -207,7 +207,8 @@ var vm = new Vue({
     },
     mounted: function () {
         this.initDOMEvents()
-        // this.checkLogin()
+        // 默认选中搜索范围
+        this.$refs.searchType.setState(this.filterState.searchType)
     },
     methods: {
         checkLogin: function () {
@@ -340,7 +341,7 @@ var vm = new Vue({
             var data = {
                 name: this.searchContent.trim()
             }
-            if (data.name.length <= 2) return
+            if (data.name.length < 2) return
             $.ajax({
                 url: '/bigmember/search/ent/association',
                 method: 'POST',
@@ -356,6 +357,36 @@ var vm = new Vue({
                 }.bind(this)
             })
         }, 200),
+        getDefaultList: function () {
+            $.ajax({
+                url: '/publicapply/enterpriseSearch/index',
+                type: 'POST',
+                success: function (res) {
+                    if (res.error_code === 0 && res.data) {
+                        if (res.data.list) {
+                            if (this.power) {
+                                this.listState.list = res.data.list || []
+                            } else {
+                                if (res.data.list.length > 4) {
+                                    res.data.list.length = 4
+                                    res.data.list.push({
+                                        company_address: 'xxx',
+                                        company_name: 'xxx',
+                                        company_status: 'xxx',
+                                        legal_person: 'xxx',
+                                        id: 'xxx',
+                                        showMask: true
+                                    })
+                                }
+                                this.listState.list = res.data.list || []
+                            }
+                        }
+                    } else {
+                        this.checkLogin()
+                    }
+                }.bind(this)
+            })
+        },
         getList: function () {
             var data = {
                 match: this.searchContent,
@@ -371,7 +402,7 @@ var vm = new Vue({
                 pageSize: this.listState.pageSize,
                 pageNum: this.listState.pageNum - 1, // 当前页, 从0开始
             }
-            // return console.info(JSON.stringify(data, null, 2))
+
             if (!data.match.replace(/\s+/g, '')) return
 
             this.listState.loading = true

+ 6 - 6
src/web/staticres/js/login.js

@@ -394,12 +394,12 @@ var logic = function(data,num){
           +"<div class=\"myorderDiv lastBox\" style='display: none' onclick=\"window.location.href='/swordfish/page_big_pc'\">"
           +"<span>大会员</span>"
           +"</div>"
+          +"<div class=\"myorderDiv ent-search\" style='display: none' onclick=\"window.location.href='/swordfish/page_big_pc/svip/ent_search'\">"
+          +"<span>企业查询</span>"
+          +"</div>"
           +"<div class=\"myorderDiv bx-collection\" onclick=\"window.location.href='/swordfish/frontPage/collection/sess/index'\">"
           +"<span>标讯收藏</span>"
           +"</div>"
-        //   +"<div class=\"myorderDiv ent-search\" style='display: none' onclick=\"window.location.href='/swordfish/page_big_pc/svip/ent_search'\">"
-        //   +"<span>企业查询</span>"
-        //   +"</div>"
 					hhtml+= "<div class='exitDiv' onclick='signout()'>"
 						+"<img id='outImg' src='/images/userexit.png'/>"
 						+"<span>退出</span>"
@@ -671,12 +671,12 @@ var haslogin = function(num,kyorpn,url){
             +"<div class=\"myorderDiv lastBox\" style='display: none' onclick=\"window.location.href='/swordfish/page_big_pc'\">"
             +"<span>大会员</span>"
             +"</div>"
+            +"<div class=\"myorderDiv ent-search\" style='display: none' onclick=\"window.location.href='/swordfish/page_big_pc/svip/ent_search'\">"
+            +"<span>企业查询</span>"
+            +"</div>"
             +"<div class=\"myorderDiv bx-collection\" onclick=\"window.location.href='/swordfish/frontPage/collection/sess/index'\">"
             +"<span>标讯收藏</span>"
             +"</div>"
-            // +"<div class=\"myorderDiv ent-search\" style='display: none' onclick=\"window.location.href='/swordfish/page_big_pc/svip/ent_search'\">"
-            // +"<span>企业查询</span>"
-            // +"</div>"
             hhtml+= "<div class='exitDiv' onclick='signout()'>"
             +"<img id='outImg' src='/images/userexit.png'/>"
             +"<span>退出</span>"

+ 12 - 1
src/web/staticres/js/selector/date-time-pc.js

@@ -46,6 +46,12 @@ var dateTimeComponent = {
     name: 'date-time-pc',
     template: dateTimeComponentTemplate,
     props: {
+        initSelected: {
+            type: Object,
+            default: function () {
+                return {}
+            }
+        },
         showSelectGroup: {
             type: Boolean,
             default: true
@@ -106,9 +112,14 @@ var dateTimeComponent = {
             }
         }
     },
+    watch: {
+        initSelected: function (newVal) {
+            this.setState(newVal)
+        }
+    },
     created: function () {},
     methods: {
-        setState: function () {
+        setState: function (data) {
             // {
             //   start: 1620230400000, // 2021-5-6
             //   end: 1620489600000, // 2021-5-9

+ 8 - 2
src/web/staticres/js/selector/select-level2-pc.js

@@ -48,6 +48,12 @@ var selectLevel2Component = {
                 }
             }
         },
+        initSelected: {
+            type: Object,
+            default: function () {
+                return {}
+            }
+        },
         // 是否需要显示更多按钮
         useShowMore: {
             type: Boolean,
@@ -55,8 +61,8 @@ var selectLevel2Component = {
         }
     },
     watch: {
-        map: function (newVal, oldVal) {
-            // this.initData()
+        initSelected: function (newVal) {
+            this.setState(newVal)
         }
     },
     data: function () {

+ 3 - 1
src/web/templates/frontRouter/pc/collection/sess/index.html

@@ -80,6 +80,7 @@
                     <div class="selector-card-header">收藏日期:</div>
                     <div class="selector-card-content">
                         <date-time-component
+                            :init-selected="filterState.timeSelectorObj"
                             :show-select-group="false"
                             @change="dateTimeFilterChange"
                         ></date-time-component>
@@ -89,6 +90,7 @@
                     <div class="selector-card-header">采购单位类型:</div>
                     <div class="selector-card-content">
                         <select-level2-component
+                            :init-selected="filterState.buyerclassObj"
                             :map="buyclassMap"
                             @change="buyerClassFilterChange"
                         ></select-level2-component>
@@ -106,7 +108,7 @@
                                 :value="item.value">
                             </el-option>
                         </el-select>
-                        <div class="select-title">采购单位联系方式</div>
+                        <div class="select-title">中标企业联系方式</div>
                         <el-select v-model="filterState.bidPhone" @change="otherFilterChange" placeholder="中标企业联系方式">
                             <el-option
                                 v-for="item in buyerPhoneOptions"

+ 2 - 1
src/web/templates/pc/entsearchindex.html

@@ -187,7 +187,7 @@
                             @click="toDetail(item.id)"
                             :key="item.id">
                             <div class="ei-i-left">
-                                <div class="ei-i-l-container" :class="randomBgc()">${ item.company_name.slice(0,4) }</div>
+                                <div class="ei-i-l-container" :class="randomBgc()">${ item.company_shortname.slice(0,4) }</div>
                             </div>
                             <div class="ei-i-right">
                                 <div class="ei-r-title-container flex">
@@ -257,6 +257,7 @@
     <script src="//cdn.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
     <script src="{{Msg "seo" "cdn"}}/big-member/js/utils.js?v={{Msg "seo" "version"}}"></script>
     <script>
+        var dataId = '';
         var pageInfo = {
             searchContent: {{.T.searchvalue}},
         }