瀏覽代碼

企微打标签

吴树波 1 月之前
父節點
當前提交
a5e5f9d076
共有 5 個文件被更改,包括 522 次插入400 次删除
  1. 9 2
      src/api/qw/groupChat.js
  2. 91 44
      src/views/qw/sop/addSop.vue
  3. 406 351
      src/views/qw/sop/sop.vue
  4. 13 1
      src/views/qw/sopTemp/sopTemp.vue
  5. 3 2
      src/views/qw/user/qwUserList.vue

+ 9 - 2
src/api/qw/groupChat.js

@@ -16,12 +16,19 @@ export function getGroupChat(chatId) {
     method: 'get'
   })
 }
-export function allList() {
+export function allList(cropId) {
   return request({
-    url: '/qw/groupChat/allList',
+    url: '/qw/groupChat/allList/' + cropId,
     method: 'get'
   })
 }
+export function listAll(qwUserIds) {
+  return request({
+    url: '/qw/groupChat/listAll',
+    method: 'get',
+    params:{qwUserIds}
+  })
+}
 // 同步客户群详情
 export function cogradientGroupChat(corpId) {
   return request({

+ 91 - 44
src/views/qw/sop/addSop.vue

@@ -28,13 +28,42 @@
             <el-radio
               :label="2"
             >企微</el-radio>
+            <el-radio
+              :label="3"
+            >企微群聊</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="小转天数" prop="minConversionDay">
+        <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%" v-if="form.type == 3">
+          <div>
+            <el-button
+              size="medium"
+              icon="el-icon-circle-plus-outline"
+              plain
+              @click="handlelistUser(form.type,form.sendType, true)">请选择使用员工</el-button>
+          </div>
+          <div>
+            <el-tag
+              style="margin-left: 5px"
+              size="medium"
+              :key="id"
+              v-for="id in userSelectList"
+              closable
+              :disable-transitions="false"
+              @close="handleClosegroupUser(id)">
+              <span v-for="list in companyQwUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
+            </el-tag>
+          </div>
+        </el-form-item>
+        <el-form-item label="群聊" prop="chatIds" v-if="form.type == 3">
+          <el-select multiple filterable clearable v-model="form.chatIds">
+            <el-option v-for="item in qwGroupList" :key="item.chatId" :label="item.name" :value="item.chatId" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="小转天数" prop="minConversionDay" v-if="form.type != 3">
           <!--          <el-input class="el-input" type="" v-model="form.minConversionDay" placeholder="请输入" />-->
           <el-input-number   v-model="form.minConversionDay"  :min="1" :max="100" ></el-input-number>
         </el-form-item>
-        <el-form-item label="大转天数" prop="maxConversionDay">
+        <el-form-item label="大转天数" prop="maxConversionDay" v-if="form.type != 3">
           <!--          <el-input class="el-input" v-model="form.maxConversionDay" placeholder="请输入" />-->
           <el-input-number   v-model="form.maxConversionDay"  :min="1" :max="100" ></el-input-number>
         </el-form-item>
@@ -56,7 +85,7 @@
                 size="medium"
                 icon="el-icon-circle-plus-outline"
                 plain
-                @click="handlelistUser(form.type,form.sendType)">请选择使用员工</el-button>
+                @click="handlelistUser(form.type,form.sendType, false)">请选择使用员工</el-button>
             </div>
             <div>
               <el-tag
@@ -184,7 +213,7 @@
 
           </el-form-item>
         </div>
-        <el-form-item label="是否固定营期" prop="isFixed">
+        <el-form-item label="是否固定营期" prop="isFixed" v-if="form.type != 3">
           <el-radio-group v-model="form.isFixed">
             <el-radio
               :label="1"
@@ -209,7 +238,7 @@
             (小时)
           </el-row>
         </el-form-item>
-        <el-form-item v-if="(form.sendType==2 || form.sendType==4)" label="自动添加SOP" prop="autoSopTime.autoSopType" >
+        <el-form-item v-if="(form.sendType==2 || form.sendType==4) && form.type != 3" label="自动添加SOP" prop="autoSopTime.autoSopType" >
           <el-radio-group v-model="form.autoSopTime.autoSopType">
             <el-radio
               :label="1"
@@ -279,7 +308,7 @@
         </el-form-item>
 
 
-        <el-form-item label="是否只发送注册用户" prop="isFixed">
+        <el-form-item label="是否只发送注册用户" prop="isRegister" v-if="form.type != 3">
           <el-radio-group v-model="form.isRegister">
             <el-radio
               :label="1"
@@ -374,8 +403,10 @@ import CustomerGroupDetails from '@/views/qw/groupMsg/customerGroupDetails.vue'
 import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
 import { listTag, getTag, } from "@/api/qw/tag";
 import {listWxUserGroup, sopListWxUserGroup} from "@/api/wxUser/wxUserGroup";
+import {allList, listAll as chatListAll} from "@/api/qw/groupChat";
 import SopTemp from "@/views/qw/sopTemp/sopTemp.vue";
 import {allListTagGroup} from "@/api/qw/tagGroup";
+import {getMyQwCompanyList} from "@/api/qw/user";
 export default {
   name: "addSop",
   components: {SopTemp, CustomerGroupDetails, qwUserList,companyUserList,ImageUpload,sopLogsDetails},
@@ -392,6 +423,7 @@ export default {
       // 选中数组
       ids: [],
       courseList:[],
+      qwGroupList:[],
       // videoList:[],
       tags:null,
       excludeTags:null,
@@ -473,6 +505,7 @@ export default {
         autoSopTime:{ autoSopType:2,autoStartTime:'00:00',autoEndTime:'24:00',autoSopSend:2},
       },
       userSelectList:[],
+      qwUserIds:[],
       //企业微信员工
       listUser:{
         title:"",
@@ -707,7 +740,7 @@ export default {
     selectListSopTemp(type){
       this.tempOpen = true;
       setTimeout(() => {
-        this.$refs.SopTempComments.getList(type);
+        this.$refs.SopTempComments.getList(type, undefined, this.form.type == 3);
       }, 200);
 
     },
@@ -717,9 +750,9 @@ export default {
       this.tempOpen=false;
     },
     //选择企微员工时
-    handlelistUser(type,sendType){
+    handlelistUser(type,sendType, selectOne){
       setTimeout(() => {
-        this.$refs.QwUserList.getDetails(this.form.corpId,type,sendType);
+        this.$refs.QwUserList.getDetails(this.form.corpId,type,sendType, selectOne);
       }, 1);
 
       this.listUser.title="选择企微员工"
@@ -745,9 +778,10 @@ export default {
       list.forEach(obj => {
         if (!this.userSelectList.some(item => item == obj.id)) {
           this.userSelectList.push(obj.id);
+          this.qwUserIds.push(obj.qwUserId);
         }
       });
-
+      this.loadChatList()
     },
 
     //销售员工
@@ -778,6 +812,8 @@ export default {
       const index = this.userSelectList.findIndex(t => t === list);
       if (index !== -1) {
         this.userSelectList.splice(index, 1);
+        this.qwUserIds.splice(index, 1);
+        this.loadChatList()
       }
     },
     // 取消按钮
@@ -840,54 +876,65 @@ export default {
 
       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
     },
+    loadChatList(){
+      chatListAll(this.qwUserIds.join()).then(e => {
+        this.qwGroupList = e.data;
+      })
+    },
 
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if(this.userSelectList.length<=0){
-            return this.$message.error("请选择员工")
-          }
-          this.form.qwUserIds = this.userSelectList.join(",");
+          if(this.form.type == 3){
+            if(this.form.chatIds.length <= 0) {
+              return this.$message.error("请选择群聊")
+            }
+            this.form.chatId = this.form.chatIds.join();
+          }else{
+            if(this.userSelectList.length<=0){
+              return this.$message.error("请选择员工")
+            }
 
 
-          if (this.tagsIdsChangeSelectList!=null && this.tagsIdsChangeSelectList.length>0){
+            if (this.tagsIdsChangeSelectList!=null && this.tagsIdsChangeSelectList.length>0){
 
-            // 确保 this.form.tags 是数组
-            if (!this.form.tags) {
-              this.form.tags = []; // 如果未定义,初始化
-            } else {
-              this.form.tags = []; // 清空已有数据
-            }
+              // 确保 this.form.tags 是数组
+              if (!this.form.tags) {
+                this.form.tags = []; // 如果未定义,初始化
+              } else {
+                this.form.tags = []; // 清空已有数据
+              }
 
-            // 遍历并添加 tagId
-            this.tagsIdsChangeSelectList.forEach(tag => {
-              if (tag.tagId) { // 确保 tagId 存在
-                this.form.tags.push(tag.tagId);
+              // 遍历并添加 tagId
+              this.tagsIdsChangeSelectList.forEach(tag => {
+                if (tag.tagId) { // 确保 tagId 存在
+                  this.form.tags.push(tag.tagId);
+                }
+              });
+              this.form.tags=this.form.tags.join(",");
+            }else {
+              return  this.$message.error("选择的标签不能为空!!请选择筛选的标签")
+            }
+            if (this.outTagsIdsChangeSelectList!=null && this.outTagsIdsChangeSelectList.length>0){
+              // 确保 this.form.tags 是数组
+              if (!this.form.excludeTags) {
+                this.form.excludeTags = []; // 如果未定义,初始化
+              } else {
+                this.form.excludeTags = []; // 清空已有数据
               }
-            });
-            this.form.tags=this.form.tags.join(",");
-          }else {
-            return  this.$message.error("选择的标签不能为空!!请选择筛选的标签")
-          }
 
-          if (this.outTagsIdsChangeSelectList!=null && this.outTagsIdsChangeSelectList.length>0){
-            // 确保 this.form.tags 是数组
-            if (!this.form.excludeTags) {
-              this.form.excludeTags = []; // 如果未定义,初始化
-            } else {
-              this.form.excludeTags = []; // 清空已有数据
+              // 遍历并添加 tagId
+              this.outTagsIdsChangeSelectList.forEach(tag => {
+                if (tag.tagId) { // 确保 tagId 存在
+                  this.form.excludeTags.push(tag.tagId);
+                }
+              });
+              this.form.excludeTags=this.form.excludeTags.join(",");
             }
 
-            // 遍历并添加 tagId
-            this.outTagsIdsChangeSelectList.forEach(tag => {
-              if (tag.tagId) { // 确保 tagId 存在
-                this.form.excludeTags.push(tag.tagId);
-              }
-            });
-            this.form.excludeTags=this.form.excludeTags.join(",");
           }
-
+          this.form.qwUserIds = this.userSelectList.join(",");
           this.form.setting=JSON.stringify(this.setting)
           this.form.autoSopTime.createTime=this.formatDateTo24HourString(new Date());
 

文件差異過大導致無法顯示
+ 406 - 351
src/views/qw/sop/sop.vue


+ 13 - 1
src/views/qw/sopTemp/sopTemp.vue

@@ -19,6 +19,12 @@
     <el-table v-loading="loading" :data="sopTempList" ref="sopTempList" >
       <el-table-column label="id" align="center" prop="id" />
       <el-table-column label="模板标题" align="center" prop="name" />
+      <el-table-column label="每天首条消息是否发课" align="center" prop="name" v-if="cuoser">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.cuoser" type="success">是</el-tag>
+          <el-tag v-if="!scope.row.cuoser" type="danger">否</el-tag>
+        </template>
+      </el-table-column>
 
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -73,6 +79,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      cuoser: false,
       // 状态字典
       statusOptions: [],
       // 查询参数
@@ -102,11 +109,16 @@ export default {
   },
   methods: {
     /** 查询sop模板列表 */
-    getList(sendType,isUpdate) {
+    getList(sendType,isUpdate,cuoser) {
+      if(cuoser == null){
+        cuoser = false;
+      }
       console.log(isUpdate)
       this.isUpdateSop = isUpdate;
+      this.cuoser = cuoser;
       this.loading = true;
       this.queryParams.sendType= sendType;
+      this.queryParams.cuoser= cuoser;
       listSopTemp(this.queryParams).then(response => {
         this.sopTempList = response.rows;
         this.total = response.total;

+ 3 - 2
src/views/qw/user/qwUserList.vue

@@ -71,6 +71,7 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
+      selectOne: true,
       // 总条数
       total: 0,
       // 企微用户表格数据
@@ -102,9 +103,10 @@ export default {
   },
   methods: {
 
-    getDetails(corpId,type,sendType){
+    getDetails(corpId,type,sendType, selectOne){
       this.type=type;
       this.sendType=sendType;
+      this.selectOne=selectOne;
       if (type!=null&&sendType!=null){
         this.queryParams.type=type;
         this.queryParams.sendType=sendType;
@@ -187,7 +189,6 @@ export default {
 
     // 多选框选中数据
     handleSelectionChange(selection) {
-
       // 保存当前页的选中项
       const currentPageSelections = selection.map(item => item.id);
 

部分文件因文件數量過多而無法顯示