Commit 19fcb034 by 杨明

门店订单

1 parent bf5afb83
/*
* @Description:
* @Description:
* @Author: huyue
* @Date: 2024-09-05 14:05:25
* @LastEditors: huyue
* @LastEditTime: 2024-09-13 11:08:55
*/
import http from "../request/http";
import http from '../request/http'
module.exports = {
/**获取APP更新 */
findSoureList (data) {
findSoureList(data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
projectName: 'boutique',
...data
})
},
/** 查询可发放礼券-分页查询商户券列表 */
findCouponList (data) {
findCouponList(data) {
return http.post({
method: "dj.api.smartcarlife.merchantCoupon.pageForZYApp",
projectName: "boutique",
method: 'dj.api.smartcarlife.merchantCoupon.pageForZYApp',
projectName: 'boutique',
onlyUsable: true,
currentPage: 1,
pageSize: 99999,
...data,
});
...data
})
},
/**查询用户是否领券 */
findCustomerReceivedStatus (data) {
findCustomerReceivedStatus(data) {
return http.post({
method: "dj.api.smartcarlife.customerCoupon.pageForZYApp",
projectName: "boutique",
method: 'dj.api.smartcarlife.customerCoupon.pageForZYApp',
projectName: 'boutique',
...data,
currentPage: 1,
pageSize: 99999,
statusList: [0, 1]
});
})
},
/**历史成交客户 */
historyDealOrderPage (data) {
historyDealOrderPage(data) {
return http.post({
method: "dj.api.smartcarlife.order.historyDealOrder.page",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.order.historyDealOrder.page',
projectName: 'boutique',
...data
})
},
// 历史订单列表
getQuotationList (data) {
getQuotationList(data) {
return http.post({
method: "dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
...data
})
},
// 历史订单列表
getOrderList(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.for.pad.page',
projectName: 'boutique',
...data
})
},
/**客户邀约记录 */
customerInviteRecordPage (data) {
customerInviteRecordPage(data) {
return http.post({
method: "dj.api.smartcarlife.customerInviteRecord.page",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.customerInviteRecord.page',
projectName: 'boutique',
...data
})
},
/**轻改素材配置 */
getBoutiqueMaterialConfig (data) {
getBoutiqueMaterialConfig(data) {
return http.post({
method: "dj.api.boutique.recepiton.material.merchant.detail",
projectName: "boutique",
...data,
});
method: 'dj.api.boutique.recepiton.material.merchant.detail',
projectName: 'boutique',
...data
})
},
/** 案例视频 */
getCaseList(data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.material.case.find",
projectName: "boutique",
method: 'dj.api.smartcarlife.recepiton.material.case.find',
projectName: 'boutique',
...data
})
},
/** 获取类目 */
getCategory(data) {
return http.post({
method: "dj.api.boutique.recepiton.material.merchant.category",
projectName: "boutique",
method: 'dj.api.boutique.recepiton.material.merchant.category',
projectName: 'boutique',
...data
})
},
/**
......@@ -94,10 +102,9 @@ module.exports = {
*/
getInviteRecordCount(data) {
return http.post({
method: "dj.api.smartcarlife.customerInviteRecord.inviteStatus.count",
projectName: "boutique",
method: 'dj.api.smartcarlife.customerInviteRecord.inviteStatus.count',
projectName: 'boutique',
...data
})
},
};
}
}
<template>
<view :class="['layout',{'byd-layout':isByd}]">
<view :class="['layout', { 'byd-layout': isByd }]">
<view class="layout-content">
<view class="title flex">{{ title }}</view>
<view
class="form-box"
:key="watchStatus"
>
<view class="form-box" :key="watchStatus">
<view class="form">
<template v-for="(i, index) in formObject">
<view
:class="['form-item' ,{active:focusIndex == index}]"
:key="index"
>
<view :class="['form-item', { active: focusIndex == index }]" :key="index">
<view class="form-item-box">
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.key]}]"
@click="showPopup(i.popKey,index)"
>
<view class="value text-hide">{{customerInfo[i.key] ||i.placeholder}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)">
<view class="value text-hide">{{ customerInfo[i.key] || i.placeholder }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</view>
</view>
</template>
<view
class="form-check flex"
@click="showphoto = !showphoto"
>
<view :class="['check-box flex',{'checked':showphoto}]">
<uni-icons
type="checkmarkempty"
:size="14"
color="#fff"
></uni-icons>
<view class="form-check flex" @click="showphoto = !showphoto">
<view :class="['check-box flex', { checked: showphoto }]">
<uni-icons type="checkmarkempty" :size="14" color="#fff"></uni-icons>
</view>
显示凭证
</view>
<view
class="form-check flex"
@click="merchantOrder = !merchantOrder"
>
<view :class="['check-box flex',{'checked':merchantOrder}]">
<uni-icons
type="checkmarkempty"
:size="14"
color="#fff"
></uni-icons>
<view class="form-check flex" @click="merchantOrder = !merchantOrder">
<view :class="['check-box flex', { checked: merchantOrder }]">
<uni-icons type="checkmarkempty" :size="14" color="#fff"></uni-icons>
</view>
门店订单
</view>
</view>
</view>
<template v-if="list.length > 0">
<scroll-view
:class="['record-box', { 'has-tabs': views && views.length > 1 }]"
scroll-y
:scroll-top="scrollTop"
@scrolltolower="pageonReachBottom"
>
<scroll-view :class="['record-box', { 'has-tabs': views && views.length > 1 }]" scroll-y :scroll-top="scrollTop" @scrolltolower="pageonReachBottom">
<!-- <template v-for="(i,index) in formatList">
<view
:key="index"
class="card-box"
> -->
<!-- <view class="card-title">{{i.title}}</view> -->
<!-- v-for="item in i.list" -->
<view class="card-list">
<view
class="card-item"
v-for="item in list"
:key="item.id"
>
<template v-if="showphoto">
<image
v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl"
class="image-box"
:src="item.vdQuotationPaymentDoc.paymentDocUrl"
/>
<image
v-else
class="image-box photo"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp"
/>
<view class="gradient-overlay"></view>
</template>
<template v-else>
<!-- 1:线上微信支付,2:线下收款,3:POS机收款,4:支付宝支付,5:嘀加收款 -->
<div :class="['payType sprite-icon',`icon-payType-${item.payType}`]"></div>
</template>
<view>
<view class="name">{{ nameHide(item.customerName) }}</view>
<!-- <view class="name">{{ item.id }}</view> -->
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info">
<view class="label">车架号</view>
<view class="value">{{ item.carVin || '-' }}</view>
</view>
<view class="card-info">
<view class="label">工单号</view>
<view class="value">{{ item.payId }}</view>
</view>
<view class="card-info">
<view class="label">交易流水号</view>
<view class="value">{{ item.transactionNo }}</view>
</view>
<view class="card-info">
<view class="label">实收金额</view>
<view class="price">
<view class="flag">¥</view>
{{ accDiv(item.equityPrice) }}
</view>
</view>
<!-- <view class="card-title">{{i.title}}</view> -->
<!-- v-for="item in i.list" -->
<view class="card-list">
<view class="card-item" v-for="item in list" :key="item.id">
<template v-if="showphoto">
<image v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl" class="image-box" :src="item.vdQuotationPaymentDoc.paymentDocUrl" />
<image v-else class="image-box photo" src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp" />
<view class="gradient-overlay"></view>
</template>
<template v-else>
<!-- 1:线上微信支付,2:线下收款,3:POS机收款,4:支付宝支付,5:嘀加收款 -->
<div :class="['payType sprite-icon', `icon-payType-${item.payType}`]"></div>
</template>
<view>
<view class="name">{{ nameHide(item.customerName) }}</view>
<!-- <view class="name">{{ item.id }}</view> -->
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info">
<view class="label">车架号</view>
<view class="value">{{ item.carVin || '-' }}</view>
</view>
<view class="card-info">
<view class="label">工单号</view>
<view class="value">{{ item.payId }}</view>
</view>
<view class="card-info">
<view class="label">交易流水号</view>
<view class="value">{{ item.transactionNo }}</view>
</view>
<view class="card-info">
<view class="label">实收金额</view>
<view class="price">
<view class="flag">¥</view>
{{ accDiv(item.equityPrice) }}
</view>
</view>
</view>
<!-- </view>
</view>
</view>
<!-- </view>
</template> -->
<view
class="end-text"
v-if="list.length > 0 && isEnd"
>我是一个有底线的人</view>
<view class="end-text" v-if="list.length > 0 && isEnd">我是一个有底线的人</view>
</scroll-view>
</template>
<template v-else>
<view class="no-data">
<glsx-image
class="no-data-img"
src="media/no-data.png"
mode="scaleToFill"
/>
<glsx-image class="no-data-img" src="media/no-data.png" mode="scaleToFill" />
<view class="no-data-text">暂无数据</view>
</view>
</template>
</view>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
@close="resetFocusIndex"
/>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" @close="resetFocusIndex" />
</view>
</template>
......@@ -161,7 +106,7 @@ export default {
isByd: Boolean,
views: Array
},
data () {
data() {
return {
scrollTop: 0,
formObject: [
......@@ -170,23 +115,23 @@ export default {
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
}
],
customerInfo: {},
focusIndex: -1,
showphoto: false,
formatList: [],
merchantOrder: false, //门店订单
merchantOrder: false //门店订单
}
},
watch: {
show (n) {
show(n) {
if (n) this.init()
else this.scrollTop = 0
},
watchStatus: {
immediate: true,
handler (newval) {
handler(newval) {
this.pageNum = 1
this.scrollTop = 1000
this.list = []
......@@ -195,11 +140,11 @@ export default {
setTimeout(() => {
this.scrollTop = 0
}, 100)
},
}
},
merchantOrder: {
immediate: true,
handler (newval) {
handler(newval) {
this.pageNum = 1
this.scrollTop = 1000
this.list = []
......@@ -211,61 +156,76 @@ export default {
}
},
computed: {
watchStatus () {
watchStatus() {
return this.$store.state.user.historyStatus
},
watchCustomerInfo () {
watchCustomerInfo() {
return this.$store.state.user.customerInfo
},
shopMerchantId () {
shopMerchantId() {
return uni.$storage.get('userInfo').shopMerchantId
},
channelType () {
channelType() {
const { channelType } = uni.$storage.get('userInfo')
return channelType
},
}
},
mounted () {
mounted() {
if (this.show) this.init()
},
methods: {
init () {
init() {
// this.customerInfo = this.watchCustomerInfo
// if (!this.customerInfo.carModel && !this.isByd) this.$refs.carBrandListVisible.autoSelect()
// else
this.search()
// else
this.search()
},
search () {
search() {
if (this.list.length == 0) {
this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
this.isEnd = true
}
if (this.pageNum == 1) this.getQuotationList()
},
async getQuotationList () {
getPreviousDate(days) {
let date = new Date()
date.setDate(date.getDate() - days)
// 格式化日期为 YYYY-MM-DD
let year = date.getFullYear()
let month = String(date.getMonth() + 1).padStart(2, '0')
let day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
async getQuotationList() {
const { shopMerchantId, pageNum, pageSize, merchantOrder } = this,
carModel = this.customerInfo.carModel
try {
uni.showLoading({
mask: true
});
})
let params = {
merchantId: shopMerchantId,
pageNum,
pageSize,
carModel:carModel || '',
carModel: carModel || '',
orderStatus: 3,
merchantOrder
}
let { list, total } = await uni.$api.boutiqueApi.getQuotationList(params);
uni.hideLoading();
if (!params.merchantOrder) {
delete params.merchantId
params.maxCreateTime = dayjs(Date.now()).format('YYYY-MM-DD HH:mm:ss')
params.minCreateTime = dayjs(Date.now() - 90 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
}
let { list, total } = await uni.$api.boutiqueApi.getOrderList(params)
uni.hideLoading()
this.list = [...(pageNum == 1 ? [] : this.list), ...list];
this.list = [...(pageNum == 1 ? [] : this.list), ...list]
let previousCreatedTime = null
let _list = []
this.list.map(e => {
let createdTime = dayjs(e.createdTime).format("YYYY年MM月DD日")
let createdTime = dayjs(e.createdTime).format('YYYY年MM月DD日')
if (createdTime !== previousCreatedTime) {
_list.push({
title: createdTime,
......@@ -276,22 +236,22 @@ export default {
})
_list.map(e => {
this.list.map(i => {
let createdTime = dayjs(i.createdTime).format("YYYY年MM月DD日")
let createdTime = dayjs(i.createdTime).format('YYYY年MM月DD日')
if (e.title === createdTime) e.list.push(i)
})
})
this.formatList = list
this.flag = true;
this.total = total;
this.flag = true
this.total = total
if (!carModel && this.pageNum == 1 && this.list.length) uni.setStorageSync(`${shopMerchantId}-historyList`, this.list)
} catch (error) {
uni.hideLoading()
this.flag = true;
this.flag = true
this.isEnd = true
if (!carModel && this.pageNum == 1) this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
}
},
pageonReachBottom () {
pageonReachBottom() {
this.isEnd = false
let { pageNum, total, isEnd, pageSize } = this
if (!isEnd) isEnd = false
......@@ -301,13 +261,13 @@ export default {
} else this.isEnd = true
},
// 脱敏
nameHide (name) {
nameHide(name) {
return name.substring(0, 1) + '*'
},
accDiv (val) {
accDiv(val) {
return utils.accDiv(val || 0, 100)
},
handleSelect (item, popkey) {
handleSelect(item, popkey) {
this.$refs[popkey].close()
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
......@@ -318,17 +278,17 @@ export default {
this.pageNum = 1
this.getQuotationList()
},
showPopup (e, index) {
showPopup(e, index) {
this.focusIndex = index
this.$refs[e].open()
},
closeAllPopup () {
closeAllPopup() {
this.$refs.carBrandListVisible.close()
this.resetFocusIndex()
},
resetFocusIndex () {
resetFocusIndex() {
this.focusIndex = -1
},
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!