123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756 |
- <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>
- <span>发布时间
- <a href="javascript:void(0)" @click="sortListByParam('releaseDate')">
-
-
- </a>
- </span>
- <span>买家</span>
- <span>型号</span>
- <span>品牌</span>
- <span>已报价
- <a href="javascript:void(0)" @click="sortListByParam('offerAmount')">
-
-
- </a>
- </span>
- <span>截止时间
- <a href="javascript:void(0)" @click="sortListByParam('deadline')">
-
-
- </a>
- </span>
- <span>操作</span>
- </p>
- <ul v-if="purchaseManList.content && purchaseManList.content.length">
- <li v-for="(purchaseMan, index) in purchaseManList.content" :class="{'active': purchaseMan.active}">
- <div>{{purchaseMan.date| date}}</div>
- <div v-if="purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{purchaseMan.inquiry.enterprise.enName | enterpriseFilter}}</div>
- <div v-else>{{purchaseMan.userName | userNameFilter}}</div>
- <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode || '-'}}</div>
- <div :title="purchaseMan.inbrand">{{purchaseMan.inbrand || '-'}}</div>
- <div class="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="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">
-
-
- <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 class="expand-content">
- <div>
- 封装:{{purchaseMan.encapsulation || '-'}}
- </div>
- <div>
- 采购数量:<span>{{purchaseMan.needquantity || '-'}}</span><span v-if="purchaseMan.needquantity">个</span>
- </div>
- <div>
- 单价预算:<span>{{purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'}}</span>
- </div>
- <div>
- 生产日期:{{purchaseMan.produceDate || '-'}}
- </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 ? (str.substring(0, 3) + '****' + str.substring(7, 11)) : '-'
- },
- enterpriseFilter (str) {
- return str ? str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str : '-'
- },
- userNameFilter (str) {
- return str ? (str.substring(0, 1) + '**') : '-'
- }
- },
- 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) {
- if (this.user.logged) {
- if (this.user.data.enterprise.uu) {
- if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
- 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;
- /*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 {
- >p {
- background: #ededed;
- height: 40px;
- line-height: 40px;
- margin: 9px 0 0 0;
- span {
- display: inline-block;
- text-align: center;
- a {
- i {
- color: #333;
- &.active {
- color: #5078cb;
- }
- }
- }
- &:nth-child(1) {
- width: 186px;
- }
- &:nth-child(2) {
- width: 106px;
- }
- &:nth-child(3) {
- width: 200px;
- }
- &:nth-child(4) {
- width: 174px;
- }
- &:nth-child(5) {
- width: 152px;
- }
- &:nth-child(6) {
- width: 158px;
- }
- &:nth-child(7) {
- width: 180px;
- margin-left: 30px;
- }
- }
- }
- >ul {
- margin-bottom: 29px;
- > li {
- position: relative;
- min-height: 61px;
- line-height: 61px;
- border: 1px solid #ededed;
- >div {
- overflow-x: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- display: inline-block;
- text-align: center;
- color: #3c3c3c;
- vertical-align: middle;
- &:nth-child(1) {
- width: 186px;
- }
- &:nth-child(2) {
- width: 106px;
- }
- &:nth-child(3) {
- width: 200px;
- }
- &:nth-child(4) {
- width: 174px;
- }
- &:nth-child(5) {
- width: 152px;
- }
- &:nth-child(6) {
- width: 158px;
- }
- &:nth-child(7) {
- width: 180px;
- margin-left: 32px;
- float: right;
- }
- &.date-content {
- span {
- &:first-child {
- font-size: 12px;
- color: #666;
- }
- color: #f71026;
- }
- i {
- font-style: normal;
- }
- }
- &.number-content {
- span {
- color: #5392f9;
- &.active {
- color: #ff9a00;
- }
- }
- >img {
- margin-bottom: 5px;
- margin-right: 2px;
- }
- }
- &.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;
- }
- .say-price-history {
- position: absolute;
- top: 53px;
- right: 11px;
- line-height: normal;
- width: 198px;
- height: 0;
- background: #fff;
- border: 1px solid #fab89a;
- z-index: 1;
- overflow: hidden;
- transition: height 1s;
- -moz-transition: height 1s; /* Firefox 4 */
- -webkit-transition: height 1s; /* Safari 和 Chrome */
- -o-transition: height 1s; /* Opera */
- opacity: 0;
- p {
- color: #020202;
- font-weight: bold;
- margin: 0;
- &.price-title {
- background: #fee6db;
- height: 28px;
- line-height: 28px;
- }
- &.price-level {
- margin: 6px 0;
- text-align: left;
- }
- }
- > div {
- padding: 9px 12px;
- > div {
- display: inline-block;
- text-align: left;
- &:nth-child(1) {
- float: left;
- }
- &:nth-child(2) {
- margin-left: 32px;
- }
- span {
- color: #020202;
- margin: 0;
- &.red-text {
- color: #f62d37;
- }
- }
- &.pre-line {
- display: block;
- padding: 13px 0;
- border-bottom: 1px dashed #fee6db;
- }
- }
- ul {
- li {
- color: #333;
- height: 22px;
- line-height: 22px;
- padding: 0 6px;
- &:nth-child(odd) {
- background: #f6f5f4;
- }
- span {
- color: #333;
- display: inline-block;
- text-align: left;
- width: 50%;
- margin: 0;
- }
- &:last-child {
- span {
- color: #4290f7;
- }
- }
- }
- }
- }
- }
- &:hover {
- .say-price-history {
- opacity: 1;
- /* animation: expand 1s infinite;
- -webkit-animation: expand 1s infinite; !*Safari and Chrome*!
- animation-iteration-count: 1;
- -webkit-animation-iteration-count: 1;*/
- height: 210px;
- }
- }
- /* @keyframes expand {
- from {bottom: 58px}
- to {bottom: auto}
- }
- @-webkit-keyframes expand {
- from {bottom: 58px}
- to {bottom: auto}
- }*/
- }
- }
- }
- .expand-content {
- display: none;
- position: absolute;
- top: 63px;
- justify-content: space-between;
- padding: 0 236px 0 36px;
- background: #fffbf0;
- height: 48px;
- line-height: 48px;
- color: #020202;
- div {
- display: inline-block;
- span {
- color: #f71026;
- }
- }
- }
- &:hover {
- border-top: 1px solid #4290f7;
- border-left: 1px solid #4290f7;
- border-right: 1px solid #4290f7;
- .expand-content {
- display: flex;
- width: 1190px;
- z-index: 1;
- border-bottom: 1px solid #4290f7;
- border-left: 1px solid #4290f7;
- border-right: 1px solid #4290f7;
- left: -1px;
- }
- }
- .say-price {
- background-color: #e7eef9;
- height: 64px;
- line-height: 64px;
- display: none;
- >div {
- display: inline-block;
- position: relative;
- height: 64px;
- line-height: 64px;
- input {
- border-radius: 3px;
- }
- &:nth-child(1) {
- width: 282px;
- background: url('/images/applyPurchase/say-price.png')no-repeat;
- text-align: center;
- margin-right: 44px;
- }
- &:nth-child(2) {
- margin-right: 39px;
- input {
- width: 118px;
- height: 26px;
- border: 1px solid #5392f9;
- }
- select {
- position: absolute;
- top: 19px;
- width: 32px;
- height: 26px;
- background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- border: {
- left: none;
- top: none;
- bottom: none;
- right: 1px solid #5392f9;
- bottom-left-radius: 4px;
- top-left-radius: 4px;
- }
- color: #5392f9;
- font: small-caption;
- padding-left: 8px;
- & + input {
- padding-left: 34px;
- }
- }
- div {
- position: absolute;
- top: 19px;
- left: 38px;
- width: 32px;
- height: 26px;
- line-height: 26px;
- text-align: center;
- border: {
- left: none;
- top: none;
- bottom: none;
- right: 1px solid #5392f9;
- bottom-left-radius: 4px;
- top-left-radius: 4px;
- }
- color: #5392f9;
- & + input {
- padding-left: 34px;
- }
- }
- }
- &:nth-child(3) {
- margin-right: 37px;
- input {
- width: 32px;
- height: 26px;
- padding: 0 0 0 6px;
- }
- }
- &:nth-child(4) {
- margin-right: 132px;
- input {
- width: 118px;
- height: 26px;
- }
- }
- &:nth-child(5) {
- span {
- width: 71px;
- height: 28px;
- line-height: 28px;
- text-align: center;
- display: inline-block;
- cursor: pointer;
- &:first-child {
- background: #dedddd;
- margin-right: 10px;
- }
- &:last-child {
- background: #fa4701;
- color: #fff;
- }
- }
- }
- i {
- color: #e41515;
- position: relative;
- top: 2px;
- right: 3px;
- }
- }
- }
- &.active {
- border: 1px solid #4290f7;
- .expand-content {
- display: flex;
- width: 1190px;
- z-index: 1;
- border: 1px solid #4290f7;
- left: -1px;
- border-top: none;
- }
- /*.say-price {*/
- /*display: block;*/
- /*}*/
- }
- }
- }
- .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>
|