Commit 0ee034fe by 李伟康

commit 回店客户流程

1 parent d691d89a
......@@ -65,7 +65,7 @@
>为客户发券</view>
</view>
</template>
<template v-if="customerType == 0 && customerInfo.customerName">
<template v-if="customerType == 0 && customerInfo.phoneNumber">
<view class="customer-info-box">
<view
class="customer-info flex"
......@@ -84,7 +84,14 @@
:key="index"
>
<view class="label">{{i.label}}</view>
<view class="value">{{customerInfo[i.key]}}</view>
<view class="value text-hide">
<template v-if="i.format">
{{i.format(customerInfo)}}
</template>
<template v-else>
{{customerInfo[i.key]}}
</template>
</view>
</view>
</template>
</view>
......@@ -209,7 +216,9 @@ export default {
},
{
label: '领券时间',
key: 'customerName',
format (cell) {
return dayjs(cell.receiveCouponDate).format("YYYY年MM月DD日")
}
},
{
label: '车主电话',
......@@ -217,7 +226,9 @@ export default {
},
{
label: '接待时间',
key: 'customerName',
format () {
return dayjs().format("YYYY年MM月DD日")
}
}
],
customerInfo: {},
......@@ -238,7 +249,7 @@ export default {
watchCustomerInfo: {
immediate: true,
handler (newval) {
if (newval && this.show) this.customerInfo = newval
if (this.show) this.customerInfo = newval
}
},
show (n) {
......@@ -249,6 +260,7 @@ export default {
handler (newval) {
this.pageParams = this.$options.data.call(this).pageParams
this.resetFocusIndex()
this.customerInfo = {}
}
}
},
......@@ -330,15 +342,12 @@ export default {
},
async createCoupon () {
try {
const { pageParams: { couponId, carInfo }, customerInfo } = this
const { pageParams: { couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo")
await this.validate()
uni.showLoading()
const {
uuid,
name,
shopMerchantId
} = uni.$storage.get("userInfo")
let scene = `id=${couponId}&userId=${uuid}&employName=${name}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
let { staffName, salesUuid } = customerInfo
scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
params = {
path: '/packageShopmall/packageMine/pages/boutique/gift/gift',
appId: 'wxe10067a63c1856ac',
......@@ -373,15 +382,8 @@ export default {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName) throw '请输入车主姓名'
// 检查车主手机
if (!phoneNumber) throw '请输入车主手机'
if (!customerName || !phoneNumber || !carModel || !staffName) throw '请输入客户信息'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
// 检查车型
if (!carModel) throw '请选择车型'
// 检查交付专员
if (!staffName) throw '请选择交付专员'
// 检查礼券类型
if (!couponId) throw '请选择礼券类型'
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
......@@ -553,9 +555,9 @@ export default {
width: 50%;
color: #333333;
line-height: 36rpx;
font-size: 28rpx;
.label {
width: 120rpx;
font-size: 28rpx;
color: #666666;
flex-shrink: 0;
margin-right: 24rpx;
......
......@@ -8,13 +8,22 @@
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="24"></uni-icons>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="24"
></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<template v-for="(item, index) in media">
<view :class="['view', { showView: id == item.id }]" :key="index">
<view
:class="['view', { showView: id == item.id }]"
:key="index"
>
<component
:is="componentName(item.id)"
:views="item.receptionSourceDetailList || []"
......@@ -24,6 +33,7 @@
:customerType="customerType"
@jumpPage="jumpPage"
:show="id == item.id"
@reception="reception"
/>
</view>
</template>
......@@ -73,24 +83,24 @@ export default {
},
customerType: Number,
},
data() {
data () {
return {
};
},
computed: {
title() {
title () {
let { id } = this,
name = this.media.find((e) => e.id == id)?.shortTitle || "";
return name;
},
watchStatus() {
watchStatus () {
return this.$store.state.user.historyStatus;
},
},
mounted() {},
mounted () { },
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
componentName(id) {
componentName (id) {
let name = "";
if ([8, 10, 11].includes(id)) name = "membranes";
else
......@@ -101,31 +111,39 @@ export default {
}[id];
return name;
},
open() {
open () {
this.$refs.stepRef.open();
},
/**切换素材 */
choose(e) {
choose (e) {
if (this.id == 7) this.$refs.media7[0].closeAllPopup();
this.$emit("update:id", e.id);
if (e.id == 2 || e.id == 4) {
// console.log(this.$refs[`media${e.id}`][0].$refs)
// this.$refs[`media${e.id}`][0].$refs.tabs.init()
}
this.jumpPage(e.id)
},
back() {
back () {
this.$refs?.toolRef?.hide();
this.$emit("back");
},
done(e) {
done (e) {
this.$refs.toolRef.hide();
this.$refs.stepRef.close();
this.$emit("done", e);
},
jumpPage(id) {
jumpPage (id) {
this.$emit("update:id", Number(id));
},
pageonReachBottom() {},
/**回店客户 */
reception ({ item }) {
console.log(JSON.parse(JSON.stringify(item)))
this.$store.dispatch('setCustomerInfo', {
customerName: item.customerName,
carModel: item.carSeriesName,
phoneNumber: item.customerPhone,
salesUuid: item.userId,
staffName: item.employeeName,
receiveCouponDate:item.receiveCouponDate
})
this.$emit('reception')
},
},
};
</script>
......
......@@ -39,7 +39,8 @@
@back="back"
@done="done"
ref="detail"
:customerType="customerType"
:customerType.sync="customerType"
@reception="reception"
/>
</template>
<template slot="content">
......@@ -70,7 +71,7 @@ export default {
chooseItem: {},
id: '',
type: '',
customerType: 1
customerType: -1
}
},
onBackPress (options) {
......@@ -168,7 +169,7 @@ export default {
this.clearHistory();
this.init();
},
async start () {
async start (before = true) {
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
......@@ -179,8 +180,11 @@ export default {
});
return;
}
this.clearHistory();
this.$refs.customerTypeRef.open()
if (before) {
this.clearHistory();
this.$refs.customerTypeRef.open()
}
this.startAudio();
},
jumpPage (id) {
......@@ -215,6 +219,14 @@ export default {
},
changeTab (index) {
if (index == 0) this.init()
},
/**客户邀约接待 */
reception () {
console.log('?')
let { customerType } = this
if (customerType == -1) this.start(false) //开始接待
this.customerType = 0
this.jumpPage()
}
}
......
......@@ -11,36 +11,40 @@
@blur="input($event)"
@focus="focus"
/>
<view class="input-tips" v-if="!isSearch"
>搜索客户姓名/电话<uni-icons
<view
class="input-tips"
v-if="!isSearch"
>搜索客户姓名/电话<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons
></view>
></uni-icons></view>
</view>
<scroll-view
class="record-box"
scroll-y
@scrolltolower="pageonReachBottom"
@scroll="scroll"
>
<view class="list">
<template v-if="flag">
<template v-if="list.length">
<template v-for="item in list">
<view class="item" :key="item.id">
<view
:class="['status flex', 'status_' + item.inviteStatus]"
>{{ inviteStatus[item.inviteStatus] }}</view
>
<view
class="item"
:key="item.id"
@click="reception(item)"
>
<view :class="['status flex', 'status_' + item.inviteStatus]">{{ inviteStatus[item.inviteStatus] }}</view>
<view class="name">
{{ item.customerName }}
</view>
<template v-for="(k, ind) in itemObject">
<view class="info flex" :key="ind">
<view
class="info flex"
:key="ind"
>
<view class="label">{{ k.label }}</view>
<view class="value">{{ item[k.key] || "-" }}</view>
</view>
......@@ -64,24 +68,29 @@
</template>
</scroll-view>
</view>
<MessageBox
ref="receptionTips"
content="是否接待当前客户,确定接待直接进入\n「精品加装服务说明」"
cancelBtnText="取消"
confirmBtnText="确定接待"
@confirm="jumpPage"
></MessageBox>
</view>
</template>
<script type="text/ecmascript-6">
import Record from "@/mixin/record";
export default {
mixins:[Record],
mixins: [Record],
props: {
customerType: Number,
show: Boolean
},
data () {
return {
customerNameOrPhone:'',
isSearch:false,
list: [{
id:1,
carModel:1,
customerName: '合适的甲方',
receptionStatus:1
}],
inviteStatus:{1:'待邀约',2:'已邀约',3:'取消预约',4:'已施工',5:'超时未到店'},
customerNameOrPhone: '',
isSearch: false,
list: [],
inviteStatus: { 1: '待邀约', 2: '已邀约', 3: '取消预约', 4: '已施工', 5: '超时未到店' },
itemObject: [
{ label: '客户电话', key: 'customerPhone' },
{ label: '客户车型', key: 'carBrand' },
......@@ -89,9 +98,15 @@ export default {
{ label: '领券时间', key: 'receiveCouponDate' },
{ label: '销售顾问', key: 'employeeName' },
],
chooseItem: {}
}
},
watch: {
show (n) {
if (n) this.getRecordList()
}
},
mounted() {
mounted () {
this.getRecordList()
},
methods: {
......@@ -104,30 +119,37 @@ export default {
this.getRecordList()
} else this.nothing = true
},
input(e) {
this.customerNameOrPhone = e.detail.value
if(this.customerNameOrPhone == '')
input (e) {
this.customerNameOrPhone = e.detail.value
if (this.customerNameOrPhone == '')
this.isSearch = false
this.pageNum = 1
this.getRecordList()
this.pageNum = 1
this.getRecordList()
},
focus() {
focus () {
this.isSearch = true
},
getRecordList() {
const { pageNum, pageSize,customerNameOrPhone } = this,
userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
this.getList('customerInviteRecordPage',{
merchantId: [shopMerchantId],
pageNum,
pageSize,
customerNameOrPhone,
})
}
getRecordList () {
const { pageNum, pageSize, customerNameOrPhone } = this,
userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
this.getList('customerInviteRecordPage', {
merchantId: [shopMerchantId],
pageNum,
pageSize,
customerNameOrPhone,
})
},
reception (item) {
this.chooseItem = item
this.$refs.receptionTips.open()
},
jumpPage () {
this.$emit('reception', {
item: this.chooseItem
})
}
},
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!