|
@@ -1,5 +1,5 @@
|
|
<script setup name="ReportEnList">
|
|
<script setup name="ReportEnList">
|
|
-import {nextTick, reactive,ref,computed} from 'vue'
|
|
|
|
|
|
+import {nextTick, reactive,ref,computed,onMounted} from 'vue'
|
|
import apiReportEn from '@/api/reportEn'
|
|
import apiReportEn from '@/api/reportEn'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import ListClassify from './components/ListClassify.vue'
|
|
import ListClassify from './components/ListClassify.vue'
|
|
@@ -10,8 +10,10 @@ import { useRouter } from 'vue-router';
|
|
import { useWindowSize } from '@vueuse/core'
|
|
import { useWindowSize } from '@vueuse/core'
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
import {enReportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
|
|
import {enReportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
|
|
|
|
+import {useReportApprove} from '@/hooks/useReportApprove'
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
const {checkAuthBtn} = useAuthBtn()
|
|
const {checkAuthBtn} = useAuthBtn()
|
|
|
|
+const {isApprove,isOtherApprove,getEtaConfig} = useReportApprove()
|
|
|
|
|
|
const { width, height } = useWindowSize()
|
|
const { width, height } = useWindowSize()
|
|
|
|
|
|
@@ -66,6 +68,7 @@ const listState = reactive({
|
|
loading:false
|
|
loading:false
|
|
})
|
|
})
|
|
async function getList(){
|
|
async function getList(){
|
|
|
|
+ const timeType = ['','publish_time','modify_time','approve_time']
|
|
const res=await apiReportEn.getList({
|
|
const res=await apiReportEn.getList({
|
|
CurrentIndex:listState.page,
|
|
CurrentIndex:listState.page,
|
|
PageSize:listState.pageSize,
|
|
PageSize:listState.pageSize,
|
|
@@ -76,7 +79,7 @@ async function getList(){
|
|
ClassifySecond:listState.ClassifyNameSecond.id,
|
|
ClassifySecond:listState.ClassifyNameSecond.id,
|
|
Frequency:listState.Frequency,
|
|
Frequency:listState.Frequency,
|
|
EmailState:listState.MsgIsSend,
|
|
EmailState:listState.MsgIsSend,
|
|
- TimeType:dateType.value===1?'publish_time':'modify_time',
|
|
|
|
|
|
+ TimeType:timeType[dateType.value]||'publish_time',
|
|
State:listState.publishStatus
|
|
State:listState.publishStatus
|
|
})
|
|
})
|
|
if(res.Ret===200){
|
|
if(res.Ret===200){
|
|
@@ -147,7 +150,7 @@ async function handleReportPublish(item){
|
|
function handleReportPublishCancle(item){
|
|
function handleReportPublishCancle(item){
|
|
showDialog({
|
|
showDialog({
|
|
title: '提示',
|
|
title: '提示',
|
|
- message: `是否确认取消发布?`,
|
|
|
|
|
|
+ message: `是否确认撤销发布?`,
|
|
showCancelButton:true
|
|
showCancelButton:true
|
|
}).then(()=>{
|
|
}).then(()=>{
|
|
apiReportEn.reportPublishCancle({ReportIds:Number(item.Id)}).then(res=>{
|
|
apiReportEn.reportPublishCancle({ReportIds:Number(item.Id)}).then(res=>{
|
|
@@ -159,11 +162,44 @@ function handleReportPublishCancle(item){
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//提交报告
|
|
|
|
+function handleReportSubmit(item){
|
|
|
|
+ showDialog({
|
|
|
|
+ title: '提示',
|
|
|
|
+ message: '是否确认提交该报告进入审批流程?',
|
|
|
|
+ showCancelButton:true
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ apiReportEn.reportEnSubmit({
|
|
|
|
+ ReportId:Number(item.Id)
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+ showToast('提交成功')
|
|
|
|
+ refreshList()
|
|
|
|
+ })
|
|
|
|
+ }).catch(()=>{})
|
|
|
|
+}
|
|
|
|
+//撤销报告
|
|
|
|
+function handleReportCancle(item){
|
|
|
|
+ showDialog({
|
|
|
|
+ title: '提示',
|
|
|
|
+ message: '确定要撤销审批吗?',
|
|
|
|
+ showCancelButton:true
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ apiReportEn.reportEnCancel({
|
|
|
|
+ ReportId:Number(item.Id)
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+ showToast('撤销成功')
|
|
|
|
+ refreshList()
|
|
|
|
+ })
|
|
|
|
+ }).catch(()=>{})
|
|
|
|
+}
|
|
|
|
+
|
|
// 日期筛选
|
|
// 日期筛选
|
|
const calendarMinDate=new Date(2010,0,1)
|
|
const calendarMinDate=new Date(2010,0,1)
|
|
const showCalendar=ref(false)
|
|
const showCalendar=ref(false)
|
|
const calendarIns=ref(null)
|
|
const calendarIns=ref(null)
|
|
-const dateType=ref(1)//1发布时间 2更新时间
|
|
|
|
|
|
+const dateType=ref(1)//1发布时间 2更新时间 3 审批时间
|
|
function handleCalendarChange(e){
|
|
function handleCalendarChange(e){
|
|
listState.StartDate=moment(e[0]).format('YYYY-MM-DD')
|
|
listState.StartDate=moment(e[0]).format('YYYY-MM-DD')
|
|
listState.EndDate=moment(e[1]).format('YYYY-MM-DD')
|
|
listState.EndDate=moment(e[1]).format('YYYY-MM-DD')
|
|
@@ -210,15 +246,18 @@ function onLongPressItem(e){
|
|
}
|
|
}
|
|
//检验权限,如果该状态下无可操作项,则长按不弹出
|
|
//检验权限,如果该状态下无可操作项,则长按不弹出
|
|
let checkState = false
|
|
let checkState = false
|
|
- if(e.State===1){ //编辑、发布、删除
|
|
|
|
|
|
+ if([1,3].includes(e.State)){ //编辑、发布、删除
|
|
checkState = checkAuthBtn(enReportManageBtn.enReport_reportEdit)
|
|
checkState = checkAuthBtn(enReportManageBtn.enReport_reportEdit)
|
|
||checkAuthBtn(enReportManageBtn.enReport_publish)
|
|
||checkAuthBtn(enReportManageBtn.enReport_publish)
|
|
||checkAuthBtn(enReportManageBtn.enReport_reportDel)
|
|
||checkAuthBtn(enReportManageBtn.enReport_reportDel)
|
|
}
|
|
}
|
|
- if(e.State===2){ //群发邮件/群发日志、取消发布
|
|
|
|
|
|
+ if([2,6].includes(e.State)){ //群发邮件/群发日志、取消发布
|
|
checkState = checkAuthBtn(enReportManageBtn.enReport_sendEmail)
|
|
checkState = checkAuthBtn(enReportManageBtn.enReport_sendEmail)
|
|
||checkAuthBtn(enReportManageBtn.enReport_cancelPublish)
|
|
||checkAuthBtn(enReportManageBtn.enReport_cancelPublish)
|
|
}
|
|
}
|
|
|
|
+ if([4,5].includes(e.State)){
|
|
|
|
+ checkState = checkAuthBtn(enReportManageBtn.enReport_cancelPublish)
|
|
|
|
+ }
|
|
if(!checkState) return
|
|
if(!checkState) return
|
|
activeItem.value=e
|
|
activeItem.value=e
|
|
showReportItemOpt.value=true
|
|
showReportItemOpt.value=true
|
|
@@ -277,15 +316,41 @@ const reportStatusOpt=[
|
|
}
|
|
}
|
|
]
|
|
]
|
|
const publishStatusOpt=[
|
|
const publishStatusOpt=[
|
|
|
|
+{
|
|
|
|
+ label:'未发布',
|
|
|
|
+ value:1
|
|
|
|
+ },
|
|
{
|
|
{
|
|
label:'已发布',
|
|
label:'已发布',
|
|
value:2
|
|
value:2
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label:'未发布',
|
|
|
|
- value:1
|
|
|
|
|
|
+ label:'待提交',
|
|
|
|
+ value:3
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label:'待审批',
|
|
|
|
+ value:4
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label:'已驳回',
|
|
|
|
+ value:5
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label:'已通过',
|
|
|
|
+ value:6
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
+const statusOpt = computed(()=>{
|
|
|
|
+ let tempArr = publishStatusOpt
|
|
|
|
+ if(!isApprove.value){
|
|
|
|
+ tempArr = tempArr.filter(i=>![3,4].includes(i.value))
|
|
|
|
+ }
|
|
|
|
+ if(isOtherApprove.value){
|
|
|
|
+ tempArr = tempArr.filter(i=>i.value!==1)
|
|
|
|
+ }
|
|
|
|
+ return tempArr
|
|
|
|
+})
|
|
function handleSelectReportStatus(item){
|
|
function handleSelectReportStatus(item){
|
|
if(temMsgIsSendVal.value==item.value){
|
|
if(temMsgIsSendVal.value==item.value){
|
|
temMsgIsSendVal.value=''
|
|
temMsgIsSendVal.value=''
|
|
@@ -405,6 +470,9 @@ function handleGoEmailLog(e){
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+onMounted(()=>{
|
|
|
|
+ getEtaConfig()
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -487,12 +555,12 @@ function handleGoEmailLog(e){
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</van-dropdown-item>
|
|
</van-dropdown-item>
|
|
- <van-dropdown-item title="发布状态" ref="publishStatusDropMenuIns">
|
|
|
|
|
|
+ <van-dropdown-item title="报告状态" ref="publishStatusDropMenuIns">
|
|
<div class="report-status-box">
|
|
<div class="report-status-box">
|
|
<ul>
|
|
<ul>
|
|
<li
|
|
<li
|
|
:class="['status-item',temPublishStatusVal===item.value?'active':'']"
|
|
:class="['status-item',temPublishStatusVal===item.value?'active':'']"
|
|
- v-for="item in publishStatusOpt"
|
|
|
|
|
|
+ v-for="item in statusOpt"
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@click="handleSelectReportPublishStatus(item)"
|
|
@click="handleSelectReportPublishStatus(item)"
|
|
>{{item.label}}</li>
|
|
>{{item.label}}</li>
|
|
@@ -542,6 +610,10 @@ function handleGoEmailLog(e){
|
|
<div>
|
|
<div>
|
|
<span v-if="item.State===1">未发布</span>
|
|
<span v-if="item.State===1">未发布</span>
|
|
<span v-if="item.State===2" class="active-status">已发布</span>
|
|
<span v-if="item.State===2" class="active-status">已发布</span>
|
|
|
|
+ <span v-if="item.State===3">待提交</span>
|
|
|
|
+ <span v-if="item.State===4">待审批</span>
|
|
|
|
+ <span v-if="item.State===5">已驳回</span>
|
|
|
|
+ <span v-if="item.State===6" class="active-status">已通过</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
@@ -565,7 +637,36 @@ function handleGoEmailLog(e){
|
|
>
|
|
>
|
|
<div class="report-item-action-box" v-if="activeItem">
|
|
<div class="report-item-action-box" v-if="activeItem">
|
|
<!-- <div class="title">{{activeItem.Title}}</div> -->
|
|
<!-- <div class="title">{{activeItem.Title}}</div> -->
|
|
- <template v-if="activeItem.State==1">
|
|
|
|
|
|
+ <!-- 操作:未发布——发布、编辑、删除
|
|
|
|
+ 已发布——取消发布、群发邮件/群发日志
|
|
|
|
+ 待提交——提交、编辑、删除
|
|
|
|
+ 待审批——撤销
|
|
|
|
+ 已通过——撤销、群发邮件/群发日志
|
|
|
|
+ 已驳回——撤销 -->
|
|
|
|
+ <!-- 未发布,待提交 -->
|
|
|
|
+ <template v-if="[1,3].includes(activeItem.State)">
|
|
|
|
+ <div class="item" @click="handleReportEdit(activeItem)" v-if="activeItem.CanEdit&&checkAuthBtn(enReportManageBtn.enReport_reportEdit)">编辑</div>
|
|
|
|
+ <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_publish)&&activeItem.State===1"
|
|
|
|
+ @click="handleReportPublish(activeItem)">发布</div>
|
|
|
|
+ <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_publish)&&activeItem.State===3"
|
|
|
|
+ @click="handleReportSubmit(activeItem)">提交</div>
|
|
|
|
+ <div class="item" @click="handleReportDel(activeItem)" v-permission="enReportManageBtn.enReport_reportDel">删除</div>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 已发布,已通过 -->
|
|
|
|
+ <template v-if="[2,6].includes(activeItem.State)">
|
|
|
|
+ <div class="item" @click="showSendEmail=true;showReportItemOpt=false" v-if="activeItem.EmailState===0&&activeItem.EmailAuth&&checkAuthBtn(enReportManageBtn.enReport_sendEmail)">群发邮件</div>
|
|
|
|
+ <div class="item" @click="handleGoEmailLog(activeItem)" v-if="activeItem.EmailState===1&&activeItem.EmailAuth&&checkAuthBtn(enReportManageBtn.enReport_sendEmail)">群发日志</div>
|
|
|
|
+ <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_cancelPublish)&&activeItem.State===2"
|
|
|
|
+ @click="handleReportPublishCancle(activeItem)">撤销</div> <!-- 实际上是取消发布 -->
|
|
|
|
+ <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_cancelPublish)&&activeItem.State===6"
|
|
|
|
+ @click="handleReportCancle(activeItem)">撤销</div>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 待审批,已驳回 -->
|
|
|
|
+ <template v-if="[4,5].includes(activeItem.State)">
|
|
|
|
+ <div class="item" v-if="checkAuthBtn(enReportManageBtn.enReport_cancelPublish)"
|
|
|
|
+ @click="handleReportCancle(activeItem)">撤销</div>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- <template v-if="activeItem.State==1">
|
|
<div class="item" @click="handleReportEdit(activeItem)" v-if="activeItem.CanEdit&&checkAuthBtn(enReportManageBtn.enReport_reportEdit)">编辑</div>
|
|
<div class="item" @click="handleReportEdit(activeItem)" v-if="activeItem.CanEdit&&checkAuthBtn(enReportManageBtn.enReport_reportEdit)">编辑</div>
|
|
<div class="item" @click="handleReportPublish(activeItem)" v-permission="enReportManageBtn.enReport_publish">发布</div>
|
|
<div class="item" @click="handleReportPublish(activeItem)" v-permission="enReportManageBtn.enReport_publish">发布</div>
|
|
<div class="item" @click="handleReportDel(activeItem)" v-permission="enReportManageBtn.enReport_reportDel">删除</div>
|
|
<div class="item" @click="handleReportDel(activeItem)" v-permission="enReportManageBtn.enReport_reportDel">删除</div>
|
|
@@ -574,7 +675,7 @@ function handleGoEmailLog(e){
|
|
<div class="item" @click="showSendEmail=true;showReportItemOpt=false" v-if="activeItem.EmailState===0&&activeItem.EmailAuth&&checkAuthBtn(enReportManageBtn.enReport_sendEmail)">群发邮件</div>
|
|
<div class="item" @click="showSendEmail=true;showReportItemOpt=false" v-if="activeItem.EmailState===0&&activeItem.EmailAuth&&checkAuthBtn(enReportManageBtn.enReport_sendEmail)">群发邮件</div>
|
|
<div class="item" @click="handleGoEmailLog(activeItem)" v-if="activeItem.EmailState===1&&activeItem.EmailAuth&&checkAuthBtn(enReportManageBtn.enReport_sendEmail)">群发日志</div>
|
|
<div class="item" @click="handleGoEmailLog(activeItem)" v-if="activeItem.EmailState===1&&activeItem.EmailAuth&&checkAuthBtn(enReportManageBtn.enReport_sendEmail)">群发日志</div>
|
|
<div class="item" @click="handleReportPublishCancle(activeItem)" v-permission="enReportManageBtn.enReport_cancelPublish">取消发布</div>
|
|
<div class="item" @click="handleReportPublishCancle(activeItem)" v-permission="enReportManageBtn.enReport_cancelPublish">取消发布</div>
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
</div>
|
|
</div>
|
|
</van-action-sheet>
|
|
</van-action-sheet>
|
|
|
|
|
|
@@ -613,6 +714,7 @@ function handleGoEmailLog(e){
|
|
<div class="time-type-box">
|
|
<div class="time-type-box">
|
|
<span @click="dateType=1" :class="['item',dateType===1?'active':'']">发布时间</span>
|
|
<span @click="dateType=1" :class="['item',dateType===1?'active':'']">发布时间</span>
|
|
<span @click="dateType=2" :class="['item',dateType===2?'active':'']">更新时间</span>
|
|
<span @click="dateType=2" :class="['item',dateType===2?'active':'']">更新时间</span>
|
|
|
|
+ <span @click="dateType=3" :class="['item',dateType===3?'active':'']">审批时间</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</van-calendar>
|
|
</van-calendar>
|