Commit c34c7862 by 李伟康

```

feat(usedCar): 新增二手车相关接口与日报功能

- 新增 usedCarApi 模块,提供二手车驻店日报的增删改查接口
- 在 interceptionApi 中增加二手车员工入职及日报填写状态校验接口
- 新增 DailyReport 组件支持二手车日报填写、展示与限制逻辑
- 调整 HomeFrame 页面图标与跳转逻辑,支持二手车场景
- 优化日报填写字段和提交逻辑,限制输入范围并增加超期提示
- 增加 signHttp 请求超时配置,提升接口稳定性
```
1 parent 0498f384
...@@ -9,6 +9,8 @@ import receptionApi from './receptionApi' ...@@ -9,6 +9,8 @@ import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi' import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi' import interceptionApi from './interceptionApi'
import popupApi from './popupApi' import popupApi from './popupApi'
import usedCarApi from './usedCar'
module.exports = { module.exports = {
commonApi, commonApi,
systemApi, systemApi,
...@@ -20,5 +22,6 @@ module.exports = { ...@@ -20,5 +22,6 @@ module.exports = {
sceneMarketApi, sceneMarketApi,
interceptionApi, interceptionApi,
popupApi, popupApi,
evaluationApi evaluationApi,
usedCarApi
} }
import http from '../request/http' import http from '../request/http'
import signHttp from '../request/signHttp'
module.exports = { module.exports = {
/** 查询该店员工日报是否开启 */ /** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid (data) { staffDailyReportMerchantValid (data) {
...@@ -27,5 +27,22 @@ module.exports = { ...@@ -27,5 +27,22 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 二手车查询员工昨天是否新入职或调店
*/
checkUsedCarStaffIsNew (data) {
return http.post({
method: 'dj.api.smartcarlife.secondHandCar.staffDailyReport.popup.need',
projectName: 'boutique',
...data
})
},
/**
* 查询员工是否需要填写二手车日报
*/
checkUsedCarStaffDailyReportValid (data) {
return signHttp.post('/carDailyReport/yesterday/check', {
...data
})
},
} }
import { add } from 'lodash'
import http from '../request/signHttp'
module.exports = {
/** 二手车驻店日报列表 */
getCarDailyReportList(data) {
return http.post('/carDailyReport/list', {
...data
})
},
/**
* 新增二手车驻店日报
*/
addCarDailyReport(data) {
return http.post('/carDailyReport/add', {
...data
})
},
/**
* 二手车驻店日报详情
*/
getCarDailyReportDetail(data) {
return http.post('/carDailyReport/detail', {
...data
})
},
/**
* 修改二手车驻店日报
*/
editCarDailyReport(data) {
return http.post('/carDailyReport/edit', {
...data
})
},
}
...@@ -20,6 +20,7 @@ function createRequestInstance() { ...@@ -20,6 +20,7 @@ function createRequestInstance() {
params: { params: {
sessionId sessionId
}, },
timeout: 30000,
response: { response: {
code_key: 'code', code_key: 'code',
code_success_value: '0', code_success_value: '0',
......
No preview for this file type
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
7: { 7: {
title: '二手车', title: '二手车',
describe: '二手车业务', describe: '二手车业务',
icon: 'icon-scene-5', icon: 'icon-scene-7',
zoom: 1.1669, zoom: 1.1669,
} }
......
<template> <template>
<view class="container" @click="handleTouchStart"> <view
class="container"
@click="handleTouchStart"
>
<view :class="['home', { show: !id && showHome }]"> <view :class="['home', { show: !id && showHome }]">
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="changeTab" @stopAudio="stopAudio" @showReadCountTips="showReadCountTips" @closeTips="closeTips" /> <left-side
<view class="tips-box" :style="tipsObject.style" @click.stop="closeTips">{{ tipsObject.text }}</view> :userInfo="userInfo"
:tabIndex.sync="tabIndex"
ref="leftBox"
@changeTab="changeTab"
@stopAudio="stopAudio"
@showReadCountTips="showReadCountTips"
@closeTips="closeTips"
/>
<view
class="tips-box"
:style="tipsObject.style"
@click.stop="closeTips"
>{{ tipsObject.text }}</view>
<view class="right-side"> <view class="right-side">
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]"> <view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]">
<view class="start" @click="start"> <view
class="start"
@click="start"
>
<template v-if="sceneType != 4"> <template v-if="sceneType != 4">
<view class="sprite-icon icon-start-text"></view> <view class="sprite-icon icon-start-text"></view>
</template> </template>
...@@ -15,7 +33,14 @@ ...@@ -15,7 +33,14 @@
<view class="module-box box-class"> <view class="module-box box-class">
<view class="common-title">产品介绍</view> <view class="common-title">产品介绍</view>
<view class="content-box"> <view class="content-box">
<swiper-component :moduleList="moduleList" @click="swiperClick" :stopAutoPlay="previewOff" :imgKey="bannerKey" :loadComplete="loadComplete" :noDataObject="swiperNoDataObject"></swiper-component> <swiper-component
:moduleList="moduleList"
@click="swiperClick"
:stopAutoPlay="previewOff"
:imgKey="bannerKey"
:loadComplete="loadComplete"
:noDataObject="swiperNoDataObject"
></swiper-component>
</view> </view>
</view> </view>
<view class="tool-box box-class"> <view class="tool-box box-class">
...@@ -28,19 +53,36 @@ ...@@ -28,19 +53,36 @@
<view class="content-right box-class"> <view class="content-right box-class">
<view class="common-title">服务中心</view> <view class="common-title">服务中心</view>
<view class="content-box"> <view class="content-box">
<MessageIndex class="message-box" ref="messageRef" /> <MessageIndex
class="message-box"
ref="messageRef"
/>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 99 }]"> <view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 99 }]">
<component :is="'Point'" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" /> <component
:is="'Point'"
ref="pointRef"
:userInfo="userInfo"
@showPage="handleShowPage"
/>
</view> </view>
<template v-if="tabIndex != 0 && tabIndex != 99"> <template v-if="tabIndex != 0 && tabIndex != 99">
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" :isPermissionFunction="isPermission" /> <component
:is="componentName"
ref="pointRef"
:userInfo="userInfo"
@showPage="handleShowPage"
:isPermissionFunction="isPermission"
/>
</template> </template>
</view> </view>
<view class="store-addr" v-if="footerBox"> <view
class="store-addr"
v-if="footerBox"
>
<view class="icon-addr sprite-icon icon-addr"></view> <view class="icon-addr sprite-icon icon-addr"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view> <view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view> </view>
...@@ -48,17 +90,41 @@ ...@@ -48,17 +90,41 @@
<view :class="['detail', { show: id }]"> <view :class="['detail', { show: id }]">
<slot name="detail" /> <slot name="detail" />
</view> </view>
<view class="point-page" v-if="!showHome"> <view
<component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" /> class="point-page"
v-if="!showHome"
>
<component
:is="pointComponentName"
@backHome="backHome"
@jump="jump"
:transfer="transfer"
/>
</view> </view>
<!-- 未点击开始接待,弹窗 --> <!-- 未点击开始接待,弹窗 -->
<MessageBox ref="previewRef" @confirm="previewHandler('preview', true)" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="previewHandler('previewCancel')" @close="previewHandler('previewClose')"></MessageBox> <MessageBox
ref="previewRef"
@confirm="previewHandler('preview', true)"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
@cancel="previewHandler('previewCancel')"
@close="previewHandler('previewClose')"
></MessageBox>
<!-- 停留弹框 --> <!-- 停留弹框 -->
<!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> --> <!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> -->
<!-- 退出弹框 --> <!-- 退出弹框 -->
<MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false"> <MessageBox
:popupW="704"
ref="finish"
:content="finishContene"
:isFooter="false"
>
<view class="footer"> <view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')"> <view
class="footer-btn confirm flex"
@click="$emit('openStep')"
>
<template v-if="finishDoneText"> <template v-if="finishDoneText">
{{ finishDoneText }} {{ finishDoneText }}
</template> </template>
...@@ -67,7 +133,10 @@ ...@@ -67,7 +133,10 @@
<text>(推荐)</text> <text>(推荐)</text>
</template> </template>
</view> </view>
<view class="footer-btn cancel flex" @click="$emit('backHome')"> <view
class="footer-btn cancel flex"
@click="$emit('backHome')"
>
仍要退出 仍要退出
<text>(不推荐)</text> <text>(不推荐)</text>
</view> </view>
...@@ -76,7 +145,11 @@ ...@@ -76,7 +145,11 @@
<!-- 升级弹框 --> <!-- 升级弹框 -->
<update-box /> <update-box />
<slot name="content" /> <slot name="content" />
<web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view> <web-view
@message="handlerMessage"
ref="webview"
src="/hybrid/html/index.html"
></web-view>
<!-- <web-view <!-- <web-view
ref="studyWebview" ref="studyWebview"
:src="jumpUrl" :src="jumpUrl"
...@@ -130,7 +203,7 @@ export default { ...@@ -130,7 +203,7 @@ export default {
loadComplete: Boolean, loadComplete: Boolean,
swiperNoDataObject: Object swiperNoDataObject: Object
}, },
data() { data () {
return { return {
studyUrl: '', studyUrl: '',
jumpUrl: '', jumpUrl: '',
...@@ -146,35 +219,35 @@ export default { ...@@ -146,35 +219,35 @@ export default {
previewOff: false previewOff: false
} }
}, },
mounted() { mounted () {
const userInfo = uni.$storage.get('userInfo') || {} const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo this.userInfo = userInfo
permision.requestAndroidPermission('android.permission.RECORD_AUDIO') // 进入界面时检查权限 permision.requestAndroidPermission('android.permission.RECORD_AUDIO') // 进入界面时检查权限
}, },
provide() { provide () {
return { return {
showPage: this.handleShowPage, showPage: this.handleShowPage,
hideFooter: this.handleFooter hideFooter: this.handleFooter
} }
}, },
computed: { computed: {
previewRef() { previewRef () {
return this.$refs.previewRef return this.$refs.previewRef
}, },
finishRef() { finishRef () {
return this.$refs.finish return this.$refs.finish
}, },
componentName() { componentName () {
let tabs = this.$refs.leftBox?.tabs let tabs = this.$refs.leftBox?.tabs
return tabs ? tabs[this.tabIndex].name : '' return tabs ? tabs[this.tabIndex].name : ''
}, },
sceneType() { sceneType () {
const { sceneType } = uni.$storage.get('userInfo') const { sceneType } = uni.$storage.get('userInfo')
return sceneType return sceneType
} }
}, },
methods: { methods: {
async changeTab({ item, index }) { async changeTab ({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary() if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0 this.previewOff = index != 0
this.$emit('changeTab', index) this.$emit('changeTab', index)
...@@ -193,16 +266,16 @@ export default { ...@@ -193,16 +266,16 @@ export default {
// this.jumpUrl = '' // this.jumpUrl = ''
// } // }
}, },
handleFooter(val) { handleFooter (val) {
this.footerBox = val this.footerBox = val
}, },
backHome() { backHome () {
this.showHome = true this.showHome = true
Promise.resolve().then(() => { Promise.resolve().then(() => {
this.$refs.pointRef?.$refs?.centerRef?.init && this.$refs.pointRef.$refs.centerRef.init() this.$refs.pointRef?.$refs?.centerRef?.init && this.$refs.pointRef.$refs.centerRef.init()
}) })
}, },
jump(val) { jump (val) {
this.showHome = true this.showHome = true
if (val == 'CustomerFile') { if (val == 'CustomerFile') {
this.tabIndex = 2 this.tabIndex = 2
...@@ -210,12 +283,12 @@ export default { ...@@ -210,12 +283,12 @@ export default {
} }
this.start() this.start()
}, },
handleShowPage(name, transfer) { handleShowPage (name, transfer) {
this.transfer = transfer this.transfer = transfer
this.showHome = false this.showHome = false
this.pointComponentName = name this.pointComponentName = name
}, },
handleOperation(val, data) { handleOperation (val, data) {
const { type } = val const { type } = val
// 提取公共的webview设置逻辑 // 提取公共的webview设置逻辑
...@@ -285,32 +358,32 @@ export default { ...@@ -285,32 +358,32 @@ export default {
} }
}, },
// 学习中心修改阅读状态,打开后才修改 // 学习中心修改阅读状态,打开后才修改
async getStudyCenterRead(id) { async getStudyCenterRead (id) {
const res = await uni.$api.commonApi.getStudyCenterRead({ id }) const res = await uni.$api.commonApi.getStudyCenterRead({ id })
}, },
showReadCountTips(res) { showReadCountTips (res) {
this.tipsObject = res this.tipsObject = res
}, },
closeTips() { closeTips () {
this.$refs.leftBox.readCount = 0 this.$refs.leftBox.readCount = 0
this.tipsObject = { this.tipsObject = {
style: '', style: '',
text: '' text: ''
} }
}, },
swiperClick(e) { swiperClick (e) {
uni.$track.add({ uni.$track.add({
eventCode: 'app_product_Introduction' eventCode: 'app_product_Introduction'
}) })
this.previewOff = true this.previewOff = true
this.$emit('swiperClick', e) this.$emit('swiperClick', e)
}, },
previewHandler(name, off = false) { previewHandler (name, off = false) {
this.previewOff = off this.previewOff = off
this.$emit(name) this.$emit(name)
}, },
start() { start () {
const { sceneType } = this const { sceneType } = this
if (sceneType == 7) return //二手车无接待功能 if (sceneType == 7) return //二手车无接待功能
uni.$track.add({ uni.$track.add({
...@@ -318,12 +391,17 @@ export default { ...@@ -318,12 +391,17 @@ export default {
}) })
this.$emit('start') this.$emit('start')
}, },
async updateApp(requested = false) { async updateApp (requested = false) {
if (!requested) await uni.$api.systemApi.getMockData(true) if (!requested) await uni.$api.systemApi.getMockData(true)
this.checkVersion() this.checkVersion()
}, },
async entranceClick(item) { async entranceClick (item) {
// 清除评估单的图片视频资源缓存 // 清除评估单的图片视频资源缓存
const noInterceptPage = ['DailyReport'],
{ sceneType } = this
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport(sceneType != 7)))) return
if (sceneType != 7 && await this.inspectionOfProhibitionBill()) return
if (item.name === 'EvaluationFormList') { if (item.name === 'EvaluationFormList') {
mediaResourceManager.cleanupExpired() mediaResourceManager.cleanupExpired()
uni.navigateTo({ uni.navigateTo({
...@@ -331,8 +409,6 @@ export default { ...@@ -331,8 +409,6 @@ export default {
}) })
return return
} }
const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
let pageName = { let pageName = {
1: 'boutique', 1: 'boutique',
7: 'usedCar' 7: 'usedCar'
......
...@@ -25,7 +25,8 @@ export default { ...@@ -25,7 +25,8 @@ export default {
if (checkWW) eventRequest.push(this.clockedIntoWork()) if (checkWW) eventRequest.push(this.clockedIntoWork())
let apiName = { let apiName = {
0: this.equityStaffDailyReport, 0: this.equityStaffDailyReport,
1: this.staffDailyReport 1: this.staffDailyReport,
7: this.usedCarDailyReport
} }
eventRequest.push(apiName[sceneType]()) eventRequest.push(apiName[sceneType]())
} }
...@@ -59,6 +60,9 @@ export default { ...@@ -59,6 +60,9 @@ export default {
}) })
} }
}, },
/**
* 轻改日报
*/
staffDailyReport () { staffDailyReport () {
let { userInfo } = this let { userInfo } = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -103,6 +107,51 @@ export default { ...@@ -103,6 +107,51 @@ export default {
}) })
}) })
}, },
/**
* 二手车日报
*/
usedCarDailyReport () {
let { userInfo } = this
return new Promise(async (resolve, reject) => {
const data = await uni.$api.interceptionApi.checkUsedCarStaffIsNew({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
staffPhone: userInfo.phone,
sceneType: 7
})
if (!data) resolve(false) //检测是否新员工或调店 flase不检测日报 true检测日报
else {
const _data = await uni.$api.interceptionApi.checkUsedCarStaffDailyReportValid({
sellerMerchantId: userInfo.shopMerchantId,
}) //true 已填写 false 未填写
if (!_data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
const pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/usedCar/tool/index') uni.$emit('jumpToDailyReport', formattedDate)
else uni.navigateTo({
url: `/pages/usedCar/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
})
resolve(true)
} else resolve(false)
}
})
},
clockedIntoWork () { clockedIntoWork () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.$api.interceptionApi uni.$api.interceptionApi
...@@ -129,6 +178,7 @@ export default { ...@@ -129,6 +178,7 @@ export default {
}) })
}) })
}, },
/**延保日报 */
equityStaffDailyReport () { }, equityStaffDailyReport () { },
addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) { addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) {
if (modalQueue.findIndex(val => val.content == content) < 0) if (modalQueue.findIndex(val => val.content == content) < 0)
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
userInfo = { userInfo = {
...userInfo, ...userInfo,
openSceneArr: [...openSceneArr, 7], //❗7 为联调写死,提测要删 ❗ openSceneArr,
shopMerchantName, shopMerchantName,
shopMerchantId, shopMerchantId,
default4SStoreInfo: { default4SStoreInfo: {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
:endDate="endDate" :endDate="endDate"
:showMonth="false" :showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`" @monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate" @change="changeDate"
backgroundColor="transparent" backgroundColor="transparent"
:selected="selectedDays" :selected="selectedDays"
:date="currentDate" :date="currentDate"
...@@ -153,10 +153,12 @@ export default { ...@@ -153,10 +153,12 @@ export default {
// name:跳转组件名,val:跳转参数 // name:跳转组件名,val:跳转参数
jump (name, val) { jump (name, val) {
this.toolComponentName = name this.toolComponentName = name
console.log(this.toolComponentName, val)
if (val) { if (val) {
this.transmissionOfData = val this.transmissionOfData = val
} }
},
changeDate(e){
this.currentDate = e.fulldate
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!