Commit bb31c7e9 by 李伟康

fix(dailyNewspaper): 修复日报编辑权限和时间限制问题

- 将环境配置中的索引从1改为2
- 移除模板类型的条件判断逻辑,统一使用30天前的日期限制
- 修改editableDate计算属性的时间范围从7天扩展到30天
- 将组件中的isToday判断改为editableDate判断
- 将提交按钮的文字从"提交"改为"上报数据"
1 parent 4e5f4a3b
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1 const index = 2
/** /**
* *
0本地 0本地
......
<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>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<view class="btn default-btn" @click="$emit('showNegotiationList')">查看洽谈明细表汇总</view> <view class="btn default-btn" @click="$emit('showNegotiationList')">查看洽谈明细表汇总</view>
<view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view> <view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<view class="btn default-btn" @click="$emit('saveReport', list)" v-else>保存</view> <view class="btn default-btn" @click="$emit('saveReport', list)" v-else>保存</view>
<view class="btn" @click="$emit('submitReport', list)">提交</view> <view class="btn" @click="$emit('submitReport', list)">上报数据</view>
</Footer> </Footer>
</view> </view>
</template> </template>
......
<template> <template>
<view class="report-content "> <view class="report-content ">
<view :class="['report-component', { 'opacity': showNegotiationList }, { 'show': showReport }]"> <view :class="['report-component', { 'opacity': showNegotiationList }, { 'show': showReport }]">
<template v-if="!isToday || ReportStatus == 1"> <template v-if="!editableDate || ReportStatus == 1">
<Detail :templateData="templateData" /> <Detail :templateData="templateData" />
</template> </template>
<template v-else> <template v-else>
......
...@@ -280,12 +280,12 @@ export default { ...@@ -280,12 +280,12 @@ export default {
async checkReport() { async checkReport() {
let componentRef = this.$refs[`ref-${this.componentName}`], let componentRef = this.$refs[`ref-${this.componentName}`],
{ templateData, templateType, currentDate } = this { templateData, templateType, currentDate } = this
if (templateType != 1) { // if (templateType != 1) {
if (!componentRef.isToday) return false // if (!componentRef.isToday) return false
} else { // } else {
let lastDay = dayjs().subtract(7, 'day') let lastDay = dayjs().subtract(30, 'day')
if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false
} // }
return templateData.length ? componentRef.saveBtnStatus : false return templateData.length ? componentRef.saveBtnStatus : false
}, },
...@@ -376,14 +376,14 @@ export default { ...@@ -376,14 +376,14 @@ export default {
}) })
this.templateData = templateData this.templateData = templateData
} else { } else {
if (this.templateType == 1) { // if (this.templateType == 1) {
let lastDay = dayjs().subtract(7, 'day') let lastDay = dayjs().subtract(30, 'day')
if (lastDay.isBefore(dayjs(currentDate), 'day')) this.getDailyTemplate() if (lastDay.isBefore(dayjs(currentDate), 'day')) this.getDailyTemplate()
else uni.hideLoading() else uni.hideLoading()
} else { // } else {
if (nowDate == currentDate) this.getDailyTemplate() // if (nowDate == currentDate) this.getDailyTemplate()
else uni.hideLoading() // else uni.hideLoading()
} // }
} }
} catch (error) { } catch (error) {
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
computed: { computed: {
/**可编辑日期 */ /**可编辑日期 */
editableDate() { editableDate() {
let lastDay = dayjs().subtract(7, 'day'), let lastDay = dayjs().subtract(30, 'day'),
{ currentDate } = this { currentDate } = this
return lastDay.isBefore(dayjs(currentDate), 'day') return lastDay.isBefore(dayjs(currentDate), 'day')
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!