|
@@ -0,0 +1,357 @@
|
|
|
+<template>
|
|
|
+ <el-card class="potential-list-card">
|
|
|
+ <div class="header-box flex-r-c sb">
|
|
|
+ <span class="card-title">{{title}}</span>
|
|
|
+ <div class="flex-r-c center" v-show="!showEmpty">
|
|
|
+ <div class="link-text" @click="changeSort(0)" :class="{active: listState.sort === 0}">数量排序</div>
|
|
|
+ <div class="link-text" @click="changeSort(1)" :class="{active: listState.sort === 1}">金额排序</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="info-list" v-loading="listState.loading">
|
|
|
+ <div
|
|
|
+ class="card-list-item"
|
|
|
+ v-for="(item, index) in listState.list"
|
|
|
+ :key="index"
|
|
|
+ @onClick="toDetail(item)">
|
|
|
+ <div class="flex-r-c center sb">
|
|
|
+ <div class="flex-r-c center">
|
|
|
+ <i class="el-icon-jy-icon-company"></i>
|
|
|
+ <span class="text--title">{{item.Buyer}}</span>
|
|
|
+ </div>
|
|
|
+ <span class="text--sm-time">2019-09-30</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex-r-c card-bottom-info">
|
|
|
+ <span class="text--sm-name">项目数量:</span>
|
|
|
+ <span class="text--sm-value">{{ item.PNCount }}</span>
|
|
|
+ <span class="text--sm-name">项目总金额:</span>
|
|
|
+ <span class="text--sm-value">{{ item.Budget | formatMoney }}</span>
|
|
|
+ <span class="text--sm-name">所在地:</span>
|
|
|
+ <span class="text--sm-value">{{item.WProvince}} {{item.WCity}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <empty v-if="showEmpty">
|
|
|
+ <div v-if="isAllFirst">
|
|
|
+ <span>选择条件,立即挖掘</span>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <span>暂无匹配信息</span>
|
|
|
+ </div>
|
|
|
+ </empty>
|
|
|
+ </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-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { Pagination, Card, Button } from 'element-ui'
|
|
|
+import Empty from '@/components/common/Empty.vue'
|
|
|
+import { moneyUnit } from '@/utils/'
|
|
|
+import { getCorList } from '@/api/modules/'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'potential-list',
|
|
|
+ components: {
|
|
|
+ [Pagination.name]: Pagination,
|
|
|
+ [Card.name]: Card,
|
|
|
+ [Button.name]: Button,
|
|
|
+ Empty
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ formatMoney (value) {
|
|
|
+ return moneyUnit(value)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: '潜在客户'
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ type: Object,
|
|
|
+ default () {
|
|
|
+ return {
|
|
|
+ area: '',
|
|
|
+ time: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ showEmpty () {
|
|
|
+ return this.listState.list.length === 0 && this.listState.loaded
|
|
|
+ },
|
|
|
+ getFilters () {
|
|
|
+ return this.filters
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ isAllFirst: false,
|
|
|
+ listState: {
|
|
|
+ loaded: true, // 是否已经搜索过
|
|
|
+ loading: false,
|
|
|
+ pageNum: 1, // 当前页
|
|
|
+ pageSize: 10, // 每页多少条数据
|
|
|
+ total: 0, // 一共多少条数据
|
|
|
+ sort: 0,
|
|
|
+ list: [] // 查询请求返回的数据
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.doQuery()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goManage () {
|
|
|
+ alert('订阅管理')
|
|
|
+ // this.$router.push('')
|
|
|
+ },
|
|
|
+ changeSort (i) {
|
|
|
+ this.listState.sort = i
|
|
|
+ this.doQuery()
|
|
|
+ },
|
|
|
+ // 恢复数据至第一次请求的状态(页码等)
|
|
|
+ resetListState () {
|
|
|
+ const state = {
|
|
|
+ loaded: false,
|
|
|
+ loading: false,
|
|
|
+ pageNum: 1,
|
|
|
+ total: 0,
|
|
|
+ list: []
|
|
|
+ }
|
|
|
+ Object.assign(this.listState, state)
|
|
|
+ },
|
|
|
+ doQuery (filters) {
|
|
|
+ this.resetListState()
|
|
|
+ this.getList(filters)
|
|
|
+ },
|
|
|
+ async getList (filters) {
|
|
|
+ const query = {
|
|
|
+ pagenum: this.listState.pageNum,
|
|
|
+ pageSize: this.listState.pageSize,
|
|
|
+ sort_no: this.listState.sort,
|
|
|
+
|
|
|
+ buyerclass: this.getFilters.buyerclass,
|
|
|
+ industry: this.getFilters.industry,
|
|
|
+ business: this.getFilters.business,
|
|
|
+ pcor: this.getFilters.pcor,
|
|
|
+ searchbool: this.getFilters.searchbool
|
|
|
+ }
|
|
|
+
|
|
|
+ if (filters && Object.keys(filters).length > 0) {
|
|
|
+ Object.keys(filters).forEach(v => {
|
|
|
+ if (typeof filters[v] !== 'undefined') {
|
|
|
+ query[v] = filters[v]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.listState.loading = true
|
|
|
+ this.listState.loaded = false
|
|
|
+ // 判断是否无筛选条件
|
|
|
+ this.isAllFirst = false
|
|
|
+ if (query.pagenum === 1 && query.area === '' && query.time === '') {
|
|
|
+ this.isAllFirst = true
|
|
|
+ }
|
|
|
+ const res = await getCorList(query)
|
|
|
+ this.listState.loading = false
|
|
|
+ this.listState.loaded = true
|
|
|
+
|
|
|
+ if (res.error_code === 0) {
|
|
|
+ this.listState.total = res.data.total
|
|
|
+ this.listState.list = res.data.list || []
|
|
|
+ } else {
|
|
|
+ this.listState.total = 0
|
|
|
+ this.listState.list = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toDetail (item) {
|
|
|
+ const { _id } = item
|
|
|
+ window.open(`/article/content/${_id}.html`)
|
|
|
+ },
|
|
|
+ onPageChange (p) {
|
|
|
+ this.listState.pageNum = p
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getMore () {
|
|
|
+ this.$emit('getMore')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ @include diy-icon('edit', 20, 20);
|
|
|
+ @include diy-icon('icon-company', 24, 24);
|
|
|
+ ::v-deep .el-icon-jy-icon-company {
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+ // card样式重置
|
|
|
+ ::v-deep {
|
|
|
+ .el-card__header {
|
|
|
+ margin: 0 40px;
|
|
|
+ padding-left: 0;
|
|
|
+ padding-right: 0;
|
|
|
+ }
|
|
|
+ .el-card__body {
|
|
|
+ padding: 20px 0;
|
|
|
+ }
|
|
|
+ .empty-container {
|
|
|
+ margin-top: 60px;
|
|
|
+ }
|
|
|
+ .get-more {
|
|
|
+ display: flex;
|
|
|
+ .el-icon-arrow-right {
|
|
|
+ margin-left: 4px;
|
|
|
+ order: 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-manager {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 8px 16px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #1d1d1d;
|
|
|
+ border-color: #E0E0E0;
|
|
|
+ &.el-button:focus,
|
|
|
+ &.el-button:hover {
|
|
|
+ color: inherit;
|
|
|
+ background-color: inherit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .potential-list-card {
|
|
|
+ .header-box {
|
|
|
+ padding-left: 40px;
|
|
|
+ padding-right: 40px;
|
|
|
+ }
|
|
|
+ .card-title {
|
|
|
+ color: #1d1d1d;
|
|
|
+ line-height: 28px;
|
|
|
+ color: #1D1D1D;
|
|
|
+ }
|
|
|
+ .link-text {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 24px;
|
|
|
+ text-decoration-line: underline;
|
|
|
+ color: #1D1D1D;
|
|
|
+ cursor: pointer;
|
|
|
+ & + .link-text {
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ &:hover,&.active {
|
|
|
+ color: #2CB7CA;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .text--{
|
|
|
+ &sm-value {
|
|
|
+ color: #1D1D1D;
|
|
|
+ }
|
|
|
+ &title {
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #1D1D1D;
|
|
|
+ }
|
|
|
+ &sm-time {
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .card-list-item {
|
|
|
+ padding: 24px 0;
|
|
|
+ padding-left: 40px;
|
|
|
+ padding-right: 40px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ background: #F5F6F7;
|
|
|
+ .text--title,
|
|
|
+ .text--sm-value {
|
|
|
+ color: #2CB7CA;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .card-bottom-info {
|
|
|
+ margin-top: 12px;
|
|
|
+ justify-content: flex-start;
|
|
|
+ text-align: left;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 22px;
|
|
|
+ color: #999999;
|
|
|
+ .text--sm-value {
|
|
|
+ margin-right: 40px;
|
|
|
+ &:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .sub-manager {
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+ .info-list {
|
|
|
+ min-height: 545px;
|
|
|
+ border-top: 1px solid transparent;
|
|
|
+ }
|
|
|
+ .add-key-button {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 32px;
|
|
|
+ padding: 8px 16px;
|
|
|
+ color: #F7F9FA;
|
|
|
+ border-radius: 6px;
|
|
|
+ background-color: #2ABED1;
|
|
|
+ cursor: pointer;
|
|
|
+ .icon-chahao {
|
|
|
+ margin-right: 4px;
|
|
|
+ transform: rotate(-45deg);
|
|
|
+ }
|
|
|
+ .button-text {
|
|
|
+ margin-left: 4px;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .icon-chahao {
|
|
|
+ position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ &:before,
|
|
|
+ &:after {
|
|
|
+ position: absolute;
|
|
|
+ content: '';
|
|
|
+ background-color: #fff;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ width: 14px;
|
|
|
+ height: 2px;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ &:before {
|
|
|
+ transform: translate(-50%,-50%) rotate(45deg);
|
|
|
+ }
|
|
|
+ &:after {
|
|
|
+ transform: translate(-50%,-50%) rotate(-45deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-pagination-container {
|
|
|
+ margin-right: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|