|
@@ -3,7 +3,7 @@ import { showToast,showDialog } from 'vant';
|
|
import apiReport from '@/api/report'
|
|
import apiReport from '@/api/report'
|
|
|
|
|
|
const props=defineProps({
|
|
const props=defineProps({
|
|
- reportId:{
|
|
|
|
|
|
+ reportData:{
|
|
default:''
|
|
default:''
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -12,8 +12,9 @@ const emits=defineEmits(['close'])
|
|
// 确认发布报告
|
|
// 确认发布报告
|
|
// type 1 仅发布 2发布且推送
|
|
// type 1 仅发布 2发布且推送
|
|
function handleConfirmPublish(type){
|
|
function handleConfirmPublish(type){
|
|
|
|
+ if(type==2&&props.reportData.MsgIsSend==1) return
|
|
apiReport.reportPublish({
|
|
apiReport.reportPublish({
|
|
- ReportIds:props.reportId
|
|
|
|
|
|
+ ReportIds:props.reportData.Id.toString()
|
|
}).then(res=>{
|
|
}).then(res=>{
|
|
if(res.Ret==200){
|
|
if(res.Ret==200){
|
|
if(type===2){
|
|
if(type===2){
|
|
@@ -38,7 +39,7 @@ function handleConfirmPublish(type){
|
|
// 推送消息
|
|
// 推送消息
|
|
function handleReportMessageSend(publish){
|
|
function handleReportMessageSend(publish){
|
|
apiReport.reportMessageSend({
|
|
apiReport.reportMessageSend({
|
|
- ReportId:Number(props.reportId)
|
|
|
|
|
|
+ ReportId:Number(props.reportData.Id)
|
|
}).then(res=>{
|
|
}).then(res=>{
|
|
if(res.Ret===200){
|
|
if(res.Ret===200){
|
|
if(publish){
|
|
if(publish){
|
|
@@ -57,7 +58,7 @@ function handleReportMessageSend(publish){
|
|
<div class="title">发布提示</div>
|
|
<div class="title">发布提示</div>
|
|
<p class="tips">是否发布报告,且推送模板消息和客户群?</p>
|
|
<p class="tips">是否发布报告,且推送模板消息和客户群?</p>
|
|
<div class="btns">
|
|
<div class="btns">
|
|
- <div class="btn blue" @click="handleConfirmPublish(2)">发布&推送</div>
|
|
|
|
|
|
+ <div :class="['btn blue',reportData.MsgIsSend===1?'disabled':'']" @click="handleConfirmPublish(2)">发布&推送</div>
|
|
<div class="btn" @click="handleConfirmPublish(1)">仅发布</div>
|
|
<div class="btn" @click="handleConfirmPublish(1)">仅发布</div>
|
|
<div class="btn" @click="emits('close')">取消发布</div>
|
|
<div class="btn" @click="emits('close')">取消发布</div>
|
|
</div>
|
|
</div>
|
|
@@ -91,6 +92,9 @@ function handleReportMessageSend(publish){
|
|
background-color: $theme-color;
|
|
background-color: $theme-color;
|
|
color: #fff;
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
+ .disabled{
|
|
|
|
+ background-color: #a8b0fc;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|