Files
foton-laws-system-front/src/pages/searchCenter/js/searchCenter.js
T
2021-05-25 18:06:45 +08:00

937 lines
33 KiB
JavaScript

import '../../../assets/zTree/js/jquery.ztree.core.js'
import '../../../assets/zTree/js/jquery.ztree.excheck.js'
import '../../../assets/zTree/js/jquery.ztree.exedit.js'
import deptTree from '../../processCenter/pages/components/deptTree'
import { mapState } from 'vuex'
export default {
name: 'SearchCenter',
data () {
return {
selectinfoList: [], // 记录查询出来的结果
total: 0,
loading: false,
searching: false,
countryOptions: [],
standSortOptions: [], // 标准类别下拉框
applyArcticOptions: [], // 适用车型下拉框
standStateOptions: [], // 标准状态下拉框
standNatureOptions: [], // 标准性质下拉框
adoptExtentOptions: [], // 采标程度下拉框
energyKindOptions: [], // 能源种类下拉框
applyAuthOptions: [], // 适用认证(认证类型)下拉框
categoryOptions: [], // 所属类别下拉框
issueTimeOptions: [{label: '全部', value: '0'}, {label: '本月', value: '1'}, {label: '近三个月', value: '2'},
{label: '近一年', value: '3'},
{label: '近两年', value: '4'}, {label: '近三年', value: '5'}, {label: '三年以上', value: '6'}], // 高级搜索条件中的发布日期
conditionShowlist: {},
searchinputflag: false, // 控制搜索框是时间日期,还是普通搜索框
dateRangeData: [], // 记录时间选择框的前后时间
seniorSearchFlag: false, // 控制高级搜索模态框显示
searchInfoEO: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
selectIndex: '', // 记录从哪张表中查数据
nature: [],
country: [],
standSort: [],
numberShow: '',
nameShow: '',
applyArctic: [],
applyAuth: [],
category: [],
energyKind: [],
adoptExtent: [],
standState: [],
selectValue: ''
}, // 分页查询过程中用到的对象
seniortype: ['nature', 'country', 'stand_sort', 'apply_arctic', 'apply_auth', 'category', 'energy_kind', 'adopt_extent', 'statecode', 'issue_time'],
kindtext: '展开条件',
domesticStandColumn: [
{
title: '序号',
type: 'index',
width: 60,
align: 'center',
indexMethod: (row) => {
return ((this.searchInfoEO.page - 1) * this.searchInfoEO.pageSize + row._index + 1)
}
},
{
title: '标准号/政策编号',
key: 'numbershow',
width: 150,
render: (h, params) => {
return h('a', {
props: {},
on: {
click: () => {
this.detailsStandardLaws(params.row)
}
},
class: {
'text-overflow-hidden': true
},
attrs: {
title: params.row.numbershow
}
}, params.row.numbershow)
}
},
{
title: '标准/文件名称',
key: 'nameshow',
render: (h, params) => {
return h('span', {
class: {
'text-overflow-hidden': true
},
attrs: {
title: params.row.nameshow
}
}, params.row.nameshow)
}
},
{
title: '发布日期',
width: 150,
align: 'center',
key: 'issue_time',
render: (h, params) => {
return h('span', {}, this.$dateFormat(new Date(params.row.issue_time), 'yyyy-MM-dd'))
}
},
{
title: '实施日期',
width: 150,
align: 'center',
key: 'put_time',
render: (h, params) => {
return h('span', {}, this.$dateFormat(new Date(params.row.put_time), 'yyyy-MM-dd'))
}
},
{
title: '标准/政策状态',
width: 150,
align: 'center',
key: 'standstateshow',
render: (h, params) => {
if (this.searchInfoEO.selectIndex === 'laws') {
return h('span', {}, params.row.lawsstateshow)
} else {
return h('span', {}, params.row.standstateshow)
}
}
},
{
title: '操作',
key: 'action',
width: 230,
align: 'center',
render: (h, params) => {
let showtyo = ''
if (params.row.collectBtn) {
showtyo = '收藏'
} else {
showtyo = '取消收藏'
}
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small',
ghost: true
},
style: {
marginRight: '5px'
},
on: {
click: () => {
if (params.row.collectBtn) {
this.collectStandard(params.row)
} else {
this.cancelCollectStandard(params.row)
}
}
}
}, showtyo),
h('Button', {
props: {
type: 'primary',
size: 'small',
ghost: true
},
style: {
marginRight: '5px'
},
on: {
click: () => {
// this.shareStandardLaws(params.row) 之前是弹出模态框,可以多选人,后修改成有组织部门的
this.drawerModal = true
this.selectNowObjResult = JSON.parse(JSON.stringify(params.row))
}
}
}, '分享'),
h('Button', {
props: {
type: 'primary',
size: 'small',
ghost: true
},
style: {
marginRight: '5px'
},
on: {
click: () => {
this.goProcess(params.row)
}
}
}, '流程')
])
}
}
],
seniorShowFlag: true,
selectTypeRedio: 'stand',
// 动态消息列表
dynamicTableColumn: [
{
title: '序号',
type: 'index',
width: 60,
align: 'center',
indexMethod: (row) => {
return ((this.searchInfoEO.page - 1) * this.searchInfoEO.pageSize + row._index + 1)
}
},
{
title: '消息模块',
key: 'msgType',
width: 180,
align: 'center',
render: (h, params) => {
// let _this = this
let texts = ''
switch (params.row.msg_type) {
case 'INLAND' :
texts = '国内动态'
break
case 'FOREIGN' :
texts = '国外动态'
break
case 'RESOURCE' :
texts = '资料中心'
break
}
return h('div', {
props: {}
}, texts)
}
},
{
title: '标题',
key: 'title',
align: 'left'
},
{
title: '发布日期',
key: 'pub_time',
width: 180,
align: 'center',
render: (h, params) => {
return h('span', {}, this.$dateFormat(new Date(params.row.pub_time), 'yyyy-MM-dd hh:mm:ss'))
}
},
{
title: '操作',
key: 'action',
width: 180,
align: 'center',
render: (h, params) => {
return h('div', [
h('Button', {
props: {
type: 'warning',
size: 'small'
},
style: {
marginRight: '5px'
},
on: {
click: () => {
this.showMsgPage(params.row.id)
}
}
}, '查看')
])
}
}
],
standTableShowFlag: true,
dynamicTableList: [],
shareStandardModal: false, // 分享模态框显示
selectNowObjResult: {}, // 记录选择的数据
shareStandardSelect: [],
shareUserInfoList: [],
// 模糊搜索下拉框数据
fuzzySearchOption: [{value: 'standNumber', label: '标准编号'},
{value: 'standName', label: '标准名称'},
{value: 'standState', label: '标准状态'},
{value: 'standFile', label: '标准正文内容'},
{value: 'applyArctic', label: '适用车型'},
{value: 'issueTime', label: '发布日期'},
{value: 'putTime', label: '实施日期'},
{value: 'draftUser', label: '起草人'},
{value: 'draftingUnit', label: '起草部门'},
{value: 'replaceStandNum', label: '代替标准'},
{value: 'replacedStandNum', label: '被代替标准'},
{value: 'lawsName', label: '文件名称'},
{value: 'lawsNumber', label: '文件编号'},
{value: 'bussstandName', label: '企业标准名称'},
{value: 'bussstandsNumber', label: '企业标准编号'},
{value: 'msgTitle', label: '动态标题'}
],
// 记录检索历史
searchHistotyData: [],
// 记录为我推荐
recommendList: [],
nodataFlag: false, // 记录是否有查询到数据
// 分享抽屉状态
drawerModal: false,
drawerModalstyles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
idList: [], // 记录所有查询出来的id
exportName: '',
exportModelFlag: false
}
},
methods: {
// 分页查询标准法规
getStandardLawsTable () {
if (this.searchInfoEO.selectKey === 'issueTime' || this.searchInfoEO.selectKey === 'putTime') {
if (this.dateRangeData[0] !== '' && this.dateRangeData[1] !== '') {
this.searchInfoEO.selectStartTime = this.$dateFormat(this.dateRangeData[0], 'yyyy-MM-dd hh:mm:ss')
this.searchInfoEO.selectEndTime = this.$dateFormat(this.dateRangeData[1], 'yyyy-MM-dd hh:mm:ss')
this.searchInfoEO.selectValue = this.dateRangeData[0]
} else {
this.searchInfoEO.selectValue = ''
}
}
// 判断显示标准表格还是动态信息表格
if (this.searchInfoEO.selectIndex === 'msgdyinfo') {
this.standTableShowFlag = false
} else {
this.standTableShowFlag = true
}
this.$http.post('search/searchCenter/searchSarBykey', this.searchInfoEO, {
_this: this, loading: 'loading'
}, res => {
if (this.searchInfoEO.selectIndex === 'msgdyinfo') {
this.nodataFlag = true
} else if (res.data.list.length > 0) {
this.nodataFlag = true
} else {
this.nodataFlag = false
}
if (this.searchInfoEO.selectIndex === 'stand') {
this.selectinfoList = res.data.list
this.total = res.data.count
for (let i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].collectId != null && res.data.list[i].collectId !== '') {
res.data.list[i].collectBtn = false
res.data.list[i].cancelCollectBtn = true
} else {
res.data.list[i].collectBtn = true
res.data.list[i].cancelCollectBtn = false
}
}
// 国内标准处理
this.selectGroupdata(res.data)
} else if (this.searchInfoEO.selectIndex === 'msgdyinfo') {
// 动态消息
this.dynamicTableList = res.data.list
this.total = res.data.count
} else {
// 企业标准,国内外法规
this.selectinfoList = res.data.list
this.total = res.data.count
for (let i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].collectId != null && res.data.list[i].collectId !== '') {
res.data.list[i].collectBtn = false
res.data.list[i].cancelCollectBtn = true
} else {
res.data.list[i].collectBtn = true
res.data.list[i].cancelCollectBtn = false
}
}
}
// 查询为我推荐
if (res.data.list.length > 0) {
this.getRecommend(res.data.list[0])
} else {
this.getRecommend()
}
}, e => {
})
},
// 分页点击后方法
pageChange (page) {
this.searchInfoEO.page = page
this.getStandardLawsTable()
},
// 分页每页显示数改变后方法
pageSizeChange (pageSize) {
this.searchInfoEO.pageSize = pageSize
this.getStandardLawsTable()
},
// 模糊搜索中下拉框数据改变
selectKeyChange (keyvalue) {
if (keyvalue === 'issueTime' || keyvalue === 'putTime') {
this.searchinputflag = true
this.dateRangeData = []
} else {
this.searchinputflag = false
this.searchInfoEO.selectValue = ''
}
},
// 点击高级搜索按钮
seniorSearch () {
if (this.seniorSearchFlag) {
this.seniorSearchFlag = false
this.kindtext = '展开条件'
this.searchInfoEO.nature = []
this.searchInfoEO.country = []
this.searchInfoEO.standSort = []
this.searchInfoEO.numberShow = ''
this.searchInfoEO.nameShow = ''
this.searchInfoEO.applyArctic = []
this.searchInfoEO.applyAuth = []
this.searchInfoEO.category = []
this.searchInfoEO.energyKind = []
this.searchInfoEO.adoptExtent = []
this.searchInfoEO.standState = []
this.searchInfoEO.issueTime = ''
} else {
this.seniorSearchFlag = true
this.kindtext = '收起条件'
}
},
// 点击高级搜索模态框中的确认按钮
searchSeniorClick () {
this.searchInfoEO.page = 1
this.seniorShowFlag = true
this.selectTypeRedio = 'stand'
this.searchInfoEO.selectIndex = 'stand'
this.getStandardLawsTable()
},
// 查看 查看跳转详情页
detailsStandardLaws (item) {
let routername = ''
let pagetype = ''
if (item.type === 'stand') {
routername = 'OtherStandardDetails'
if (item.stand_type === 'INLAND') {
pagetype = 'INLAND_STAND'
} else {
pagetype = 'FOREIGN_STAND'
}
} else if (item.type === 'laws') {
routername = 'OtherLawsDetails'
if (item.laws_type === 'INLAND') {
pagetype = 'INLAND_LAWS'
} else {
pagetype = 'FOREIGN_LAWS'
}
} else {
routername = 'OtherBussStandardDetails'
pagetype = 'BUSINESS_STAND '
}
// 详情跳到新页
let routeUrl = this.$router.resolve({
name: routername,
params: {
id: item.id,
pageType: pagetype
}
})
window.open(routeUrl.href, '_blank')
},
// 收藏
collectStandard (item) {
let personCollect = {}
personCollect.collectResId = item.id
personCollect.collectTitle = item.nameshow + '(编号:' + item.numbershow + ')'
let pagetype = ''
if (item.type === 'stand') {
if (item.stand_type === 'INLAND') {
pagetype = 'INLAND_STAND'
} else {
pagetype = 'FOREIGN_STAND'
}
} else if (item.type === 'laws') {
if (item.laws_type === 'INLAND') {
pagetype = 'INLAND_LAWS'
} else {
pagetype = 'FOREIGN_LAWS'
}
} else {
pagetype = 'BUSINESS_STAND'
}
personCollect.collectType = pagetype
this.$http.postData('person/personCollect', personCollect, {
_this: this
}, res => {
item.collectBtn = !item.collectBtn
item.cancelCollectBtn = !item.cancelCollectBtn
item.collectId = res.data.id
}, e => {
})
},
// 取消收藏
cancelCollectStandard (item) {
this.$http.put('person/personCollect/updateByUserId', {
id: item.collectId
}, {
_this: this
}, res => {
item.collectBtn = !item.collectBtn
item.cancelCollectBtn = !item.cancelCollectBtn
item.collectId = ''
}, e => {
})
},
// 分享标准
shareStandardLaws (item) {
this.selectNowObjResult = JSON.parse(JSON.stringify(item))
this.shareStandardModal = true
this.$http.get('/sys/user/userEoList', '', {
_this: this
}, res => {
this.shareUserInfoList = res.data
}, e => {
})
},
// 消息推送
sureShareStandardLaws () {
if (this.shareStandardSelect.length === 0) {
this.$Message.warning('请选择要分享的人!')
} else {
let pagetype = ''
if (this.selectNowObjResult.type === 'stand') {
if (this.selectNowObjResult.stand_type === 'INLAND') {
pagetype = 'INLAND_STAND'
} else {
pagetype = 'FOREIGN_STAND'
}
} else if (this.selectNowObjResult.type === 'laws') {
if (this.selectNowObjResult.laws_type === 'INLAND') {
pagetype = 'INLAND_LAWS'
} else {
pagetype = 'FOREIGN_LAWS'
}
} else {
pagetype = 'BUSINESS_STAND'
}
let personShareEO = {}
personShareEO.resType = pagetype
personShareEO.resTitle = this.selectNowObjResult.nameshow + ' ( 编号:' + this.selectNowObjResult.numbershow + ' )'
personShareEO.resId = this.selectNowObjResult.id
personShareEO.recipientId = this.shareStandardSelect.join(',')
this.$http.post('/person/personShare/savePersonShare', personShareEO, {
_this: this
}, res => {
this.$Message.success('分享成功!')
this.shareStandardModal = false
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
}, e => {
this.$Message.error('分享失败!')
})
}
},
// 取消
treeCancel () {
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
// 树点击
selcetTree (treeId, treeNode) {
this.shareStandardSelect.push(treeNode.id)
},
// 流程
goProcess (item) {
this.$store.commit('setSearchInfoEO', JSON.stringify(this.searchInfoEO))
let obj = {}
obj.id = item.id
obj.showName = item.nameshow
obj.showNumber = item.numbershow
obj.natureShow = item.nature
let pagetype = ''
this.$store.commit('setDetailMap', this.$route.path)
if (item.type === 'stand') {
if (item.stand_type === 'INLAND') {
pagetype = 'INLAND_STAND'
} else {
pagetype = 'FOREIGN_STAND'
}
} else if (item.type === 'laws') {
if (item.laws_type === 'INLAND') {
pagetype = 'INLAND_LAWS'
} else {
pagetype = 'FOREIGN_LAWS'
}
} else {
pagetype = 'BUSINESS_STAND'
}
obj.typeShow = pagetype
sessionStorage.setItem('processStandLaws', JSON.stringify(obj))
this.$router.push({
path: '/newProcess'
})
},
// 高级搜索后,返回各分组数据
selectGroupdata (data) {
if (data.list.length > 0) {
let resultdata = data.list[0]['groupdata']
for (let i = 0; i < this.seniortype.length; i++) {
let nowdata = this.conditionShowlist[this.seniortype[i]].value
let resultsubdata = resultdata[this.seniortype[i]]
for (let j = 0; j < nowdata.length; j++) {
if (resultsubdata[nowdata[j].value] === undefined) {
nowdata[j].number = 0
} else {
nowdata[j].number = resultsubdata[nowdata[j].value]
}
}
}
} else {
for (let i = 0; i < this.seniortype.length; i++) {
let nowdata = this.conditionShowlist[this.seniortype[i]].value
for (let j = 0; j < nowdata.length; j++) {
nowdata[j].number = 0
}
}
}
},
selectTypeRedioChange () {
this.searchInfoEO.page = 1
if (this.selectTypeRedio === 'stand') {
this.seniorShowFlag = true
} else {
this.seniorShowFlag = false
}
switch (this.selectTypeRedio) {
case 'stand': this.searchInfoEO.selectIndex = 'stand'; break
case 'laws': this.searchInfoEO.selectIndex = 'laws'; break
case 'bussstand': this.searchInfoEO.selectIndex = 'bussstand'; break
case 'msgdyinfo': this.searchInfoEO.selectIndex = 'msgdyinfo'; break
}
this.getStandardLawsTable()
},
// 模糊搜索按钮点击事件
fuzzySearch () {
this.searchInfoEO.page = 1
if (this.searchInfoEO.selectKey === 'lawsName' || this.searchInfoEO.selectKey === 'lawsNumber') {
this.seniorShowFlag = false
this.selectTypeRedio = 'laws'
this.searchInfoEO.selectIndex = 'laws'
} else if (this.searchInfoEO.selectKey === 'bussstandName' || this.searchInfoEO.selectKey === 'bussstandsNumber') {
this.seniorShowFlag = false
this.selectTypeRedio = 'bussstand'
this.searchInfoEO.selectIndex = 'bussstand'
} else if (this.searchInfoEO.selectKey === 'msgTitle') {
this.seniorShowFlag = false
this.selectTypeRedio = 'msgdyinfo'
this.searchInfoEO.selectIndex = 'msgdyinfo'
} else {
this.seniorShowFlag = true
this.selectTypeRedio = 'stand'
this.searchInfoEO.selectIndex = 'stand'
}
this.getStandardLawsTable()
},
// 查看消息内容
showMsgPage (id) {
// 详情跳到新页
let routeUrl = this.$router.resolve({
name: 'OtherDomesticDynamicsDetails',
params: {
id: id
}
})
window.open(routeUrl.href, '_blank')
},
// 标准查询条件搜索按钮
clearAllSearch () {
this.searchInfoEO.nature = []
this.searchInfoEO.country = []
this.searchInfoEO.standSort = []
this.searchInfoEO.numberShow = ''
this.searchInfoEO.nameShow = ''
this.searchInfoEO.applyArctic = []
this.searchInfoEO.applyAuth = []
this.searchInfoEO.category = []
this.searchInfoEO.energyKind = []
this.searchInfoEO.adoptExtent = []
this.searchInfoEO.standState = []
this.searchInfoEO.issueTime = ''
this.getStandardLawsTable()
},
// 查询检索历史记录
getSearchHistoty () {
this.$http.get('person/personSearch/selectPersonSearch', this.searchInfoEO, {
_this: this
}, res => {
this.searchHistotyData = res.data
}, e => {
})
},
getDate (date) {
return date != null ? date.substring(0, date.indexOf(' ')) : ''
},
deleteSearchHistory (flag, item) {
let type = ''
let id = ''
if (flag === 1) {
type = 'all'
} else {
id = item.id
}
this.$http.post('person/personSearch/deletePersonSearch', {id: id, type: type}, {
_this: this, loading: 'loading'
}, res => {
this.getSearchHistoty()
}, e => {
})
},
// 查询为我推荐
getRecommend (item) {
let obj = {}
obj.id = item.id
let url = ''
if (item.type === 'stand') {
// 为我推荐查询
url = 'lawss/sarStandardsInfo/selectRecommendStand'
} else if (item.type === 'laws') {
url = 'lawss/sarLawsInfo/selectRecommendLaws'
} else if (item.type === 'bussstand') {
url = 'lawss/sarBussionessStand/selectRecommendStand'
} else {
url = 'lawss/msgDynamicInfo/selectRecommendMsgDynamicInfo'
}
this.$http.get(url, obj, {
_this: this
}, res => {
this.recommendList = res.data
}, e => {
})
},
showRecommendDetials (item) {
if (item.typeShow !== 'MSG_DYNAMIC') {
let routername = ''
let pagetype = ''
pagetype = item.typeShow
if (item.typeShow === 'INLAND_STAND' || item.typeShow === 'FOREIGN_STAND') {
routername = 'OtherStandardDetails'
} else if (item.typeShow === 'INLAND_LAWS' || item.typeShow === 'FOREIGN_LAWS') {
routername = 'OtherLawsDetails'
} else if (item.typeShow === 'BUSINESS_STAND') {
routername = 'OtherBussStandardDetails'
}
// 详情跳到新页
let routeUrl = this.$router.resolve({
name: routername,
params: {
id: item.id,
pageType: pagetype
}
})
window.open(routeUrl.href, '_blank')
} else {
this.showMsgPage(item.id)
}
},
// 没有数据的时候申请购买
applyPurchase () {
this.$store.commit('setSearchInfoEO', JSON.stringify(this.searchInfoEO))
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'NewProcess',
params: {
type: '10',
state: 1
}
})
},
// 导出查询数据模态框控制
exportSelectFlag () {
if (this.total > 0) {
this.exportName = ''
this.exportModelFlag = true
// 将所有的搜索条件传回去,没有分页去查询所有的id
this.$http.post('search/searchCenter/searchIdToImport', this.searchInfoEO, {
_this: this, loading: 'loading'
}, res => {
if (res.ok) {
this.idList = res.data
} else {
this.$Message.warning(res.message)
}
}, e => {
})
} else {
this.$Message.warning('没有查询到任何数据')
}
},
// 导出确定功能
exportTestItem () {
if (this.exportName === '') {
this.exportName = '查询信息导出'
}
if (this.searchInfoEO.selectIndex === 'stand') {
window.open('/api/lawss/sarStandardsInfo/exportStandardsInfoExcel?idList=' + this.idList.join(',') + '&exportName=' + this.exportName)
} else if (this.searchInfoEO.selectIndex === 'laws') {
window.open('/api/lawss/sarLawsInfo/exportLawsInfos?ids=' + this.idList.join(',') + '&exportNameGet=' + this.exportName)
} else if (this.searchInfoEO.selectIndex === 'bussstand') {
window.open('/api/lawss/sarBussionessStand/exportSarBussionessStand?idList=' + this.idList.join(',') + '&exportName=' + this.exportName)
} else {
window.open('/api/lawss/msgDynamicInfo/exportMsgDynamicInfoExcel?idList=' + this.idList.join(',') + '&exportName=' + this.exportName)
}
this.$Message.success('导出信息成功..')
this.exportModelFlag = false
},
// 导出取消按钮关闭模态、置空
cancal () {
this.exportModelFlag = false
}
},
components: {
ComHeader,
SideBar,
deptTree
},
props: {},
computed: {
...mapState(['process'])
},
watch: {},
mounted () {
if (this.$route.params.selectKey === undefined || this.$route.params.selectKey === '') {
this.searchInfoEO.selectKey = 'standNumber'
} else {
this.searchInfoEO.selectKey = this.$route.params.selectKey
}
// 如果从首页进来,输入框中没有输入任何数据,传递allvalue
if (this.$route.params.selectValue === 'allvalue' || this.$route.params.selectValue === undefined || this.$route.params.selectValue === '') {
this.searchInfoEO.selectValue = ''
} else {
this.searchInfoEO.selectValue = this.$route.params.selectValue
}
if (this.searchInfoEO.selectKey === 'issueTime' || this.searchInfoEO.selectKey === 'putTime') {
let datarange = JSON.parse(this.searchInfoEO.selectValue)
this.dateRangeData[0] = new Date(datarange[0])
this.dateRangeData[1] = new Date(datarange[1])
this.searchInfoEO.selectValue = ''
this.searchinputflag = true
}
// 判断selectKey 从而确定从哪个索引表中查询数据
if (this.searchInfoEO.selectKey === 'lawsName' || this.searchInfoEO.selectKey === 'lawsNumber') {
this.selectTypeRedio = 'laws'
} else if (this.searchInfoEO.selectKey === 'bussstandName' || this.searchInfoEO.selectKey === 'bussstandsNumber') {
this.selectTypeRedio = 'bussstand'
} else if (this.searchInfoEO.selectKey === 'msgTitle') {
this.selectTypeRedio = 'msgdyinfo'
} else {
this.selectTypeRedio = 'stand'
}
this.selectTypeRedioChange()
// 从数据库中查询各下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '', {
_this: this
}, res => {
let obj = {}
obj['key'] = '标准性质'
obj['value'] = JSON.parse(JSON.stringify(res.data.SARPROPERTY))
this.conditionShowlist.nature = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '国家/地区'
obj['value'] = JSON.parse(JSON.stringify(res.data.COUNTRY))
this.conditionShowlist.country = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '标准类别'
obj['value'] = JSON.parse(JSON.stringify(res.data.STANDCLASSIFY))
this.conditionShowlist.stand_sort = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '产品类别'
obj['value'] = JSON.parse(JSON.stringify(res.data.PRODUCTTYPE)) // 根据需求文档,产品类别对应标准属性中的“适用车型”
this.conditionShowlist.apply_arctic = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '认证类型'
obj['value'] = JSON.parse(JSON.stringify(res.data.PROVETYPE)) // 适用认证下拉框
this.conditionShowlist.apply_auth = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '所属类别'
obj['value'] = JSON.parse(JSON.stringify(res.data.CATEGORY))
this.conditionShowlist.category = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '能源种类'
obj['value'] = JSON.parse(JSON.stringify(res.data.ENERGYTYPES))
this.conditionShowlist.energy_kind = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '采标程度'
obj['value'] = JSON.parse(JSON.stringify(res.data.DEGREESTANDARD))
this.conditionShowlist.adopt_extent = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '标准状态'
obj['value'] = JSON.parse(JSON.stringify(res.data.STANDSTATE))
this.conditionShowlist.statecode = JSON.parse(JSON.stringify(obj)) // 标准性质
obj['key'] = '发布时间'
obj['value'] = [
{label: '本月', value: '1'}, {label: '近三个月', value: '2'},
{label: '近一年', value: '3'}, {label: '近两年', value: '4'},
{label: '近三年', value: '5'}, {label: '三年以上', value: '6'}]
this.conditionShowlist.issue_time = JSON.parse(JSON.stringify(obj)) // 发布时间
// 设置高级搜索下拉框
this.standNatureOptions = res.data.SARPROPERTY // 标准性质
this.standNatureOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.countryOptions = res.data.COUNTRY
this.countryOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.standSortOptions = res.data.STANDCLASSIFY
this.standSortOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.applyArcticOptions = res.data.PRODUCTTYPE // 根据需求文档,产品类别对应标准属性中的“适用车型”
this.applyArcticOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.applyAuthOptions = res.data.PROVETYPE // 适用认证下拉框
this.applyAuthOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.categoryOptions = res.data.CATEGORY
this.categoryOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.standStateOptions = res.data.STANDSTATE
this.standStateOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.adoptExtentOptions = res.data.DEGREESTANDARD
this.adoptExtentOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
this.energyKindOptions = res.data.ENERGYTYPES
this.energyKindOptions.splice(0, 0, {'label': '全部', 'value': 'all'})
}, e => {
})
// 查询检索历史
this.getSearchHistoty()
},
// 路由进入之前
beforeRouteEnter (to, from, next) {
if (from.name === 'NewProcess') {
// 从vuex里读取暂存记录
next(vm => {
if (vm.$store.getters.searchInfoEO !== '') {
vm.searchInfoEO = vm.$store.getters.getSearchInfoEO
}
})
} else {
next()
}
},
beforeRouteLeave (to, from, next) {
// 清除流程缓存
if (to.name !== 'NewProcess' && this.$store.state.searchInfoEO !== '') {
this.$store.commit('setSearchInfoEO', '')
}
sessionStorage.removeItem('searchInfoEO')
next()
}
}