123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <template>
- <view class="settlement-pages">
- <!-- 授信结算 -->
- <view class="sxjs-box" v-if="info">
- <view class="sxjs-head flex flex_column align-center justify_center">
- <view>已用额度</view>
- <view class="edu">
- <text>¥{{info?info.usedAmount.toFixed(2):0.00}}</text>
- </view>
- </view>
- <view class="sxjs-head-grid flex align-center justify_between">
- <view :class="tabIndex==0?'active':''" @click="tabChange(0)">
- <view>待结算</view>
- <view class="edu"><text>¥{{info?info.waitSettleAmount:0.00}}</text></view>
- <view class="line"></view>
- </view>
- <view :class="tabIndex==1?'active':''" @click="tabChange(1)">
- <view>已冻结</view>
- <view class="edu"><text>¥{{info?info.freezeAmount.toFixed(2):0.00}}</text></view>
- <view class="line"></view>
- </view>
- </view>
- </view>
- <view class="ds-box">
- <scroll-view style="height: calc(100vh - 370upx);position: relative;" scroll-y @scrolltolower="loadMore">
- <view class="notes-msg" v-if="tabIndex==1">
- 已冻结金额是指状态为“待拿货”的订单结算金额合计,暂时无需支付,但是会占用授信额度,请尽快处理
- </view>
- <!-- 列表 -->
- <view class="ds-list" v-for="item in list" :key="item.id">
- <view class="flex align_center">
- <view class="orderNo">{{item.shelfOrderNo}}</view>
- <view class="time">{{item.createDate}}</view>
- </view>
- <view class="flex align_center">
- <view class="carImage flex flex_column justify_center">
- <u-image v-if="!item.billSource" :src="item.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
- <u-image v-if="item.billSource=='qr_code'" src="/static/qrcode.png" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
- <u-image v-if="item.billSource=='bar_code'" src="/static/barcode.png" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
- <u-image v-if="item.billSource=='product_code'" src="/static/tag.png" border-radius="30" width="100" height="100" bg-color="#333" ></u-image>
- </view>
- <view class="carModel">
- {{!item.billSource ? item.vehicleModel : item.shelfOrderDetailList[0].productName}}
- </view>
- <view class="price">¥{{item.settleAmount}}</view>
- </view>
- </view>
- <view style="padding-top: 10%;border:0" v-if="list.length==0 && status!='loading'">
- <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无记录" img-width="180" mode="list"></u-empty>
- </view>
- <view style="padding: 20upx;">
- <u-loadmore v-if="(allData.length>=list.length&&list.length)||status=='loading'" :status="status" />
- </view>
- </scroll-view>
- </view>
- <!-- <view class="footer" v-if="tabIndex==0&&info&&info.waitSettleAmount>0">
- <u-button @click="toPay" :throttle-time="100" :custom-style="{background:'#066cff',color:'#fff'}" shape="circle" type="success">
- 立即支付(¥{{info.waitSettleAmount}})
- </u-button>
- </view> -->
- </view>
- </template>
- <script>
- import { waitSettleForSx,shelfSettleBillToPay,findStoreShelfSettleRule } from '@/api/shelf.js'
- export default {
- components: {
- },
- data() {
- return {
- tabIndex: 0,
- pageNo: 1,
- pageSize:10,
- list: [],
- allData: [],
- info:null,
- status: 'loading',
- shelfOrderSnList:[]
- }
- },
- onReady() {
- },
- onLoad(option) {
- this.getDetail()
- },
- methods: {
- // 查询详情
- getDetail(){
- findStoreShelfSettleRule().then(res => {
- console.log(res)
- if(res.status == 200){
- this.info = res.data
- this.getwaitSettleForSx()
- }
- })
- },
- // 去支付
- toPay(){
- this.info.shelfOrderSnList = this.shelfOrderSnList
- },
- waitSettleAmount() {
- let ret = 0
- this.allData.map(item => {
- ret = ret + item.settleAmount
- })
- this.info.waitSettleAmount = ret.toFixed(2)
- },
- // 获取详细列表
- getwaitSettleForSx(){
- const state = ["WAIT","FREEZE","FINISH"]
- waitSettleForSx({shelfOrderState: state[this.tabIndex]}).then(res => {
- this.allData = res.data || []
- console.log(this.allData)
- // 默认显示第一页
- const allTotal = this.allData.length
- this.list = this.allData.slice(0,allTotal<=this.pageSize?allTotal:this.pageSize)
- this.status = allTotal>=this.list.length ? "nomore" : 'loadmore'
- if(this.tabIndex==0){
- // 获取所有sn
- this.allData.map(item => {
- this.shelfOrderSnList.push(item.shelfOrderSn)
- })
- this.waitSettleAmount()
- }
- })
- },
- tabChange(i){
- this.tabIndex = i
- this.pageNo = 1
- this.status = "loading"
- this.allData = []
- this.list = []
- this.shelfOrderSnList = []
- this.getwaitSettleForSx()
- },
- loadMore(event){
- console.log(event,'滚动到底部')
- const curCount = this.list.length
- const total = this.allData.length
- if(curCount<total){
- // 下页
- this.pageNo = this.pageNo + 1
- this.status = "loading"
- setTimeout(()=>{
- const end = this.pageNo * this.pageSize
- this.list = this.allData.slice(0,end)
- this.status = total>=this.list.length ? "nomore" : 'loadmore'
- },500)
- }else{
- this.status = "nomore"
- }
- }
- }
- }
- </script>
- <style lang="less">
- .settlement-pages{
- width: 100%;
- height: 100vh;
- display: flex;
- flex-direction: column;
- > view{
- padding: 30rpx 50rpx;
- }
- .sxjs-box{
- > view{
- background-color: #fff;
- border-radius: 25rpx;
- min-height: 100rpx;
- padding: 30rpx;
- color: #666;
- }
- .sxjs-head{
- width: 100%;
- text-align: center;
- font-size: 30rpx;
- margin-bottom: 0;
- > .edu{
- color: #FA3534;
- padding: 10rpx 0;
- font-size: 36rpx;
- text{
- font-size: 46rpx;
- font-style: italic;
- font-weight: 900;
- }
- }
- }
- .sxjs-head-grid{
- margin-top: -40rpx;
- padding-bottom: 20rpx;
- > view{
- width: 50%;
- border-right: 2rpx solid #eee;
- text-align: center;
- color: #999;
- position: relative;
- .edu{
- text{
- font-size: 40rpx;
- }
- }
- &:last-child{
- border: 0;
- }
- .line{
- width: 60%;
- position: absolute;
- left: 20%;
- bottom: -20rpx;
- }
- }
- .active{
- color: #666;
- .edu{
- text{
- color: #222;
- }
- }
- .line{
- border-bottom: 6rpx solid #0485F6;
- }
- }
- }
- }
- .ds-box{
- flex-grow: 1;
- padding: 0 50rpx;
- overflow: auto;
- .notes-msg{
- background-color: #F8ECD9;
- border-radius: 25rpx;
- margin-bottom: 20rpx;
- min-height: 100rpx;
- padding: 30rpx;
- color: #666E75;
- font-size: 28rpx;
- }
- .ds-list{
- background-color: #fff;
- border-radius: 25rpx;
- margin-bottom: 20rpx;
- min-height: 100rpx;
- padding: 10rpx;
- color: #666;
- > view{
- padding: 10rpx;
- font-size: 28rpx;
- &:first-child{
- justify-content: space-between;
- }
- .time{
- color: #666E75;
- font-size: 24rpx;
- }
- .price{
- color: #FA3534;
- font-size: 32rpx;
- padding-left: 20rpx;
- }
- .carImage{
- padding-right: 20rpx;
- }
- .carModel{
- color: #222;
- font-size: 28rpx;
- flex-grow: 1;
- }
- .orderNo{
- font-size: 28rpx;
- flex-grow: 1;
- width: 60%;
- }
- }
- }
- }
- }
- </style>
|