Browse Source

优化报价详情 状态判断

devlop
杨阁辉 4 years ago
parent
commit
d384fe7b92
2 changed files with 281 additions and 295 deletions
  1. 4
      pages/quotation-details/index.vue
  2. 572
      pages/trade/quotationList.vue

4
pages/quotation-details/index.vue

@ -4,13 +4,13 @@
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="submit-title">报价详情</view>
<view slot="left"></view>
<view slot="right" class="edit-price" @click="editPrice()">修改报价</view>
<view slot="right" class="edit-price" v-if="upDataObj.replyStatus !== 30102" @click="editPrice()">修改报价</view>
</uni-nav-bar>
</view>
<view class="submit-main">
<view>
<text class="submit-main-title">交货要求</text>
<text class="price-tips">已报价</text>
<text class="price-tips">{{upDataObj.re}}</text>
</view>
<view>
<text class="submit-main-subTitle">询价客户</text>

572
pages/trade/quotationList.vue

@ -1,66 +1,52 @@
<template>
<view class="quotation-list">
<scroll-list ref="quotationRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index">
<view class="list-border list-title-line">
<text class="list-title">{{ item.belongEnterpriseName }}</text>
<text class="list-title-Subtitle">{{ item.replyStatus | replyStatusName }}</text>
</view>
<view class="list-border list-info-line">
<view
class="list-info"
:class="subIndex + 1 === item.itemList.length ? '' : 'list-border'"
v-for="(subItem, subIndex) in item.itemList"
:key="subIndex"
>
<view class="">
<!-- <image class="list-image" src="../../static/logo.png" mode=""></image> -->
<image class="list-image" :src="subItem.productImg" mode=""></image>
</view>
<view class="list-info-contant">
<view class="list-info-title">{{ subItem.brandName }}</view>
<view class="list-info-text">
{{ subItem.categoryName }}/{{ subItem.paperName }}/{{ subItem.gramWeight }}g/{{ subItem.length }}*{{ subItem.width }}/{{ subItem.quantity }}
</view>
</view>
</view>
<!-- <view class="list-info">
<view class=""><image class="list-image" src="../../static/logo.png" mode=""></image></view>
<view class="list-info-contant">
<view class="list-info-title">金蝶蓝白卡</view>
<view class="list-info-text">白卡纸/金蝶蓝/350g/787*1092/2200</view>
<view class="quotation-list">
<scroll-list ref="quotationRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index">
<view class="list-border list-title-line">
<text class="list-title">{{ item.belongEnterpriseName }}</text>
<text class="list-title-Subtitle">{{ item.replyStatus | replyStatusName }}</text>
</view>
<view class="" @click="offerClick(item)">
<view class="list-border list-info-line">
<view class="list-info" :class="subIndex + 1 === item.itemList.length ? '' : 'list-border'" v-for="(subItem, subIndex) in item.itemList" :key="subIndex">
<view class=""><image class="list-image" :src="subItem.productImg" mode=""></image></view>
<view class="list-info-contant">
<view class="list-info-title">{{ subItem.brandName }}</view>
<view class="list-info-text">
{{ subItem.categoryName }}/{{ subItem.paperName }}/{{ subItem.gramWeight }}g/{{ subItem.length }}*{{ subItem.width }}/{{ subItem.quantity }}
</view>
</view>
</view>
</view> -->
</view>
<view class="list-border list-bottom-contant">
<view>
<text>交货时间</text>
<text>{{ item.deliveryDay }}</text>
</view>
<view>
<text>交货区域</text>
<text>{{ item.deliveryArea }}</text>
</view>
<view class="offer-class">
<view class="offer-width">
<text>报价截止</text>
<text>{{ item.enquiryValidTime }}</text>
</view>
<view>
<button type="primary" class="offer-btn" @click="offerClick(item)">报价</button>
</view>
<view class="list-border list-bottom-contant" >
<view>
<text>交货时间</text>
<text>{{ item.deliveryDay }}</text>
</view>
<view>
<text>交货区域</text>
<text>{{ item.deliveryArea }}</text>
</view>
<view class="offer-class">
<view class="offer-width">
<text>报价截止</text>
<text>{{ item.enquiryValidTime }}</text>
</view>
<view><button type="primary" class="offer-btn">报价</button></view>
</view>
</view>
</view>
<uGap></uGap>
</view>
</scroll-list>
<view>
<view class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/myPrice.png" mode=""></image>
<view class="my-price">我的报价</view>
</view>
</view>
</view>
<uGap></uGap>
</view>
</scroll-list>
<view>
<view class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/myPrice.png" mode=""></image>
<view class="my-price">我的报价</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
@ -68,244 +54,244 @@ import { getEnterpriseList } from '@/apis/trade'
import { back, go2 } from '@/utils/hook.js'
import uGap from '@/components/u-gap/u-gap.vue'
export default {
props: {
queryData: {
type: Object,
default: () => {}
}
},
components: {
uGap
},
props: {
queryData: {
type: Object,
default: () => {}
}
},
components: {
uGap
},
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无报价信息~',
background: '#F7F8FA',
fontSize: '40rpx'
},
params: {
asc: '',
desc: '',
// mallSupplierIds: [this.$store.state.supplierInfo.supplierId], // ID
mallSupplierIds: ['553703427180466176'] // ID
},
pagination: {
pageNum: 0, //
pageSize: 20
},
list: []
}
},
onShow() {
this.getQuotationQurty()
},
onLoad(option) {},
filters: {
replyStatusName(status) {
let name = ''
// 30128 30130 30139 30102
switch (status) {
case 30128:
name = '待报价'
break
case 30130:
name = '已报价'
break
case 30139:
name = '转化订单'
break
case 30102:
name = '已失效'
break
default:
break
}
return name
}
},
methods: {
//
getQuotationQurty() {
return new Promise((resolve, reject) => {
getEnterpriseList({ ...this.params, ...this.pagination })
.then((res) => {
console.log('获取报价列表', res)
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
// this.list = []
// this.list = [{ name: '111', id: '222' }, { name: '111', id: '222' }]
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
reject(err)
})
})
},
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无报价信息~',
background: '#F7F8FA',
fontSize: '40rpx'
},
params: {
asc: '',
desc: '',
// mallSupplierIds: [this.$store.state.supplierInfo.supplierId], // ID
mallSupplierIds: ['553703427180466176'] // ID
},
pagination: {
pageNum: 0, //
pageSize: 20
},
list: []
}
},
onShow() {
this.getQuotationQurty()
},
onLoad(option) {},
filters: {
replyStatusName(status) {
let name = ''
// 30128 30130 30139 30102
switch (status) {
case 30128:
name = '待报价'
break
case 30130:
name = '已报价'
break
case 30139:
name = '转化订单'
break
case 30102:
name = '已失效'
break
default:
break
}
return name
}
},
methods: {
//
getQuotationQurty() {
return new Promise((resolve, reject) => {
getEnterpriseList({ ...this.params, ...this.pagination })
.then(res => {
console.log('获取报价列表', res)
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
// this.list = []
// this.list = [{ name: '111', id: '222' }, { name: '111', id: '222' }]
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch(err => {
reject(err)
})
})
},
//
quotationUp(page) {
this.pagination.pageNum++
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.loadFail()
})
},
//
quotationDown() {
this.pagination.pageNum = 1
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.refreshFail()
})
},
//
offerClick(item) {
var params = {
...item,
title: '提交报价',
}
go2('submit-quotation', params)
},
//
nativeTo() {
go2('my-offer')
}
}
//
quotationUp(page) {
this.pagination.pageNum++
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.loadFail()
})
},
//
quotationDown() {
this.pagination.pageNum = 1
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.refreshFail()
})
},
//
offerClick(item) {
var params = {
...item,
title: '提交报价'
}
go2('submit-quotation', params)
},
//
nativeTo() {
go2('my-offer')
}
}
}
</script>
<style lang="scss">
.quotation-list {
margin-bottom: 0rpx;
.list-border {
// border-top: 1px solid #dddddd;
border-bottom: 2rpx solid #dddddd;
}
.list-title-line {
line-height: 88rpx;
padding-left: 48rpx;
background: #ffffff;
}
.list-title {
font-family: PingFangSC-Semibold;
font-size: 30rpx;
color: #000000;
letter-spacing: 0;
font-weight: 600;
}
.list-title-Subtitle {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #ff5368;
letter-spacing: 0;
text-align: right;
font-weight: 500;
float: right;
margin-right: 32rpx;
}
.list-info-line {
padding-left: 48rpx;
line-height: 70rpx;
background: #ffffff;
}
.list-info-contant {
margin-left: 48rpx;
background: #ffffff;
}
.list-info-title {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
text-align: left;
font-weight: 550;
}
.list-info-text {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #888888;
letter-spacing: 0;
text-align: left;
line-height: 64rpx;
font-weight: 400;
}
.list-image {
width: 100rpx;
height: 100rpx;
margin-top: 20rpx;
}
.list-info {
display: flex;
}
.list-bottom-contant {
line-height: 70rpx;
padding-left: 48rpx;
padding-bottom: 48rpx;
background: #ffffff;
}
.my-image {
width: 32rpx;
height: 32rpx;
}
.my-price {
font-family: PingFangSC-Medium;
font-size: 18rpx;
color: #007aff;
text-align: center;
font-weight: 500;
white-space: nowrap;
padding: 6rpx;
}
.offer-class {
display: flex;
justify-content: space-between;
}
.offer-btn {
width: 150rpx;
height: 64rpx;
background: #007aff;
border: 2rpx solid #007aff;
border-radius: 8rpx;
line-height: 60rpx;
margin-right: 32rpx;
}
.offer-width {
width: 70%;
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #ffffff;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
margin-bottom: 0rpx;
.list-border {
// border-top: 1px solid #dddddd;
border-bottom: 2rpx solid #dddddd;
}
.list-title-line {
line-height: 88rpx;
padding-left: 48rpx;
background: #ffffff;
}
.list-title {
font-family: PingFangSC-Semibold;
font-size: 30rpx;
color: #000000;
letter-spacing: 0;
font-weight: 600;
}
.list-title-Subtitle {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #ff5368;
letter-spacing: 0;
text-align: right;
font-weight: 500;
float: right;
margin-right: 32rpx;
}
.list-info-line {
padding-left: 48rpx;
line-height: 70rpx;
background: #ffffff;
}
.list-info-contant {
margin-left: 48rpx;
background: #ffffff;
}
.list-info-title {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
text-align: left;
font-weight: 550;
}
.list-info-text {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #888888;
letter-spacing: 0;
text-align: left;
line-height: 64rpx;
font-weight: 400;
}
.list-image {
width: 100rpx;
height: 100rpx;
margin-top: 20rpx;
}
.list-info {
display: flex;
}
.list-bottom-contant {
line-height: 70rpx;
padding-left: 48rpx;
padding-bottom: 48rpx;
background: #ffffff;
}
.my-image {
width: 32rpx;
height: 32rpx;
}
.my-price {
font-family: PingFangSC-Medium;
font-size: 18rpx;
color: #007aff;
text-align: center;
font-weight: 500;
white-space: nowrap;
padding: 6rpx;
}
.offer-class {
display: flex;
justify-content: space-between;
}
.offer-btn {
width: 150rpx;
height: 64rpx;
background: #007aff;
border: 2rpx solid #007aff;
border-radius: 8rpx;
line-height: 60rpx;
margin-right: 32rpx;
}
.offer-width {
width: 70%;
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #ffffff;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
}
</style>
</style>
Loading…
Cancel
Save