jwyu 1 anno fa
parent
commit
4b6a6c8213

+ 11 - 4
src/views/report/Detail.vue

@@ -66,7 +66,14 @@ function handleDelReport(){
 
 // 推送消息
 function handleReportSendMsg(){
-    
+    apiReport.reportMessageSend({
+        ReportId:Number(props.reportId)
+    }).then(res=>{
+        if(res.Ret===200){
+            showToast('推送成功')
+            getReportDetail()
+        }
+    })
 }
 
 </script>
@@ -87,11 +94,11 @@ function handleReportSendMsg(){
             </template>
             <template v-if="reportInfo.State===2">
                 <!-- 推送消息 -->
-                <div class="btn-item" @click="handleReportSendMsg">
+                <div class="btn-item" v-if="!reportInfo.MsgIsSend" @click="handleReportSendMsg">
                     <img src="@/assets/imgs/icon_publish.png" alt="">
                 </div>
                 <!-- 取消发布 -->
-                <div class="btn-item" @click="showPublishPop=true">
+                <div class="btn-item" @click="handleReportPublishCancle">
                     <img src="@/assets/imgs/report/icon_publish.png" alt="">
                 </div>
             </template>
@@ -111,7 +118,7 @@ function handleReportSendMsg(){
         position="center"
         round
     >
-        <ReportPublishPop :reportId="$route.query.id" @close="handlePublishPopClose"/>
+        <ReportPublishPop :reportData="reportInfo" @close="handlePublishPopClose"/>
     </van-popup>
 </template>
 

+ 4 - 4
src/views/report/List.vue

@@ -82,10 +82,10 @@ function handleReportDel(item){
 }
 
 // 发布报告
-let activeReportId=ref('')
+let activeReportData=ref('')
 let showPublishPop=ref(false)
 async function handleReportPublish(item){
-    activeReportId.value=item.Id.toString()
+    activeReportData.value=item
 
     // 周报校验是否上传了音频
     if(item.ClassifyNameFirst=='周报'){
@@ -115,7 +115,7 @@ function handlePublishPopClose(refresh){
     if(refresh){
         refreshList()
     }
-    activeReportId.value=0
+    activeReportData.value=''
     showPublishPop.value=false
 }
 
@@ -397,7 +397,7 @@ function handleConfirmStatus(){
         position="center"
         round
     >
-        <ReportPublishPop :reportId="activeReportId" @close="handlePublishPopClose"/>
+        <ReportPublishPop :reportData="activeReportData" @close="handlePublishPopClose"/>
     </van-popup>
 
     <!-- 日期筛选 -->

+ 35 - 17
src/views/report/chapter/List.vue

@@ -84,6 +84,9 @@ function goChapterDetail(item){
 
 <template>
     <div class="report-chapterlist-page" v-if="reportInfo">
+        <div class="top-form-wrap">
+
+        </div>
         <div>
             <span>报告类型</span>
             <span>{{reportInfo.ClassifyNameFirst}}</span>
@@ -100,23 +103,27 @@ function goChapterDetail(item){
             <span>作者</span>
             <span>{{reportInfo.Author}}</span>
         </div>
-        <div>章节列表</div>
-        <ul class="chapter-list">
-            <li class="item" v-for="item in chapterList" :key="item.ReportChapterId" @click="goChapterDetail(item)">
-                <div class="img-box">
-                    <img :src="item.TypeEditImg" alt="">
-                    <span>{{item.TypeName}}</span>
-                </div>
-                <div class="content">
-                    <div>{{item.TypeName}}</div>
-                    <div>{{item.PublishState==1?'未发布':'已发布'}}</div>
-                    <div>{{item.ModifyTime}}</div>
-                    <div @click="handleShowTrendTag(item)">{{item.Trend||'添加标签'}}</div>
-                    <div v-if="item.PublishState==2">微信分享</div>
-                    <div v-if="reportInfo.ClassifyNameFirst=='周报'">{{item.VideoUrl&&item.VideoKind==1?'已传录音':'未传录音'}}</div>
-                </div>
-            </li>
-        </ul>
+
+        <div class="chapter-list-wrap">
+            <span class="list-lable">章节列表</span>
+            <ul class="chapter-list">
+                <li class="item" v-for="item in chapterList" :key="item.ReportChapterId" @click="goChapterDetail(item)">
+                    <div class="img-box">
+                        <img :src="item.TypeEditImg" alt="">
+                        <span>{{item.TypeName}}</span>
+                    </div>
+                    <div class="content">
+                        <div>{{item.TypeName}}</div>
+                        <div>{{item.PublishState==1?'未发布':'已发布'}}</div>
+                        <div>{{item.ModifyTime}}</div>
+                        <div @click="handleShowTrendTag(item)">{{item.Trend||'添加标签'}}</div>
+                        <div v-if="item.PublishState==2">微信分享</div>
+                        <div v-if="reportInfo.ClassifyNameFirst=='周报'">{{item.VideoUrl&&item.VideoKind==1?'已传录音':'未传录音'}}</div>
+                    </div>
+                </li>
+            </ul>
+        </div>
+        
     </div>
     <!-- 选择标签 -->
     <van-popup 
@@ -135,6 +142,17 @@ function goChapterDetail(item){
 </template>
 
 <style lang="scss" scoped>
+.chapter-list-wrap{
+    border-top: 10px solid #F2F6FA;
+    padding: 60px 34px;
+    .list-lable{
+        display: block;
+        font-weight: 600;
+        font-size: 32px;
+        margin-bottom: 55px;
+    }
+
+}
 .chapter-list{
     .item{
         display: flex;

+ 0 - 3
src/views/report/components/ListFilter.vue

@@ -1,3 +0,0 @@
-<script setup>
-
-</script>

+ 8 - 4
src/views/report/components/ReportPublishPop.vue

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