sopUserLogsSchedule.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <div class="app-container">
  3. <div style="margin-bottom: 10px">
  4. <el-card>
  5. <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则名称:{{sopName}}</span>
  6. <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则编号:{{queryParams.sopId}}</span>
  7. <span class="custom-style" style="display: block;">模板编号:{{tempId}}</span>
  8. </el-card>
  9. </div>
  10. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  11. <el-form-item label="企微员工账号" prop="qwUserId">
  12. <el-input
  13. v-model="queryParams.qwUserId"
  14. placeholder="请输入企微员工账号"
  15. clearable
  16. size="small"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="企微员工昵称" prop="qwUserName">
  21. <el-input
  22. v-model="queryParams.qwUserName"
  23. placeholder="请输入企微员工昵称"
  24. clearable
  25. size="small"
  26. @keyup.enter.native="handleQuery"
  27. />
  28. </el-form-item>
  29. <el-form-item label="营期时间" prop="startTime">
  30. <el-date-picker clearable size="small"
  31. v-model="queryParams.startTime"
  32. type="date"
  33. value-format="yyyy-MM-dd"
  34. placeholder="选择营期时间">
  35. </el-date-picker>
  36. </el-form-item>
  37. <!-- <el-form-item label="状态" prop="status">-->
  38. <!-- <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">-->
  39. <!-- <el-option-->
  40. <!-- v-for="dict in sopUserLogsDelStatus"-->
  41. <!-- :key="dict.dictValue"-->
  42. <!-- :label="dict.dictLabel"-->
  43. <!-- :value="dict.dictValue"-->
  44. <!-- />-->
  45. <!-- </el-select>-->
  46. <!-- </el-form-item>-->
  47. <el-form-item label="客户名称" prop="externalUserName">
  48. <el-input
  49. v-model="queryParams.externalUserName"
  50. placeholder="请输入客户名称"
  51. clearable
  52. size="small"
  53. @keyup.enter.native="handleQuery"
  54. />
  55. </el-form-item>
  56. <el-form-item label="客户id" prop="externalId">
  57. <el-input
  58. v-model="queryParams.externalId"
  59. placeholder="请输入企微客户id"
  60. clearable
  61. size="small"
  62. @keyup.enter.native="handleQuery"
  63. />
  64. </el-form-item>
  65. <el-form-item>
  66. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  67. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  68. </el-form-item>
  69. </el-form>
  70. <el-row :gutter="10" class="mb8" v-if="filterMode == 1">
  71. <el-col :span="1.5">
  72. <el-tooltip class="item" effect="dark" content="此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top">
  73. <el-button
  74. type="warning"
  75. icon="el-icon-s-promotion"
  76. size="medium"
  77. :disabled="multiple"
  78. @click="handleCampSendMsg"
  79. v-hasPermi="['qw:sopUserLogsInfo:msgSchedule']"
  80. >营期一键群发(或草稿)</el-button>
  81. </el-tooltip>
  82. </el-col>
  83. <el-col :span="1.5">
  84. <el-tooltip class="item" effect="dark" content="修改选择的群聊营期时间" placement="top">
  85. <el-button
  86. type="danger"
  87. icon="el-icon-edit"
  88. size="medium"
  89. :disabled="multiple"
  90. @click="updateGroupTime"
  91. >批量修改营期时间</el-button>
  92. </el-tooltip>
  93. </el-col>
  94. <el-col :span="1.5">
  95. <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的客户发送消息,ps:删除之后不可恢复" placement="top">
  96. <el-button
  97. type="danger"
  98. icon="el-icon-s-promotion"
  99. size="medium"
  100. :disabled="multiple"
  101. @click="handleDeleteUserLogs"
  102. v-hasPermi="['qw:sopUserLogs:remove']"
  103. >批量删除营期</el-button>
  104. </el-tooltip>
  105. </el-col>
  106. </el-row>
  107. <el-row :gutter="10" class="mb8" v-if="filterMode == 2">
  108. <el-col :span="1.5">
  109. <el-tooltip class="item" effect="dark" content="添加新群聊进入任务" placement="top">
  110. <el-button
  111. type="warning"
  112. icon="el-icon-plus"
  113. size="medium"
  114. @click="addGroup"
  115. >追加群聊</el-button>
  116. </el-tooltip>
  117. </el-col>
  118. <el-col :span="1.5">
  119. <el-tooltip class="item" effect="dark" content="修改选择的群聊营期时间" placement="top">
  120. <el-button
  121. type="danger"
  122. icon="el-icon-edit"
  123. size="medium"
  124. :disabled="multiple"
  125. @click="updateGroupTime"
  126. >批量修改营期时间</el-button>
  127. </el-tooltip>
  128. </el-col>
  129. <el-col :span="1.5">
  130. <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的群发送消息,ps:删除之后不可恢复" placement="top">
  131. <el-button
  132. type="danger"
  133. icon="el-icon-s-promotion"
  134. size="medium"
  135. :disabled="multiple"
  136. @click="handleDeleteUserLogs"
  137. v-hasPermi="['qw:sopUserLogs:remove']"
  138. >批量删除营期</el-button>
  139. </el-tooltip>
  140. </el-col>
  141. <el-col :span="1.5">
  142. <el-tooltip class="item" effect="dark" content="批量更换实际发送人" placement="top" >
  143. <el-button
  144. type="primary"
  145. icon="el-icon-s-custom"
  146. size="medium"
  147. :disabled="multiple"
  148. @click="handleUpdateSender"
  149. >批量更换实际发送人</el-button>
  150. </el-tooltip>
  151. </el-col>
  152. </el-row>
  153. <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
  154. <i class="el-icon-info"></i>
  155. 【营期一键群发】:此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】
  156. </div>
  157. <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
  158. <i class="el-icon-info"></i>
  159. 【批量删除营期】:此功能用于删除选中的【整个营期】,删除之后将不会在给原营期的客户发送消息,ps:删除之后不可恢复
  160. </div>
  161. <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
  162. <i class="el-icon-info"></i>
  163. 【天数】:【列表:营期时间】对应列表中的天数是几 就代表着 插件助手 会发送【任务模板】里的第几天的消息
  164. </div>
  165. <el-table border v-loading="loading" :data="sopUserLogsList" @selection-change="handleSelectionChange">
  166. <el-table-column type="selection" width="55" align="center" />
  167. <el-table-column label="营期编号" align="center" prop="id" />
  168. <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
  169. <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
  170. <el-table-column label="实际发送人" align="center" prop="actualQwUserName" />
  171. <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2" />
  172. <el-table-column label="营期时间" align="center" prop="startTime" width="180">
  173. <template slot-scope="scope">
  174. <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column label="天数" align="center" prop="countDays" />
  178. <el-table-column label="状态" align="center" prop="status" >
  179. <template slot-scope="scope">
  180. <div v-if="scope.row.userId && scope.row.userId.includes('null')">
  181. <span style="color: orange;">营期异常</span>
  182. </div>
  183. <div v-else>
  184. <dict-tag :options="sopUserLogsDelStatus" :value="scope.row.status"/>
  185. </div>
  186. </template>
  187. </el-table-column>
  188. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="filterMode == 1">
  189. <template slot-scope="scope">
  190. <el-button
  191. v-if="scope.row.status ==1"
  192. size="mini"
  193. type="text"
  194. icon="el-icon-edit"
  195. @click="handleSelect(scope.row)"
  196. v-hasPermi="['qw:sop:list']"
  197. >营期详情</el-button>
  198. <el-button
  199. v-if="scope.row.userId && scope.row.userId.includes('null')"
  200. size="mini"
  201. type="text"
  202. icon="el-icon-s-check"
  203. @click="handleRepairLogs(scope.row)"
  204. v-hasPermi="['qw:sop:list']"
  205. >修复营期</el-button>
  206. <!-- <el-button-->
  207. <!-- size="mini"-->
  208. <!-- type="text"-->
  209. <!-- icon="el-icon-edit"-->
  210. <!-- @click="handleTemp(scope.row)"-->
  211. <!-- >新建群发任务</el-button>-->
  212. </template>
  213. </el-table-column>
  214. </el-table>
  215. <pagination
  216. v-show="total>0"
  217. :total="total"
  218. :page.sync="queryParams.pageNum"
  219. :limit.sync="queryParams.pageSize"
  220. @pagination="getList"
  221. />
  222. <!-- 执行详情 -->
  223. <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="88%" style="font-weight: bolder">
  224. <sop-user-logs-info-details ref="SopUserLogsInfoDetails" :rowDetailFrom="logsInfoDetailsOpen.item" @flashNotify="flashNotify"></sop-user-logs-info-details>
  225. </el-drawer>
  226. <send-msg-open-tool ref="sendMsgOpenTool" ></send-msg-open-tool>
  227. <el-dialog title="修改营期时间" :visible.sync="updateTimeData.open" width="800px" append-to-body>
  228. <p>
  229. <span>选择群聊:</span>
  230. <el-tag v-for="name in chatNames">{{name}}</el-tag>
  231. </p>
  232. <el-form ref="msgForm" :model="updateTimeData.form" label-width="100px">
  233. <el-form-item label="日期">
  234. <el-date-picker
  235. v-model="updateTimeData.form.date"
  236. type="date"
  237. value-format="yyyy-MM-dd"
  238. placeholder="选择日期">
  239. </el-date-picker>
  240. </el-form-item>
  241. </el-form>
  242. <div slot="footer" class="dialog-footer">
  243. <el-button type="primary" @click="submitUpdateTimeForm">确 定</el-button>
  244. <el-button @click="updateTimeData.open = false">取 消</el-button>
  245. </div>
  246. </el-dialog>
  247. <el-dialog title="选择企微" :visible.sync="addGroupData.userOpen" width="1300px" append-to-body>
  248. <qwUserList ref="QwUserList" @selectUserList="selectUserList"></qwUserList>
  249. </el-dialog>
  250. <el-dialog :title="listUser.title" :visible.sync="listUser.open" width="1300px" append-to-body>
  251. <qwUserSelectOne ref="QwUserListSender" @selectUser="selectSenderSingle"></qwUserSelectOne>
  252. </el-dialog>
  253. <el-dialog title="追加群聊" :visible.sync="addGroupData.open" width="800px" append-to-body>
  254. <el-form ref="msgForm" :model="addGroupData.form" label-width="100px">
  255. <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
  256. <div>
  257. <el-button
  258. size="medium"
  259. icon="el-icon-circle-plus-outline"
  260. plain
  261. @click="handleCompanyUser">请选择使用员工</el-button>
  262. </div>
  263. <div>
  264. <el-tag
  265. style="margin-left: 5px"
  266. size="medium"
  267. :key="id"
  268. v-for="id in userSelectList"
  269. closable
  270. :disable-transitions="false"
  271. @close="handleClosegroupUser(id)">
  272. <span v-for="list in companyUserLists " :key="list.userId" v-if="list.id == id">{{list.qwUserName}}</span>
  273. </el-tag>
  274. </div>
  275. </el-form-item>
  276. <el-form-item label="群聊">
  277. <el-select multiple filterable clearable v-model="addGroupData.form.chatIds">
  278. <el-option v-for="item in addGroupData.selectChat" :key="item.chatId" :label="item.name" :value="item.chatId"/>
  279. </el-select>
  280. </el-form-item>
  281. <el-form-item label="日期">
  282. <el-date-picker
  283. v-model="addGroupData.form.date"
  284. type="date"
  285. value-format="yyyy-MM-dd"
  286. placeholder="选择日期">
  287. </el-date-picker>
  288. </el-form-item>
  289. </el-form>
  290. <div slot="footer" class="dialog-footer">
  291. <el-button type="primary" @click="submitAddGroupForm">确 定</el-button>
  292. <el-button @click="addGroupData.open = false">取 消</el-button>
  293. </div>
  294. </el-dialog>
  295. </div>
  296. </template>
  297. <script>
  298. import {
  299. delSopUserLogs,
  300. exportSopUserLogs,
  301. listSopUserLogs,
  302. repairSopUserLogs,
  303. getSelectChat,
  304. addGroupChat,
  305. updateLogDate,UpdateTimeSopUserLogs,replaceUser
  306. } from "../../../api/qw/sopUserLogs";
  307. import sopLogsDetails from "@/views/qw/sopLogs/sopLogsList.vue";
  308. import SopUserLogsInfoDetails from "@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue";
  309. import sendMsgOpenTool from "../../../views/qw/sopUserLogsInfo/sendMsgOpenTool.vue";
  310. import {listAll as chatListAll} from "@/api/qw/groupChat";
  311. import companyUserList from "@/views/company/companyUser/companyUserList.vue";
  312. import qwUserList from "@/views/qw/user/qwUserList.vue";
  313. import qwUserSelectOne from "@/views/qw/user/qwUserSelectOne.vue";
  314. import {getQwAllUserList, listUser} from "@/api/company/companyUser";
  315. export default {
  316. name: "sopUserLogsSchedule",
  317. components: {qwUserList, qwUserSelectOne, companyUserList, SopUserLogsInfoDetails, sopLogsDetails,sendMsgOpenTool},
  318. props:{
  319. rowDetailFrom:{},
  320. },
  321. data() {
  322. return {
  323. qwUserIds: [],
  324. sopUserLogId:null,
  325. companyUserLists:[],
  326. sopName:'',
  327. tempId:'',
  328. listUser: {
  329. title: '选择发送人',
  330. open: false
  331. },
  332. // 遮罩层
  333. loading: true,
  334. // 导出遮罩层
  335. exportLoading: false,
  336. filterMode: 1,
  337. // 选中数组
  338. ids: [],
  339. chatNames: [],
  340. statusOptions: [],
  341. // 非单个禁用
  342. single: true,
  343. // 非多个禁用
  344. multiple: true,
  345. // 显示搜索条件
  346. showSearch: true,
  347. // 总条数
  348. total: 0,
  349. logsInfoDetailsOpen:{
  350. title:"",
  351. open:false,
  352. },
  353. sysQwSopAiContentType:[],
  354. userSelectList:[],
  355. // sopUserLogs表格数据
  356. sopUserLogsList: [],
  357. sopUserLogsDelStatus:[],
  358. // 弹出层标题
  359. title: "",
  360. // 是否显示弹出层
  361. open: false,
  362. // 查询参数
  363. addGroupData: {
  364. open: false,
  365. userOpen: false,
  366. selectChat: [],
  367. form: {
  368. chatIds: [],
  369. },
  370. },
  371. updateTimeData: {
  372. open: false,
  373. form: {
  374. date: null,
  375. },
  376. },
  377. queryParams: {
  378. pageNum: 1,
  379. pageSize: 10,
  380. sopId: null,
  381. userLogsId:null,
  382. externalUserName:null,
  383. externalId:null,
  384. sopTempId: null,
  385. qwUserId: null,
  386. qwUserName: null,
  387. corpId: null,
  388. startTime: null,
  389. status: null,
  390. userId: null,
  391. type:null,
  392. },
  393. sendMsgOpen:{
  394. title:'营期一键批量群发',
  395. open:false,
  396. ids:null,
  397. },
  398. setting:[],
  399. // 表单参数
  400. form: {},
  401. tempForm: {
  402. setting:null,
  403. videoIdSet:null,
  404. courseIdSet:null,
  405. },
  406. // 表单校验
  407. rules: {
  408. }
  409. };
  410. },
  411. created() {
  412. this.getDicts("sys_company_status").then(response => {
  413. this.statusOptions = response.data;
  414. });
  415. this.getDicts("sop_user_logs_del_status").then(response => {
  416. this.sopUserLogsDelStatus = response.data;
  417. });
  418. this.getDicts("sys_qwSopAi_contentType").then(response => {
  419. this.sysQwSopAiContentType = response.data;
  420. });
  421. this.queryParams.sopId = this.$route.params.id;
  422. this.sopName = this.$route.query.name;
  423. this.filterMode = this.$route.query.filterMode;
  424. this.tempId = this.$route.query.tempId;
  425. this.queryParams.corpId= this.$route.query.corpId;
  426. this.queryParams.type= this.$route.query.type;
  427. getQwAllUserList(this.queryParams.corpId).then(response => {
  428. this.companyUserLists = response.data;
  429. });
  430. this.getList()
  431. },
  432. methods: {
  433. selectSenderSingle(user){
  434. this.listUser.open=false;
  435. const data = { ids: this.ids };
  436. // 仅在选中员工时携带 actualQwUserId 与 actualQwId,否则两字段均不传,后端按清空处理
  437. if (user && user.qwUserId) {
  438. data.actualQwUserId = user.qwUserId;
  439. data.actualQwId = user.id;
  440. }
  441. replaceUser(data).then(res => {
  442. this.msgSuccess(user && user.qwUserId ? "修改成功" : "已清空实际发送人");
  443. this.getList();
  444. })
  445. },
  446. /** 查询sopUserLogs列表 */
  447. getList() {
  448. this.loading = true;
  449. listSopUserLogs(this.queryParams).then(response => {
  450. this.sopUserLogsList = response.rows;
  451. this.total = response.total;
  452. this.loading = false;
  453. });
  454. },
  455. // 取消按钮
  456. cancel() {
  457. this.open = false;
  458. this.reset();
  459. },
  460. addSetList(){
  461. const newSetting = {
  462. contentType:'1',
  463. value: '',
  464. };
  465. // 将新设置项添加到 content.setting 数组中
  466. this.setting.push(newSetting);
  467. },
  468. // 表单重置
  469. reset() {
  470. this.form = {
  471. id: null,
  472. sopId: null,
  473. sopTempId: null,
  474. qwUserId: null,
  475. externalId:null,
  476. corpId: null,
  477. startTime: null,
  478. status: 0,
  479. userId: null
  480. };
  481. this.resetForm("form");
  482. },
  483. /**
  484. * 营期一键群发
  485. */
  486. handleCampSendMsg(){
  487. setTimeout(() => {
  488. this.$refs.sendMsgOpenTool.oneClickGroupSending(this.ids,2,this.queryParams.corpId);
  489. }, 500);
  490. },
  491. /**
  492. * 批量更换实际发送人
  493. */
  494. handleUpdateSender() {
  495. this.listUser.open = true;
  496. this.$nextTick(() => {
  497. this.$refs.QwUserListSender.getDetails(this.queryParams.corpId);
  498. })
  499. },
  500. /**
  501. * 删除营期
  502. */
  503. handleDeleteUserLogs(){
  504. const ids = this.ids;
  505. this.$confirm('是否确认删除编号为"' + ids + '"的数据项【注意!!删除后不可恢复,请谨慎操作】?', "警告", {
  506. confirmButtonText: "确定",
  507. cancelButtonText: "取消",
  508. type: "warning"
  509. }).then(function() {
  510. return delSopUserLogs(ids);
  511. }).then(() => {
  512. this.getList();
  513. this.msgSuccess("删除成功");
  514. }).catch(() => {});
  515. },
  516. /** 搜索按钮操作 */
  517. handleQuery() {
  518. this.queryParams.pageNum = 1;
  519. this.getList();
  520. },
  521. /** 重置按钮操作 */
  522. resetQuery() {
  523. this.resetForm("queryForm");
  524. this.handleQuery();
  525. },
  526. flashNotify(){
  527. this.getList();
  528. },
  529. // 多选框选中数据
  530. handleSelectionChange(selection) {
  531. this.ids = selection.map(item => item.id)
  532. if(this.filterMode == 2){
  533. this.chatNames = selection.map(item => item.chatName);
  534. }
  535. this.single = selection.length!==1
  536. this.multiple = !selection.length
  537. },
  538. handleSelect(val){
  539. val.filterMode = this.filterMode;
  540. this.logsInfoDetailsOpen.title='企微账号:'+val.qwUserId+' '+'营期时间:'+val.startTime+' '+'天数:' + val.countDays;
  541. this.logsInfoDetailsOpen.open=true;
  542. const externalUserName = this.queryParams.externalUserName;
  543. setTimeout(() => {
  544. this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val, externalUserName);
  545. }, 500);
  546. },
  547. handleRepairLogs(val) {
  548. this.loading = true;
  549. let loadingRock = this.$loading({
  550. lock: true,
  551. text: '正在修复中请稍后~~!!',
  552. spinner: 'el-icon-loading',
  553. background: 'rgba(0, 0, 0, 0.7)'
  554. });
  555. repairSopUserLogs(val).then(res => {
  556. this.msgSuccess("修复成功成功");
  557. }).catch(res => {
  558. }).finally(res => {
  559. loadingRock.close();
  560. this.loading = false;
  561. this.getList();
  562. })
  563. },
  564. /** 导出按钮操作 */
  565. handleExport() {
  566. const queryParams = this.queryParams;
  567. this.$confirm('是否确认导出所有sopUserLogs数据项?', "警告", {
  568. confirmButtonText: "确定",
  569. cancelButtonText: "取消",
  570. type: "warning"
  571. }).then(() => {
  572. this.exportLoading = true;
  573. return exportSopUserLogs(queryParams);
  574. }).then(response => {
  575. this.download(response.msg);
  576. this.exportLoading = false;
  577. }).catch(() => {
  578. });
  579. },
  580. addGroup() {
  581. this.addGroupData.open = true;
  582. this.addGroupData.form = {date: new Date(), chatIds: []};
  583. },
  584. updateGroupTime() {
  585. this.updateTimeData.open = true;
  586. this.updateTimeData.form = {date: new Date()};
  587. },
  588. submitUpdateTimeForm() {
  589. let form = {
  590. date: this.updateTimeData.form.date,
  591. ids: this.ids,
  592. }
  593. updateLogDate(form).then(response => {
  594. if (response.data!=null){
  595. this.msgInfo("部分时间已有营期:"+response.data);
  596. }
  597. this.updateTimeData.open = false;
  598. this.getList();
  599. });
  600. },
  601. submitAddGroupForm() {
  602. let form = {
  603. id: this.queryParams.sopId,
  604. qwUserIds: this.userSelectList.join(),
  605. chatIds: this.addGroupData.form.chatIds.join(),
  606. date: this.addGroupData.form.date,
  607. }
  608. addGroupChat(form).then(e => {
  609. this.addGroupData.open = false;
  610. this.getList();
  611. });
  612. },
  613. handleCompanyUser() {
  614. setTimeout(() => {
  615. this.$refs.QwUserList.getDetails(this.queryParams.corpId, this.queryParams.type, 2);
  616. }, 1);
  617. this.addGroupData.userOpen = true;
  618. },
  619. handleClosegroupUser(list) {
  620. const index = this.userSelectList.findIndex(t => t === list);
  621. if (index !== -1) {
  622. this.userSelectList.splice(index, 1);
  623. this.qwUserIds.splice(index, 1);
  624. this.loadChatList()
  625. }
  626. },
  627. loadChatList() {
  628. chatListAll(this.qwUserIds.join(), this.queryParams.corpId, this.queryParams.sopId).then(e => {
  629. this.addGroupData.selectChat = e.data;
  630. })
  631. },
  632. selectUserList(list) {
  633. this.addGroupData.userOpen = false;
  634. list.forEach(obj => {
  635. if (!this.userSelectList.some(item => item == obj.id)) {
  636. console.info(this.userSelectList)
  637. this.userSelectList.push(obj.id);
  638. this.qwUserIds.push(obj.qwUserId);
  639. }
  640. });
  641. this.loadChatList()
  642. },
  643. }
  644. };
  645. </script>
  646. <style>
  647. .custom-style {
  648. font-weight: bold; /* 加粗 */
  649. }
  650. </style>