|
@@ -1,5 +1,5 @@
|
|
|
<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 moment from 'moment'
|
|
|
import ListClassify from './components/ListClassify.vue'
|
|
@@ -10,8 +10,10 @@ import { useRouter } from 'vue-router';
|
|
|
import { useWindowSize } from '@vueuse/core'
|
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
|
import {enReportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
|
|
|
+import {useReportApprove} from '@/hooks/useReportApprove'
|
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
|
const {checkAuthBtn} = useAuthBtn()
|
|
|
+const {isApprove,getEtaConfig} = useReportApprove()
|
|
|
|
|
|
const { width, height } = useWindowSize()
|
|
|
|
|
@@ -159,6 +161,39 @@ 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 showCalendar=ref(false)
|
|
@@ -210,15 +245,18 @@ function onLongPressItem(e){
|
|
|
}
|
|
|
//检验权限,如果该状态下无可操作项,则长按不弹出
|
|
|
let checkState = false
|
|
|
- if(e.State===1){ //编辑、发布、删除
|
|
|
+ if([1,3].includes(e.State)){ //编辑、发布、删除
|
|
|
checkState = checkAuthBtn(enReportManageBtn.enReport_reportEdit)
|
|
|
||checkAuthBtn(enReportManageBtn.enReport_publish)
|
|
|
||checkAuthBtn(enReportManageBtn.enReport_reportDel)
|
|
|
}
|
|
|
- if(e.State===2){ //群发邮件/群发日志、取消发布
|
|
|
+ if([2,6].includes(e.State)){ //群发邮件/群发日志、取消发布
|
|
|
checkState = checkAuthBtn(enReportManageBtn.enReport_sendEmail)
|
|
|
||checkAuthBtn(enReportManageBtn.enReport_cancelPublish)
|
|
|
}
|
|
|
+ if([4,5].includes(e.State)){
|
|
|
+ checkState = checkAuthBtn(enReportManageBtn.enReport_cancelPublish)
|
|
|
+ }
|
|
|
if(!checkState) return
|
|
|
activeItem.value=e
|
|
|
showReportItemOpt.value=true
|
|
@@ -277,13 +315,29 @@ const reportStatusOpt=[
|
|
|
}
|
|
|
]
|
|
|
const publishStatusOpt=[
|
|
|
+{
|
|
|
+ label:'未发布',
|
|
|
+ value:1
|
|
|
+ },
|
|
|
{
|
|
|
label:'已发布',
|
|
|
value:2
|
|
|
},
|
|
|
{
|
|
|
- label:'未发布',
|
|
|
- value:1
|
|
|
+ label:'待提交',
|
|
|
+ value:3
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'待审批',
|
|
|
+ value:4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'已驳回',
|
|
|
+ value:5
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'已通过',
|
|
|
+ value:6
|
|
|
}
|
|
|
]
|
|
|
function handleSelectReportStatus(item){
|
|
@@ -405,6 +459,9 @@ function handleGoEmailLog(e){
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+onMounted(()=>{
|
|
|
+ getEtaConfig()
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -487,7 +544,7 @@ function handleGoEmailLog(e){
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-dropdown-item>
|
|
|
- <van-dropdown-item title="发布状态" ref="publishStatusDropMenuIns">
|
|
|
+ <van-dropdown-item title="报告状态" ref="publishStatusDropMenuIns">
|
|
|
<div class="report-status-box">
|
|
|
<ul>
|
|
|
<li
|
|
@@ -542,6 +599,10 @@ function handleGoEmailLog(e){
|
|
|
<div>
|
|
|
<span v-if="item.State===1">未发布</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>
|
|
|
</li>
|
|
@@ -565,7 +626,36 @@ function handleGoEmailLog(e){
|
|
|
>
|
|
|
<div class="report-item-action-box" v-if="activeItem">
|
|
|
<!-- <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="handleReportPublish(activeItem)" v-permission="enReportManageBtn.enReport_publish">发布</div>
|
|
|
<div class="item" @click="handleReportDel(activeItem)" v-permission="enReportManageBtn.enReport_reportDel">删除</div>
|
|
@@ -574,7 +664,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="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>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</div>
|
|
|
</van-action-sheet>
|
|
|
|
|
@@ -611,7 +701,7 @@ function handleGoEmailLog(e){
|
|
|
<span>日期选择</span>
|
|
|
</div>
|
|
|
<div class="time-type-box">
|
|
|
- <span @click="dateType=1" :class="['item',dateType===1?'active':'']">发布时间</span>
|
|
|
+ <span @click="dateType=1" :class="['item',dateType===1?'active':'']">{{isApprove?'审批时间':'发布时间'}}</span>
|
|
|
<span @click="dateType=2" :class="['item',dateType===2?'active':'']">更新时间</span>
|
|
|
</div>
|
|
|
</template>
|