Commit ebbf1c8a by cen

Merge branch 'SAAS+V5.0.0-1014' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.0.0-1014

2 parents 52c48eb0 c34c7862
...@@ -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
})
},
}
...@@ -30,12 +30,20 @@ const request = new Request({ ...@@ -30,12 +30,20 @@ const request = new Request({
response: (responseData, config) => { response: (responseData, config) => {
console.log('response事件触发', responseData, config) console.log('response事件触发', responseData, config)
}, },
error: (error, config) => { timeout: 30000,
console.log('error事件触发', error, config) response: {
code_key: 'code',
code_success_value: '0',
data_key: 'data',
errId: 'errId',
errId_logout_value: '21'
}, },
request: (request, config) => { request: (request, config) => {
console.log('request事件触发', request, config) console.log('request事件触发', request, config)
}, },
error: (error, config) => {
console.log('error事件触发', error, config)
},
logout: config => { logout: config => {
console.log('logout事件触发', config) console.log('logout事件触发', config)
const pages = getCurrentPages(), const pages = getCurrentPages(),
......
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: {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="daily-report"> <view class="daily-report">
<view class="common-title">填写日报</view> <view class="common-title">填写日报</view>
<scroll-view <scroll-view
:class="['repoet-view',{full:!orderObj.isDateWithin7Days}]" :class="['repoet-view',{full:!isDateWithin7Days}]"
scroll-y scroll-y
:scroll-into-view="to" :scroll-into-view="to"
@scroll="to = ''" @scroll="to = ''"
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
> >
<view class="label flex"> <view class="label flex">
{{i.label}} {{i.label}}
<template v-if="index != 0 || (i.required && orderObj.pickerValue == 0)"> <view class="required">*</view>
<view class="required">*</view>
</template>
</view> </view>
<view class="value flex"> <view class="value flex">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
...@@ -36,40 +34,33 @@ ...@@ -36,40 +34,33 @@
placeholder-class="placeholder" placeholder-class="placeholder"
@blur="handleBlur($event, i)" @blur="handleBlur($event, i)"
:disabled="filterDisabled(isEditReport)" :disabled="filterDisabled(isEditReport)"
:maxlength="3" :maxlength="2"
:key="dateKey[i.value]" :key="dateKey[i.value]"
auto-blur auto-blur
> >
</template> </template>
<template v-else-if="i.type == 'picker'">
<picker
class="picker flex"
:value="orderObj[i.value]"
:range="i.range"
:range-key="i.rangeKey"
@change="changePicker($event,i)"
:disabled="filterDisabled(isEditReport)"
>
{{i.range[orderObj[i.value]][i.rangeKey] || ''}}
<uni-icons
type="right"
:size="16"
color="#999"
class="arrow"
></uni-icons>
</picker>
</template>
<template v-else> <template v-else>
{{orderObj[i.value]}} {{orderObj[i.value]}}
</template> </template>
<view class="unit">台</view>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
<template v-if="!isDateWithin7Days && !isFilled">
<view class="nothing flex">
<image
src="../../../../assets/images/common/report-no-data.webp"
class="icon"
/>
已超过 7 个自然日,暂不支持补填操作
</view>
</template>
</template> </template>
</view> </view>
</scroll-view> </scroll-view>
<template v-if="orderObj.isDateWithin7Days"> <template v-if="isDateWithin7Days && !isFilled">
<view class="btn-box flex"> <view class="btn-box flex">
<template v-if="filterDisabled()"> <template v-if="filterDisabled()">
<template v-if="!isEditReport"> <template v-if="!isEditReport">
...@@ -131,26 +122,26 @@ export default { ...@@ -131,26 +122,26 @@ export default {
reportObject: Object.freeze([ reportObject: Object.freeze([
{ {
label: '新车下订', label: '新车下订',
value: 'staffCount', value: 'orderQuantity',
type: 'input', type: 'input',
required: true, required: true,
inputType: 'number', inputType: 'number',
refId: 'staffCount' refId: 'orderQuantity'
}, },
{ {
label: '新车交付', label: '新车交付',
value: 'staffCount', value: 'deliveryQuantity',
type: 'input', type: 'input',
required: true, required: true,
inputType: 'number', inputType: 'number',
refId: 'staffCount' refId: 'deliveryQuantity'
}, },
]), ]),
orderObj: {}, orderObj: {},
carBandList: [],
weeklyList: [], weeklyList: [],
isEditReport: false, isEditReport: false,
isFilled: false, //是否填写过选中天日报
buttons: Object.freeze([ buttons: Object.freeze([
{ {
text: '返回首页', text: '返回首页',
...@@ -166,7 +157,9 @@ export default { ...@@ -166,7 +157,9 @@ export default {
mouthNumber () { mouthNumber () {
return dayjs(this.currentMonth).daysInMonth() return dayjs(this.currentMonth).daysInMonth()
}, },
isDateWithin7Days () {
return dayjs().diff(dayjs(this.currentDate), 'day') < 7
}
}, },
watch: { watch: {
currentMonth: { currentMonth: {
...@@ -178,7 +171,9 @@ export default { ...@@ -178,7 +171,9 @@ export default {
}, },
currentDate: { currentDate: {
handler (val) { handler (val) {
if (this.carBandList.length) this.getStaffDailyReportDetail() // if (this.isDateWithin7Days)
this.getStaffDailyReportDetail()
// else
}, },
deep: true, deep: true,
} }
...@@ -194,25 +189,11 @@ export default { ...@@ -194,25 +189,11 @@ export default {
uni.navigateBack() uni.navigateBack()
}, },
initData () { initData () {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo const { shopMerchantId, shopMerchantName } = this.userInfo
this.orderObj = { this.orderObj = {
yqMerchantId: merchantId, sellerMerchantId: shopMerchantId,
yqMerchantName: merchantName, sellerMerchantName: shopMerchantName,
staffName: name,
staffUuid: uuid,
merchantId: shopMerchantId,
merchantName: shopMerchantName
} }
this.getDailyReportCarBrand()
},
async getDailyReportCarBrand () {
let { userInfo } = this,
{ shopMerchantId } = userInfo
const data = await uni.$api.boutiqueApi.getDailyReportCarBrand({
merchantId: shopMerchantId,
sceneType: 1
})
this.carBandList = data
this.getStaffDailyReportDetail() this.getStaffDailyReportDetail()
}, },
setMonthDay () { setMonthDay () {
...@@ -238,151 +219,71 @@ export default { ...@@ -238,151 +219,71 @@ export default {
let startDay = weekDayList[0].date, let startDay = weekDayList[0].date,
endDay = weekDayList[weekDayList.length - 1].date endDay = weekDayList[weekDayList.length - 1].date
let params = { let params = {
weekDayList, startDate: dayjs(startDay).format('YYYY-MM-DD'),
yearMonth: currentMonth, endDate: dayjs(endDay).format('YYYY-MM-DD'),
starDay: 1,
starDayLabel: dayjs(startDay).format('YYYY/MM/DD'),
reportStartDate: startDay,
endDayLabel: dayjs(endDay).format('YYYY/MM/DD'),
reportEndDate: endDay,
formatYearMonth: currentMonth
} }
this.getStaffDailyReportDetailWeeklyList(params) this.getStaffDailyReportDetailWeeklyList(params, weekDayList)
}, },
async getStaffDailyReportDetailWeeklyList (params) { async getStaffDailyReportDetailWeeklyList (params, weekDayList) {
let { shopMerchantId, merchantId, uuid } = this.userInfo let { shopMerchantId } = this.userInfo
const data = await uni.$api.boutiqueApi.getStaffDailyReportDetailWeeklyList({ const data = await uni.$api.usedCarApi.getCarDailyReportList({
staffUuid: uuid, sellerMerchantId: shopMerchantId,
yqMerchantId: merchantId,
merchantId: shopMerchantId,
...params, ...params,
sceneType: 1,
reportTypeList: [-1]
}) })
let selectedDay = [] let selectedDay = [],
params.weekDayList.map(e => { reportDate = data.map(e => e.date) || []
weekDayList.map(e => {
let { date } = e let { date } = e
if (!data.includes(date)) selectedDay.push({ if (!reportDate.includes(date)) selectedDay.push({
date date
}) })
}) })
this.weeklyList = data this.weeklyList = data
this.$emit('setCalendarSelected', selectedDay) this.$emit('setCalendarSelected', selectedDay)
if (reportDate.length && reportDate.includes(this.currentDate)) this.getStaffDailyReportDetail()
}, },
async getStaffDailyReportDetail () { async getStaffDailyReportDetail () {
this.isEditReport = false this.isEditReport = false
this.loadComplete = false this.loadComplete = false
let { currentDate, let { currentDate,
userInfo, weeklyList,
carBandList,
hwOhterObjArray,
orderObj } = this, orderObj } = this,
{ shopMerchantId, merchantId, uuid } = userInfo item = weeklyList.find(item => item.date == currentDate)
uni.showLoading({ if (item && item.id) {
mask: true uni.showLoading({
}) mask: true
const data = await uni.$api.boutiqueApi.getStaffDailyReportDetail({
yqMerchantId: merchantId,
merchantId: shopMerchantId,
staffUuid: uuid,
reportDate: currentDate,
sceneType: 1,
reportTypeList: [-1]
})
uni.hideLoading()
let { brandDataList, remark } = data
if (brandDataList && brandDataList.length) {
carBandList = carBandList.map((item, index) => {
this.dateKey[`deliveryCount_${index}`] = Date.now()
this.dateKey[`notDeliveryCount_${index}`] = Date.now()
this.dateKey[`equityToShopCount_${index}`] = Date.now()
this.dateKey[`afterSaleEquityToShopCount_${index}`] = Date.now()
let carBand = brandDataList.find(ele => {
if ([0, 1].includes(ele.brandType)) {
return ele.brandType == item.brandType
} else if (ele.brandType == 2) {
return ele.firstBrandId == item.firstBrandId
}
})
if (carBand != null) {
let {
firstBrandId,
firstBrandName,
brandId,
brandName,
brandType
} = item
item = {
...carBand,
firstBrandId,
firstBrandName,
brandId,
brandName,
brandType
}
} else {
hwOhterObjArray.forEach(e => {
item[e.key] = null
})
}
return item
}) })
const data = await uni.$api.usedCarApi.getCarDailyReportDetail({
id: item.id,
})
if (data) {
orderObj.id = data.id
orderObj.orderQuantity = data.orderQuantity
orderObj.deliveryQuantity = data.deliveryQuantity
this.isFilled = data.isFilled
}
uni.hideLoading()
this.orderObj = orderObj
this.loadComplete = true
} else {
delete orderObj.id
delete orderObj.orderQuantity
delete orderObj.deliveryQuantity
this.orderObj = orderObj
this.loadComplete = true
this.isFilled = false
} }
let diffDay = dayjs().diff(dayjs(currentDate), 'day')
this.hwOhterObjArray = hwOhterObjArray
this.carBandList = carBandList
this.orderObj = {
...orderObj,
reportDate: currentDate,
isDateWithin7Days: diffDay < 7,
isDateWithin60Days: diffDay < 60,
remark,
lastStaffName: data.lastStaffName,
lastStaffUuid: data.lastStaffUuid,
recordStaffCount: data.staffCount,
totalOrderMoney: data.totalOrderMoney,
totalOrderCount: data.totalOrderCount,
glWorryFreeCount: data.glWorryFreeCount,
cancelOrderCount: data.cancelOrderCount,
cancelOrderMoney: data.cancelOrderMoney,
templateType: data.templateType || 0,
staffCount: data.staffCount,
onBreak: data.onBreak || 'N',
pickerValue: data.onBreak == 'Y' ? 1 : 0,
staffCountError: false,
}
this.loadComplete = true
this.dateKey.staffCount = Date.now()
},
title (item) {
let title = ''
if (item.brandType == 0) title = '问界'
if (item.brandType == 1) title = '鸿蒙'
return title || item.firstBrandName
}, },
handleBlur (e, i) { handleBlur (e, i) {
let { value } = e.detail let { value } = e.detail
if (value) { if (value) {
let { orderObj, userInfo } = this
let key = i.value, let key = i.value,
numbers = value.match(/\d+/g) numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : '' numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString() this.orderObj[key] = Math.min(Math.max(Math.floor(Number(numbers)), 0), 99).toString()
this.dateKey[key] = Date.now() this.dateKey[key] = Date.now()
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
this.isNotEmpty(value) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) uni.showModal({
title: '预警提示',
content: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF'
})
} }
}, },
isNotEmpty (value) { isNotEmpty (value) {
...@@ -393,17 +294,6 @@ export default { ...@@ -393,17 +294,6 @@ export default {
!(Array.isArray(value) && value.length === 0) !(Array.isArray(value) && value.length === 0)
) )
}, },
handleCarInputBlur (e, i, item, index) {
let { value } = e.detail
if (value) {
let { key } = i,
numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
item[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey[`${key}_${index}`] = Date.now()
}
},
async submit () { async submit () {
uni.showLoading({ uni.showLoading({
title: '提交中', title: '提交中',
...@@ -413,32 +303,21 @@ export default { ...@@ -413,32 +303,21 @@ export default {
eventCode: 'app_submit_daily_report' eventCode: 'app_submit_daily_report'
}) //提交驻店日报埋点 }) //提交驻店日报埋点
try { try {
let { orderObj, carBandList, hwOhterObjArray } = this let { orderObj, currentDate } = this,
orderObj.isAdmin = false apiName = 'addCarDailyReport'
orderObj.oprBy = orderObj.staffUuid if (orderObj.orderQuantity == null) throw {
orderObj.sceneType = 1 message: '新车下订',
orderObj.brandDataList = carBandList refId: 'orderQuantity'
if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw {
message: '今日驻店人数(按店)',
refId: 'staffCount'
}
carBandList.map((item, index) => {
hwOhterObjArray.map(el => {
if (el.required && ['', null].includes(item[el.key])) throw {
message: el.label,
refId: `${el.refId}_${index}`
}
})
})
} }
if (orderObj.onBreak == 'Y') { if (orderObj.deliveryQuantity == null) throw {
orderObj.brandDataList.forEach(item => { message: '新车交付',
item.notDeliveryCount = item.notDeliveryCount || 0 refId: 'deliveryQuantity'
item.equityToShopCount = item.equityToShopCount || 0
})
} }
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj) if (orderObj.id != null) apiName = 'editCarDailyReport'
const data = await uni.$api.usedCarApi[apiName]({
date: currentDate,
...orderObj
})
uni.hideLoading() uni.hideLoading()
if (data) { if (data) {
this.isEditReport = false this.isEditReport = false
...@@ -460,8 +339,9 @@ export default { ...@@ -460,8 +339,9 @@ export default {
} }
}, },
filterDisabled (disabledStatus) { filterDisabled (disabledStatus) {
let { weeklyList, currentDate, orderObj: { isDateWithin7Days } } = this let { weeklyList, currentDate, isDateWithin7Days } = this,
return weeklyList.includes(currentDate) && !disabledStatus || !isDateWithin7Days repoetDateList = weeklyList.map(item => item.date)
return repoetDateList.includes(currentDate) && !disabledStatus || !isDateWithin7Days
}, },
changePicker (e, i) { changePicker (e, i) {
let { value } = e.detail let { value } = e.detail
...@@ -477,10 +357,29 @@ export default { ...@@ -477,10 +357,29 @@ export default {
height: 100%; height: 100%;
.repoet-view { .repoet-view {
height: calc(100% - #{toRpx(248)}); height: calc(100% - #{toRpx(248)});
position: relative;
} }
.full { .full {
height: calc(100% - #{toRpx(120)}); height: calc(100% - #{toRpx(120)});
} }
.nothing {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #f1f4ff;
backdrop-filter: blur(8px);
z-index: 2;
flex-direction: column;
justify-content: center;
color: #999999;
font-size: 24rpx;
.icon {
width: 344rpx;
height: 236rpx;
}
}
.box { .box {
margin: 0 toRpx(48) toRpx(16); margin: 0 toRpx(48) toRpx(16);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -519,7 +418,9 @@ export default { ...@@ -519,7 +418,9 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
justify-content: flex-end; justify-content: flex-end;
.unit {
margin-left: 16rpx;
}
.input, .input,
.picker { .picker {
width: 100%; width: 100%;
......
...@@ -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!