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.
 
 
 

808 line
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 label="操作" align="center" width="200" fixed="right">
  325. <template slot-scope="{ row }">
  326. <el-button
  327. type="text"
  328. v-if="rec_index_show"
  329. @click="Receivedetailsabout(row)"
  330. >查看</el-button
  331. >
  332. <!-- To Doing?按钮未添加权限判断 下一版本开发(删除) -->
  333. <!-- <el-button type="text" @click="deleteReceive(row)">删除</el-button> -->
  334. <!-- <el-button type="text" v-if="rec_index_text">下载文本</el-button>
  335. <el-button type="text" v-if="rec_index_voice">下载录音</el-button> -->
  336. </template>
  337. </el-table-column>
  338. </el-table>
  339. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  340. <el-pagination
  341. @size-change="handleSizeChange"
  342. @current-change="handleCurrentChange"
  343. :current-page="currentPage"
  344. :page-sizes="[10, 30, 50]"
  345. :page-size="size"
  346. layout="total, sizes, prev, pager, next, jumper"
  347. :total="total"
  348. >
  349. </el-pagination>
  350. </div>
  351. </div>
  352. </div>
  353. </template>
  354. <script>
  355. import { mapGetters } from "vuex";
  356. import { exportMethodPost } from "@/util/util";
  357. export default {
  358. data() {
  359. return {
  360. TimetoAhoose: 2,
  361. time: [],
  362. houseList: [],
  363. orgType: localStorage.getItem("orgType"),
  364. options: [],
  365. keywordsList: [],
  366. accountList: [],
  367. recordingList: [
  368. {
  369. value: "0",
  370. label: "没有录音",
  371. },
  372. {
  373. value: "1",
  374. label: "部分录音",
  375. },
  376. {
  377. value: "2",
  378. label: "完整录音",
  379. },
  380. ],
  381. options3: [
  382. {
  383. value: "1",
  384. label: "0-15分钟",
  385. },
  386. {
  387. value: "2",
  388. label: "15-30分钟",
  389. },
  390. {
  391. value: "3",
  392. label: "30-60分钟",
  393. },
  394. {
  395. value: "4",
  396. label: "60-90分钟",
  397. },
  398. {
  399. value: "5",
  400. label: "90分钟以上",
  401. },
  402. ],
  403. options4: [
  404. {
  405. value: "1",
  406. label: "首次到访",
  407. },
  408. {
  409. value: "2",
  410. label: "2次到访",
  411. },
  412. {
  413. value: "3",
  414. label: "3次到访",
  415. },
  416. {
  417. value: "4",
  418. label: "三次以上",
  419. },
  420. ],
  421. options5: [
  422. {
  423. value: "1",
  424. label: "已标记",
  425. },
  426. {
  427. value: "0",
  428. label: "未标记",
  429. },
  430. ],
  431. options11: [
  432. {
  433. value: "0",
  434. label: "否",
  435. },
  436. {
  437. value: "1",
  438. label: "是",
  439. },
  440. ],
  441. options12: [
  442. {
  443. value: "0",
  444. label: "已加精",
  445. },
  446. {
  447. value: "1",
  448. label: "未加精",
  449. },
  450. ],
  451. options13: [
  452. {
  453. label: "有效接待",
  454. value: "0",
  455. },
  456. {
  457. label: "无效接待",
  458. value: "1",
  459. },
  460. ],
  461. currentPage: 1,
  462. size: 10,
  463. total: 10,
  464. value: "",
  465. input: "",
  466. tableData: [],
  467. tophove: "",
  468. type: "0",
  469. searchForm: {
  470. name: "",
  471. keywordsId: [],
  472. recording: "",
  473. markAdvisor: null,
  474. recDurationInterval: "",
  475. visitRecord: "",
  476. staDate: "",
  477. endDate: "",
  478. houseType: "",
  479. dateType: null,
  480. projectId: "",
  481. taboo: "",
  482. zfal: "",
  483. validInvalid: "", // 是否为有效接待 0:有效 1:无效
  484. },
  485. rec_index_show: false, // 按钮权限
  486. rec_index_text: false, // 按钮权限
  487. rec_index_voice: false, // 按钮权限
  488. rec_index_downLoad: false, // 按钮权限
  489. };
  490. },
  491. computed: {
  492. ...mapGetters(["permissions"]),
  493. },
  494. created() {
  495. if (this.$route.query.types) {
  496. let arr = this.$route.query.types.split(",");
  497. this.searchForm[arr[0]] = arr[1];
  498. console.log(arr);
  499. }
  500. if (this.$route.query.date) {
  501. this.time = this.$route.query.date.split(",");
  502. this.searchForm.staDate = this.time[0];
  503. this.searchForm.endDate = this.time[1];
  504. console.log("时间");
  505. }
  506. this.rec_index_show = this.permissions["rec_index_show"];
  507. this.rec_index_text = this.permissions["rec_index_text"];
  508. this.rec_index_voice = this.permissions["rec_index_voice"];
  509. this.rec_index_downLoad = this.permissions["rec_index_downLoad"];
  510. },
  511. mounted() {
  512. // 获取楼盘列表
  513. this.zkhousePage();
  514. },
  515. methods: {
  516. // 清除上次进入遗留的数据
  517. resetParams() {
  518. this.searchForm.taboo = ''
  519. this.searchForm.validInvalid = ''
  520. this.searchForm.endDate = ''
  521. this.searchForm.staDate = ''
  522. this.time = ''
  523. },
  524. downLoad() {
  525. let obj = {
  526. type: 1,
  527. ...this.searchForm,
  528. };
  529. obj.keywordIds = obj.keywordsId.join(",");
  530. obj.dateType = this.searchForm.staDate ? null : this.searchForm.dateType;
  531. exportMethodPost("autoSR/customer/pageExport", "接待记录", obj);
  532. },
  533. // 跳转接待详情
  534. Receivedetailsabout(row) {
  535. this.$api.http.findByCusIdcusId({ cusId: row.id }).then((res) => {
  536. if (res.data.length == 0) {
  537. this.$message({
  538. message: "无录音",
  539. type: "warning",
  540. });
  541. } else {
  542. this.$router.push({
  543. path: "/Receive/index",
  544. query: { flag: row.id, AudioIdx: 0 },
  545. });
  546. }
  547. });
  548. },
  549. // 删除此条接待记录
  550. deleteReceive(row) {
  551. console.log(row);
  552. },
  553. // 接待记录列表
  554. findbypage() {
  555. let obj = {
  556. current: this.currentPage,
  557. size: this.size,
  558. type: 1,
  559. ...this.searchForm,
  560. };
  561. obj.keywordIds = obj.keywordsId.join(",");
  562. (obj.dateType = this.searchForm.staDate
  563. ? null
  564. : this.searchForm.dateType),
  565. this.$api.api.findbypage(obj).then((res) => {
  566. // console.log(res)
  567. this.tableData = res.data.records;
  568. this.total = res.data.total;
  569. });
  570. },
  571. clearScreen() {
  572. this.currentPage = 1;
  573. this.searchForm = {
  574. name: "",
  575. keywordsId: [],
  576. recording: "",
  577. markAdvisor: null,
  578. recDurationInterval: "",
  579. visitRecord: "",
  580. staDate: "",
  581. endDate: "",
  582. houseType: "",
  583. dateType: null,
  584. taboo: "",
  585. zfal: "",
  586. // projectId: this.houseList[0].id,
  587. projectId:
  588. this.orgType == 3
  589. ? localStorage.getItem("houseId")
  590. : this.houseList[0].id,
  591. };
  592. this.findbypage();
  593. },
  594. houseChange() {
  595. this.findbypage();
  596. this.findKeywords();
  597. // 获取置业顾问列表
  598. this.findUserListByHouseId();
  599. },
  600. timeChange(e) {
  601. if (!e) {
  602. this.searchForm.dateType = null;
  603. this.searchForm.staDate = "";
  604. this.searchForm.endDate = "";
  605. } else {
  606. console.log(e, "asdkasljdlksajl");
  607. this.searchForm.dateType = null;
  608. this.searchForm.staDate = e[0];
  609. this.searchForm.endDate = e[1];
  610. }
  611. this.houseChange();
  612. },
  613. screen() {
  614. this.currentPage = 1;
  615. console.log(this.searchForm);
  616. this.findbypage();
  617. },
  618. findKeywords() {
  619. this.$api.api
  620. .findKeywords({
  621. dateType: this.searchForm.staDate ? null : this.searchForm.dateType,
  622. statDateStart: this.searchForm.staDate,
  623. statDateEnd: this.searchForm.endDate,
  624. projectId: this.searchForm.projectId,
  625. type: this.type,
  626. })
  627. .then((res) => {
  628. console.log(res);
  629. this.keywordsList = res.data;
  630. });
  631. },
  632. zkhousePage() {
  633. this.$api.api
  634. .findHouseByUser({
  635. orgType: localStorage.getItem("orgType"),
  636. })
  637. .then((res) => {
  638. // console.log(res)
  639. this.houseList = res.data;
  640. if (localStorage.getItem("orgType") == 3) {
  641. this.searchForm.projectId = localStorage.getItem("houseId");
  642. } else {
  643. this.searchForm.projectId = res.data[0].id;
  644. }
  645. this.houseChange();
  646. });
  647. },
  648. // 置业顾问列表
  649. async findUserListByHouseId() {
  650. let result = await this.$api.api.findUserListByHouseId({
  651. orgType: localStorage.getItem("orgType"),
  652. projectId: this.searchForm.projectId,
  653. });
  654. console.log(result);
  655. this.accountList = result.data;
  656. },
  657. handleSizeChange(val) {
  658. console.log(`每页 ${val} 条`);
  659. this.size = val;
  660. this.findbypage();
  661. },
  662. handleCurrentChange(val) {
  663. console.log(`当前页: ${val}`);
  664. this.currentPage = val;
  665. this.findbypage();
  666. },
  667. tabtimetap(idx) {
  668. this.searchForm.staDate = "";
  669. this.searchForm.endDate = "";
  670. // this.$set(this, "time", null);
  671. this.searchForm.dateType = idx;
  672. this.houseChange();
  673. },
  674. timestampToTime(timestamp) {
  675. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  676. // var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  677. var yyyy = date.getFullYear() + "-";
  678. var MM =
  679. (date.getMonth() + 1 < 10
  680. ? "0" + (date.getMonth() + 1)
  681. : date.getMonth() + 1) + "-";
  682. // var dd = date.getDate() + ' ';
  683. var dd =
  684. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  685. return yyyy + MM + dd;
  686. },
  687. },
  688. watch: {
  689. $route(to, from) {
  690. this.resetParams()
  691. //监听路由是否变化
  692. if (to.query.types != from.query.types && to.query.types != null) {
  693. let arr = this.$route.query.types.split(",");
  694. this.searchForm[arr[0]] = arr[1];
  695. }
  696. if (to.query.date != from.query.date && to.query.date != null) {
  697. this.time = this.$route.query.date.split(",");
  698. this.searchForm.staDate = this.time[0];
  699. this.searchForm.endDate = this.time[1];
  700. }
  701. },
  702. },
  703. };
  704. </script>
  705. <style scoped="scoped" lang="scss" >
  706. .box-center {
  707. width: 100%;
  708. padding: 15px;
  709. min-width: 1000px;
  710. padding-bottom: 100px;
  711. }
  712. .cen-tab {
  713. width: 100%;
  714. padding: 15px;
  715. background: #ffffff;
  716. margin-top: 15px;
  717. }
  718. .tophove {
  719. color: #ffffff;
  720. background: #2671e2;
  721. }
  722. .app-top {
  723. width: 100%;
  724. background: #ffffff;
  725. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  726. border-radius: 4px;
  727. padding-top: 15px;
  728. padding-bottom: 15px;
  729. .app-titel {
  730. width: 100%;
  731. display: flex;
  732. align-items: center;
  733. flex-wrap: wrap;
  734. .label {
  735. font-size: 14px;
  736. font-weight: 400;
  737. color: #32363d;
  738. line-height: 32px;
  739. margin-left: 15px;
  740. min-width: 100px;
  741. text-align: right;
  742. }
  743. .toptimeqhuan {
  744. height: 30px;
  745. background: #ffffff;
  746. display: flex;
  747. align-items: center;
  748. }
  749. .toptimeqhuan div {
  750. padding-left: 20px;
  751. padding-right: 20px;
  752. text-align: center;
  753. line-height: 30px;
  754. font-size: 14px;
  755. margin-right: 15px;
  756. border-radius: 4px;
  757. border: 1px solid #e0e0e0;
  758. }
  759. .toptimeqhuan .btn {
  760. padding-left: 20px;
  761. padding-right: 20px;
  762. text-align: center;
  763. // line-height: 30px;
  764. font-size: 14px;
  765. margin-right: 15px;
  766. border-radius: 4px;
  767. border: 1px solid #e0e0e0;
  768. }
  769. }
  770. }
  771. .div-lab {
  772. display: flex;
  773. margin: 5px;
  774. }
  775. .div-inp {
  776. width: 250px;
  777. }
  778. </style>