Commit 081d1880 by 李伟康

commit 提交

1 parent 746181f1
...@@ -2,23 +2,24 @@ import http from "../request/http"; ...@@ -2,23 +2,24 @@ import http from "../request/http";
module.exports = { module.exports = {
/**获取APP更新 */ /**获取APP更新 */
findSoureList(data) { findSoureList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList', method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
projectName: "boutique", projectName: "boutique",
...data, ...data,
}); });
}, },
/** 查当前4s商户下商户券 */ /** 查询可发放礼券-分页查询商户券列表 */
findCouponList(data) { findCouponList (data) {
return http.post({ return http.post({
method: 'dj.api.smartCarLife.merchant.coupon.list', method: 'dj.api.smartcarlife.merchantCoupon.pageForZYApp',
projectName: "boutique", projectName: "boutique",
onlyUsable: true,
...data, ...data,
}); });
}, },
/**查询用户是否领券 */ /**查询用户是否领券 */
findCustomerReceivedStatus(data) { findCustomerReceivedStatus (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customerCoupon.page', method: 'dj.api.smartcarlife.customerCoupon.page',
projectName: "boutique", projectName: "boutique",
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view <view
class="pop-tips" class="pop-tips"
v-else v-else
>检测到“{{sceneType == 0 ? '交车通知书':'精品加装服务说明页'}}”中未填写客户档案,请填写后再完成接待。</view> >{{tips}}</view>
</template> </template>
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
:key="index" :key="index"
> >
<view class="label">{{ i.label }}</view> <view class="label">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) }]"> <view :class="['value', { error: showError(i.key) },{disabled:customerType == 0}]">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input <input
:type="i.inputType" :type="i.inputType"
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
v-model="formData[i.key]" v-model="formData[i.key]"
class="input" class="input"
:placeholder="i.placeholder" :placeholder="i.placeholder"
placeholder-class="placeholder" :disabled="customerType == 0"
/> />
</template> </template>
<template v-else> <template v-else>
...@@ -102,6 +102,36 @@ import Employee from '@/components/Employee.vue' ...@@ -102,6 +102,36 @@ import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
const phoneRex = /^[1]([3-9])[0-9]{9}$/; const phoneRex = /^[1]([3-9])[0-9]{9}$/;
const formObject_boutique = [{
label: "车主姓名",
key: "customerName",
type: "input",
inputType: "text",
maxlength: 50,
placeholder: '请输入姓名'
},
{
label: "车型",
key: "carModel",
type: "select",
popKey: "carBrandListVisible",
placeholder: '请选择车型'
},
{
label: "车主电话",
key: "phoneNumber",
type: "input",
inputType: "tel",
maxlength: 11,
placeholder: '请输入电话'
},
{
label: "交付专员",
key: "staffName",
type: "select",
popKey: "employeeBoxVisible",
placeholder: '请选择交付专员'
},]
export default { export default {
components: { Employee, CarBrands }, components: { Employee, CarBrands },
name: 'FinishStep', name: 'FinishStep',
...@@ -109,6 +139,10 @@ export default { ...@@ -109,6 +139,10 @@ export default {
sceneType: { sceneType: {
type: Number, type: Number,
default: 0 default: 0
},
customerType: {
type: Number,
default: 1
} }
}, },
data () { data () {
...@@ -174,6 +208,12 @@ export default { ...@@ -174,6 +208,12 @@ export default {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
tips () {
let { sceneType } = this,
text = '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。'
if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。'
return text
}
}, },
watch: { watch: {
watchStatus: { watchStatus: {
...@@ -196,6 +236,8 @@ export default { ...@@ -196,6 +236,8 @@ export default {
return this.errorTip && flag return this.errorTip && flag
}, },
showPopup (e) { showPopup (e) {
let {customerType} = this
if(customerType == 0) return
this.$refs[e].open(); this.$refs[e].open();
}, },
// 取消 // 取消
...@@ -257,16 +299,26 @@ export default { ...@@ -257,16 +299,26 @@ export default {
}, },
open () { open () {
this.$store.dispatch('getCustomerInfo').then((customerInfo) => { this.$store.dispatch('getCustomerInfo').then((customerInfo) => {
let { sceneType } = this
this.errorTip = false
this.receptionStatus = sceneType == 0 ? -1 : 1 //精品默认1
this.formData = customerInfo this.formData = customerInfo
let step = sceneType == 0 ? Object.values(customerInfo).every((value) => !!value) ? 2 : 1 : 1 let { sceneType, customerType } = this,
receptionStatus = -1,
step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1
this.errorTip = false
if (sceneType == 1) {
if (customerType == 0 && !this.check()) return uni.showToast({
title: '请选择回店客户',
icon: 'none'
})
receptionStatus = 1 //精品默认1
step = 1
this.formObject = formObject_boutique
}
if (step == 2 && !this.check()) { if (step == 2 && !this.check()) {
this.errorTip = true this.errorTip = true
step = 1 step = 1
} }
this.step = step this.step = step
this.receptionStatus = receptionStatus
this.$refs.formRef.open() this.$refs.formRef.open()
}) })
}, },
...@@ -341,6 +393,10 @@ export default { ...@@ -341,6 +393,10 @@ export default {
border: none !important; border: none !important;
outline: none; outline: none;
padding: 0 !important; padding: 0 !important;
font-size: 30rpx;
&::placeholder {
color: #c9c9c9;
}
} }
.select { .select {
display: flex; display: flex;
...@@ -354,6 +410,9 @@ export default { ...@@ -354,6 +410,9 @@ export default {
color: #c9c9c9; color: #c9c9c9;
} }
} }
.disabled{
background: #f4f4f4;
}
} }
} }
.choose-box { .choose-box {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
@input="inputCustomer" @input="inputCustomer"
:placeholder="i.placeholder" :placeholder="i.placeholder"
@focus="focusIndex = index" @focus="focusIndex = index"
@blur="focusIndex = -1" @blur="resetFocusIndex"
/> />
</template> </template>
<template v-else> <template v-else>
...@@ -88,13 +88,13 @@ ...@@ -88,13 +88,13 @@
<car-brands <car-brands
ref="carBrandListVisible" ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')" @select="handleSelect($event,'carBrandListVisible')"
@close="focusIndex = -1" @close="resetFocusIndex"
/> />
<employee <employee
ref="employeeBoxVisible" ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')" @select="handleSelect($event,'employeeBoxVisible')"
title="交付人员" title="交付人员"
@close="focusIndex = -1" @close="resetFocusIndex"
/> />
<MessageBox <MessageBox
ref="couponBoxVisible" ref="couponBoxVisible"
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
:isFooter="false" :isFooter="false"
title="请选择礼券类型" title="请选择礼券类型"
:maxHeight="1000" :maxHeight="1000"
@close="focusIndex = -1" @close="resetFocusIndex"
> >
<view class="select-box"> <view class="select-box">
<view <view
...@@ -129,6 +129,8 @@ ...@@ -129,6 +129,8 @@
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import QrBox from './QrBox.vue' import QrBox from './QrBox.vue'
import dayjs from 'dayjs'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
export default { export default {
name: 'Reception', name: 'Reception',
components: { Employee, CarBrands, QrBox }, components: { Employee, CarBrands, QrBox },
...@@ -202,14 +204,14 @@ export default { ...@@ -202,14 +204,14 @@ export default {
methods: { methods: {
init () { init () {
this.qrTimer = null this.qrTimer = null
this.focusIndex = -1 this.resetFocusIndex()
this.findCouponList() this.findCouponList()
}, },
async findCouponList () { async findCouponList () {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo, { shopMerchantId } = userInfo,
couponList = await uni.$api.boutiqueApi.findCouponList({ couponList = await uni.$api.boutiqueApi.findCouponList({
merchantId: shopMerchantId merchantIdList: [shopMerchantId]
}) })
this.couponList = couponList || [] this.couponList = couponList || []
}, },
...@@ -226,7 +228,7 @@ export default { ...@@ -226,7 +228,7 @@ export default {
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name
this.carInfo = item this.carInfo = item
} }
this.focusIndex = -1 this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
}, },
showPopup (e, index) { showPopup (e, index) {
...@@ -237,6 +239,8 @@ export default { ...@@ -237,6 +239,8 @@ export default {
this.$refs.carBrandListVisible.close() this.$refs.carBrandListVisible.close()
this.$refs.employeeBoxVisible.close() this.$refs.employeeBoxVisible.close()
this.$refs.couponBoxVisible.close() this.$refs.couponBoxVisible.close()
this.resetFocusIndex()
this.closeQr()
}, },
chooseCoupon (item) { chooseCoupon (item) {
this.couponId = item.id this.couponId = item.id
...@@ -249,11 +253,7 @@ export default { ...@@ -249,11 +253,7 @@ export default {
async createCoupon () { async createCoupon () {
try { try {
const { couponId, customerInfo, carInfo } = this const { couponId, customerInfo, carInfo } = this
if (!customerInfo.customerName) throw '请输入车主姓名' await this.validate()
if (!customerInfo.phoneNumber) throw '请输入车主手机'
if (!customerInfo.carModel) throw '请选择车型'
if (!customerInfo.staffName) throw '请选择交付专员'
if (!couponId) throw '请选择礼券类型'
uni.showLoading() uni.showLoading()
const { const {
uuid, uuid,
...@@ -281,7 +281,7 @@ export default { ...@@ -281,7 +281,7 @@ export default {
if (code == 0) { if (code == 0) {
if (data) { if (data) {
this.QRURL = data this.QRURL = data
this.checkCustomerReceivedStatus() this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
} }
else throw '生成小程序码失败,请重试!' else throw '生成小程序码失败,请重试!'
} else throw message } else throw message
...@@ -294,10 +294,30 @@ export default { ...@@ -294,10 +294,30 @@ export default {
}) })
} }
}, },
checkCustomerReceivedStatus () { async validate () {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this
// 检查车主姓名
if (!customerName) throw '请输入车主姓名'
// 检查车主手机
if (!phoneNumber) throw '请输入车主手机'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
// 检查车型
if (!carModel) throw '请选择车型'
// 检查交付专员
if (!staffName) throw '请选择交付专员'
// 检查礼券类型
if (!couponId) throw '请选择礼券类型'
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
this.qrTimer = setInterval(async () => { this.qrTimer = setInterval(async () => {
// const res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({}) const { couponId, customerInfo } = this,
if (true) { res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res.total) {
this.received = true this.received = true
this.closeQr() this.closeQr()
setTimeout(() => { setTimeout(() => {
...@@ -309,6 +329,9 @@ export default { ...@@ -309,6 +329,9 @@ export default {
closeQr () { closeQr () {
clearInterval(this.qrTimer) clearInterval(this.qrTimer)
this.qrTimer = null this.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
} }
} }
} }
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
:sceneType="1" :sceneType="1"
:customerType="customerType"
/> />
</view> </view>
</template> </template>
......
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
chooseCustomerType (index) { chooseCustomerType (index) {
const { moduleList } = this const { moduleList } = this
this.customerType = index this.customerType = index
if (index == 0) this.jumpPage(moduleList.at(-1).id) if (index == 0) this.jumpPage(moduleList.at(-1).id) //跳转处理
else this.jumpPage() else this.jumpPage()
}, },
done (e) { done (e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!