Commit ef802de6 by 李伟康

feat(common): 添加门店分类查询接口并优化日报功能

- 在 common.js 中新增 getSceneByMerchantId 接口用于查询门店分类
- 在 dailyTemplateApi.js 中新增 getReportList 和 getReportDetail 接口
- 重构 HomeFrame.vue 中的组件结构,优化代码可读性
- 在 HomeFrame.vue 中集成门店分类获取功能
- 优化日报页面的数据获取和显示逻辑
- 更新日报弹窗组件配置和员工列表查询逻辑
- 添加 baseSceneCode 缓存常量支持门店分类存储
1 parent 0302960f
...@@ -708,4 +708,16 @@ module.exports = { ...@@ -708,4 +708,16 @@ module.exports = {
...data, ...data,
}) })
}, },
/**
* 查询门店分类
*
*/
getSceneByMerchantId(data = {}) {
return http.post({
method: 'dj.api.scenemerchantref.findAllSceneByMerchantId',
projectName: 'boutique',
...data
})
},
} }
...@@ -13,9 +13,9 @@ const ENV = env == 'ip' ? 'develop' : env, ...@@ -13,9 +13,9 @@ const ENV = env == 'ip' ? 'develop' : env,
const getDailyTemplate = async (templateType) => { const getDailyTemplate = async (templateType) => {
try { try {
const configModule = { const configModule = {
1:'staff-daily-template', 1: 'staff-daily-template',
2:'store-daily-template', 2: 'store-daily-template',
3:'negotiation-details-template', 3: 'negotiation-details-template',
}[templateType] }[templateType]
const data = await http.uni_request({ url: `${configUrl}&moduleUrl=${configModule}` }) const data = await http.uni_request({ url: `${configUrl}&moduleUrl=${configModule}` })
return Promise.resolve(data) return Promise.resolve(data)
...@@ -23,5 +23,32 @@ const getDailyTemplate = async (templateType) => { ...@@ -23,5 +23,32 @@ const getDailyTemplate = async (templateType) => {
return Promise.reject(error) return Promise.reject(error)
} }
} }
/**
* 查询日报是否填写列表
* @param {*} data
* @returns
*/
const getReportList = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.weekly.list',
projectName: 'boutique',
...data
})
}
/**
查询日报详情
*/
const getReportDetail = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.detail.get',
projectName: 'boutique',
...data
})
}
module.exports = { getDailyTemplate }
module.exports = {
getDailyTemplate,
getReportList,
getReportDetail
}
<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" @closeActivityCenter="closeActivityCenter" /> <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"
@closeActivityCenter="closeActivityCenter"
/>
<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 != 7"> <template v-if="sceneType != 7">
<view class="sprite-icon icon-start-text"></view> <view class="sprite-icon icon-start-text"></view>
</template> </template>
...@@ -19,7 +38,14 @@ ...@@ -19,7 +38,14 @@
<slot name="swiperCustom" /> <slot name="swiperCustom" />
</template> </template>
<template v-else> <template v-else>
<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>
</template> </template>
</view> </view>
</view> </view>
...@@ -33,19 +59,36 @@ ...@@ -33,19 +59,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>
...@@ -53,17 +96,41 @@ ...@@ -53,17 +96,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>
...@@ -72,7 +139,10 @@ ...@@ -72,7 +139,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>
...@@ -86,7 +156,12 @@ ...@@ -86,7 +156,12 @@
ref="webview" ref="webview"
src="/hybrid/html/index.html" src="/hybrid/html/index.html"
></web-view> --> ></web-view> -->
<web-view ref="uploaderWebview" src="/hybrid/html/index.html" @message="handleUploadMessageNew" :webview-styles="webviewStyles"></web-view> <web-view
ref="uploaderWebview"
src="/hybrid/html/index.html"
@message="handleUploadMessageNew"
:webview-styles="webviewStyles"
></web-view>
<!-- <web-view <!-- <web-view
ref="studyWebview" ref="studyWebview"
:src="jumpUrl" :src="jumpUrl"
...@@ -94,25 +169,85 @@ ...@@ -94,25 +169,85 @@
></web-view> --> ></web-view> -->
<!-- 学习中心 等级考试弹窗 --> <!-- 学习中心 等级考试弹窗 -->
<StudyPopup :show.sync="showStudyPopup" title="开始您的学习之旅" :topImage="require('@/assets/images/common/study-center-bg.png')" :topImageWidth="848" :topImageHeight="248"> <StudyPopup
<StudyPopupContent cardTitle="个性化学习路径" description="根据您当前的学习情况,我们将为您定制专属的学习计划,帮助您高效提升技能,实现职业突破。" :listItems="['基于当前能力水平评估', '结合岗位发展目标制定', '定期跟踪学习进度和效果']" tipText="true" :courseName="courseInfo.title" buttonText="开始测评" @cancel="handleStudyPopupCancel" @button-click="handleStartAssessment" /> :show.sync="showStudyPopup"
title="开始您的学习之旅"
:topImage="require('@/assets/images/common/study-center-bg.png')"
:topImageWidth="848"
:topImageHeight="248"
>
<StudyPopupContent
cardTitle="个性化学习路径"
description="根据您当前的学习情况,我们将为您定制专属的学习计划,帮助您高效提升技能,实现职业突破。"
:listItems="['基于当前能力水平评估', '结合岗位发展目标制定', '定期跟踪学习进度和效果']"
tipText="true"
:courseName="courseInfo.title"
buttonText="开始测评"
@cancel="handleStudyPopupCancel"
@button-click="handleStartAssessment"
/>
</StudyPopup> </StudyPopup>
<!-- 考试提交确认弹窗 --> <!-- 考试提交确认弹窗 -->
<StudyPopup :show.sync="showExamPopup" title="" :width="848" :height="examPopInfo.isExamLoading ? 740 : 656" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248"> <StudyPopup
<ExamSubmitPopup :isLoading="examPopInfo.isExamLoading" :showError="examPopInfo.showError" :confirmText="examPopInfo.confirmText" @cancel="handleExamCancel" @confirm="handleExamConfirm" /> :show.sync="showExamPopup"
title=""
:width="848"
:height="examPopInfo.isExamLoading ? 740 : 656"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
>
<ExamSubmitPopup
:isLoading="examPopInfo.isExamLoading"
:showError="examPopInfo.showError"
:confirmText="examPopInfo.confirmText"
@cancel="handleExamCancel"
@confirm="handleExamConfirm"
/>
</StudyPopup> </StudyPopup>
<!-- 学习中心权限弹窗 --> <!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden"> <StudyPopup
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" /> :show.sync="showStudyPermissionPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden"
>
<StudyCenterPermissionPopup
:lockReason="lockReason"
@confirm="handleStudyPermissionConfirm"
/>
</StudyPopup> </StudyPopup>
<activity-popup ref="activityPopup" @JumpActivityCenter="JumpActivityCenter"></activity-popup> <activity-popup
<uni-popup ref="errorRef" type="message"> ref="activityPopup"
<uni-popup-message type="error" :message="errorMsg" :duration="1500"></uni-popup-message> @JumpActivityCenter="JumpActivityCenter"
></activity-popup>
<uni-popup
ref="errorRef"
type="message"
>
<uni-popup-message
type="error"
:message="errorMsg"
:duration="1500"
></uni-popup-message>
</uni-popup> </uni-popup>
<!-- 异常订单锁单 --> <!-- 异常订单锁单 -->
<ErrorOrderPopup :show.sync="showErrorOrderPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden"> <ErrorOrderPopup
:show.sync="showErrorOrderPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden"
>
<view> <view>
<view class="error-order-title">异常订单提醒</view> <view class="error-order-title">异常订单提醒</view>
<view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view> <view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view>
...@@ -122,7 +257,10 @@ ...@@ -122,7 +257,10 @@
<!-- <view class="footer-btn cancel" @click="showErrorOrderPopup=false"> <!-- <view class="footer-btn cancel" @click="showErrorOrderPopup=false">
取消 取消
</view> --> </view> -->
<view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false">好的</view> <view
class="footer-btn sure flex-1"
@click="showErrorOrderPopup = false"
>好的</view>
</view> </view>
</template> </template>
</ErrorOrderPopup> </ErrorOrderPopup>
...@@ -166,7 +304,7 @@ import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue' ...@@ -166,7 +304,7 @@ import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue'
import { FileUploadManager, UploadService } from '@/utils/recordManager/index.js' import { FileUploadManager, UploadService } from '@/utils/recordManager/index.js'
export default { export default {
// mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin], // mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
mixins: [recorder, versionCheck, interceptionMixin,merge], mixins: [recorder, versionCheck, interceptionMixin, merge],
components: { components: {
ReceptionCenter, ReceptionCenter,
StudyCenter, StudyCenter,
...@@ -214,7 +352,7 @@ export default { ...@@ -214,7 +352,7 @@ export default {
}, },
swiperCustom: Boolean swiperCustom: Boolean
}, },
data() { data () {
return { return {
studyUrl: '', studyUrl: '',
jumpUrl: '', jumpUrl: '',
...@@ -253,13 +391,13 @@ export default { ...@@ -253,13 +391,13 @@ export default {
}) })
} }
}, },
beforeDestroy() { beforeDestroy () {
// 组件销毁前移除监听 // 组件销毁前移除监听
uni.$logger.local.info('levelStudyPopup 移除监听') uni.$logger.local.info('levelStudyPopup 移除监听')
uni.$off('levelStudyPopup') uni.$off('levelStudyPopup')
uni.$off('pageBack') uni.$off('pageBack')
}, },
async mounted() { async mounted () {
uni.$logger.local.info('levelStudyPopup 开始监听mounted') uni.$logger.local.info('levelStudyPopup 开始监听mounted')
uni.$on('levelStudyPopup', obj => { uni.$on('levelStudyPopup', obj => {
uni.$logger.local.info('接收到学习弹窗事件', obj) uni.$logger.local.info('接收到学习弹窗事件', obj)
...@@ -280,38 +418,38 @@ export default { ...@@ -280,38 +418,38 @@ export default {
return return
} }
}, },
beforeDestroy() { beforeDestroy () {
// 清理 FileUploadManager 资源 // 清理 FileUploadManager 资源
FileUploadManager.destroy() FileUploadManager.destroy()
}, },
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
}, },
activityWindowPopStatus() { activityWindowPopStatus () {
return this.$store.getters.activityWindowPopStatus return this.$store.getters.activityWindowPopStatus
} }
}, },
watch: { watch: {
activityWindowPopStatus: { activityWindowPopStatus: {
handler(val) { handler (val) {
const { id, tabIndex } = this const { id, tabIndex } = this
if (val == 2 && !id && tabIndex == 0) this.getActivityMessage() if (val == 2 && !id && tabIndex == 0) this.getActivityMessage()
}, },
...@@ -319,16 +457,20 @@ export default { ...@@ -319,16 +457,20 @@ export default {
deep: true deep: true
} }
}, },
created() { created () {
// 监听自定义事件 // 监听自定义事件
uni.$on('pageBack', () => { uni.$on('pageBack', () => {
this.$refs.leftBox.getMessageInfo() this.$refs.leftBox.getMessageInfo()
this.$refs.messageRef.getMessageSummary() this.$refs.messageRef.getMessageSummary()
}) })
/**
* 获取门店分类
*/
this.getSceneByMerchantId()
}, },
methods: { methods: {
// 处理开始测评(参考 detail.vue 的实现) // 处理开始测评(参考 detail.vue 的实现)
async handleStartAssessment() { async handleStartAssessment () {
this.showStudyPopup = false this.showStudyPopup = false
try { try {
// 获取北森 token // 获取北森 token
...@@ -374,7 +516,7 @@ export default { ...@@ -374,7 +516,7 @@ export default {
} }
}, },
// 获取北森 SSO Token(参考 detail.vue 的方法) // 获取北森 SSO Token(参考 detail.vue 的方法)
findBeiSenSSOToken() { findBeiSenSSOToken () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.$api.commonApi uni.$api.commonApi
.findBeiSenSSOToken({}) .findBeiSenSSOToken({})
...@@ -388,7 +530,7 @@ export default { ...@@ -388,7 +530,7 @@ export default {
}) })
}, },
// 处理考试取消(用户选择未提交) // 处理考试取消(用户选择未提交)
handleExamCancel() { handleExamCancel () {
this.showExamPopup = false this.showExamPopup = false
this.examPopInfo = { this.examPopInfo = {
isExamLoading: false, isExamLoading: false,
...@@ -397,7 +539,7 @@ export default { ...@@ -397,7 +539,7 @@ export default {
} }
this.getLevelExamInfo() this.getLevelExamInfo()
}, },
handleStudyPermissionConfirm() { handleStudyPermissionConfirm () {
this.showStudyPermissionPopup = false this.showStudyPermissionPopup = false
if (this.lockReason == '2') { if (this.lockReason == '2') {
uni.navigateTo({ url: '/pages/common/serviceDetail/index?moduleType=9' }) uni.navigateTo({ url: '/pages/common/serviceDetail/index?moduleType=9' })
...@@ -414,7 +556,7 @@ export default { ...@@ -414,7 +556,7 @@ export default {
} }
}, },
// 处理学习弹窗取消 // 处理学习弹窗取消
handleStudyPopupCancel() { handleStudyPopupCancel () {
this.showStudyPopup = false this.showStudyPopup = false
// 切换到学习中心 tab // 切换到学习中心 tab
const tabs = this.$refs.leftBox?.tabs const tabs = this.$refs.leftBox?.tabs
...@@ -427,7 +569,7 @@ export default { ...@@ -427,7 +569,7 @@ export default {
} }
}, },
// 检查学习中心权限 // 检查学习中心权限
async checkStudyCenterPermission() { async checkStudyCenterPermission () {
try { try {
const userInfo = uni.$storage.get('userInfo') const userInfo = uni.$storage.get('userInfo')
...@@ -461,7 +603,7 @@ export default { ...@@ -461,7 +603,7 @@ export default {
} }
}, },
// 处理考试确认(用户选择已提交) // 处理考试确认(用户选择已提交)
async handleExamConfirm() { async handleExamConfirm () {
this.examPopInfo.isExamLoading = true this.examPopInfo.isExamLoading = true
this.examPopInfo.showError = false this.examPopInfo.showError = false
const { examId, levelExamId } = this.courseInfo const { examId, levelExamId } = this.courseInfo
...@@ -504,7 +646,7 @@ export default { ...@@ -504,7 +646,7 @@ export default {
}) })
} }
}, },
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)
...@@ -515,23 +657,23 @@ export default { ...@@ -515,23 +657,23 @@ export default {
} }
}, },
// 查询等级弹窗信息 // 查询等级弹窗信息
async getLevelExamInfo() { async getLevelExamInfo () {
const res = await uni.$api.commonApi.startExam() const res = await uni.$api.commonApi.startExam()
if (res) { if (res) {
this.showStudyPopup = true this.showStudyPopup = true
this.courseInfo = res this.courseInfo = res
} }
}, },
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
...@@ -539,12 +681,12 @@ export default { ...@@ -539,12 +681,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设置逻辑
...@@ -614,21 +756,21 @@ export default { ...@@ -614,21 +756,21 @@ 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) {
if (this.sceneType == 0) if (this.sceneType == 0)
uni.$track.add({ uni.$track.add({
eventCode: 'app_product_Introduction' eventCode: 'app_product_Introduction'
...@@ -636,11 +778,11 @@ export default { ...@@ -636,11 +778,11 @@ export default {
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({
...@@ -648,11 +790,11 @@ export default { ...@@ -648,11 +790,11 @@ 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 { sceneType } = this const { sceneType } = this
if (!item.noInterception) { if (!item.noInterception) {
...@@ -706,7 +848,7 @@ export default { ...@@ -706,7 +848,7 @@ export default {
url: `/pages/${pageName}/tool/index?componentName=${item.name}` url: `/pages/${pageName}/tool/index?componentName=${item.name}`
}) })
}, },
async getActivityMessage() { async getActivityMessage () {
this.$store.dispatch('setActivityWindowPopCount', 0) this.$store.dispatch('setActivityWindowPopCount', 0)
const { sceneType } = this const { sceneType } = this
if (sceneType == 7) return // 二手车业务无活动中心 if (sceneType == 7) return // 二手车业务无活动中心
...@@ -715,10 +857,10 @@ export default { ...@@ -715,10 +857,10 @@ export default {
}) })
if (data) this.$refs.activityPopup.open(data) if (data) this.$refs.activityPopup.open(data)
}, },
closeActivityCenter() { closeActivityCenter () {
this.$refs.activityPopup.close() this.$refs.activityPopup.close()
}, },
async JumpActivityCenter(data) { async JumpActivityCenter (data) {
const { activityId } = data, const { activityId } = data,
{ shopMerchantId } = uni.$storage.get('userInfo'), { shopMerchantId } = uni.$storage.get('userInfo'),
{ sceneType } = this, { sceneType } = this,
...@@ -733,7 +875,7 @@ export default { ...@@ -733,7 +875,7 @@ export default {
} }
this.$refs.leftBox.handleActivityCenter() this.$refs.leftBox.handleActivityCenter()
}, },
handleErrorOrderPopupSure() { handleErrorOrderPopupSure () {
let pageName = { let pageName = {
0: 'equity', 0: 'equity',
1: 'boutique' 1: 'boutique'
...@@ -742,11 +884,20 @@ export default { ...@@ -742,11 +884,20 @@ export default {
url: `/pages/${pageName}/tool/index?componentName=OrderManagement` url: `/pages/${pageName}/tool/index?componentName=OrderManagement`
}) })
}, },
handleUploadMessageNew(event) { handleUploadMessageNew (event) {
FileUploadManager.handleWebViewMessage(event) FileUploadManager.handleWebViewMessage(event)
}, },
handleTouchStart() { handleTouchStart () {
uni.$emit('reset_timeout') uni.$emit('reset_timeout')
},
async getSceneByMerchantId () {
const merchantId = uni.$storage.get('userInfo').shopMerchantId,
data = await uni.$api.commonApi.getSceneByMerchantId({
merchantId
})
let baseSceneCode = []
if (data && data.length) baseSceneCode = data.map(e => Number(e.baseSceneCode))
uni.$storage.set('baseSceneCode', baseSceneCode)
} }
} }
} }
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
}, },
methods: { methods: {
async getList (searchValue, search) { async getList (searchValue, search) {
const { userInfo, params } = this, const { userInfo, params, data: { optionsKey } } = this,
{ cacheData } = params { cacheData } = params
this.currentId = '' this.currentId = ''
this.currentIds = [] this.currentIds = []
...@@ -45,14 +45,13 @@ export default { ...@@ -45,14 +45,13 @@ export default {
return return
} }
this.componentLoading(params) this.componentLoading(params)
const { shopMerchantId, sceneType, merchantId } = userInfo, console.log(optionsKey)
apiTargetName = sceneType == 1 || params.defeat ? 'getEmployeeList' : 'getOrderScreenEmployeeList', const { shopMerchantId, merchantId } = userInfo,
apiParams = { apiParams = {
merchantId: params.idKey == 'sellerUserId' ? merchantId : shopMerchantId, merchantId: optionsKey == '4sStaffList' ? shopMerchantId : merchantId,
sceneList: params.idKey == 'sellerUserId' ? '' : [sceneType],
} }
if (searchValue) apiParams.name = searchValue if (searchValue) apiParams.name = searchValue
const data = await uni.$api.popupApi[apiTargetName](apiParams) const data = await uni.$api.popupApi.getEmployeeList(apiParams)
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (list) { initData (list) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
const componentConfig = { const componentConfig = {
0: { 0: {
name: 'EmployeeList', name: 'EmployeeList',
title: '销售顾问/录单员', title: '选择人员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: ['userId'], idKey: ['userId'],
cacheData: [], cacheData: [],
...@@ -30,6 +30,16 @@ const componentConfig = { ...@@ -30,6 +30,16 @@ const componentConfig = {
searchValue: '', searchValue: '',
noData: false noData: false
}, },
2: {
name: 'EmployeeList',
title: '选择人员',
placeholder: '请输入姓名',
idKey: ['userId'],
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
3: { 3: {
name: 'CarModelList', name: 'CarModelList',
title: '选择车型', title: '选择车型',
......
...@@ -114,7 +114,6 @@ export default { ...@@ -114,7 +114,6 @@ export default {
default: false default: false
}, },
externalData: null, externalData: null,
popupTitle: String,
endDate: { endDate: {
type: String, type: String,
default: '' default: ''
...@@ -141,7 +140,8 @@ export default { ...@@ -141,7 +140,8 @@ export default {
dataKey: null, dataKey: null,
popupType: 0, popupType: 0,
itemIndex: null, itemIndex: null,
calendarData: '' calendarData: '',
popupTitle: ''
} }
}, },
...@@ -186,10 +186,12 @@ export default { ...@@ -186,10 +186,12 @@ export default {
}) })
}, },
open (data, popupType, index) { open (data, popupType, index) {
this.popupTitle = data.label || ''
this.data = data this.data = data
this.dataKey = data.key this.dataKey = data.key
this.popupType = popupType this.popupType = popupType
this.itemIndex = index this.itemIndex = index
if (popupType == 5) { if (popupType == 5) {
this.calendarData = data.value || dayjs().format('YYYY-MM-DD') this.calendarData = data.value || dayjs().format('YYYY-MM-DD')
this.$refs.calendar.open() this.$refs.calendar.open()
......
...@@ -196,7 +196,6 @@ export default { ...@@ -196,7 +196,6 @@ export default {
if (popupType == 5) { if (popupType == 5) {
this.$set(this.data[itemIndex], 'value', chooseContent) this.$set(this.data[itemIndex], 'value', chooseContent)
} else if (popupType == 3) { } else if (popupType == 3) {
console.log(chooseContent)
const { vehicleBrandName, vehicleSubBrandName, vehicleSeriesName, vehicleShapeName } = chooseContent const { vehicleBrandName, vehicleSubBrandName, vehicleSeriesName, vehicleShapeName } = chooseContent
this.$set(this.data[itemIndex], 'value', `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}-${vehicleShapeName}`) this.$set(this.data[itemIndex], 'value', `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}-${vehicleShapeName}`)
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent) this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent)
......
...@@ -187,9 +187,10 @@ export default { ...@@ -187,9 +187,10 @@ export default {
this.$emit('onInput', e.detail.value) this.$emit('onInput', e.detail.value)
}, },
select (e) { select (e) {
let { item } = this let { item, popupType } = this
if (item.optionsKey || item.type == 'datetime' || item.type == 'carBrandSelect') { if (item.optionsKey || item.type == 'datetime' || item.type == 'carBrandSelect') {
this.$emit('openSelect', item, this.popupType) if(item.optionsKey == 'storeStaffList') popupType = 2
this.$emit('openSelect', item, popupType)
} else { } else {
this.$emit('onSelect', item.options[e.detail.value].value) this.$emit('onSelect', item.options[e.detail.value].value)
} }
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
:clearDate="false" :clearDate="false"
:endDate="endDate" :endDate="endDate"
:showMonth="false" :showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`" @monthSwitch="changeMonth"
@change="currentDate = $event.fulldate" @change="changeCurrentDate"
backgroundColor="transparent" backgroundColor="transparent"
:selected="selectedDays" :selected="selectedDays"
:date="currentDate" :date="currentDate"
...@@ -43,15 +43,8 @@ ...@@ -43,15 +43,8 @@
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component <component
:ref="``" :ref="`ref-${componentName}`"
:is="componentName" :is="componentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
:lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event"
:enterType="enterType"
:templateData="templateData" :templateData="templateData"
/> />
</view> </view>
...@@ -89,16 +82,19 @@ export default { ...@@ -89,16 +82,19 @@ export default {
return { return {
options: {}, options: {},
transmissionOfData: null, transmissionOfData: null,
endDate: dayjs().format('YYYY-MM-DD'), endDate: dayjs().format('YYYY-MM-DD'), // 日历结束日期
currentDate: dayjs().format('YYYY-MM-DD'), currentDate: dayjs().format('YYYY-MM-DD'), // 当前选中日期
currentMonth: dayjs().format('YYYY-MM'), currentMonth: dayjs().format('YYYY-MM'), // 当前月份
selectedDays: [], selectedDays: [], // 填写日报日期
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'), lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'), // 上个月份
enterType: '', enterType: '',
templateData: [] templateData: []
} }
}, },
computed: { computed: {
userInfo () {
return uni.$storage.get("userInfo")
},
SCENE_TYPE () { SCENE_TYPE () {
const { sceneType } = uni.$storage.get('userInfo') const { sceneType } = uni.$storage.get('userInfo')
return Number(sceneType) return Number(sceneType)
...@@ -108,17 +104,9 @@ export default { ...@@ -108,17 +104,9 @@ export default {
carBrandId = carBrandList.map(item => item.id) carBrandId = carBrandList.map(item => item.id)
return carBrandId return carBrandId
}, },
/**
* '1.1': 100101, //精品升级
// '1.2': 100102, //次新车升配
// '1.3': 100103, //售后众筹
// '2.1.1': 110101, //售前会员权益升级
// '2.1.2': 110102, //售后会员权益升级
// '2.3.1': 110201, //售前延保
// '2.3.2': 110202, //售后延保
*/
BASE_SCENE_CODE () { BASE_SCENE_CODE () {
return [100101, 100102,100103, 110101, 110102, 110201, 110202] const baseSceneCode = uni.$storage.get('baseSceneCode')
return baseSceneCode
}, },
title () { title () {
...@@ -144,16 +132,54 @@ export default { ...@@ -144,16 +132,54 @@ export default {
componentName = 'EditNegotiationDetail' componentName = 'EditNegotiationDetail'
} }
return componentName return componentName
} },
templateType () {
return {
staffdailyreport: 1,
storedailyreport: 2,
negotiationdetaillist: 3,
editnegotiationdetail: 3
}[this.componentName.toLowerCase()]
},
dayList () {
let currentMonth = dayjs(this.currentMonth).format('YYYY-MM'),
mouthNumber = dayjs(currentMonth).daysInMonth(),
nowYear = dayjs(currentMonth).format('YYYY'),
nowMonth = dayjs(currentMonth).format('MM'),
maxDay = dayjs().format('D'),
maxMonth = dayjs().format('YYYY-MM'),
dayNum = currentMonth != maxMonth ? mouthNumber : maxDay,
dayList = []
for (let i = 1; i <= dayNum; i++) {
let date = dayjs(`${nowYear}-${nowMonth}-${i}`).format('YYYY-MM-DD')
dayList.push(date)
}
return dayList
},
}, },
onLoad (options) { onLoad (options) {
this.options = options this.options = options
this.getReportList()
this.getDailyTemplate(options.componentName) this.getDailyTemplate(options.componentName)
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
}, },
onUnload () { onUnload () {
}, },
methods: { methods: {
async getReportList () {
const { uuid, shopMerchantId } = this.userInfo,
{ templateType, dayList } = this
const data = await uni.$api.dailyTemplateApi.getReportList({
merchantId: shopMerchantId,
staffUuid: uuid,
templateType,
reportStartDate: dayList[0],
reportEndDate: dayList[dayList.length - 1]
})
console.log(data)
},
async getDailyTemplate (componentName) { async getDailyTemplate (componentName) {
const hasCommonElement = (arrA, arrB) => { const hasCommonElement = (arrA, arrB) => {
return arrA.some(item => arrB.includes(item)) return arrA.some(item => arrB.includes(item))
...@@ -217,9 +243,17 @@ export default { ...@@ -217,9 +243,17 @@ export default {
console.log(templateData) console.log(templateData)
}, },
setCurrentDate (currentDate) { setCurrentDate (currentDate) {
console.log(currentDate)
this.currentDate = currentDate this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM') this.currentMonth = dayjs(currentDate).format('YYYY-MM')
}, },
changeCurrentDate (e) {
this.currentDate = e.fulldate
},
changeMonth (e) {
this.currentMonth = `${e.year}-${e.month}`
this.getReportList()
},
backPage () { backPage () {
uni.navigateBack() uni.navigateBack()
}, },
...@@ -230,6 +264,7 @@ export default { ...@@ -230,6 +264,7 @@ export default {
this.transmissionOfData = val this.transmissionOfData = val
} }
}, },
} }
} }
</script> </script>
......
...@@ -622,6 +622,7 @@ export default { ...@@ -622,6 +622,7 @@ export default {
date date
}) })
}) })
console.log(data, selectedDay)
this.weeklyList = data this.weeklyList = data
this.$emit('setCalendarSelected', selectedDay) this.$emit('setCalendarSelected', selectedDay)
}, },
......
...@@ -45,5 +45,6 @@ export const STORAGE_OBJECTKEY = { ...@@ -45,5 +45,6 @@ export const STORAGE_OBJECTKEY = {
caseInfo: 'caseInfo', caseInfo: 'caseInfo',
boutique_YQorderSetting: 'boutique_YQorderSetting', boutique_YQorderSetting: 'boutique_YQorderSetting',
sessionId: 'sessionId', sessionId: 'sessionId',
createAllGoodsFlag: 'createAllGoodsFlag' createAllGoodsFlag: 'createAllGoodsFlag',
baseSceneCode: 'baseSceneCode',
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!