Commit bb31c7e9 by 李伟康

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

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