shanbinzhang 1 долоо хоног өмнө
parent
commit
dd94ad950a

+ 29 - 0
src/api/modules/reportV2.js

@@ -165,6 +165,35 @@ export const reportV2Interface = {
 	},
 	},
 }
 }
 
 
+export const reportPushInterface = {
+	/**
+	 * 推送消息
+	 * @param {*} params ReportId   PptId
+	 * @returns 
+	 */
+	pushMsg: params => {
+		return http.post('/report/ice_msg/push',params)
+	},
+
+	/**
+	 * 接收人配置
+	 * @param {*} params ClassifyId   NotifyUsers:[]
+	 * @returns 
+	 */
+	setMsgUsers: params => {
+		return http.post('/report/ice_msg/config',params)
+	},
+
+	/**
+	 * 推送列表
+	 * @param {*} params PageSize CurrentIndex ClassifyId ClassifyType Status SendTime
+	 * @returns 
+	 */
+	getPushList:params => {
+		return http.get('/report/ice_msg/record',params)
+	}
+}
+
 
 
 const reportlist = params => { return http.get('/report/list',params); };  //获取报告列表
 const reportlist = params => { return http.get('/report/list',params); };  //获取报告列表
 
 

+ 1 - 1
src/utils/buttonConfig.js

@@ -45,7 +45,7 @@ export const reportManageBtn={
     reportMange_history: 'reportManage:history',//历史记录
     reportMange_history: 'reportManage:history',//历史记录
 
 
     reportPush_setView: 'reportPush:setView',
     reportPush_setView: 'reportPush:setView',
-    reportPush_recordView: 'reportPush:setView',
+    reportPush_recordView: 'reportPush:recordView',
     reportPush_setBtn: 'reportPush:setBtn',
     reportPush_setBtn: 'reportPush:setBtn',
 }
 }
 /*
 /*

+ 15 - 3
src/views/ppt_manage/newVersion/pptCatalog.vue

@@ -146,7 +146,7 @@
 
 
             <div style="margin-bottom: 10px;">
             <div style="margin-bottom: 10px;">
               <div style="margin-bottom: 4px;" class="item-title">最近一次推送时间</div>
               <div style="margin-bottom: 4px;" class="item-title">最近一次推送时间</div>
-              <div class="item-content">{{$moment(pptItem.PublishTime).format('YYYY-MM-DD HH:mm:ss')}}</div>
+              <div class="item-content" v-if="pptItem.MsgSendTime">{{$moment(pptItem.MsgSendTime).format('YYYY-MM-DD HH:mm:ss')}}</div>
             </div>
             </div>
             
             
             <div style="display: flex;align-items: center;">
             <div style="display: flex;align-items: center;">
@@ -209,6 +209,9 @@ import {pptInterface} from '@/api/api.js';
 import MergePptDialog from './components/catalog/mergePPTDialog.vue';
 import MergePptDialog from './components/catalog/mergePPTDialog.vue';
 // import shareUserDialog from './components/catalog/chooseShareUserDia.vue';
 // import shareUserDialog from './components/catalog/chooseShareUserDia.vue';
 import addPptBaseDia from './components/catalog/addPptBaseDia.vue';
 import addPptBaseDia from './components/catalog/addPptBaseDia.vue';
+import {
+  reportPushInterface,
+} from '@/api/modules/reportV2.js';
 //触发window.resize,使Highcharts重绘
 //触发window.resize,使Highcharts重绘
 const reloadPPTWid = ()=>{
 const reloadPPTWid = ()=>{
   const resizeEvent = new Event('resize')
   const resizeEvent = new Event('resize')
@@ -437,7 +440,7 @@ export default {
           'download':checkPermissionBtn(pptPermission.ppt_download)&&((item.State===6&&item.ReportSource===2) || item.ReportSource===1),
           'download':checkPermissionBtn(pptPermission.ppt_download)&&((item.State===6&&item.ReportSource===2) || item.ReportSource===1),
           'edit':checkPermissionBtn(pptPermission.ppt_save)&&item.HasAuth&&(([3,5].includes(item.State)&&item.ReportSource===2) || item.ReportSource===1),
           'edit':checkPermissionBtn(pptPermission.ppt_save)&&item.HasAuth&&(([3,5].includes(item.State)&&item.ReportSource===2) || item.ReportSource===1),
           'delete':checkPermissionBtn(pptPermission.ppt_del)&&item.ReportSource===1&&item.AdminId===this.RoleId,
           'delete':checkPermissionBtn(pptPermission.ppt_del)&&item.ReportSource===1&&item.AdminId===this.RoleId,
-          'push': [2,6].includes(item.State)
+          'push': [2,6].includes(item.State)&&checkPermissionBtn(pptPermission.ppt_sendMsg)
       }
       }
 
 
       return toolList.filter((i)=>btnAuthMap[i.key]) 
       return toolList.filter((i)=>btnAuthMap[i.key]) 
@@ -521,6 +524,7 @@ export default {
       const handleCommand = {
       const handleCommand = {
         'download':this.downloadPpt,
         'download':this.downloadPpt,
         'delete':this.deletePPT,
         'delete':this.deletePPT,
+        'push':this.pushMessage
       }
       }
       handleCommand[item.key](pptItem)
       handleCommand[item.key](pptItem)
     },
     },
@@ -602,11 +606,19 @@ export default {
       }
       }
     },
     },
 
 
-    async pushMessage() {
+    async pushMessage(item) {
       await this.$confirm('报告将被推送到订阅号,无法撤回,确定推送吗?','提示',{
       await this.$confirm('报告将被推送到订阅号,无法撤回,确定推送吗?','提示',{
         type: 'warning'
         type: 'warning'
       })
       })
+       const res = await reportPushInterface.pushMsg({ 
+        ReportId: 0,
+        PptId: item.PptId
+      })
 
 
+      if (res.Ret !== 200) return
+      this.$message.success(this.$t('ReportManage.smart_msg.push_success'));
+      item.MsgIsSend = 1;
+      item.MsgSendTime = res.Data.MsgSendTime;
     },
     },
 
 
     /* 目录栏收起 展开 */
     /* 目录栏收起 展开 */

+ 75 - 19
src/views/report_manage/components/reportReceiveSet.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="content-box">
+  <div class="content-box reportPush-userSet">
     <el-tree
     <el-tree
       :data="list"
       :data="list"
       node-key="Id"
       node-key="Id"
@@ -16,21 +16,27 @@
     >
     >
       <div
       <div
         class="classify-item-wrap"
         class="classify-item-wrap"
-        slot-scope="{ data }"
+        slot-scope="{ data,node }"
       >
       >
-                  <div>
-                      <span>{{data.ClassifyName}}</span>
-                  </div>
-        
-                  <div class="opt-box">
-                      <!-- 章节设置 -->
-                      <span class="editsty" 
-                          v-if="(!data.Child||(data.Child&&!data.Child.length)) && data.ClassifyType===1" 
-                          @click="handleSetUser(data)"
-                      >
-                        配置人员
-                      </span>
-                  </div>
+          <div>
+              <span>{{data.ClassifyName}}</span>
+              <template v-if="!data.Child||(data.Child&&!data.Child.length)">
+                <el-tag 
+                  :type="data.IceMsgUsers?'success':'danger'"
+                  size="small"
+                >{{ data.IceMsgUsers ? '已配置' : '未配置' }}</el-tag>
+              </template>
+          </div>
+
+          <div class="opt-box">
+              <span 
+                  class="editsty" 
+                  v-if="(!data.Child||(data.Child&&!data.Child.length)) && permissionBtn.isShowBtn('reportManageBtn','reportPush_setBtn')" 
+                  @click="handleOpenSetUser(data,node)"
+              >
+                配置人员
+              </span>
+          </div>
       </div>
       </div>
     </el-tree>
     </el-tree>
 
 
@@ -84,6 +90,10 @@
 import mDialog from '@/components/mDialog.vue';
 import mDialog from '@/components/mDialog.vue';
 import { departInterence } from '@/api/modules/setApi';
 import { departInterence } from '@/api/modules/setApi';
 import { traverseTree } from "@/utils/commonOptions"
 import { traverseTree } from "@/utils/commonOptions"
+import { classifylist } from 'api/api.js';
+import {
+  reportPushInterface
+} from '@/api/modules/reportV2.js';
 export default {
 export default {
   components: { mDialog },
   components: { mDialog },
   data() {
   data() {
@@ -93,14 +103,23 @@ export default {
       userOptions: [],
       userOptions: [],
       isOpenSetDialog: false,
       isOpenSetDialog: false,
       classifyForm: {
       classifyForm: {
-        users:[]
+        users:[],
+        classifyId: 0
       }
       }
     }
     }
   },
   },
   mounted(){
   mounted(){
     this.getUserList();
     this.getUserList();
+    this.getList()
   },
   },
   methods:{
   methods:{
+    async getList(){
+      const res=await classifylist()
+
+      if(res.Ret!==200) return
+      this.list=res.Data.List||[]
+    },
+
     /* 获取用户列表 */
     /* 获取用户列表 */
     async getUserList() {
     async getUserList() {
       
       
@@ -139,12 +158,38 @@ export default {
       dfs(arr); 
       dfs(arr); 
     },
     },
 
 
-    handleOpenDialog() {
-      this.getUserList()
+    handleOpenSetUser(data,node) {
+      let classifyName = '';
+
+      switch(node.level){
+        case 1:
+          classifyName = data.ClassifyName;
+          break;
+        case 2:
+          classifyName = `${node.parent.data.ClassifyName}/${data.ClassifyName}`;
+          break;
+        case 3:
+          classifyName = `${node.parent.parent.data.ClassifyName}/${node.parent.data.ClassifyName}/${data.ClassifyName}`;
+          break;
+      }
+
+      this.classifyForm = {
+        classifyId: data.Id,
+        classifyName,
+        users: data.IceMsgUsers ? data.IceMsgUsers.map(_ => String(_)) : []
+      }
+      this.isOpenSetDialog = true;
     },
     },
 
 
-    handleSetUser() {
+    async handleSetUser() {
+      const res = await reportPushInterface.setMsgUsers({
+        ClassifyId: this.classifyForm.classifyId,
+        NotifyUsers: this.classifyForm.users.map(_ => Number(_))
+      })
+      if(res.Ret !== 200) return 
+      this.$message.success('配置成功')
       this.isOpenSetDialog = false;
       this.isOpenSetDialog = false;
+      this.getList()
     }
     }
   },
   },
 }
 }
@@ -186,3 +231,14 @@ export default {
     } 
     } 
 }
 }
 </style>
 </style>
+<style lang="scss">
+.reportPush-userSet {
+    .el-tree-node__content{
+        height: fit-content;
+        padding-top: 10px;
+        padding-bottom: 10px;
+        border-bottom: 1px solid #C8CDD9;
+    }
+
+}
+</style>

+ 106 - 47
src/views/report_manage/components/repotPushRecord.vue

@@ -1,39 +1,65 @@
 <template>
 <template>
   <div>
   <div>
     <div class="filter-cont">
     <div class="filter-cont">
-      <el-cascader
-          @change="filterChange"
-          :options="classifyOptions"
-          v-model="filterForm.classifyIds"
-          :props="{
-            value: 'Id',
-            label: 'ClassifyName',
-            children: 'Child'
-          }"
+      <div>
+
+        <el-cascader
+            @change="initList"
+            :options="classifyOptions"
+            v-model="filterForm.classifyId"
+            :props="{
+              value: 'Id',
+              label: 'ClassifyName',
+              children: 'Child',
+              emitPath: false
+            }"
+            clearable
+            :placeholder="$t('ReportManage.smart_type_filtering')"
+            style="width:240px;"
+        ></el-cascader>
+
+        <el-select
+          v-model="filterForm.classifyType"
+          style="width: 200px"
+          placeholder="报告类型"
           clearable
           clearable
-          :placeholder="$t('ReportManage.smart_type_filtering')"
-          style="width:240px;"
-      ></el-cascader>
+          @change="initList"
+        >
+          <el-option label="研报" :value="1"/>
+          <el-option label="PPT" :value="2"/>
+        </el-select>
 
 
-      <el-select
-        v-model="filterForm.reportType"
-        style="width: 240px"
-      >
-        <el-option label="报告" value="report"/>
-        <el-option label="PPT" value="ppt"/>
-      </el-select>
+        <el-select
+          v-model="filterForm.pushStatus"
+          style="width: 200px"
+          placeholder="推送状态"
+          clearable
+          @change="initList"
+        >
+          <el-option 
+            :label="status.label" 
+            :value="status.value" 
+            v-for="status in pushStatusOptions" 
+            :key="status.key"
+          />
+        </el-select>
+        <el-date-picker 
+            v-model="filterForm.date"
+            @change="initList"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="操作时间">
+        </el-date-picker>
+      </div>
 
 
-      <el-select
-        v-model="filterForm.pushStatus"
-        style="width: 240px"
-      >
-        <el-option 
-          :label="status.label" 
-          :value="status.value" 
-          v-for="status in pushStatusOptions" 
-          :key="status.key"
-        />
-      </el-select>
+       <el-input 
+        v-model="filterForm.searchTxt" 
+        prefix-icon="el-icon-search" 
+        clearable 
+        @change="initList"
+        placeholder="报告标题" 
+        style="width:260px;margin-left: auto;"
+      />
     </div>
     </div>
 
 
     <el-table
     <el-table
@@ -51,12 +77,20 @@
         align="center"
         align="center"
       >
       >
         <template slot-scope="scope">
         <template slot-scope="scope">
-            
-          <span>{{ scope.row[item.key] }}</span>
+          <span 
+            v-if="item.key==='Status'"
+            :class="scope.row[item.key]===1?'successty':'deletesty'"
+          >
+            {{scope.row[item.key]===1?'推送成功':'推送失败'}}
+          </span>
+          <span v-else-if="item.key==='ClassifyType'">
+            {{scope.row[item.key]===1?'研报':'PPT'}}
+          </span>
+          <span v-else>{{ scope.row[item.key] }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <div slot="empty">
       <div slot="empty">
-        <tableNoData text="暂无记录" size="mini"/>
+        <tableNoData text="暂无推送记录" size="mini"/>
       </div>
       </div>
     </el-table>
     </el-table>
 
 
@@ -72,7 +106,8 @@
 </template>
 </template>
 <script>
 <script>
 import {
 import {
-  classifylist
+  classifylist,
+  reportPushInterface
 } from '@/api/modules/reportV2.js';
 } from '@/api/modules/reportV2.js';
 import mPage from '@/components/mPage.vue'
 import mPage from '@/components/mPage.vue'
 export default {
 export default {
@@ -80,21 +115,27 @@ export default {
   data() {
   data() {
     return {
     return {
       filterForm: {
       filterForm: {
-
+        classifyId: 0,
+        classifyType:'',
+        pushStatus: '',
+        date:'',
+        searchTxt: ''
       },
       },
+      classifyOptions: [],
+
       pushStatusOptions: [
       pushStatusOptions: [
         { label: '推送成功',value: 1 },
         { label: '推送成功',value: 1 },
         { label: '推送失败',value: 2 },
         { label: '推送失败',value: 2 },
       ],
       ],
 
 
       tableColums: [
       tableColums: [
-        { label:'报告标题',key:'Title' },
-        { label:'报告分类',key:'Classify' },
-        { label:'报告类型',key:'Type' },
-        { label:'操作人',key:'' },
-        { label:'接收人',key:'' },
-        { label:'推送状态',key:'' },
-        { label:'操作时间',key:'ModifyTime' },
+        { label:'报告标题',key:'ReportTitle' },
+        { label:'报告分类',key:'ClassifyFullName' },
+        { label:'报告类型',key:'ClassifyType' },
+        { label:'操作人',key:'SendAdminName' },
+        { label:'接收人',key:'ReceiveAdminName' },
+        { label:'推送状态',key:'Status' },
+        { label:'操作时间',key:'CreateTime' },
       ],
       ],
 
 
       list: [],
       list: [],
@@ -104,7 +145,8 @@ export default {
     }
     }
   },
   },
   mounted(){
   mounted(){
-
+    this.getclassifylist();
+    this.getList()
   },
   },
   methods:{
   methods:{
     pageChange(page) {
     pageChange(page) {
@@ -112,17 +154,30 @@ export default {
       this.getList()
       this.getList()
     },
     },
 
 
-    filterChange() {
+    initList() {
       this.pageChange(1)
       this.pageChange(1)
     },
     },
 
 
-    getList() {
+    async getList() {
+      let params = {
+        PageSize: this.pageSize,
+        CurrentIndex: this.pageNo,
+        ClassifyId: this.filterForm.classifyId,
+        ClassifyType: this.filterForm.classifyType,
+        Status: this.filterForm.pushStatus,
+        SendTime: this.filterForm.date
+      }
+
+      const res = await reportPushInterface.getPushList(params)
+      if(res.Ret !== 200) return
       
       
+      this.list = res.Data.List || [];
+      this.total = res.Data.Paging.Totals;
     },
     },
 
 
-     getclassifylist() {
+    getclassifylist() {
       //获取分类列表
       //获取分类列表
-      let params = { CurrentIndex: 0, PageSize: 1000, KeyWord: "",ClassifyType:1 };
+      let params = { CurrentIndex: 0, PageSize: 1000, KeyWord: "" };
 
 
       classifylist(params).then((res) => {
       classifylist(params).then((res) => {
         if (res.Ret == 200 && Array.isArray(res.Data.List)) {
         if (res.Ret == 200 && Array.isArray(res.Data.List)) {
@@ -137,5 +192,9 @@ export default {
 <style scoped lang='scss'>
 <style scoped lang='scss'>
 .filter-cont {
 .filter-cont {
   margin-bottom: 10px;
   margin-bottom: 10px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  flex-wrap: wrap;
 }
 }
 </style>
 </style>

+ 12 - 7
src/views/report_manage/pushMessageList.vue

@@ -25,18 +25,23 @@ export default {
   components: { repotPushRecord,reportReceiveSet },
   components: { repotPushRecord,reportReceiveSet },
   data() {
   data() {
     return {
     return {
-      defaultTab: 'record',
-      tabs: [
-        { label: '推送记录', key:'record' },
-        { label: '接收人员配置', key:'set' },
-      ]
+      defaultTab: '',
+      alltabs: [
+        { label: '推送记录', key:'record',authCode:'reportPush_recordView' },
+        { label: '接收人员配置', key:'set',authCode:'reportPush_setView' },
+      ],
+      tabs: []
     }
     }
   },
   },
   mounted(){
   mounted(){
-    
+    this.init()
   },
   },
   methods:{
   methods:{
-
+    init() {
+      const {reportManageBtn,checkPermissionBtn}=this.permissionBtn;
+      this.tabs = this.alltabs.filter( _ => checkPermissionBtn(reportManageBtn[_.authCode]));
+      this.defaultTab = this.tabs[0].key;
+    }
   },
   },
 }
 }
 </script>
 </script>

+ 7 - 10
src/views/report_manage/reportV2/list.vue

@@ -195,9 +195,9 @@
             </template>
             </template>
           </el-table-column>
           </el-table-column>
 
 
-          <el-table-column v-if="permissionBtn.checkPermissionBtn(permissionBtn.reportManageBtn.reportManage_reportList_sendTime)"
+          <el-table-column
             prop="MsgSendTime"
             prop="MsgSendTime"
-            :label="$t('ReportManage.smart_report_push_time_btn')"
+            label="最近一次推送时间"
             min-width="124"
             min-width="124"
             align="center"
             align="center"
           >
           >
@@ -205,12 +205,6 @@
               scope.row.MsgSendTime | formatTime
               scope.row.MsgSendTime | formatTime
             }}</template>
             }}</template>
           </el-table-column>
           </el-table-column>
-          <el-table-column
-            prop="ModifyTime"
-            label="最近一次推送时间"
-            min-width="124"
-            align="center"
-          ></el-table-column>
 
 
           <el-table-column
           <el-table-column
             prop="ModifyTime"
             prop="ModifyTime"
@@ -431,7 +425,7 @@ import {
   voiceupload,
   voiceupload,
   reportdelete,
   reportdelete,
   markReport,
   markReport,
-  reportMessageSend,
+  reportPushInterface,
   weekReportValidAudio,
   weekReportValidAudio,
 } from '@/api/modules/reportV2.js';
 } from '@/api/modules/reportV2.js';
 import { departInterence } from "api/api.js";
 import { departInterence } from "api/api.js";
@@ -955,7 +949,10 @@ export default {
         type: 'warning'
         type: 'warning'
       })
       })
 
 
-      const res = await reportMessageSend({ ReportId: item.Id })
+      const res = await reportPushInterface.pushMsg({ 
+        ReportId: item.Id,
+        PptId: 0
+      })
 
 
       if (res.Ret === 200) {
       if (res.Ret === 200) {
         this.$message.success(this.$t('ReportManage.smart_msg.push_success'));
         this.$message.success(this.$t('ReportManage.smart_msg.push_success'));