|
@@ -10,6 +10,7 @@ var vm = new Vue({
|
|
},
|
|
},
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
|
|
+ sessKey: '$data-collection-index',
|
|
powerInfo: {},
|
|
powerInfo: {},
|
|
power: false,
|
|
power: false,
|
|
powerLoaded: false,
|
|
powerLoaded: false,
|
|
@@ -36,9 +37,14 @@ var vm = new Vue({
|
|
],
|
|
],
|
|
filterState: {
|
|
filterState: {
|
|
tags: [],
|
|
tags: [],
|
|
- timeStart: 0,
|
|
|
|
- timeEnd: 0,
|
|
|
|
|
|
+ selectTime: '',
|
|
|
|
+ timeSelectorObj: {
|
|
|
|
+ start: '',
|
|
|
|
+ end: '',
|
|
|
|
+ exact: ''
|
|
|
|
+ },
|
|
buyerclass: [],
|
|
buyerclass: [],
|
|
|
|
+ buyerclassObj: {}, // buyerclass原始选中数据
|
|
buyerPhone: 0, // 采购单位联系方式
|
|
buyerPhone: 0, // 采购单位联系方式
|
|
bidPhone: 0, // 中标企业联系方式
|
|
bidPhone: 0, // 中标企业联系方式
|
|
},
|
|
},
|
|
@@ -52,6 +58,7 @@ var vm = new Vue({
|
|
list: [] // 查询请求返回的数据
|
|
list: [] // 查询请求返回的数据
|
|
},
|
|
},
|
|
currentPageAllChecked: false,
|
|
currentPageAllChecked: false,
|
|
|
|
+ currentSelectItems: [],
|
|
tagDrawer: {
|
|
tagDrawer: {
|
|
dialogShow: false,
|
|
dialogShow: false,
|
|
toastShow: false,
|
|
toastShow: false,
|
|
@@ -61,12 +68,24 @@ var vm = new Vue({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created: function () {
|
|
created: function () {
|
|
|
|
+ var _this = this
|
|
this.getPower(function () {
|
|
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: {
|
|
methods: {
|
|
showToast: function (content, timer, callback) {
|
|
showToast: function (content, timer, callback) {
|
|
content = content || '暂无数据'
|
|
content = content || '暂无数据'
|
|
@@ -100,7 +119,7 @@ var vm = new Vue({
|
|
this.listState.pageSize = 100
|
|
this.listState.pageSize = 100
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getTagList: function () {
|
|
|
|
|
|
+ getTagList: function (callback) {
|
|
$.ajax({
|
|
$.ajax({
|
|
url: '/publicapply/bidcoll/getLabel',
|
|
url: '/publicapply/bidcoll/getLabel',
|
|
type: 'POST',
|
|
type: 'POST',
|
|
@@ -108,6 +127,7 @@ var vm = new Vue({
|
|
if (res.error_code === 0 && res.data) {
|
|
if (res.error_code === 0 && res.data) {
|
|
this.tagList = res.data
|
|
this.tagList = res.data
|
|
this.initSelectTagList()
|
|
this.initSelectTagList()
|
|
|
|
+ callback && callback()
|
|
}
|
|
}
|
|
}.bind(this)
|
|
}.bind(this)
|
|
})
|
|
})
|
|
@@ -118,12 +138,11 @@ var vm = new Vue({
|
|
pagenum: this.listState.pageNum,
|
|
pagenum: this.listState.pageNum,
|
|
pagesize: this.listState.pageSize,
|
|
pagesize: this.listState.pageSize,
|
|
label: this.filterState.tags.join(','),
|
|
label: this.filterState.tags.join(','),
|
|
- selectTime: this.filterState.timeStart / 1000 + '_' + this.filterState.timeEnd / 1000,
|
|
|
|
|
|
+ selectTime: this.filterState.selectTime,
|
|
buyerclass: this.filterState.buyerclass.join(','),
|
|
buyerclass: this.filterState.buyerclass.join(','),
|
|
buyPhone: this.filterState.buyPhone ? this.filterState.buyPhone : 0,
|
|
buyPhone: this.filterState.buyPhone ? this.filterState.buyPhone : 0,
|
|
bidPhone: this.filterState.bidPhone ? this.filterState.bidPhone : 0
|
|
bidPhone: this.filterState.bidPhone ? this.filterState.bidPhone : 0
|
|
}
|
|
}
|
|
-
|
|
|
|
this.listState.loading = true
|
|
this.listState.loading = true
|
|
this.listState.loaded = false
|
|
this.listState.loaded = false
|
|
|
|
|
|
@@ -215,12 +234,24 @@ var vm = new Vue({
|
|
this.doQuery()
|
|
this.doQuery()
|
|
},
|
|
},
|
|
dateTimeFilterChange: function (t) {
|
|
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()
|
|
this.doQuery()
|
|
},
|
|
},
|
|
buyerClassFilterChange: function (buyerclass) {
|
|
buyerClassFilterChange: function (buyerclass) {
|
|
var buyerclassArr = []
|
|
var buyerclassArr = []
|
|
|
|
+ this.filterState.buyerclassObj = buyerclass
|
|
for (var key in buyerclass) {
|
|
for (var key in buyerclass) {
|
|
buyerclassArr = buyerclassArr.concat(buyerclass[key])
|
|
buyerclassArr = buyerclassArr.concat(buyerclass[key])
|
|
}
|
|
}
|
|
@@ -236,9 +267,33 @@ var vm = new Vue({
|
|
dataExport: function () {
|
|
dataExport: function () {
|
|
var info = this.getSelectedIdArr()
|
|
var info = this.getSelectedIdArr()
|
|
var ids = info.ids
|
|
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 () {
|
|
unStarSelected: function () {
|
|
@@ -276,6 +331,7 @@ var vm = new Vue({
|
|
ids.push(item._id)
|
|
ids.push(item._id)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ this.currentSelectItems = ids
|
|
return {
|
|
return {
|
|
ids: ids,
|
|
ids: ids,
|
|
arr: arr
|
|
arr: arr
|
|
@@ -377,5 +433,31 @@ var vm = new Vue({
|
|
}.bind(this)
|
|
}.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
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|