Commit b5583f9d by 李伟康

style(api): 优化api模块代码格式并新增功能接口

- 调整env.js中环境索引值从2改为1
- 统一boutique.js中所有函数声明格式,去除空格
- 在customerApi.js中统一函数声明格式并新增多个sop任务相关接口
- 为dailyTemplateApi.js添加客户计划到店统计功能接口
- 更新sprite.scss中图标定位坐标优化显示效果
- 新增活动产品列表、sop任务管理等多个api接口功能
1 parent c6494465
......@@ -3,7 +3,7 @@ import environment from '@/env'
module.exports = {
/**查询当前门店是否有客户档案权限 */
haveCustomerAccess (data) {
haveCustomerAccess(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findPermissionsMerchantList',
projectName: 'boutique',
......@@ -11,7 +11,7 @@ module.exports = {
})
},
/**查询当前门店客户档案列表 */
getCustomerFileList (data) {
getCustomerFileList(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoPage',
projectName: 'boutique',
......@@ -19,7 +19,7 @@ module.exports = {
})
},
/* 删除客户档案*/
delCustomerFile (data) {
delCustomerFile(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.deleteVisitsInfo',
projectName: 'boutique',
......@@ -27,7 +27,7 @@ module.exports = {
})
},
/** 根据业务查询接待场景 */
findAllSence (data) {
findAllSence(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findAllSence',
projectName: 'boutique',
......@@ -35,7 +35,7 @@ module.exports = {
})
},
/**根据业务查询客户标签 */
findCustomerTags (data) {
findCustomerTags(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findSenceTag',
projectName: 'boutique',
......@@ -45,7 +45,7 @@ module.exports = {
/**
* 查询客户档案详情
*/
findVisitsInfo (data) {
findVisitsInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findVisitsInfo',
projectName: 'boutique',
......@@ -55,7 +55,7 @@ module.exports = {
/*
* 保存客户档案
*/
saveVisitsInfo (data) {
saveVisitsInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.saveVisitsInfo',
projectName: 'boutique',
......@@ -65,7 +65,7 @@ module.exports = {
/**
* 更新客户档案
*/
updateVisitsInfo (data) {
updateVisitsInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.updateVisitsInfo',
projectName: 'boutique',
......@@ -73,7 +73,7 @@ module.exports = {
})
},
/**查询客户档案列表 */
getCustomerInfoList (data) {
getCustomerInfoList(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoList',
projectName: 'boutique',
......@@ -83,7 +83,7 @@ module.exports = {
/**接待客户素材
*
*/
getMaterialResponsePage (data) {
getMaterialResponsePage(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialResponsePage',
projectName: 'boutique',
......@@ -91,7 +91,7 @@ module.exports = {
})
},
/**素材详情 查询素材详情 */
getMaterialDetail (data) {
getMaterialDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialById',
projectName: 'boutique',
......@@ -99,11 +99,51 @@ module.exports = {
})
},
/**直营驻店人员 */
saleOpen (data) {
saleOpen(data) {
return http.post({
method: 'dj.api.car.boutique.resident.direct.sale.merchant',
projectName: 'boutique',
...data
})
},
/**
* 查询今日待执行触达客户
*/
getTodaySopTaskCustomerPage(data) {
return http.post({
method: 'dj.pad.api.today.sop.task.customer.page',
projectName: 'pad',
...data
})
},
/**
* 查询近7天已触达客户
*/
getLastWeekSopTaskCustomerPage(data) {
return http.post({
method: 'dj.pad.api.last.week.sop.task.customer.page',
projectName: 'pad',
...data
})
},
/**
* 查询客户今日未触达任务列表
*/
getTodaySopTaskDetailList(data) {
return http.post({
method: 'dj.pad.api.today.sop.task.detail.list',
projectName: 'pad',
...data
})
},
/**
* 查询客户近7天推送任务记录列表
*/
getLastWeekSopTaskDetailList(data) {
return http.post({
method: 'dj.pad.api.last.week.sop.task.detail.list',
projectName: 'pad',
...data
})
}
}
......@@ -128,6 +128,26 @@ const getStoreBaseSceneCodeList = async (data = {}) => {
...data
})
}
/**
* 统计客户今日计划到店数
*/
const getTodayPlanStoreCount = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.customer.todayPlanStore.count',
projectName: 'boutique',
...data
})
}
/**
* 查询客户今日计划到店列表
*/
const getTodayPlanStoreList = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.customer.todayPlanStore.list',
projectName: 'boutique',
...data
})
}
module.exports = {
getDailyTemplate,
......@@ -140,5 +160,7 @@ module.exports = {
submitReport,
getGoodsOrderList,
getStaffBaseSceneCodeList,
getStoreBaseSceneCodeList
getStoreBaseSceneCodeList,
getTodayPlanStoreCount,
getTodayPlanStoreList
}

3.23 MB | W: | H:

3.24 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -15,7 +15,7 @@
<template v-if="item.block">
<view :class="['block', item.status == 1 ? 'success' : 'failed']">{{ item.content }}</view>
</template>
<text v-else>{{ item.content }}</text>
<text v-else>{{ options.data[item.key] }}</text>
</view>
</view>
</template>
......@@ -38,18 +38,19 @@ import TaskItem from './TaskItem.vue'
export default {
components: { TaskItem },
name: 'CustomerPopup',
inject: ['userInfo'],
data() {
return {
options: {},
customerObject: [
{ title: '客户姓名', content: '张三' },
{ title: '手机号码', content: '一级' },
{ title: '车型', content: '朋友介绍' },
{ title: '客户群', content: '潜在客户' },
{ title: '订单状态', content: '潜在客户', block: true, status: 1 },
{ title: '订单时间', content: '潜在客户' },
{ title: '客户姓名', key: 'customerName' },
{ title: '手机号码', key: 'customerPhone' },
{ title: '车型', key: 'carSeriesName' },
{ title: '客户群', key: 'qwGroupName' },
{ title: '订单状态', key: 'customerStatus', block: true },
{ title: '订单时间', key: 'orderHandleTime' },
],
taskList: new Array(10).fill({})
taskList: []
}
},
watch: {},
......@@ -82,13 +83,28 @@ export default {
mounted() { },
methods: {
open(options) {
console.log(options)
uni.showLoading({
mask: true,
title: '加载中...'
})
this.options = options
this.$refs.popup.open()
this.getData(options)
},
close() {
this.$refs.popup.close()
}
},
async getData(options) {
let { shopMerchantId: merchantId } = this.userInfo,
targetApi = {
task: 'getTodaySopTaskDetailList',
taskRecord: 'getLastWeekSopTaskDetailList'
}[options.type],
{ customerInstanceId } = options.data,
data = await uni.$api.customerApi[targetApi]({ merchantId, customerInstanceId })
uni.hideLoading()
this.taskList = data
this.$refs.popup.open()
},
}
}
</script>
......@@ -186,6 +202,7 @@ export default {
height: calc(100% - #{toRpx(484)});
box-sizing: border-box;
}
.p-b {
height: 28rpx;
}
......
<template>
<view class="nothing-box">
<image
class="icon"
:src="require('@/assets/images/common/noData.webp')"
/>
<text class="text">{{ text }}</text>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Nothing',
props: {
text: {
type: String,
default: '暂无数据'
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.nothing-box {
width: 100%;
height: calc(100% - #{toRpx(72)});
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
width: 300rpx;
height: 236rpx;
margin-bottom: 8rpx;
}
.text {
font-size: 24rpx;
line-height: 28rpx;
color: #999;
}
}
</style>
\ No newline at end of file
......@@ -6,16 +6,16 @@
向客户群发送消息
<template v-if="type == 'taskRecord'">
<view class="line"></view>
文本
{{ messageType(item.messageType) }}
</template>
</view>
<view class="btn-box flex">
<template v-if="type == 'task'">
<template v-if="item.taskStatus == 0">
<view class="btn primary-btn">立即推送</view>
<view class="btn">暂不推送</view>
</template>
<template v-else>
<view :class="['status flex', { success: item.status != 1 }]">已推送</view>
<view :class="['status flex', { success: item.taskStatus == 1 }]">{{ taskStatus(item.taskStatus) }}</view>
</template>
</view>
</view>
......@@ -36,7 +36,22 @@ export default {
watch: {},
computed: {},
mounted() { },
methods: {}
methods: {
messageType(type){
return {
1: '文本',
2: '图片',
3: '视频',
4: '网页链接',
}[type]
},
taskStatus(status){
return {
1: '已推送',
2: '暂不推送',
}[status]
}
}
}
</script>
<style scoped lang='scss'>
......
......@@ -18,7 +18,7 @@
</template>
</view>
<view class="customer-content">
<Table :type="tabIndex" @openPopup="openPopup" />
<Table :type="tabIndex" @openPopup="openPopup" @loadMore="loadMore" :list="tableData" ref="table" />
</view>
<CustomerPopup ref="customerPopup" />
</view>
......@@ -30,19 +30,45 @@ import CustomerPopup from './components/CustomerPopup'
export default {
name: 'CustomerOpportunities',
components: { Table, CustomerPopup },
inject: ['userInfo'],
props: {
show: Boolean
},
data() {
return {
tabIndex: 0,
tabs: ['待执行推送客户(12)', '近7日已推送客户(18)'],
toDay: dayjs().format('MM-DD')
tabs: ['待执行推送客户(0)', '近7日已推送客户(0)'],
toDay: dayjs().format('MM-DD'),
total: 0,
pageNum: 1,
pageSize: 10,
tableData: []
}
},
watch: {
show: {
handler(val) {
if (val) {
this.getTodaySopTaskCustomerPage()
this.getLastWeekSopTaskCustomerPage(false)
} else this.initRequestParams()
},
immediate: true,
deep: true
}
},
watch: {},
computed: {},
computed: {
},
mounted() {
},
methods: {
initRequestParams() {
this.pageNum = 1
this.pageSize = 10
this.tableData = []
this.$refs.table.loadComplete = false
this.$refs.table.noMore = false
},
/**
* 切换标签
* @param {number} index
......@@ -50,9 +76,52 @@ export default {
changeTab(index) {
if (index == this.tabIndex) return
this.tabIndex = index
this.initRequestParams()
if (index == 0) this.getTodaySopTaskCustomerPage()
else this.getLastWeekSopTaskCustomerPage()
},
openPopup(data) {
this.$refs.customerPopup.open(data)
},
loadMore() {
let { total, pageSize, pageNum, tabIndex } = this
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
if (tabIndex == 0) this.getTodaySopTaskCustomerPage()
else this.getLastWeekSopTaskCustomerPage()
} else this.$refs.table.noMore = true
},
async getTodaySopTaskCustomerPage() {
try {
uni.showLoading({ title: '加载中' })
let { shopMerchantId: merchantId } = this.userInfo,
{ pageNum, pageSize, tableData } = this,
{ list, total } = await uni.$api.customerApi.getTodaySopTaskCustomerPage({ merchantId, pageNum, pageSize })
this.tableData = [...tableData, ...list]
this.$refs.table.loadComplete = true
this.total = total
if (total) this.$set(this.tabs, 0, `待执行推送客户(${total})`)
uni.hideLoading()
} catch (error) {
this.$refs.table.loadComplete = true
}
},
async getLastWeekSopTaskCustomerPage(assignment = true) {
try {
if (assignment) uni.showLoading({ title: '加载中' })
let { shopMerchantId: merchantId } = this.userInfo,
{ pageNum, pageSize, tableData } = this,
{ list, total } = await uni.$api.customerApi.getLastWeekSopTaskCustomerPage({ merchantId, pageNum, pageSize })
if (assignment) {
this.tableData = [...tableData, ...list]
this.$refs.table.loadComplete = true
this.total = total
uni.hideLoading()
}
if (total) this.$set(this.tabs, 1, `近7日已推送客户(${total})`)
} catch (error) {
this.$refs.table.loadComplete = true
}
}
}
}
......
......@@ -114,7 +114,7 @@
</view>
<!-- 挖掘潜客机会 -->
<view v-show="homeContentTabIndex === 2" class="right-content-box flex right-content-box-scene1 customer-opportunities-box">
<customer-opportunities />
<customer-opportunities :show="homeContentTabIndex === 2" />
</view>
</view>
......@@ -425,7 +425,8 @@ export default {
provide() {
return {
showPage: this.handleShowPage,
hideFooter: this.handleFooter
hideFooter: this.handleFooter,
userInfo: this.userInfo,
}
},
computed: {
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2
const index = 1
/**
*
0本地
......
......@@ -4,7 +4,8 @@
<template v-if="currentDate">
<view class="box">
<view class="popup-title flex">
{{ userInfo.name }}的待接待客户
<view class="text text-hide"> {{ userInfo.name }}</view>
的待接待客户
<view class="popup-close flex" @click="close">
<uni-icons type="closeempty" size="16"></uni-icons>
</view>
......@@ -115,7 +116,6 @@ export default {
this.loadComplete = false
this.customerList = []
if (val) this.getCustomerList()
},
deep: true
}
......@@ -128,57 +128,24 @@ export default {
title: '加载中...',
mask: true
})
setTimeout(() => {
this.customerList = [
{
customerName: '张宇',
customerPhone: '138****1234',
carSeriesName: '问界M7 Plus',
inviteDate: '2026-06-20',
advanceUserName: '张三',
advanceUserId: '123456',
selected: false,
carBrandId: '车辆品牌id',
carBrand: '车辆品牌名称',
carChildsBrandId: '子品牌id',
carChildsBrandName: '子品牌名字',
carSeriesId: '车系id',
carSeriesName: '车系名字'
},
{
customerName: '迪丽热巴·迪丽热巴',
customerPhone: '138****1234',
carSeriesName: '问界M7',
advanceUserName: '张三',
advanceUserId: '123456',
inviteDate: '2026-06-10',
selected: false,
carBrandId: '车辆品牌id',
carBrand: '车辆品牌名称',
carChildsBrandId: '子品牌id',
carChildsBrandName: '子品牌名字',
carSeriesId: '车系id',
carSeriesName: '车系名字'
},
{
customerName: '黄小小',
customerPhone: '138****9239',
carSeriesName: '问界M7',
advanceUserName: '张三',
advanceUserId: '123456',
inviteDate: '2026-06-10',
selected: false,
carBrandId: '车辆品牌id',
carBrand: '车辆品牌名称',
carChildsBrandId: '子品牌id',
carChildsBrandName: '子品牌名字',
carSeriesId: '车系id',
carSeriesName: '车系名字'
},
]
try {
const { uuid, shopMerchantId } = this.userInfo,
data = await uni.$api.dailyTemplateApi.getTodayPlanStoreList({
merchantId: shopMerchantId,
advanceUserId: uuid,
inviteDate: this.currentDate.format('YYYY-MM-DD')
})
console.log(data)
this.customerList = data.map(item => ({
...item,
selected: false
}))
this.loadComplete = true
uni.hideLoading()
}, 1000)
} catch (error) {
uni.hideLoading()
console.log(error)
}
},
open() {
this.currentDate = dayjs()
......@@ -258,6 +225,10 @@ export default {
font-weight: 500;
line-height: 48rpx;
.text {
max-width: 50%;
}
.popup-close {
position: absolute;
height: 100%;
......
......@@ -6,7 +6,7 @@
<view class="fixed-box flex">
<view class="fixed-title flex">
<view class="sprite-icon icon-negotiation-detail-count"></view>
今日待接待客户数<text class="text-primary">5</text>
今日待接待客户数<text class="text-primary">{{ customerCount }}</text>
</view>
<view class="fixed-btn flex" @click="$refs.CustomerDrawer.open()">
查看客户
......@@ -62,10 +62,11 @@ import Footer from '../components/Footer'
import utils from '@/utils/utils'
import EditForm from '../components/EditForm'
import CustomerDrawer from './components/CustomerDrawer'
import dayjs from 'dayjs'
export default {
components: { Table, Nothing, Footer, EditForm, CustomerDrawer },
name: 'edit',
inject: ['sceneType'],
inject: ['sceneType', 'userInfo'],
props: {
templateData: {
type: Array,
......@@ -77,7 +78,8 @@ export default {
return {
loadComplete: false,
list: [],
saveBtn: true
saveBtn: true,
customerCount: 0
}
},
watch: {
......@@ -87,6 +89,7 @@ export default {
this.list = utils.deepClone(val)
setTimeout(() => {
this.loadComplete = true
this.getTodayPlanStoreCount()
}, 200)
},
immediate: true,
......@@ -110,6 +113,19 @@ export default {
mounted() {
},
methods: {
async getTodayPlanStoreCount() {
try {
const { uuid, shopMerchantId } = this.userInfo,
data = await uni.$api.dailyTemplateApi.getTodayPlanStoreCount({
merchantId: shopMerchantId,
advanceUserId: uuid,
inviteDate: dayjs().format('YYYY-MM-DD')
})
this.customerCount = data
} catch (error) {
console.log(error)
}
},
handleRowClick(row, rowIndex, index) {
let parent = this.list[index]
this.$refs.editForm.open(row, rowIndex, index, parent)
......
......@@ -2,7 +2,7 @@
<view class="nothing-box">
<image
class="icon"
:src="require('@//assets/images/common/noData.webp')"
:src="require('@/assets/images/common/noData.webp')"
/>
<text class="text">{{ text }}</text>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!