Explorar el Código

迁移润天批量修改实际发送人

zhangqin hace 1 semana
padre
commit
966529537c

+ 7 - 0
src/api/qw/sopUserLogs.js

@@ -69,6 +69,13 @@ export function updateLogDate(data) {
     data: data
   })
 }
+export function replaceUser(data) {
+  return request({
+    url: '/qwSop/sopUserLogs/replaceUser',
+    method: 'post',
+    data: data
+  })
+}
 // 修改sopUserLogs
 export function addGroupChat(data) {
   return request({

+ 45 - 2
src/views/qw/sopUserLogs/sopUserLogsSchedule.vue

@@ -133,6 +133,17 @@
             v-hasPermi="['qw:sopUserLogs:remove']"
           >批量删除营期</el-button>
         </el-tooltip>
+      </el-col>
+                  <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="批量更换实际发送人" placement="top" >
+          <el-button
+            type="primary"
+            icon="el-icon-s-custom"
+            size="medium"
+            :disabled="multiple"
+            @click="handleUpdateSender"
+          >批量更换实际发送人</el-button>
+        </el-tooltip>
       </el-col>
     </el-row>
     <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
@@ -152,6 +163,7 @@
       <el-table-column label="营期编号" align="center" prop="id" />
       <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
       <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
+      <el-table-column label="实际发送人" align="center" prop="actualQwUserName" />
       <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2" />
       <el-table-column label="营期时间" align="center" prop="startTime" width="180">
         <template slot-scope="scope">
@@ -239,6 +251,10 @@
       <qwUserList ref="QwUserList" @selectUserList="selectUserList"></qwUserList>
     </el-dialog>
 
+        <el-dialog :title="listUser.title" :visible.sync="listUser.open" width="1300px"   append-to-body>
+      <qwUserSelectOne ref="QwUserListSender" @selectUser="selectSenderSingle"></qwUserSelectOne>
+    </el-dialog>
+
     <el-dialog title="追加群聊" :visible.sync="addGroupData.open"  width="800px" append-to-body>
       <el-form ref="msgForm" :model="addGroupData.form" label-width="100px">
         <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
@@ -292,7 +308,7 @@ import {
   repairSopUserLogs,
   getSelectChat,
   addGroupChat,
-  updateLogDate
+  updateLogDate,UpdateTimeSopUserLogs,replaceUser
 } from "../../../api/qw/sopUserLogs";
 import sopLogsDetails from "@/views/qw/sopLogs/sopLogsList.vue";
 import SopUserLogsInfoDetails from "@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue";
@@ -300,11 +316,12 @@ import sendMsgOpenTool from "../../../views/qw/sopUserLogsInfo/sendMsgOpenTool.v
 import {listAll as chatListAll} from "@/api/qw/groupChat";
 import companyUserList from "@/views/company/companyUser/companyUserList.vue";
 import qwUserList from "@/views/qw/user/qwUserList.vue";
+import qwUserSelectOne from "@/views/qw/user/qwUserSelectOne.vue";
 import {getQwAllUserList, listUser} from "@/api/company/companyUser";
 
 export default {
   name: "sopUserLogsSchedule",
-  components: {qwUserList, companyUserList, SopUserLogsInfoDetails, sopLogsDetails,sendMsgOpenTool},
+  components: {qwUserList, qwUserSelectOne, companyUserList, SopUserLogsInfoDetails, sopLogsDetails,sendMsgOpenTool},
   props:{
     rowDetailFrom:{},
   },
@@ -316,6 +333,10 @@ export default {
       companyUserLists:[],
       sopName:'',
       tempId:'',
+      listUser: {
+        title: '选择发送人',
+        open: false
+      },
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -420,6 +441,19 @@ export default {
 
   },
   methods: {
+        selectSenderSingle(user){
+      this.listUser.open=false;
+      const data = { ids: this.ids };
+      // 仅在选中员工时携带 actualQwUserId 与 actualQwId,否则两字段均不传,后端按清空处理
+      if (user && user.qwUserId) {
+        data.actualQwUserId = user.qwUserId;
+        data.actualQwId     = user.id;   
+      }
+      replaceUser(data).then(res => {
+        this.msgSuccess(user && user.qwUserId ? "修改成功" : "已清空实际发送人");
+        this.getList();
+      })
+    },
     /** 查询sopUserLogs列表 */
     getList() {
       this.loading = true;
@@ -470,6 +504,15 @@ export default {
 
     },
 
+        /**
+     * 批量更换实际发送人
+     */
+    handleUpdateSender() {
+      this.listUser.open = true;
+      this.$nextTick(() => {
+        this.$refs.QwUserListSender.getDetails(this.queryParams.corpId);
+      })
+    },
     /**
      *  删除营期
      */

+ 9 - 1
src/views/qw/user/qwUserSelectOne.vue

@@ -41,6 +41,11 @@
       @pagination="handlePaginationChange"
     />
 
+        <div style="margin-top: 30px;display: flex;justify-content: center;gap: 12px">
+      <el-button plain @click="handleClear">不选(清空发送人)</el-button>
+      <el-button type="warning" icon="el-icon-check" @click="confirmSelect">确定选择</el-button>
+    </div>
+
   </div>
 </template>
 
@@ -167,7 +172,10 @@ export default {
     handleSelectionChange(selection) {
       this.$emit("selectUser",selection);
     },
-
+    // 用户点击“不选”
+    handleClear() {
+      this.$emit("selectUser",{});   // 传空对象,表示清空
+    },
   }
 };
 </script>