Эх сурвалжийг харах

研报定时发布做推送消息控制

jwyu 1 жил өмнө
parent
commit
3941294013

+ 18 - 15
src/views/report_manage/addreportNew.vue

@@ -726,31 +726,34 @@ export default {
 				return
 			}
 			console.log('定时去发布了');
-			this.$confirm('是否发布定时报告,并推送模板消息?', '发布提示', {
-				confirmButtonText: '推送',
-				cancelButtonText: '不推送',
+			const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)
+			this.$confirm(isPost?'是否发布定时报告,并推送模板消息?':'是否发布定时报告?', '发布提示', {
+				confirmButtonText: isPost?'推送':'发布',
+				cancelButtonText: isPost?'不推送':'取消',
 				type: 'warning',
 				distinguishCancelAndClose:true,
 				beforeClose:(action, instance,done)=>{
 					console.log(action, instance);
 					if(action==='close'||action==='cancel') {
-						//右上角或者不推送
-						reportSetPrepublish({
-							ReportId:Number(this.report_draft_id),
-							PrePublishTime:this.taskTime,
-							PreMsgSend:0,
-						}).then(res=>{
-							if(res.Ret===200){
-								this.$message.success('定时发布成功!')
-								this.$router.push({ path: '/reportlist' });
-							}
-						})
+						if(isPost) {
+							//右上角或者不推送
+							reportSetPrepublish({
+								ReportId:Number(this.report_draft_id),
+								PrePublishTime:this.taskTime,
+								PreMsgSend:0,
+							}).then(res=>{
+								if(res.Ret===200){
+									this.$message.success('定时发布成功!')
+									this.$router.push({ path: '/reportlist' });
+								}
+							})
+						}
 					} else {
 						//confirmButton
 						reportSetPrepublish({
 							ReportId:Number(this.report_draft_id),
 							PrePublishTime:this.taskTime,
-							PreMsgSend:1,
+							PreMsgSend:isPost?1:0,
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success('定时发布成功!')

+ 18 - 14
src/views/report_manage/editreportNew.vue

@@ -733,31 +733,35 @@ export default {
 				})
 				return
 			}
-			this.$confirm('是否发布定时报告,并推送模板消息?', '发布提示', {
-				confirmButtonText: '推送',
-				cancelButtonText: '不推送',
+			const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)
+
+			this.$confirm(isPost?'是否发布定时报告,并推送模板消息?':'是否发布定时报告?', '发布提示', {
+				confirmButtonText: isPost?'推送':'发布',
+				cancelButtonText: isPost?'不推送':'取消',
 				type: 'warning',
 				distinguishCancelAndClose:true,
 				beforeClose:(action, instance,done)=>{
 					console.log(action, instance);
 					if(action==='close'||action==='cancel') {
 						//右上角或者不推送
-						reportSetPrepublish({
-							ReportId:Number(this.report_id),
-							PrePublishTime:this.taskTime,
-							PreMsgSend:0,
-						}).then(res=>{
-							if(res.Ret===200){
-								this.$message.success('定时发布成功!')
-								this.$router.push({ path: '/reportlist' });
-							}
-						})
+						if(isPost){
+							reportSetPrepublish({
+								ReportId:Number(this.report_id),
+								PrePublishTime:this.taskTime,
+								PreMsgSend:0,
+							}).then(res=>{
+								if(res.Ret===200){
+									this.$message.success('定时发布成功!')
+									this.$router.push({ path: '/reportlist' });
+								}
+							})
+						}
 					} else {
 						//confirmButton
 						reportSetPrepublish({
 							ReportId:Number(this.report_id),
 							PrePublishTime:this.taskTime,
-							PreMsgSend:1,
+							PreMsgSend:isPost?1:0,
 						}).then(res=>{
 							if(res.Ret===200){
 								this.$message.success('定时发布成功!')