index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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="extName">
  5. <el-input
  6. v-model="queryParams.extName"
  7. placeholder="请输入外部联系人名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="企微用户名称" prop="qwUserName">
  14. <el-input
  15. v-model="queryParams.qwUserName"
  16. placeholder="请输入企微用户名称"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <!-- <el-form-item label="标题" prop="title">
  23. <el-input
  24. v-model="queryParams.title"
  25. placeholder="请输入标题"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>-->
  31. <el-form-item label="通话状态" prop="status">
  32. <el-select v-model="queryParams.status" placeholder="请选择通话状态" clearable size="small">
  33. <el-option
  34. v-for="dict in statusOptions"
  35. :key="dict.dictValue"
  36. :label="dict.dictLabel"
  37. :value="dict.dictValue"
  38. />
  39. </el-select>
  40. </el-form-item>
  41. <!-- <el-form-item label="企微id" prop="corpId">
  42. <el-input
  43. v-model="queryParams.corpId"
  44. placeholder="请输入企微id"
  45. clearable
  46. size="small"
  47. @keyup.enter.native="handleQuery"
  48. />
  49. </el-form-item>-->
  50. <el-form-item label="公司名称" prop="companyName">
  51. <el-input
  52. v-model="queryParams.companyName"
  53. placeholder="请输入公司名称"
  54. clearable
  55. size="small"
  56. @keyup.enter.native="handleQuery"
  57. />
  58. </el-form-item>
  59. <el-form-item label="销售用户名称" prop="companyUserName">
  60. <el-input
  61. v-model="queryParams.companyUserName"
  62. placeholder="请输入销售用户名称"
  63. clearable
  64. size="small"
  65. @keyup.enter.native="handleQuery"
  66. />
  67. </el-form-item>
  68. <!-- <el-form-item label="时长秒" prop="duration">
  69. <el-input
  70. v-model="queryParams.duration"
  71. placeholder="请输入时长秒"
  72. clearable
  73. size="small"
  74. @keyup.enter.native="handleQuery"
  75. />
  76. </el-form-item>-->
  77. <el-form-item label="创建时间" prop="createTime">
  78. <el-date-picker v-model="createTime" size="small" style="width: 215px"
  79. value-format="yyyy-MM-dd" type="daterange" range-separator="-"
  80. start-placeholder="开始日期" end-placeholder="结束日期"
  81. @change="changeTime"></el-date-picker>
  82. </el-form-item>
  83. <el-form-item>
  84. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  85. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  86. </el-form-item>
  87. </el-form>
  88. <el-row :gutter="10" class="mb8">
  89. <!-- <el-col :span="1.5">
  90. <el-button
  91. type="primary"
  92. plain
  93. icon="el-icon-plus"
  94. size="mini"
  95. @click="handleAdd"
  96. v-hasPermi="['qw:qwUserVoiceLog:add']"
  97. >新增</el-button>
  98. </el-col>
  99. <el-col :span="1.5">
  100. <el-button
  101. type="success"
  102. plain
  103. icon="el-icon-edit"
  104. size="mini"
  105. :disabled="single"
  106. @click="handleUpdate"
  107. v-hasPermi="['qw:qwUserVoiceLog:edit']"
  108. >修改</el-button>
  109. </el-col>
  110. <el-col :span="1.5">
  111. <el-button
  112. type="danger"
  113. plain
  114. icon="el-icon-delete"
  115. size="mini"
  116. :disabled="multiple"
  117. @click="handleDelete"
  118. v-hasPermi="['qw:qwUserVoiceLog:remove']"
  119. >删除</el-button>
  120. </el-col>-->
  121. <el-col :span="1.5">
  122. <el-button
  123. type="warning"
  124. plain
  125. icon="el-icon-download"
  126. size="mini"
  127. :loading="exportLoading"
  128. @click="handleExport"
  129. v-hasPermi="['qw:qwUserVoiceLog:myExport']"
  130. >导出</el-button>
  131. </el-col>
  132. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  133. </el-row>
  134. <el-table border v-loading="loading" :data="qwUserVoiceLogList" @selection-change="handleSelectionChange">
  135. <el-table-column type="selection" width="55" align="center" />
  136. <el-table-column label="id" align="center" width="80" prop="id" />
  137. <el-table-column label="外部联系人名称" align="center" prop="qwExternalContact.name" />
  138. <el-table-column label="企微用户名称" align="center" prop="qwUser.qwUserName" />
  139. <el-table-column label="时长秒" align="center" prop="duration" />
  140. <el-table-column label="标题" align="center" width="80" prop="title" />
  141. <el-table-column label="通话状态" align="center" prop="status">
  142. <template slot-scope="scope">
  143. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="企微id" align="center" width="80" prop="corpId" />
  147. <el-table-column label="公司名称" align="center" prop="company.companyName" />
  148. <el-table-column label="销售用户名称" align="center" prop="companyUser.userName" />
  149. <el-table-column label="创建时间" align="center" prop="createTime" />
  150. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  151. <template slot-scope="scope">
  152. <el-button
  153. size="mini"
  154. type="text"
  155. icon="el-icon-edit"
  156. @click="handleUpdate(scope.row)"
  157. v-hasPermi="['qw:qwUserVoiceLog:edit']"
  158. >修改</el-button>
  159. <el-button
  160. size="mini"
  161. type="text"
  162. icon="el-icon-delete"
  163. @click="handleDelete(scope.row)"
  164. v-hasPermi="['qw:qwUserVoiceLog:remove']"
  165. >删除</el-button>
  166. </template>
  167. </el-table-column>-->
  168. </el-table>
  169. <pagination
  170. v-show="total>0"
  171. :total="total"
  172. :page.sync="queryParams.pageNum"
  173. :limit.sync="queryParams.pageSize"
  174. @pagination="getList"
  175. />
  176. <!-- 添加或修改企微用户通话记录对话框 -->
  177. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  178. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  179. <el-form-item label="外部联系人id" prop="extId">
  180. <el-input v-model="form.extId" placeholder="请输入外部联系人id" />
  181. </el-form-item>
  182. <el-form-item label="企微用户id" prop="qwUserId">
  183. <el-input v-model="form.qwUserId" placeholder="请输入企微用户id" />
  184. </el-form-item>
  185. <el-form-item label="时长秒" prop="duration">
  186. <el-input v-model="form.duration" placeholder="请输入时长秒" />
  187. </el-form-item>
  188. <el-form-item label="标题" prop="title">
  189. <el-input v-model="form.title" placeholder="请输入标题" />
  190. </el-form-item>
  191. <el-form-item label="1接听 2未接">
  192. <el-radio-group v-model="form.status">
  193. <el-radio
  194. v-for="dict in statusOptions"
  195. :key="dict.dictValue"
  196. :label="parseInt(dict.dictValue)"
  197. >{{dict.dictLabel}}</el-radio>
  198. </el-radio-group>
  199. </el-form-item>
  200. <el-form-item label="企微id" prop="corpId">
  201. <el-input v-model="form.corpId" placeholder="请输入企微id" />
  202. </el-form-item>
  203. <el-form-item label="公司id" prop="companyId">
  204. <el-input v-model="form.companyId" placeholder="请输入公司id" />
  205. </el-form-item>
  206. <el-form-item label="销售用户id" prop="companyUserId">
  207. <el-input v-model="form.companyUserId" placeholder="请输入销售用户id" />
  208. </el-form-item>
  209. </el-form>
  210. <div slot="footer" class="dialog-footer">
  211. <el-button type="primary" @click="submitForm">确 定</el-button>
  212. <el-button @click="cancel">取 消</el-button>
  213. </div>
  214. </el-dialog>
  215. </div>
  216. </template>
  217. <script>
  218. import { listMyVoiceLog, exportMyVoiceLog } from "@/api/qw/myVoiceLog";
  219. export default {
  220. name: "QwUserVoiceLog",
  221. data() {
  222. return {
  223. // 遮罩层
  224. loading: true,
  225. // 导出遮罩层
  226. exportLoading: false,
  227. // 选中数组
  228. ids: [],
  229. // 非单个禁用
  230. single: true,
  231. // 非多个禁用
  232. multiple: true,
  233. // 显示搜索条件
  234. showSearch: true,
  235. //时间范围
  236. createTime:null,
  237. beginTime:null,
  238. endTime:null,
  239. // 总条数
  240. total: 0,
  241. // 企微用户通话记录表格数据
  242. qwUserVoiceLogList: [],
  243. // 弹出层标题
  244. title: "",
  245. // 是否显示弹出层
  246. open: false,
  247. // 1接听 2未接字典
  248. statusOptions: [],
  249. // 查询参数
  250. queryParams: {
  251. pageNum: 1,
  252. pageSize: 10,
  253. extId: null,
  254. extName:null,
  255. qwUserId: null,
  256. qwUserName: null,
  257. duration: null,
  258. title: null,
  259. status: null,
  260. corpId: null,
  261. companyId: null,
  262. companyName: null,
  263. companyUserId: null,
  264. companyUserName: null,
  265. createTime:null,
  266. beginTime:null,
  267. endTime:null,
  268. },
  269. // 表单参数
  270. form: {},
  271. // 表单校验
  272. rules: {
  273. }
  274. };
  275. },
  276. created() {
  277. this.getList();
  278. this.getDicts("sys_qw_user_voice_status").then(response => {
  279. this.statusOptions = response.data;
  280. });
  281. },
  282. methods: {
  283. /** 查询企微用户通话记录列表 */
  284. getList() {
  285. this.loading = true;
  286. listMyVoiceLog(this.queryParams).then(response => {
  287. this.qwUserVoiceLogList = response.rows;
  288. this.total = response.total;
  289. this.loading = false;
  290. });
  291. },
  292. changeTime(){
  293. if(this.createTime!=null){
  294. this.queryParams.beginTime=this.createTime[0];
  295. this.queryParams.endTime=this.createTime[1];
  296. }else{
  297. this.queryParams.beginTime=null;
  298. this.queryParams.endTime=null;
  299. }
  300. },
  301. // 取消按钮
  302. cancel() {
  303. this.open = false;
  304. this.reset();
  305. },
  306. // 表单重置
  307. reset() {
  308. this.form = {
  309. id: null,
  310. extId: null,
  311. qwUserId: null,
  312. duration: null,
  313. title: null,
  314. status: 0,
  315. corpId: null,
  316. companyId: null,
  317. companyUserId: null,
  318. createTime:null,
  319. beginTime:null,
  320. endTime:null,
  321. };
  322. this.resetForm("form");
  323. },
  324. /** 搜索按钮操作 */
  325. handleQuery() {
  326. this.queryParams.pageNum = 1;
  327. this.getList();
  328. },
  329. /** 重置按钮操作 */
  330. resetQuery() {
  331. this.resetForm("queryForm");
  332. this.createTime=null;
  333. this.queryParams.beginTime = null;
  334. this.queryParams.endTime = null;
  335. this.handleQuery();
  336. },
  337. // 多选框选中数据
  338. handleSelectionChange(selection) {
  339. this.ids = selection.map(item => item.id)
  340. this.single = selection.length!==1
  341. this.multiple = !selection.length
  342. },
  343. /** 新增按钮操作 */
  344. handleAdd() {
  345. this.reset();
  346. this.open = true;
  347. this.title = "添加企微用户通话记录";
  348. },
  349. /** 修改按钮操作 */
  350. handleUpdate(row) {
  351. this.reset();
  352. const id = row.id || this.ids
  353. getQwUserVoiceLog(id).then(response => {
  354. this.form = response.data;
  355. this.open = true;
  356. this.title = "修改企微用户通话记录";
  357. });
  358. },
  359. /** 提交按钮 */
  360. submitForm() {
  361. this.$refs["form"].validate(valid => {
  362. if (valid) {
  363. if (this.form.id != null) {
  364. updateQwUserVoiceLog(this.form).then(response => {
  365. this.msgSuccess("修改成功");
  366. this.open = false;
  367. this.getList();
  368. });
  369. } else {
  370. addQwUserVoiceLog(this.form).then(response => {
  371. this.msgSuccess("新增成功");
  372. this.open = false;
  373. this.getList();
  374. });
  375. }
  376. }
  377. });
  378. },
  379. /** 删除按钮操作 */
  380. handleDelete(row) {
  381. const ids = row.id || this.ids;
  382. this.$confirm('是否确认删除企微用户通话记录编号为"' + ids + '"的数据项?', "警告", {
  383. confirmButtonText: "确定",
  384. cancelButtonText: "取消",
  385. type: "warning"
  386. }).then(function() {
  387. return delQwUserVoiceLog(ids);
  388. }).then(() => {
  389. this.getList();
  390. this.msgSuccess("删除成功");
  391. }).catch(() => {});
  392. },
  393. /** 导出按钮操作 */
  394. handleExport() {
  395. const queryParams = this.queryParams;
  396. this.$confirm('是否确认导出所有企微用户通话记录数据项?', "警告", {
  397. confirmButtonText: "确定",
  398. cancelButtonText: "取消",
  399. type: "warning"
  400. }).then(() => {
  401. this.exportLoading = true;
  402. return exportMyVoiceLog(queryParams);
  403. }).then(response => {
  404. this.download(response.msg);
  405. this.exportLoading = false;
  406. }).catch(() => {});
  407. }
  408. }
  409. };
  410. </script>