You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
348 lines
9.9 KiB
348 lines
9.9 KiB
<template>
|
|
<view class="wrapper">
|
|
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="询价列表"></uni-nav-bar>
|
|
<view>
|
|
<view class="status-bar">
|
|
<view v-for="(item, index) in statusBarArray" :key="index" :class="{ box: true, 'box--selected': current == index }" @click="selectStatus(item, index)">
|
|
{{ item }}
|
|
</view>
|
|
</view>
|
|
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback">
|
|
<view class="content" v-for="(item, index) in list" :key="index">
|
|
<uGap v-if="index > 0"></uGap>
|
|
<view class="header">
|
|
<view class="header-title">{{ item.id }}</view>
|
|
<view class="header-value">
|
|
<text :class="item.status == 30131 || item.status == 30138 ? 'failure' : ''">{{ item.status | statusName }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="box" v-if="item.status != 30116 && item.status != 30131">
|
|
<view class="list-box" v-for="(subItem, subIndex) in item.itemList" :key="subIndex">
|
|
<image
|
|
class="image"
|
|
:src="subItem.productImg || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'"
|
|
mode=""
|
|
></image>
|
|
<view class="info-box">
|
|
<view class="name">{{ subItem.paperName }}</view>
|
|
<view class="value">
|
|
{{ subItem.brandName }}/{{ subItem.categoryName }}/{{ subItem.gramWeight }}g/{{ subItem.width }}*{{ subItem.length }}/{{ subItem.quantity }}张
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="box" v-else>
|
|
<view class="list-box" v-for="(subItem, subIndex) in item.reply.replyItemList" :key="subIndex">
|
|
<image
|
|
class="image"
|
|
:src="subItem.productImg || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'"
|
|
mode=""
|
|
></image>
|
|
<view class="info-box">
|
|
<view class="name">{{ subItem.paperName }}</view>
|
|
<view class="value">
|
|
{{ subItem.brandName }}/{{ subItem.categoryName }}/{{ subItem.gramWeight }}g/{{ subItem.width }}*{{ subItem.length }}/{{ subItem.quantity }}张
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="other" v-if="item.status == 30116 || item.status == 30131">
|
|
<view class="left">{{ item.createTime }}</view>
|
|
<view class="right">
|
|
<view>
|
|
<text class="price" v-if="item.reply">¥ {{ item.reply.totalPrice }}</text>
|
|
</view>
|
|
<view class="btn" @tap="placeOrderTap(item, item.reply.replyItemList)" v-if="item.status == 30116">去下单</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</scroll-list>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { go2, back, loginGo2 } from '@/utils/hook.js'
|
|
import uGap from '@/components/u-gap/u-gap.vue'
|
|
import { getEnquiryOrder, createByEnquiry } from '@/apis/enquiryListApi.js'
|
|
export default {
|
|
components: { uGap },
|
|
data() {
|
|
return {
|
|
current: 0,
|
|
statusBarArray: ['全部', '待报价', '已报价', '已成交'],
|
|
option: {
|
|
size: 10,
|
|
auto: true,
|
|
emptyText: '暂无数据~',
|
|
background: '#F7F8FA',
|
|
disabled: false,
|
|
emptyImage: '/static/imgs/order/order-empty.png'
|
|
},
|
|
|
|
pagination: {
|
|
status: 0,
|
|
pageNum: 0, // 初始会执行一次下拉加载
|
|
pageSize: 10
|
|
},
|
|
list: []
|
|
}
|
|
},
|
|
filters: {
|
|
statusName(e) {
|
|
let name = ''
|
|
switch (e) {
|
|
case 30114:
|
|
name = '待报价'
|
|
break
|
|
case 30116:
|
|
name = '已报价'
|
|
break
|
|
case 30131:
|
|
name = '已成交'
|
|
break
|
|
case 30138:
|
|
name = '已失效'
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
return name
|
|
}
|
|
},
|
|
computed: {
|
|
hasLogin() {
|
|
return this.$store.state.qnToken != ''
|
|
}
|
|
},
|
|
onShow() {
|
|
if (this.hasLogin()) {
|
|
this.downCallback()
|
|
} else {
|
|
loginGo2('enquiry-list')
|
|
}
|
|
},
|
|
methods: {
|
|
go2,
|
|
back,
|
|
selectStatus(item, index) {
|
|
this.current = index
|
|
this.pagination.status = index
|
|
this.downCallback()
|
|
},
|
|
getList() {
|
|
return new Promise((resolve, reject) => {
|
|
getEnquiryOrder({ ...this.pagination })
|
|
.then((res) => {
|
|
// console.log('询价列表', res.records)
|
|
if (res) {
|
|
if (res.current == 1) {
|
|
this.list = res.records
|
|
} else {
|
|
this.list = this.list.concat(res.records)
|
|
}
|
|
resolve({ list: this.list, total: res.total })
|
|
} else {
|
|
reject()
|
|
}
|
|
})
|
|
.catch((err) => {
|
|
reject(err)
|
|
})
|
|
})
|
|
},
|
|
downCallback() {
|
|
this.pagination.pageNum = 1
|
|
this.getList()
|
|
.then(({ list, total }) => {
|
|
this.$refs.list.refreshSuccess({ list, total })
|
|
})
|
|
.catch(() => {
|
|
this.$refs.list.refreshFail()
|
|
})
|
|
},
|
|
upCallback() {
|
|
this.pagination.pageNum++
|
|
this.getList()
|
|
.then(({ list, total }) => {
|
|
this.$refs.list.loadSuccess({ list, total })
|
|
})
|
|
.catch(() => {
|
|
this.$refs.list.loadFail()
|
|
})
|
|
},
|
|
// 确认下单
|
|
placeOrderTap(item, replyItemList) {
|
|
let supplierOtherFee = replyItemList.map((replyItem) => {
|
|
return {
|
|
mallSupplierId: replyItem.mallSupplierId,
|
|
otherFee: replyItem.otherFee
|
|
}
|
|
})
|
|
|
|
const params = {
|
|
enquiryId: item.id,
|
|
orderGoodsList: replyItemList,
|
|
purchaserEnterpriseId: this.$store.state.companyInfo.id,
|
|
userId: this.$store.state.userInfo.userId,
|
|
supplierOtherFee
|
|
}
|
|
createByEnquiry(params).then((res) => {
|
|
if (res) {
|
|
uni.showToast({
|
|
title: '下单成功',
|
|
icon: 'success'
|
|
})
|
|
setTimeout(() => {
|
|
go2('order-make', { orderId: res.orderId })
|
|
}, 500)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.wrapper {
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex: 1;
|
|
height: 100vh;
|
|
.status-bar {
|
|
flex-grow: 0;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 32rpx;
|
|
// border-bottom: 2rpx solid rgba(221,221,221,0.5);
|
|
background-color: #fff;
|
|
border-bottom: 2rpx solid rgba($color: #dddddd, $alpha: 0.8);
|
|
height: 90rpx;
|
|
.box {
|
|
height: 86rpx;
|
|
flex-grow: 0;
|
|
flex-shrink: 0;
|
|
color: #000000;
|
|
font-size: 28rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
// border-bottom: 4rpx solid #f8f8f8;
|
|
}
|
|
.box--selected {
|
|
border-bottom: 4rpx solid #007aff;
|
|
color: #007aff;
|
|
}
|
|
}
|
|
.content {
|
|
.header {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
height: 88rpx;
|
|
background: #ffffff;
|
|
padding: 0rpx 32rpx;
|
|
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
|
|
.header-title {
|
|
font-size: 30rpx;
|
|
color: #333333;
|
|
letter-spacing: 0;
|
|
font-weight: 500;
|
|
}
|
|
.header-value {
|
|
font-size: 30rpx;
|
|
color: #ff5368;
|
|
letter-spacing: 0;
|
|
text-align: right;
|
|
font-weight: 500;
|
|
.failure {
|
|
color: #888888;
|
|
}
|
|
}
|
|
}
|
|
.box {
|
|
background-color: #fff;
|
|
padding: 24rpx 32rpx;
|
|
.list-box:nth-last-child(even) {
|
|
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
|
|
}
|
|
.list-box {
|
|
display: flex;
|
|
flex-direction: row;
|
|
// height: 148rpx;
|
|
background: #ffffff;
|
|
|
|
// padding: 24rpx 0rpx;
|
|
.image {
|
|
width: 100rpx;
|
|
height: 100rpx;
|
|
flex: 0 0 100rpx;
|
|
margin-right: 20rpx;
|
|
}
|
|
.info-box {
|
|
.name {
|
|
font-size: 30rpx;
|
|
color: #333333;
|
|
letter-spacing: 0;
|
|
text-align: left;
|
|
font-weight: 400;
|
|
padding-top: 4rpx;
|
|
}
|
|
.value {
|
|
font-size: 26rpx;
|
|
color: #888888;
|
|
letter-spacing: 0;
|
|
text-align: left;
|
|
font-weight: 400;
|
|
padding-top: 26rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.other {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 0rpx 32rpx;
|
|
height: 80rpx;
|
|
background: #ffffff;
|
|
border-top: 2rpx solid rgba(221, 221, 221, 0.5);
|
|
.left {
|
|
font-size: 26rpx;
|
|
color: #888888;
|
|
letter-spacing: 0;
|
|
text-align: left;
|
|
font-weight: 400;
|
|
}
|
|
.right {
|
|
display: flex;
|
|
align-items: center;
|
|
.price {
|
|
font-size: 30rpx;
|
|
color: #ff5368;
|
|
letter-spacing: 0;
|
|
text-align: right;
|
|
font-weight: 500;
|
|
}
|
|
.btn {
|
|
margin-left: 24rpx;
|
|
width: 132rpx;
|
|
height: 54rpx;
|
|
line-height: 54rpx;
|
|
background: #007aff;
|
|
border-radius: 27rpx;
|
|
font-size: 28rpx;
|
|
color: #ffffff;
|
|
letter-spacing: 0;
|
|
text-align: center;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|