Browse Source

feat: 智能推送 - 推送分组 - "新建分组"逻辑

zhengxy 1 year ago
parent
commit
0a688f5190

+ 7 - 0
project/src/components/smartPushV3/detailList.vue

23
         </div>
23
         </div>
24
       </div>
24
       </div>
25
       <div class="flex">
25
       <div class="flex">
26
+        <el-button type="primary" size="mini" @click="onClickCreatedRule">新建智能推送</el-button>
26
         <el-button type="primary" plain size="mini" @click="onClickBatchGroup">批量设置分组</el-button>
27
         <el-button type="primary" plain size="mini" @click="onClickBatchGroup">批量设置分组</el-button>
27
         <el-button type="primary" plain size="mini" @click="init(1,'export')">导出Excel</el-button>
28
         <el-button type="primary" plain size="mini" @click="init(1,'export')">导出Excel</el-button>
28
       </div>
29
       </div>
170
       }
171
       }
171
       this.massMsgFlag = false
172
       this.massMsgFlag = false
172
     },
173
     },
174
+    // 监听点击"新建智能推送"规则
175
+    onClickCreatedRule () {
176
+      this.detail_rule_id = ''
177
+      this.isCopy = false
178
+      this.massMsgFlag = true
179
+    },
173
     // 监听点击"编辑"智能推送规则
180
     // 监听点击"编辑"智能推送规则
174
     onClickEditRule (data) {
181
     onClickEditRule (data) {
175
       this.detail_rule_id = data.rule_id;
182
       this.detail_rule_id = data.rule_id;

+ 9 - 4
project/src/components/smartPushV3/pushGroupDialog.vue

27
       <!-- S 使用员工 - 单个企微主体 模式 -->
27
       <!-- S 使用员工 - 单个企微主体 模式 -->
28
       <div v-show="form.operate_type == 1" class="form-item flex-align-start">
28
       <div v-show="form.operate_type == 1" class="form-item flex-align-start">
29
         <span class="lable required">使用员工:</span>
29
         <span class="lable required">使用员工:</span>
30
-        <div>
30
+        <div v-if="!loading">
31
           <div class="flex-align-center">
31
           <div class="flex-align-center">
32
             <el-radio v-model="form.is_all" :label="1">全部员工</el-radio>
32
             <el-radio v-model="form.is_all" :label="1">全部员工</el-radio>
33
             <el-radio v-model="form.is_all" :label="0">部分员工</el-radio>
33
             <el-radio v-model="form.is_all" :label="0">部分员工</el-radio>
40
       <!-- S 使用员工 - 多个企微主体 模式 -->
40
       <!-- S 使用员工 - 多个企微主体 模式 -->
41
       <div v-show="form.operate_type == 2" class="form-item flex-align-start">
41
       <div v-show="form.operate_type == 2" class="form-item flex-align-start">
42
         <span class="lable required">使用员工:</span>
42
         <span class="lable required">使用员工:</span>
43
-        <div>
43
+        <div v-if="!loading">
44
           <div class="flex-align-center">
44
           <div class="flex-align-center">
45
             <el-radio v-model="form.is_operation" :label="1">运营组</el-radio>
45
             <el-radio v-model="form.is_operation" :label="1">运营组</el-radio>
46
             <el-radio v-model="form.is_operation" :label="0">选择成员</el-radio>
46
             <el-radio v-model="form.is_operation" :label="0">选择成员</el-radio>
86
   data() {
86
   data() {
87
     return {
87
     return {
88
       loading: false,
88
       loading: false,
89
+      isShowForm: false,
89
       form: {
90
       form: {
90
         title: '',
91
         title: '',
91
         is_all: 1, // 使用员工:1全部员工 0部分员工
92
         is_all: 1, // 使用员工:1全部员工 0部分员工
127
           group_id: this.isEdit ? this.groupInfo.group_id : '',
128
           group_id: this.isEdit ? this.groupInfo.group_id : '',
128
           title,
129
           title,
129
           operate_type,
130
           operate_type,
130
-          is_all,
131
+          is_all: operate_type == 2 ? 0 : is_all, // 多企微时传0
131
           senders: (operate_type == 1 && is_all == 0) ? user_id_list.join(',') : '',
132
           senders: (operate_type == 1 && is_all == 0) ? user_id_list.join(',') : '',
132
           is_operation: operate_type == 1 ? 0 : is_operation, // 单主体模式 该字段传0
133
           is_operation: operate_type == 1 ? 0 : is_operation, // 单主体模式 该字段传0
133
           operator_group_id: (operate_type == 2 && is_operation == 1) ? operator_group_id : '',
134
           operator_group_id: (operate_type == 2 && is_operation == 1) ? operator_group_id : '',
139
         if (res && res.errno == 0) {
140
         if (res && res.errno == 0) {
140
           this.$message.success('操作成功')
141
           this.$message.success('操作成功')
141
           this.handleClearFormData()
142
           this.handleClearFormData()
142
-          this.$emit('confirm')
143
+          this.$emit('confirm', { isEdit: this.isEdit })
143
         } else if (res.errno != 4002) {
144
         } else if (res.errno != 4002) {
144
           this.$message.warning(res.err || '操作失败')
145
           this.$message.warning(res.err || '操作失败')
145
         }
146
         }
221
         this.loading = true
222
         this.loading = true
222
         const { data: res = {} } = await this.$axios.get(url, { params })
223
         const { data: res = {} } = await this.$axios.get(url, { params })
223
         if (res && res.errno == 0) {
224
         if (res && res.errno == 0) {
225
+          this.isShowForm = false
226
+
224
           const detailInfo = res.rst || {}
227
           const detailInfo = res.rst || {}
225
           this.form.title = detailInfo.title
228
           this.form.title = detailInfo.title
226
           this.form.operate_type = detailInfo.operate_type ? detailInfo.operate_type : 1
229
           this.form.operate_type = detailInfo.operate_type ? detailInfo.operate_type : 1
251
               this.form.afferent_multiple_senders = [...arr]
254
               this.form.afferent_multiple_senders = [...arr]
252
             }
255
             }
253
           }
256
           }
257
+
258
+          this.isShowForm = true
254
         } else if (res.errno != 4002) {
259
         } else if (res.errno != 4002) {
255
           this.$message.warning(res.err || '操作失败')
260
           this.$message.warning(res.err || '操作失败')
256
         }
261
         }

+ 17 - 5
project/src/components/smartPushV3/pushGroupList.vue

1
 <template>
1
 <template>
2
   <div v-loading="loading">
2
   <div v-loading="loading">
3
-    <div class="screenBox" style="align-items: center;padding-right:16px">
3
+    <div class="screenBox" style="align-items: center;padding-right:16px;min-width:1120px;">
4
       <div class="flex-align-center" style="flex:1">
4
       <div class="flex-align-center" style="flex:1">
5
         <datePicker title="创建时间" :reset="resetFlag" @changeTime="onChangeTime" />
5
         <datePicker title="创建时间" :reset="resetFlag" @changeTime="onChangeTime" />
6
         <selfChannel title="创建人" :reset="resetFlag" type="circleCreate" :labelWidth="true" @channelDefine="onChangeCreatorId" />
6
         <selfChannel title="创建人" :reset="resetFlag" type="circleCreate" :labelWidth="true" @channelDefine="onChangeCreatorId" />
7
-        <selfInputV2 v-model="keyword" label_name="搜索" placeholder="请输入" @change="onChangeKeyword" />
7
+        <selfInputV2 v-model="keyword" label_name="搜索" placeholder="请输入" :labelWidth="true" @change="onChangeKeyword" />
8
       </div>
8
       </div>
9
+      <el-button type="primary" size="mini" @click="onClickCreateGroup">新建分组</el-button>
9
       <el-button type="primary" size="mini" @click="onClickCreatedRule">新建智能推送</el-button>
10
       <el-button type="primary" size="mini" @click="onClickCreatedRule">新建智能推送</el-button>
10
     </div>
11
     </div>
11
     <el-table ref="multipleTable" :height="height" :data="tableData" tooltip-effect="dark" style="width:100%;margin-top:10px;">
12
     <el-table ref="multipleTable" :height="height" :data="tableData" tooltip-effect="dark" style="width:100%;margin-top:10px;">
94
     this.init(1)
95
     this.init(1)
95
   },
96
   },
96
   methods: {
97
   methods: {
98
+
99
+
97
     detailClose (val) {
100
     detailClose (val) {
98
       if (val == 'update') {//编辑
101
       if (val == 'update') {//编辑
99
         this.init(this.page)
102
         this.init(this.page)
273
       this.$exportOrder({ excelDatas, name: `智能推送-分组列表(导出时间:${this.$getDay(0)})` })
276
       this.$exportOrder({ excelDatas, name: `智能推送-分组列表(导出时间:${this.$getDay(0)})` })
274
     },
277
     },
275
 
278
 
276
-    // 监听点击"编辑"智能推送规则
279
+    // 监听点击"新建分组"
280
+    onClickCreateGroup() {
281
+      this.currentGroupInfo = {}
282
+      this.pushGroupVisible = true
283
+    },
284
+    // 监听点击"编辑分组"
277
     onClickEditGroup({ group_id, title }) {
285
     onClickEditGroup({ group_id, title }) {
278
       this.currentGroupInfo = { group_id, title }
286
       this.currentGroupInfo = { group_id, title }
279
       this.pushGroupVisible = true
287
       this.pushGroupVisible = true
280
     },
288
     },
281
-    onConfirmGroup() {
282
-      this.init()
289
+    onConfirmGroup({ isEdit }) {
290
+      if (isEdit) {
291
+        this.init()
292
+      } else {
293
+        this.init(1)
294
+      }
283
       this.currentGroupInfo = {}
295
       this.currentGroupInfo = {}
284
       this.pushGroupVisible = false
296
       this.pushGroupVisible = false
285
     },
297
     },