index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="148px">
  4. <el-form-item label="部门" prop="type">
  5. <treeselect
  6. style="width: 220px"
  7. :clearable="false"
  8. v-model="queryParams.deptId"
  9. :options="deptOptions"
  10. clearable
  11. :show-count="true"
  12. placeholder="请选择归属部门"
  13. />
  14. </el-form-item>
  15. <el-form-item label="所属客服" prop="companyUserId">
  16. <el-select v-model="queryParams.companyUserId" clearable filterable remote
  17. placeholder="请输入关键词" :remote-method="loadCompanyUserOptions"
  18. v-select-load-more="loadMoreCompanyUserOptions"
  19. :loading="companyUserOptionsLoading">
  20. <el-option
  21. v-for="item in companyUserOptions"
  22. :key="item.dictValue"
  23. :label="item.dictLabel"
  24. :value="item.dictValue">
  25. </el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="企微用户名称" prop="qwUserName">
  29. <el-input
  30. v-model="queryParams.qwUserName"
  31. placeholder="请输入企微用户名称"
  32. clearable
  33. size="small"
  34. @keyup.enter.native="handleQuery"
  35. />
  36. </el-form-item>
  37. <!-- <el-form-item label="标题" prop="title">
  38. <el-input
  39. v-model="queryParams.title"
  40. placeholder="请输入标题"
  41. clearable
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>-->
  46. <!-- <el-form-item label="通话状态" prop="status">
  47. <el-select v-model="queryParams.status" placeholder="请选择通话状态" clearable size="small">
  48. <el-option
  49. v-for="dict in statusOptions"
  50. :key="dict.dictValue"
  51. :label="dict.dictLabel"
  52. :value="dict.dictValue"
  53. />
  54. </el-select>
  55. </el-form-item>-->
  56. <!-- <el-form-item label="企微id" prop="corpId">
  57. <el-input
  58. v-model="queryParams.corpId"
  59. placeholder="请输入企微id"
  60. clearable
  61. size="small"
  62. @keyup.enter.native="handleQuery"
  63. />
  64. </el-form-item>-->
  65. <!-- <el-form-item label="公司名称" prop="companyName">
  66. <el-input
  67. v-model="queryParams.companyName"
  68. placeholder="请输入公司名称"
  69. clearable
  70. size="small"
  71. @keyup.enter.native="handleQuery"
  72. />
  73. </el-form-item>-->
  74. <!-- <el-form-item label="时长秒" prop="duration">
  75. <el-input
  76. v-model="queryParams.duration"
  77. placeholder="请输入时长秒"
  78. clearable
  79. size="small"
  80. @keyup.enter.native="handleQuery"
  81. />
  82. </el-form-item>-->
  83. <el-form-item label="标签" prop="tagIds">
  84. <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
  85. <div style="min-height: 35px; max-height: 200px; overflow-y: auto;" :key="selectTags.length">
  86. <el-tag type="success"
  87. closable
  88. :disable-transitions="false"
  89. v-for="list in this.selectTags"
  90. :key="list.tagId"
  91. @close="handleCloseTags(list)"
  92. style="margin: 3px;"
  93. >{{list.name}}
  94. </el-tag>
  95. </div>
  96. </div>
  97. </el-form-item>
  98. <el-form-item label="创建时间" prop="createTime">
  99. <el-date-picker v-model="createTime" size="small" style="width: 220px"
  100. value-format="yyyy-MM-dd" type="daterange" range-separator="-"
  101. start-placeholder="开始日期" end-placeholder="结束日期"
  102. @change="changeTime"></el-date-picker>
  103. </el-form-item>
  104. <el-form-item>
  105. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  106. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  107. </el-form-item>
  108. </el-form>
  109. <el-row :gutter="10" class="mb8">
  110. <!-- <el-col :span="1.5">
  111. <el-button
  112. type="primary"
  113. plain
  114. icon="el-icon-plus"
  115. size="mini"
  116. @click="handleAdd"
  117. v-hasPermi="['qw:qwUserVoiceLog:add']"
  118. >新增</el-button>
  119. </el-col>
  120. <el-col :span="1.5">
  121. <el-button
  122. type="success"
  123. plain
  124. icon="el-icon-edit"
  125. size="mini"
  126. :disabled="single"
  127. @click="handleUpdate"
  128. v-hasPermi="['qw:qwUserVoiceLog:edit']"
  129. >修改</el-button>
  130. </el-col>
  131. <el-col :span="1.5">
  132. <el-button
  133. type="danger"
  134. plain
  135. icon="el-icon-delete"
  136. size="mini"
  137. :disabled="multiple"
  138. @click="handleDelete"
  139. v-hasPermi="['qw:qwUserVoiceLog:remove']"
  140. >删除</el-button>
  141. </el-col>-->
  142. <el-col :span="1.5">
  143. <el-button
  144. type="warning"
  145. plain
  146. icon="el-icon-download"
  147. size="mini"
  148. :loading="exportLoading"
  149. @click="handleExport"
  150. v-hasPermi="['qw:qwUserVoiceLog:totalExport']"
  151. >导出</el-button>
  152. </el-col>
  153. <el-col :span="1.5">
  154. <el-button
  155. type="primary"
  156. plain
  157. size="mini"
  158. @click="getSellList"
  159. >切换到客服统计</el-button>
  160. </el-col>
  161. <el-col :span="1.5">
  162. <el-button
  163. type="primary"
  164. plain
  165. size="mini"
  166. @click="getList"
  167. >切回企微通话统计</el-button>
  168. </el-col>
  169. <right-toolbar :showSearch.sync="showSearch" @queryTable="handlePagination"></right-toolbar>
  170. </el-row>
  171. <el-table border v-loading="loading" :data="qwUserVoiceLogList" @selection-change="handleSelectionChange">
  172. <el-table-column type="selection" width="55" align="center" />
  173. <!-- <el-table-column label="id" align="center" width="80" prop="id" />-->
  174. <!-- <el-table-column label="外部联系人名称" align="center" prop="qwExternalContact.name" />-->
  175. <el-table-column label="客服名称" align="center" prop="companyUserName" />
  176. <el-table-column label="企微用户名称" align="center" prop="qwUser.qwUserName" />
  177. <el-table-column label="企微主体名称" align="center" prop="corpName" />
  178. <el-table-column label="企微用户id" align="center" prop="qwUser.qwUserId" />
  179. <el-table-column label="时长秒" align="center" prop="duration" />
  180. <el-table-column label="标签" align="center" prop="tagIdsName" width="250px">
  181. <template slot-scope="scope">
  182. <div v-for="name in scope.row.tagIdsName" style="display: inline;">
  183. <el-tag type="success">{{ name }}</el-tag>
  184. </div>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="接通数量" align="center" prop="connectCount" />
  188. <el-table-column label="未接通数量" align="center" prop="noConnectCount" />
  189. <!-- <el-table-column label="标题" align="center" width="80" prop="title" />-->
  190. <!-- <el-table-column label="通话状态" align="center" prop="status">
  191. <template slot-scope="scope">
  192. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  193. </template>
  194. </el-table-column>-->
  195. <!--<el-table-column label="公司名称" align="center" prop="company.companyName" />
  196. <el-table-column label="客服用户名称" align="center" prop="companyUser.userName" />
  197. <el-table-column label="创建时间" align="center" prop="createTime" />-->
  198. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  199. <template slot-scope="scope">
  200. <el-button
  201. size="mini"
  202. type="text"
  203. icon="el-icon-edit"
  204. @click="handleUpdate(scope.row)"
  205. v-hasPermi="['qw:qwUserVoiceLog:edit']"
  206. >修改</el-button>
  207. <el-button
  208. size="mini"
  209. type="text"
  210. icon="el-icon-delete"
  211. @click="handleDelete(scope.row)"
  212. v-hasPermi="['qw:qwUserVoiceLog:remove']"
  213. >删除</el-button>
  214. </template>
  215. </el-table-column>-->
  216. </el-table>
  217. <!-- 搜索标签 -->
  218. <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" width="1000px" append-to-body>
  219. <div>搜索标签:
  220. <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  221. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
  222. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  223. </div>
  224. <div v-for="item in tagGroupList" :key="item.id" >
  225. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  226. <span class="name-background">{{ item.name }}</span>
  227. </div>
  228. <!-- 添加外层滚动容器 -->
  229. <div class="scroll-wrapper">
  230. <div class="tag-container">
  231. <a
  232. v-for="tagItem in item.tag"
  233. class="tag-box"
  234. @click="tagSelection(tagItem)"
  235. :class="{ 'tag-selected': tagItem.isSelected }"
  236. >
  237. {{ tagItem.name }}
  238. </a>
  239. </div>
  240. </div>
  241. </div>
  242. <pagination
  243. v-show="tagTotal>0"
  244. :total="tagTotal"
  245. :page.sync="queryTagParams.pageNum"
  246. :limit.sync="queryTagParams.pageSize"
  247. @pagination="getPageListTagGroup"
  248. />
  249. <div slot="footer" class="dialog-footer">
  250. <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
  251. <el-button @click="tagCancel()">取消</el-button>
  252. </div>
  253. </el-dialog>
  254. <pagination
  255. v-show="total>0"
  256. :total="total"
  257. :page.sync="queryParams.pageNum"
  258. :limit.sync="queryParams.pageSize"
  259. @pagination="handlePagination"
  260. />
  261. </div>
  262. </template>
  263. <script>
  264. import { listQwUserVoiceLog, getQwUserVoiceLog, delQwUserVoiceLog, addQwUserVoiceLog, updateQwUserVoiceLog, exportQwUserVoiceLog } from "@/api/qw/qwUserVoiceLog";
  265. import {listQwUserVoiceLogTotal,exportQwUserVoiceLogTotal,listQwUserVoiceLogSellTotal,exportQwUserVoiceLogSellTotal} from "@/api/qw/qwUserVoiceLogTotal";
  266. import {getCompanyUserListLikeName} from "@/api/company/companyUser";
  267. import Treeselect from "@riophae/vue-treeselect";
  268. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  269. import {treeselect} from "../../../api/company/companyDept";
  270. import {allListTagGroup} from "@/api/qw/tagGroup";
  271. import {searchTags} from "@/api/qw/tag";
  272. export default {
  273. name: "QwUserVoiceLog",
  274. components: {Treeselect},
  275. data() {
  276. return {
  277. // 遮罩层
  278. loading: true,
  279. status: 0,
  280. // 导出遮罩层
  281. exportLoading: false,
  282. // 选中数组
  283. ids: [],
  284. // 非单个禁用
  285. single: true,
  286. // 非多个禁用
  287. multiple: true,
  288. // 显示搜索条件
  289. showSearch: true,
  290. //时间范围
  291. createTime:null,
  292. beginTime:null,
  293. endTime:null,
  294. selectTags:[],
  295. queryTagParams:{
  296. pageNum: 1,
  297. pageSize: 5,
  298. total:0,
  299. name:null,
  300. corpId:null,
  301. },
  302. //标签
  303. changeTagDialog:{
  304. title:"",
  305. open:false,
  306. },
  307. tagTotal:0,
  308. tagGroupList: [],
  309. addTagForm:{
  310. userIds:[],
  311. tagIds:[]
  312. },
  313. // 总条数
  314. total: 0,
  315. // 企微用户通话记录表格数据
  316. qwUserVoiceLogList: [],
  317. deptOptions: [],
  318. // 弹出层标题
  319. title: "",
  320. // 是否显示弹出层
  321. open: false,
  322. // 1接听 2未接字典
  323. statusOptions: [],
  324. // 查询参数
  325. queryParams: {
  326. pageNum: 1,
  327. pageSize: 10,
  328. extId: null,
  329. extName:null,
  330. qwUserId: null,
  331. qwUserName: null,
  332. duration: null,
  333. title: null,
  334. status: null,
  335. corpName: null,
  336. companyId: null,
  337. companyName: null,
  338. companyUserId: null,
  339. companyUserName: null,
  340. createTime:null,
  341. beginTime:null,
  342. endTime:null,
  343. tagIds: null,
  344. },
  345. // 表单参数
  346. form: {},
  347. // 表单校验
  348. rules: {
  349. },
  350. companyUserOptionsLoading: false,
  351. companyUserOptions: [],
  352. companyUserOptionsParams: {
  353. name: undefined,
  354. hasNextPage: false,
  355. pageNum: 1,
  356. pageSize: 10
  357. },
  358. };
  359. },
  360. created() {
  361. this.getDeptTreeSelect();
  362. this.handlePagination();
  363. this.getDicts("sys_qw_user_voice_status").then(response => {
  364. this.statusOptions = response.data;
  365. });
  366. },
  367. methods: {
  368. tagSubmitForm(){
  369. for (let i = 0; i < this.tagGroupList.length; i++) {
  370. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  371. if (this.tagGroupList[i].tag[x].isSelected === true) {
  372. if (!this.selectTags) {
  373. this.selectTags = [];
  374. }
  375. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  376. let tagExists = this.selectTags.some(
  377. tag => tag.id === this.tagGroupList[i].tag[x].id
  378. );
  379. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  380. if (!tagExists) {
  381. this.selectTags.push(this.tagGroupList[i].tag[x]);
  382. }
  383. }
  384. }
  385. }
  386. if (!this.selectTags || this.selectTags.length === 0) {
  387. return this.$message('请选择标签');
  388. }
  389. this.changeTagDialog.open = false;
  390. },
  391. //取消选择标签
  392. tagCancel(){
  393. this.changeTagDialog.open = false;
  394. },
  395. tagSelection(row){
  396. row.isSelected= !row.isSelected;
  397. this.$forceUpdate();
  398. },
  399. handleSearchTags(name){
  400. if (!name){
  401. return this.$message.error("请输入要搜索的标签")
  402. }
  403. this.queryTagParams.name=name;
  404. this.queryTagParams.corpId=this.queryParams.corpId;
  405. searchTags(this.queryTagParams).then(response => {
  406. this.tagGroupList = response.rows;
  407. this.tagTotal = response.total;
  408. });
  409. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  410. // this.tagGroupList = response.rows;
  411. // });
  412. },
  413. cancelSearchTags(){
  414. this.resetSearchQueryTag()
  415. this.getPageListTagGroup();
  416. },
  417. //删除一些选择的标签
  418. handleCloseTags(list){
  419. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  420. if (ls !== -1) {
  421. this.selectTags.splice(ls, 1);
  422. this.selectTags = [...this.selectTags];
  423. }
  424. if (this.selectTags!=null && this.selectTags.length>0){
  425. // 确保 this.form.tags 是数组
  426. if (!this.queryParams.tagIds) {
  427. this.queryParams.tagIds = []; // 如果未定义,初始化
  428. } else {
  429. this.queryParams.tagIds = []; // 清空已有数据
  430. }
  431. // 遍历并添加 tagId
  432. this.selectTags.forEach(tag => {
  433. if (tag.tagId) { // 确保 tagId 存在
  434. this.queryParams.tagIds.push(tag.tagId);
  435. }
  436. });
  437. console.log(this.queryParams.tagIds)
  438. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  439. }else {
  440. this.queryParams.tagIds=null;
  441. }
  442. },
  443. getPageListTagGroup(){
  444. this.queryTagParams.corpId=this.queryParams.corpId
  445. allListTagGroup(this.queryTagParams).then(response => {
  446. this.tagGroupList = response.rows;
  447. this.tagTotal = response.total;
  448. });
  449. },
  450. //搜索的标签
  451. hangleChangeTags(){
  452. this.changeTagDialog.title="搜索的标签"
  453. this.changeTagDialog.open=true;
  454. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  455. const selectedTagIds = new Set(
  456. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  457. );
  458. this.queryTagParams.name=null;
  459. this.getPageListTagGroup();
  460. setTimeout(() => {
  461. for (let i = 0; i < this.tagGroupList.length; i++) {
  462. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  463. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  464. }
  465. }
  466. }, 200);
  467. },
  468. /** 查询企微用户通话记录列表 */
  469. getList() {
  470. this.loading = true;
  471. this.status = 0;
  472. const { qwUserName, ...queryParams } = this.queryParams;
  473. listQwUserVoiceLogTotal(queryParams).then(response => {
  474. this.qwUserVoiceLogList = response.rows;
  475. this.total = response.total;
  476. this.loading = false;
  477. });
  478. },
  479. getDeptTreeSelect() {
  480. treeselect().then((response) => {
  481. this.deptOptions = response.data;
  482. });
  483. },
  484. getSellList() {
  485. this.loading = true;
  486. this.status = 1;
  487. listQwUserVoiceLogSellTotal(this.queryParams).then(response => {
  488. this.qwUserVoiceLogList = response.rows;
  489. this.total = response.total;
  490. this.loading = false;
  491. });
  492. },
  493. // 新增 handlePagination 方法
  494. handlePagination() {
  495. if (this.status === 0) {
  496. this.getList();
  497. } else {
  498. this.getSellList();
  499. }
  500. },
  501. /**
  502. * 根据名称模糊查询用户列表
  503. * @param query 参数
  504. */
  505. loadCompanyUserOptions(query) {
  506. this.companyUserOptions = [];
  507. if (query === '') {
  508. return;
  509. }
  510. this.companyUserOptionsParams.pageNum = 1
  511. this.companyUserOptionsParams.name = query
  512. this.companyUserOptionsLoading = true;
  513. this.getCompanyUserListLikeName()
  514. },
  515. getCompanyUserListLikeName() {
  516. getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
  517. this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
  518. this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
  519. this.companyUserOptionsLoading = false;
  520. });
  521. },
  522. /**
  523. * 加载更多员工选项
  524. */
  525. loadMoreCompanyUserOptions() {
  526. if (!this.companyUserOptionsParams.hasNextPage) {
  527. return;
  528. }
  529. this.companyUserOptionsParams.pageNum += 1
  530. this.getCompanyUserListLikeName()
  531. },
  532. changeTime(){
  533. if(this.createTime!=null){
  534. this.queryParams.beginTime=this.createTime[0];
  535. this.queryParams.endTime=this.createTime[1];
  536. }else{
  537. this.queryParams.beginTime=null;
  538. this.queryParams.endTime=null;
  539. }
  540. },
  541. // 取消按钮
  542. cancel() {
  543. this.open = false;
  544. this.reset();
  545. },
  546. // 表单重置
  547. reset() {
  548. this.form = {
  549. id: null,
  550. extId: null,
  551. qwUserId: null,
  552. duration: null,
  553. title: null,
  554. status: 0,
  555. corpId: null,
  556. companyId: null,
  557. companyUserId: null,
  558. createTime: null,
  559. beginTime:null,
  560. endTime:null,
  561. deptOption:null,
  562. };
  563. this.resetForm("form");
  564. },
  565. /** 搜索按钮操作 */
  566. handleQuery() {
  567. if (this.selectTags!=null && this.selectTags.length>0){
  568. // 确保 this.form.tags 是数组
  569. if (!this.queryParams.tagIds) {
  570. this.queryParams.tagIds = []; // 如果未定义,初始化
  571. } else {
  572. this.queryParams.tagIds = []; // 清空已有数据
  573. }
  574. // 遍历并添加 tagId
  575. this.selectTags.forEach(tag => {
  576. if (tag.tagId) { // 确保 tagId 存在
  577. this.queryParams.tagIds.push(tag.tagId);
  578. }
  579. });
  580. //this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  581. }else {
  582. this.queryParams.tagIds=null;
  583. }
  584. this.queryParams.pageNum = 1;
  585. this.handlePagination();
  586. },
  587. /** 重置按钮操作 */
  588. resetQuery() {
  589. this.resetForm("queryForm");
  590. this.createTime=null;
  591. this.queryParams.beginTime = null;
  592. this.queryParams.endTime = null;
  593. this.queryParams.deptId = null;
  594. if (this.myQwCompanyList && this.myQwCompanyList.length > 0) {
  595. this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
  596. } else {
  597. this.queryParams.corpId = null; // 或设置默认值
  598. }
  599. this.selectTags=[];
  600. this.createTime=null;
  601. this.queryParams.sTime=null;
  602. this.queryParams.eTime=null;
  603. this.queryParams.tagIds=null;
  604. this.$forceUpdate();
  605. this.handleQuery();
  606. },
  607. // 多选框选中数据
  608. handleSelectionChange(selection) {
  609. this.ids = selection.map(item => item.id)
  610. this.single = selection.length!==1
  611. this.multiple = !selection.length
  612. },
  613. /** 新增按钮操作 */
  614. handleAdd() {
  615. this.reset();
  616. this.open = true;
  617. this.title = "添加企微用户通话记录";
  618. },
  619. /** 修改按钮操作 */
  620. handleUpdate(row) {
  621. this.reset();
  622. const id = row.id || this.ids
  623. getQwUserVoiceLog(id).then(response => {
  624. this.form = response.data;
  625. this.open = true;
  626. this.title = "修改企微用户通话记录";
  627. });
  628. },
  629. /** 提交按钮 */
  630. submitForm() {
  631. this.$refs["form"].validate(valid => {
  632. if (valid) {
  633. if (this.form.id != null) {
  634. updateQwUserVoiceLog(this.form).then(response => {
  635. this.msgSuccess("修改成功");
  636. this.open = false;
  637. this.handlePagination();
  638. });
  639. } else {
  640. addQwUserVoiceLog(this.form).then(response => {
  641. this.msgSuccess("新增成功");
  642. this.open = false;
  643. this.handlePagination();
  644. });
  645. }
  646. }
  647. });
  648. },
  649. /** 删除按钮操作 */
  650. handleDelete(row) {
  651. const ids = row.id || this.ids;
  652. this.$confirm('是否确认删除企微用户通话记录编号为"' + ids + '"的数据项?', "警告", {
  653. confirmButtonText: "确定",
  654. cancelButtonText: "取消",
  655. type: "warning"
  656. }).then(function() {
  657. return delQwUserVoiceLog(ids);
  658. }).then(() => {
  659. this.handlePagination();
  660. this.msgSuccess("删除成功");
  661. }).catch(() => {});
  662. },
  663. /** 导出按钮操作 */
  664. handleExport() {
  665. const queryParams = this.queryParams;
  666. this.$confirm('是否确认导出所有企微用户通话记录数据项?', "警告", {
  667. confirmButtonText: "确定",
  668. cancelButtonText: "取消",
  669. type: "warning"
  670. }).then(() => {
  671. this.exportLoading = true;
  672. if(this.status === 0){
  673. return exportQwUserVoiceLogTotal(queryParams);
  674. }else{
  675. return exportQwUserVoiceLogSellTotal(queryParams);
  676. }
  677. }).then(response => {
  678. this.download(response.msg);
  679. this.exportLoading = false;
  680. }).catch(() => {});
  681. }
  682. }
  683. };
  684. </script>
  685. <style scoped>
  686. /* CSS 样式 */
  687. .tag-container {
  688. display: flex;
  689. flex-wrap: wrap; /* 超出宽度时自动换行 */
  690. gap: 8px; /* 设置标签之间的间距 */
  691. }
  692. .name-background {
  693. display: inline-block;
  694. background-color: #abece6; /* 背景颜色 */
  695. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  696. border-radius: 4px; /* 可选:设置圆角 */
  697. }
  698. /* CSS 样式 */
  699. .tag-container {
  700. display: flex;
  701. flex-wrap: wrap; /* 超出宽度时自动换行 */
  702. gap: 8px; /* 设置标签之间的间距 */
  703. }
  704. .name-background {
  705. display: inline-block;
  706. background-color: #abece6; /* 背景颜色 */
  707. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  708. border-radius: 4px; /* 可选:设置圆角 */
  709. }
  710. .tag-box {
  711. padding: 8px 12px;
  712. border: 1px solid #989797;
  713. border-radius: 4px;
  714. cursor: pointer;
  715. display: inline-block;
  716. }
  717. .tag-selected {
  718. background-color: #00bc98;
  719. color: #fff;
  720. border-color: #00bc98;
  721. }
  722. .el-tag + .el-tag {
  723. margin-left: 10px;
  724. }
  725. .suggestion-box {
  726. position: absolute;
  727. z-index: 999;
  728. background: #fff;
  729. border: 1px solid #ddd;
  730. max-height: 200px;
  731. overflow-y: auto;
  732. width: 100%;
  733. }
  734. .suggestion-item {
  735. padding: 10px;
  736. cursor: pointer;
  737. }
  738. .suggestion-item:hover {
  739. background-color: #f5f7fa;
  740. }
  741. .button-new-tag {
  742. margin-left: 10px;
  743. height: 32px;
  744. line-height: 30px;
  745. padding-top: 0;
  746. padding-bottom: 0;
  747. }
  748. .input-new-tag {
  749. width: 90px;
  750. margin-left: 10px;
  751. vertical-align: bottom;
  752. }
  753. .feedback-dialog {
  754. width: 100%;
  755. max-width: 1000px;
  756. max-height: 80vh; /* 限制最大高度为视窗高度的 80% */
  757. overflow-y: auto; /* 超出时显示垂直滚动条 */
  758. padding: 20px;
  759. box-sizing: border-box; /* 确保 padding 不影响总宽度 */
  760. }
  761. /* 新增的滚动容器样式(不影响原有样式) */
  762. .scroll-wrapper {
  763. max-height: 130px; /* 大约三行的高度 */
  764. overflow-y: auto; /* 垂直滚动 */
  765. padding-right: 5px; /* 为滚动条留出空间 */
  766. }
  767. /* 美化滚动条(可选) */
  768. .scroll-wrapper::-webkit-scrollbar {
  769. width: 6px;
  770. }
  771. .scroll-wrapper::-webkit-scrollbar-thumb {
  772. background: rgba(0, 0, 0, 0.2);
  773. border-radius: 3px;
  774. }
  775. </style>