瀏覽代碼

feat:增加广东移动单位搜索、画像页面

yangfeng 3 年之前
父節點
當前提交
0f4918f334

+ 13 - 7
src/components/chart/ProgressChart.vue

@@ -43,7 +43,13 @@ export default {
   props: {
     type: String,
     // 传入的数据
-    datas: Array
+    datas: Array,
+    ishref: {
+      type: Boolean,
+      default () {
+        return true
+      }
+    }
   },
   data () {
     return {}
@@ -73,12 +79,12 @@ export default {
       window.open('/swordfish/page_big_pc/unit_portrayal/' + encodeURIComponent(name))
     },
     goEnt (id) {
-      // if (this.info.power.indexOf(5) > -1) {
-      //   window.open('/swordfish/page_big_pc/ent_portrait/' + id)
-      // } else {
-      //   window.open('/swordfish/page_big_pc/svip/ent_ser_portrait/' + id)
-      // }
-      window.open('/swordfish/page_big_pc/svip/ent_ser_portrait/' + id)
+      if (!this.ishref) return
+      if (this.info.power.indexOf(5) > -1) {
+        window.open('/swordfish/page_big_pc/ent_portrait/' + id)
+      } else {
+        window.open('/swordfish/page_big_pc/svip/ent_ser_portrait/' + id)
+      }
     }
   }
 }

+ 1 - 1
src/router/routers.js

@@ -157,7 +157,7 @@ export default [
   {
     path: '/free/custom_search',
     name: 'custom_search',
-    component: () => import('@/views/customer/EntSearch.vue')
+    component: () => import('@/views/customer/Search.vue')
   },
   // 广东客户-采购单位画像
   {

+ 98 - 411
src/views/customer/Buyer.vue

@@ -2,41 +2,29 @@
   <Layout class="unit-portrayal">
     <div class="unit-portrayal-content" v-loading="loading" background="#fff">
       <div class="unit-type">
-        <div class="u-top-container">
-          <div class="u-name">{{ info.buyerName }}</div>
-          <!-- <div class="u-follow" @click="setFollow" v-if="conf7">
-            <span :class="{ icon_heart_red: follow.followed, icon_heart_gray: !follow.followed }"></span>
-            <span class="follow-text">{{ follow.followed ? '已关注' : '关注' }}</span>
-          </div> -->
+        <div class="unit-logo" :class="entInfo.randomBgc">
+          {{ entInfo.company_shortname ? entInfo.company_shortname.slice(0,4) : entInfo.company_name.slice(0,4) }}
         </div>
-        <div class="u-type">
-          <div class="u-t-item">
-            <span class="area-icon"></span>
-            <span>所在地:{{ info.province }} {{ info.city }}</span>
+        <div>
+          <div class="u-top-container">
+            <div class="u-name">
+              <span class="u-name-h">{{ entInfo.company_name }}</span>
+              <span class="u-name-tag" :class="getEntStatus(entInfo.company_status)">{{entInfo.company_status}}</span>
+            </div>
           </div>
-          <div class="u-t-item">
-            <span class="type-icon"></span>
-            <span>采购单位类型:{{ info.buyerClass }}</span>
+          <div class="u-detail">
+            <div class="u-d-info">
+              <span>法定代表人:{{entInfo.legal_person ?entInfo.legal_person : '-'}}</span>
+              <span>注册资本:{{calcListItemForCap(entInfo.capital)}}</span>
+              <span>成立日期:{{entInfo.establishStamp ? new Date(entInfo.establishStamp * 1000).pattern('yyyy-MM-dd') : '-' }}</span>
+              <span>联系方式:{{entInfo.company_phone ? entInfo.company_phone : '-'}}</span>
+            </div>
+            <div class="u-d-info">
+              <span>地址:{{entInfo.company_address ? entInfo.company_address : '-' }}</span>
+            </div>
           </div>
         </div>
       </div>
-      <!-- 超级订阅用户、免费用户显示 -->
-      <!-- <div>
-        <div class="free-bg" v-if="userInfo.isFree && userInfo.freeBuyerPort === 0">
-          <span class="give-tip">赠送</span>
-          <div class="free-text">免费赠送1次【采购单位全景分析】权益体验机会!</div>
-          <div class="unlock-btn" @click="goUnlock">去解锁>></div>
-        </div>
-        <div class="supervip-bg" v-if="vipStatusNoMember">
-          <div class="vip-balance">当月采购单位画像余额:<em class="highlight-text">{{usageInfo.surplus}}</em></div>
-          <div class="update-btn" @click.stop="goUpdate">{{vipStatusBtn}}</div>
-        </div>
-      </div> -->
-      <!-- 采购单位通讯录 -->
-      <!-- <ContactList name="buyer" titlename="采购单位通讯录" style="padding:32px 40px 32px;" v-if="!noBuyerAuth"></ContactList>
-      <div class="mask-bg-group" v-else>
-        <MaskCard @click="openBigPage('采购单位通讯录', getEntContactMap)" k="采购单位通讯录 " :key="'采购单位通讯录' + getEntContactMap.button + getEntContactMap.title" :item="getEntContactMap"></MaskCard>
-      </div> -->
       <div class="unit-info">
         <div class="bidcomp">
           <BidInfoActive whichPor="unitpor" @onPageChange="onLimitChange" :canselect="canSelect" title="采购单位分析"></BidInfoActive>
@@ -65,13 +53,13 @@
         </div>
         <div class="u-i-tip" v-if="baseShow">数据统计范围:{{ info.start }}-{{ info.end }}</div>
       </div>
-      <unit-chart @isTrial="getIsTrail" @baseInfoBool="baseInfoBool" @showEmpty="showEmpty" :params="bidInfoParams" v-on:baseInfo="getBaseInfo"></unit-chart>
+      <unit-chart @baseInfoBool="baseInfoBool" @showEmpty="showEmpty" :params="bidInfoParams" v-on:baseInfo="getBaseInfo"></unit-chart>
+      <!-- 预告项目 -->
+      <unit-list title="预告项目" :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList"></unit-list>
+      <!-- 即将到期项目 -->
+      <unit-list title="即将到期项目" :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList"></unit-list>
       <!-- 招标动态 -->
-      <unit-list :noauth="noBuyerAuth" :usage="usageInfo" :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList" @click="openCheckPop" @onClickUnlock="goEmitClick"></unit-list>
-      <!-- <div class="unit-big-upgrade-group" v-if="noBuyerAuth && !emptyShow">
-        <MaskCard @click="openBigPage(k, item)" v-for="(item, k) in getBigUpgradeMap" :key="k + item.button + item.title"
-                  :k="k" :item="item"></MaskCard>
-      </div> -->
+      <unit-list :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList"></unit-list>
       <Empty v-show="emptyShow" :images="require('@/assets/images/empty/jy-chagrin.png')">
         <div slot="default" style="text-align:center">
           <span>对不起,没有匹配到相关信息,</span><br/>
@@ -79,32 +67,18 @@
         </div>
       </Empty>
     </div>
-    <el-dialog
-      class="unit-dialog-group"
-      title="联系客服"
-      :visible.sync="isDialogShow"
-    >
-      <div class="unit-dialog-content">如有疑问,请联系客服:400-108-6670</div>
-    </el-dialog>
-    <!-- <CollectInfo ref="collectRef"></CollectInfo> -->
   </Layout>
 </template>
 <script>
 import Layout from '@/components/common/ContentLayout'
 import UnitChart from './components/BuyerChart'
-import UnitList from '../portrayal/components/UnitList'
-import BidInfoActive from '../portrayal/components/BidInfoActive'
-import ContactList from '@/components/contact-info/ContactInfo'
-import MaskCard from '@/components/mask-card/MaskCard.vue'
+import UnitList from './components/UnitList'
+import BidInfoActive from './components/BidInfoActive'
 import Empty from '@/components/common/Empty'
 import { Dialog } from 'element-ui'
-import { setLogs, getStatusCustomer, setStatusCustomer, getBuyerSelect, getVipBuyerSelect, getUsage } from '@/api/modules'
+import { getBuyerSelect } from '@/api/modules'
 import { mapState } from 'vuex'
 
-function getImgForBigUpgrade (name, bg = false, suffix = '.png') {
-  const temp = (bg ? 'bg/' : '') + name + suffix
-  return require('@/assets/images/big/' + temp)
-}
 /* eslint-disable */
 export default {
   name: 'unit-portrayal',
@@ -112,8 +86,6 @@ export default {
     Layout,
     UnitChart,
     UnitList,
-    ContactList,
-    MaskCard,
     BidInfoActive,
     [Dialog.name]: Dialog,
     Empty
@@ -143,302 +115,31 @@ export default {
       unitData: {
         id: ''
       },
-      entContactTip: {
-        title: '开通大会员',
-        subtitle: '获取采购单位类似项目联系人、联系方式等,一键拨打!',
-        button: '免费体验',
-        source: 'buyer_portrait_contacts_freeuser',
-        img: getImgForBigUpgrade('1-big'),
-        bg: getImgForBigUpgrade('1-bg', true)
-      },
-      bigUpgradeMap: {
-        年度项目统计: {
-          title: '开通大会员',
-          subtitle: '采购单位年度项目规模、增长趋势一目了然,快速分析市场!',
-          img: getImgForBigUpgrade('2-big'),
-          bg: getImgForBigUpgrade('2-bg', true),
-          source: 'buyer_portrait_yearData_freeuser'
-        },
-        月度采购规模统计: {
-          title: '开通大会员',
-          subtitle: '通过纵向对比近3年月度中标金额,快速分析行业月度采购趋势!',
-          img: getImgForBigUpgrade('3-big'),
-          bg: getImgForBigUpgrade('3-bg', true),
-          source: 'buyer_portrait_monthData_freeuser'
-        },
-        采购规模分布: {
-          title: '开通大会员',
-          subtitle: '全面了解采购单位的年度采购规划、项目预算,帮助投标人制定投标策略!',
-          img: getImgForBigUpgrade('4-big'),
-          bg: getImgForBigUpgrade('4-bg', true),
-          source: 'buyer_portrait_moneyRange_freeuser'
-        },
-        各类招标方式占比: {
-          title: '开通大会员',
-          subtitle: '洞察采购单位招标方式、数量、金额占比,综合了解采购单位,帮企业决策是否投标!',
-          img: getImgForBigUpgrade('5-big'),
-          bg: getImgForBigUpgrade('5-bg', true),
-          source: 'buyer_portrait_bidtypeData_freeuser'
-        },
-        各行业项目平均节支率: {
-          title: '开通大会员',
-          subtitle: '分析行业项目的预算、中标价格差额比率,帮助企业核算采购项目的利润率!',
-          img: getImgForBigUpgrade('6-big'),
-          bg: getImgForBigUpgrade('6-bg', true),
-          source: 'buyer_portrait_rate_freeuser'
-        },
-        重点合作代理机构: {
-          title: '开通大会员',
-          subtitle: '通过提供合作代理机构的名录、数量,全面洞察采购单位合作环境,辅助投标决策!',
-          img: getImgForBigUpgrade('12-big'),
-          bg: getImgForBigUpgrade('12-bg', true),
-          source: 'buyer_portrait_topAgencyData_freeuser'
-        },
-        重点合作企业: {
-          title: '开通大会员',
-          subtitle: '通过挖掘重点合作企业,直观了解采购单位与企业关系远近,辅助投标决策!',
-          img: getImgForBigUpgrade('8-big'),
-          bg: getImgForBigUpgrade('8-bg', true),
-          source: 'buyer_portrait_topShow_freeuser'
-        },
-        各行业项目规模占比: {
-          title: '开通大会员',
-          subtitle: '通过行业采购项目的规模、数量、利润率,洞悉采购单位的采购状况!',
-          img: getImgForBigUpgrade('7-big'),
-          bg: getImgForBigUpgrade('7-bg', true),
-          source: 'buyer_portrait_top12_freeuser'
-        }
-      },
       bidInfoParams: {},
       canSelect: {},
       baseShow: true,
       chartShowArr: [],
       emptyShow: false,
       unitlistshow: true,
-      usageInfo: {
-        total: 0,
-        usage: 0,
-        provin: 0,
-        visited: false,
-        surplus: 0
-      }, // 画像访问量
-      freeTrial: false,
       entInfo: {}
     }
   },
-  watch: {
-    chartShowArr (newval) {
-      if (newval.indexOf(true) !== -1) {
-        this.emptyShow = false
-      } else {
-        if (this.noBuyerAuth) {
-          this.emptyShow = false
-        } else {
-          this.emptyShow = true
-        }
-      }
-    },
-    'usageInfo.provin' (newVal) {
-      this.usageInfo.provin = newVal
-    }
-  },
+  watch: {},
   computed: {
     ...mapState({
       userInfo: state => state.user.info
-    }),
-    conf7 () {
-      const power = this.userInfo.power
-      if (power) {
-        // 7.挖掘潜在客户
-        return power.indexOf(7) !== -1
-      } else {
-        return false
-      }
-    },
-    canShowHistoryContact () {
-      const info = this.userInfo
-      const usage = this.usageInfo
-      // 大会员用户有采购单位全景分析权限
-      const bigMember = info.memberStatus > 0 && info.power.indexOf(5) !== -1
-      // 新超级订阅用户 有采购单位画像余额
-      const svip = info.vipStatus > 0 && info.viper && usage.surplus > 0
-      // 新超级订阅用户 次数用完 浏览过
-      const svipTrial = info.vipStatus > 0 && info.viper && usage.surplus <= 0 && usage.visited
-      // 免费用户 留过资 免费体验一次
-      const freePort = info.isFree && info.freeBuyerPort > 0
-      // 免费用户 体验过期 浏览过
-      const freeTail = info.isFree && info.freeBuyerPort < 0
-      return bigMember || svip  || svipTrial || freePort || freeTail
-    },
-    // 可以查看画像权限,显示遮罩
-    noBuyerAuth () {
-      const info = this.userInfo
-      const usage = this.usageInfo
-      const isFreeAuth = info.isFree && info.freeBuyerPort > 0
-      const isVipAuth = info.vipStatus > 0 && info.viper && usage.surplus > 0
-      const isMember = info.power.indexOf(5)  !== -1
-      // 超级订阅用户是否访问过该画像
-      const vipTrial = info.vipStatus > 0 && info.viper && usage.surplus === 0 && usage.visited
-      // 免费用户是否查看过该画像
-      const freeTrial = info.isFree && info.freeBuyerPort < 0 && this.freeTrial
-      // 免费用户无体验次数的、超级订阅用户无剩余次数的、没有大会员浏览权限的 显示遮罩
-      return !isFreeAuth && !isVipAuth && !isMember && !freeTrial && !vipTrial
-    },
-    getEntContactMap () {
-      const tempMap = this.entContactTip
-      const canShow = this.userInfo.memberStatus > 0
-      let tempTitle = '大会员'
-      // let tempButton = '联系客服'
-      if (!canShow) {
-        tempTitle = '开通大会员'
-        // tempButton = '免费体验'
-      }
-      tempMap.title = tempTitle
-      tempMap.button = this.shadeBottomBtnText
-      return tempMap
-    },
-    // 纯超级订阅用户
-    vipStatusNoMember () {
-      return this.userInfo.vipStatus > 0 && this.userInfo.viper && this.userInfo.memberStatus <= 0
-    },
-    // 超级订阅余额提醒 对应文案
-    vipStatusBtn () {
-      let text = ''
-      if (this.usageInfo.provin === -1) {
-        text = '联系客服'
-      } else {
-        text = '前往升级'
-      }
-      return text
-    },
-    getBigUpgradeMap () {
-      for (const v in this.bigUpgradeMap) {
-        // let tempTitle = '大会员'
-        // let tempButton = '联系客服'
-        // if (!tempPowerInfo.isMember) {
-        //   tempTitle = '开通大会员'
-        //   tempButton = '免费体验'
-        // }
-        // this.bigUpgradeMap[v].title = tempTitle
-        console.log(this.shadeBottomBtnText)
-        this.bigUpgradeMap[v].button = this.shadeBottomBtnText
-      }
-      return  this.bigUpgradeMap
-    },
-    // 遮罩按钮对应文案
-    shadeBottomBtnText () {
-      let btnText = ''
-      const info = this.userInfo
-      const usage = this.usageInfo
-      // 【立即解锁】:未体验过采购单位画像的免费用户,点击进行“欢迎体验采购单位全景分析”留资
-      // 【去开通】:已体验过1次采购单位画像的免费用户,点击进入超级订阅购买页
-      // 【前往升级】:超级订阅老版用户+购买了非全国采购单位画像余额为0的超级订阅新版用户,点击进入超级订阅升级页
-      // 【联系客服】:购买了全国采购单位画像余额为0的超级订阅新版用户+无采购单位画像权限的大会员客户;点击调起智齿在线客服
-      if (info.isFree) {
-        if (info.freeBuyerPort === 0) {
-          btnText = '立即解锁'
-        } else {
-          btnText = '去开通'
-        }
-      } else {
-        btnText = ''
-        // 老超级订阅用户
-        const oldVip = info.vipStatus > 0 && !info.viper
-        // 新超级订阅用户
-        const newVip = info.vipStatus > 0 && info.viper
-        // 大会员用户
-        const member = info.memberStatus > 0
-        // 新超级订阅用户买的非全国 余额为0
-        const noAllProvinNoCounts = newVip && usage.provin !== -1 && usage.surplus <= 0
-        // 超级订阅新用户 购买的全国 余额为0
-        const allProvinNoCounts = newVip && usage.provin === -1 && usage.surplus <= 0
-        // 无权限的大会员用户
-        const noAuthMember = info.memberStatus > 0 && info.power.indexOf(5) === -1
-        // 纯商机管理用户
-        const entniche = info.entniche && !oldVip && !newVip && !member
-        if (oldVip || noAllProvinNoCounts) {
-          btnText = '前往升级'
-        } else if (allProvinNoCounts || noAuthMember || entniche) {
-          btnText = '联系客服'
-        }
-      }
-      return btnText
-    }
+    })
   },
   created () {
+    console.log(JSON.parse(this.$route.query.info))
     if (this.$route.query.info) {
       this.entInfo = JSON.parse(this.$route.query.info)
     }
-    this.$store.dispatch('user/getUserPower')
   },
   mounted () {
-    this.info.buyerName = decodeURIComponent(this.$route.params.entName)
-    // this.getBigUpgradeMap()
-    this.getFollowState()
     this.getSelect()
-    this.getBuyerUsage()
-    $.ajax({
-      url: '/publicapply/bidcoll/power',
-      type: 'POST',
-      success: (res) => {
-        // 如果是商机管理、大会员、超级订阅会员有筛选权限
-        let tempType = ''
-        if (res.data.vip > 0) {
-          tempType = '1'
-        }
-        if (res.data.member) {
-          if (tempType !== '') {
-            tempType += ','
-          }
-          tempType += '2'
-        }
-        if (res.data.entniche) {
-          if (tempType !== '') {
-            tempType += ','
-          }
-          tempType += '3'
-        }
-        if (tempType === '') {
-          tempType = '0'
-        }
-        setLogs({
-          platform: 'P',
-          userType: tempType
-        }).then(res => {
-          if (res.error_msg === '' && res.data) {
-            this.unitData = res.data
-          }
-        })
-      }
-    })
   },
   methods: {
-    // 获取免费用户是否体验过该采购单位
-    getIsTrail (data) {
-      console.log(data, 'dadadada')
-      this.freeTrial = data ? data : false
-    },
-    // 采购单位画像访问量查询
-    getBuyerUsage () {
-      const info = this.userInfo
-      const isNewVip = info.vipStatus > 0 && info.viper && info.power.indexOf(5) === -1
-      if (!isNewVip) return
-      getUsage({
-        buyer: decodeURIComponent(this.$route.params.entName),
-        p_type: '1'
-      }).then(res => {
-        if (res.error_code === 0 && res.data) {
-          if (res.data.usage > res.data.total) {
-            res.data.usage = res.data.total
-          }
-          res.data.surplus = res.data.total - res.data.usage
-          this.usageInfo = res.data
-        }
-      })
-    },
-    goExp () {
-      this.$refs.collectRef.noCallApiFn('buyer_portrait_exp_freeuser', true)
-    },
     // 采购单位-筛选项
     onLimitChange (data) {
       this.unitlistshow = true
@@ -453,38 +154,11 @@ export default {
     },
     async getSelect () {
       const params = { buyer: this.$route.params.entName }
-      const info = this.usageInfo
-      const isMember = info.memberStatus > 0 && info.power.indexOf(5) > -1
-      const res = isMember ? await getBuyerSelect(params) : await getVipBuyerSelect(params)
+      const res = await getBuyerSelect(params)
       if (res.error_code === 0) {
         this.canSelect = res.data
       }
     },
-    openCheckPop () {
-      this.openBigPage('', {
-        source: 'buyer_portrait_getNewMsg_freeuser',
-        button: this.shadeBottomBtnText
-      })
-    },
-    
-    openBigPage (k, item) {
-      try {
-        // eslint-disable-next-line no-undef
-        _hmt.push(['_trackEvent', '采购单位画像-pc', 'click', k + '-' + item.button])
-      } catch (e) {
-        console.log('未初始化百度统计')
-      }
-      if (item.button === '立即解锁') {
-        this.$refs.collectRef.noCallApiFn(item.source, true)
-      } else if (item.button === '去开通') {
-        this.$router.push('/free/svip/buy')
-      } else if (item.button === '前往升级') {
-        this.$router.push('/free/svip/buy?type=upgrade')
-      } else if (item.button === '联系客服') {
-        // this.isDialogShow = true
-        $('.help-slide-zx.open-customer').trigger('click')
-      }
-    },
     getList (data) {
       if (!data) {
         this.chartShowArr.push(false)
@@ -504,58 +178,22 @@ export default {
       this.info = data
       this.loading = false
     },
-    getFollowState () {
-      // 查询当前企业是否在 关注的客户 列表中
-      getStatusCustomer({ name: this.info.buyerName }).then(res => {
-        if (res && res.error_code === 0 && res.data) {
-          this.follow.followed = res.data
-        }
-      })
-    },
-    setFollow () {
-      if (this.follow.loading) return
-      const data = {
-        name: this.info.buyerName,
-        province: this.info.province,
-        city: this.info.city,
-        b: this.follow.followed
+    getEntStatus (status) {
+      if (status === '吊销') {
+        return 'tag-danger'
+      } else if (status === '注销') {
+        return 'tag-danger'
+      } else if (status === '撤销') {
+        return 'tag-disabled'
+      } else {
+        return ''
       }
-      this.follow.loading = true
-      // 潜在客户挖掘/我的客户-关注
-      setStatusCustomer(data).then(res => {
-        if (res && res.error_code === 0 && res.data) {
-          if (this.follow.followed) {
-            // 取消关注操作返回
-            this.$toast('取消关注成功')
-            this.follow.followed = false
-          } else {
-            // 关注操作返回
-            this.follow.followed = true
-            this.$toast(res.error_msg || '关注成功,可前往“我关注的客户”中查看')
-          }
-        } else {
-          this.$toast(res.error_msg)
-        }
-      }).finally(() => {
-        this.follow.loading = false
-      })
-    },
-    // 去解锁
-    goUnlock () {
-      this.$refs.collectRef.noCallApiFn('buyer_portrait_freeuser', true)
-    },
-    goEmitClick (data) {
-      this.$refs.collectRef.noCallApiFn(data, true)
     },
-    goUpdate () {
-      if (this.usageInfo.provin === -1) {
-        try {
-          $('.help-slide-zx.open-customer').unbind('click').trigger('click')
-        } catch (e) {
-          console.log(e)
-        }
+    calcListItemForCap (p) {
+      if (p) {
+        return p + '万元'
       } else {
-        this.$router.push('/free/svip/buy?type=upgrade')
+        return '-'
       }
     }
   }
@@ -677,9 +315,33 @@ export default {
   }
 
   .unit-type {
+    display: flex;
     padding: 32px 40px;
     background: #fff;
-
+    .bgc-default {
+      background-color: #2cb7ca;
+    }
+    .bgc-blue {
+      background-color: #f5af5c;
+    }
+    .bgc-orange {
+      background-color: #58a1e7;
+    }
+    .bgc-green {
+      background-color: #51cea2;
+    }
+    .unit-logo{
+      display: flex;
+      align-items: center;
+      width: 60px;
+      height: 60px;
+      padding: 8px 12px;
+      margin-right: 24px;
+      color: #fff;
+      border-radius: 4px;
+      font-size: 18px;
+      overflow: hidden;
+    }
     .u-top-container {
       display: flex;
       align-items: center;
@@ -687,10 +349,35 @@ export default {
     }
 
     .u-name {
-      flex: 1;
-      font-size: 24px;
-      line-height: 36px;
-      color: #171826;
+      display: flex;
+      align-items: center;
+      .u-name-h{
+        margin-right: 12px;
+        font-size: 18px;
+        line-height: 28px;
+        color: #1D1D1D;
+      }
+      .u-name-tag{
+        padding: 4px 8px;
+        color: #2cb7ca;
+        font-size: 12px;
+        text-align: center;
+        border: 1px solid #2cb7ca;
+        background-color: rgba(44, 183, 202, 0.08);
+        border-radius: 5px;
+      }
+    }
+
+    .u-d-info{
+      margin-top: 12px;
+      line-height: 22px;
+      span{
+        font-size: 14px;
+        color: #999;
+      }
+      span:not(:last-of-type) {
+        margin-right: 32px;
+      }
     }
 
     .u-follow {

+ 20 - 3
src/views/customer/EntSearch.vue → src/views/customer/Search.vue

@@ -4,7 +4,7 @@
       <div class="w1200">
         <div class="ent-header-title">专属私域企业数据</div>
         <div class="ent-header-input">
-          <EntInput placeholder="输入企业名称"></EntInput>
+          <EntInput @submit="getRecovery" ajaxType="entsearch" placeholder="输入企业名称"></EntInput>
         </div>
       </div>
     </div>
@@ -17,8 +17,9 @@
 </template>
 
 <script>
-import EntInput from '@/components/input/SearchInput.vue'
+import EntInput from './components/SearchInput.vue'
 import SearchList from './components/SearchList.vue'
+import { getBidAssociation} from '@/api/modules'
 import { mapState } from 'vuex'
 export default {
   name: 'ent-search',
@@ -47,7 +48,23 @@ export default {
   mounted () {},
   methods: {
     // 企业查询默认列表
-    getSearchList () {}
+    getSearchList () {},
+    getRecovery (data) {
+      console.log(data, 'x')
+      getBidAssociation({ name: data.text }).then(res => {
+        if (res && res.error_msg === '' && res.data) {
+          // 企业情报
+          if (data.events === 'select') {
+            // 联想跳转
+            console.log(data)
+            // this.$router.push(`/ent_portrait/${data.data.entId}`)
+          } else {
+            // this.$store.commit('forcast/setType', this.type)
+            // this.$store.commit('forcast/setEntFollowSearch', res.data)
+          }
+        }
+      })
+    }
   }
 }
 </script>

+ 732 - 0
src/views/customer/components/BidInfoActive.vue

@@ -0,0 +1,732 @@
+<template>
+  <div class="bidinfoactive">
+    <div class="pro_active_head">
+      <div class="pro_a_h_left">
+        <span>{{title}}</span>
+      </div>
+      <div class="pro_a_h_right" v-if="setBtnInt" @click="screenShow">
+        <span class="pro_screen">高级分析设置</span>
+        <img src="@/assets/images/jyxia.png" :class="proScreenShow?'rotateClass':''" class="pro_scr_img" />
+      </div>
+    </div>
+    <div class="pro_screen_list" v-show="proScreenShow">
+      <div class="search_key pro_r_list">
+        <span class="list_label">关键词:</span>
+        <div class="key_comp">
+          <el-input
+            class="keyinput"
+            size="small"
+            placeholder="请输入关键词,多个关键词用空格隔开"
+            maxlength= 50
+            show-word-limit
+            @input="getInput"
+            @focus="getFocus"
+            v-model="ScreenParams.match">
+            <i slot="suffix" v-if="cancelShow" @click="cancelClick('1')">
+              <img style="width:12px;height:12px;ling-height:32px;cursor: pointer;" src="@/assets/images/icon/cancel.png" class="inputcancel" />
+            </i>
+          </el-input>
+          <div class="key_radio" v-show="optionModel">
+            <el-radio v-model="ScreenParams.exactMatch" label="0">模糊(包含其中1个关键词即可)</el-radio>
+            <el-radio v-model="ScreenParams.exactMatch" label="1">精准(同时包含所有关键词)</el-radio>
+          </div>
+        </div>
+      </div>
+      <div class="search_rage pro_r_list">
+        <span class="list_label">搜索范围:</span>
+        <div class="search_checkbox">
+          <el-checkbox-group v-model="checkList" @change="checkChangeList">
+            <el-checkbox label="项目名称/标的物"></el-checkbox>
+            <el-checkbox v-if="whichPor==='entpor'" label="采购单位"></el-checkbox>
+            <el-checkbox v-if="whichPor==='unitpor'" label="中标企业"></el-checkbox>
+            <el-checkbox label="招标代理机构"></el-checkbox>
+          </el-checkbox-group>
+        </div>
+      </div>
+      <div class="release_area pro_r_list">
+        <AreaSelector
+          ref="areaSelector"
+          only-province
+          @onChange="saveAreaData"
+          comtype="portrait"
+          selectorType="line">
+          <div slot="header">项目地区:</div>
+        </AreaSelector>
+      </div>
+      <div class="release_infotype pro_r_list">
+        <IndustrySelector @onChange="changeIndustry" dataType="industryRage" ref="industrySel" selectorType="line">
+          <div slot="header">行业:</div>
+        </IndustrySelector>
+      </div>
+      <div class="release_time pro_r_list">
+        <span class="list_label">分析年份:</span>
+        <div class="release_container">
+          <el-popover
+            class="release_main"
+            popper-class="release_pover"
+            placement="bottom"
+            width="240"
+            trigger="click">
+            <template>
+              <ul class="yearul">
+                <li class="yearlist" @click="setAnalySisYear(item, 'start')" v-for="(item, index) in startYearRage" :key="index">{{item}}</li>
+              </ul>
+            </template>
+            <el-input size="small" style="cursor: pointer;" v-model="startModel" slot="reference" placeholder="请选择年份">
+            </el-input>
+            <img slot="reference" v-show="startYearShow" style="position:absolute;width:12px;height:12px;ling-height:32px;cursor: pointer;top:10px;right:10px;" src="@/assets/images/icon/cancel.png" @click="cancelClick('2')" class="inputcancel" />
+          </el-popover>
+          <div class="rowline"></div>
+          <el-popover
+            class="release_main"
+            popper-class="release_pover"
+            placement="bottom"
+            width="240"
+            @show="endInputClick"
+            trigger="click">
+            <template>
+              <ul class="yearul">
+                <li class="yearlist" @click="setAnalySisYear(item, 'end')" v-for="(item, index) in endYearRage" :key="index">{{item}}</li>
+              </ul>
+            </template>
+            <el-input size="small" style="cursor: pointer;" v-model="endModel" slot="reference" placeholder="请选择年份">
+            </el-input>
+            <img slot="reference" v-show="endYearShow" style="position:absolute;width:12px;height:12px;ling-height:32px;cursor: pointer;top:10px;right:10px;" src="@/assets/images/icon/cancel.png" @click="cancelClick('3')" class="inputcancel" />
+          </el-popover>
+        </div>
+      </div>
+      <div class="bidinfo_footer">
+        <button class="bid_reset bid_btn" @click="onReset">重置</button>
+        <button class="bid_confirm bid_btn" @click="onPageChange">开始分析</button>
+      </div>
+    </div>
+    <Empty v-if="isShow" tip="暂无数据"></Empty>
+  </div>
+</template>
+
+<script>
+import { Pagination, RadioGroup, Popover, Radio, Input, Checkbox, CheckboxGroup } from 'element-ui'
+import { mapState } from 'vuex'
+import { infoTypeListExp, provinceListMapExp } from '@/assets/js/selector.js'
+import Empty from '@/components/common/Empty'
+import IndustrySelector from '@/components/selector/IndustrySelector.vue'
+import AreaSelector from '@/components/selector/AreaSelector.vue'
+import { moneyUnit, dateFormatter } from '@/utils'
+export default {
+  props: [
+    'projectData',
+    'type',
+    'title',
+    'canselect',
+    'whichPor'
+  ],
+  name: 'entproactive',
+  components: {
+    [Pagination.name]: Pagination,
+    [Checkbox.name]: Checkbox,
+    [CheckboxGroup.name]: CheckboxGroup,
+    [Input.name]: Input,
+    [Radio.name]: Radio,
+    [RadioGroup.name]: RadioGroup,
+    [Popover.name]: Popover,
+    AreaSelector,
+    IndustrySelector,
+    Empty
+  },
+  data () {
+    return {
+      listState: {
+        loaded: true, // 是否已经搜索过
+        loading: false,
+        pageNum: 1, // 当前页
+        pageSize: 5, // 每页多少条数据
+        total: 0, // 一共多少条数据
+        list: [] // 查询请求返回的数据
+      },
+      isShow: false,
+      getTimeList: [],
+      checkList: ['项目名称/标的物'],
+      proScreenShow: false,
+      ScreenParams: {
+        entId: this.$route.params.eId || '',
+        buyer: this.$route.params.entName || '',
+        match: '', // 关键词
+        exactMatch: '0', // 模糊、精准搜索
+        matchRange: '', // 搜索范围
+        area: {}, // 地区
+        scopeClass: '', // 行业
+        timeRange: ''
+      },
+      startyear: '', // 开始年份
+      endyear: '', // 结束年份
+      cancelShow: false,
+      optionModel: false,
+      startYearRage: [],
+      endYearRage: [],
+      startYearShow: false,
+      endYearShow: false,
+      setBtnInt: true
+    }
+  },
+  created () {
+    this.initData(this.projectData)
+  },
+  mounted () {
+  },
+  computed: {
+    ...mapState({
+      info: state => state.user.info
+    }),
+    startModel () {
+      return this.startyear + (this.startyear ? '年' : '')
+    },
+    endModel () {
+      return this.endyear + (this.endyear ? '年' : '')
+    }
+  },
+  watch: {
+    whichPor: {
+      handler (newval) {
+        // if (newval === 'entpor') {
+        //   if (this.info.memberStatus > 0 && (this.info.power.indexOf(4) !== -1 || this.info.power.indexOf(13) !== -1)) {
+        //     this.setBtnInt = true
+        //   } else if (this.info.memberStatus < 0 && this.info.vipStatus > 0) {
+        //     this.setBtnInt = true
+        //   } else {
+        //     this.setBtnInt = false
+        //   }
+        // } else if (newval === 'unitpor') {
+        //   if (this.info.memberStatus > 0 && (this.info.power.indexOf(5) !== -1 || this.info.power.indexOf(13) !== -1)) {
+        //     this.setBtnInt = true
+        //   } else {
+        //     this.setBtnInt = false
+        //   }
+        // }
+      },
+      immediate: true
+    },
+    optionModel (newval) {
+      if (!newval) {
+        this.ScreenParams.exactMatch = '0'
+      }
+    },
+    projectData (newVal, oldVal) {
+      this.initData(newVal)
+    },
+    startyear: {
+      handler (newval) {
+        if (newval === '') {
+          this.startYearShow = false
+        } else {
+          this.startYearShow = true
+        }
+      }
+    },
+    endyear: {
+      handler (newval) {
+        if (newval === '') {
+          this.endYearShow = false
+        } else {
+          this.endYearShow = true
+        }
+      }
+    },
+    canselect (newval) {
+      if (newval) {
+        this.initScreenData(newval)
+      }
+    }
+  },
+  methods: {
+    moneyUnit,
+    dateFormatter,
+    initData (obj) {
+      // 处理可选年份
+      this.checkChangeList()
+      const nowYear = new Date().getFullYear()
+      this.startyear = nowYear - 2
+      this.endyear = nowYear
+      for (let i = nowYear - 4; i <= nowYear; i++) {
+        this.startYearRage.push(i)
+        if (this.startyear === '') {
+          this.endYearRage.push(i)
+        }
+      }
+    },
+    setAnalySisYear (data, rage) {
+      if (rage === 'start') {
+        this.startyear = data
+        this.endYearRage = this.startYearRage.slice(this.startYearRage.indexOf(data), this.startYearRage.length)
+        if (this.endyear !== '') {
+          if (data > this.endyear) {
+            this.startyear = this.endyear
+            this.endyear = data
+          }
+        }
+      } else if (rage === 'end') {
+        this.endyear = data
+      }
+    },
+    endInputClick () {
+      if (this.startyear !== '') {
+        this.endYearRage = this.startYearRage.slice(this.startYearRage.indexOf(this.startyear), this.startYearRage.length)
+      } else {
+        this.endYearRage = this.startYearRage
+      }
+    },
+    changeIndustry (item) {
+      const tempArr = []
+      Object.keys(item).forEach(v => {
+        const tempItem = item[v]
+        if (Array.isArray(tempItem)) {
+          tempItem.forEach(vv => {
+            tempArr.push(`${v}_${vv}`)
+          })
+        }
+      })
+      this.ScreenParams.scopeClass = tempArr.toString()
+    },
+    // 处理可筛选数据
+    initScreenData (data) {
+      if (!data) return
+      // 地区
+      if (!data.areaArr) {
+        data.areaArr = []
+      }
+      if (!data.scopeArr) {
+        data.scopeArr = []
+      }
+      const areaArr = this.getInitArea(data.areaArr)
+      this.$refs.areaSelector.initList(areaArr)
+      this.$refs.areaSelector.setCitySelected()
+      const industryObj = this.initIndustryData(data.scopeArr)
+      this.$refs.industrySel.changeInitData(industryObj)
+    },
+    getFocus () {
+      if (this.ScreenParams.match !== '') {
+        this.cancelShow = true
+      }
+    },
+    cancelClick (data) {
+      if (data === '1') {
+        this.ScreenParams.match = ''
+        this.cancelShow = false
+        this.optionModel = false
+      } else if (data === '2') {
+        this.startyear = ''
+      } else if (data === '3') {
+        this.endyear = ''
+      }
+    },
+    getInput () {
+      if (this.ScreenParams.match.indexOf(' ') !== -1) {
+        this.optionModel = true
+      } else {
+        this.optionModel = false
+      }
+      if (this.ScreenParams.match === '') {
+        this.cancelShow = false
+      } else {
+        this.cancelShow = true
+      }
+    },
+    getInitInfoType (list) {
+      const infoList = []
+      const infoTypeExp = JSON.parse(JSON.stringify(infoTypeListExp))
+      infoTypeExp.forEach(item => {
+        if (item.name === '全部') {
+          infoList.push(item)
+        } else {
+          const arr = []
+          item.children.forEach(t => {
+            if (list.indexOf(t.value) !== -1) {
+              arr.push(t)
+            }
+          })
+          item.children = arr
+          if (list.indexOf(item.value) !== -1 || arr.length) {
+            infoList.push(item)
+          }
+        }
+      })
+      return infoList
+    },
+    // 处理数据为行业选择页面所需格式
+    initIndustryData (data) {
+      var arr = []
+      var obj = {}
+      if (data) {
+        data.forEach(function (item) {
+          item = item.split('_')
+          // obj[item[0]] = item[1]
+          arr.push({
+            key: item[0],
+            val: item[1]
+          })
+        })
+        var tempArr = []
+        var newArr = []
+        for (var i = 0; i < arr.length; i++) {
+          if (tempArr.indexOf(arr[i].key) === -1) {
+            newArr.push({
+              key: arr[i].key,
+              child: [arr[i].val]
+            })
+            tempArr.push(arr[i].key)
+          } else {
+            for (var j = 0; j < newArr.length; j++) {
+              if (newArr[j].key === arr[i].key) {
+                newArr[j].child.push(arr[i].val)
+                break
+              }
+            }
+          }
+        }
+        for (var t = 0; t < newArr.length; t++) {
+          obj[newArr[t].key] = newArr[t].child
+        }
+        return obj
+      } else {
+        return '请选择行业'
+      }
+    },
+    getInitArea (areaArr) {
+      if (!Array.isArray(areaArr)) return
+      if (areaArr.indexOf('全国') === -1) {
+        areaArr.push('全国')
+      }
+      var areaMap = JSON.parse(JSON.stringify(provinceListMapExp))
+      var map = {}
+      for (var key in areaMap) {
+        var arr = []
+        areaMap[key].forEach(function (item) {
+          if (areaArr.indexOf(item) !== -1) {
+            arr.push(item)
+          }
+        })
+        if (arr.length) {
+          map[key] = arr
+        }
+      }
+      return map
+    },
+    resetListState () {
+      const rState = {
+        loaded: true,
+        loading: false,
+        pageNum: 1,
+        total: 0
+      }
+      Object.assign(this.listState, rState)
+    },
+    // 地区选择
+    saveAreaData (data) {
+      let dataArr = []
+      dataArr = Object.keys(data)
+      if (dataArr.length === 0) {
+        this.ScreenParams.area = ''
+      } else {
+        this.ScreenParams.area = dataArr.join(',')
+      }
+      this.resetListState()
+      this.$emit('onScreenChange', this.ScreenParams)
+    },
+    checkChangeList () {
+      const checkBoxArr = []
+      this.checkList.forEach((item) => {
+        if (item === '项目名称/标的物') {
+          checkBoxArr.push('purchasing')
+        }
+        if (item === '采购单位') {
+          checkBoxArr.push('buyer')
+        }
+        if (item === '中标企业') {
+          checkBoxArr.push('winner')
+        }
+        if (item === '招标代理机构') {
+          checkBoxArr.push('agency')
+        }
+      })
+      if (checkBoxArr.length > 0) {
+        this.ScreenParams.matchRange = checkBoxArr.join(',')
+      } else {
+        this.ScreenParams.matchRange = ''
+      }
+      this.resetListState()
+      this.$emit('onScreenChange', this.ScreenParams)
+    },
+    screenShow () {
+      this.proScreenShow = !this.proScreenShow
+    },
+    // 重置
+    onReset () {
+      const nowYear = new Date().getFullYear()
+      this.startyear = nowYear - 2
+      this.endyear = nowYear
+      const paramData = {
+        match: '', // 关键词
+        exactMatch: '0', // 模糊、精准搜索
+        matchRange: '', // 搜索范围
+        area: {}, // 地区
+        scopeClass: [], // 行业
+        timeRange: ''
+      }
+      this.checkList = ['项目名称/标的物']
+      this.$refs.areaSelector.setCitySelected()
+      this.$refs.industrySel.setIndustryState()
+      Object.assign(this.ScreenParams, paramData)
+    },
+    // 开始分析
+    onPageChange () {
+      if (this.startyear === '') {
+        this.startyear = new Date().getFullYear() - 4
+      }
+      if (this.endyear === '') {
+        this.endyear = new Date().getFullYear()
+      }
+      this.ScreenParams.timeRange = this.startyear + '_' + this.endyear
+      this.$emit('onPageChange', JSON.stringify(this.ScreenParams))
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.bidinfoactive {
+  .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner{
+    background-color:#2cb7ca;
+    border-color:#2cb7ca;
+  }
+  .el-checkbox__input.is-checked + .el-checkbox__label {
+    color: #2cb7ca;
+  }
+  .el-checkbox.is-bordered.is-checked{
+    border-color: #2cb7ca;
+  }
+  .el-checkbox__input.is-focus .el-checkbox__inner{
+    border-color:  #2cb7ca;
+  }
+  .release_main{
+    position:relative;
+    .el-input__inner{
+      background: #fff!important;
+      cursor: pointer!important;
+      color: #1D1D1D!important;
+      font-size: 14px!important;
+    }
+  }
+}
+</style>
+<style lang="scss" scoped>
+.release_pover{
+  .yearul{
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: flex-start;
+    .yearlist{
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 70px;
+      height: 46px;
+      cursor: pointer;
+      &:hover{
+        color: #2cb7ca;
+      }
+    }
+  }
+}
+.bidinfoactive{
+  width: 856px;
+  ::v-deep {
+    .s-line .select-group-container{
+      margin: 0;
+    }
+    .s-header>div{
+      text-align: right;
+    }
+  }
+  .el-pagination-container{
+    justify-content: center;
+    .el-pagination{
+      right: auto;
+    }
+  }
+  .pro_active_head{
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 16px;
+    height: 28px;
+    font-size: 18px;
+    font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+    font-weight: 400;
+    text-align: LEFT;
+    color: #1d1d1d;
+    line-height: 28px;
+  }
+  .pro_a_h_left{
+    position: relative;
+    display: flex;
+    align-items: center;
+    .search-input{
+      margin-left: 24px;
+      width: 240px;
+      height: 30px;
+    }
+    &::after{
+      content: '';
+      position: absolute;
+      left: -32px;
+      width: 3px;
+      height: 24px;
+      background: #2cb7ca;
+      border-radius: 0px 2px 2px 0px;
+    }
+  }
+  .pro_a_h_right{
+    cursor: pointer;
+    .pro_screen{
+      font-size: 14px;
+      font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+      font-weight: 400;
+      text-align: LEFT;
+      color: #686868;
+      &:hover{
+        color: #2cb7ca;
+      }
+    }
+    .pro_scr_img{
+      margin-left: 5px;
+      width: 12px;
+      // height: 12px;
+    }
+    .rotateClass{
+      transform: rotate(180deg);
+    }
+  }
+  .pro_screen_list{
+    margin-top: 16px;
+    width: 100%;
+    height: auto;
+    .pro_r_list{
+      // height: 34px;
+      padding: 16px 0;
+      display: flex;
+      align-items: flex-start;
+      border-bottom: 1px dashed #e0e0e0;
+      .release_container{
+        display: flex;
+        align-items: center;
+        padding: 6px;
+        background: #f5f6f7;
+        border-radius: 2px;
+        .rowline{
+          margin: 0 6px;
+          width: 14px;
+          height: 1px;
+          background: #e0e0e0;
+        }
+      }
+      .list_label{
+        margin-right: 16px;
+        width: 70px;
+        font-size: 14px;
+        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+        font-weight: 400;
+        color: #686868;
+        text-align: right;
+        line-height: 22px;
+      }
+      .key_comp{
+        display: flex;
+        flex-direction: column;
+        width: 100%;
+        flex: 1;
+        .key_radio{
+          margin-top: 16px;
+          ::v-deep {
+            .el-radio__input.is-checked .el-radio__inner {
+              border-color: #2cb7ca;
+              background-color: #2cb7ca;
+            }
+            .el-radio__input.is-checked .el-radio__inner::after{
+              width: 12px;
+              height: 12px;
+              background: url('~@/assets/images/icon-checked.png') no-repeat;
+              background-size: contain;
+            }
+            .el-radio__inner:hover {
+              border-color: #2cb7ca;
+            }
+            .el-radio.is-checked {
+              .el-radio__label{
+                color: #2cb7ca;
+              }
+            }
+          }
+        }
+      }
+      .el-checkbox{
+        margin-right: 16px;
+      }
+      ::v-deep {
+        .selector-card.s-line{
+          padding: 0;
+          .selector-card-header{
+            min-width: 70px;
+            font-size: 14px;
+            font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+            font-weight: 400;
+            color: #686868;
+            line-height: 22px;
+          }
+          .j-button-item.all {
+            font-weight: 400;
+          }
+          .j-button-item.all.active {
+            background: #2cb7ca;
+            color: #fff;
+          }
+        }
+      }
+    }
+    .search_key {
+      .list_label{
+        margin-top: 4px;
+      }
+    }
+    .bidinfo_footer{
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 100%;
+      height: 62px;
+      .bid_btn{
+        width: 116px;
+        height: 30px;
+        border: 1px solid #2cb7ca;
+        border-radius: 4px;
+        background: #fff;
+        font-size: 14px;
+        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+        font-weight: 400;
+        text-align: CENTER;
+        color: #2cb7ca;
+        line-height: 22px;
+      }
+      .bid_confirm{
+        margin-left: 40px;
+        background: #2cb7ca;
+        color: #ffffff;
+      }
+    }
+    .release_time {
+      align-items: center;
+    }
+  }
+  .el-pagination-container{
+    margin-right: 40px;
+  }
+}
+
+</style>

+ 1 - 1
src/views/customer/components/BuyerChart.vue

@@ -58,7 +58,7 @@
     <!-- 重点合作企业 -->
     <div v-if="client.data.length > 0">
       <div class="chart-title">重点合作企业</div>
-      <progress-chart type="unit"  :datas="client.data"></progress-chart>
+      <progress-chart :ishref="false" type="unit"  :datas="client.data"></progress-chart>
     </div>
   </div>
 </template>

+ 232 - 0
src/views/customer/components/SearchInput.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="search-input">
+    <el-input
+      :placeholder="placeholder"
+      prefix-icon="el-icon-jy-search"
+      v-model="input"
+      @focus="focus = true"
+      @blur="focus = false"
+      @input="changeInputValue"
+      @keyup.enter.native="submitSearch('onEnter')"
+      clearable>
+      <el-button @click="submitSearch('onSubmit')" slot="append">搜索</el-button>
+    </el-input>
+    <div class="association-input-group" v-show="getListShow"
+         @mouseout="hover = false" @mouseover="hover = true">
+      <div class="association-input-item ellipsis" v-for="(item, index) in getList" @click="selectItem(item)" :key="index">{{item.spareLabel}}</div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { Input, Button } from 'element-ui'
+import { getProjectList, getFollowAssociationList, getBidAssociation } from '@/api/modules/'
+
+export default {
+  name: 'Search-Input',
+  props: {
+    placeholder: String,
+    ajaxType: String,
+    onlySelect: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: {
+    [Input.name]: Input,
+    [Button.name]: Button
+  },
+  data () {
+    return {
+      tn: null,
+      hover: false,
+      focus: false,
+      input: '',
+      type: '全部',
+      tabs: [],
+      ajaxList: []
+    }
+  },
+  computed: {
+    getListShow () {
+      return this.input.trim().length > 2 && this.getList.length && (this.focus || this.hover)
+    },
+    getList () {
+      return this.ajaxList.slice(0, 10)
+    }
+  },
+  mounted () {
+    const qUrl = this.$route.query
+    qUrl && qUrl.type && (this.type = qUrl.type)
+    if (qUrl && qUrl.text) {
+      this.input = qUrl.text
+      this.$emit('recovery', {
+        type: this.type,
+        text: this.input.trim().replace(/\s+/g, ' ')
+      })
+    }
+  },
+  methods: {
+    selectItem (item) {
+      this.hover = false
+      this.input = item.spareLabel
+      this.ajaxList = []
+      this.submitSearch('select', item)
+    },
+    changeInputValue (value) {
+      if (value.trim().length > 2) {
+        clearTimeout(this.tn)
+        this.tn = setTimeout(() => {
+          console.log(value)
+          this.ajaxSearchInput(value)
+        }, 300)
+      }
+    },
+    ajaxSearchInput (value) {
+      this.ajaxList = []
+      switch (this.ajaxType) {
+        case 'follow': {
+          this.ajaxForFollow(value)
+          break
+        }
+        case 'entsearch': {
+          this.ajaxEntSearch(value)
+          break
+        }
+        default: {
+          this.ajaxForProject(value)
+        }
+      }
+    },
+    ajaxForFollow (value) {
+      getFollowAssociationList({ entName: value }).then(res => {
+        if (res && res.error_msg === '' && res.data) {
+          this.hover = true
+          this.ajaxList = []
+          this.ajaxList = res.data.map(v => {
+            return Object.assign({ spareLabel: v.entName }, v)
+          })
+        }
+      })
+    },
+    // 企业查询
+    ajaxEntSearch (value) {
+      getBidAssociation({ name: value }).then(res => {
+        if (res && res.error_msg === '' && res.data) {
+          this.hover = true
+          this.ajaxList = []
+          this.ajaxList = res.data.list.map(v => {
+            return Object.assign({ spareLabel: v.name }, v)
+          })
+        }
+      })
+    },
+    ajaxForProject (value) {
+      getProjectList({ pName: value }).then(res => {
+        if (res && res.error_msg === '' && res.data) {
+          this.hover = true
+          this.ajaxList = []
+          this.ajaxList = res.data.map(v => {
+            return Object.assign({ spareLabel: v.projectname }, v)
+          })
+        }
+      })
+    },
+    setSearchContent: function (v) {
+      this.input = v
+    },
+    submitSearch (e, data) {
+      const canSelect = this.onlySelect && e !== 'select'
+      if (canSelect) {
+        return
+      }
+      this.$emit('submit', {
+        type: this.type,
+        text: this.input.trim().replace(/\s+/g, ' '),
+        data: data,
+        events: e
+      })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .search-input {
+    position: relative;
+    width: 640px;
+    margin: 0 auto;
+    @include diy-icon('search-white', 24);
+    @include diy-icon('search', 20, 20);
+
+    .association-input- {
+      &group {
+        position: absolute;
+        overflow: hidden;
+        z-index: 6;
+        top: 52px;
+        width: 100%;
+        background: #FFFFFF;
+        box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
+        border-radius: 8px;
+      }
+      &item {
+        cursor: pointer;
+        padding: 12px 40px;
+        box-sizing: border-box;
+        width: 100%;
+        transition: all 0.3s;
+        font-size: 16px;
+        line-height: 24px;
+        color: #686868;
+        &:hover {
+          color: #1D1D1D;
+          background-color: #ECECEC;
+          padding: 12px 30px;
+        }
+      }
+    }
+    ::v-deep .el-input{
+      height: 42px;
+      border: 2px solid #2CB7CA;
+      border-radius: 8px;
+      box-sizing: border-box;
+      overflow: hidden;
+    }
+    ::v-deep .el-input__inner {
+      // border-radius: 22px 0 0 22px;
+      background: #FFFFFF;
+      border: 1px solid #E0E0E0;
+      padding-left: 43px;
+      color: #1D1D1D;
+      font-family: Microsoft YaHei;
+      font-size: 16px;
+      // line-height: 24px;
+      // height: 42px;
+      // border: 2px solid #2CB7CA;
+    }
+
+    ::v-deep .el-input-group__append {
+      // height: 42px;
+      box-sizing: border-box;
+      text-align: center;
+      border: none;
+      // border-radius: 0px 22px 22px 0px;
+      background: #2CB7CA;
+      // border: 2px solid #2CB7CA;
+      border-radius: 0;
+
+      .el-button {
+        display: block;
+        padding: 8px 19px;
+        color: #fff;
+        font-size: 18px;
+      }
+    }
+    ::v-deep{
+      .el-icon-jy-search{
+        margin: 10px;
+      }
+    }
+  }
+</style>

+ 4 - 6
src/views/customer/components/SearchList.vue

@@ -66,11 +66,7 @@
               </div>
             </div>
             <div class="_u4m8od8j3s"></div>
-            <!-- <no-data
-              style="display: none"
-              v-show="listState.list.length === 0 && listState.loaded"
-              tip-text="没有找到符合条件的企业"
-            ></no-data> -->
+            <Empty v-show="listState.list.length === 0 && listState.loaded" tip="没有找到符合条件的企业"></Empty>
           </div>
         </div>
         <div class="el-pagination-container">
@@ -92,6 +88,7 @@
 
 <script>
 import { Tabs, TabPane, Pagination } from 'element-ui'
+import Empty from '@/components/common/Empty'
 import { mapState } from 'vuex'
 import chinaMapJSON from '@/assets/js/china_area.js'
 export default {
@@ -107,7 +104,8 @@ export default {
   components: {
     [Tabs.name]: Tabs,
     [TabPane.name]: TabPane,
-    [Pagination.name]: Pagination
+    [Pagination.name]: Pagination,
+    Empty
   },
   data () {
     return {

+ 319 - 0
src/views/customer/components/UnitList.vue

@@ -0,0 +1,319 @@
+<template>
+  <div class="dynamic" v-show="domShow">
+    <div class="d-title">{{title}}</div>
+    <div class="d-content" v-if="showDt">
+      <div class="d-list" v-for="item in dt.list" :key="item.id" @click="goDetail(item.id)">
+        <div class="d-title">{{item.title}}</div>
+        <div class="d-info">
+          <p class="i-main">
+            <span v-if="item.area" class="i-area">{{item.area}}</span>
+            <span v-if="item.bidstatus" class="i-type">{{item.bidstatus}}</span>
+            <span v-if="item.bidamount" class="i-type">{{item.bidamount}}</span>
+          </p>
+          <p class="i-time">{{item.firsttime}}</p>
+        </div>
+      </div>
+      <div class="pages" :key="isUpdatePageNum">
+        <el-pagination
+          background
+          :page-size="5"
+          :current-page="dt.pageNum"
+          @current-change="handleCurrentChange"
+          layout="prev, pager, next"
+          :total="dt.total">
+        </el-pagination>
+      </div>
+    </div>
+    <Empty v-if="!showDt" tip="暂无数据"></Empty>
+  </div>
+</template>
+<script>
+import { getUnitDt } from '@/api/modules/'
+import { moneyUnit } from '@/utils/'
+import Empty from '@/components/common/Empty'
+import { Pagination, Dialog, Button } from 'element-ui'
+import { mapState } from 'vuex'
+export default {
+  name: 'dynamic',
+  components: {
+    [Pagination.name]: Pagination,
+    [Dialog.name]: Dialog,
+    [Button.name]: Button,
+    Empty
+  },
+  props: {
+    title: {
+      type: String,
+      default () {
+        return '招标动态'
+      }
+    },
+    bidparams: {
+      type: Object,
+      default () {
+        return {}
+      }
+    },
+    usage: {
+      type: Object,
+      default () {
+        return {}
+      }
+    },
+    noauth: {
+      type: Boolean
+    }
+  },
+  data () {
+    return {
+      isUpdatePageNum: -1,
+      isDialogShow: false,
+      showDt: false,
+      dt: {
+        total: 0,
+        pageCount: '',
+        pageNum: 1,
+        list: []
+      },
+      reqCount: 0,
+      bidataparams: {},
+      domShow: false,
+      tipDialog: false
+    }
+  },
+  watch: {
+    bidparams (newval) {
+      this.dt.pageNum = 1
+      this.bidataparams = newval
+      this.getUnitDtFn(newval)
+    }
+  },
+  computed: {
+    ...mapState({
+      info: state => state.user.info
+    })
+  },
+  created () {
+    this.getUnitDtFn(this.bidparams)
+  },
+  mounted () {},
+  methods: {
+    async getUnitDtFn (newval) {
+      this.reqCount++
+      const params = {
+        buyer: decodeURIComponent(this.$route.params.entName),
+        pageNum: this.dt.pageNum,
+        pageSize: 5,
+        pageCount: this.dt.pageCount
+      }
+      if (newval) {
+        Object.assign(params, newval)
+      }
+      const res = await getUnitDt(params)
+      if (res.error_code === 0) {
+        if (res.data.list && res.data.list.length && res.data.list.length > 0) {
+          res.data.list.forEach((v, i) => {
+            v.firsttime = new Date(Number(v.firsttime + '000')).pattern('yyyy/MM/dd')
+            v.bidamount = v.bidamount ? moneyUnit(v.bidamount) : ''
+          })
+          this.showDt = true
+          if (res.data.count >= 0) {
+            this.dt.total = res.data.count
+          }
+          this.dt.pageCount = res.data.count
+          this.dt.list = res.data.list
+          this.domShow = true
+        } else {
+          this.showDt = false
+          if (this.reqCount < 3) {
+            this.getUnitDtFn(newval)
+          }
+        }
+        this.$emit('list', res.data.list)
+      } else {
+        this.domShow = false
+        this.showDt = false
+      }
+    },
+    handleCurrentChange (currentPage) {
+      this.dt.pageNum = currentPage
+      this.getUnitDtFn(this.bidataparams)
+    },
+    goDetail (id) {
+      return window.open('/article/content/' + id + '.html')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.dynamic{
+  margin-top: 32px;
+  padding: 32px 40px 0;
+  background: #fff;
+  .empty-container.mtb60 {
+    margin: 0 auto;
+  }
+  .unit-dialog-group {
+    ::v-deep {
+      .el-dialog__header {
+        display: none;
+      }
+      .el-dialog {
+        width: 380px;
+        height: auto;
+        background: #ffffff;
+        border-radius: 8px;
+      }
+      .el-dialog__header {
+        text-align: center;
+        padding: 32px;
+        padding-bottom: 20px;
+      }
+      .el-dialog__body {
+        padding: 32px;
+        padding-top: 0;
+        font-size: 14px;
+        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+        font-weight: 400;
+        text-align: CENTER;
+        color: #686868;
+        line-height: 22px;
+      }
+      .el-dialog__title {
+        font-size: 18px;
+        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+        font-weight: 400;
+        color: #1d1d1d;
+        line-height: 28px;
+      }
+      .el-dialog__footer {
+        padding: 0;
+      }
+    }
+    .unit-dialog-footer {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      justify-content: space-between;
+      padding: 32px;
+      padding-top: 0;
+      ::v-deep {
+        .el-button--default {
+          border: 1px solid #e0e0e0;
+          color: #686868;
+          background: #fff;
+        }
+        .el-button {
+          width: 132px;
+          height: 36px;
+          display: flex;
+          flex-direction: column;
+          align-items: center;
+          justify-content: center;
+          font-size: 16px;
+          font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+          font-weight: 400;
+          text-align: CENTER;
+          border-radius: 6px;
+
+        }
+        .el-button--primary {
+          background: #2cb7ca;
+          color: #ffffff;
+          border-color: #2CB7CA;
+        }
+      }
+    }
+  }
+  .tip-dialog{
+    ::v-deep{
+      .el-button--primary,
+      .el-button--primary:hover,
+      .el-button--primary:focus{
+        width: 132px;
+        height: 36px;
+        margin-right: 52px;
+        text-align: center;
+        background: #2CB7CA;
+        border-radius: 6px;
+        font-style: 16px;
+        color: #fff;
+        border: 0;
+      }
+      .el-dialog__header{
+        padding: 0;
+      }
+      .el-dialog__body{
+        padding: 32px;
+        color: #686868;
+        font-size: 14px;
+        line-height: 22px;
+        text-align: justify;
+      }
+      .el-dialog__body i{
+        color: #2CB7CA;
+      }
+      .el-button--default,
+      .el-button--default:hover,
+      .el-button--default:focus{
+        width: 132px;
+        height: 36px;
+        text-align: center;
+        background: #fff;
+        border-radius: 6px;
+        font-style: 16px;
+        color: #686868;
+        border: 1px solid #DCDFE6;
+      }
+      .el-dialog__footer{
+        padding-bottom: 32px;
+      }
+    }
+  }
+  .d-title{
+    font-size: 18px;
+    color: #1d1d1d;
+    line-height: 28px;
+  }
+  .d-list{
+    padding: 18px 0;
+    border-bottom: 1px solid #ECECEC;
+    cursor: pointer;
+    .d-title{
+      font-size: 16px;
+      line-height: 24px;
+      color: #1D1D1D;
+    }
+    .d-info{
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+    }
+    .i-main{
+      display: flex;
+      align-items: center;
+      margin-top: 8px;
+    }
+    .i-area,.i-type{
+      display: inline-block;
+      padding: 0 8px;
+      margin-right: 8px;
+      color: #2CB7CA;
+      font-size: 12px;
+      line-height: 20px;
+      background: rgba(44,183,202,0.08);
+      border-radius: 4px;
+      box-shadow: 0px -1px 0px 0px rgba(0,0,0,0.05);
+    }
+    .i-time{
+      color: #999999;
+      font-size: 12px;
+      line-height: 20px;
+    }
+  }
+  .pages{
+    margin-top: 16px;
+    text-align: center;
+  }
+}
+</style>

+ 6 - 0
vue.config.js

@@ -70,6 +70,12 @@ module.exports = {
         target: 'http://127.0.0.1:8881',
         changeOrigin: true,
         logLevel: 'debug'
+      },
+      '^/privatedata': {
+        // target: 'https://web2-jytest.jydev.jianyu360.com',
+        target: 'http://192.168.20.173:814',
+        changeOrigin: true,
+        logLevel: 'debug'
       }
     }
   },