Browse Source

feat:广东移动单位画像

yangfeng 3 years ago
parent
commit
f868c16dae

+ 73 - 0
src/api/modules/customer.js

@@ -0,0 +1,73 @@
+import request from '@/api'
+import qs from 'qs'
+
+// 广东移动单位画像-搜索
+export function getCustomQuery (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/enterpriseSearch/doQuery',
+    method: 'POST',
+    data: data
+  })
+}
+// 广东移动单位画像-详情
+export function getCustomBuyerData (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/portrait/buyer/getData',
+    method: 'POST',
+    data: data
+  })
+}
+// 广东移动单位画像-招标动态
+export function getBuyerNewMsg (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/portrait/buyer/getNewMsg',
+    method: 'POST',
+    data: data
+  })
+}
+// 广东移动单位画像-高级分析筛选条件
+export function getCustomBuyerSelect (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/portrait/buyer/selects',
+    method: 'POST',
+    data: data
+  })
+}
+// 广东移动单位画像-拟建项目
+export function getBuyerProposed (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/portrait/buyer/getProposed',
+    method: 'POST',
+    data: data
+  })
+}
+// 广东移动单位画像-预告项目
+export function getBuyerNotice (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/portrait/buyer/getNotice',
+    method: 'POST',
+    data: data
+  })
+}
+// 广东移动单位画像-即将到期项目
+export function getBuyerExpire (data) {
+  data = qs.stringify(data)
+  return request({
+    baseURL: '/privatedata',
+    url: '/portrait/buyer/getExpire',
+    method: 'POST',
+    data: data
+  })
+}

+ 1 - 0
src/api/modules/index.js

@@ -10,3 +10,4 @@ export * from './project'
 export * from './coupon'
 export * from './coupon'
 export * from './svip'
 export * from './svip'
 export * from './file'
 export * from './file'
+export * from './customer'

BIN
src/assets/images/custom-bg.png


+ 60 - 13
src/views/customer/Buyer.vue

@@ -3,13 +3,13 @@
     <div class="unit-portrayal-content" v-loading="loading" background="#fff">
     <div class="unit-portrayal-content" v-loading="loading" background="#fff">
       <div class="unit-type">
       <div class="unit-type">
         <div class="unit-logo" :class="entInfo.randomBgc">
         <div class="unit-logo" :class="entInfo.randomBgc">
-          {{ entInfo.company_shortname ? entInfo.company_shortname.slice(0,4) : entInfo.company_name.slice(0,4) }}
+          {{ entInfo.company_shortname }}
         </div>
         </div>
         <div>
         <div>
           <div class="u-top-container">
           <div class="u-top-container">
             <div class="u-name">
             <div class="u-name">
               <span class="u-name-h">{{ entInfo.company_name }}</span>
               <span class="u-name-h">{{ entInfo.company_name }}</span>
-              <span class="u-name-tag" :class="getEntStatus(entInfo.company_status)">{{entInfo.company_status}}</span>
+              <span v-if="entInfo.company_status" class="u-name-tag" :class="getEntStatus(entInfo.company_status)">{{entInfo.company_status}}</span>
             </div>
             </div>
           </div>
           </div>
           <div class="u-detail">
           <div class="u-detail">
@@ -54,12 +54,15 @@
         <div class="u-i-tip" v-if="baseShow">数据统计范围:{{ info.start }}-{{ info.end }}</div>
         <div class="u-i-tip" v-if="baseShow">数据统计范围:{{ info.start }}-{{ info.end }}</div>
       </div>
       </div>
       <unit-chart @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 title="预告项目" :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList"></unit-list>
       <!-- 即将到期项目 -->
       <!-- 即将到期项目 -->
       <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 :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList"></unit-list>
+      <unit-list title="招标动态" :bidparams="bidInfoParams" v-if="unitlistshow" @list="getList"></unit-list>
       <Empty v-show="emptyShow" :images="require('@/assets/images/empty/jy-chagrin.png')">
       <Empty v-show="emptyShow" :images="require('@/assets/images/empty/jy-chagrin.png')">
         <div slot="default" style="text-align:center">
         <div slot="default" style="text-align:center">
           <span>对不起,没有匹配到相关信息,</span><br/>
           <span>对不起,没有匹配到相关信息,</span><br/>
@@ -75,8 +78,9 @@ import UnitChart from './components/BuyerChart'
 import UnitList from './components/UnitList'
 import UnitList from './components/UnitList'
 import BidInfoActive from './components/BidInfoActive'
 import BidInfoActive from './components/BidInfoActive'
 import Empty from '@/components/common/Empty'
 import Empty from '@/components/common/Empty'
+import chinaMapJSON from '@/assets/js/china_area.js'
 import { Dialog } from 'element-ui'
 import { Dialog } from 'element-ui'
-import { getBuyerSelect } from '@/api/modules'
+import { getCustomBuyerSelect } from '@/api/modules'
 import { mapState } from 'vuex'
 import { mapState } from 'vuex'
 
 
 /* eslint-disable */
 /* eslint-disable */
@@ -124,18 +128,21 @@ export default {
       entInfo: {}
       entInfo: {}
     }
     }
   },
   },
-  watch: {},
+  watch: {
+    chartShowArr (newVal) {
+      if (newVal.indexOf(true) !== -1) {
+        this.emptyShow = false
+      } else {
+        this.emptyShow = true
+      }
+    }
+  },
   computed: {
   computed: {
     ...mapState({
     ...mapState({
       userInfo: state => state.user.info
       userInfo: state => state.user.info
     })
     })
   },
   },
-  created () {
-    console.log(JSON.parse(this.$route.query.info))
-    if (this.$route.query.info) {
-      this.entInfo = JSON.parse(this.$route.query.info)
-    }
-  },
+  created () {},
   mounted () {
   mounted () {
     this.getSelect()
     this.getSelect()
   },
   },
@@ -154,13 +161,13 @@ export default {
     },
     },
     async getSelect () {
     async getSelect () {
       const params = { buyer: this.$route.params.entName }
       const params = { buyer: this.$route.params.entName }
-      const res = await getBuyerSelect(params)
+      const res = await getCustomBuyerSelect(params)
       if (res.error_code === 0) {
       if (res.error_code === 0) {
         this.canSelect = res.data
         this.canSelect = res.data
       }
       }
     },
     },
     getList (data) {
     getList (data) {
-      if (!data) {
+      if (!data || (data && data.length == 0)) {
         this.chartShowArr.push(false)
         this.chartShowArr.push(false)
         if (this.emptyShow) {
         if (this.emptyShow) {
           this.unitlistshow = false
           this.unitlistshow = false
@@ -176,6 +183,9 @@ export default {
       // 子组件传来的值
       // 子组件传来的值
       if (!data) return
       if (!data) return
       this.info = data
       this.info = data
+      data.entdata.company_shortname = this.getShortName(data.entdata.company_name)
+      data.entdata.randomBgc = this.randomBgc()
+      this.entInfo = data.entdata
       this.loading = false
       this.loading = false
     },
     },
     getEntStatus (status) {
     getEntStatus (status) {
@@ -195,6 +205,43 @@ export default {
       } else {
       } else {
         return '-'
         return '-'
       }
       }
+    },
+    // 随机颜色
+    randomBgc () {
+      var arr = ['default', 'blue', 'orange', 'green']
+      var randomIndex = this.getRandomNumber(0, arr.length - 1)
+      return 'bgc-' + arr[randomIndex]
+    },
+    getRandomNumber (min, max) {
+      return Math.floor(Math.random() * (max - min + 1) + min)
+    },
+    getShortName (comName) {
+      var areaMap = chinaMapJSON || []
+      var shortname = comName
+      // 1. 循环省份城市进行替换
+      areaMap.forEach(function (item) {
+        var p = item.name.replace(/[省市]/, '')
+        if (shortname.indexOf(p) !== -1) {
+          shortname = shortname.replace(item.name, '').replace(p, '')
+        }
+        item.city.forEach(function (iitem) {
+          var c = iitem.name.replace(/[省市]/, '')
+          if (shortname.indexOf(c) !== -1) {
+            shortname = shortname.replace(iitem.name, '').replace(c, '')
+          }
+          iitem.area.forEach(function (iiitem) {
+            if (shortname.indexOf(iiitem) !== -1) {
+              shortname = shortname.replace(iiitem, '')
+            }
+          })
+        })
+      })
+      var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+      let shortName = matchRes ? matchRes[0] : shortname.slice(0, 4)
+      if (shortName.length < 4) {
+        shortName = shortName.slice(0, 4)
+      }
+      return shortName
     }
     }
   }
   }
 }
 }

+ 392 - 30
src/views/customer/Search.vue

@@ -2,68 +2,288 @@
   <div class="ent-search">
   <div class="ent-search">
     <div class="ent-header">
     <div class="ent-header">
       <div class="w1200">
       <div class="w1200">
-        <div class="ent-header-title">专属私域企业数据</div>
+        <div class="ent-header-logo">
+          <img :src="custom.imgUrl" alt="">
+        </div>
+        <div class="ent-header-title">{{ custom.name }}</div>
         <div class="ent-header-input">
         <div class="ent-header-input">
-          <EntInput @submit="getRecovery" ajaxType="entsearch" placeholder="输入企业名称"></EntInput>
+          <EntInput ref="inputRef" @submit="getRecovery" ajaxType="entsearch" placeholder="输入企业名称"></EntInput>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
     <div class="ent-main">
     <div class="ent-main">
       <div class="w1200">
       <div class="w1200">
-        <SearchList></SearchList>
+        <div class="ent-list">
+          <el-tabs v-model="activeName" @tab-click="handleClick">
+            <el-tab-pane label="采购单位" name="buyer">
+              <div class="search-result-container">
+                <div class="ent-info-list" v-loading="listState.loading">
+                  <div
+                    class="ent-info-item"
+                    :class="{ hover: !item.showMask }"
+                    v-for="item in listState.list"
+                    @click="toDetail(item)"
+                    :key="item.id"
+                  >
+                    <div class="ei-i-left">
+                      <div class="ei-i-l-container" :class="item.randomBgc">
+                        {{ item.company_shortname ? item.company_shortname.slice(0,4)
+                        : item.company_name.slice(0,4) }}
+                      </div>
+                    </div>
+                    <div class="ei-i-right">
+                      <div class="ei-r-title-container flex">
+                        <div class="ei-r-title">{{ item.company_name }}</div>
+                        <div
+                          class="ei-r-tag"
+                          :class="getEntStatus(item.company_status)"
+                          v-if="item.company_status"
+                        >
+                          {{ item.company_status }}
+                        </div>
+                      </div>
+                      <div class="ei-r-info-container">
+                        <div class="ei-r-info-item">
+                          <div class="i-label">法定代表人:</div>
+                          <div class="i-text">
+                            {{ item.legal_person ? item.legal_person : '-' }}
+                          </div>
+                        </div>
+                        <div class="ei-r-info-item">
+                          <div class="i-label">注册资本:</div>
+                          <div class="i-text">
+                            {{ calcListItemForCap(item.capital) }}
+                          </div>
+                        </div>
+                        <div class="ei-r-info-item">
+                          <div class="i-label">成立日期:</div>
+                          <div class="i-text">
+                            {{ item.establishStamp ? new Date(item.establishStamp *
+                            1000).pattern('yyyy-MM-dd') : '-' }}
+                          </div>
+                        </div>
+                        <div class="ei-r-info-item">
+                          <div class="i-label">联系方式:</div>
+                          <div class="i-text">
+                            {{ item.company_phone ? item.company_phone : '-' }}
+                          </div>
+                        </div>
+                      </div>
+                      <div class="ei-r-info-container">
+                        <div class="ei-r-info-item">
+                          <div class="i-label">地址:</div>
+                          <div class="i-text">
+                            {{ item.company_address ? item.company_address : '-' }}
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                  <Empty v-show="listState.list.length === 0 && listState.loaded" tip="没有找到符合条件的企业"></Empty>
+                </div>
+              </div>
+              <div class="el-pagination-container">
+                <el-pagination
+                  background
+                  layout="prev, pager, next, ->"
+                  :hide-on-single-page="true"
+                  :current-page="listState.pageNum"
+                  :page-size="listState.pageSize"
+                  :total="listState.total"
+                  @current-change="onPageChange"
+                ></el-pagination>
+              </div>
+            </el-tab-pane>
+            <el-tab-pane label="中标单位" name="winner" disabled></el-tab-pane>
+          </el-tabs>
+        </div>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import { Tabs, TabPane, Pagination } from 'element-ui'
+import Empty from '@/components/common/Empty'
 import EntInput from './components/SearchInput.vue'
 import EntInput from './components/SearchInput.vue'
-import SearchList from './components/SearchList.vue'
-import { getBidAssociation} from '@/api/modules'
+import { getCustomQuery } from '@/api/modules'
 import { mapState } from 'vuex'
 import { mapState } from 'vuex'
+import chinaMapJSON from '@/assets/js/china_area.js'
 export default {
 export default {
   name: 'ent-search',
   name: 'ent-search',
   components: {
   components: {
+    [Tabs.name]: Tabs,
+    [TabPane.name]: TabPane,
+    [Pagination.name]: Pagination,
     EntInput,
     EntInput,
-    SearchList
+    Empty
   },
   },
   data () {
   data () {
     return {
     return {
-      myDataObj: {
-        list: [],
-        total: 0
+      activeName: 'buyer',
+      listState: {
+        loaded: false, // 是否已经搜索过
+        loading: false,
+        pageNum: 1, // 当前页, 从0开始
+        pageSize: 10, // 每页多少条数据
+        total: 0, // 一共多少条数据
+        list: [] // 查询请求返回的数据
       },
       },
-      tiptext: ''
+      custom: {
+        name: '',
+        imgUrl: ''
+      }
     }
     }
   },
   },
   computed: {
   computed: {
-    ...mapState({
-      forcastSer: state => state.forcast.entSearchList,
-      type: state => state.forcast.type
-    })
+    ...mapState({})
   },
   },
   created () {
   created () {
-    this.getSearchList()
+    this.getList()
   },
   },
   mounted () {},
   mounted () {},
   methods: {
   methods: {
-    // 企业查询默认列表
-    getSearchList () {},
+    resetListState () {
+      const state = {
+        loaded: false,
+        loading: false,
+        pageNum: 1,
+        total: 0,
+        list: []
+      }
+      Object.assign(this.listState, state)
+    },
     getRecovery (data) {
     getRecovery (data) {
       console.log(data, 'x')
       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}`)
+      if (data.events === 'select') {
+        // 联想跳转
+        const s = JSON.stringify(data.data)
+        const routeUrl = this.$router.resolve({
+          path: `/free/custom_unit_portrayal/${s.name}`
+        })
+        return window.open(routeUrl.href, '_blank')
+      } else {
+        this.resetListState()
+        this.getList()
+      }
+    },
+    getEntStatus (status) {
+      if (status === '吊销') {
+        return 'tag-danger'
+      } else if (status === '注销') {
+        return 'tag-danger'
+      } else if (status === '撤销') {
+        return 'tag-disabled'
+      } else {
+        return ''
+      }
+    },
+    calcListItemForCap (p) {
+      if (p) {
+        return p + '万元'
+      } else {
+        return '-'
+      }
+    },
+    // 随机颜色
+    randomBgc () {
+      var arr = ['default', 'blue', 'orange', 'green']
+      var randomIndex = this.getRandomNumber(0, arr.length - 1)
+      return 'bgc-' + arr[randomIndex]
+    },
+    getRandomNumber (min, max) {
+      return Math.floor(Math.random() * (max - min + 1) + min)
+    },
+    getShortName (comName) {
+      var areaMap = chinaMapJSON || []
+      var shortname = comName
+      // 1. 循环省份城市进行替换
+      areaMap.forEach(function (item) {
+        var p = item.name.replace(/[省市]/, '')
+        if (shortname.indexOf(p) !== -1) {
+          shortname = shortname.replace(item.name, '').replace(p, '')
+        }
+        item.city.forEach(function (iitem) {
+          var c = iitem.name.replace(/[省市]/, '')
+          if (shortname.indexOf(c) !== -1) {
+            shortname = shortname.replace(iitem.name, '').replace(c, '')
+          }
+          iitem.area.forEach(function (iiitem) {
+            if (shortname.indexOf(iiitem) !== -1) {
+              shortname = shortname.replace(iiitem, '')
+            }
+          })
+        })
+      })
+      var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+      let shortName = matchRes ? matchRes[0] : shortname.slice(0, 4)
+      if (shortName.length < 4) {
+        shortName = shortName.slice(0, 4)
+      }
+      return shortName
+    },
+    // 企业查询默认列表
+    getList () {
+      const value = this.$refs.inputRef ? this.$refs.inputRef.input : ''
+      this.listState.loading = true
+      this.listState.loaded = false
+      getCustomQuery({
+        match: value,
+        pageSize: this.listState.pageSize,
+        pageNum: this.listState.pageNum - 1 // 当前页, 从0开始
+      }).then((res) => {
+        if (res.error_code === 0) {
+          this.listState.loading = false
+          this.listState.loaded = true
+          if (res.data) {
+            if (!this.custom.title) {
+              this.custom.name = res.data.title
+            }
+            if (!this.custom.imgUrl) {
+              this.custom.imgUrl = res.data.titleImg
+            }
+            this.setList(res)
           } else {
           } else {
-            // this.$store.commit('forcast/setType', this.type)
-            // this.$store.commit('forcast/setEntFollowSearch', res.data)
+            this.listState.loading = true
+            this.listState.loaded = false
           }
           }
+        } else {
+          console.log(res.error_msg)
+        }
+      })
+    },
+    setList (res) {
+      if (res.data) {
+        if (res.data.total) {
+          this.listState.total = res.data.total
+        }
+        if (res.data.list) {
+          res.data.list.forEach((d) => {
+            d.company_shortname = this.getShortName(d.company_name)
+            d.randomBgc = this.randomBgc()
+          })
+          this.listState.list = res.data.list || []
         }
         }
+      } else {
+        this.listState.total = 0
+        this.listState.list = []
+      }
+    },
+    toDetail (item) {
+      console.log(item)
+      const data = JSON.stringify(item)
+      const routeUrl = this.$router.resolve({
+        path: `/free/custom_unit_portrayal/${item.company_name}`
       })
       })
+      return window.open(routeUrl.href, '_blank')
+    },
+    handleClick (tab, event) {
+      console.log(tab, event)
+    },
+    onPageChange (p) {
+      this.listState.pageNum = p
+      console.log(this.listState.pageNum)
+      this.getList()
     }
     }
   }
   }
 }
 }
@@ -77,18 +297,30 @@ export default {
     margin: 0 auto;
     margin: 0 auto;
   }
   }
   .ent-header{
   .ent-header{
+    // overflow: hidden;
     width: 100%;
     width: 100%;
-    height: 186px;
+    height: 256px;
+    padding-top: 32px;
     background: url('~@/assets/images/custom-bg.png') no-repeat center center;
     background: url('~@/assets/images/custom-bg.png') no-repeat center center;
     background-size: cover;
     background-size: cover;
+    .ent-header-logo{
+      width: 231px;
+      height: 28px;
+      margin: 0 auto;
+      img{
+        width: 100%;
+        height: 100%;
+      }
+    }
     .ent-header-title{
     .ent-header-title{
       padding-top: 40px;
       padding-top: 40px;
       text-align: center;
       text-align: center;
-      font-size: 28px;
-      color: #1D1D1D;
+      font-size: 32px;
+      color: #fff;
+      line-height: 36px;
     }
     }
     .ent-header-input{
     .ent-header-input{
-      margin-top: 20px;
+      margin-top: 29px;
     }
     }
   }
   }
   .icon_ent{
   .icon_ent{
@@ -100,5 +332,135 @@ export default {
     background: url('~@/assets/images/icon/book.png') no-repeat;
     background: url('~@/assets/images/icon/book.png') no-repeat;
     background-size: contain;
     background-size: contain;
   }
   }
+  .ent-list {
+    padding: 40px 0 80px;
+    .ent-info-list {
+      min-height: 400px;
+      .flex{
+        display: flex;
+        align-items: center;
+      }
+      .ent-info-item {
+        position: relative;
+        padding: 18px 16px;
+        display: flex;
+        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
+        cursor: pointer;
+      }
+      .ent-info-item.hover:hover {
+        background-color: #f5f6f7;
+        box-shadow: inset 0 -1px 0 0 rgb(0, 0, 0, 0.05);
+      }
+      .ent-info-item{
+        .ei-i-l-container {
+          padding: 8px 12px;
+          height: 60px;
+          width: 60px;
+          color: #fff;
+          font-size: 18px;
+          line-height: 22px;
+          overflow: hidden;
+          border-radius: 5px;
+        }
+        .ei-i-l-container.bgc-default {
+          background-color: #2cb7ca;
+        }
+        .ei-i-l-container.bgc-blue {
+          background-color: #f5af5c;
+        }
+        .ei-i-l-container.bgc-orange {
+          background-color: #58a1e7;
+        }
+        .ei-i-l-container.bgc-green {
+          background-color: #51cea2;
+        }
+        .ei-i-l-container > img {
+          display: block;
+          width: 100%;
+          height: 100%;
+        }
+        .ei-i-right {
+          margin-left: 32px;
+        }
+        .ei-r-info-container {
+          margin-top: 12px;
+          display: flex;
+          align-items: center;
+          font-size: 14px;
+          line-height: 22px;
+        }
+        .ei-r-info-item {
+          display: flex;
+          .i-label {
+            color: #a0a0a0;
+          }
+          .i-text {
+            color: #7d7d7d;
+          }
+        }
+        .ei-r-info-item:not(:last-of-type) {
+          margin-right: 32px;
+        }
+        .ei-r-title {
+          margin-right: 12px;
+          color: #1d1d1d;
+          font-size: 18px;
+        }
+        .ei-r-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;
+        }
+        .ei-r-tag.tag-danger {
+          color: #ff3a20;
+          border: 1px solid #ff3a20;
+          background-color: rgba(255, 58, 32, 0.08);
+        }
+        .ei-r-tag.tag-warning {
+          color: #ff9f40;
+          border: 1px solid #ff9f40;
+          background: rgba(255, 159, 64, 0.08);
+          background-color: transparent;
+        }
+        .ei-r-tag.tag-disabled {
+          color: #aaa;
+          border: 1px solid #aaa;
+        }
+      }
+    }
+    ::v-deep {
+      .el-tabs__nav-wrap::after {
+        height: 0;
+      }
+      .el-tabs__nav-scroll {
+        border: 1px solid #ebebeb;
+      }
+      .el-tabs__item {
+        padding: 0 16px !important;
+      }
+      .el-tabs__item:hover {
+        color: #2cb7ca;
+      }
+      .el-tabs__item.is-active {
+        color: #2cb7ca;
+      }
+      .el-tabs__active-bar {
+        background-color: #2cb7ca;
+      }
+      .el-tabs__item.is-disabled {
+        color: #c0c4cc;
+        cursor: default;
+      }
+      .el-tabs__header {
+        margin: 0;
+      }
+      .el-tabs__content {
+      }
+    }
+  }
 }
 }
 </style>
 </style>

+ 13 - 8
src/views/customer/components/BidInfoActive.vue

@@ -109,7 +109,7 @@ import { Pagination, RadioGroup, Popover, Radio, Input, Checkbox, CheckboxGroup
 import { mapState } from 'vuex'
 import { mapState } from 'vuex'
 import { infoTypeListExp, provinceListMapExp } from '@/assets/js/selector.js'
 import { infoTypeListExp, provinceListMapExp } from '@/assets/js/selector.js'
 import Empty from '@/components/common/Empty'
 import Empty from '@/components/common/Empty'
-import IndustrySelector from '@/components/selector/IndustrySelector.vue'
+import IndustrySelector from './IndustrySelector.vue'
 import AreaSelector from '@/components/selector/AreaSelector.vue'
 import AreaSelector from '@/components/selector/AreaSelector.vue'
 import { moneyUnit, dateFormatter } from '@/utils'
 import { moneyUnit, dateFormatter } from '@/utils'
 export default {
 export default {
@@ -276,14 +276,19 @@ export default {
     },
     },
     changeIndustry (item) {
     changeIndustry (item) {
       const tempArr = []
       const tempArr = []
-      Object.keys(item).forEach(v => {
-        const tempItem = item[v]
-        if (Array.isArray(tempItem)) {
-          tempItem.forEach(vv => {
-            tempArr.push(`${v}_${vv}`)
-          })
-        }
+      Object.keys(item).forEach((key) => {
+        tempArr.push(key)
       })
       })
+      // const tempArr = []
+      // Object.keys(item).forEach(v => {
+      //   const tempItem = item[v]
+      //   if (Array.isArray(tempItem)) {
+      //     tempItem.forEach(vv => {
+      //       tempArr.push(`${v}_${vv}`)
+      //     })
+      //   }
+      // })
+      console.log(tempArr)
       this.ScreenParams.scopeClass = tempArr.toString()
       this.ScreenParams.scopeClass = tempArr.toString()
     },
     },
     // 处理可筛选数据
     // 处理可筛选数据

+ 7 - 9
src/views/customer/components/BuyerChart.vue

@@ -71,7 +71,7 @@ import PieChart from '@/components/chart/PieChart'
 import ProgressChart from '@/components/chart/ProgressChart'
 import ProgressChart from '@/components/chart/ProgressChart'
 import MapChart from '@/components/chart/MapChart'
 import MapChart from '@/components/chart/MapChart'
 import BlueProgressChart from '@/components/chart/BlueProgressChart'
 import BlueProgressChart from '@/components/chart/BlueProgressChart'
-import { getUnitChart, getVipUnitChart } from '@/api/modules/'
+import { getCustomBuyerData } from '@/api/modules/'
 import { bSort, moneyUnit } from '@/utils/'
 import { bSort, moneyUnit } from '@/utils/'
 export default {
 export default {
   name: 'unit-chart',
   name: 'unit-chart',
@@ -325,15 +325,10 @@ export default {
     // 画像数据
     // 画像数据
     async getChartData (newval) {
     async getChartData (newval) {
       this.allBool = []
       this.allBool = []
-      const info = this.$store.state.user.info
-      const isMember = info.memberStatus > 0 && info.power.indexOf(5) > -1
-      const res = isMember ? await getUnitChart(newval) : await getVipUnitChart(newval)
+      const res = await getCustomBuyerData(newval)
       if (res.error_code === 0) {
       if (res.error_code === 0) {
         if (res.data && Object.keys(res.data).length > 0) {
         if (res.data && Object.keys(res.data).length > 0) {
           this.showChart = true
           this.showChart = true
-          if (res.data.onTrial) {
-            this.$emit('isTrial', res.data.onTrial)
-          }
           this.initData('', res.data)
           this.initData('', res.data)
         } else {
         } else {
           this.getSectionChartData('a', newval)
           this.getSectionChartData('a', newval)
@@ -347,7 +342,7 @@ export default {
         buyer: decodeURIComponent(this.$route.params.entName)
         buyer: decodeURIComponent(this.$route.params.entName)
       }
       }
       Object.assign(flagAjaxParams, newval)
       Object.assign(flagAjaxParams, newval)
-      getUnitChart(flagAjaxParams).then((res) => {
+      getCustomBuyerData(flagAjaxParams).then((res) => {
         if (res.error_code === 0) {
         if (res.error_code === 0) {
           this.reqCount++
           this.reqCount++
           if (res.data && Object.keys(res.data).length > 0) {
           if (res.data && Object.keys(res.data).length > 0) {
@@ -631,6 +626,7 @@ export default {
         info.otherWinner = res.otherProvincesWinnerCount ? res.otherProvincesWinnerCount + '个' : '--'
         info.otherWinner = res.otherProvincesWinnerCount ? res.otherProvincesWinnerCount + '个' : '--'
         info.buyerScale = res.bidamount_count ? moneyUnit(res.bidamount_count) : '--'
         info.buyerScale = res.bidamount_count ? moneyUnit(res.bidamount_count) : '--'
         info.fail_count = res.fail_count ? res.fail_count + '条' : '--'
         info.fail_count = res.fail_count ? res.fail_count + '条' : '--'
+        info.entdata = res.entdata
         this.$emit('baseInfo', info)
         this.$emit('baseInfo', info)
         if (!res.project_count && !res.winner_count && !res.otherProvincesWinnerCount && !res.bidamount_count && !res.fail_count) {
         if (!res.project_count && !res.winner_count && !res.otherProvincesWinnerCount && !res.bidamount_count && !res.fail_count) {
           this.$emit('baseInfoBool', false)
           this.$emit('baseInfoBool', false)
@@ -1004,7 +1000,9 @@ export default {
         this.client.data = newData
         this.client.data = newData
         this.client.flag = true
         this.client.flag = true
         this.client.show = true
         this.client.show = true
-        this.allBool.push(true)
+        if (newData && newData.length > 0) {
+          this.allBool.push(true)
+        }
       } else {
       } else {
         this.allBool.push(false)
         this.allBool.push(false)
         this.client.data = []
         this.client.data = []

+ 77 - 0
src/views/customer/components/IndustrySelector.vue

@@ -0,0 +1,77 @@
+<template>
+  <selector-card
+    class="industry-selector"
+    :cardType="selectorType"
+    @onConfirm="onConfirm"
+    @onCancel="onCancel"
+  >
+    <div slot="header" :class="{ 's-header': selectorType === 'line' }">
+      <slot name="header">选择行业分类</slot>
+    </div>
+    <IndustrySelectorContent
+      ref="content"
+      @onChange="onChange"
+      :dataType="dataType"
+      :selectorType="selectorType"
+      :initIndustry="initIndustry"
+    />
+  </selector-card>
+</template>
+
+<script>
+import SelectorCard from '@/components/selector/SelectorCard.vue'
+import IndustrySelectorContent from './IndustrySelectorContent.vue'
+export default {
+  name: 'industry-selector',
+  components: {
+    SelectorCard,
+    IndustrySelectorContent
+  },
+  props: {
+    selectorType: {
+      type: String,
+      default: 'card'
+    },
+    dataType: {
+      type: String,
+      default: 'industry'
+    },
+    initIndustry: {
+      type: Object,
+      default () {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {}
+  },
+  created () {},
+  methods: {
+    // 修改原始数据
+    changeInitData (data) {
+      return this.$refs.content.changeInitData(data)
+    },
+    setIndustryState (data) {
+      return this.$refs.content.setIndustryState(data)
+    },
+    getSelected () {
+      return this.$refs.content.getSelected()
+    },
+    onCancel () {
+      this.$emit('onCancel')
+    },
+    onConfirm () {
+      const selected = this.getSelected()
+      this.$emit('onConfirm', selected)
+    },
+    onChange (selected) {
+      this.$emit('onChange', selected)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 450 - 0
src/views/customer/components/IndustrySelectorContent.vue

@@ -0,0 +1,450 @@
+<template>
+  <div class="selector-content" v-if="selectorType === 'card'" key="selector-content">
+    <div class="search-container">
+      <el-input v-model.trim="searchContent" placeholder="搜索" prefix-icon="el-icon-search"></el-input>
+    </div>
+    <div class="select-list scrollbar" ref="selectList">
+      <div
+        v-for="(item, index) in industryListMap"
+        :key="index"
+        class="select-group-container"
+      >
+        <div class="select-group-header">
+          <button
+            class="j-button-item button-level-1"
+            :class="{
+              active: item.selected,
+              [item.id]: true
+            }"
+            @click="changeIndustryState(item)"
+          >{{ item.name }}</button>
+        </div>
+        <div class="select-group-main">
+          <button
+            v-for="(iitem, iindex) in item.children" :key="999-iindex"
+            class="j-button-item button-level-2"
+            :class="{
+              active: iitem.selected,
+              [iitem.id]: true
+            }"
+            @click="changeIndustryState(iitem)"
+            >{{ iitem.name }}</button>
+        </div>
+      </div>
+    </div>
+  </div>
+  <div class="selector-content" :class="{ 'no-more': !showMore }" key="selector-content" v-else-if="selectorType === 'line'">
+    <!-- <span class="action-button show-more" v-if="showmoreBtn" @click="showMore = !showMore">
+      <span class="action-text">{{ showMore ? '收起' : '更多' }}</span>
+      <span class="el-icon-arrow-down" :class="showMore ? 'rotate180' : ''"></span>
+    </span> -->
+    <div class="select-group-container" >
+      <div class="select-group-header"
+        v-show="!showMore"
+          v-for="(item, index) in industryListMap"
+          :key="index+'A'"
+          :class="{
+            'right-line': showMore
+          }">
+        <button
+          class="j-button-item"
+          :class="{
+            active: item.selected,
+            [item.id]: true,
+            'button-level-0': item.level === 0,
+            'button-level-1': item.level === 1,
+            'all': item.level === 0,
+            'bgc': item.level === 1
+          }"
+          @click="changeIndustryState(item)"
+        >{{ item.name }}</button>
+      </div>
+      <!-- <div class="select-group-header"
+        v-show="showMore"
+          v-for="(item, index) in getIndustryListMap"
+          :key="index+'B'"
+          :class="{
+            'right-line': showMore
+          }">
+        <button
+          class="j-button-item"
+          :class="{
+            active: item.selected,
+            [item.id]: true,
+            'button-level-0': item.level === 0,
+            'button-level-1': item.level === 1,
+            'all': item.level === 0,
+            'bgc': item.level === 1
+          }"
+          @click="changeIndustryState(item)"
+        >{{ item.name }}</button>
+      </div> -->
+    </div>
+  </div>
+</template>
+
+<script>
+import { Input, Icon } from 'element-ui'
+// import { industryListMapExp, buyerclassListMapExp } from '@/assets/js/selector.js'
+import { debounce, getRandomString } from '@/utils/'
+export default {
+  name: 'industry-selector-content',
+  components: {
+    [Input.name]: Input,
+    [Icon.name]: Icon
+  },
+  props: {
+    selectorType: {
+      type: String,
+      default: 'card'
+    },
+    dataType: {
+      type: String,
+      default: 'industry'
+    },
+    initIndustry: {
+      type: Object,
+      default () {
+        return {
+          // '建筑工程': [
+          //     '勘察设计',
+          //     '工程施工',
+          //     '监理咨询',
+          //     '材料设备',
+          // ],
+          // '水利水电': [
+          //     '水利工程',
+          //     '发电工程',
+          //     '航运工程',
+          //     '其他工程',
+          // ]
+        }
+      }
+    }
+  },
+  data () {
+    return {
+      searchContent: '',
+      // 原始数据
+      industryListMapExp: {},
+      // 页面中循环的数据
+      industryListMap: [],
+      industryExp: {
+        name: this.dataType === 'industry' ? '全部行业' : '全部',
+        selected: false,
+        level: 0,
+        children: [],
+        id: ''
+      },
+      showMore: false,
+      showmoreBtn: true
+    }
+  },
+  watch: {
+    initIndustry (newVal, oldVal) {
+      this.setIndustryState(newVal)
+    },
+    searchContent: debounce(function (newVal, oldVal) {
+      const search = newVal
+      const id = this.getIndexWithString(search)
+      if (id) {
+        this.$nextTick(() => {
+          const wrapper = document.querySelector('.industry-selector.s-card')
+          this.$refs.selectList.scrollTop = wrapper.querySelector(`.${id}`).offsetTop
+        })
+      }
+    }, 300)
+  },
+  computed: {
+    getIndustryListMap () {
+      const tempArr = []
+      this.industryListMap.forEach(v => {
+        const tempNode = v
+        tempNode.zindex = 1
+        tempArr.push(tempNode)
+        // eslint-disable-next-line no-unused-expressions
+        tempNode?.children.forEach(s => {
+          const tempS = s
+          tempS.zindex = 2
+          tempArr.push(tempS)
+        })
+      })
+      return tempArr
+    }
+  },
+  mounted () {
+    this.initIndustryMap()
+    this.setIndustryState(this.initIndustry)
+  },
+  methods: {
+    // 整理数据列表
+    initIndustryMap () {
+      const industryListMap = []
+
+      // 全部
+      const all = JSON.parse(JSON.stringify(this.industryExp))
+      all.selected = true
+      all.id = `lv0-${getRandomString(8).toLowerCase()}`
+      industryListMap.push(all)
+      for (const key in this.industryListMapExp) {
+        const level1 = JSON.parse(JSON.stringify(this.industryExp))
+        level1.name = key
+        level1.level = 1
+        level1.id = `lv1-${getRandomString(8).toLowerCase()}`
+
+        const level2Arr = []
+        this.industryListMapExp[key].forEach(item => {
+          const level2 = JSON.parse(JSON.stringify(this.industryExp))
+          level2.name = item
+          level2.level = 2
+          level2.id = `lv2-${getRandomString(8).toLowerCase()}`
+          level2Arr.push(level2)
+        })
+
+        level1.children = level2Arr
+        industryListMap.push(level1)
+      }
+
+      this.industryListMap = industryListMap
+    },
+    // 更改原始数据
+    changeInitData (data) {
+      if (typeof data !== 'object') return
+      if (this.dataType === 'industryRage') {
+        if (JSON.stringify(data) === '{}') {
+          this.showmoreBtn = false
+        }
+        this.industryListMapExp = data
+        this.initIndustryMap()
+      }
+    },
+    // 按钮点击事件
+    changeIndustryState (item) {
+      // 循环所有数据,判断并改变状态
+      switch (item.level) {
+        case 0: {
+          this.setIndustryState()
+          break
+        }
+        case 1: {
+          item.selected = !item.selected
+
+          this.industryListMap[0].selected = false
+          // 二级子按钮状态跟随一级按钮
+          item.children.forEach(level2 => {
+            level2.selected = item.selected
+          })
+          break
+        }
+        case 2: {
+          item.selected = !item.selected
+
+          // 找到当前点击的父级元素
+          this.industryListMap.forEach(level1 => {
+            const selectedStateArr = []
+            if (item.level !== 0) {
+              level1.children.forEach(level2 => {
+                selectedStateArr.push(level2.selected)
+              })
+              if (selectedStateArr.indexOf(false) === -1) {
+                level1.selected = true
+              } else {
+                level1.selected = false
+              }
+            }
+          })
+
+          this.industryListMap[0].selected = false
+          break
+        }
+        default: {
+          console.log('未知level')
+        }
+      }
+
+      if (item.level !== 0) {
+        const allSelected = this.checkAllSelectedState()
+        if (allSelected.allSelected || allSelected.allNotSelected) {
+          this.setIndustryState()
+        }
+      }
+
+      if (this.selectorType === 'line') {
+        this.onChange()
+      }
+    },
+    // 检查是否全部选中了/全部不选中
+    checkAllSelectedState () {
+      // 一级标签选中状态(如果一级标签全部被选中,则说明,全部按钮被选中)
+      const level1StateArr = []
+      // 所有标签选中状态
+      const allSelectedArr = []
+
+      this.industryListMap.forEach(level1 => {
+        if (level1.level !== 0) {
+          level1StateArr.push(level1.selected)
+          allSelectedArr.push(level1.selected)
+          level1.children.forEach(level2 => {
+            allSelectedArr.push(level2.selected)
+          })
+        }
+      })
+
+      return {
+        // 找不到false,就说明全部被选中
+        allSelected: level1StateArr.indexOf(false) === -1,
+        // 找不到true,就说明没有一个被选中
+        allNotSelected: allSelectedArr.indexOf(true) === -1
+      }
+    },
+    /**
+     * 初始化页面选中状态
+     * @param { Array | undefined } data 要恢复的数据
+     */
+    setIndustryState (data) {
+      if (Array.isArray(data)) {
+        return this.setBuyerclassState(data)
+      }
+      // 设置全部按钮
+      if (!data || Object.keys(data).length === 0) {
+        // 其他全部设置不选中,全部按钮设置选中
+        this.industryListMap.forEach(item => {
+          item.selected = false
+          item.children.forEach(iitem => {
+            iitem.selected = false
+          })
+        })
+
+        this.industryListMap[0].selected = true
+      } else {
+        this.setIndustryState()
+        this.industryListMap[0].selected = false
+
+        this.industryListMap.forEach(item => {
+          if (data[item.name]) {
+            // 如果恢复数组长度等于页面二级标签长度,则一级标签点亮
+            if (data[item.name].length === item.children.length) {
+              item.selected = true
+            }
+            item.children.forEach(function (iitem) {
+              if (data[item.name].indexOf(iitem.name) !== -1) {
+                iitem.selected = true
+              }
+            })
+          }
+        })
+      }
+    },
+    setBuyerclassState (data) {
+      this.getIndustryListMap.forEach(item => {
+        if (data.includes(item.name)) {
+          this.changeIndustryState(item)
+        }
+      })
+    },
+    // 获取选中的数据
+    getSelected () {
+      const map = {}
+
+      this.industryListMap.forEach(item => {
+        const mapArr = []
+
+        if (item.level !== 0) {
+          item.children.forEach(iitem => {
+            if (iitem.selected) {
+              mapArr.push(iitem.name)
+            }
+          })
+        }
+
+        if (mapArr.length !== 0) {
+          map[item.name] = mapArr
+        }
+      })
+
+      return map
+    },
+    // 搜索找到其level1级id
+    getIndexWithString (s = '') {
+      if (!s) return
+      let giveId = ''
+      this.industryListMap.find(level1 => {
+        if (level1.name.includes(s)) {
+          giveId = level1.id
+          return level1.id
+        } else {
+          return level1.children.find(level2 => {
+            if (level2.name.includes(s)) {
+              giveId = level1.id
+              return level2
+            }
+          })
+        }
+      })
+      return giveId
+    },
+    onChange () {
+      const selected = this.getSelected()
+      this.$emit('onChange', selected)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .s-card {
+    .button-level-1 {
+      color: inherit;
+      font-weight: bold;
+    }
+    .button-level-2 {
+      margin: 5px;
+    }
+    .select-group-container {
+      padding: 6px 20px;
+      &:not(:last-of-type) {
+        border-bottom: 1px solid rgba(0,0,0,.05);
+      }
+      .select-group-main {
+        display: flex;
+        flex-wrap: wrap;
+      }
+    }
+  }
+
+  .s-line {
+    .button-level-1 {
+      color: $color-text--highlight;
+    }
+    .selector-content {
+      display: flex;
+      flex-wrap: wrap;
+      padding-right: 45px;
+      &.no-more {
+        flex: 1;
+        height: 38px;
+        overflow: hidden;
+      }
+    }
+    .select-group-container {
+      position: relative;
+      display: flex;
+      flex-wrap: wrap;
+      &.right-line::after {
+        content: '';
+        position: absolute;
+        right: -1px;
+        top: 50%;
+        width: 1px;
+        height: 16px;
+        background-color: #E3E4E6;
+        margin-top: -8px;
+        // transform: translate(0, -50%);
+      }
+      .select-group-main {
+        display: flex;
+        flex-wrap: wrap;
+      }
+    }
+  }
+</style>

+ 8 - 14
src/views/customer/components/SearchInput.vue

@@ -20,7 +20,7 @@
 
 
 <script>
 <script>
 import { Input, Button } from 'element-ui'
 import { Input, Button } from 'element-ui'
-import { getProjectList, getFollowAssociationList, getBidAssociation } from '@/api/modules/'
+import { getProjectList, getFollowAssociationList, getCustomQuery } from '@/api/modules/'
 
 
 export default {
 export default {
   name: 'Search-Input',
   name: 'Search-Input',
@@ -111,13 +111,14 @@ export default {
     },
     },
     // 企业查询
     // 企业查询
     ajaxEntSearch (value) {
     ajaxEntSearch (value) {
-      getBidAssociation({ name: value }).then(res => {
-        if (res && res.error_msg === '' && res.data) {
+      getCustomQuery({ match: value }).then(res => {
+        if (res && res.error_msg === '' && res.data && res.data.list) {
           this.hover = true
           this.hover = true
           this.ajaxList = []
           this.ajaxList = []
           this.ajaxList = res.data.list.map(v => {
           this.ajaxList = res.data.list.map(v => {
-            return Object.assign({ spareLabel: v.name }, v)
+            return Object.assign({ spareLabel: v.company_name }, v)
           })
           })
+          console.log(this.ajaxList, 'sss')
         }
         }
       })
       })
     },
     },
@@ -187,33 +188,26 @@ export default {
       }
       }
     }
     }
     ::v-deep .el-input{
     ::v-deep .el-input{
-      height: 42px;
-      border: 2px solid #2CB7CA;
+      // height: 42px;
       border-radius: 8px;
       border-radius: 8px;
       box-sizing: border-box;
       box-sizing: border-box;
       overflow: hidden;
       overflow: hidden;
     }
     }
     ::v-deep .el-input__inner {
     ::v-deep .el-input__inner {
-      // border-radius: 22px 0 0 22px;
+      height: 42px;
       background: #FFFFFF;
       background: #FFFFFF;
       border: 1px solid #E0E0E0;
       border: 1px solid #E0E0E0;
       padding-left: 43px;
       padding-left: 43px;
       color: #1D1D1D;
       color: #1D1D1D;
       font-family: Microsoft YaHei;
       font-family: Microsoft YaHei;
       font-size: 16px;
       font-size: 16px;
-      // line-height: 24px;
-      // height: 42px;
-      // border: 2px solid #2CB7CA;
     }
     }
 
 
     ::v-deep .el-input-group__append {
     ::v-deep .el-input-group__append {
-      // height: 42px;
       box-sizing: border-box;
       box-sizing: border-box;
       text-align: center;
       text-align: center;
       border: none;
       border: none;
-      // border-radius: 0px 22px 22px 0px;
       background: #2CB7CA;
       background: #2CB7CA;
-      // border: 2px solid #2CB7CA;
       border-radius: 0;
       border-radius: 0;
 
 
       .el-button {
       .el-button {
@@ -225,7 +219,7 @@ export default {
     }
     }
     ::v-deep{
     ::v-deep{
       .el-icon-jy-search{
       .el-icon-jy-search{
-        margin: 10px;
+        margin: 11px 10px;
       }
       }
     }
     }
   }
   }

+ 0 - 472
src/views/customer/components/SearchList.vue

@@ -1,472 +0,0 @@
-<template>
-  <div class="ent-list">
-    <el-tabs v-model="activeName" @tab-click="handleClick">
-      <el-tab-pane label="采购单位" name="first">
-        <div class="search-result-container">
-          <div class="ent-info-list" v-loading="listState.loading">
-            <div
-              class="ent-info-item"
-              :class="{ hover: !item.showMask }"
-              v-for="item in listState.list"
-              @click="toDetail(item)"
-              :key="item.id"
-            >
-              <div class="ei-i-left">
-                <div class="ei-i-l-container" :class="item.randomBgc">
-                  {{ item.company_shortname ? item.company_shortname.slice(0,4)
-                  : item.company_name.slice(0,4) }}
-                </div>
-              </div>
-              <div class="ei-i-right">
-                <div class="ei-r-title-container flex">
-                  <div class="ei-r-title">{{ item.company_name }}</div>
-                  <div
-                    class="ei-r-tag"
-                    :class="getEntStatus(item.company_status)"
-                    v-if="item.company_status"
-                  >
-                    {{ item.company_status }}
-                  </div>
-                </div>
-                <div class="ei-r-info-container">
-                  <div class="ei-r-info-item">
-                    <div class="i-label">法定代表人:</div>
-                    <div class="i-text">
-                      {{ item.legal_person ? item.legal_person : '-' }}
-                    </div>
-                  </div>
-                  <div class="ei-r-info-item">
-                    <div class="i-label">注册资本:</div>
-                    <div class="i-text">
-                      {{ calcListItemForCap(item.capital) }}
-                    </div>
-                  </div>
-                  <div class="ei-r-info-item">
-                    <div class="i-label">成立日期:</div>
-                    <div class="i-text">
-                      {{ item.establishStamp ? new Date(item.establishStamp *
-                      1000).pattern('yyyy-MM-dd') : '-' }}
-                    </div>
-                  </div>
-                  <div class="ei-r-info-item">
-                    <div class="i-label">联系方式:</div>
-                    <div class="i-text">
-                      {{ item.company_phone ? item.company_phone : '-' }}
-                    </div>
-                  </div>
-                </div>
-                <div class="ei-r-info-container">
-                  <div class="ei-r-info-item">
-                    <div class="i-label">地址:</div>
-                    <div class="i-text">
-                      {{ item.company_address ? item.company_address : '-' }}
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div>
-            <div class="_u4m8od8j3s"></div>
-            <Empty v-show="listState.list.length === 0 && listState.loaded" tip="没有找到符合条件的企业"></Empty>
-          </div>
-        </div>
-        <div class="el-pagination-container">
-          <el-pagination
-            background
-            layout="prev, pager, next, ->"
-            :hide-on-single-page="true"
-            :current-page="listState.pageNum"
-            :page-size="listState.pageSize"
-            :total="listState.total"
-            @current-change="onPageChange"
-          ></el-pagination>
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="中标单位" name="second" disabled></el-tab-pane>
-    </el-tabs>
-  </div>
-</template>
-
-<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 {
-  name: 'ent-list',
-  props: {
-    list: {
-      type: Object,
-      default () {
-        return {}
-      }
-    }
-  },
-  components: {
-    [Tabs.name]: Tabs,
-    [TabPane.name]: TabPane,
-    [Pagination.name]: Pagination,
-    Empty
-  },
-  data () {
-    return {
-      activeName: 'first',
-      listState: {
-        loaded: false, // 是否已经搜索过
-        loading: false,
-        pageNum: 1, // 当前页, 从0开始
-        pageSize: 5, // 每页多少条数据
-        total: 0, // 一共多少条数据
-        list: [] // 查询请求返回的数据
-      }
-    }
-  },
-  computed: {
-    ...mapState({})
-  },
-  created () {
-    this.getList()
-  },
-  mounted () {},
-  methods: {
-    getEntStatus (status) {
-      if (status === '吊销') {
-        return 'tag-danger'
-      } else if (status === '注销') {
-        return 'tag-danger'
-      } else if (status === '撤销') {
-        return 'tag-disabled'
-      } else {
-        return ''
-      }
-    },
-    calcListItemForCap (p) {
-      if (p) {
-        return p + '万元'
-      } else {
-        return '-'
-      }
-    },
-    // 随机颜色
-    randomBgc () {
-      var arr = ['default', 'blue', 'orange', 'green']
-      var randomIndex = this.getRandomNumber(0, arr.length - 1)
-      return 'bgc-' + arr[randomIndex]
-    },
-    getRandomNumber (min, max) {
-      return Math.floor(Math.random() * (max - min + 1) + min)
-    },
-    getShortName (comName) {
-      var areaMap = chinaMapJSON || []
-      var shortname = comName
-      // 1. 循环省份城市进行替换
-      areaMap.forEach(function (item) {
-        var p = item.name.replace(/[省市]/, '')
-        if (shortname.indexOf(p) !== -1) {
-          shortname = shortname.replace(item.name, '').replace(p, '')
-        }
-        item.city.forEach(function (iitem) {
-          var c = iitem.name.replace(/[省市]/, '')
-          if (shortname.indexOf(c) !== -1) {
-            shortname = shortname.replace(iitem.name, '').replace(c, '')
-          }
-          iitem.area.forEach(function (iiitem) {
-            if (shortname.indexOf(iiitem) !== -1) {
-              shortname = shortname.replace(iiitem, '')
-            }
-          })
-        })
-      })
-      var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
-      let shortName = matchRes ? matchRes[0] : shortname.slice(0, 4)
-      if (shortName.length < 4) {
-        shortName = shortName.slice(0, 4)
-      }
-      return shortName
-    },
-    getList () {
-      // this.listState.loading = true
-      // this.listState.loaded = false
-      const res = {
-        data: {
-          total: 2,
-          list: [
-            /* eslint-disable */
-            {
-              "capital": 19399093,
-              "company_address": "郑州市陇海中路106号",
-              "company_name": "中国铁路郑州局集团有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 830102400,
-              "id": "ABCZnZaYikvNDY4EmRmcFwJJTACDjF3XFJ0KAUjKjogd3xndS8oNwkjJGBxXnEkDlxTDHQ%3D",
-              "legal_person": "孙景"
-            },
-            {
-              "capital": 878300,
-              "company_address": "郑州航空港区护航路16号兴港大厦",
-              "company_name": "郑州航空港区国有资产经营管理有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1368374400,
-              "id": "ABCY1xGYDIOOyw7Amd1c2JbDzIvCSFjdmNlPB4gNj0eZFZwYls4NAkrIndhXnAhOFxTDPI%3D",
-              "legal_person": "许永喜"
-            },
-            {
-              "capital": 620809.56,
-              "company_address": "河南省郑州市二七区建设东路50号",
-              "company_name": "郑州大学第一附属医院",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1585497600,
-              "id": "ABCY3FCYi4%2FLyk4EnN5c18sPiQZDSRjYWh%2BKSgsPyFFaGdnXCw%2BICgoMWMBVnEmDlxTDJQ%3D",
-              "legal_person": "刘章锁"
-            },
-            {
-              "capital": 600000,
-              "company_address": "郑州市中牟县商都大街399号",
-              "company_name": "郑州牟中发展投资有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1274803200,
-              "id": "ABCdGZJczIFKD8vRHRoZ1wwMyc4IDR0V0FgK1gvKC4gcFVzdTAxND8vJ3dhBX8vDlxTDQ8%3D",
-              "legal_person": "张伍发"
-            },
-            {
-              "capital": 377926,
-              "company_address": "郑州航空港区护航路16号兴港大厦",
-              "company_name": "郑州航空港区航程置业有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1323964800,
-              "id": "ABCYHYAfT1YUT07NGd6ZHIoPicCASFmdnRyKCgZIyEgY3lwYiQxND80MndXQnAhOFxTDUA%3D",
-              "legal_person": "许永喜"
-            },
-            {
-              "capital": 310000,
-              "company_address": "郑州市郑东新区龙子湖智慧岛尚贤街6号",
-              "company_name": "郑州一建集团有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1088524800,
-              "id": "ABCdAEBYTIFMyg4I395ZE8%2FJScCDSJmYXdlKD8nKj0wXlVkdSsqNBkaMWZhWnAsDlxTC%2BY%3D",
-              "legal_person": "段利民"
-            },
-            {
-              "capital": 266632.1,
-              "company_address": "河南省郑州市高新技术产业开发区科学大道136号",
-              "company_name": "郑州轻工业大学",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1596988800,
-              "id": "ABCdEdCYjxYLD84JHt4Z1wnJDNfSCNjV1J%2BKS8wODoeY35nZSMlIBkVIHRHRnIbDlxTDQg%3D",
-              "legal_person": "黄荣杰"
-            },
-            {
-              "capital": 193000,
-              "company_address": "郑州市郑东新区平安大道189号正商环湖国际17层",
-              "company_name": "郑州市建设投资集团有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1301414400,
-              "id": "ABCYAEBZCkvND0vAn94ZwcjIyRfDRZgYWdhKDgjKC4nZFRnTzw4NwI0MWNHQnAyKFxTC38%3D",
-              "legal_person": "秦广远"
-            },
-            {
-              "capital": 173247.137,
-              "company_address": "郑州市经济技术开发区第九大街167号",
-              "company_name": "郑州煤矿机械集团股份有限公司",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1036512000,
-              "id": "ABCYAFaYj0eID87Antxc1w4PjNfCjF0XFJ%2BPC8nID0eUXlkciMtNwI3J3RXAXFeHlxTDK4%3D",
-              "legal_person": "焦承尧"
-            },
-            {
-              "capital": 138325,
-              "company_address": "河南省郑州市郑东新区鹏程大道56号",
-              "company_name": "郑州铁路职业技术学院",
-              "company_shortname": "",
-              "company_status": "存续",
-              "establishStamp": 1519833600,
-              "id": "ABCYFxoYjIFAjYvNHxlcE8gMycoDRZmYVViKB4zKC8ecFFzciMtNDg4MHQBBXAbHlxTC8U%3D",
-              "legal_person": "马玉霞"
-            }
-            /* eslint-enable */
-          ]
-        }
-      }
-      this.setList(res)
-      // this.listState.loading = false
-      // this.listState.loaded = true
-    },
-    setList (res) {
-      if (res.data) {
-        if (res.data.total) {
-          this.listState.total = res.data.total
-        }
-        if (res.data.list) {
-          res.data.list.forEach((d) => {
-            d.company_shortname = this.getShortName(d.company_name)
-            d.randomBgc = this.randomBgc()
-          })
-          this.listState.list = res.data.list || []
-        }
-      } else {
-        this.listState.total = 0
-        this.listState.list = []
-      }
-    },
-    toDetail (item) {
-      console.log(item)
-      const data = JSON.stringify(item)
-      const routeUrl = this.$router.resolve({
-        path: `/free/custom_unit_portrayal/${item.company_name}`,
-        query: {
-          info: data
-        }
-      })
-      return window.open(routeUrl.href, '_blank')
-    },
-    handleClick (tab, event) {
-      console.log(tab, event)
-    },
-    onPageChange (p) {
-      this.listState.pageNum = p
-      this.getList()
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.ent-list {
-  padding: 40px 0 80px;
-  .ent-info-list {
-    min-height: 400px;
-    .flex{
-      display: flex;
-      align-items: center;
-    }
-    .ent-info-item {
-      position: relative;
-      padding: 18px 16px;
-      display: flex;
-      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
-      cursor: pointer;
-    }
-    .ent-info-item.hover:hover {
-      background-color: #f5f6f7;
-      box-shadow: inset 0 -1px 0 0 rgb(0, 0, 0, 0.05);
-    }
-    .ent-info-item{
-      .ei-i-l-container {
-        padding: 8px 12px;
-        height: 60px;
-        width: 60px;
-        color: #fff;
-        font-size: 18px;
-        line-height: 22px;
-        overflow: hidden;
-        border-radius: 5px;
-      }
-      .ei-i-l-container.bgc-default {
-        background-color: #2cb7ca;
-      }
-      .ei-i-l-container.bgc-blue {
-        background-color: #f5af5c;
-      }
-      .ei-i-l-container.bgc-orange {
-        background-color: #58a1e7;
-      }
-      .ei-i-l-container.bgc-green {
-        background-color: #51cea2;
-      }
-      .ei-i-l-container > img {
-        display: block;
-        width: 100%;
-        height: 100%;
-      }
-      .ei-i-right {
-        margin-left: 32px;
-      }
-      .ei-r-info-container {
-        margin-top: 12px;
-        display: flex;
-        align-items: center;
-        font-size: 14px;
-        line-height: 22px;
-      }
-      .ei-r-info-item {
-        display: flex;
-        .i-label {
-          color: #a0a0a0;
-        }
-        .i-text {
-          color: #7d7d7d;
-        }
-      }
-      .ei-r-info-item:not(:last-of-type) {
-        margin-right: 32px;
-      }
-      .ei-r-title {
-        margin-right: 12px;
-        color: #1d1d1d;
-        font-size: 18px;
-      }
-      .ei-r-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;
-      }
-      .ei-r-tag.tag-danger {
-        color: #ff3a20;
-        border: 1px solid #ff3a20;
-        background-color: rgba(255, 58, 32, 0.08);
-      }
-      .ei-r-tag.tag-warning {
-        color: #ff9f40;
-        border: 1px solid #ff9f40;
-        background: rgba(255, 159, 64, 0.08);
-        background-color: transparent;
-      }
-      .ei-r-tag.tag-disabled {
-        color: #aaa;
-        border: 1px solid #aaa;
-      }
-    }
-  }
-  ::v-deep {
-    .el-tabs__nav-wrap::after {
-      height: 0;
-    }
-    .el-tabs__nav-scroll {
-      border: 1px solid #ebebeb;
-    }
-    .el-tabs__item {
-      padding: 0 16px !important;
-    }
-    .el-tabs__item:hover {
-      color: #2cb7ca;
-    }
-    .el-tabs__item.is-active {
-      color: #2cb7ca;
-    }
-    .el-tabs__active-bar {
-      background-color: #2cb7ca;
-    }
-    .el-tabs__item.is-disabled {
-      color: #c0c4cc;
-      cursor: default;
-    }
-    .el-tabs__header {
-      margin: 0;
-    }
-    .el-tabs__content {
-    }
-  }
-}
-</style>

+ 20 - 5
src/views/customer/components/UnitList.vue

@@ -28,7 +28,7 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { getUnitDt } from '@/api/modules/'
+import { getBuyerNewMsg, getBuyerProposed, getBuyerNotice, getBuyerExpire } from '@/api/modules/'
 import { moneyUnit } from '@/utils/'
 import { moneyUnit } from '@/utils/'
 import Empty from '@/components/common/Empty'
 import Empty from '@/components/common/Empty'
 import { Pagination, Dialog, Button } from 'element-ui'
 import { Pagination, Dialog, Button } from 'element-ui'
@@ -109,7 +109,22 @@ export default {
       if (newval) {
       if (newval) {
         Object.assign(params, newval)
         Object.assign(params, newval)
       }
       }
-      const res = await getUnitDt(params)
+      let res = null
+      switch (this.title) {
+        case '拟建项目':
+          res = await getBuyerProposed(params)
+          break
+        case '预告项目':
+          res = await getBuyerNotice(params)
+          break
+        case '即将到期项目':
+          res = await getBuyerExpire(params)
+          break
+        case '招标动态':
+          res = await getBuyerNewMsg(params)
+          break
+      }
+      // const res = await getBuyerNewMsg(params)
       if (res.error_code === 0) {
       if (res.error_code === 0) {
         if (res.data.list && res.data.list.length && res.data.list.length > 0) {
         if (res.data.list && res.data.list.length && res.data.list.length > 0) {
           res.data.list.forEach((v, i) => {
           res.data.list.forEach((v, i) => {
@@ -125,9 +140,9 @@ export default {
           this.domShow = true
           this.domShow = true
         } else {
         } else {
           this.showDt = false
           this.showDt = false
-          if (this.reqCount < 3) {
-            this.getUnitDtFn(newval)
-          }
+          // if (this.reqCount < 3) {
+          //   this.getUnitDtFn(newval)
+          // }
         }
         }
         this.$emit('list', res.data.list)
         this.$emit('list', res.data.list)
       } else {
       } else {

+ 1 - 1
vue.config.js

@@ -73,7 +73,7 @@ module.exports = {
       },
       },
       '^/privatedata': {
       '^/privatedata': {
         // target: 'https://web2-jytest.jydev.jianyu360.com',
         // target: 'https://web2-jytest.jydev.jianyu360.com',
-        target: 'http://192.168.20.173:814',
+        target: 'http://192.168.20.173:816',
         changeOrigin: true,
         changeOrigin: true,
         logLevel: 'debug'
         logLevel: 'debug'
       }
       }