| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528 |
- <template>
- <div class="apply-info">
- <div class="apply-info-title">
- <p>最新求购信息</p>
- <span>海量求购,一网打尽</span>
- <div>
- <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" placeholder="型号/品牌" />
- <span @click="searchList">查询</span>
- </div>
- </div>
- <div class="apply-info-list">
- <p class="list-title">
- <span class="list-title-item">买家/发布时间
- <!--<a href="javascript:void(0)" @click="sortListByParam('releaseDate')">
- <i class=" fa fa-long-arrow-up" :class="{active: sorting.releaseDate == 'ASC'}"></i>
- <i class=" fa fa-long-arrow-down" :class="{active: sorting.releaseDate == 'DESC'}"></i>
- </a>-->
- </span>
- <span class="list-title-item">产品信息</span>
- <span class="list-title-item">已报价
- <!--<a href="javascript:void(0)" @click="sortListByParam('offerAmount')">
- <i class=" fa fa-long-arrow-up" :class="{active: sorting.offerAmount == 'ASC'}"></i>
- <i class=" fa fa-long-arrow-down" :class="{active: sorting.offerAmount == 'DESC'}"></i>
- </a>-->
- </span>
- <span class="list-title-item">截止时间
- <!--<a href="javascript:void(0)" @click="sortListByParam('deadline')">
- <i class=" fa fa-long-arrow-up" :class="{active: sorting.deadline == 'ASC'}"></i>
- <i class=" fa fa-long-arrow-down" :class="{active: sorting.deadline == 'DESC'}"></i>
- </a>-->
- </span>
- </p>
- <ul v-if="purchaseManList.content && purchaseManList.content.length">
- <li v-for="(purchaseMan, index) in purchaseManList.content" :class="{'active': purchaseMan.active}">
- <div class="il-item il-left">
- <div class="item" v-if="purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName" :title="user.logged ? purchaseMan.inquiry.enterprise.enName : null">{{[purchaseMan.inquiry.enterprise.enName, user] | enterpriseFilter}}</div>
- <div class="item" v-else :title="user.logged ? purchaseMan.userName : null">{{[purchaseMan.userName, user] | userNameFilter}}</div>
- <div>{{purchaseMan.date| date}}</div>
- </div>
- <div class="il-item il-center">
- <div class="il-box-large il-box">
- <div :title="purchaseMan.prodTitle" class="fl item"><span>类目:</span><div class="content">{{purchaseMan.prodTitle || '-'}}</div></div>
- <div :title="purchaseMan.cmpCode" class="fl item"><span>型号:</span><div class="content">{{purchaseMan.cmpCode || '-'}}</div></div>
- <div :title="purchaseMan.inbrand" class="fl item bottom"><span>品牌:</span><div class="content">{{purchaseMan.inbrand || '-'}}</div></div>
- <div :title="purchaseMan.spec" class="fl item bottom"><span>规格:</span><div class="content">{{purchaseMan.spec || '-'}}</div></div>
- </div>
- <div class="il-box-small il-box">
- <div :title="purchaseMan.encapsulation" class="item"><span>封装:</span>{{purchaseMan.encapsulation || '-'}}</div>
- <div :title="purchaseMan.needquantity" class="item"><span>采购数量:</span>{{purchaseMan.needquantity || '-'}}</div>
- <div :title="purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'" class="item"><span>单价预算:</span>{{purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'}}</div>
- </div>
- </div>
- <div class="il-item number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span> 条</div>
- <div class="il-item il-right">
- <div class="date-content">
- <div v-if="purchaseMan.remainingTime > 0">
- <span>剩余 </span>
- <span v-if="getDay(purchaseMan.remainingTime) > 0" v-text="getDay(purchaseMan.remainingTime)"></span>
- <i v-if="getDay(purchaseMan.remainingTime) > 0"> 天 </i>
- <span v-if="getDay(purchaseMan.remainingTime) <= 0" v-text="getHours(purchaseMan.remainingTime)"></span>
- <i v-if="getDay(purchaseMan.remainingTime) <= 0" > 小时</i>
- </div>
- <span v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0">已截止</span>
- </div>
- <div class="btn-content">
- <!--<a @click="setLinkBoxIndex(index)">联系买家</a>-->
- <!--判断该求购是自己的-->
- <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt=""></div>
- <div v-else>
- <a title="该求购已截止" v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0" style="background: #cccbcb;" @click="sayPriceStop">我要报价</a>
- <a title="此为贵公司的求购" v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU && !purchaseMan.inquiry.enterprise)))" style="background: #cccbcb;" @click="sayPriceSeft">我要报价</a>
- <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && !(user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU && !purchaseMan.inquiry.enterprise)))" @click="sayPrice(purchaseMan, index)">我要报价</a>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <div class="empty" v-else>
- <img src="/images/all/empty-cart.png">
- <span>暂无搜索结果</span>
- </div>
- </div>
- <say-price :current="currentSayPriceIndex"
- :purchase="purchaseManList"
- @cancelSayPriceAction="cancelSayPrice"
- @resetListAction="resetList"
- @sayPriceIndexAction="setIndex(index)"
- ></say-price>
- <page :total="totalCount" :page-size="pageSize"
- :current="nowPage" v-on:childEvent="listenPage"></page>
- <div class="com-del-box link-saler-box" v-if="linkBoxIndex > -1">
- <div class="title">
- <i @click="setLinkBoxIndex(-1)"></i>
- </div>
- <div class="content">
- <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
- <p>买家联系电话:<span v-text="purchaseManList.content[linkBoxIndex].userTel"></span></p>
- <div>
- <a @click="setLinkBoxIndex(-1)">我知道了</a>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Page from '~components/common/page/pageComponent.vue'
- import SayPrice from './SayPrice.vue'
- export default {
- data () {
- return {
- pageSize: 10,
- nowPage: 1,
- keyWord: '',
- sorting: {},
- currentSayPriceIndex: -1,
- linkBoxIndex: -1
- }
- },
- components: {
- Page,
- SayPrice
- },
- filters: {
- date: function (date) {
- const d = new Date(Number(date))
- const year = d.getFullYear()
- const monthTemp = d.getMonth() + 1
- const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
- const hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
- const minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes() + ' '
- const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
- return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
- },
- phone: function (str) {
- return str.substring(0, 3) + '****' + str.substring(7, 11)
- },
- enterpriseFilter ([str, user]) {
- if (!user.logged) {
- return str ? str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str : '-'
- } else {
- return str || '-'
- }
- },
- userNameFilter ([str, user]) {
- if (!user.logged) {
- return str ? str.substring(0, 1) + '**' : '-'
- } else {
- return str || '-'
- }
- }
- },
- computed: {
- purchaseManList () {
- return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
- },
- totalCount () {
- return this.purchaseManList.totalElements
- },
- user () {
- return this.$store.state.option.user
- }
- },
- methods: {
- setIndex: function (index) {
- this.currentSayPriceIndex = index
- },
- getDay: function (timeStamp) {
- return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
- },
- getHours: function (timeStamp) {
- return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
- },
- listenPage: function (page) {
- this.nowPage = page
- this.resetList()
- },
- sayPrice: function (purchaseMan, index) {
- // let _this = this
- // for (let i = 0; i < this.purchaseManList.content.length; i++) {
- // _this.purchaseManList.content[i].active = false
- // }
- if (this.user.logged) {
- if (this.user.data.enterprise.uu) {
- if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
- // this.resetSayPrice()
- purchaseMan.active = true
- this.currentSayPriceIndex = index
- } else {
- this.$message.error('抱歉,您需开通卖家功能才可报价')
- }
- } else {
- this.$message.error('个人账户暂不可报价')
- }
- } else {
- this.$router.push('/auth/login?returnUrl=' + window.location.href)
- }
- },
- cancelSayPrice: function () {
- this.purchaseManList.content[this.currentSayPriceIndex].active = false
- this.currentSayPriceIndex = -1
- },
- resetList: function () {
- this.currentSayPriceIndex = -1
- this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.nowPage, pageSize: this.pageSize, keyword: this.keyWord, sorting: !this.sorting || JSON.stringify(this.sorting) === '{}' ? {releaseDate: 'DESC'} : this.sorting, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
- },
- searchList: function () {
- this.nowPage = 1
- this.resetList()
- },
- sayPriceStop: function () {
- this.$message.error('该求购已截止')
- },
- sayPriceSeft: function () {
- this.$message.error('此为贵公司的求购')
- },
- sortListByParam: function (param) {
- if (this.sorting[param]) {
- if (this.sorting[param] === 'ASC') {
- this.$set(this.sorting, param, 'DESC')
- } else {
- this.$delete(this.sorting, param)
- }
- } else {
- this.sorting = {}
- this.$set(this.sorting, param, 'ASC')
- }
- this.nowPage = 1
- this.resetList()
- },
- setLinkBoxIndex: function (index) {
- if (!this.user.logged) {
- this.$router.push('/auth/login?returnUrl=' + window.location.href)
- } else {
- this.linkBoxIndex = index
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .apply-info {
- width: 1190px;
- margin: 0 auto;
- .apply-info-title {
- border-bottom: 1px solid #3975f4;
- >p {
- display: inline-block;
- width: 156px;
- height: 33px;
- line-height: 33px;
- color: #fff;
- background: #3975f4;
- font-size: 18px;
- text-align: center;
- border: {
- top-left-radius: 3px;
- top-right-radius: 3px;
- }
- margin: 0;
- }
- >span {
- color: #999;
- margin-left: 16px;
- }
- >div {
- float: right;
- height: 32px;
- line-height: 32px;
- >input {
- width: 241px;
- height: 32px;
- line-height: 32px;
- font-size: 13px;
- border: {
- top-right-radius: 0;
- bottom-right-radius: 0;
- }
- }
- >span {
- display: inline-block;
- width: 69px;
- color: #fff;
- background: #3975f4;
- text-align: center;
- margin: 0 6px 0 -1px;
- height: 33px;
- /*vertical-align: middle;*/
- border: {
- top-right-radius: 3px;
- bottom-right-radius: 3px;
- }
- cursor: pointer;
- }
- >a {
- background: #ffa200;
- color: #fff;
- width: 79px;
- border-radius: 3px;
- text-align: center;
- display: inline-block;
- }
- }
- }
- .apply-info-list {
- .list-title {
- background: #e2ebff;
- height: 40px;
- line-height: 40px;
- margin: 9px 0 0 0;
- .list-title-item {
- display: inline-block;
- text-align: center;
- .fa {
- color: #333;
- &.active {
- color: #5078cb;
- }
- }
- &:nth-child(1) {
- margin-left: 21px;
- }
- &:nth-child(2) {
- margin-left: 345px;
- }
- &:nth-child(3) {
- margin-left: 452px;
- }
- &:nth-child(4) {
- margin-left: 71px;
- }
- }
- }
- >ul {
- margin-bottom: 29px;
- > li {
- position: relative;
- border: 1px solid #ededed;
- &.active {
- border: 1px solid #4290f7;
- box-shadow: 2px 4px 5px 0 rgb( 205, 221, 252 );
- }
- &:hover {
- border: 1px solid #4290f7;
- box-shadow: 2px 4px 5px 0 rgb( 205, 221, 252 );
- }
- .il-item {
- height: 120px;
- display: inline-block;
- text-align: center;
- color: #3c3c3c;
- padding-top: 16px;
- vertical-align: middle;
- .item {
- display: inline-block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- span {
- color: #999;
- }
- }
- &.il-left {
- width: 136px;
- padding-left: 17px;
- div {
- display: block;
- &:last-child {
- margin-top: 37px;
- color: #666;
- }
- }
- }
- &.il-center {
- margin-left: 47px;
- text-align: left;
- width: 707px;
- .il-box {
- display: inline-block;
- float: left;
- span {
- color: #999;
- }
- }
- .il-box-large {
- width: 570px;
- .fl {
- width: 284px;
- line-height: 19px;
- word-break: break-all;
- white-space: unset;
- &.bottom {
- margin-top: 14px;
- }
- .content {
- display: inline-block;
- width: 220px;
- overflow: hidden;
- vertical-align: middle;
- height: 38px;
- }
- span {
- float: left;
- }
- }
- }
- .il-box-small {
- width: 121px;
- margin-left: 12px;
- .item {
- color: #020202;
- width: 121px;
- margin-bottom: 16px;
- }
- }
- }
- &.il-right {
- width: 100px;
- .date-content {
- margin-top: 14px;
- margin-bottom: 17px;
- span {
- &:first-child {
- font-size: 12px;
- color: #666;
- }
- color: #f71026;
- }
- i {
- font-style: normal;
- }
- }
- .btn-content {
- >div a {
- display: inline-block;
- width: 71px;
- height: 28px;
- line-height: 28px;
- color: #fff;
- background: #3c7cf5;
- border-radius: 3px;
- cursor: pointer;
- /* &:first-child {
- background: #ffa200;
- float: left;
- margin-top: 19px;
- }*/
- }
- .is-say-price {
- display: inline-block;
- color: #39ae05;
- margin-left: 11px;
- img {
- margin-bottom: 2px;
- }
- }
- }
- }
- }
- .number-content {
- margin-left: 56px;
- line-height: 120px;
- padding-top: 0;
- width: 77px;
- margin-right: 34px;
- span {
- color: #5392f9;
- &.active {
- color: #ff9a00;
- }
- }
- >img {
- margin-bottom: 5px;
- margin-right: 2px;
- }
- }
- }
- }
- .empty{
- text-align: center;
- height: 200px;
- line-height: 200px;
- border: 1px solid #e8e8e8;
- margin-bottom: 10px;
- span {
- color: #999;
- margin-left: 10px;
- }
- }
- }
- .page-wrap {
- text-align: right;
- float: none;
- }
- .link-saler-box {
- width: 289px;
- height: auto;
- min-height: auto;
- border-radius: 2px;
- .title {
- background-color: #4290f7;
- height: 22px;
- line-height: 22px;
- margin-bottom: 20px;
- }
- .content {
- p {
- line-height: 20px;
- padding-top: 0;
- i {
- color: #4290f7;
- margin-right: 4px;
- }
- span {
- color: #f62d37;
- }
- }
- div {
- a {
- width: 78px;
- background: #4290f7;
- margin: 18px 0 13px 0;
- border-radius: 2px;
- }
- }
- }
- }
- }
- </style>
|