123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- var vm = new Vue({
- el: '.vue-search-container',
- delimiters: ['${', '}'],
- components: {
- areaCityComponent: areaCityComponent,
- selectListComponent: selectListComponent,
- priceComponent: priceComponent,
- noData: noDataComponent
- },
- data: function () {
- return {
- provinceMap: provinceMap,
- searchContent: '',
- tabActive: 'qy',
- filterShow: true,
- searchTypeList: [
- {
- label: '企业名称',
- value: 'A'
- },
- {
- label: '法定代表人',
- value: 'B'
- },
- {
- label: '股东',
- value: 'C'
- },
- {
- label: '高管',
- value: 'D'
- },
- {
- label: '中标项目/标的物',
- value: 'E'
- }
- ],
- entTypeList: [
- {
- label: '有限责任公司',
- value: 'A'
- },
- {
- label: '股份有限公司',
- value: 'B'
- },
- {
- label: '有限合伙',
- value: 'C'
- },
- {
- label: '普通合伙',
- value: 'D'
- }
- ],
- entStateList: [
- {
- label: '存续(在营、开业、在业)',
- value: 'A'
- },
- {
- label: '吊销',
- value: 'B'
- },
- {
- label: '注销',
- value: 'C'
- },
- {
- label: '撤销',
- value: 'D'
- }
- ],
- priceList: [
- {
- label: '100万以内',
- value: '0-100'
- },
- {
- label: '100-500万',
- value: '100-500'
- },
- {
- label: '500-1000万',
- value: '500-1000'
- },
- {
- label: '1000-5000万',
- value: '1000-5000'
- },
- {
- label: '5000万以上',
- value: '5000-'
- },
- ],
- zblyFilterOption: {
- zbAreaOptions: [
- // {
- // label: '北京',
- // value: '北京'
- // }
- ],
- dwlxOptions: [
- {
- label: '采购单位',
- value: '1'
- },
- {
- label: '投标企业',
- value: '2'
- },
- {
- label: '招标代理机构',
- value: '3'
- },
- {
- label: '厂商',
- value: '4'
- }
- ],
- lxfsOptions: [
- {
- label: '固定电话',
- value: '1'
- },
- {
- label: '手机号',
- value: '2'
- },
- {
- label: '电子邮箱',
- value: '3'
- },
- {
- label: '不存在',
- value: '4'
- }
- ],
- },
- filterState: {
- searchType: [],
- entArea: [],
- entCity: [],
- entType: [],
- entStatus: [],
- entCapital: [],
- biddingArea: '', // 中标区域
- entClass: '', // 单位类型
- entContact: '' // 联系方式
- },
- listState: {
- loaded: false, // 是否已经搜索过
- loading: false,
- pageNum: 1, // 当前页, 从0开始
- pageSize: 10, // 每页多少条数据
- total: 0, // 一共多少条数据
- list: [] // 查询请求返回的数据
- },
- preSearch: {
- hover: false,
- focus: false,
- list: []
- },
- powerInfo: {
- entniche: '',
- member: '',
- vip: ''
- },
- power: false,
- powerLoaded: false,
- powerDialogShow: false,
- }
- },
- watch: {
- tabActive: function (newVal, oldVal) {
- if (newVal === 'zb') {
- if (this.searchContent) {
- location.href = '/jylab/supsearch/index.html?keywords=' + this.searchContent
- } else {
- location.href = '/jylab/supsearch/index.html'
- }
- }
- }
- },
- computed: {
- preSearchListShow: function () {
- return this.searchContent.trim().length > 2 && this.preSearch.list.length && (this.preSearch.focus || this.preSearch.hover)
- },
- buttonText: function () {
- if (this.power) {
- return '升级'
- } else {
- if (this.powerInfo.vip === 0) {
- return '开通'
- } else if (this.powerInfo.vip === 1) {
- return '升级'
- } else {
- return '升级'
- }
- }
- }
- },
- created: function () {
- this.getPower()
- this.initPageData()
- this.initProvinceMapList()
- },
- mounted: function () {
- this.initDOMEvents()
- // this.checkLogin()
- },
- methods: {
- checkLogin: function () {
- var moduleOpen = $('body').hasClass('modal-open')
- if (moduleOpen) return
- if (!loginflag) {
- $("#bidLogin").modal("show");
- }
- },
- getPower: function (callback) {
- $.ajax({
- url: '/publicapply/bidcoll/power',
- type: 'POST',
- success: function (res) {
- if (res.error_code === 0 && res.data) {
- Object.assign(this.powerInfo, res.data)
- this.checkPower()
- } else {
- this.checkLogin()
- }
- }.bind(this),
- complete: function () {
- this.powerLoaded = true
- callback && callback()
- }.bind(this)
- })
- },
- checkPower: function () {
- this.power = this.powerInfo.member || this.powerInfo.vip !== 0
- },
- initPageData: function () {
- if (pageInfo.searchContent) {
- this.searchContent = pageInfo.searchContent
- }
- },
- initProvinceMapList: function () {
- var provinceMapList = []
- for (var key in this.provinceMap) {
- this.provinceMap[key].forEach(function (item) {
- provinceMapList.push({
- label: item,
- value: item
- })
- })
- }
- this.zblyFilterOption.zbAreaOptions = provinceMapList
- },
- initDOMEvents: function () {
- ewmMoveHover()
- refreshEwmText(this.searchContent)
- },
- isFilterShow: function () {
- if (this.filterShow) {
- $('.search-filters').slideUp()
- } else {
- $('.search-filters').slideDown()
- }
- this.filterShow = !this.filterShow
- },
- searchTypeChange: function (t) {
- var eIndex = t.indexOf('E')
- if (!this.power && eIndex !== -1) {
- this.powerDialogShow = true
- t.splice(eIndex, 1)
- this.$refs.searchType.setState(t)
- return
- }
- this.filterState.searchType = t
- this.doSearch()
- },
- areaCityChange: function (area) {
- var city = []
- for (var key in area) {
- city = city.concat(area[key])
- }
- this.filterState.entArea = Object.keys(area)
- this.filterState.entCity = city
- this.doSearch()
- },
- entTypeChange: function (e) {
- this.filterState.entType = e
- this.doSearch()
- },
- entStateChange: function (e) {
- this.filterState.entStatus = e
- this.doSearch()
- },
- // 标准金额区间
- inexactPriceChange: function (p) {
- this.filterState.entCapital = p
- this.doSearch()
- },
- // 输入金额区间
- exactPriceChange: function (p) {
- this.$refs.entCapital.setState()
- this.filterState.entCapital = [p.min + '-' + p.max]
- this.doSearch()
- },
- zbFilterChange: function () {
- if (this.power) {
- this.doSearch()
- } else {
- this.filterState.biddingArea = ''
- this.filterState.entClass = ''
- this.filterState.entContact = ''
- this.powerDialogShow = true
- }
- },
- doSearch: function () {
- this.resetListState()
- this.getList()
- },
- resetListState: function () {
- var state = {
- loaded: false,
- loading: false,
- pageNum: 1,
- total: 0,
- list: []
- }
- Object.assign(this.listState, state)
- },
- getPreSearchList: utils.debounce(function () {
- var data = {
- name: this.searchContent.trim()
- }
- if (data.name.length <= 2) return
- $.ajax({
- url: '/bigmember/search/ent/association',
- method: 'POST',
- data: data,
- success: function (res) {
- if (res.error_code === 0) {
- if (res.data) {
- this.preSearch.list = res.data.list || []
- }
- } else {
- this.checkLogin()
- }
- }.bind(this)
- })
- }, 200),
- getList: function () {
- var data = {
- match: this.searchContent,
- matchType: this.filterState.searchType.join(','),
- entArea: this.filterState.entArea.join(','),
- entCity: this.filterState.entCity.join(','),
- entCapital: this.filterState.entCapital.join(','),
- entType: this.filterState.entType.join(','),
- entStatus: this.filterState.entStatus.join(','),
- biddingArea: this.filterState.biddingArea,
- entClass: this.filterState.entClass,
- entContact: this.filterState.entContact,
- 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
- this.listState.loaded = false
- $.ajax({
- url: '/publicapply/enterpriseSearch/doQuery',
- method: 'POST',
- data: data,
- success: function (res) {
- if (res.error_code === 0) {
- if (res.data) {
- if (res.data.total) {
- if (this.power) {
- this.listState.total = res.data.total
- } else {
- this.listState.total = 9
- }
- }
- 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.listState.total = 0
- this.listState.list = []
- }
- } else {
- this.checkLogin()
- }
- }.bind(this),
- complete: function () {
- this.listState.loading = false
- this.listState.loaded = true
- }.bind(this)
- })
- },
- onPageChange: function (p) {
- this.listState.pageNum = p
- this.getList()
- },
- openVipPage: function () {
- window.open('/front/subscribe.html')
- },
- toDetail: function (id) {
- window.open('/swordfish/page_big_pc/svip/ent_ser_portrait/' + id)
- },
- calcListItemForCap: function (p) {
- if (p) {
- return p + '万元'
- } else {
- return '-'
- }
- },
- }
- })
- function refreshEwmText (text) {
- if (text && text.trim().length > 0) {
- $(".wx-inner-title").html("扫码关注企业");
- $(".wx-inner-bottom").html('扫码即可实时接收<span style="color:#2cb7ca">'+'"'+text+'"'+'</span>的中标信息!');
- }
- }
- function ewmMoveHover() {
- var $div = $(".search-right-wx .search-right-wx-inner"),
- $parent = $(".search-right-wx");
- $parent.on("mouseover",function(){
- $div.css({
- "transform":"scale(1)",
- "transition":"transform 0.8s"
- })
- })
- $parent.on("mouseout",function(){
- $div.css({
- "transform":"scale(0)",
- "transition":"transform 0.2s"
- })
- })
- }
|