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 = {
...data,
})
},
/**
* 查询门店分类
*
*/
getSceneByMerchantId(data = {}) {
return http.post({
method: 'dj.api.scenemerchantref.findAllSceneByMerchantId',
projectName: 'boutique',
...data
})
},
}
......@@ -13,9 +13,9 @@ const ENV = env == 'ip' ? 'develop' : env,
const getDailyTemplate = async (templateType) => {
try {
const configModule = {
1:'staff-daily-template',
2:'store-daily-template',
3:'negotiation-details-template',
1: 'staff-daily-template',
2: 'store-daily-template',
3: 'negotiation-details-template',
}[templateType]
const data = await http.uni_request({ url: `${configUrl}&moduleUrl=${configModule}` })
return Promise.resolve(data)
......@@ -23,5 +23,32 @@ const getDailyTemplate = async (templateType) => {
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>
<view class="container" @click="handleTouchStart">
<view
class="container"
@click="handleTouchStart"
>
<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" />
<view class="tips-box" :style="tipsObject.style" @click.stop="closeTips">{{ tipsObject.text }}</view>
<left-side
: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="['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">
<view class="sprite-icon icon-start-text"></view>
</template>
......@@ -19,7 +38,14 @@
<slot name="swiperCustom" />
</template>
<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>
</view>
</view>
......@@ -33,19 +59,36 @@
<view class="content-right box-class">
<view class="common-title">服务中心</view>
<view class="content-box">
<MessageIndex class="message-box" ref="messageRef" />
<MessageIndex
class="message-box"
ref="messageRef"
/>
</view>
</view>
</view>
</view>
<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>
<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>
</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="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
......@@ -53,17 +96,41 @@
<view :class="['detail', { show: id }]">
<slot name="detail" />
</view>
<view class="point-page" v-if="!showHome">
<component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" />
<view
class="point-page"
v-if="!showHome"
>
<component
:is="pointComponentName"
@backHome="backHome"
@jump="jump"
:transfer="transfer"
/>
</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 :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
<MessageBox
:popupW="704"
ref="finish"
:content="finishContene"
:isFooter="false"
>
<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">
{{ finishDoneText }}
</template>
......@@ -72,7 +139,10 @@
<text>(推荐)</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
<view
class="footer-btn cancel flex"
@click="$emit('backHome')"
>
仍要退出
<text>(不推荐)</text>
</view>
......@@ -86,7 +156,12 @@
ref="webview"
src="/hybrid/html/index.html"
></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
ref="studyWebview"
:src="jumpUrl"
......@@ -94,25 +169,85 @@
></web-view> -->
<!-- 学习中心 等级考试弹窗 -->
<StudyPopup :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
: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 :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
: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 :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
: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>
<activity-popup ref="activityPopup" @JumpActivityCenter="JumpActivityCenter"></activity-popup>
<uni-popup ref="errorRef" type="message">
<uni-popup-message type="error" :message="errorMsg" :duration="1500"></uni-popup-message>
<activity-popup
ref="activityPopup"
@JumpActivityCenter="JumpActivityCenter"
></activity-popup>
<uni-popup
ref="errorRef"
type="message"
>
<uni-popup-message
type="error"
:message="errorMsg"
:duration="1500"
></uni-popup-message>
</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 class="error-order-title">异常订单提醒</view>
<view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view>
......@@ -122,7 +257,10 @@
<!-- <view class="footer-btn cancel" @click="showErrorOrderPopup=false">
取消
</view> -->
<view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false">好的</view>
<view
class="footer-btn sure flex-1"
@click="showErrorOrderPopup = false"
>好的</view>
</view>
</template>
</ErrorOrderPopup>
......@@ -166,7 +304,7 @@ import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue'
import { FileUploadManager, UploadService } from '@/utils/recordManager/index.js'
export default {
// mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
mixins: [recorder, versionCheck, interceptionMixin,merge],
mixins: [recorder, versionCheck, interceptionMixin, merge],
components: {
ReceptionCenter,
StudyCenter,
......@@ -214,7 +352,7 @@ export default {
},
swiperCustom: Boolean
},
data() {
data () {
return {
studyUrl: '',
jumpUrl: '',
......@@ -253,13 +391,13 @@ export default {
})
}
},
beforeDestroy() {
beforeDestroy () {
// 组件销毁前移除监听
uni.$logger.local.info('levelStudyPopup 移除监听')
uni.$off('levelStudyPopup')
uni.$off('pageBack')
},
async mounted() {
async mounted () {
uni.$logger.local.info('levelStudyPopup 开始监听mounted')
uni.$on('levelStudyPopup', obj => {
uni.$logger.local.info('接收到学习弹窗事件', obj)
......@@ -280,38 +418,38 @@ export default {
return
}
},
beforeDestroy() {
beforeDestroy () {
// 清理 FileUploadManager 资源
FileUploadManager.destroy()
},
provide() {
provide () {
return {
showPage: this.handleShowPage,
hideFooter: this.handleFooter
}
},
computed: {
previewRef() {
previewRef () {
return this.$refs.previewRef
},
finishRef() {
finishRef () {
return this.$refs.finish
},
componentName() {
componentName () {
let tabs = this.$refs.leftBox?.tabs
return tabs ? tabs[this.tabIndex].name : ''
},
sceneType() {
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
},
activityWindowPopStatus() {
activityWindowPopStatus () {
return this.$store.getters.activityWindowPopStatus
}
},
watch: {
activityWindowPopStatus: {
handler(val) {
handler (val) {
const { id, tabIndex } = this
if (val == 2 && !id && tabIndex == 0) this.getActivityMessage()
},
......@@ -319,16 +457,20 @@ export default {
deep: true
}
},
created() {
created () {
// 监听自定义事件
uni.$on('pageBack', () => {
this.$refs.leftBox.getMessageInfo()
this.$refs.messageRef.getMessageSummary()
})
/**
* 获取门店分类
*/
this.getSceneByMerchantId()
},
methods: {
// 处理开始测评(参考 detail.vue 的实现)
async handleStartAssessment() {
async handleStartAssessment () {
this.showStudyPopup = false
try {
// 获取北森 token
......@@ -374,7 +516,7 @@ export default {
}
},
// 获取北森 SSO Token(参考 detail.vue 的方法)
findBeiSenSSOToken() {
findBeiSenSSOToken () {
return new Promise((resolve, reject) => {
uni.$api.commonApi
.findBeiSenSSOToken({})
......@@ -388,7 +530,7 @@ export default {
})
},
// 处理考试取消(用户选择未提交)
handleExamCancel() {
handleExamCancel () {
this.showExamPopup = false
this.examPopInfo = {
isExamLoading: false,
......@@ -397,7 +539,7 @@ export default {
}
this.getLevelExamInfo()
},
handleStudyPermissionConfirm() {
handleStudyPermissionConfirm () {
this.showStudyPermissionPopup = false
if (this.lockReason == '2') {
uni.navigateTo({ url: '/pages/common/serviceDetail/index?moduleType=9' })
......@@ -414,7 +556,7 @@ export default {
}
},
// 处理学习弹窗取消
handleStudyPopupCancel() {
handleStudyPopupCancel () {
this.showStudyPopup = false
// 切换到学习中心 tab
const tabs = this.$refs.leftBox?.tabs
......@@ -427,7 +569,7 @@ export default {
}
},
// 检查学习中心权限
async checkStudyCenterPermission() {
async checkStudyCenterPermission () {
try {
const userInfo = uni.$storage.get('userInfo')
......@@ -461,7 +603,7 @@ export default {
}
},
// 处理考试确认(用户选择已提交)
async handleExamConfirm() {
async handleExamConfirm () {
this.examPopInfo.isExamLoading = true
this.examPopInfo.showError = false
const { examId, levelExamId } = this.courseInfo
......@@ -504,7 +646,7 @@ export default {
})
}
},
async changeTab({ item, index }) {
async changeTab ({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0
this.$emit('changeTab', index)
......@@ -515,23 +657,23 @@ export default {
}
},
// 查询等级弹窗信息
async getLevelExamInfo() {
async getLevelExamInfo () {
const res = await uni.$api.commonApi.startExam()
if (res) {
this.showStudyPopup = true
this.courseInfo = res
}
},
handleFooter(val) {
handleFooter (val) {
this.footerBox = val
},
backHome() {
backHome () {
this.showHome = true
Promise.resolve().then(() => {
this.$refs.pointRef?.$refs?.centerRef?.init && this.$refs.pointRef.$refs.centerRef.init()
})
},
jump(val) {
jump (val) {
this.showHome = true
if (val == 'CustomerFile') {
this.tabIndex = 2
......@@ -539,12 +681,12 @@ export default {
}
this.start()
},
handleShowPage(name, transfer) {
handleShowPage (name, transfer) {
this.transfer = transfer
this.showHome = false
this.pointComponentName = name
},
handleOperation(val, data) {
handleOperation (val, data) {
const { type } = val
// 提取公共的webview设置逻辑
......@@ -614,21 +756,21 @@ export default {
}
},
// 学习中心修改阅读状态,打开后才修改
async getStudyCenterRead(id) {
async getStudyCenterRead (id) {
const res = await uni.$api.commonApi.getStudyCenterRead({ id })
},
showReadCountTips(res) {
showReadCountTips (res) {
this.tipsObject = res
},
closeTips() {
closeTips () {
this.$refs.leftBox.readCount = 0
this.tipsObject = {
style: '',
text: ''
}
},
swiperClick(e) {
swiperClick (e) {
if (this.sceneType == 0)
uni.$track.add({
eventCode: 'app_product_Introduction'
......@@ -636,11 +778,11 @@ export default {
this.previewOff = true
this.$emit('swiperClick', e)
},
previewHandler(name, off = false) {
previewHandler (name, off = false) {
this.previewOff = off
this.$emit(name)
},
start() {
start () {
const { sceneType } = this
if (sceneType == 7) return //二手车无接待功能
uni.$track.add({
......@@ -648,11 +790,11 @@ export default {
})
this.$emit('start')
},
async updateApp(requested = false) {
async updateApp (requested = false) {
if (!requested) await uni.$api.systemApi.getMockData(true)
this.checkVersion()
},
async entranceClick(item) {
async entranceClick (item) {
// 清除评估单的图片视频资源缓存
const { sceneType } = this
if (!item.noInterception) {
......@@ -706,7 +848,7 @@ export default {
url: `/pages/${pageName}/tool/index?componentName=${item.name}`
})
},
async getActivityMessage() {
async getActivityMessage () {
this.$store.dispatch('setActivityWindowPopCount', 0)
const { sceneType } = this
if (sceneType == 7) return // 二手车业务无活动中心
......@@ -715,10 +857,10 @@ export default {
})
if (data) this.$refs.activityPopup.open(data)
},
closeActivityCenter() {
closeActivityCenter () {
this.$refs.activityPopup.close()
},
async JumpActivityCenter(data) {
async JumpActivityCenter (data) {
const { activityId } = data,
{ shopMerchantId } = uni.$storage.get('userInfo'),
{ sceneType } = this,
......@@ -733,7 +875,7 @@ export default {
}
this.$refs.leftBox.handleActivityCenter()
},
handleErrorOrderPopupSure() {
handleErrorOrderPopupSure () {
let pageName = {
0: 'equity',
1: 'boutique'
......@@ -742,11 +884,20 @@ export default {
url: `/pages/${pageName}/tool/index?componentName=OrderManagement`
})
},
handleUploadMessageNew(event) {
handleUploadMessageNew (event) {
FileUploadManager.handleWebViewMessage(event)
},
handleTouchStart() {
handleTouchStart () {
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 {
},
methods: {
async getList (searchValue, search) {
const { userInfo, params } = this,
const { userInfo, params, data: { optionsKey } } = this,
{ cacheData } = params
this.currentId = ''
this.currentIds = []
......@@ -45,14 +45,13 @@ export default {
return
}
this.componentLoading(params)
const { shopMerchantId, sceneType, merchantId } = userInfo,
apiTargetName = sceneType == 1 || params.defeat ? 'getEmployeeList' : 'getOrderScreenEmployeeList',
console.log(optionsKey)
const { shopMerchantId, merchantId } = userInfo,
apiParams = {
merchantId: params.idKey == 'sellerUserId' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserId' ? '' : [sceneType],
merchantId: optionsKey == '4sStaffList' ? shopMerchantId : merchantId,
}
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 || [])
},
initData (list) {
......
......@@ -10,7 +10,7 @@
const componentConfig = {
0: {
name: 'EmployeeList',
title: '销售顾问/录单员',
title: '选择人员',
placeholder: '请输入姓名',
idKey: ['userId'],
cacheData: [],
......@@ -30,6 +30,16 @@ const componentConfig = {
searchValue: '',
noData: false
},
2: {
name: 'EmployeeList',
title: '选择人员',
placeholder: '请输入姓名',
idKey: ['userId'],
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
},
3: {
name: 'CarModelList',
title: '选择车型',
......
......@@ -114,7 +114,6 @@ export default {
default: false
},
externalData: null,
popupTitle: String,
endDate: {
type: String,
default: ''
......@@ -141,7 +140,8 @@ export default {
dataKey: null,
popupType: 0,
itemIndex: null,
calendarData: ''
calendarData: '',
popupTitle: ''
}
},
......@@ -186,10 +186,12 @@ export default {
})
},
open (data, popupType, index) {
this.popupTitle = data.label || ''
this.data = data
this.dataKey = data.key
this.popupType = popupType
this.itemIndex = index
if (popupType == 5) {
this.calendarData = data.value || dayjs().format('YYYY-MM-DD')
this.$refs.calendar.open()
......
......@@ -196,7 +196,6 @@ export default {
if (popupType == 5) {
this.$set(this.data[itemIndex], 'value', chooseContent)
} else if (popupType == 3) {
console.log(chooseContent)
const { vehicleBrandName, vehicleSubBrandName, vehicleSeriesName, vehicleShapeName } = chooseContent
this.$set(this.data[itemIndex], 'value', `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}-${vehicleShapeName}`)
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent)
......
......@@ -187,9 +187,10 @@ export default {
this.$emit('onInput', e.detail.value)
},
select (e) {
let { item } = this
let { item, popupType } = this
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 {
this.$emit('onSelect', item.options[e.detail.value].value)
}
......
......@@ -31,8 +31,8 @@
:clearDate="false"
:endDate="endDate"
:showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate"
@monthSwitch="changeMonth"
@change="changeCurrentDate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
......@@ -43,15 +43,8 @@
</view>
<view class="detail-right">
<component
:ref="``"
:ref="`ref-${componentName}`"
:is="componentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
:lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event"
:enterType="enterType"
:templateData="templateData"
/>
</view>
......@@ -89,16 +82,19 @@ export default {
return {
options: {},
transmissionOfData: null,
endDate: dayjs().format('YYYY-MM-DD'),
currentDate: dayjs().format('YYYY-MM-DD'),
currentMonth: dayjs().format('YYYY-MM'),
selectedDays: [],
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'),
endDate: dayjs().format('YYYY-MM-DD'), // 日历结束日期
currentDate: dayjs().format('YYYY-MM-DD'), // 当前选中日期
currentMonth: dayjs().format('YYYY-MM'), // 当前月份
selectedDays: [], // 填写日报日期
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'), // 上个月份
enterType: '',
templateData: []
}
},
computed: {
userInfo () {
return uni.$storage.get("userInfo")
},
SCENE_TYPE () {
const { sceneType } = uni.$storage.get('userInfo')
return Number(sceneType)
......@@ -108,17 +104,9 @@ export default {
carBrandId = carBrandList.map(item => item.id)
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 () {
return [100101, 100102,100103, 110101, 110102, 110201, 110202]
const baseSceneCode = uni.$storage.get('baseSceneCode')
return baseSceneCode
},
title () {
......@@ -144,16 +132,54 @@ export default {
componentName = 'EditNegotiationDetail'
}
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) {
this.options = options
this.getReportList()
this.getDailyTemplate(options.componentName)
if (options.currentDate) this.setCurrentDate(options.currentDate)
},
onUnload () {
},
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) {
const hasCommonElement = (arrA, arrB) => {
return arrA.some(item => arrB.includes(item))
......@@ -217,9 +243,17 @@ export default {
console.log(templateData)
},
setCurrentDate (currentDate) {
console.log(currentDate)
this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM')
},
changeCurrentDate (e) {
this.currentDate = e.fulldate
},
changeMonth (e) {
this.currentMonth = `${e.year}-${e.month}`
this.getReportList()
},
backPage () {
uni.navigateBack()
},
......@@ -230,6 +264,7 @@ export default {
this.transmissionOfData = val
}
},
}
}
</script>
......
......@@ -622,6 +622,7 @@ export default {
date
})
})
console.log(data, selectedDay)
this.weeklyList = data
this.$emit('setCalendarSelected', selectedDay)
},
......
......@@ -45,5 +45,6 @@ export const STORAGE_OBJECTKEY = {
caseInfo: 'caseInfo',
boutique_YQorderSetting: 'boutique_YQorderSetting',
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!