Browse Source

feat: 系统消息

zhengxy 1 year ago
parent
commit
432e33422d

+ 5 - 1
project/src/components/assembly/screen/pay.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="common-screen-item pay">
3 3
     <label class="common-screen-label" v-if="title&&title!=''">{{title}}</label>
4
-    <el-popover placement="bottom" trigger="click" v-model="visible" @hide="visibleHide">
4
+    <el-popover placement="bottom" trigger="click" v-model="visible" @hide="visibleHide" :disabled="disabled">
5 5
       <div :style="width?'width:'+width:''" :class="['common-screen-self-box','common-input-select',valueObj.radio!=null&&clearable?'common-input-select-hover':'']" slot="reference">
6 6
         <div :class="['common-screen-self-con',valueObj.radio!=0&&valueObj.radio==null?'common-screen-self-placeholder':'']" :style="width?'text-align: left;padding-left: 15px !important;':''">
7 7
           <div class="common-screen-self-con-div">
@@ -56,6 +56,10 @@ export default {
56 56
       type: Object,
57 57
       default: () => { }
58 58
     },
59
+    disabled: {
60
+      type: Boolean,
61
+      default: false,
62
+    },
59 63
   },
60 64
   watch: {
61 65
     reset () {

+ 18 - 3
project/src/components/manage/systemMsg.vue

@@ -33,7 +33,7 @@
33 33
             </template>
34 34
 
35 35
             <template v-else-if="item.column == 'handler'">
36
-              <div class="c-00B38A pointer table_button" @click="onClickDetail(row)">详情</div>
36
+              <div class="c-00B38A pointer table_button" @click="onClickDetail(row)">配置详情</div>
37 37
             </template>
38 38
 
39 39
             <span v-else>{{ (row[item.column] || row[item.column] == 0) ? $formatNum(row[item.column]) : '-' }}</span>
@@ -61,6 +61,12 @@
61 61
         <detailKHQF v-if="isShowDetailKHQF" title="群发详情" :rule_id='currentRuleId' :sysMsgCorpid="currentCorpid" @close="detailClose" />
62 62
       </el-drawer>
63 63
       <!-- E 详情 - 客户群发 -->
64
+
65
+      <!-- S 详情 - 智能群发 -->
66
+      <el-drawer size="1200px" :visible.sync="isShowDetailZNQF" :with-header="false">
67
+        <detailRuleZNQF v-if="isShowDetailZNQF" title="智能推送详情" :rule_id='currentRuleId' :sysMsgCorpid="currentCorpid" :isCopy="false" :createGroupId="currentGroupId" @close="detailClose" />
68
+      </el-drawer>
69
+      <!-- E 详情 - 智能群发 -->
64 70
     </div>
65 71
     <!-- E 明细表 detailsTable -->
66 72
   </div>
@@ -78,6 +84,8 @@ import detailKHQQF from '@/components/customOperate/chatGroup/createMsgDetail.vu
78 84
 import detailRuleKHQF from '@/components/customOperate/createMassMsg.vue' // 客户群发-规则详情
79 85
 import detailKHQF from '@/components/customOperate/massMsgDetail/index.vue' // 客户群发 - 群发详情
80 86
 
87
+import detailRuleZNQF from '@/components/smartPushV3/createMassMsg.vue' // 智能群发-规则详情
88
+
81 89
 export default {
82 90
   components: {
83 91
     selfInputV2,
@@ -88,6 +96,7 @@ export default {
88 96
     detailKHQQF,
89 97
     detailRuleKHQF,
90 98
     detailKHQF,
99
+    detailRuleZNQF,
91 100
   },
92 101
   data() {
93 102
     const DEFAULT_TIME = [this.$getDay(-30, false), this.$getDay(0, false)]
@@ -104,7 +113,7 @@ export default {
104 113
         { column: 'msg_type_text', name: '消息类型', 'min_width': 140, fixed: '', },
105 114
         { column: 'send_status_text', name: '发送状态', 'min_width': 140, fixed: '', },
106 115
         { column: 'notice', name: '消息内容', 'min_width': 400, fixed: '', },
107
-        { column: 'handler', name: '操作', 'min_width': 60, fixed: 'right', },
116
+        { column: 'handler', name: '操作', 'min_width': 90, fixed: 'right', },
108 117
       ],
109 118
       pagination: {
110 119
         page: 1,
@@ -124,10 +133,12 @@ export default {
124 133
 
125 134
       currentCorpid: '',
126 135
       currentRuleId: '',
136
+      currentGroupId: '',
127 137
       isShowRuleKHQQF: false,
128 138
       isShowDetailKHQQF: false,
129 139
       isShowRuleKHQF: false,
130 140
       isShowDetailKHQF: false,
141
+      isShowDetailZNQF: false,
131 142
     }
132 143
   },
133 144
   created() {
@@ -238,11 +249,12 @@ export default {
238 249
       this.height = document.documentElement.clientHeight - 240 > 400 ? document.documentElement.clientHeight - 240 : 400
239 250
     },
240 251
 
241
-    onClickDetail({ send_status, msg_type, rule_id, corpid }) {
252
+    onClickDetail({ send_status, msg_type, rule_id, corpid, group_id }) {
242 253
       console.log('onClickDetail => send_status ', send_status)
243 254
       console.log('onClickDetail => msg_type ', msg_type)
244 255
       this.currentRuleId = rule_id
245 256
       this.currentCorpid = corpid
257
+      this.currentGroupId = group_id
246 258
       // 客户群发详情
247 259
       if (msg_type == 1) this.handleShowKHQF(send_status)
248 260
       // 客户群群发
@@ -271,15 +283,18 @@ export default {
271 283
     // 智能群发
272 284
     handleShowZNQF(send_status) {
273 285
       console.log('handleShowZNQF => ', send_status)
286
+      this.isShowDetailZNQF = true
274 287
     },
275 288
 
276 289
     detailClose() {
277 290
       this.currentCorpid = ''
278 291
       this.currentRuleId = ''
292
+      this.currentGroupId = ''
279 293
       this.isShowRuleKHQQF = false
280 294
       this.isShowDetailKHQQF = false
281 295
       this.isShowRuleKHQF = false
282 296
       this.isShowDetailKHQF = false
297
+      this.isShowDetailZNQF = false
283 298
     },
284 299
   },
285 300
 }

+ 32 - 20
project/src/components/smartPushV3/createMassMsg.vue

@@ -13,12 +13,12 @@
13 13
       <div class="regulations" style="margin-bottom:20px;">
14 14
         <label>选择模板</label>
15 15
         <div>
16
-          <el-select v-model="tempGroupId" class="select-cls" style="width:200px;" size="small" placeholder="请选择模板分组" filterable @change="onChangeTempGroupId">
16
+          <el-select v-model="tempGroupId" class="select-cls" style="width:200px;" size="small" placeholder="请选择模板分组" filterable @change="onChangeTempGroupId" :disabled="isFromSysMsg">
17 17
             <el-option v-for="tempGroup in tempGroupOptions" :key="tempGroup.group_id" :label="tempGroup.title" :value="tempGroup.group_id" />
18 18
           </el-select>
19 19
         </div>
20 20
         <div style="margin-left:10px;">
21
-          <el-select v-model="selectedTempId" class="select-cls" style="width:200px;" size="small" placeholder="请选择模板" filterable @change="onChangeTempId">
21
+          <el-select v-model="selectedTempId" class="select-cls" style="width:200px;" size="small" placeholder="请选择模板" filterable @change="onChangeTempId" :disabled="isFromSysMsg">
22 22
             <el-option v-for="temp in templateOptions" :key="temp.template_id" :label="temp.title" :value="temp.template_id" />
23 23
           </el-select>
24 24
         </div>
@@ -31,7 +31,7 @@
31 31
         <div style="margin-top: 10px;" class="screeningCustomers">
32 32
           <div class="screeningItem">
33 33
             <label>性别:</label>
34
-            <el-checkbox-group class="checkboxGroup" v-model="gender">
34
+            <el-checkbox-group class="checkboxGroup" v-model="gender" :disabled="isFromSysMsg">
35 35
               <el-checkbox label="1">男性</el-checkbox>
36 36
               <el-checkbox label="2">女性</el-checkbox>
37 37
               <el-checkbox label="0">未知性别</el-checkbox>
@@ -39,27 +39,29 @@
39 39
           </div>
40 40
           <div class="screeningItem">
41 41
             <label>付费情况:</label>
42
-            <screen-pay title="" width="355px" :reset='resetFlag' @payChange="payChange" :afferent_obj='payInfo' style="margin:0" />
42
+            <screen-pay title="" width="355px" :reset='resetFlag' @payChange="payChange" :afferent_obj='payInfo' style="margin:0" :disabled="isFromSysMsg" />
43 43
           </div>
44 44
 
45 45
           <div class="screeningItem" style="align-items: flex-start;">
46 46
             <label><em>*</em>添加客服时间:</label>
47 47
             <div class="send-time-wrap">
48 48
               <div v-for="(conf, idx) in send_conf" :key="idx" class="send-time-item">
49
-                <el-input v-model.trim="conf.natural_day" size="mini" maxlength="3" clearable @input="onInputDays($event, idx)" @change="onChangeDays($event, idx)" />
49
+                <el-input v-model.trim="conf.natural_day" size="mini" maxlength="3" clearable @input="onInputDays($event, idx)" @change="onChangeDays($event, idx)" :disabled="isFromSysMsg" />
50 50
                 <span class="text">天&nbsp;&nbsp;</span>
51 51
                 <!-- S 天数为1时 设置添加时间段 -->
52
-                <el-time-picker v-if="conf.natural_day == 1" v-model="conf.add_time" is-range size="mini" placeholder="客户添加起止时间" start-placeholder="起始时间" end-placeholder="截止时间" value-format="HH:mm:ss" :clearable="false" class="add-time" @change="onChangeAddTime($event, idx)" />
52
+                <el-time-picker v-if="conf.natural_day == 1" v-model="conf.add_time" is-range size="mini" placeholder="客户添加起止时间" start-placeholder="起始时间" end-placeholder="截止时间" value-format="HH:mm:ss" :clearable="false" class="add-time" @change="onChangeAddTime($event, idx)" :disabled="isFromSysMsg" />
53 53
                 <!-- E 天数为1时 设置添加时间段 -->
54 54
                 <span class="text">当天</span>
55 55
                 <div class="timeNums-wrap">
56 56
                   <div class="timeNums">
57
-                    <el-time-picker v-model="conf.send_time" size="mini" placeholder="请选择" value-format="HH:mm:ss" :clearable="false" />
57
+                    <el-time-picker v-model="conf.send_time" size="mini" placeholder="请选择" value-format="HH:mm:ss" :clearable="false" :disabled="isFromSysMsg" />
58 58
                   </div>
59 59
                 </div>
60 60
                 <span class="text">提醒发送</span>
61
-                <i v-if="idx > 0" class="el-icon-error" @click="onClickDelConf(idx)" />
62
-                <i v-if="idx === send_conf.length -1" class="el-icon-circle-plus-outline" @click="onClickAddConf" />
61
+                <template v-if="!isFromSysMsg">
62
+                  <i v-if="idx > 0" class="el-icon-error" @click="onClickDelConf(idx)" />
63
+                  <i v-if="idx === send_conf.length -1" class="el-icon-circle-plus-outline" @click="onClickAddConf" />
64
+                </template>
63 65
               </div>
64 66
             </div>
65 67
           </div>
@@ -70,11 +72,11 @@
70 72
       <div class="regulations" style="margin-bottom:20px;align-items:center;">
71 73
         <label><em>*</em>选择分组</label>
72 74
         <div>
73
-          <el-select v-model="group_id" class="select-cls" style="width:300px;" size="small" placeholder="请选择" filterable clearable @change="onChangeGroupId">
75
+          <el-select v-model="group_id" class="select-cls" style="width:300px;" size="small" placeholder="请选择" filterable clearable @change="onChangeGroupId" :disabled="isFromSysMsg">
74 76
             <el-option v-for="group in groupOptions" :key="group.group_id" :label="group.title" :value="group.group_id" />
75 77
           </el-select>
76 78
         </div>
77
-        <div class="newGroupCss" @click="onClickCreateGroup">新建分组</div>
79
+        <div v-if="!isFromSysMsg" class="newGroupCss" @click="onClickCreateGroup">新建分组</div>
78 80
       </div>
79 81
       <!-- E 选择分组 -->
80 82
 
@@ -82,12 +84,12 @@
82 84
       <h3 class="bigTitle">编辑群发消息</h3>
83 85
       <div class="regulations regulations2">
84 86
         <label><em>*</em>标题</label>
85
-        <el-input placeholder="例:活动推送/拉新等" style="width:300px" v-model.trim="name" clearable size="small" />
87
+        <el-input placeholder="例:活动推送/拉新等" style="width:300px" v-model.trim="name" clearable size="small" :disabled="isFromSysMsg" />
86 88
         <p style="font-size:13px;line-height:30px;color:#f9a527;margin-left:10px">*仅作为企业内部人员记录群发摘要,不会推送给客户</p>
87 89
       </div>
88 90
       <div class="regulations regulations2">
89 91
         <label style="margin-top:4px"><em>*</em>内容</label>
90
-        <edit-con v-if="isShowEditCon" ref="editCon" :afferent_content='content' :afferent_attachments='attachments' @editContent="(val) => { content = val }" @changeAttachment='getAttachment' />
92
+        <edit-con v-if="isShowEditCon" ref="editCon" :afferent_content='content' :afferent_attachments='attachments' @editContent="(val) => { content = val }" @changeAttachment='getAttachment' :disabled="isFromSysMsg" />
91 93
       </div>
92 94
       <div class="regulations regulations2">
93 95
         <label></label>
@@ -101,7 +103,7 @@
101 103
           <img v-if="processFlag" src="@/assets/img/exterprise-mass-send.png" class="img" alt="">
102 104
         </div>
103 105
       </div>
104
-      <div class="button_box">
106
+      <div v-if="!isFromSysMsg" class="button_box">
105 107
         <button class="button" @click="massMsg_set">应用规则</button>
106 108
       </div>
107 109
     </div>
@@ -129,7 +131,7 @@ import { getIntegerNumber, isJSON } from '@/assets/js/common'
129 131
 
130 132
 export default {
131 133
   components: { selfChannel, selfCustomerservice, customerServiceCorpV2, datePicker, enterpriseTag, editCon, screenPay, pushGroupDialog },
132
-  props: ['title', 'rule_id', 'isCopy', 'createTempGroupId', 'createTemplateId', 'createGroupId'],
134
+  props: ['title', 'rule_id', 'isCopy', 'createTempGroupId', 'createTemplateId', 'createGroupId', 'sysMsgCorpid'], //sysMsgCorpid是否来自“系统消息” 系统消息查看详情不可编辑
133 135
   data () {
134 136
     return {
135 137
       loading: true,
@@ -171,6 +173,9 @@ export default {
171 173
     isEdit() {
172 174
       return this.rule_id && !this.isCopy
173 175
     },
176
+    isFromSysMsg() {
177
+      return !!this.sysMsgCorpid
178
+    },
174 179
   },
175 180
   created () {
176 181
     this.handleGetTempGroupOptions()
@@ -205,11 +210,11 @@ export default {
205 210
     detail () {//详情
206 211
       this.loading = true
207 212
       this.isShowEditCon = false
208
-      this.$axios.get(this.URL.BASEURL + this.URL.smartPushV2_detail, {
209
-        params: {
210
-          rule_id: this.rule_id
211
-        }
212
-      }).then((res) => {
213
+      const params = {
214
+        rule_id: this.rule_id
215
+      }
216
+      if (this.sysMsgCorpid) { params.corpid = this.sysMsgCorpid }
217
+      this.$axios.get(this.URL.BASEURL + this.URL.smartPushV2_detail, { params }).then((res) => {
213 218
         var res = res.data
214 219
         this.loading = false
215 220
         this.isShowEditCon = true
@@ -561,6 +566,7 @@ export default {
561 566
 
562 567
     async handleGetGroupOptions() {
563 568
       const params = { status: 1, page: 1, page_size: 1000 }
569
+      if (this.sysMsgCorpid) { params.corpid = this.sysMsgCorpid }
564 570
       const { data: res = {} } = await this.$axios.post(this.URL.BASEURL + this.URL.smartPushV3_groupList, params)
565 571
       if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
566 572
         this.groupOptions = res.rst.data;
@@ -585,6 +591,7 @@ export default {
585 591
 
586 592
     async handleGetTempGroupOptions() {
587 593
       const params = { status: 1, page: 1, page_size: 1000 }
594
+      if (this.sysMsgCorpid) { params.corpid = this.sysMsgCorpid }
588 595
       const { data: res = {} } = await this.$axios.post(this.URL.BASEURL + this.URL.smartPushV3_tempGroupList, params)
589 596
       if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
590 597
         this.tempGroupOptions = [
@@ -605,6 +612,7 @@ export default {
605 612
 
606 613
     async handleGetTemplateOptions() {
607 614
       const params = { group_id: this.tempGroupId, status: 1, page: 1, page_size: 1000 }
615
+      if (this.sysMsgCorpid) { params.corpid = this.sysMsgCorpid }
608 616
       const { data: res = {} } = await this.$axios.get(this.URL.BASEURL + this.URL.smartPushV3_templateList, { params })
609 617
       if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
610 618
         this.templateOptions = res.rst.data;
@@ -622,6 +630,7 @@ export default {
622 630
     async handleGetTempDetail() {
623 631
       try {
624 632
         const params = { template_id: this.selectedTempId }
633
+        if (this.sysMsgCorpid) { params.corpid = this.sysMsgCorpid }
625 634
         const { data: res = {} } = await this.$axios.get(this.URL.BASEURL + this.URL.smartPushV3_templateDetail, { params })
626 635
         if (res && res.errno == 0) {
627 636
           if (res.rst.send_conf) {
@@ -900,4 +909,7 @@ export default {
900 909
   margin-left: 10px;
901 910
   cursor: pointer;
902 911
 }
912
+/deep/ .el-input.is-disabled .el-input__inner {
913
+  color: #666;
914
+}
903 915
 </style>