You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

810 lines
21 KiB

  1. <template>
  2. <div class="box-center">
  3. <!-- 头 -->
  4. <div class="app-top">
  5. <div class="app-titel" v-if="orgType != 3">
  6. <div
  7. class="label"
  8. style="color: #32363d; font-weight: 400; font-size: 16px"
  9. >
  10. 项目选择:
  11. </div>
  12. <div style="margin-left: 8px">
  13. <el-select
  14. v-model="searchForm.projectId"
  15. @change="houseChange"
  16. placeholder="请选择"
  17. filterable
  18. >
  19. <el-option
  20. v-for="item in houseList"
  21. :key="item.id"
  22. :label="item.propertyName"
  23. :value="item.id"
  24. >
  25. </el-option>
  26. </el-select>
  27. </div>
  28. </div>
  29. <div class="app-titel" style="margin-top: 15px">
  30. <div class="label" style="margin-left: 20px">时间:</div>
  31. <div class="toptimeqhuan">
  32. <el-button
  33. class="btn"
  34. :type="searchForm.dateType == null ? 'primary' : ''"
  35. @click="tabtimetap(null)"
  36. >
  37. 全部
  38. </el-button>
  39. <el-button
  40. class="btn"
  41. :type="searchForm.dateType == 0 ? 'primary' : ''"
  42. @click="tabtimetap(0)"
  43. >
  44. 今日
  45. </el-button>
  46. <el-button
  47. class="btn"
  48. :type="searchForm.dateType == 1 ? 'primary' : ''"
  49. @click="tabtimetap(1)"
  50. >
  51. 昨日
  52. </el-button>
  53. <el-button
  54. class="btn"
  55. :type="searchForm.dateType == 2 ? 'primary' : ''"
  56. @click="tabtimetap(2)"
  57. >
  58. 近7天
  59. </el-button>
  60. </div>
  61. <div style="margin-left: 20px">
  62. <el-date-picker
  63. v-model="time"
  64. type="daterange"
  65. class="div-inp"
  66. range-separator="-"
  67. start-placeholder="开始日期"
  68. :default-time="['00:00:00', '23:59:59']"
  69. value-format="yyyy-MM-dd"
  70. end-placeholder="结束日期"
  71. @change="timeChange"
  72. >
  73. </el-date-picker>
  74. </div>
  75. </div>
  76. <div class="app-titel" style="margin-top: 15px">
  77. <div class="div-lab">
  78. <div class="label">客户名称:</div>
  79. <el-input
  80. class="div-inp"
  81. maxlength="10"
  82. clearable
  83. v-model="searchForm.name"
  84. ></el-input>
  85. </div>
  86. <div class="div-lab">
  87. <div class="label">画像标签:</div>
  88. <el-select
  89. class="div-inp"
  90. multiple
  91. clearable
  92. filterable
  93. collapse-tags
  94. v-model="searchForm.keywordsId"
  95. placeholder="请选择"
  96. >
  97. <el-option
  98. v-for="item in keywordsList"
  99. :key="item.keywordsId"
  100. :label="
  101. item.isInterval == 0
  102. ? item.name + '-' + item.endName + item.unit
  103. : item.name
  104. "
  105. :value="item.keywordsId"
  106. >
  107. </el-option>
  108. </el-select>
  109. </div>
  110. <div class="div-lab">
  111. <div class="label">录音类型:</div>
  112. <el-select
  113. v-model="searchForm.recording"
  114. clearable
  115. filterable
  116. placeholder="请选择"
  117. class="div-inp"
  118. >
  119. <el-option
  120. v-for="item in recordingList"
  121. :key="item.value"
  122. :label="item.label"
  123. :value="item.value"
  124. >
  125. </el-option>
  126. </el-select>
  127. </div>
  128. <div class="div-lab">
  129. <div class="label">置业顾问:</div>
  130. <el-select
  131. v-model="searchForm.accountId"
  132. clearable
  133. filterable
  134. placeholder="请选择"
  135. class="div-inp"
  136. >
  137. <el-option
  138. v-for="item in accountList"
  139. :key="item.accountId"
  140. :label="item.name"
  141. :value="item.accountId"
  142. >
  143. </el-option>
  144. </el-select>
  145. </div>
  146. <div class="div-lab">
  147. <!-- 默认全部 -->
  148. <div class="label">标记顾问:</div>
  149. <el-select
  150. v-model="searchForm.markAdvisor"
  151. placeholder="请选择"
  152. class="div-inp"
  153. filterable
  154. clearable
  155. >
  156. <el-option
  157. v-for="item in options5"
  158. :key="item.value"
  159. :label="item.label"
  160. :value="item.value"
  161. >
  162. </el-option>
  163. </el-select>
  164. </div>
  165. <div class="div-lab">
  166. <!-- 默认全部 -->
  167. <div class="label">是否违禁:</div>
  168. <el-select
  169. v-model="searchForm.taboo"
  170. placeholder="请选择"
  171. class="div-inp"
  172. filterable
  173. clearable
  174. >
  175. <el-option
  176. v-for="item in options11"
  177. :key="item.value"
  178. :label="item.label"
  179. :value="item.value"
  180. >
  181. </el-option>
  182. </el-select>
  183. </div>
  184. <div class="div-lab">
  185. <!-- 默认全部 -->
  186. <div class="label">是否加精:</div>
  187. <el-select
  188. v-model="searchForm.zfal"
  189. placeholder="请选择"
  190. class="div-inp"
  191. filterable
  192. clearable
  193. >
  194. <el-option
  195. v-for="item in options12"
  196. :key="item.value"
  197. :label="item.label"
  198. :value="item.value"
  199. >
  200. </el-option>
  201. </el-select>
  202. </div>
  203. <div class="div-lab">
  204. <div class="label">接待时长:</div>
  205. <el-select
  206. clearable
  207. filterable
  208. v-model="searchForm.recDurationInterval"
  209. placeholder="请选择"
  210. class="div-inp"
  211. >
  212. <el-option
  213. v-for="item in options3"
  214. :key="item.value"
  215. :label="item.label"
  216. :value="item.value"
  217. >
  218. </el-option>
  219. </el-select>
  220. </div>
  221. <div class="div-lab">
  222. <div class="label">到访次数:</div>
  223. <el-select
  224. v-model="searchForm.visitRecord"
  225. clearable
  226. filterable
  227. placeholder="请选择"
  228. class="div-inp"
  229. >
  230. <el-option
  231. v-for="item in options4"
  232. :key="item.value"
  233. :label="item.label"
  234. :value="item.value"
  235. >
  236. </el-option>
  237. </el-select>
  238. </div>
  239. <!-- <div class="div-lab">
  240. <div class="label">是否有效:</div>
  241. <el-select
  242. v-model="searchForm.validInvalid"
  243. clearable
  244. filterable
  245. placeholder="请选择"
  246. class="div-inp"
  247. >
  248. <el-option
  249. v-for="item in options13"
  250. :key="item.value"
  251. :label="item.label"
  252. :value="item.value"
  253. ></el-option>
  254. </el-select>
  255. </div> -->
  256. </div>
  257. <div class="app-titel" style="margin-top: 15px"></div>
  258. <div class="app-titel" style="margin-top: 15px">
  259. <div class="label" style="color: #ffffff">筛选相关:</div>
  260. <div>
  261. <el-button type="primary" @click="screen">筛选</el-button>
  262. </div>
  263. <div style="margin-left: 20px">
  264. <el-button @click="clearScreen">清空筛选条件</el-button>
  265. </div>
  266. <div
  267. style="margin-left: auto; margin-right: 10px"
  268. v-if="rec_index_downLoad"
  269. >
  270. <el-button @click="downLoad">导出</el-button>
  271. </div>
  272. </div>
  273. </div>
  274. <!-- 表格 -->
  275. <div class="cen-tab">
  276. <el-table :data="tableData" stripe style="width: 100%">
  277. <el-table-column
  278. prop="staTime"
  279. label="接待开始时间"
  280. align="center"
  281. width="200"
  282. >
  283. </el-table-column>
  284. <el-table-column prop="agentName" label="顾问" align="center">
  285. </el-table-column>
  286. <el-table-column prop="name" label="客户" align="center">
  287. </el-table-column>
  288. <el-table-column prop="mm" label="录音时长" align="center">
  289. </el-table-column>
  290. <el-table-column prop="recording" label="录音类型" align="center">
  291. <template slot-scope="{ row }">
  292. {{
  293. row.recording == 0
  294. ? "没有录音"
  295. : row.recording == 1
  296. ? "部分录音"
  297. : "完整录音"
  298. }}
  299. </template>
  300. </el-table-column>
  301. <el-table-column prop="markAdvisor" label="标记顾问" align="center">
  302. <template slot-scope="{ row }">
  303. {{ row.markAdvisor == 0 ? "未标记" : "已标记" }}
  304. </template>
  305. </el-table-column>
  306. <el-table-column prop="total" label="语义词触达次数" align="center">
  307. </el-table-column>
  308. <el-table-column prop="fraction" label="执行率" align="center">
  309. <template slot-scope="{ row }"> {{ row.fraction || "0" }}% </template>
  310. </el-table-column>
  311. <!-- <el-table-column prop="address" label="禁忌执行率" align="center">
  312. </el-table-column> -->
  313. <!-- scope -->
  314. <el-table-column prop="taboo" label="是否违禁" align="center">
  315. <template slot-scope="{ row }">
  316. {{ row.taboo == 0 ? "否" : "是" }}
  317. </template>
  318. </el-table-column>
  319. <el-table-column prop="zfal" label="是否加精" align="center">
  320. <template slot-scope="{ row }">
  321. {{ row.zfal == 0 ? "已加精" : "未加精" }}
  322. </template>
  323. </el-table-column>
  324. <!-- <el-table-column prop="validInvalidName" label="是否有效" align="center"></el-table-column> -->
  325. <el-table-column label="操作" align="center" width="200" fixed="right">
  326. <template slot-scope="{ row }">
  327. <el-button
  328. type="text"
  329. v-if="rec_index_show"
  330. @click="Receivedetailsabout(row)"
  331. >查看</el-button
  332. >
  333. <!-- To Doing?按钮未添加权限判断 下一版本开发(删除) -->
  334. <!-- <el-button type="text" @click="deleteReceive(row)">删除</el-button> -->
  335. <!-- <el-button type="text" v-if="rec_index_text">下载文本</el-button>
  336. <el-button type="text" v-if="rec_index_voice">下载录音</el-button> -->
  337. </template>
  338. </el-table-column>
  339. </el-table>
  340. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  341. <el-pagination
  342. @size-change="handleSizeChange"
  343. @current-change="handleCurrentChange"
  344. :current-page="currentPage"
  345. :page-sizes="[10, 30, 50]"
  346. :page-size="size"
  347. layout="total, sizes, prev, pager, next, jumper"
  348. :total="total"
  349. >
  350. </el-pagination>
  351. </div>
  352. </div>
  353. </div>
  354. </template>
  355. <script>
  356. import { mapGetters } from "vuex";
  357. import { exportMethodPost } from "@/util/util";
  358. export default {
  359. data() {
  360. return {
  361. TimetoAhoose: 2,
  362. time: [],
  363. houseList: [],
  364. orgType: localStorage.getItem("orgType"),
  365. options: [],
  366. keywordsList: [],
  367. accountList: [],
  368. recordingList: [
  369. {
  370. value: "0",
  371. label: "没有录音",
  372. },
  373. {
  374. value: "1",
  375. label: "部分录音",
  376. },
  377. {
  378. value: "2",
  379. label: "完整录音",
  380. },
  381. ],
  382. options3: [
  383. {
  384. value: "1",
  385. label: "0-15分钟",
  386. },
  387. {
  388. value: "2",
  389. label: "15-30分钟",
  390. },
  391. {
  392. value: "3",
  393. label: "30-60分钟",
  394. },
  395. {
  396. value: "4",
  397. label: "60-90分钟",
  398. },
  399. {
  400. value: "5",
  401. label: "90分钟以上",
  402. },
  403. ],
  404. options4: [
  405. {
  406. value: "1",
  407. label: "首次到访",
  408. },
  409. {
  410. value: "2",
  411. label: "2次到访",
  412. },
  413. {
  414. value: "3",
  415. label: "3次到访",
  416. },
  417. {
  418. value: "4",
  419. label: "三次以上",
  420. },
  421. ],
  422. options5: [
  423. {
  424. value: "1",
  425. label: "已标记",
  426. },
  427. {
  428. value: "0",
  429. label: "未标记",
  430. },
  431. ],
  432. options11: [
  433. {
  434. value: "0",
  435. label: "否",
  436. },
  437. {
  438. value: "1",
  439. label: "是",
  440. },
  441. ],
  442. options12: [
  443. {
  444. value: "0",
  445. label: "已加精",
  446. },
  447. {
  448. value: "1",
  449. label: "未加精",
  450. },
  451. ],
  452. options13: [
  453. {
  454. label: "有效接待",
  455. value: "0",
  456. },
  457. {
  458. label: "无效接待",
  459. value: "1",
  460. },
  461. ],
  462. currentPage: 1,
  463. size: 10,
  464. total: 10,
  465. value: "",
  466. input: "",
  467. tableData: [],
  468. tophove: "",
  469. type: "0",
  470. searchForm: {
  471. name: "",
  472. keywordsId: [],
  473. recording: "",
  474. markAdvisor: null,
  475. recDurationInterval: "",
  476. visitRecord: "",
  477. staDate: "",
  478. endDate: "",
  479. houseType: "",
  480. dateType: null,
  481. projectId: "",
  482. taboo: "",
  483. zfal: "",
  484. validInvalid: "", // 是否为有效接待 0:有效 1:无效
  485. },
  486. rec_index_show: false, // 按钮权限
  487. rec_index_text: false, // 按钮权限
  488. rec_index_voice: false, // 按钮权限
  489. rec_index_downLoad: false, // 按钮权限
  490. };
  491. },
  492. computed: {
  493. ...mapGetters(["permissions"]),
  494. },
  495. created() {
  496. if (this.$route.query.types) {
  497. let arr = this.$route.query.types.split(",");
  498. this.searchForm[arr[0]] = arr[1];
  499. console.log(arr);
  500. }
  501. if (this.$route.query.date) {
  502. this.time = this.$route.query.date.split(",");
  503. this.searchForm.staDate = this.time[0];
  504. this.searchForm.endDate = this.time[1];
  505. console.log("时间");
  506. }
  507. this.rec_index_show = this.permissions["rec_index_show"];
  508. this.rec_index_text = this.permissions["rec_index_text"];
  509. this.rec_index_voice = this.permissions["rec_index_voice"];
  510. this.rec_index_downLoad = this.permissions["rec_index_downLoad"];
  511. },
  512. mounted() {
  513. // 获取项目列表
  514. this.zkhousePage();
  515. },
  516. methods: {
  517. // 清除上次进入遗留的数据
  518. resetParams() {
  519. this.searchForm.taboo = ''
  520. this.searchForm.validInvalid = ''
  521. this.searchForm.endDate = ''
  522. this.searchForm.staDate = ''
  523. this.time = ''
  524. },
  525. downLoad() {
  526. let obj = {
  527. type: 1,
  528. ...this.searchForm,
  529. };
  530. obj.keywordIds = obj.keywordsId.join(",");
  531. obj.dateType = this.searchForm.staDate ? null : this.searchForm.dateType;
  532. exportMethodPost("autoSR/customer/pageExport", "接待记录", obj);
  533. },
  534. // 跳转接待详情
  535. Receivedetailsabout(row) {
  536. this.$api.http.findByCusIdcusId({ cusId: row.id }).then((res) => {
  537. if (res.data.length == 0) {
  538. this.$message({
  539. message: "无录音",
  540. type: "warning",
  541. });
  542. } else {
  543. this.$router.push({
  544. path: "/Receive/index",
  545. query: { flag: row.id, AudioIdx: 0 },
  546. });
  547. }
  548. });
  549. },
  550. // 删除此条接待记录
  551. deleteReceive(row) {
  552. console.log(row);
  553. },
  554. // 接待记录列表
  555. findbypage() {
  556. let obj = {
  557. current: this.currentPage,
  558. size: this.size,
  559. type: 1,
  560. ...this.searchForm,
  561. };
  562. obj.keywordIds = obj.keywordsId.join(",");
  563. (obj.dateType = this.searchForm.staDate
  564. ? null
  565. : this.searchForm.dateType),
  566. this.$api.api.findbypage(obj).then((res) => {
  567. // console.log(res)
  568. this.tableData = res.data.records;
  569. this.total = res.data.total;
  570. });
  571. },
  572. clearScreen() {
  573. this.currentPage = 1;
  574. this.searchForm = {
  575. name: "",
  576. keywordsId: [],
  577. recording: "",
  578. markAdvisor: null,
  579. recDurationInterval: "",
  580. visitRecord: "",
  581. staDate: "",
  582. endDate: "",
  583. houseType: "",
  584. dateType: null,
  585. taboo: "",
  586. zfal: "",
  587. // projectId: this.houseList[0].id,
  588. projectId:
  589. this.orgType == 3
  590. ? localStorage.getItem("houseId")
  591. : this.houseList[0].id,
  592. };
  593. this.findbypage();
  594. },
  595. houseChange() {
  596. this.findbypage();
  597. this.findKeywords();
  598. // 获取置业顾问列表
  599. this.findUserListByHouseId();
  600. },
  601. timeChange(e) {
  602. if (!e) {
  603. this.searchForm.dateType = null;
  604. this.searchForm.staDate = "";
  605. this.searchForm.endDate = "";
  606. } else {
  607. console.log(e, "asdkasljdlksajl");
  608. this.searchForm.dateType = null;
  609. this.searchForm.staDate = e[0];
  610. this.searchForm.endDate = e[1];
  611. }
  612. this.houseChange();
  613. },
  614. screen() {
  615. this.currentPage = 1;
  616. console.log(this.searchForm);
  617. this.findbypage();
  618. },
  619. findKeywords() {
  620. this.$api.api
  621. .findKeywords({
  622. dateType: this.searchForm.staDate ? null : this.searchForm.dateType,
  623. statDateStart: this.searchForm.staDate,
  624. statDateEnd: this.searchForm.endDate,
  625. projectId: this.searchForm.projectId,
  626. type: this.type,
  627. })
  628. .then((res) => {
  629. console.log(res);
  630. this.keywordsList = res.data;
  631. });
  632. },
  633. zkhousePage() {
  634. this.$api.api
  635. .findHouseByUser({
  636. orgType: localStorage.getItem("orgType"),
  637. })
  638. .then((res) => {
  639. // console.log(res)
  640. this.houseList = res.data;
  641. if (localStorage.getItem("orgType") == 3) {
  642. this.searchForm.projectId = localStorage.getItem("houseId");
  643. } else {
  644. this.searchForm.projectId = res.data[0].id;
  645. }
  646. this.houseChange();
  647. });
  648. },
  649. // 置业顾问列表
  650. async findUserListByHouseId() {
  651. let result = await this.$api.api.findUserListByHouseId({
  652. orgType: localStorage.getItem("orgType"),
  653. projectId: this.searchForm.projectId,
  654. });
  655. console.log(result);
  656. this.accountList = result.data;
  657. },
  658. handleSizeChange(val) {
  659. console.log(`每页 ${val} 条`);
  660. this.size = val;
  661. this.findbypage();
  662. },
  663. handleCurrentChange(val) {
  664. console.log(`当前页: ${val}`);
  665. this.currentPage = val;
  666. this.findbypage();
  667. },
  668. tabtimetap(idx) {
  669. this.searchForm.staDate = "";
  670. this.searchForm.endDate = "";
  671. // this.$set(this, "time", null);
  672. this.searchForm.dateType = idx;
  673. this.time = []
  674. this.houseChange();
  675. },
  676. timestampToTime(timestamp) {
  677. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  678. // var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  679. var yyyy = date.getFullYear() + "-";
  680. var MM =
  681. (date.getMonth() + 1 < 10
  682. ? "0" + (date.getMonth() + 1)
  683. : date.getMonth() + 1) + "-";
  684. // var dd = date.getDate() + ' ';
  685. var dd =
  686. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  687. return yyyy + MM + dd;
  688. },
  689. },
  690. watch: {
  691. $route(to, from) {
  692. this.resetParams()
  693. //监听路由是否变化
  694. if (to.query.types != from.query.types && to.query.types != null) {
  695. let arr = this.$route.query.types.split(",");
  696. this.searchForm[arr[0]] = arr[1];
  697. }
  698. if (to.query.date != from.query.date && to.query.date != null) {
  699. this.time = this.$route.query.date.split(",");
  700. this.searchForm.staDate = this.time[0];
  701. this.searchForm.endDate = this.time[1];
  702. }
  703. },
  704. },
  705. };
  706. </script>
  707. <style scoped="scoped" lang="scss" >
  708. .box-center {
  709. width: 100%;
  710. padding: 15px;
  711. min-width: 1000px;
  712. padding-bottom: 100px;
  713. }
  714. .cen-tab {
  715. width: 100%;
  716. padding: 15px;
  717. background: #ffffff;
  718. margin-top: 15px;
  719. }
  720. .tophove {
  721. color: #ffffff;
  722. background: #2671e2;
  723. }
  724. .app-top {
  725. width: 100%;
  726. background: #ffffff;
  727. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  728. border-radius: 4px;
  729. padding-top: 15px;
  730. padding-bottom: 15px;
  731. .app-titel {
  732. width: 100%;
  733. display: flex;
  734. align-items: center;
  735. flex-wrap: wrap;
  736. .label {
  737. font-size: 14px;
  738. font-weight: 400;
  739. color: #32363d;
  740. line-height: 32px;
  741. margin-left: 15px;
  742. min-width: 100px;
  743. text-align: right;
  744. }
  745. .toptimeqhuan {
  746. height: 30px;
  747. background: #ffffff;
  748. display: flex;
  749. align-items: center;
  750. }
  751. .toptimeqhuan div {
  752. padding-left: 20px;
  753. padding-right: 20px;
  754. text-align: center;
  755. line-height: 30px;
  756. font-size: 14px;
  757. margin-right: 15px;
  758. border-radius: 4px;
  759. border: 1px solid #e0e0e0;
  760. }
  761. .toptimeqhuan .btn {
  762. padding-left: 20px;
  763. padding-right: 20px;
  764. text-align: center;
  765. // line-height: 30px;
  766. font-size: 14px;
  767. margin-right: 15px;
  768. border-radius: 4px;
  769. border: 1px solid #e0e0e0;
  770. }
  771. }
  772. }
  773. .div-lab {
  774. display: flex;
  775. margin: 5px;
  776. }
  777. .div-inp {
  778. width: 250px;
  779. }
  780. </style>