Commit 65f5156a by 李伟康

Merge branch 'hotfix_v5.8.2.1' into 'saas+v5.8.3'

Hotfix v5.8.2.1

See merge request !92
2 parents 8bd44244 6bf8be8c
...@@ -108,6 +108,26 @@ const getGoodsOrderList = async (data = {}) => { ...@@ -108,6 +108,26 @@ const getGoodsOrderList = async (data = {}) => {
...data ...data
}) })
} }
/**
* 查询员工账号上架门店的小场景值
*/
const getStaffBaseSceneCodeList = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.scene.config.getUserScene',
projectName: 'boutique',
...data
})
}
/**
* 查询门店上架的小场景值
*/
const getStoreBaseSceneCodeList = async (data = {}) => {
return http.post({
method: 'dj.api.scenemerchantref.findByMerchantIdAndSceneType',
projectName: 'boutique',
...data
})
}
module.exports = { module.exports = {
getDailyTemplate, getDailyTemplate,
...@@ -118,5 +138,7 @@ module.exports = { ...@@ -118,5 +138,7 @@ module.exports = {
saveDraft, saveDraft,
getDiscussionStaffList, getDiscussionStaffList,
submitReport, submitReport,
getGoodsOrderList getGoodsOrderList,
getStaffBaseSceneCodeList,
getStoreBaseSceneCodeList
} }
...@@ -161,14 +161,6 @@ export default { ...@@ -161,14 +161,6 @@ export default {
noInterception: true noInterception: true
}, },
{ {
icon: 'daily-report',
label: '驻店日报-新',
name: 'staffDailyReport',
page: '/pages/common/dailyNewspaper/index',
eventCode: 'staff_daily_report_page',
noInterception: true
},
{
icon: 'store-daily-report', icon: 'store-daily-report',
label: '门店日报', label: '门店日报',
name: 'storeDailyReport', name: 'storeDailyReport',
...@@ -190,10 +182,18 @@ export default { ...@@ -190,10 +182,18 @@ export default {
{ sceneType, shopMerchantId } = userInfo, { sceneType, shopMerchantId } = userInfo,
newReport = await this.isNewVersionNeed(shopMerchantId) newReport = await this.isNewVersionNeed(shopMerchantId)
if (newReport && sceneType != 7) { if (newReport && sceneType != 7) {
let [staffDailyReport] = entranceList
entranceList[0] = {
...staffDailyReport,
name: 'staffDailyReport',
page: '/pages/common/dailyNewspaper/index',
eventCode: 'staff_daily_report_page',
}
entranceList.map(e => { entranceList.map(e => {
if (['staffDailyReport', 'storeDailyReport', 'NegotiationDetail'].includes(e.name)) e.sceneType = [0, 1] if (['staffDailyReport', 'storeDailyReport', 'NegotiationDetail'].includes(e.name)) e.sceneType = [0, 1]
}) })
} }
this.$store.dispatch('setNewReport', newReport)
// 先根据场景过滤 // 先根据场景过滤
let list = entranceList.filter(e => e.sceneType?.includes(sceneType)) let list = entranceList.filter(e => e.sceneType?.includes(sceneType))
// 加载阶段或不允许显示时,移除工资申诉入口 // 加载阶段或不允许显示时,移除工资申诉入口
......
...@@ -343,9 +343,13 @@ export default { ...@@ -343,9 +343,13 @@ export default {
this.$refs.messageRef.getMessageSummary() this.$refs.messageRef.getMessageSummary()
}) })
/** /**
* 获取门店分类 * 获取员工场景小分类
*/ */
this.getSceneByMerchantId() this.getStaffBaseSceneCodeList()
/**
* 获取门店场景小分类
*/
this.getStoreBaseSceneCodeList()
}, },
methods: { methods: {
// 处理开始测评(参考 detail.vue 的实现) // 处理开始测评(参考 detail.vue 的实现)
...@@ -730,8 +734,11 @@ export default { ...@@ -730,8 +734,11 @@ export default {
}, },
async getActivityMessage() { async getActivityMessage() {
this.$store.dispatch('setActivityWindowPopCount', 0) this.$store.dispatch('setActivityWindowPopCount', 0)
const { sceneType } = this const { sceneType } = this,
pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (sceneType == 7) return // 二手车业务无活动中心 if (sceneType == 7) return // 二手车业务无活动中心
if (!['pages/equity/index', 'pages/boutique/index'].includes(currentPage.route)) return
const data = await uni.$api.activityApi.getActivityMessagePopUpWindow({ const data = await uni.$api.activityApi.getActivityMessagePopUpWindow({
businessType: sceneType businessType: sceneType
}) })
...@@ -770,15 +777,29 @@ export default { ...@@ -770,15 +777,29 @@ export default {
handleTouchStart() { handleTouchStart() {
uni.$emit('reset_timeout') uni.$emit('reset_timeout')
}, },
async getSceneByMerchantId() { async getStaffBaseSceneCodeList() {
const merchantId = uni.$storage.get('userInfo').shopMerchantId, const { shopMerchantId: merchantId, phone } = uni.$storage.get('userInfo'),
data = await uni.$api.commonApi.getSceneByMerchantId({ { sceneType } = this,
merchantId data = await uni.$api.dailyTemplateApi.getStaffBaseSceneCodeList({
merchantId,
phone,
sceneType
}) })
let baseSceneCode = [] let baseSceneCode = []
if (data && data.length) baseSceneCode = data.map(e => Number(e.baseSceneCode)) if (data && data.length) baseSceneCode = data.map(e => Number(e.baseSceneCode))
uni.$storage.set('baseSceneCode', baseSceneCode) uni.$storage.set('baseSceneCode', baseSceneCode)
} },
async getStoreBaseSceneCodeList() {
const { shopMerchantId: merchantId } = uni.$storage.get('userInfo'),
{ sceneType } = this,
data = await uni.$api.dailyTemplateApi.getStoreBaseSceneCodeList({
merchantId,
sceneType
})
let baseSceneCode = []
if (data && data.length) baseSceneCode = data.map(e => Number(e.baseSceneCode))
uni.$storage.set('storeBaseSceneCode', baseSceneCode)
},
} }
} }
</script> </script>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.25.2", "versionName" : "2.25.4",
"versionCode" : 2252, "versionCode" : 2254,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
......
...@@ -7,6 +7,9 @@ export default { ...@@ -7,6 +7,9 @@ export default {
computed: { computed: {
userInfo() { userInfo() {
return uni.$storage.get('userInfo') || {} return uni.$storage.get('userInfo') || {}
},
isNewReport() {
return this.$store.state.user.newReport
} }
}, },
mounted() {}, mounted() {},
...@@ -51,7 +54,7 @@ export default { ...@@ -51,7 +54,7 @@ export default {
cancelColor: '#292D33', cancelColor: '#292D33',
confirmText: modalInfo.confirmText, confirmText: modalInfo.confirmText,
confirmColor: '#347BFF', confirmColor: '#347BFF',
success: (res) => { success: res => {
// wx.__HAS_SHOW_MODAL = false; // wx.__HAS_SHOW_MODAL = false;
// if (res.cancel) _this.showNextModal(); // if (res.cancel) _this.showNextModal();
if (res.cancel) this.showNextModal() if (res.cancel) this.showNextModal()
...@@ -64,7 +67,7 @@ export default { ...@@ -64,7 +67,7 @@ export default {
* 轻改日报 * 轻改日报
*/ */
staffDailyReport() { staffDailyReport() {
let { userInfo } = this let { userInfo, isNewReport } = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.$api.interceptionApi uni.$api.interceptionApi
.staffDailyReportMerchantValid({ .staffDailyReportMerchantValid({
...@@ -74,6 +77,7 @@ export default { ...@@ -74,6 +77,7 @@ export default {
sceneType: 1 sceneType: 1
}) })
.then(data => { .then(data => {
console.log(data)
if (data) { if (data) {
// 获取当前日期 // 获取当前日期
let currentDate = new Date() let currentDate = new Date()
...@@ -91,11 +95,22 @@ export default { ...@@ -91,11 +95,22 @@ export default {
console.log(formattedDate) console.log(formattedDate)
const pages = getCurrentPages(), const pages = getCurrentPages(),
currentPage = pages[pages.length - 1] currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/boutique/tool/index') uni.$emit('jumpToDailyReport', formattedDate) if (currentPage.route == 'pages/boutique/tool/index') {
else if (isNewReport)
uni.navigateTo({ uni.redirectTo({
url: `/pages/boutique/tool/index?componentName=DailyReport&currentDate=${formattedDate}` url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
}) })
else uni.$emit('jumpToDailyReport', formattedDate)
} else {
if (isNewReport)
uni.navigateTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
})
else
uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
} }
}) })
resolve(true) resolve(true)
...@@ -182,7 +197,7 @@ export default { ...@@ -182,7 +197,7 @@ export default {
}, },
/**延保日报 */ /**延保日报 */
equityStaffDailyReport() { equityStaffDailyReport() {
let { userInfo } = this let { userInfo, isNewReport } = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.$api.interceptionApi uni.$api.interceptionApi
.staffDailyReportMerchantValid({ .staffDailyReportMerchantValid({
...@@ -208,11 +223,22 @@ export default { ...@@ -208,11 +223,22 @@ export default {
if (res.confirm) { if (res.confirm) {
const pages = getCurrentPages(), const pages = getCurrentPages(),
currentPage = pages[pages.length - 1] currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/equity/tool/index') uni.$emit('jumpToDailyReport', formattedDate) if (currentPage.route == 'pages/equity/tool/index') {
else if (isNewReport)
uni.navigateTo({ uni.redirectTo({
url: `/pages/equity/tool/index?componentName=DailyReport&currentDate=${formattedDate}` url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
}) })
else uni.$emit('jumpToDailyReport', formattedDate)
} else {
if (isNewReport)
uni.navigateTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
})
else
uni.navigateTo({
url: `/pages/equity/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
} }
}) })
resolve(true) resolve(true)
......
...@@ -5,39 +5,22 @@ ...@@ -5,39 +5,22 @@
<template v-if="loadComplete"> <template v-if="loadComplete">
<template v-if="list.length"> <template v-if="list.length">
<view class="daily-report-container"> <view class="daily-report-container">
<template v-for="(i,index) in list"> <template v-for="(i, index) in list">
<view <view :class="['list-box', { 'no-child': !i.children.length }]" :key="index">
:class="['list-box',{ 'no-child': !i.children.length }]"
:key="index"
>
<view class="list-title flex"> <view class="list-title flex">
{{ i.label }} {{ i.label }}
<template v-if="!i.children.length"> <template v-if="!i.children.length">
<view <view :class="['add flex', { 'disabled': !saveBtn }]" @click="addItem(index)">
class="add flex"
@click="addItem(index)"
>
<view class="add-icon"></view> <view class="add-icon"></view>
新增 新增
</view> </view>
</template> </template>
</view> </view>
<template v-if="i.children.length"> <template v-if="i.children.length">
<Table <Table :columns="i.children[0]" :data="i.children" titleKey="label" tableStyle="padding-right:32rpx"
:columns="i.children[0]" customTable cornerText="序号" LeftWidth="104rpx" @rowClick="handleRowClick" :tableIndex="index"
:data="i.children" hasFooter @clickAdd="addItem(index)" :maxLength="i.rules.maxLength">
titleKey="label" <template v-slot:customCell="{ row, colIndex }">
tableStyle="padding-right:32rpx"
customTable
cornerText="序号"
LeftWidth="104rpx"
@rowClick="handleRowClick"
:tableIndex="index"
hasFooter
@clickAdd="addItem(index)"
:maxLength="i.rules.maxLength"
>
<template v-slot:customCell="{row, colIndex}">
<text>{{ formatValue(row[colIndex].value) }}</text> <text>{{ formatValue(row[colIndex].value) }}</text>
<template v-if="row[colIndex].unit && formatValue(row[colIndex].value) != '-'"> <template v-if="row[colIndex].unit && formatValue(row[colIndex].value) != '-'">
<text class="unit">{{ row[colIndex].unit }}</text> <text class="unit">{{ row[colIndex].unit }}</text>
...@@ -50,20 +33,14 @@ ...@@ -50,20 +33,14 @@
</view> </view>
<view class="footer"> <view class="footer">
<Footer> <Footer>
<view <view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
class="btn" <view class="btn" @click="$emit('submitReport', list)" v-else>保存</view>
@click="$emit('submitReport',list)"
>保存</view>
</Footer> </Footer>
</view> </view>
</template> </template>
<nothing v-else /> <nothing v-else />
</template> </template>
<EditForm <EditForm ref="editForm" @onDel="delItem" @onConfirm="confirm" />
ref="editForm"
@onDel="delItem"
@onConfirm="confirm"
/>
</view> </view>
</template> </template>
...@@ -81,17 +58,19 @@ export default { ...@@ -81,17 +58,19 @@ export default {
templateData: { templateData: {
type: Array, type: Array,
default: () => [] default: () => []
} },
ReportStatus: null
}, },
data () { data() {
return { return {
loadComplete: false, loadComplete: false,
list: [] list: [],
saveBtn: true
} }
}, },
watch: { watch: {
templateData: { templateData: {
handler (val) { handler(val) {
this.loadComplete = false this.loadComplete = false
this.list = utils.deepClone(val) this.list = utils.deepClone(val)
setTimeout(() => { setTimeout(() => {
...@@ -100,31 +79,46 @@ export default { ...@@ -100,31 +79,46 @@ export default {
}, },
immediate: true, immediate: true,
deep: true deep: true
},
ReportStatus: {
handler(val) {
this.saveBtn = val != 1
},
immediate: true,
deep: true
},
saveBtn: {
handler(val) {
this.$emit('getSaveBtnStatus', val)
},
immediate: true,
deep: true
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
handleRowClick (row, rowIndex, index) { handleRowClick(row, rowIndex, index) {
let parent = this.list[index] let parent = this.list[index]
this.$refs.editForm.open(row, rowIndex, index, parent) this.$refs.editForm.open(row, rowIndex, index, parent)
}, },
delItem (c_index, index) { delItem(c_index, index) {
this.list[index].children.splice(c_index, 1) this.list[index].children.splice(c_index, 1)
}, },
addItem (index) { addItem(index) {
let { templateData } = this, let { templateData, saveBtn } = this,
parent = this.list[index] parent = this.list[index]
if(!saveBtn) return
this.list[index].children.push(templateData[index].origin_children) this.list[index].children.push(templateData[index].origin_children)
let data = this.list[index].children[this.list[index].children.length - 1], let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1 c_index = this.list[index].children.length - 1
this.$refs.editForm.open(data, c_index, index, parent) this.$refs.editForm.open(data, c_index, index, parent)
}, },
confirm (data, c_index, index) { confirm(data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data)) this.$set(this.list[index].children, c_index, utils.deepClone(data))
}, },
formatValue (value) { formatValue(value) {
return value !== null && value !=='' && value !== undefined ? value : '-' return value !== null && value !== '' && value !== undefined ? value : '-'
} }
} }
} }
...@@ -134,6 +128,7 @@ export default { ...@@ -134,6 +128,7 @@ export default {
.daily-report { .daily-report {
height: 100%; height: 100%;
position: relative; position: relative;
&-container { &-container {
height: calc(100% - #{toRpx(184)}); height: calc(100% - #{toRpx(184)});
padding: 0 48rpx; padding: 0 48rpx;
...@@ -141,22 +136,27 @@ export default { ...@@ -141,22 +136,27 @@ export default {
overflow-y: auto; overflow-y: auto;
transform: translateY(48rpx); transform: translateY(48rpx);
} }
.common-title { .common-title {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
} }
.list-box { .list-box {
width: 100%; width: 100%;
border-radius: 16rpx; border-radius: 16rpx;
background: #fff; background: #fff;
padding: 0 0 32rpx 32rpx; padding: 0 0 32rpx 32rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
.list-title { .list-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
line-height: 44rpx; line-height: 44rpx;
padding: 32rpx 32rpx 24rpx 0; padding: 32rpx 32rpx 24rpx 0;
transition: all .25s ease-in-out;
.add { .add {
margin-left: auto; margin-left: auto;
height: 64rpx; height: 64rpx;
...@@ -168,11 +168,13 @@ export default { ...@@ -168,11 +168,13 @@ export default {
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
color: #2c66f7; color: #2c66f7;
&-icon { &-icon {
position: relative; position: relative;
width: 28rpx; width: 28rpx;
height: 28rpx; height: 28rpx;
margin-right: 10rpx; margin-right: 10rpx;
&::before, &::before,
&::after { &::after {
position: absolute; position: absolute;
...@@ -183,24 +185,36 @@ export default { ...@@ -183,24 +185,36 @@ export default {
background: #4673ff; background: #4673ff;
border-radius: 4rpx; border-radius: 4rpx;
} }
&::before { &::before {
width: 4rpx; width: 4rpx;
height: 28rpx; height: 28rpx;
} }
&::after { &::after {
width: 28rpx; width: 28rpx;
height: 4rpx; height: 4rpx;
} }
} }
} }
.disabled{
opacity: .5;
}
} }
} }
.no-child { .no-child {
padding-bottom: 0; padding-bottom: 0;
.list-title {
padding-bottom: 32rpx;
}
} }
.footer { .footer {
transform: translateY(48rpx); transform: translateY(48rpx);
height: 136rpx; height: 136rpx;
.btn { .btn {
margin: 0 168rpx; margin: 0 168rpx;
width: 100%; width: 100%;
...@@ -214,6 +228,11 @@ export default { ...@@ -214,6 +228,11 @@ export default {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
} }
.default-btn {
background: #3b73ff1a;
color: #4673ff;
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
<Detail :templateData="templateData" /> <Detail :templateData="templateData" />
</template> </template>
<template v-else> <template v-else>
<Edit <Edit :templateData="templateData" @submitReport="submitReport" @getSaveBtnStatus="saveBtnStatus = $event" :ReportStatus="ReportStatus" />
:templateData="templateData"
@submitReport="submitReport"
/>
</template> </template>
</view> </view>
</template> </template>
...@@ -21,15 +18,14 @@ export default { ...@@ -21,15 +18,14 @@ export default {
mixins: [mixins], mixins: [mixins],
name: 'NegotiationDetail', name: 'NegotiationDetail',
data () { data() {
return { return {
} }
}, },
computed: { computed: {
}, },
mounted () { mounted() {
this.loadComplete = true
}, },
methods: { methods: {
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value"> <view class="value">
<text>{{ formatValue(item.value) }}</text> <text>{{ formatValue(item.value) }}</text>
<template v-if="item.unit"> <template v-if="item.unit && formatValue(item.value) != '-'">
<text class="unit">{{ item.unit }}</text> <text class="unit">{{ item.unit }}</text>
</template> </template>
</view> </view>
......
...@@ -18,18 +18,20 @@ ...@@ -18,18 +18,20 @@
</template> </template>
<template v-else> <template v-else>
<FormItem :formItem="i" :rules="i.rules" @onSelect="onSelect($event, index)" <FormItem :formItem="i" :rules="i.rules" @onSelect="onSelect($event, index)"
@onInput="onInput($event, index)" :disabled="itemDisabled(i)" /> @onInput="onInput($event, index)" :disabled="itemDisabled(i)" :readonly="!saveBtn" />
</template> </template>
</template> </template>
<template v-else> <template v-else>
<view class="list-title flex">
{{ i.label }}
</view>
<template v-if="i.children.length"> <template v-if="i.children.length">
<template v-for="(c, c_index) in i.children"> <view class="list-title flex">
<FormItem class="form-item" :formItem="c" :key="c_index" :rules="i.childrenRules[c.key]" {{ i.label }}
@onSelect="onSelect($event, index, c_index)" @onInput="onInput($event, index, c_index)" </view>
:disabled="itemDisabled(c)" /> <template v-if="i.children.length">
<template v-for="(c, c_index) in i.children">
<FormItem class="form-item" :formItem="c" :key="c_index" :rules="i.childrenRules[c.key]"
@onSelect="onSelect($event, index, c_index)" @onInput="onInput($event, index, c_index)"
:disabled="itemDisabled(c)" :readonly="!saveBtn" />
</template>
</template> </template>
</template> </template>
</template> </template>
...@@ -38,7 +40,8 @@ ...@@ -38,7 +40,8 @@
</view> </view>
<view class="footer"> <view class="footer">
<Footer> <Footer>
<view class="btn" @click="$emit('submitReport', list)">保存</view> <view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<view class="btn" @click="$emit('submitReport', list)" v-else>保存</view>
</Footer> </Footer>
</view> </view>
</template> </template>
...@@ -62,12 +65,14 @@ export default { ...@@ -62,12 +65,14 @@ export default {
templateData: { templateData: {
type: Array, type: Array,
default: () => [] default: () => []
} },
ReportStatus: null
}, },
data() { data() {
return { return {
loadComplete: false, loadComplete: false,
list: [] list: [],
saveBtn: true
} }
}, },
watch: { watch: {
...@@ -75,13 +80,26 @@ export default { ...@@ -75,13 +80,26 @@ export default {
handler(val) { handler(val) {
this.loadComplete = false this.loadComplete = false
this.list = utils.deepClone(val) this.list = utils.deepClone(val)
console.log(this.list)
setTimeout(() => { setTimeout(() => {
this.loadComplete = true this.loadComplete = true
}, 200) }, 200)
}, },
immediate: true, immediate: true,
deep: true deep: true
},
ReportStatus: {
handler(val) {
this.saveBtn = val != 1
},
immediate: true,
deep: true
},
saveBtn: {
handler(val) {
this.$emit('getSaveBtnStatus', val)
},
immediate: true,
deep: true
} }
}, },
mounted() { mounted() {
...@@ -285,6 +303,11 @@ export default { ...@@ -285,6 +303,11 @@ export default {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
} }
.default-btn {
background: #3b73ff1a;
color: #4673ff;
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<view class="report-content "> <view class="report-content ">
<template v-if="!isToday"> <template v-if="!editableDate">
<Detail :templateData="templateData" /> <Detail :templateData="templateData" />
</template> </template>
<template v-else> <template v-else>
<Edit <Edit :templateData="templateData" @submitReport="submitReport" @getSaveBtnStatus="saveBtnStatus = $event"
:templateData="templateData" :ReportStatus="ReportStatus" />
@submitReport="submitReport"
/>
</template> </template>
</view> </view>
</template> </template>
...@@ -20,15 +18,15 @@ export default { ...@@ -20,15 +18,15 @@ export default {
components: { Detail, Edit }, components: { Detail, Edit },
mixins: [mixins], mixins: [mixins],
name: 'StaffDailyReport', name: 'StaffDailyReport',
data () { data() {
return { return {
} }
}, },
computed: { computed: {
}, },
mounted () { mounted() {
this.loadComplete = true
}, },
methods: { methods: {
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value flex"> <view class="value flex">
<text class="value-text">{{ formatValue(item.value) }}</text> <text class="value-text">{{ formatValue(item.value) }}</text>
<template v-if="item.unit"> <template v-if="item.unit && formatValue(item.value) != '-'">
<text class="unit">{{ item.unit }}</text> <text class="unit">{{ item.unit }}</text>
</template> </template>
</view> </view>
......
<template> <template>
<view class="report-content "> <view class="report-content ">
<view :class="['report-component',{'opacity':showNegotiationList}]"> <view :class="['report-component', { 'opacity': showNegotiationList }, { 'show': showReport }]">
<template v-if="!isToday || ReportStatus == 1"> <template v-if="!isToday || ReportStatus == 1">
<Detail :templateData="templateData" /> <Detail :templateData="templateData" />
</template> </template>
<template v-else> <template v-else>
<Edit <Edit :templateData="templateData" @showNegotiationList="changeComponent(true)" @saveReport="saveReport"
:templateData="templateData" @submitReport="submitReport" :reportDate="currentDate" :ReportStatus="ReportStatus"
@showNegotiationList="changeComponent(true)" @getSaveBtnStatus="saveBtnStatus = $event" />
@saveReport="saveReport"
@submitReport="submitReport"
:reportDate="currentDate"
/>
</template> </template>
</view> </view>
<template v-if="showNegotiationList"> <template v-if="showNegotiationList">
<NegotiationList <NegotiationList :currentDate="currentDate" @back="changeComponent(false)" />
:currentDate="currentDate"
@back="changeComponent(false)"
/>
</template> </template>
</view> </view>
</template> </template>
...@@ -34,9 +27,10 @@ export default { ...@@ -34,9 +27,10 @@ export default {
components: { Detail, Edit, NegotiationList }, components: { Detail, Edit, NegotiationList },
mixins: [mixins], mixins: [mixins],
name: 'StoreDailyReport', name: 'StoreDailyReport',
data () { data() {
return { return {
showNegotiationList: false showNegotiationList: false,
showReport: true
} }
}, },
...@@ -45,7 +39,7 @@ export default { ...@@ -45,7 +39,7 @@ export default {
}, },
watch: { watch: {
currentDate: { currentDate: {
handler (val) { handler(val) {
if (val) { if (val) {
this.showNegotiationList = false this.showNegotiationList = false
this.$emit('changeComponent', { title: '', icon: '' }) this.$emit('changeComponent', { title: '', icon: '' })
...@@ -53,13 +47,25 @@ export default { ...@@ -53,13 +47,25 @@ export default {
}, },
immediate: true, immediate: true,
deep: true deep: true
},
ReportStatus: {
handler(val) {
this.saveBtnStatus = val !== 1
},
immediate: true,
deep: true
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
changeComponent (val) { changeComponent(val) {
this.showNegotiationList = val if (!val) {
setTimeout(() => { this.showNegotiationList = false }, 450)
}
else this.showNegotiationList = true
this.showReport = !val
this.$emit('changeComponent', { this.$emit('changeComponent', {
title: val ? '洽谈明细表' : '', title: val ? '洽谈明细表' : '',
icon: val ? 'negotiation-detail' : '' icon: val ? 'negotiation-detail' : ''
...@@ -74,9 +80,14 @@ export default { ...@@ -74,9 +80,14 @@ export default {
.report-component { .report-component {
height: 100%; height: 100%;
position: relative; position: relative;
transition: all 0.5s ease-in-out;
} }
.opacity { .opacity {
opacity: 0; left: -100%;
visibility: hidden; }
.show {
left: 0;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<view class="list"> <view :class="['list', { out: isOut }]">
<view class="common-title"> <view class="common-title">
</view> </view>
<view class="list-box"> <view class="list-box">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</view> </view>
<view class="footer"> <view class="footer">
<Footer> <Footer>
<view class="btn" @click="$emit('back')">返回</view> <view class="btn" @click="back">返回</view>
</Footer> </Footer>
</view> </view>
</view> </view>
...@@ -41,7 +41,7 @@ import utils from '@/utils/utils' ...@@ -41,7 +41,7 @@ import utils from '@/utils/utils'
export default { export default {
name: 'negotiationList', name: 'negotiationList',
components: { Nothing, Footer, Table }, components: { Nothing, Footer, Table },
inject: ['userInfo'], inject: ['userInfo','sceneType'],
props: { props: {
currentDate: { currentDate: {
...@@ -55,6 +55,7 @@ export default { ...@@ -55,6 +55,7 @@ export default {
if (val) { if (val) {
this.getDiscussionStaffList(val) this.getDiscussionStaffList(val)
this.currentIndex = 0 this.currentIndex = 0
this.isOut = false
} }
}, },
immediate: true, immediate: true,
...@@ -67,7 +68,8 @@ export default { ...@@ -67,7 +68,8 @@ export default {
staffList: [], staffList: [],
loadComplete: false, loadComplete: false,
currentIndex: 0, currentIndex: 0,
list: [] list: [],
isOut: false
} }
}, },
mounted() { mounted() {
...@@ -81,9 +83,11 @@ export default { ...@@ -81,9 +83,11 @@ export default {
async getDiscussionStaffList(reportDate) { async getDiscussionStaffList(reportDate) {
this.loadComplete = false this.loadComplete = false
const { shopMerchantId } = this.userInfo, const { shopMerchantId } = this.userInfo,
{sceneType} = this,
data = await uni.$api.dailyTemplateApi.getDiscussionStaffList({ data = await uni.$api.dailyTemplateApi.getDiscussionStaffList({
merchantId: shopMerchantId, merchantId: shopMerchantId,
reportDate reportDate,
sceneType
}) })
this.staffList = data || [] this.staffList = data || []
this.loadComplete = true this.loadComplete = true
...@@ -92,12 +96,13 @@ export default { ...@@ -92,12 +96,13 @@ export default {
}, },
async getReportDetail(item) { async getReportDetail(item) {
const { shopMerchantId } = this.userInfo, const { shopMerchantId } = this.userInfo,
{ currentDate } = this, { currentDate, sceneType } = this,
data = await uni.$api.dailyTemplateApi.getReportDetail({ data = await uni.$api.dailyTemplateApi.getReportDetail({
merchantId: shopMerchantId, merchantId: shopMerchantId,
staffUuid: item.staffUuid, staffUuid: item.staffUuid,
templateType: 3, templateType: 3,
reportDate: currentDate reportDate: currentDate,
sceneType
}) })
if (data) { if (data) {
let list = JSON.parse(data.jsonContent || '[]') let list = JSON.parse(data.jsonContent || '[]')
...@@ -151,6 +156,10 @@ export default { ...@@ -151,6 +156,10 @@ export default {
this.list = list this.list = list
} }
}, },
back() {
this.isOut = true
this.$emit('back')
}
} }
} }
</script> </script>
...@@ -244,6 +253,10 @@ export default { ...@@ -244,6 +253,10 @@ export default {
} }
} }
.list.out {
animation: list-right-out 0.5s ease-in-out;
}
@keyframes list-left-in { @keyframes list-left-in {
0% { 0% {
left: 100%; left: 100%;
...@@ -253,4 +266,14 @@ export default { ...@@ -253,4 +266,14 @@ export default {
left: 0; left: 0;
} }
} }
@keyframes list-right-out {
0% {
left: 0;
}
100% {
left: 100%;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</view> </view>
<template v-if="hasFooter"> <template v-if="hasFooter">
<view class="footer-row" :style="{ width: tableWidth }" v-if="maxLength && tableData.length < maxLength"> <view class="footer-row" :style="{ width: tableWidth }" v-if="maxLength && tableData.length < maxLength">
<view class="add" @click="$emit('clickAdd')"></view> <view :class="['add', { 'disabled': disabled }]" @click="add"></view>
</view> </view>
</template> </template>
</view> </view>
...@@ -113,6 +113,10 @@ export default { ...@@ -113,6 +113,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
disabled: {
type: Boolean,
default: false
},
}, },
data() { data() {
return { return {
...@@ -141,11 +145,15 @@ export default { ...@@ -141,11 +145,15 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
add() {
if (this.disabled) return
this.$emit('clickAdd')
},
formatValue(value) { formatValue(value) {
return value !== null && value !== '' && value !== undefined ? value : '-' return value !== null && value !== '' && value !== undefined ? value : '-'
}, },
handleRowClick(row, rowIndex) { handleRowClick(row, rowIndex) {
if (this.isDetail) return if (this.isDetail || this.disabled) return
// 清除之前的定时器 // 清除之前的定时器
if (this.clickTimer) { if (this.clickTimer) {
clearTimeout(this.clickTimer) clearTimeout(this.clickTimer)
...@@ -352,4 +360,8 @@ export default { ...@@ -352,4 +360,8 @@ export default {
.is-detail { .is-detail {
color: #999 !important; color: #999 !important;
} }
.disabled {
opacity: .5;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -104,7 +104,10 @@ export default { ...@@ -104,7 +104,10 @@ export default {
const baseSceneCode = uni.$storage.get('baseSceneCode') const baseSceneCode = uni.$storage.get('baseSceneCode')
return baseSceneCode return baseSceneCode
}, },
STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode
},
title() { title() {
return { return {
staffdailyreport: '驻店日报', staffdailyreport: '驻店日报',
...@@ -171,26 +174,21 @@ export default { ...@@ -171,26 +174,21 @@ export default {
} }
) )
}, },
back() { async back() {
let now = dayjs().format('YYYY-MM-DD') const openNotice = await this.checkReport()
if (this.currentDate == now) { if (openNotice) this.exitInterception()
if (this.templateType == 2) { else this.backPage()
if (this.reportStatus != 1) this.exitInterception()
else this.backPage()
} else {
this.exitInterception()
}
} else this.backPage()
}, },
async getReportList() { async getReportList() {
const { uuid, shopMerchantId } = this.userInfo, const { uuid, shopMerchantId } = this.userInfo,
{ templateType, dayList } = this { templateType, dayList, SCENE_TYPE: sceneType } = this
const data = await uni.$api.dailyTemplateApi.getReportList({ const data = await uni.$api.dailyTemplateApi.getReportList({
merchantId: shopMerchantId, merchantId: shopMerchantId,
staffUuid: uuid, staffUuid: uuid,
templateType, templateType,
reportStartDate: dayList[0], reportStartDate: dayList[0],
reportEndDate: dayList[dayList.length - 1] reportEndDate: dayList[dayList.length - 1],
sceneType
}) })
let selectedDay = [] let selectedDay = []
dayList.map(e => { dayList.map(e => {
...@@ -210,8 +208,9 @@ export default { ...@@ -210,8 +208,9 @@ export default {
const setA = new Set(arrA) const setA = new Set(arrA)
return arrB.every(item => setA.has(item)) return arrB.every(item => setA.has(item))
} }
const { templateType, CAR_BRAND_ID, BASE_SCENE_CODE } = this, const { templateType, CAR_BRAND_ID, BASE_SCENE_CODE ,STORE_BASE_SCENE_CODE } = this,
data = await uni.$api.dailyTemplateApi.getDailyTemplate(templateType) data = await uni.$api.dailyTemplateApi.getDailyTemplate(templateType),
baseCode = templateType == 2 ? STORE_BASE_SCENE_CODE : BASE_SCENE_CODE
let templateData = Object.values(data) let templateData = Object.values(data)
// .filter(item => { // .filter(item => {
// // 场景类型过滤 // // 场景类型过滤
...@@ -226,34 +225,39 @@ export default { ...@@ -226,34 +225,39 @@ export default {
} }
}) })
.filter(item => { .filter(item => {
if (item.type == 'subform' && item.children.length) {
item.children[0] = item.children[0].filter(child => {
return child.brandId?.length ? hasCommonElement(child.brandId, CAR_BRAND_ID) : true
}).filter(child => {
return child.baseSceneCode?.length ? hasCommonElement(child.baseSceneCode, baseCode) : true
})
}
if (item.type == 'group' && item.children.length) { if (item.type == 'group' && item.children.length) {
item.children = item.children item.children = item.children.filter(child => {
.filter(child => { // 品牌过滤
// 品牌过滤 if (child.filterBrandId && child.filterBrandId.length) {
if (child.filterBrandId && child.filterBrandId.length) { return !isSubset(child.filterBrandId, CAR_BRAND_ID)
return !isSubset(child.filterBrandId, CAR_BRAND_ID) } else {
} else { return child.brandId?.length ? hasCommonElement(child.brandId, CAR_BRAND_ID) : true
return child.brandId?.length ? hasCommonElement(child.brandId, CAR_BRAND_ID) : true }
} }).filter(child => {
}) // 基础场景代码过滤
.filter(child => { return child.baseSceneCode.length ? hasCommonElement(child.baseSceneCode, baseCode) : true
// 基础场景代码过滤 })
return child.baseSceneCode.length ? hasCommonElement(child.baseSceneCode, BASE_SCENE_CODE) : true
})
} }
// 基础场景代码过滤 // 基础场景代码过滤
if (item.type == 'divider') { if (item.type == 'divider') {
if (!item.qgCode) { if (!item.qgCode) {
let hasQY = hasCommonElement(item.qyCode, BASE_SCENE_CODE), let hasQY = hasCommonElement(item.qyCode, baseCode),
hasYB = hasCommonElement(item.ybCode, BASE_SCENE_CODE) hasYB = hasCommonElement(item.ybCode, baseCode)
if (item.isQY || item.isYB) { if (item.isQY || item.isYB) {
if (item.isQY) return hasQY && !hasYB if (item.isQY) return hasQY && !hasYB
if (item.isYB) return hasYB && !hasQY if (item.isYB) return hasYB && !hasQY
} else return hasQY && hasYB } else return hasQY && hasYB
} else { } else {
return hasCommonElement(item.qgCode, BASE_SCENE_CODE) return hasCommonElement(item.qgCode, baseCode)
} }
} else return item.baseSceneCode?.length ? hasCommonElement(item.baseSceneCode, BASE_SCENE_CODE) : true } else return item.baseSceneCode?.length ? hasCommonElement(item.baseSceneCode, baseCode) : true
}) })
templateData.map(e => { templateData.map(e => {
if (e.children && e.type == 'subform') { if (e.children && e.type == 'subform') {
...@@ -274,16 +278,16 @@ export default { ...@@ -274,16 +278,16 @@ export default {
this.getReportDetail() this.getReportDetail()
}, },
async checkReport() { async checkReport() {
let { templateType, reportStatus } = this, let componentRef = this.$refs[`ref-${this.componentName}`],
currentComponent = this.$refs[`ref-${this.componentName}`] { templateData, templateType, currentDate } = this
if (currentComponent.isToday) { if (templateType != 1) {
if (templateType == 2) { if (!componentRef.isToday) return false
return reportStatus != 1 } else {
} else { let lastDay = dayjs().subtract(7, 'day')
return true if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false
}
} }
return false return templateData.length ? componentRef.saveBtnStatus : false
}, },
async changeDate(e) { async changeDate(e) {
if (e.fullDate == this.currentDate) return if (e.fullDate == this.currentDate) return
...@@ -326,16 +330,18 @@ export default { ...@@ -326,16 +330,18 @@ export default {
}, },
async getReportDetail() { async getReportDetail() {
this.reportStatus = '' this.reportStatus = ''
this.dailyReportRecordId = ''
uni.showLoading({ title: '加载中...', mask: true }) uni.showLoading({ title: '加载中...', mask: true })
try { try {
const { uuid, shopMerchantId } = this.userInfo, const { uuid, shopMerchantId } = this.userInfo,
nowDate = dayjs().format('YYYY-MM-DD'), nowDate = dayjs().format('YYYY-MM-DD'),
{ templateType, currentDate } = this, { templateType, currentDate, SCENE_TYPE: sceneType } = this,
data = await uni.$api.dailyTemplateApi.getReportDetail({ data = await uni.$api.dailyTemplateApi.getReportDetail({
merchantId: shopMerchantId, merchantId: shopMerchantId,
staffUuid: uuid, staffUuid: uuid,
templateType, templateType,
reportDate: currentDate reportDate: currentDate,
sceneType
}) })
if (data) { if (data) {
...@@ -367,10 +373,16 @@ export default { ...@@ -367,10 +373,16 @@ export default {
} }
}) })
this.templateData = templateData this.templateData = templateData
console.log(templateData)
} else { } else {
if (nowDate == currentDate) this.getDailyTemplate() if (this.templateType == 1) {
else uni.hideLoading() let lastDay = dayjs().subtract(7, 'day')
if (lastDay.isBefore(dayjs(currentDate), 'day')) this.getDailyTemplate()
else uni.hideLoading()
} else {
if (nowDate == currentDate) this.getDailyTemplate()
else uni.hideLoading()
}
} }
} catch (error) { } catch (error) {
uni.showToast({ title: error, icon: 'none', mask: true }) uni.showToast({ title: error, icon: 'none', mask: true })
...@@ -498,6 +510,7 @@ export default { ...@@ -498,6 +510,7 @@ export default {
height: toRpx(144); height: toRpx(144);
justify-content: start; justify-content: start;
padding-left: toRpx(32); padding-left: toRpx(32);
transition: all 0.5s ease-in-out;
.sprite-icon { .sprite-icon {
margin-right: toRpx(24); margin-right: toRpx(24);
......
...@@ -7,7 +7,8 @@ export default { ...@@ -7,7 +7,8 @@ export default {
data() { data() {
return { return {
dayjs, dayjs,
nowDate: dayjs().format('YYYY-MM-DD') nowDate: dayjs().format('YYYY-MM-DD'),
saveBtnStatus: false
} }
}, },
props: { props: {
...@@ -19,12 +20,18 @@ export default { ...@@ -19,12 +20,18 @@ export default {
ReportStatus: null ReportStatus: null
}, },
computed: { computed: {
/**可编辑日期 */
editableDate() {
let lastDay = dayjs().subtract(7, 'day'),
{ currentDate } = this
return lastDay.isBefore(dayjs(currentDate), 'day')
},
isToday() { isToday() {
return this.currentDate == this.nowDate return this.currentDate == this.nowDate
}, },
reportParams() { reportParams() {
let { shopMerchantId, shopMerchantName, uuid, name } = this.userInfo, let { shopMerchantId, shopMerchantName, uuid, name, merchantId, merchantName } = this.userInfo,
{ currentDate, templateType, dailyReportRecordId } = this, { currentDate, templateType, dailyReportRecordId, sceneType } = this,
params = { params = {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName: shopMerchantName, merchantName: shopMerchantName,
...@@ -32,7 +39,10 @@ export default { ...@@ -32,7 +39,10 @@ export default {
staffUuid: uuid, staffUuid: uuid,
staffName: name, staffName: name,
dailyReportSource: 2, //1:生意助手员工版小程序,2:平板电脑 dailyReportSource: 2, //1:生意助手员工版小程序,2:平板电脑
templateType: templateType() templateType: templateType(),
yqMerchantId: merchantId,
yqMerchantName: merchantName,
sceneType
} }
if (dailyReportRecordId()) params.dailyReportRecordId = dailyReportRecordId() if (dailyReportRecordId()) params.dailyReportRecordId = dailyReportRecordId()
return params return params
...@@ -111,13 +121,12 @@ export default { ...@@ -111,13 +121,12 @@ export default {
uni.showToast({ title: error, icon: 'none', mask: true }) uni.showToast({ title: error, icon: 'none', mask: true })
} }
}, },
submitReport(res) { async submitReport(res) {
try { try {
const phoneRegex = /^1[3456789]\d{9}$/ const phoneRegex = /^1[3456789]\d{9}$/
uni.showLoading({ title: '提交中...', mask: true }) uni.showLoading({ title: '提交中...', mask: true })
let { reportParams } = this, let { reportParams } = this,
list = utils.deepClone(res) list = utils.deepClone(res)
console.log('提交日报', list)
let jsonContent = JSON.stringify(list) let jsonContent = JSON.stringify(list)
let requestJson = buildAppNormalizedListsFromJsonContent(jsonContent) let requestJson = buildAppNormalizedListsFromJsonContent(jsonContent)
list.map(e => { list.map(e => {
...@@ -169,6 +178,18 @@ export default { ...@@ -169,6 +178,18 @@ export default {
if (e.type == 'subform') delete e.children if (e.type == 'subform') delete e.children
}) })
const { shopMerchantId } = this.userInfo,
{ sceneType } = this,
carBrandList = await uni.$api.boutiqueApi.getDailyReportCarBrand({
merchantId: shopMerchantId,
sceneType
}) || []
requestJson.carBrandList = carBrandList.map(({ firstBrandId, firstBrandName, brandId, brandName }) => ({
firstBrandId,
firstBrandName,
brandId,
brandName
}))
reportParams.jsonContent = JSON.stringify(list) reportParams.jsonContent = JSON.stringify(list)
reportParams.requestJson = JSON.stringify(requestJson) reportParams.requestJson = JSON.stringify(requestJson)
console.log('提交日报', reportParams) console.log('提交日报', reportParams)
......
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
customerKey: Date.now(), //客户信息KEY customerKey: Date.now(), //客户信息KEY
currentCarInfo: {},//当前选中的车品牌车系 currentCarInfo: {},//当前选中的车品牌车系
carBrandOpenStatus: false, // 车品牌选择弹窗是否打开 carBrandOpenStatus: false, // 车品牌选择弹窗是否打开
newReport: false, // 是否新日报
}; };
}, },
mutations: { mutations: {
...@@ -97,6 +98,9 @@ export default { ...@@ -97,6 +98,9 @@ export default {
setCarBrandOpenStatus (state, value) { setCarBrandOpenStatus (state, value) {
state.carBrandOpenStatus = value; state.carBrandOpenStatus = value;
}, },
setNewReport (state, value) {
state.newReport = value;
},
}, },
actions: { actions: {
...@@ -138,5 +142,9 @@ export default { ...@@ -138,5 +142,9 @@ export default {
setCarBrandOpenStatus ({ commit }, value) { setCarBrandOpenStatus ({ commit }, value) {
commit('setCarBrandOpenStatus', value) commit('setCarBrandOpenStatus', value)
}, },
setNewReport ({ commit }, value) {
commit('setNewReport', value)
},
}, },
}; };
...@@ -46,5 +46,6 @@ export const STORAGE_OBJECTKEY = { ...@@ -46,5 +46,6 @@ export const STORAGE_OBJECTKEY = {
boutique_YQorderSetting: 'boutique_YQorderSetting', boutique_YQorderSetting: 'boutique_YQorderSetting',
sessionId: 'sessionId', sessionId: 'sessionId',
createAllGoodsFlag: 'createAllGoodsFlag', createAllGoodsFlag: 'createAllGoodsFlag',
baseSceneCode: 'baseSceneCode', baseSceneCode: 'baseSceneCode', //员工场景小分类
storeBaseSceneCode: 'storeBaseSceneCode', //门店场景小分类
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!