Commit c84b5941 by cen

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

2 parents f62f1224 9980c3e1
...@@ -610,4 +610,23 @@ module.exports = { ...@@ -610,4 +610,23 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 检查今天是否在T1-T5之间
*/
checkTodayInT1T5(data={}) {
return http.post({
method: 'dj.api.staff.miniprogram.salaryapply.daily.report.fill.check',
projectName: 'staffMiniprogram',
...data,
})
},
// 工资申诉入口判断
getWageAppealEntrance(data={}) {
return http.post({
method: 'dj.staff.api.has.performance.config.formerchant',
projectName: 'staffMiniprogram',
...data,
})
},
} }
...@@ -30,11 +30,20 @@ export default { ...@@ -30,11 +30,20 @@ export default {
} }
}, },
data() { data() {
return {} return {
// 工资申诉入口是否允许显示
wageAppealAllowed: false,
// 工资申诉入口加载中,加载完成前不展示避免误显示
loadingEntrance: true
}
},
created() {
// 组件创建时请求工资申诉入口权限
this.fetchWageAppealEntrance()
}, },
computed: { computed: {
entranceList() { entranceList() {
let { sceneType } = uni.$storage.get('userInfo'), let { sceneType } = uni.$storage.get('userInfo') || {},
entranceList = [ entranceList = [
{ {
icon: 'daily-report', icon: 'daily-report',
...@@ -93,10 +102,45 @@ export default { ...@@ -93,10 +102,45 @@ export default {
sceneType: [7] sceneType: [7]
} }
] ]
return entranceList.filter(e => e.sceneType.includes(sceneType)) // 先根据场景过滤
let list = entranceList.filter(e => e.sceneType.includes(sceneType))
// 加载阶段或不允许显示时,移除工资申诉入口
if (this.loadingEntrance || !this.wageAppealAllowed) {
list = list.filter(e => e.name !== 'WageAppeal')
}
return list
} }
}, },
methods: { methods: {
// 请求工资申诉入口权限,并设置显示开关
async fetchWageAppealEntrance() {
try {
this.loadingEntrance = true
const userInfo = uni.$storage.get('userInfo') || {}
const { shopMerchantId } = userInfo
// 缺少商户ID时降级为不展示
if (!shopMerchantId) {
this.wageAppealAllowed = false
return
}
const res = await uni.$api.commonApi.getWageAppealEntrance({
merchantId: shopMerchantId
})
// 兼容不同返回结构,解析是否允许显示
this.wageAppealAllowed = !!res
} catch (error) {
// 接口异常降级:不展示工资申诉入口,并提示(非打断式)
this.wageAppealAllowed = false
if (error) {
uni.showToast({
title: '工资申诉入口获取失败',
icon: 'none'
})
}
} finally {
this.loadingEntrance = false
}
},
handleClick(item) { handleClick(item) {
// 这里可以根据实际需求进行跳转或功能处理 // 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item) this.$emit('entranceClick', item)
......
<!-- <!--
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-12-31 16:53:31 * @Date: 2024-12-31 16:53:31
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-17 21:26:09 * @LastEditTime: 2025-01-17 21:26:09
* @FilePath: \gl-tape\components\HomeFrame\components\Point.vue * @FilePath: \gl-tape\components\HomeFrame\components\Point.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<view class="point-container"> <view class="point-container">
<view class="tab-box"> <view class="tab-box">
<view @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view> <view @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view>
</view> </view>
<component :is="tabName" ref="centerRef" @selectTab="selectTab"></component> <component :is="tabName" ref="centerRef" @selectTab="selectTab"></component>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import Point from './Point/index.vue' import Point from './Point/index.vue'
import Income from './Income/index.vue' import Income from './Income/index.vue'
import Attendance from './Attendance/index.vue' import Attendance from './Attendance/index.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: '', name: '',
components: { components: {
Point, Point,
Income, Income,
Attendance Attendance
}, },
data () { data () {
return { return {
activeIndex: 0, activeIndex: 0,
componentList:['Attendance','Income'], componentList:['Attendance','Income'],
tabName: 'Attendance', tabName: 'Attendance',
tabList:[ tabList:[
// { {
// name:'我的积分', name:'我的考勤',
// }, },
{ ]
name:'我的考勤', }
}, },
{ computed: {
name:'我的收入', ...mapState(['point.tabIndex']),
} },
] watch: {
} '$store.state.point.tabIndex'(val) {
}, console.log(val)
computed: { this.activeIndex = val
...mapState(['point.tabIndex']), this.tabName = this.componentList[val]
}, }
watch: { },
'$store.state.point.tabIndex'(val) { mounted() {
console.log(val) this.$store.dispatch('setTab', 0)
this.activeIndex = val },
this.tabName = this.componentList[val] methods: {
} selectTab(index){
}, this.$store.dispatch('setTab', index)
mounted() { }
this.$store.dispatch('setTab', 0) },
}, }
methods: { </script>
selectTab(index){ <style scoped lang="scss">
this.$store.dispatch('setTab', index) .tab-box {
} margin-top: toRpx(68);
}, width: toRpx(290);
} height: toRpx(84);
</script> line-height: toRpx(74);
<style scoped lang="scss"> background: rgba(101, 171, 250, 0.12);
.tab-box { border-radius: toRpx(20);
margin-top: 68rpx; display: flex;
width: 550rpx; align-items: center;
height: 84rpx; justify-content: center;
line-height: 74rpx; .tab-item {
background: rgba(101, 171, 250, 0.12); font-size: toRpx(28);
border-radius: 20rpx; color: #1a1a1a;
display: flex; text-align: center;
align-items: center; width: 50%;
justify-content: center; &.active {
.tab-item { width: toRpx(260);
font-size: 28rpx; height: toRpx(72);
color: #1a1a1a; background: #ffffff;
text-align: center; border-radius: toRpx(16);
width: 50%; text-align: center;
&.active { font-weight: 600;
width: 260rpx; color: #4673ff;
height: 72rpx; }
background: #ffffff; }
border-radius: 16rpx; }
text-align: center; </style>
font-weight: 600;
color: #4673ff;
}
}
}
</style>
...@@ -617,7 +617,7 @@ export default { ...@@ -617,7 +617,7 @@ export default {
async entranceClick(item) { async entranceClick(item) {
console.log(item, 'item') console.log(item, 'item')
// 清除评估单的图片视频资源缓存 // 清除评估单的图片视频资源缓存
const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement'], const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement', 'WageAppeal'],
{ sceneType } = this { sceneType } = this
if (!noInterceptPage.includes(item.name)) { if (!noInterceptPage.includes(item.name)) {
if (sceneType != 7) { if (sceneType != 7) {
......
...@@ -164,11 +164,11 @@ function requestAndroidPermission (permissionID) { ...@@ -164,11 +164,11 @@ function requestAndroidPermission (permissionID) {
}, },
['android.permission.CAMERA']: { ['android.permission.CAMERA']: {
title: '相机', title: '相机',
content: '为了拍摄活动现场照片及客户购车凭证,展业助手需要申请您的相机权限。' content: '展业助手需要申请相机权限,用于上传相关图片资料以完成业务办理。'
}, },
['android.permission.READ_EXTERNAL_STORAGE']: { ['android.permission.READ_EXTERNAL_STORAGE']: {
title: '相册', title: '相册',
content: '为了上传活动现场照片及客户购车凭证,展业助手需要申请您的相册权限。' content: '展业助手需要申请相册权限,用于上传相关图片资料以完成业务办理。'
} }
}[permissionID] || { }[permissionID] || {
title: permissionID, title: permissionID,
......
<template> <template>
<!-- --> <!-- -->
<view class="daily-report"> <view class="daily-report">
<view class="common-title flex"> <view class="common-title flex">
填写日报 填写日报
<!-- <view class="common-title-btns flex"> <!-- <view class="common-title-btns flex">
<view class="title-btn">{{orderObj.staffName}}</view> <view class="title-btn">{{orderObj.staffName}}</view>
<view class="title-btn">轻改</view> <view class="title-btn">轻改</view>
</view> --> </view> -->
</view> </view>
<scroll-view <scroll-view
:class="['repoet-view',{full:!orderObj.isDateWithin7Days}]" :class="['repoet-view',{full:!orderObj.isDateWithin7Days}]"
scroll-y scroll-y
:scroll-into-view="to" :scroll-into-view="to"
@scroll="to = ''" @scroll="to = ''"
> >
<view class="repoet-box"> <view class="repoet-box">
<template v-if="loadComplete"> <template v-if="loadComplete">
<view :class="[{'hide-box':!orderObj.isDateWithin7Days && !orderObj.onBreak}]"> <view :class="[{'hide-box':!orderObj.isDateWithin7Days && !orderObj.onBreak}]">
<view class="box"> <view class="box">
<view class="sub-title">驻店日报</view> <view class="sub-title">驻店日报</view>
<template v-for="(i,index) in reportObject"> <template v-for="(i,index) in reportObject">
<view <view
class="form-item flex" class="form-item flex"
:key="index" :key="index"
:id="i.refId || ''" :id="i.refId || ''"
> >
<view class="label flex"> <view class="label flex">
{{i.label}} {{i.label}}
<template v-if="index == 0 || (i.required && orderObj.pickerValue == 0)"> <template v-if="index == 0 || (i.required && orderObj.pickerValue == 0)">
<view class="required">*</view> <view class="required">*</view>
</template> </template>
</view> </view>
<view class="value flex"> <view class="value flex">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input <input
class="input" class="input"
:type="i.inputType || 'text'" :type="i.inputType || 'text'"
:value="orderObj[i.value]" :value="orderObj[i.value]"
:placeholder="i.placeholder || '请输入'" :placeholder="i.placeholder || '请输入'"
placeholder-class="placeholder" placeholder-class="placeholder"
@blur="handleBlur($event, i)" @blur="handleBlur($event, i)"
:disabled="filterDisabled(isEditReport)" :disabled="filterDisabled(isEditReport)"
:maxlength="3" :maxlength="3"
:key="dateKey[i.value]" :key="dateKey[i.value]"
auto-blur auto-blur
> >
</template> </template>
<template v-else-if="i.type == 'picker'"> <template v-else-if="i.type == 'picker'">
<view class="picker flex"> <view class="picker flex">
<template v-for="(item,ind) in i.range"> <template v-for="(item,ind) in i.range">
<view <view
class="picker-item flex" class="picker-item flex"
:key="`${index}_${ind}`" :key="`${index}_${ind}`"
@click="changePicker(item.id, i)" @click="changePicker(item.id, i)"
> >
<view class="icon"> <view class="icon">
<template v-if="item.id == orderObj[i.submitValue]"> <template v-if="item.id == orderObj[i.submitValue]">
<uni-icons <uni-icons
type="checkbox-filled" type="checkbox-filled"
:size="18" :size="18"
color="#3B73FF" color="#3B73FF"
></uni-icons> ></uni-icons>
</template> </template>
<template v-else> <template v-else>
<uni-icons <uni-icons
type="circle" type="circle"
:size="18" :size="18"
color="#8C8C8C" color="#8C8C8C"
></uni-icons> ></uni-icons>
</template> </template>
</view> </view>
{{item.name}} {{item.name}}
</view> </view>
</template> </template>
</view> </view>
</template> </template>
<template v-else> <template v-else>
{{orderObj[i.value]}} {{orderObj[i.value]}}
</template> </template>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
<view class="car-band-box"> <view class="car-band-box">
<type-tab-component <type-tab-component
styleV2 styleV2
:typeList="carBandList" :typeList="carBandList"
:tabIndex.sync="tabIndex" :tabIndex.sync="tabIndex"
nameKey="tabName" nameKey="tabName"
></type-tab-component> ></type-tab-component>
<view <view
class="car-band-form-box" class="car-band-form-box"
:style="[{height: `${filterTemplateList(carBandList[tabIndex]).length * 96}rpx`}]" :style="[{height: `${filterTemplateList(carBandList[tabIndex]).length * 96}rpx`}]"
> >
<template v-for="(item,index) in carBandList"> <template v-for="(item,index) in carBandList">
<view <view
:class="['box',{show:index == tabIndex}]" :class="['box',{show:index == tabIndex}]"
:key="index" :key="index"
> >
<template v-for="(i,ind) in filterTemplateList(item)"> <template v-for="(i,ind) in filterTemplateList(item)">
<view <view
:class="['form-item flex',{name:i.name}]" :class="['form-item flex',{name:i.name}]"
:key="`${index}_${ind}`" :key="`${index}_${ind}`"
:id="i.refId ? `${i.refId}_${index}` : ''" :id="i.refId ? `${i.refId}_${index}` : ''"
> >
<view class="label flex"> <view class="label flex">
{{i.label}} {{i.label}}
<template v-if="i.required && orderObj.pickerValue == 0"> <template v-if="i.required && orderObj.pickerValue == 0">
<view class="required">*</view> <view class="required">*</view>
</template> </template>
</view> </view>
<view class="value flex"> <view class="value flex">
<template v-if="filterDisabled(isEditReport) || i.disabled"> <template v-if="filterDisabled(isEditReport) || i.disabled">
<template v-if="item[i.key] != null"> <template v-if="item[i.key] != null">
{{item[i.key] }} {{item[i.key] }}
</template> </template>
<template v-else> <template v-else>
<view class="placeholder">{{i.inputPlaceholder || '请输入'}}</view> <view class="placeholder">{{i.inputPlaceholder || '请输入'}}</view>
</template> </template>
</template> </template>
<template v-else> <template v-else>
<input <input
class="input" class="input"
:type="i.type || 'text'" :type="i.type || 'text'"
:value="item[i.key]" :value="item[i.key]"
:placeholder="i.inputPlaceholder || '请输入'" :placeholder="i.inputPlaceholder || '请输入'"
placeholder-class="placeholder" placeholder-class="placeholder"
@blur="handleCarInputBlur($event, i , item , index)" @blur="handleCarInputBlur($event, i , item , index)"
:maxlength="i.maxlength || 3" :maxlength="i.maxlength || 3"
:key="dateKey[`${i.key}_${index}`]" :key="dateKey[`${i.key}_${index}`]"
auto-blur auto-blur
> >
</template> </template>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
</template> </template>
</view> </view>
</view> </view>
<view class="box"> <view class="box">
<view class="sub-title">个人日报</view> <view class="sub-title">个人日报</view>
<view class="form-item flex"> <view class="form-item flex">
<view class="label flex"> <view class="label flex">
备注 备注
</view> </view>
<view class="value"> <view class="value">
<textarea <textarea
class="textarea" class="textarea"
v-model="orderObj.remark" v-model="orderObj.remark"
placeholder="请输入 (500字以内)" placeholder="请输入 (500字以内)"
placeholder-class="placeholder" placeholder-class="placeholder"
confirm-type="done" confirm-type="done"
auto-height auto-height
:maxlength="500" :maxlength="500"
:disabled="filterDisabled(isEditReport)" :disabled="filterDisabled(isEditReport)"
></textarea> ></textarea>
</view> </view>
</view> </view>
</view> </view>
<view class="box info"> <view class="box info">
<template v-for="(item,index) in infoObj"> <template v-for="(item,index) in infoObj">
<view <view
class="info-item" class="info-item"
:key="index" :key="index"
> >
<view class="info-label">{{item.label}}</view> <view class="info-label">{{item.label}}</view>
<view class="info-value">{{item.format()}}</view> <view class="info-value">{{item.format()}}</view>
</view> </view>
</template> </template>
</view> </view>
<view class="block"></view> <view class="block"></view>
</view> </view>
<template v-if="!orderObj.isDateWithin7Days && !orderObj.onBreak"> <template v-if="!orderObj.isDateWithin7Days && !orderObj.onBreak">
<view class="nothing flex"> <view class="nothing flex">
<image <image
src="../../../../assets/images/common/report-no-data.webp" src="../../../../assets/images/common/report-no-data.webp"
class="icon" class="icon"
/> />
已超过 7 个自然日,暂不支持补填操作 暂不支持补填操作
</view> </view>
</template> </template>
</template> </template>
</view> </view>
</scroll-view> </scroll-view>
<template v-if="orderObj.isDateWithin7Days"> <template v-if="orderObj.isDateWithin7Days">
<view class="btn-box flex"> <view class="btn-box flex">
<template v-if="filterDisabled()"> <template v-if="filterDisabled()">
<template v-if="!isEditReport"> <template v-if="!isEditReport">
<view <view
class="btn" class="btn"
@click="isEditReport = true" @click="isEditReport = true"
>编辑</view> >编辑</view>
</template> </template>
<template v-else> <template v-else>
<view <view
class="btn cancel-btn" class="btn cancel-btn"
@click="isEditReport = false" @click="isEditReport = false"
>取消</view> >取消</view>
<view <view
class="btn" class="btn"
@click="submit" @click="submit"
>保存</view> >保存</view>
</template> </template>
</template> </template>
<template v-else> <template v-else>
<view <view
class="btn" class="btn"
@click="submit" @click="submit"
>提交</view> >提交</view>
</template> </template>
</view> </view>
</template> </template>
<NoticePopup <NoticePopup
ref="reportNotice" ref="reportNotice"
:title="noticeObj.title" :title="noticeObj.title"
:text="noticeObj.text" :text="noticeObj.text"
:type="noticeObj.type || 'success'" :type="noticeObj.type || 'success'"
:buttons="noticeObj.buttons" :buttons="noticeObj.buttons"
></NoticePopup> ></NoticePopup>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
var weekday = require('dayjs/plugin/weekday') var weekday = require('dayjs/plugin/weekday')
import dayjs from 'dayjs' import dayjs from 'dayjs'
dayjs.extend(weekday) dayjs.extend(weekday)
import TypeTabComponent from '@/components/TypeTabComponent.vue' import TypeTabComponent from '@/components/TypeTabComponent.vue'
import NoticePopup from '@/components/NoticePopup.vue' import NoticePopup from '@/components/NoticePopup.vue'
export default { export default {
components: { components: {
TypeTabComponent, TypeTabComponent,
NoticePopup NoticePopup
}, },
props: { props: {
currentDate: String, currentDate: String,
currentMonth: String currentMonth: String
}, },
name: 'DailyReport', name: 'DailyReport',
data () { data () {
return { return {
noticeObj: {}, noticeObj: {},
tabIndex: 0, tabIndex: 0,
to: '', to: '',
dateKey: {}, dateKey: {},
loadComplete: false, loadComplete: false,
reportObject: Object.freeze([ reportObject: Object.freeze([
{ {
label: '当日调休', label: '当日调休',
value: 'pickerValue', value: 'pickerValue',
type: 'picker', type: 'picker',
required: true, required: true,
rangeKey: 'name', rangeKey: 'name',
range: [ range: [
{ id: 'N', name: '在岗' }, { id: 'N', name: '在岗' },
{ id: 'Y', name: '调休' } { id: 'Y', name: '调休' }
], ],
submitValue: 'onBreak' submitValue: 'onBreak'
}, },
{ {
label: '今日驻店人数(按店)', label: '今日驻店人数(按店)',
value: 'staffCount', value: 'staffCount',
type: 'input', type: 'input',
required: true, required: true,
inputType: 'number', inputType: 'number',
refId: 'staffCount' refId: 'staffCount'
}, },
]), ]),
orderObj: {}, orderObj: {},
carBandList: [], carBandList: [],
hwOhterObjArray: Object.freeze([ hwOhterObjArray: Object.freeze([
{ {
label: '店端实际交车数', label: '店端实际交车数',
key: 'deliveryCount', key: 'deliveryCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
refId: 'deliveryCount', refId: 'deliveryCount',
}, },
{ {
label: '店端总未触客数', label: '店端总未触客数',
key: 'notDeliveryCount', key: 'notDeliveryCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
refId: 'notDeliveryCount', refId: 'notDeliveryCount',
}, },
{ {
label: '实际售前触客数', label: '实际售前触客数',
key: 'equityToShopCount', key: 'equityToShopCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
inputPlaceholder: '', inputPlaceholder: '',
refId: 'equityToShopCount', refId: 'equityToShopCount',
}, },
{ {
label: '实际售后触客数', label: '实际售后触客数',
key: 'afterSaleEquityToShopCount', key: 'afterSaleEquityToShopCount',
type: 'number', type: 'number',
required: false, required: false,
min: 0, min: 0,
max: 100, max: 100,
} }
]), ]),
defaultObjArray: Object.freeze([ defaultObjArray: Object.freeze([
{ {
label: '店端实际交车数', label: '店端实际交车数',
key: 'deliveryCount', key: 'deliveryCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
refId: 'deliveryCount', refId: 'deliveryCount',
}, },
{ {
label: '实际售前触客数', label: '实际售前触客数',
key: 'equityToShopCount', key: 'equityToShopCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
inputPlaceholder: '', inputPlaceholder: '',
refId: 'equityToShopCount', refId: 'equityToShopCount',
}, },
{ {
label: '实际售后触客数', label: '实际售后触客数',
key: 'afterSaleEquityToShopCount', key: 'afterSaleEquityToShopCount',
type: 'number', type: 'number',
required: false, required: false,
min: 0, min: 0,
max: 100, max: 100,
}, },
{ {
label: '今日店端实际发券数', label: '今日店端实际发券数',
key: 'issueCouponCount', key: 'issueCouponCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
inputPlaceholder: '' inputPlaceholder: ''
}, },
{ {
label: '本月待邀约', label: '本月待邀约',
key: 'waitInviteCount', key: 'waitInviteCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 3000, max: 3000,
maxlength: 4, maxlength: 4,
inputPlaceholder: '' inputPlaceholder: ''
}, },
{ {
label: '今日流失', label: '今日流失',
key: 'customerLossCount', key: 'customerLossCount',
type: 'number', type: 'number',
required: true, required: true,
min: 0, min: 0,
max: 3000, max: 3000,
maxlength: 4, maxlength: 4,
inputPlaceholder: '' inputPlaceholder: ''
}, },
]), ]),
weeklyList: [], weeklyList: [],
isEditReport: false, isEditReport: false,
buttons: Object.freeze([ buttons: Object.freeze([
{ {
text: '返回首页', text: '返回首页',
type: 'primary' type: 'primary'
} }
]), ]),
infoObj: Object.freeze([ infoObj: Object.freeze([
{ {
label: '今日成交数', label: '今日成交数',
format: () => { format: () => {
let { carBandList, tabIndex } = this, let { carBandList, tabIndex } = this,
item = carBandList[tabIndex] || {} item = carBandList[tabIndex] || {}
return item.totalOrderCount || 0 return item.totalOrderCount || 0
} }
}, },
{ {
label: '个人成交总金额', label: '个人成交总金额',
format: _ => { format: _ => {
return `¥${this.orderObj.totalOrderMoney || 0}` return `¥${this.orderObj.totalOrderMoney || 0}`
} }
} }
]) ]),
} editableDay: null
}, }
computed: { },
userInfo () { computed: {
return uni.$storage.get("userInfo") userInfo () {
}, return uni.$storage.get("userInfo")
mouthNumber () { },
return dayjs(this.currentMonth).daysInMonth() mouthNumber () {
}, return dayjs(this.currentMonth).daysInMonth()
}, },
watch: { },
currentMonth: { watch: {
handler (val) { currentMonth: {
this.setMonthDay() handler (val) {
}, this.setMonthDay()
deep: true, },
immediate: true deep: true,
}, immediate: true
currentDate: { },
handler (val) { currentDate: {
if (this.carBandList.length) this.getStaffDailyReportDetail() handler (val) {
}, if (this.carBandList.length) this.getStaffDailyReportDetail()
deep: true, },
} deep: true,
}, }
mounted () { },
uni.$track.add({ mounted () {
eventCode: 'app_daily_report' uni.$track.add({
}) //驻店日报埋点 eventCode: 'app_daily_report'
this.initData() }) //驻店日报埋点
}, this.initData()
methods: { },
back () { methods: {
uni.navigateBack() back () {
}, uni.navigateBack()
initData () { },
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo async initData () {
this.orderObj = { let inT1T5 = await uni.$api.commonApi.checkTodayInT1T5(),
yqMerchantId: merchantId, { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo
yqMerchantName: merchantName, this.orderObj = {
staffName: name, yqMerchantId: merchantId,
staffUuid: uuid, yqMerchantName: merchantName,
merchantId: shopMerchantId, staffName: name,
merchantName: shopMerchantName staffUuid: uuid,
} merchantId: shopMerchantId,
this.getDailyReportCarBrand() merchantName: shopMerchantName
}, }
async getDailyReportCarBrand () { if (inT1T5) this.editableDay = dayjs().subtract(1, 'M').startOf('M')
let { userInfo } = this, this.getDailyReportCarBrand()
{ shopMerchantId } = userInfo },
const data = await uni.$api.boutiqueApi.getDailyReportCarBrand({ async getDailyReportCarBrand () {
merchantId: shopMerchantId, let { userInfo } = this,
sceneType: 1 { shopMerchantId } = userInfo
}) const data = await uni.$api.boutiqueApi.getDailyReportCarBrand({
data.map(e => { merchantId: shopMerchantId,
let { firstBrandId, firstBrandName, brandName } = e sceneType: 1
e.tabName = firstBrandId == -1 ? firstBrandName : brandName })
}) data.map(e => {
this.carBandList = data let { firstBrandId, firstBrandName, brandName } = e
this.getStaffDailyReportDetail() e.tabName = firstBrandId == -1 ? firstBrandName : brandName
}, })
setMonthDay () { this.carBandList = data
let { mouthNumber } = this, this.getStaffDailyReportDetail()
currentMonth = dayjs(this.currentMonth).format('YYYY-MM'), },
nowYear = dayjs(currentMonth).format('YYYY'), setMonthDay () {
nowMonth = dayjs(currentMonth).format('MM'), let { mouthNumber } = this,
maxDay = dayjs().format('D'), currentMonth = dayjs(this.currentMonth).format('YYYY-MM'),
maxMonth = dayjs().format('YYYY-MM'), nowYear = dayjs(currentMonth).format('YYYY'),
dayNum = currentMonth < maxMonth ? mouthNumber : maxDay, nowMonth = dayjs(currentMonth).format('MM'),
weekDayList = [] maxDay = dayjs().format('D'),
if (currentMonth > maxMonth) return maxMonth = dayjs().format('YYYY-MM'),
for (let i = 1; i <= dayNum; i++) { dayNum = currentMonth < maxMonth ? mouthNumber : maxDay,
let date = dayjs(`${nowYear}-${nowMonth}-${i}`).format('YYYY-MM-DD'), weekDayList = []
week = ['日', '一', '二', '三', '四', '五', '六'][dayjs(date).weekday()] if (currentMonth > maxMonth) return
weekDayList.push({ for (let i = 1; i <= dayNum; i++) {
day: i, let date = dayjs(`${nowYear}-${nowMonth}-${i}`).format('YYYY-MM-DD'),
date, week = ['日', '一', '二', '三', '四', '五', '六'][dayjs(date).weekday()]
week, weekDayList.push({
disabled: false day: i,
}) date,
} week,
let startDay = weekDayList[0].date, disabled: false
endDay = weekDayList[weekDayList.length - 1].date })
let params = { }
weekDayList, let startDay = weekDayList[0].date,
yearMonth: currentMonth, endDay = weekDayList[weekDayList.length - 1].date
starDay: 1, let params = {
starDayLabel: dayjs(startDay).format('YYYY/MM/DD'), weekDayList,
reportStartDate: startDay, yearMonth: currentMonth,
endDayLabel: dayjs(endDay).format('YYYY/MM/DD'), starDay: 1,
reportEndDate: endDay, starDayLabel: dayjs(startDay).format('YYYY/MM/DD'),
formatYearMonth: currentMonth reportStartDate: startDay,
} endDayLabel: dayjs(endDay).format('YYYY/MM/DD'),
this.getStaffDailyReportDetailWeeklyList(params) reportEndDate: endDay,
}, formatYearMonth: currentMonth
async getStaffDailyReportDetailWeeklyList (params) { }
let { shopMerchantId, merchantId, uuid } = this.userInfo this.getStaffDailyReportDetailWeeklyList(params)
const data = await uni.$api.boutiqueApi.getStaffDailyReportDetailWeeklyList({ },
staffUuid: uuid, async getStaffDailyReportDetailWeeklyList (params) {
yqMerchantId: merchantId, let { shopMerchantId, merchantId, uuid } = this.userInfo
merchantId: shopMerchantId, const data = await uni.$api.boutiqueApi.getStaffDailyReportDetailWeeklyList({
...params, staffUuid: uuid,
sceneType: 1, yqMerchantId: merchantId,
reportTypeList: [-1] merchantId: shopMerchantId,
}) ...params,
let selectedDay = [] sceneType: 1,
params.weekDayList.map(e => { reportTypeList: [-1]
let { date } = e })
if (!data.includes(date)) selectedDay.push({ let selectedDay = []
date params.weekDayList.map(e => {
}) let { date } = e
}) if (!data.includes(date)) selectedDay.push({
this.weeklyList = data date
this.$emit('setCalendarSelected', selectedDay) })
}, })
async getStaffDailyReportDetail () { this.weeklyList = data
this.isEditReport = false this.$emit('setCalendarSelected', selectedDay)
this.loadComplete = false },
let { currentDate, async getStaffDailyReportDetail () {
userInfo, this.isEditReport = false
carBandList, this.loadComplete = false
hwOhterObjArray, let {
orderObj } = this, currentDate,
{ shopMerchantId, merchantId, uuid } = userInfo userInfo,
uni.showLoading({ carBandList,
mask: true hwOhterObjArray,
}) orderObj,
const data = await uni.$api.boutiqueApi.getStaffDailyReportDetail({ editableDay
yqMerchantId: merchantId, } = this,
merchantId: shopMerchantId, { shopMerchantId, merchantId, uuid } = userInfo
staffUuid: uuid, uni.showLoading({
reportDate: currentDate, mask: true
sceneType: 1, })
reportTypeList: [-1] const data = await uni.$api.boutiqueApi.getStaffDailyReportDetail({
}) yqMerchantId: merchantId,
uni.hideLoading() merchantId: shopMerchantId,
let { brandDataList, remark } = data staffUuid: uuid,
if (brandDataList && brandDataList.length) { reportDate: currentDate,
carBandList = carBandList.map((item, index) => { sceneType: 1,
this.dateKey[`deliveryCount_${index}`] = Date.now() reportTypeList: [-1]
this.dateKey[`notDeliveryCount_${index}`] = Date.now() })
this.dateKey[`equityToShopCount_${index}`] = Date.now() uni.hideLoading()
this.dateKey[`afterSaleEquityToShopCount_${index}`] = Date.now() let { brandDataList, remark } = data
let carBand = brandDataList.find(ele => { if (brandDataList && brandDataList.length) {
if ([0, 1, 3, 4, 5, 6].includes(ele.brandType)) { carBandList = carBandList.map((item, index) => {
return ele.brandType == item.brandType this.dateKey[`deliveryCount_${index}`] = Date.now()
} else if (ele.brandType == 2) { this.dateKey[`notDeliveryCount_${index}`] = Date.now()
return ele.firstBrandId == item.firstBrandId this.dateKey[`equityToShopCount_${index}`] = Date.now()
} this.dateKey[`afterSaleEquityToShopCount_${index}`] = Date.now()
}) let carBand = brandDataList.find(ele => {
if (carBand != null) { if ([0, 1, 3, 4, 5, 6].includes(ele.brandType)) {
let { return ele.brandType == item.brandType
firstBrandId, } else if (ele.brandType == 2) {
firstBrandName, return ele.firstBrandId == item.firstBrandId
brandId, }
brandName, })
brandType, if (carBand != null) {
tabName let {
} = item firstBrandId,
item = { firstBrandName,
...carBand, brandId,
firstBrandId, brandName,
firstBrandName, brandType,
brandId, tabName
brandName, } = item
brandType, item = {
tabName ...carBand,
} firstBrandId,
} else { firstBrandName,
hwOhterObjArray.forEach(e => { brandId,
item[e.key] = null brandName,
}) brandType,
} tabName
return item }
}) } else {
} hwOhterObjArray.forEach(e => {
let diffDay = dayjs().diff(dayjs(currentDate), 'day') item[e.key] = null
this.hwOhterObjArray = hwOhterObjArray })
this.carBandList = carBandList }
this.orderObj = { return item
...orderObj, })
reportDate: currentDate, }
isDateWithin7Days: diffDay < 7, let diffDay = dayjs().diff(dayjs(currentDate), 'day'),
isDateWithin60Days: diffDay < 60, disabledReport = false
remark, if (editableDay && editableDay.diff(dayjs(currentDate), 'day') > 0) disabledReport = true
lastStaffName: data.lastStaffName, this.hwOhterObjArray = hwOhterObjArray
lastStaffUuid: data.lastStaffUuid, this.carBandList = carBandList
recordStaffCount: data.staffCount, this.orderObj = {
totalOrderMoney: data.totalOrderMoney, ...orderObj,
totalOrderCount: data.totalOrderCount, reportDate: currentDate,
glWorryFreeCount: data.glWorryFreeCount, isDateWithin7Days:editableDay ? !disabledReport : diffDay < 7,
cancelOrderCount: data.cancelOrderCount, remark,
cancelOrderMoney: data.cancelOrderMoney, lastStaffName: data.lastStaffName,
templateType: data.templateType || 0, lastStaffUuid: data.lastStaffUuid,
staffCount: data.staffCount, recordStaffCount: data.staffCount,
onBreak: data.onBreak ? data.onBreak : diffDay < 7 ? data.onBreak || 'N' : '', totalOrderMoney: data.totalOrderMoney,
pickerValue: data.onBreak == 'Y' ? 1 : 0, totalOrderCount: data.totalOrderCount,
staffCountError: false, glWorryFreeCount: data.glWorryFreeCount,
} cancelOrderCount: data.cancelOrderCount,
this.tabIndex = 0 cancelOrderMoney: data.cancelOrderMoney,
this.loadComplete = true templateType: data.templateType || 0,
this.dateKey.staffCount = Date.now() staffCount: data.staffCount,
}, onBreak: data.onBreak ? data.onBreak : diffDay < 7 ? data.onBreak || 'N' : '',
handleBlur (e, i) { pickerValue: data.onBreak == 'Y' ? 1 : 0,
let { value } = e.detail, staffCountError: false,
{ orderObj, userInfo } = this, }
key = i.value this.tabIndex = 0
if (value) { this.loadComplete = true
let numbers = value.match(/\d+/g) this.dateKey.staffCount = Date.now()
numbers = numbers ? numbers.join('') : '' },
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') handleBlur (e, i) {
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString() let { value } = e.detail,
this.dateKey[key] = Date.now() { orderObj, userInfo } = this,
} else { key = i.value
this.orderObj[key] = '' if (value) {
this.dateKey[key] = Date.now() let numbers = value.match(/\d+/g)
} numbers = numbers ? numbers.join('') : ''
if ( if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.isNotEmpty(orderObj.recordStaffCount) && this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.isNotEmpty(value) && this.dateKey[key] = Date.now()
orderObj.recordStaffCount != value && } else {
orderObj.lastStaffUuid && this.orderObj[key] = ''
userInfo.uuid != orderObj.lastStaffUuid this.dateKey[key] = Date.now()
) { }
this.noticeObj = { if (
title: '重要提示', this.isNotEmpty(orderObj.recordStaffCount) &&
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`, this.isNotEmpty(value) &&
type: 'warning', orderObj.recordStaffCount != value &&
buttons: [ orderObj.lastStaffUuid &&
{ userInfo.uuid != orderObj.lastStaffUuid
text: '确定', ) {
type: 'primary', this.noticeObj = {
} title: '重要提示',
] text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
} type: 'warning',
this.$nextTick(() => this.$refs.reportNotice.open()) buttons: [
} {
}, text: '确定',
isNotEmpty (value) { type: 'primary',
return ( }
value !== null && ]
value !== undefined && }
value !== '' && this.$nextTick(() => this.$refs.reportNotice.open())
!(Array.isArray(value) && value.length === 0) }
) },
}, isNotEmpty (value) {
handleCarInputBlur (e, i, item, index) { return (
let { value } = e.detail, value !== null &&
{ key, max } = i value !== undefined &&
if (value) { value !== '' &&
let numbers = value.match(/\d+/g) !(Array.isArray(value) && value.length === 0)
numbers = numbers ? numbers.join('') : '' )
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') },
item[key] = Math.min(Math.max(Number(numbers), 0), max).toString() handleCarInputBlur (e, i, item, index) {
this.dateKey[`${key}_${index}`] = Date.now() let { value } = e.detail,
} else { { key, max } = i
item[key] = '' if (value) {
this.dateKey[`${key}_${index}`] = Date.now() let numbers = value.match(/\d+/g)
} numbers = numbers ? numbers.join('') : ''
console.log(item[key]) if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
}, item[key] = Math.min(Math.max(Number(numbers), 0), max).toString()
async submit () { this.dateKey[`${key}_${index}`] = Date.now()
uni.showLoading({ } else {
title: '提交中', item[key] = ''
mask: true this.dateKey[`${key}_${index}`] = Date.now()
}) }
uni.$track.add({ console.log(item[key])
eventCode: 'app_submit_daily_report' },
}) //提交驻店日报埋点 async submit () {
try { uni.showLoading({
let { orderObj, carBandList, hwOhterObjArray, defaultObjArray } = this title: '提交中',
orderObj.isAdmin = false mask: true
orderObj.oprBy = orderObj.staffUuid })
orderObj.sceneType = 1 uni.$track.add({
orderObj.brandDataList = carBandList eventCode: 'app_submit_daily_report'
if (orderObj.pickerValue == 0) { }) //提交驻店日报埋点
if (['', null].includes(orderObj.staffCount)) throw { try {
message: '今日驻店人数(按店)', let { orderObj, carBandList, hwOhterObjArray, defaultObjArray } = this
refId: 'staffCount' orderObj.isAdmin = false
} orderObj.oprBy = orderObj.staffUuid
carBandList.map((item, index) => { orderObj.sceneType = 1
if (item.firstBrandId == -1) defaultObjArray.map(el => { orderObj.brandDataList = carBandList
if (el.required && ['', null].includes(item[el.key])) throw { if (orderObj.pickerValue == 0) {
message: `${item.tabName}${el.label}`, if (['', null].includes(orderObj.staffCount)) throw {
refId: `${el.refId}_${index}`, message: '今日驻店人数(按店)',
tabIndex: index refId: 'staffCount'
} }
}) carBandList.map((item, index) => {
else hwOhterObjArray.map(el => { if (item.firstBrandId == -1) defaultObjArray.map(el => {
if (el.required && ['', null].includes(item[el.key])) throw { if (el.required && ['', null].includes(item[el.key])) throw {
message: `${item.tabName}${el.label}`, message: `${item.tabName}${el.label}`,
refId: `${el.refId}_${index}`, refId: `${el.refId}_${index}`,
tabIndex: index tabIndex: index
} }
}) })
}) else hwOhterObjArray.map(el => {
} if (el.required && ['', null].includes(item[el.key])) throw {
if (orderObj.onBreak == 'Y') { message: `${item.tabName}${el.label}`,
orderObj.brandDataList.forEach(item => { refId: `${el.refId}_${index}`,
item.notDeliveryCount = item.notDeliveryCount || 0 tabIndex: index
item.equityToShopCount = item.equityToShopCount || 0 }
}) })
} })
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj) }
uni.hideLoading() if (orderObj.onBreak == 'Y') {
if (data) { orderObj.brandDataList.forEach(item => {
this.isEditReport = false item.notDeliveryCount = item.notDeliveryCount || 0
this.noticeObj = { item.equityToShopCount = item.equityToShopCount || 0
title: '提交成功', })
text: '您的日报已提交成功', }
type: 'success', const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj)
buttons: [ uni.hideLoading()
{ if (data) {
text: '返回首页', this.isEditReport = false
type: 'primary', this.noticeObj = {
callback: _ => { title: '提交成功',
uni.navigateBack() text: '您的日报已提交成功',
} type: 'success',
} buttons: [
] {
} text: '返回首页',
this.$nextTick(() => this.$refs.reportNotice.open()) type: 'primary',
} callback: _ => {
} catch (errorObj) { uni.navigateBack()
uni.hideLoading() }
if (errorObj.tabIndex != null) this.tabIndex = errorObj.tabIndex }
if (errorObj.message) { ]
uni.showToast({ }
title: `${errorObj.message}不能为空`, this.$nextTick(() => this.$refs.reportNotice.open())
icon: 'none' }
}) } catch (errorObj) {
this.to = errorObj.refId uni.hideLoading()
} else uni.showToast({ if (errorObj.tabIndex != null) this.tabIndex = errorObj.tabIndex
title: typeof errorObj == 'string' ? errorObj : errorObj.toString(), if (errorObj.message) {
icon: 'none' uni.showToast({
}) title: `${errorObj.message}不能为空`,
icon: 'none'
} })
}, this.to = errorObj.refId
filterDisabled (disabledStatus) { } else uni.showToast({
let { weeklyList, currentDate, orderObj: { isDateWithin7Days } } = this title: typeof errorObj == 'string' ? errorObj : errorObj.toString(),
return weeklyList.includes(currentDate) && !disabledStatus || !isDateWithin7Days icon: 'none'
}, })
changePicker (value, i) {
const disabled = this.filterDisabled(this.isEditReport) }
if (disabled) return },
this.orderObj[i.value] = { filterDisabled (disabledStatus) {
'Y': 1, let { weeklyList, currentDate, orderObj: { isDateWithin7Days } } = this
'N': 0 return weeklyList.includes(currentDate) && !disabledStatus || !isDateWithin7Days
}[value] },
this.orderObj[i.submitValue] = value changePicker (value, i) {
}, const disabled = this.filterDisabled(this.isEditReport)
filterTemplateList (item) { if (disabled) return
let { hwOhterObjArray, defaultObjArray, orderObj: { templateType } } = this this.orderObj[i.value] = {
if (item.firstBrandId == -1) { 'Y': 1,
return defaultObjArray 'N': 0
} }[value]
if (templateType == 3) { this.orderObj[i.submitValue] = value
return hwOhterObjArray.filter(function (item) { },
return item.templateValue != 3 filterTemplateList (item) {
}) let { hwOhterObjArray, defaultObjArray, orderObj: { templateType } } = this
} else { if (item.firstBrandId == -1) {
return hwOhterObjArray return defaultObjArray
} }
}, if (templateType == 3) {
} return hwOhterObjArray.filter(function (item) {
} return item.templateValue != 3
</script> })
} else {
<style scoped lang='scss'> return hwOhterObjArray
.daily-report { }
height: 100%; },
.hide-box { }
opacity: 0; }
height: 100%; </script>
overflow: hidden;
} <style scoped lang='scss'>
.common-title-btns { .daily-report {
margin: 0 toRpx(48) 0 auto; height: 100%;
gap: toRpx(16); .hide-box {
.title-btn { opacity: 0;
height: toRpx(80); height: 100%;
border-radius: toRpx(16); overflow: hidden;
background: #3b73ff1a; }
display: flex; .common-title-btns {
align-items: center; margin: 0 toRpx(48) 0 auto;
justify-content: center; gap: toRpx(16);
padding: 0 toRpx(40); .title-btn {
color: #333333; height: toRpx(80);
font-size: toRpx(28); border-radius: toRpx(16);
} background: #3b73ff1a;
} display: flex;
align-items: center;
.repoet-view { justify-content: center;
height: calc(100% - #{toRpx(248)}); padding: 0 toRpx(40);
position: relative; color: #333333;
.repoet-box { font-size: toRpx(28);
height: 100%; }
} }
}
.full { .repoet-view {
height: calc(100% - #{toRpx(120)}); height: calc(100% - #{toRpx(248)});
} position: relative;
.box { .repoet-box {
margin: 0 toRpx(48) toRpx(16); height: 100%;
border-radius: toRpx(16); }
background: #ffffff; }
padding-left: toRpx(32); .full {
.sub-title { height: calc(100% - #{toRpx(120)});
line-height: toRpx(48); }
padding: toRpx(16) toRpx(32) toRpx(8) 0; .box {
color: #777777; margin: 0 toRpx(48) toRpx(16);
font-size: toRpx(24); border-radius: toRpx(16);
.staff-name { background: #ffffff;
margin-left: auto; padding-left: toRpx(32);
color: #4673ff; .sub-title {
font-size: toRpx(24); line-height: toRpx(48);
} padding: toRpx(16) toRpx(32) toRpx(8) 0;
} color: #777777;
font-size: toRpx(24);
.form-item { .staff-name {
min-height: toRpx(96); margin-left: auto;
border-bottom: toRpx(2) solid #f7f7f6; color: #4673ff;
padding-right: toRpx(32); font-size: toRpx(24);
font-size: toRpx(28); }
color: #333333; }
&:last-of-type {
border-bottom: none; .form-item {
} min-height: toRpx(96);
.label { border-bottom: toRpx(2) solid #f7f7f6;
flex-shrink: 0; padding-right: toRpx(32);
margin-right: toRpx(16); font-size: toRpx(28);
.required { color: #333333;
color: #f24724; &:last-of-type {
font-size: toRpx(28); border-bottom: none;
margin-left: toRpx(8); }
} .label {
} flex-shrink: 0;
.value { margin-right: toRpx(16);
width: 100%; .required {
height: 100%; color: #f24724;
justify-content: flex-end; font-size: toRpx(28);
margin-left: toRpx(8);
.input, }
.picker { }
width: 100%; .value {
height: 100%; width: 100%;
text-align: right; height: 100%;
line-height: toRpx(96); justify-content: flex-end;
justify-content: flex-end;
font-size: toRpx(28); .input,
} .picker {
.picker { width: 100%;
gap: toRpx(48); height: 100%;
&-item { text-align: right;
line-height: toRpx(34); line-height: toRpx(96);
.icon { justify-content: flex-end;
margin-right: toRpx(10); font-size: toRpx(28);
height: toRpx(32); }
} .picker {
} gap: toRpx(48);
} &-item {
.placeholder { line-height: toRpx(34);
color: #999999; .icon {
font-size: toRpx(28); margin-right: toRpx(10);
line-height: toRpx(28); height: toRpx(32);
} }
.textarea { }
width: calc(100% - #{toRpx(24)}); }
text-align: right; .placeholder {
margin: toRpx(10) 0 0 toRpx(24); color: #999999;
// line-height: toRpx(28); font-size: toRpx(28);
font-size: toRpx(28); line-height: toRpx(28);
} }
} .textarea {
} width: calc(100% - #{toRpx(24)});
.name { text-align: right;
line-height: toRpx(48); margin: toRpx(10) 0 0 toRpx(24);
height: toRpx(72); // line-height: toRpx(28);
color: #777777; font-size: toRpx(28);
font-size: toRpx(24); }
border-bottom: none; }
} }
} .name {
.car-band-box { line-height: toRpx(48);
margin: 0 toRpx(48) toRpx(16); height: toRpx(72);
background: #ffffff59; color: #777777;
backdrop-filter: blur(toRpx(16)); font-size: toRpx(24);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; border-bottom: none;
overflow: hidden; }
border-radius: toRpx(32); }
.car-band-form-box { .car-band-box {
position: relative; margin: 0 toRpx(48) toRpx(16);
.box { background: #ffffff59;
position: absolute; backdrop-filter: blur(toRpx(16));
left: 0; box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
top: 0; overflow: hidden;
width: 100%; border-radius: toRpx(32);
visibility: hidden; .car-band-form-box {
} position: relative;
.show { .box {
visibility: visible; position: absolute;
} left: 0;
} top: 0;
.box { width: 100%;
margin: 0; visibility: hidden;
border-radius: 0 0 toRpx(32); }
} .show {
} visibility: visible;
.info { }
display: flex; }
padding: 0 toRpx(32) toRpx(16); .box {
flex-wrap: wrap; margin: 0;
&-item { border-radius: 0 0 toRpx(32);
width: 25%; }
color: #222222; }
font-size: toRpx(28); .info {
font-weight: 500; display: flex;
} padding: 0 toRpx(32) toRpx(16);
&-label { flex-wrap: wrap;
color: #777777; &-item {
font-size: toRpx(24); width: 25%;
line-height: toRpx(48); color: #222222;
padding: toRpx(24) 0 toRpx(8); font-size: toRpx(28);
} font-weight: 500;
&-value { }
padding-bottom: toRpx(8); &-label {
} color: #777777;
} font-size: toRpx(24);
.block { line-height: toRpx(48);
width: 100%; padding: toRpx(24) 0 toRpx(8);
height: toRpx(16); }
} &-value {
.btn-box { padding-bottom: toRpx(8);
height: toRpx(128); }
padding: 0 toRpx(128); }
gap: 0 toRpx(32); .block {
.btn { width: 100%;
display: flex; height: toRpx(16);
align-items: center; }
justify-content: center; .btn-box {
width: 100%; height: toRpx(128);
height: toRpx(80); padding: 0 toRpx(128);
border-radius: toRpx(48); gap: 0 toRpx(32);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); .btn {
color: #ffffff; display: flex;
font-size: toRpx(28); align-items: center;
font-weight: 500; justify-content: center;
} width: 100%;
.cancel-btn { height: toRpx(80);
background: #3b73ff1a; border-radius: toRpx(48);
color: #4673ff; background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
} color: #ffffff;
} font-size: toRpx(28);
.nothing { font-weight: 500;
position: absolute; }
top: 0; .cancel-btn {
left: 0; background: #3b73ff1a;
bottom: 0; color: #4673ff;
right: 0; }
// background: #f1f4ff; }
backdrop-filter: blur(8px); .nothing {
z-index: 2; position: absolute;
flex-direction: column; top: 0;
justify-content: center; left: 0;
color: #999999; bottom: 0;
font-size: toRpx(24); right: 0;
.icon { // background: #f1f4ff;
width: toRpx(344); backdrop-filter: blur(8px);
height: toRpx(236); z-index: 2;
} flex-direction: column;
} justify-content: center;
} color: #999999;
font-size: toRpx(24);
.icon {
width: toRpx(344);
height: toRpx(236);
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<RightPopup ref="rightPopup" :title="title[type]" :showFooter="true" @confirm="confirm" :confirmDisabled="confirmDisabled"> <RightPopup ref="rightPopup" :title="title[popType]" :showFooter="true" @confirm="confirm" :confirmDisabled="confirmDisabled">
<view class="popup-content"> <view class="popup-content">
<view class="appeal-desc"> <view class="appeal-desc">
<view class="sprite-icon icon-icon-appeal"></view>规定申诉时间为<view class="blod-text">每月6号-每月15号</view> <view class="sprite-icon icon-icon-appeal"></view>规定申诉时间为<view class="blod-text">每月{{appealStartTime}}号-每月{{appealEndTime}}号</view>
,支持提交修订异议处理,总部流转审批,请在规定时间内完成,逾期不再受理。 ,支持提交修订异议处理,总部流转审批,请在规定时间内完成,逾期不再受理。
</view> </view>
<view class="form-item flex-item line"> <view class="form-item flex-item line" v-if="formItem[popType]">
<view class="label">{{formItem[type][0].label}}</view> <view class="label">{{formItem[popType][0].label}}</view>
<view class="value"><text class="blue-text">{{ currentCount }}</text> {{formItem[type][1].unit}}</view> <view class="value"><text class="blue-text">{{ count }}</text> {{formItem[popType][0].unit}}</view>
</view> </view>
<view class="form-item"> <view class="form-item" v-if="formItem[popType]">
<view class="label m-b">{{formItem[type][1].label}}</view> <view class="label m-b">{{formItem[popType][1].label}}</view>
<view class="input-box"> <view class="input-box">
<input type="number" v-model="formData.modifyCount" :maxlength="formItem[type][1].maxlength" placeholder="请输入" placeholder-class="placeholder" @input="onInput" /> <input type="number" v-model="formData.modifyCount" :maxlength="formItem[popType][1].maxlength" placeholder="请输入" placeholder-class="placeholder" @input="onInput" />
<text class="suffix">{{formItem[type][1].unit}}</text> <text class="suffix">{{formItem[popType][1].unit}}</text>
</view> </view>
</view> </view>
...@@ -71,6 +71,7 @@ import dayjs from 'dayjs' ...@@ -71,6 +71,7 @@ import dayjs from 'dayjs'
import { uploadFile } from '@/utils/ossUpload.js' import { uploadFile } from '@/utils/ossUpload.js'
import RightPopup from '../../components/RightPopup.vue' import RightPopup from '../../components/RightPopup.vue'
import { title, formItem } from './contant.js' import { title, formItem } from './contant.js'
import permision from '@/js_sdk/wa-permission/permission.js'
const MAX_IMAGE_SIZE = 10 * 1024 * 1024, // 图片最大10MB const MAX_IMAGE_SIZE = 10 * 1024 * 1024, // 图片最大10MB
MAX_IMG_COUNT = 10 // 最大图片数量 MAX_IMG_COUNT = 10 // 最大图片数量
export default { export default {
...@@ -87,14 +88,22 @@ export default { ...@@ -87,14 +88,22 @@ export default {
type: [Number, String], type: [Number, String],
default: 0 default: 0
}, },
type: { popType: {
type: String, type: String,
default: '' default: 'attendance'
}, },
lastRecord: { lastRecord: {
type: Object, type: Object,
default: () => {} default: () => {}
} },
appealStartTime: {
type: String,
default: ''
},
appealEndTime: {
type: String,
default: ''
},
}, },
data() { data() {
return { return {
...@@ -106,7 +115,8 @@ export default { ...@@ -106,7 +115,8 @@ export default {
remark: '', remark: '',
otherAbnormalMessage: '' otherAbnormalMessage: ''
}, },
confirmDisabled: true confirmDisabled: true,
count: ''
} }
}, },
watch: { watch: {
...@@ -119,32 +129,40 @@ export default { ...@@ -119,32 +129,40 @@ export default {
}, },
lastRecord: { lastRecord: {
handler(val) { handler(val) {
console.log(val)
if (!val) return if (!val) return
const { appealType, actualAttendanceDays, applyActualAttendanceDays, padRecordNum, applyPadRecordNum, remark, otherAbnormalMessage, attachmentList } = val const { appealType, actualAttendanceDays, applyActualAttendanceDays, padRecordNum, applyPadRecordNum, remark, otherAbnormalMessage, attachmentList, shopCount } = val
const typeMap = { const typeMap = {
1: { count: actualAttendanceDays, modify: applyActualAttendanceDays }, 1: { count: actualAttendanceDays, modify: applyActualAttendanceDays },
2: { count: padRecordNum, modify: applyPadRecordNum } 2: { count: padRecordNum, modify: applyPadRecordNum }
} }
const currentType = typeMap[appealType] const currentType = typeMap[appealType]
if (currentType) { if (currentType) {
this.currentCount = currentType.count this.count = currentType.count
if (currentType.modify) this.formData.modifyCount = currentType.modify if (currentType.modify) this.formData.modifyCount = currentType.modify
} }
if (remark) this.formData.remark = remark if (remark) this.formData.remark = remark
if (otherAbnormalMessage) this.formData.otherAbnormalMessage = otherAbnormalMessage if (otherAbnormalMessage) this.formData.otherAbnormalMessage = otherAbnormalMessage
if (attachmentList) this.formData.images = attachmentList if (attachmentList) this.formData.images = attachmentList
if (shopCount) this.formData.shopCount = shopCount
console.log(this.formData, '==')
}, },
deep: true deep: true
},
currentCount: {
handler(val) {
if (val) this.count = val
}
} }
}, },
methods: { methods: {
onInput: debounce(function(e) { onInput: debounce(function(e) {
let value = e.detail.value let value = e.detail.value
if (this.type === 'record') { if (this.popType === 'record') {
// Integer only // Integer only
value = value.replace(/[^\d]/g, '') value = value.replace(/[^\d]/g, '')
} else if (this.type === 'attendance') { } else if (this.popType === 'attendance') {
// Decimal with 2 places // Decimal with 2 places
value = value.replace(/[^\d.]/g, '') // Remove non-digits/dots value = value.replace(/[^\d.]/g, '') // Remove non-digits/dots
.replace(/^\./g, '') // No starting dot .replace(/^\./g, '') // No starting dot
...@@ -252,9 +270,9 @@ export default { ...@@ -252,9 +270,9 @@ export default {
}) })
}, },
async confirm() { async confirm() {
const { modifyCount, remark, images, otherAbnormalMessage} = this.formData, {currentCount} = this const { modifyCount, remark, images, otherAbnormalMessage, shopCount} = this.formData, {count} = this
// 校验申诉天数是否在上个月自然日天数内 // 校验申诉天数是否在上个月自然日天数内
if (this.type == 'attendance' && modifyCount && !this.checkLastNaturalDay(modifyCount)) return if (this.popType == 'attendance' && modifyCount && !this.checkLastNaturalDay(modifyCount)) return
const { sceneType, shopMerchantId } = uni.$storage.get('userInfo') const { sceneType, shopMerchantId } = uni.$storage.get('userInfo')
const params = { const params = {
appealMonth: this.month, appealMonth: this.month,
...@@ -264,22 +282,27 @@ export default { ...@@ -264,22 +282,27 @@ export default {
if (remark) params.remark = remark if (remark) params.remark = remark
if (images.length > 0) params.attachmentList = images if (images.length > 0) params.attachmentList = images
if (otherAbnormalMessage) params.otherAbnormalMessage = otherAbnormalMessage if (otherAbnormalMessage) params.otherAbnormalMessage = otherAbnormalMessage
if (this.type == 'record') { if (this.popType == 'record') {
params.appealType = 2 params.appealType = 2
params.padRecordNum = currentCount params.padRecordNum = count
params.shopCount = shopCount
if (modifyCount) params.applyPadRecordNum = modifyCount if (modifyCount) params.applyPadRecordNum = modifyCount
} else if (this.type == 'attendance') { } else if (this.popType == 'attendance') {
params.appealType = 1 params.appealType = 1
params.actualAttendanceDays = currentCount params.actualAttendanceDays = count
if (modifyCount) params.applyActualAttendanceDays = modifyCount if (modifyCount) params.applyActualAttendanceDays = modifyCount
} }
console.log(params, 'params') console.log(params, 'params')
const res = await uni.$api.commonApi.addWageAppeal(params) const res = await uni.$api.commonApi.addWageAppeal(params)
console.log(res, '=res') console.log(res, '=res')
// this.$emit('confirm', { if (res) uni.showToast({
// month: this.month, title: '申诉成功',
// ...this.formData icon: 'success'
// }) })
this.$emit('confirm', {
month: this.month,
...this.formData
})
this.close() this.close()
} }
} }
...@@ -288,14 +311,14 @@ export default { ...@@ -288,14 +311,14 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.popup-content { .popup-content {
padding: 16rpx 64rpx; padding: toRpx(16) toRpx(64);
} }
.appeal-desc { .appeal-desc {
border-radius: 8rpx; border-radius: toRpx(8);
font-size: 24rpx; font-size: toRpx(24);
line-height: 1.5; line-height: 1.5;
margin-bottom: 56rpx; margin-bottom: toRpx(56);
display: inline-block; display: inline-block;
display: block; display: block;
...@@ -307,12 +330,12 @@ export default { ...@@ -307,12 +330,12 @@ export default {
.sprite-icon { .sprite-icon {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
margin-right: 8rpx; margin-right: toRpx(8);
} }
} }
.form-item { .form-item {
margin-bottom: 32rpx; margin-bottom: toRpx(32);
&.flex-item { &.flex-item {
display: flex; display: flex;
...@@ -321,60 +344,60 @@ export default { ...@@ -321,60 +344,60 @@ export default {
} }
&.line { &.line {
border-bottom: 1rpx solid #EFF0F2; border-bottom: toRpx(1) solid #EFF0F2;
padding-bottom: 32rpx; padding-bottom: toRpx(32);
} }
.label { .label {
font-size: 28rpx; font-size: toRpx(28);
font-weight: 500; font-weight: 500;
color: #333; color: #333;
&.m-b { &.m-b {
margin-bottom: 16rpx; margin-bottom: toRpx(16);
} }
} }
.value { .value {
font-size: 28rpx; font-size: toRpx(28);
color: #333; color: #333;
.blue-text { .blue-text {
color: #2A82E4; color: #2A82E4;
margin-right: 8rpx; margin-right: toRpx(8);
} }
} }
.input-box { .input-box {
background: #F5F6F8; background: #F5F6F8;
border-radius: 16rpx; border-radius: toRpx(16);
height: 80rpx; height: toRpx(80);
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 24rpx; padding: 0 toRpx(24);
input { input {
flex: 1; flex: 1;
font-size: 28rpx; font-size: toRpx(28);
color: #333; color: #333;
} }
.suffix { .suffix {
font-size: 28rpx; font-size: toRpx(28);
color: #333; color: #333;
margin-left: 16rpx; margin-left: toRpx(16);
} }
} }
.textarea-box { .textarea-box {
background: #F5F6F8; background: #F5F6F8;
border-radius: 8rpx; border-radius: toRpx(8);
padding: 24rpx; padding: toRpx(24);
textarea { textarea {
width: 100%; width: 100%;
height: 192rpx; height: toRpx(192);
font-size: 28rpx; font-size: toRpx(28);
color: #333; color: #333;
line-height: 1.5; line-height: 1.5;
} }
...@@ -384,12 +407,12 @@ export default { ...@@ -384,12 +407,12 @@ export default {
.upload-container { .upload-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 20rpx; gap: toRpx(20);
.image-item { .image-item {
width: 160rpx; width: toRpx(160);
height: 160rpx; height: toRpx(160);
border-radius: 16rpx; border-radius: toRpx(16);
position: relative; position: relative;
overflow: hidden; overflow: hidden;
...@@ -402,8 +425,8 @@ export default { ...@@ -402,8 +425,8 @@ export default {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
width: 40rpx; width: toRpx(40);
height: 40rpx; height: toRpx(40);
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
// border-bottom-left-radius: 8rpx; // border-bottom-left-radius: 8rpx;
border-radius: 50%; border-radius: 50%;
...@@ -414,19 +437,19 @@ export default { ...@@ -414,19 +437,19 @@ export default {
} }
.upload-btn { .upload-btn {
width: 160rpx; width: toRpx(160);
height: 160rpx; height: toRpx(160);
background: #F5F8FF; background: #F5F8FF;
border-radius: 8rpx; border-radius: toRpx(8);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.count { .count {
font-size: 24rpx; font-size: toRpx(24);
color: #999; color: #999;
margin-top: 8rpx; margin-top: toRpx(8);
} }
} }
} }
......
<template> <template>
<view class="wage-appeal"> <view class="wage-appeal">
<view class="common-title">工资申诉{{ month }}</view> <view class="common-title">工资申诉</view>
<scroll-view scroll-y class="section"> <scroll-view scroll-y class="section">
<!-- 考勤/日报/平板录音卡片区 --> <!-- 考勤/日报/平板录音卡片区 -->
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<view class="card-item"> <view class="card-item">
<view class="card-top"> <view class="card-top">
<view class="card-title">实际出勤天数</view> <view class="card-title">实际出勤天数</view>
<view class="card-value">{{ appealData.actualAttendanceDays || 0 }}天</view> <view class="card-value">{{ appealData.actualAttendanceDays != null ? appealData.actualAttendanceDays : '-' }}
<view v-if="appealData.actualAttendanceDays != null" class="card-unit">天</view>
</view>
</view> </view>
<view class="card-desc">根据打卡数据产生</view> <view class="card-desc">根据打卡数据产生</view>
<view v-if="appealData.attendanceAppealable" class="action-btn" @click="handleAppeal('attendance')">申诉考勤</view> <view v-if="appealData.attendanceAppealable" class="action-btn" @click="handleAppeal('attendance')">申诉考勤</view>
...@@ -19,12 +21,14 @@ ...@@ -19,12 +21,14 @@
<view class="card-item"> <view class="card-item">
<view class="card-top"> <view class="card-top">
<view class="card-title">日报完成天数</view> <view class="card-title">日报完成天数</view>
<view class="card-value">{{ appealData.dailyReportDays || 0 }}天</view> <view class="card-value">{{ appealData.dailyReportDays != null ? appealData.dailyReportDays : '-' }}
<view v-if="appealData.dailyReportDays != null" class="card-unit">天</view>
</view>
</view> </view>
<view class="card-desc">填写驻店日报天数</view> <view class="card-desc">填写驻店日报天数</view>
<view class="deduction">扣款 <text class="amount">-{{ appealData.dailyReportDeductionAmount || 0 }}元</text></view> <view class="deduction">扣款 <text :class="{'amount': appealData.dailyReportDeductionAmount != null}">{{appealData.dailyReportDeductionAmount ? '-' : ''}}{{ appealData.dailyReportDeductionAmount != null ? appealData.dailyReportDeductionAmount + '元' : '-' }}</text></view>
<view class="missing-days" v-if="appealData.missingDailyReportDates && appealData.missingDailyReportDates.length"> <view class="missing-days" v-if="appealData.missingDailyReportDates && appealData.missingDailyReportDates.length">
缺失天数为 <text class="warning-content"><text v-for="(day, idx) in appealData.missingDailyReportDates" :key="idx">{{ day }}{{ idx < appealData.missingDailyReportDates.length - 1 ? '、' : '' }}</text>号</text> <text class="warning-text">缺失天数为</text> <text class="warning-content"><text v-for="(day, idx) in appealData.missingDailyReportDates" :key="idx">{{ day }}{{ idx < appealData.missingDailyReportDates.length - 1 ? '、' : '' }}</text>号</text>
</view> </view>
<view v-if="appealData.dailyReportable" class="action-btn" @click="handleAppeal('dailyReport')">去补日报</view> <view v-if="appealData.dailyReportable" class="action-btn" @click="handleAppeal('dailyReport')">去补日报</view>
</view> </view>
...@@ -33,10 +37,12 @@ ...@@ -33,10 +37,12 @@
<view class="card-item"> <view class="card-item">
<view class="card-top"> <view class="card-top">
<view class="card-title">平板录音完成总数</view> <view class="card-title">平板录音完成总数</view>
<view class="card-value">{{ appealData.padRecordNum || 0 }}条</view> <view class="card-value">{{ appealData.padRecordNum != null ? appealData.padRecordNum : '-' }}
<view v-if="appealData.padRecordNum != null" class="card-unit">条</view>
</view>
</view> </view>
<view class="card-desc">触客总数为 <text class="blue-text">{{ appealData.touchCustomerTotal || 0 }}条</text></view> <view class="card-desc">触客总数为 <text :class="{'blue-text': appealData.touchCustomerTotal != null}">{{ appealData.touchCustomerTotal != null ? appealData.touchCustomerTotal + '条' : '-' }}</text></view>
<view class="deduction">扣款 <text class="amount">-{{ appealData.padDeductionAmount || 0 }}元</text></view> <view class="deduction">扣款 <text :class="{'amount': appealData.padDeductionAmount != null}">{{ appealData.padDeductionAmount ? '-' : '' }}{{ appealData.padDeductionAmount != null ? appealData.padDeductionAmount + '元' : '-' }}</text></view>
<view v-if="appealData.padAppealable" class="action-btn" @click="handleAppeal('record')">申诉平板</view> <view v-if="appealData.padAppealable" class="action-btn" @click="handleAppeal('record')">申诉平板</view>
</view> </view>
</view> </view>
...@@ -47,10 +53,12 @@ ...@@ -47,10 +53,12 @@
<text class="subtitle">订单数若有异常请跟总部联系</text> <text class="subtitle">订单数若有异常请跟总部联系</text>
</view> </view>
<view class="order-stats-box"> <view class="order-stats-box">
<view class="stat-item" v-for="(item, index) in orderStats" :key="index"> <template v-for="(item, index) in orderStats">
<view class="stat-label">{{ item.label }}</view> <view class="stat-item" :key="index" v-if="item.value != null">
<view class="stat-value">{{ item.value }}</view> <view class="stat-label">{{ item.label }}</view>
</view> <view class="stat-value">{{ item.value }}</view>
</view>
</template>
</view> </view>
<!-- 申诉答复记录 --> <!-- 申诉答复记录 -->
...@@ -61,7 +69,7 @@ ...@@ -61,7 +69,7 @@
<view class="reply-content">{{ item.replyContent }}</view> <view class="reply-content">{{ item.replyContent }}</view>
<view class="reply-footer"> <view class="reply-footer">
<text>申诉类型:{{ item.appealType === 1 ? '考勤' : '平板' }}</text> <text>申诉类型:{{ item.appealType === 1 ? '考勤' : '平板' }}</text>
<text class="time">{{ item.createdDate }}</text> <text class="time">{{ formatTime(item.replyDate, 'YYYY-MM-DD HH:mm:ss') }}</text>
</view> </view>
</view> </view>
<view v-if="replyList.length === 0" class="empty-text"> <view v-if="replyList.length === 0" class="empty-text">
...@@ -71,11 +79,12 @@ ...@@ -71,11 +79,12 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<AttendanceRecord ref="attendanceRecord" :lastRecord="lastRecord" :currentCount="currentCount" :type="popType" :month="month" /> <AttendanceRecord @confirm="handleConfirm" :appealStartTime="appealData.appealStartTime" :appealEndTime="appealData.appealEndTime" ref="attendanceRecord" :lastRecord="lastRecord" :currentCount="currentCount" :popType="popType" :month="month" />
</view> </view>
</template> </template>
<script> <script>
import dayjs from 'dayjs'
import { EQUITY_ORDER_COUNT_FIELDS, BOUTIQUE_ORDER_COUNT_FIELDS } from './components/contant' import { EQUITY_ORDER_COUNT_FIELDS, BOUTIQUE_ORDER_COUNT_FIELDS } from './components/contant'
import AttendanceRecord from './components/AttendanceRecord.vue'; import AttendanceRecord from './components/AttendanceRecord.vue';
export default { export default {
...@@ -104,20 +113,6 @@ export default { ...@@ -104,20 +113,6 @@ export default {
return { return {
month: '', month: '',
appealData: { appealData: {
actualAttendanceDays: 26,
attendanceDeduction: 100,
dailyReportDays: 26,
dailyReportDeductionAmount: 12300,
missingDailyReportDates: [12, 13, 17],
padRecordNum: 12,
touchCustomerTotal: 11,
padDeductionAmount: 100,
boutiqueAccessoryDealCount: 12,
windowFilmDealCount: 32,
carCoverDealCount: 20,
attendanceAppealable: true,
dailyReportable: true,
padAppealable: true
}, },
replyList: [], replyList: [],
popType: '', popType: '',
...@@ -137,32 +132,15 @@ export default { ...@@ -137,32 +132,15 @@ export default {
} }
} }
}, },
mounted() {
this.loadData(this.lastMonth)
},
methods: { methods: {
// 格式化时间
formatTime(time, formatStr) {
if (!time) return '-';
return dayjs(time).format(formatStr);
},
async loadData(month) { async loadData(month) {
// 模拟加载数据,实际应调用接口 // 模拟加载数据,实际应调用接口
console.log('Loading data for month:', month) console.log('Loading data for month:', month)
// setTimeout(() => {
// const getRandomTwoDigit = () => Math.floor(Math.random() * 90) + 10;
// const data = {
// "windowFilmDealCount": getRandomTwoDigit(),
// "carCoverDealCount": getRandomTwoDigit(),
// "boutiqueAccessoryDealCount": getRandomTwoDigit(),
// "wholeCarWarrantyDealCount": getRandomTwoDigit(),
// "tireInsuranceAchieveCount": getRandomTwoDigit(),
// "safePackageMaxAchieveCount": getRandomTwoDigit(),
// "safePackageAchieveCount": getRandomTwoDigit(),
// "batteryWarrantyDealCount": getRandomTwoDigit(),
// "baicWorryFreeDealCount": getRandomTwoDigit(),
// "guangAiWorryFreeDealCount": getRandomTwoDigit(),
// "guangLianBenefitDealCount": getRandomTwoDigit()
// }
// this.orderStats.forEach(item => {
// this.$set(item, 'value', data[item.prop] || 0)
// })
// })
const { phone } = uni.$storage.get('userInfo') const { phone } = uni.$storage.get('userInfo')
// 参数 // 参数
const params = { const params = {
...@@ -174,12 +152,13 @@ export default { ...@@ -174,12 +152,13 @@ export default {
// 工资申诉订单统计查询 // 工资申诉订单统计查询
const res1 = await uni.$api.commonApi.getWageAppealStatistics(params) const res1 = await uni.$api.commonApi.getWageAppealStatistics(params)
this.orderStats.forEach(item => { this.orderStats.forEach(item => {
this.$set(item, 'value', res1[item.prop] || 0) this.$set(item, 'value', res1[item.prop])
}) })
const res2 = await uni.$api.commonApi.replyList(params) const res2 = await uni.$api.commonApi.replyList(params)
this.replyList = res2 || [] this.replyList = res2 || []
}, },
async handleAppeal(type) { async handleAppeal(type) {
console.log(type, 'type')
// 根据类型跳转或弹窗 // 根据类型跳转或弹窗
if (type === 'dailyReport') { if (type === 'dailyReport') {
// 去补日报逻辑 // 去补日报逻辑
...@@ -191,24 +170,21 @@ export default { ...@@ -191,24 +170,21 @@ export default {
appealMonth: this.month, appealMonth: this.month,
appealType: type == 'record' ? 2 : type == 'attendance' ? 1 : '' appealType: type == 'record' ? 2 : type == 'attendance' ? 1 : ''
} }
// const res = await uni.$api.commonApi.getWageAppealLatestRecord(params) const res = await uni.$api.commonApi.getWageAppealLatestRecord(params)
// console.log('getWageAppealLatestRecord', res) console.log('getWageAppealLatestRecord', res)
// this.lastRecord = res || {} this.lastRecord = res || {}
this.lastRecord = {
appealMonth: '2525-12',
actualAttendanceDays: 24,
applyActualAttendanceDays: 30,
appealType: type == 'record' ? 2 : type == 'attendance' ? 1 : '',
applyPadRecordNum: 90,
attachmentList: [{fileUrl: '121', fileName: '2323'}]
}
if (type == 'record') { if (type == 'record') {
this.currentCount = this.appealData.padRecordNum this.currentCount = this.appealData.padRecordNum
this.lastRecord.shopCount = this.appealData.touchCustomerTotal
} else if (type == 'attendance') { } else if (type == 'attendance') {
this.currentCount = this.appealData.actualAttendanceDays this.currentCount = this.appealData.actualAttendanceDays
} }
this.$refs.attendanceRecord.open() this.$refs.attendanceRecord.open()
} }
},
handleConfirm(val) {
console.log(val)
this.loadData(this.lastMonth)
} }
} }
} }
...@@ -221,25 +197,25 @@ export default { ...@@ -221,25 +197,25 @@ export default {
} }
.header { .header {
font-size: 36rpx; font-size: toRpx(36);
font-weight: 500; font-weight: 500;
color: #333; color: #333;
margin-bottom: 32rpx; margin-bottom: toRpx(32);
} }
.section { .section {
height: calc(100% - #{120rpx}); height: calc(100% - #{toRpx(120)});
} }
.card-row { .card-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 0 48rpx 40rpx 48rpx; margin: 0 toRpx(48) toRpx(40) toRpx(48);
} }
.card-item { .card-item {
width: 32%; width: 32%;
background: #fff; background: #fff;
border-radius: 24rpx; border-radius: toRpx(24);
padding: 32rpx 24rpx; padding: toRpx(32) toRpx(24);
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -249,25 +225,32 @@ export default { ...@@ -249,25 +225,32 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 16rpx; margin-bottom: toRpx(16);
.card-title { .card-title {
font-size: 28rpx; font-size: toRpx(28);
font-weight: 500; font-weight: 500;
color: #333; color: #333;
} }
.card-value { .card-value {
font-size: 28rpx; font-size: toRpx(28);
font-weight: 500; font-weight: 500;
color: #333; color: #333;
} }
.card-unit {
display: inline-block;
font-size: toRpx(24);
}
} }
.card-desc { .card-desc {
font-size: 24rpx; font-size: toRpx(24);
color: #999; color: #999;
margin-bottom: 16rpx; margin-bottom: toRpx(16);
text {
margin-left: toRpx(8);
}
.blue-text { .blue-text {
color: #3B73FF; color: #3B73FF;
...@@ -275,9 +258,12 @@ export default { ...@@ -275,9 +258,12 @@ export default {
} }
.deduction { .deduction {
font-size: 24rpx; font-size: toRpx(24);
color: #666; color: #666;
margin-bottom: 24rpx; margin-bottom: toRpx(24);
text {
margin-left: toRpx(8);
}
.amount { .amount {
color: #FF6B00; color: #FF6B00;
...@@ -286,10 +272,13 @@ export default { ...@@ -286,10 +272,13 @@ export default {
} }
.missing-days { .missing-days {
font-size: 24rpx; font-size: toRpx(24);
color: #757980; color: #757980;
margin-bottom: 24rpx; margin-bottom: toRpx(24);
line-height: 1.4; line-height: 1.4;
.warning-text {
margin-right: toRpx(8);
}
.warning-content { .warning-content {
color: #2A82E4; color: #2A82E4;
} }
...@@ -298,102 +287,102 @@ export default { ...@@ -298,102 +287,102 @@ export default {
.action-btn { .action-btn {
margin-top: auto; margin-top: auto;
width: 100%; width: 100%;
height: 64rpx; height: toRpx(64);
line-height: 64rpx; line-height: toRpx(64);
text-align: center; text-align: center;
background: #EFF4FF; background: #EFF4FF;
border-radius: 32rpx; border-radius: toRpx(32);
color: #3B73FF; color: #3B73FF;
font-size: 28rpx; font-size: toRpx(28);
font-weight: 500;
} }
} }
.section-title { .section-title {
margin: 0 48rpx; margin: 0 toRpx(48);
font-size: 28rpx; font-size: toRpx(28);
font-weight: 500; font-weight: 500;
color: #333; color: #333;
margin-bottom: 24rpx; margin-bottom: toRpx(24);
display: flex; display: flex;
align-items: center; align-items: center;
.subtitle { .subtitle {
font-size: 24rpx; font-size: toRpx(24);
color: #999EA8; color: #999EA8;
font-weight: normal; font-weight: normal;
margin-left: 8rpx; margin-left: toRpx(8);
} }
} }
.order-stats-box { .order-stats-box {
background: #fff; background: #fff;
border-radius: 24rpx; border-radius: toRpx(24);
padding: 32rpx 24rpx; padding: toRpx(32) toRpx(24);
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin: 0 48rpx; margin: 0 toRpx(48);
margin-bottom: 40rpx; margin-bottom: toRpx(40);
.stat-item { .stat-item {
width: 25%; // 四列布局 width: 25%; // 四列布局
margin-bottom: 32rpx; margin-bottom: toRpx(32);
&:nth-last-child(-n+4) { &:nth-last-child(-n+4) {
margin-bottom: 0; margin-bottom: 0;
} }
.stat-label { .stat-label {
font-size: 24rpx; font-size: toRpx(24);
color: #777; color: #777;
margin-bottom: 8rpx; margin-bottom: toRpx(8);
} }
.stat-value { .stat-value {
font-size: 32rpx; font-size: toRpx(32);
font-weight: 500; font-weight: 500;
color: #222; color: #222;
} }
} }
} }
.reply-container { .reply-container {
padding-bottom: 32rpx; padding-bottom: toRpx(32);
} }
.reply-list { .reply-list {
flex: 1; flex: 1;
background: #fff; background: #fff;
border-radius: 24rpx; border-radius: toRpx(24);
padding: 32rpx 24rpx; padding: toRpx(32) toRpx(24);
margin: 0 48rpx; margin: 0 toRpx(48);
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
.reply-item { .reply-item {
background: #FAFAFA; background: #FAFAFA;
border-radius: 16rpx; border-radius: toRpx(16);
padding: 24rpx; padding: toRpx(24);
margin-bottom: 24rpx; margin-bottom: toRpx(24);
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.reply-content { .reply-content {
font-size: 28rpx; font-size: toRpx(28);
color: #292D33; color: #292D33;
line-height: 1.5; line-height: 1.5;
margin-bottom: 16rpx; margin-bottom: toRpx(16);
word-break: break-all;
} }
.reply-footer { .reply-footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
font-size: 24rpx; font-size: toRpx(24);
color: #757B85; color: #757B85;
.time { .time {
margin-left: 24rpx; margin-left: toRpx(24);
color: #999EA8; color: #999EA8;
} }
} }
...@@ -402,11 +391,11 @@ export default { ...@@ -402,11 +391,11 @@ export default {
.empty-text { .empty-text {
text-align: center; text-align: center;
color: #999EA8; color: #999EA8;
font-size: 24rpx; font-size: toRpx(24);
margin: 0 auto; margin: 0 auto;
.empty-image { .empty-image {
width: 128rpx; width: toRpx(128);
height: 128rpx; height: toRpx(128);
} }
} }
} }
......
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
src="../../../../assets/images/common/report-no-data.webp" src="../../../../assets/images/common/report-no-data.webp"
class="icon" class="icon"
/> />
已超过 7 个自然日,暂不支持补填操作 暂不支持补填操作
</view> </view>
</template> </template>
</template> </template>
...@@ -377,6 +377,7 @@ export default { ...@@ -377,6 +377,7 @@ export default {
]), ]),
weeklyList: [], weeklyList: [],
isEditReport: false, isEditReport: false,
editableDay: null
} }
}, },
computed: { computed: {
...@@ -503,8 +504,9 @@ export default { ...@@ -503,8 +504,9 @@ export default {
this.isEditReport = false this.isEditReport = false
}, },
methods: { methods: {
initData () { async initData () {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo let inT1T5 = await uni.$api.commonApi.checkTodayInT1T5(),
{ merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo
this.orderObj = { this.orderObj = {
yqMerchantId: merchantId, yqMerchantId: merchantId,
yqMerchantName: merchantName, yqMerchantName: merchantName,
...@@ -513,6 +515,7 @@ export default { ...@@ -513,6 +515,7 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName: shopMerchantName merchantName: shopMerchantName
} }
if (inT1T5) this.editableDay = dayjs().subtract(1, 'M').startOf('M')
this.getDailyReportCarBrand() this.getDailyReportCarBrand()
}, },
async getDailyReportCarBrand () { async getDailyReportCarBrand () {
...@@ -598,7 +601,9 @@ export default { ...@@ -598,7 +601,9 @@ export default {
carBandList, carBandList,
hwOhterObjArray, hwOhterObjArray,
orderObj, orderObj,
isHmStore } = this, isHmStore,
editableDay
} = this,
{ shopMerchantId, merchantId, uuid } = userInfo { shopMerchantId, merchantId, uuid } = userInfo
uni.showLoading({ uni.showLoading({
mask: true mask: true
...@@ -654,14 +659,15 @@ export default { ...@@ -654,14 +659,15 @@ export default {
return item return item
}) })
} }
let diffDay = dayjs().diff(dayjs(currentDate), 'day') let diffDay = dayjs().diff(dayjs(currentDate), 'day'),
disabledReport = false
if (editableDay && editableDay.diff(dayjs(currentDate), 'day') > 0) disabledReport = true
this.hwOhterObjArray = hwOhterObjArray this.hwOhterObjArray = hwOhterObjArray
this.carBandList = carBandList this.carBandList = carBandList
this.orderObj = { this.orderObj = {
...orderObj, ...orderObj,
reportDate: currentDate, reportDate: currentDate,
isDateWithin7Days: diffDay < 7, isDateWithin7Days:editableDay ? !disabledReport : diffDay < 7,
isDateWithin60Days: diffDay < 60,
remark, remark,
lastStaffName: data.lastStaffName, lastStaffName: data.lastStaffName,
lastStaffUuid: data.lastStaffUuid, lastStaffUuid: data.lastStaffUuid,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!