Commit 878abe5b by 胡悦

feat(工资申诉): 支持从工资申诉页面跳转补日报并返回

在工资申诉页面点击补日报时,根据用户场景跳转到对应日报页面
日报提交成功后根据进入类型显示不同的返回按钮文本并触发返回事件
修复日历组件在1月时无法向后导航的问题
更新雪碧图及相关样式文件
1 parent c84b5941

3 MB | W: | H:

3 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -237,7 +237,8 @@ export default { ...@@ -237,7 +237,8 @@ export default {
}, },
props: { props: {
currentDate: String, currentDate: String,
currentMonth: String currentMonth: String,
enterType: String,
}, },
name: 'DailyReport', name: 'DailyReport',
data () { data () {
...@@ -704,6 +705,8 @@ export default { ...@@ -704,6 +705,8 @@ export default {
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj) const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj)
uni.hideLoading() uni.hideLoading()
if (data) { if (data) {
let _text = '返回首页'
if (this.enterType == 'wageAppeal') _text = '返回上一页'
this.isEditReport = false this.isEditReport = false
this.noticeObj = { this.noticeObj = {
title: '提交成功', title: '提交成功',
...@@ -711,10 +714,11 @@ export default { ...@@ -711,10 +714,11 @@ export default {
type: 'success', type: 'success',
buttons: [ buttons: [
{ {
text: '返回首页', text: _text,
type: 'primary', type: 'primary',
callback: _ => { callback: _ => {
uni.navigateBack() uni.navigateBack()
if (this.enterType == 'wageAppeal') uni.$emit('backToWageAppeal')
} }
} }
] ]
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
:currentMonth="currentMonth" :currentMonth="currentMonth"
:lastMonth="lastMonth" :lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event" @setCalendarSelected="selectedDays = $event"
:enterType="enterType"
/> />
</view> </view>
</view> </view>
...@@ -112,12 +113,14 @@ export default { ...@@ -112,12 +113,14 @@ export default {
selectedDays: [], selectedDays: [],
lockReason: '', lockReason: '',
showStudyPermissionPopup: false, showStudyPermissionPopup: false,
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM') lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'),
enterType: '',
} }
}, },
onLoad (options) { onLoad (options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
if (options.enterType) this.enterType = options.enterType
uni.$on('jumpToDailyReport', currentDate => { uni.$on('jumpToDailyReport', currentDate => {
this.toolComponentName = 'DailyReport' this.toolComponentName = 'DailyReport'
if (currentDate) this.setCurrentDate(currentDate) if (currentDate) this.setCurrentDate(currentDate)
......
...@@ -56,6 +56,7 @@ export default { ...@@ -56,6 +56,7 @@ export default {
}, },
computed: { computed: {
canGoNext() { canGoNext() {
if (dayjs().month() === 0) return false
return this.displayYear < this.today.year return this.displayYear < this.today.year
}, },
canGoPrev() { canGoPrev() {
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<AttendanceRecord @confirm="handleConfirm" :appealStartTime="appealData.appealStartTime" :appealEndTime="appealData.appealEndTime" ref="attendanceRecord" :lastRecord="lastRecord" :currentCount="currentCount" :popType="popType" :month="month" /> <AttendanceRecord :appealStartTime="appealData.appealStartTime" :appealEndTime="appealData.appealEndTime" ref="attendanceRecord" :lastRecord="lastRecord" :currentCount="currentCount" :popType="popType" :month="month" />
</view> </view>
</template> </template>
...@@ -132,6 +132,14 @@ export default { ...@@ -132,6 +132,14 @@ export default {
} }
} }
}, },
created() {
uni.$on('backToWageAppeal', () => {
this.loadData(this.month)
})
},
beforeDestroy() {
uni.$off('backToWageAppeal')
},
methods: { methods: {
// 格式化时间 // 格式化时间
formatTime(time, formatStr) { formatTime(time, formatStr) {
...@@ -162,7 +170,18 @@ export default { ...@@ -162,7 +170,18 @@ export default {
// 根据类型跳转或弹窗 // 根据类型跳转或弹窗
if (type === 'dailyReport') { if (type === 'dailyReport') {
// 去补日报逻辑 // 去补日报逻辑
uni.$emit('jumpToDailyReport') const {sceneType} = uni.$storage.get('userInfo')
const len = this.appealData.missingDailyReportDates.length
const currentDate = `${this.month}-${this.appealData.missingDailyReportDates[len - 1]}`
if (sceneType == 1) {
uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport&currentDate=${currentDate}&enterType=wageAppeal`
})
} else if (sceneType == 0) {
uni.navigateTo({
url: `/pages/equity/tool/index?componentName=DailyReport&currentDate=${currentDate}&enterType=wageAppeal`
})
}
} else { } else {
// 申诉弹窗或其他逻辑 // 申诉弹窗或其他逻辑
this.popType = type this.popType = type
...@@ -182,10 +201,6 @@ export default { ...@@ -182,10 +201,6 @@ export default {
this.$refs.attendanceRecord.open() this.$refs.attendanceRecord.open()
} }
}, },
handleConfirm(val) {
console.log(val)
this.loadData(this.lastMonth)
}
} }
} }
</script> </script>
......
...@@ -291,7 +291,8 @@ export default { ...@@ -291,7 +291,8 @@ export default {
}, },
props: { props: {
currentDate: String, currentDate: String,
currentMonth: String currentMonth: String,
enterType: String
}, },
name: 'DailyReport', name: 'DailyReport',
data () { data () {
...@@ -814,6 +815,8 @@ export default { ...@@ -814,6 +815,8 @@ export default {
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj) const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj)
uni.hideLoading() uni.hideLoading()
if (data) { if (data) {
let _text = '返回首页'
if (this.enterType == 'wageAppeal') _text = '返回上一页'
this.isEditReport = false this.isEditReport = false
this.noticeObj = { this.noticeObj = {
title: '提交成功', title: '提交成功',
...@@ -821,10 +824,11 @@ export default { ...@@ -821,10 +824,11 @@ export default {
type: 'success', type: 'success',
buttons: [ buttons: [
{ {
text: '返回首页', text: _text,
type: 'primary', type: 'primary',
callback: _ => { callback: _ => {
uni.navigateBack() uni.navigateBack()
if (this.enterType == 'wageAppeal') uni.$emit('backToWageAppeal')
} }
} }
] ]
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</view> </view>
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" :lastMonth="lastMonth" @setCalendarSelected="selectedDays = $event" /> <component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" :lastMonth="lastMonth" @setCalendarSelected="selectedDays = $event" :enterType="enterType" />
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup> <NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
...@@ -87,12 +87,14 @@ export default { ...@@ -87,12 +87,14 @@ export default {
selectedDays: [], selectedDays: [],
lockReason: '', lockReason: '',
showStudyPermissionPopup: false, showStudyPermissionPopup: false,
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM') lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'),
enterType: ''
} }
}, },
onLoad(options) { onLoad(options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
if (options.enterType) this.enterType = options.enterType
uni.$on('jumpToDailyReport', currentDate => { uni.$on('jumpToDailyReport', currentDate => {
this.toolComponentName = 'DailyReport' this.toolComponentName = 'DailyReport'
if (currentDate) this.setCurrentDate(currentDate) if (currentDate) this.setCurrentDate(currentDate)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!