AI销管
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

customer.vue 16 KiB

há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
há 2 anos
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <template>
  2. <view class="cented-box">
  3. <view v-if="waitCustomList.length==0" class="empty">
  4. <view style="width: 100%;display: flex;
  5. flex-direction: column;justify-content: center;align-items: center;">
  6. <view style="width: 100%;text-align: center;">
  7. <image style="width: 220rpx;height: 200rpx;"
  8. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  9. </view>
  10. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  11. </view>
  12. </view>
  13. <!-- <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  14. @click="tapThevisiting(item)">
  15. <view class="title">
  16. <view class="zuo">
  17. <view class="zuoimg">A</view>
  18. <view class="zuoname">{{item.name}}</view>
  19. </view>
  20. <view class="you">
  21. <view class="youimg1" v-if="item.status!=0"></view>
  22. <view class="youimg1-1" v-if="item.status==0"></view>
  23. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view>
  24. </view>
  25. </view>
  26. <view class="centerbox" v-if="item.status!=0">
  27. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  28. <view class="centerbox-che">开始时间:<text class="shizai">{{item.createTime}}</text></view>
  29. <view class="centerbox-che">顾问姓名:<text class="shizai" style="color: #333333;">{{item.agentName}}</text>
  30. </view>
  31. <view class="centerbox-che2" v-if="item.status==1">
  32. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==0">设备状态:<text
  33. class="shizai" style="color: red;">离线</text></view>
  34. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine!=0">工牌电量:<text
  35. class="shizai" style="color: #333333;">{{item.zkEquipmentState.electricity}}%</text></view>
  36. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==1">录音状态:
  37. <text v-if="item.zkEquipmentState.simAudioStatus=='true'" class="shizai"
  38. style="color: #333333;">使用中</text>
  39. <text v-if="item.zkEquipmentState.simAudioStatus=='false'" class="shizai"
  40. style="color: #333333;">未使用</text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="footer-button" v-if="item.status!=0">
  45. <view v-if="permissions.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  46. <view v-if="permissions.commonly4" class="footer1" @click.stop="assign(item)">重新指派</view>
  47. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  48. </view>
  49. <view class="centerbox" v-if="item.status==0">
  50. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  51. </view>
  52. <view class="footer-button" v-if="item.status==0">
  53. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  54. </view>
  55. </view> -->
  56. <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  57. @click="tapThevisiting(item)">
  58. <view class="title">
  59. <view class="zuo">
  60. <view class="zuoimg">顾</view>
  61. <view class="zuoname">{{item.agentName || '--'}}</view>
  62. </view>
  63. <view class="cen" v-if="timestamp(item.assignedTime) < 60*30">
  64. <view v-if="item.status!=0">
  65. 自动结束 <u-count-down :timestamp="timestamp(item.assignedTime)" color="#E7483C"></u-count-down>
  66. </view>
  67. </view>
  68. <view class="you">
  69. <!-- <view class="youimg1" v-if="item.status!=0"></view>
  70. <view class="youimg1-1" v-if="item.status==0"></view>
  71. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view> -->
  72. <view class="" v-if="item.status!=0" style="display: flex;">
  73. <block v-if="item.imei!=null">
  74. <!-- 接待中 -->
  75. <view class="">
  76. <!-- 工牌标示 -->
  77. <!-- <image class="you-img" src="../../static/images/cus1.png" mode=""></image> -->
  78. </view>
  79. <!-- 未离线 -->
  80. <view class="" v-if="item.zkEquipmentState.onLine!=0" style="display: flex;">
  81. <view class="">
  82. <!-- 电量 -->
  83. <image v-if="item.zkEquipmentState.electricity>=20" class="you-img"
  84. src="../../static/images/cus2.png" mode=""></image>
  85. <image v-else class="you-img" src="../../static/images/cus5.png" mode=""></image>
  86. </view>
  87. <view class="">
  88. <!-- 录音 -->
  89. <image v-if="item.zkEquipmentState.simAudioStatus=='true'" class="you-img"
  90. src="../../static/images/cus3.png" mode=""></image>
  91. <image v-else class="you-img" src="../../static/images/cus6.png" mode=""></image>
  92. </view>
  93. </view>
  94. <!-- 离线 -->
  95. <view class="" v-else>
  96. <view class="">
  97. <!-- 录音 -->
  98. <image class="you-img" src="../../static/images/cus4.png" mode=""></image>
  99. </view>
  100. </view>
  101. </block>
  102. </view>
  103. <view class="youtext" v-else>
  104. <!--排队中 -->
  105. 排队中
  106. </view>
  107. </view>
  108. </view>
  109. <view class="centerbox">
  110. <view class="content-sec">
  111. <view class="left">
  112. <view class="adviser">客</view>
  113. <view class="cus">{{item.name || '--'}}</view>
  114. <view class="arriveNum">{{ item.phone || '--' }}</view>
  115. </view>
  116. </view>
  117. <view class="content-last">
  118. <view class="c-items">
  119. <image src="../../static/images/people.png" class="c-items-img" mode=""></image>
  120. {{ item.visitRecord || "0" }}次到访
  121. </view>
  122. <view class="c-items">
  123. <image src="../../static/images/time.png" class="c-items-img" mode=""></image>
  124. {{ item.createTime }}
  125. </view>
  126. <!-- <view class="c-items">
  127. <image src="../../static/images/voice.png" class="c-items-img" mode=""></image>
  128. {{ item.mm || '0' }}min
  129. </view> -->
  130. </view>
  131. </view>
  132. <view class="footer-button" v-if="item.status!=0">
  133. <view v-if="permissions.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  134. <view v-if="permissions.commonly4" class="footer1" @click.stop="assign(item)">重新指派</view>
  135. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  136. </view>
  137. <view class="footer-button" v-if="item.status==0">
  138. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  139. </view>
  140. </view>
  141. <image v-if="permissions.commonly2" @click="addreception()" class="add" src="/static/images/add.png" mode="">
  142. </image>
  143. <image class="add2" @click="reshCustom()" src="https://static.quhouse.com/zhikong_xcx_img/refresh.png" mode="">
  144. </image>
  145. </view>
  146. </template>
  147. <script>
  148. import tabbarList from '@/utils/tabbar.js'
  149. export default {
  150. data() {
  151. return {
  152. noClick:true,
  153. // tabbar配置项
  154. current: 0,
  155. tabbarList: tabbarList,
  156. //--- end --- tabbar配置项
  157. buildingID: '',
  158. waitCustomList: [],
  159. isAdd: '',
  160. dataCode: '',
  161. addAccount: '',
  162. permissions: {
  163. commonly1: false, //查看
  164. commonly2: false, //添加
  165. commonly3: false, //指派
  166. commonly4: false,
  167. commonly5: false,
  168. },
  169. };
  170. },
  171. computed: {
  172. timestamp() {
  173. return (e) => {
  174. if (!e) return
  175. let totalTime = new Date(e).getTime() / 1000 + 60 * 60 * 2
  176. let nowTime = new Date().getTime() / 1000
  177. return totalTime - nowTime
  178. }
  179. }
  180. // judgeHalfAnHour(){
  181. // return (e)=>{
  182. // }
  183. // }
  184. },
  185. onShow() {
  186. this.buildingID = uni.getStorageSync('buildingID').id;
  187. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  188. this.permissions.commonly1 = newmenulist.jd_ck;
  189. this.permissions.commonly2 = newmenulist.jd_xz;
  190. this.permissions.commonly3 = newmenulist.jd_zp;
  191. this.permissions.commonly4 = newmenulist.jdys;
  192. this.permissions.commonly5 = newmenulist.jsjd;
  193. const {
  194. addAccount,
  195. dataCode
  196. } = uni.getStorageSync("weapp_session_userInfo_data");
  197. this.addAccount = addAccount;
  198. this.dataCode = dataCode;
  199. this.init()
  200. this.queryHaveDept()
  201. },
  202. onPullDownRefresh(){
  203. this.init()
  204. setTimeout(function () {
  205. uni.stopPullDownRefresh();
  206. }, 1000);
  207. },
  208. methods: {
  209. reshCustom() {
  210. this.init()
  211. },
  212. tapThevisiting(item) {
  213. if (this.permissions.commonly1 != true) {
  214. return
  215. }
  216. uni.showLoading({
  217. title: '加载中',
  218. mask: true
  219. });
  220. if (item.status == 0) {
  221. setTimeout(function() {
  222. uni.hideLoading();
  223. }, 2000);
  224. uni.showToast({
  225. icon: "none",
  226. title: "排队中"
  227. })
  228. return
  229. } else {
  230. const parames = {
  231. pageNum: 1,
  232. pageSize: 100,
  233. query: {
  234. customerId: item.id,
  235. }
  236. }
  237. var itemsd = {
  238. bg: 0,
  239. customerId: item.id,
  240. id: '',
  241. onebest: ''
  242. }
  243. this.$u.post("/corpus/findByPage", parames).then(res => {
  244. setTimeout(function() {
  245. uni.hideLoading();
  246. }, 2000);
  247. if (res) {
  248. let newobj = res[0];
  249. uni.navigateTo({
  250. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  251. })
  252. } else {
  253. uni.showToast({
  254. icon: "none",
  255. title: "暂无音频"
  256. })
  257. return
  258. }
  259. })
  260. }
  261. },
  262. queryHaveDept() {
  263. return new Promise((resolve, reject) => {
  264. this.$u.get("/user/queryHaveDept?houseId=" + this.buildingID).then(res => {
  265. this.isAdd = res;
  266. resolve();
  267. })
  268. })
  269. },
  270. init() {
  271. this.waitCustomList = []
  272. let parames = {
  273. itemId: this.buildingID
  274. }
  275. this.$u.post("/customer/reception", parames).then(data => {
  276. this.waitCustomList = data;
  277. });
  278. },
  279. //延时接待
  280. addTime(item) {
  281. uni.showModal({
  282. content: "确定延长半小时接待时间?",
  283. cancelColor: "#999999",
  284. success: res => {
  285. if (res.confirm) {
  286. this.$u.post("/customer/delayed", {
  287. cusId: item.id
  288. }).then(res => {
  289. uni.showToast({
  290. icon: "none",
  291. title: "操作成功"
  292. })
  293. });
  294. }
  295. }
  296. })
  297. },
  298. //结束接待
  299. changeEnd(id) {
  300. uni.showModal({
  301. content: "确定更改当前客户接待状态为结束?",
  302. cancelColor: "#999999",
  303. success: res => {
  304. if (this.noClick) {
  305. this.noClick= false;
  306. if (res.confirm) {
  307. this.$u.post("/customer/endReception", {
  308. id: id,
  309. houseId: this.buildingID
  310. }).then(res => {
  311. uni.showToast({
  312. icon: "none",
  313. title: "操作成功"
  314. })
  315. this.init();
  316. });
  317. }
  318. setTimeout(()=> {
  319. this.noClick= true;
  320. }, 2000)
  321. } else {
  322. // 这里是重复点击的判断
  323. }
  324. }
  325. })
  326. },
  327. //新增接待
  328. addreception() {
  329. const {
  330. dataCode,
  331. addAccount
  332. } = uni.getStorageSync("weapp_session_userInfo_data");
  333. if (dataCode == 6) {
  334. // if (addAccount != 0) {
  335. // uni.showToast({
  336. // title: '不允许自建客户!',
  337. // duration: 2000
  338. // });
  339. // return
  340. // }
  341. if (this.waitCustomList.length == 0) {
  342. uni.navigateTo({
  343. url: '/pages/mine/reception/addreception'
  344. })
  345. return
  346. } else {
  347. for (var i = 0; i < this.waitCustomList.length; i++) {
  348. if (this.waitCustomList[i].status == 1) {
  349. uni.showLoading({
  350. title: '当前还有未完成的客户项'
  351. });
  352. setTimeout(function() {
  353. uni.hideLoading();
  354. }, 1000);
  355. return
  356. } else {
  357. uni.navigateTo({
  358. url: '/pages/mine/reception/addreception'
  359. })
  360. return
  361. }
  362. }
  363. }
  364. } else {
  365. uni.navigateTo({
  366. url: '/pages/mine/reception/addreception'
  367. });
  368. }
  369. },
  370. assign(item) {
  371. let url = `/pages/mine/reception/consultant?id=${item.id}`
  372. if (item.beforeAgentId) {
  373. url += `&beforeAgentId=${item.beforeAgentId}`;
  374. }
  375. uni.navigateTo({
  376. url: url
  377. })
  378. },
  379. },
  380. };
  381. </script>
  382. <style lang="scss" scoped>
  383. .cented-box {
  384. background: #F8F8F8;
  385. width: 100%;
  386. min-height: calc(100vh - var(--window-bottom) - var(--window-top));
  387. padding-bottom: 30rpx;
  388. display: flex;
  389. flex-direction: column;
  390. .empty {
  391. flex-grow: 1;
  392. display: flex;
  393. align-items: center;
  394. }
  395. }
  396. .customer {
  397. margin-top: 30rpx;
  398. width: 100%;
  399. background: #FFFFFF;
  400. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  401. .title {
  402. height: 90rpx;
  403. border-bottom: 1px solid #E0E0E0;
  404. display: flex;
  405. align-items: center;
  406. justify-content: space-between;
  407. .zuo {
  408. // width: 25%;
  409. height: 100%;
  410. display: flex;
  411. align-items: center;
  412. .zuoimg {
  413. width: 52rpx;
  414. height: 52rpx;
  415. border-radius: 50%;
  416. // border: 1px solid #C9C9C9;
  417. border: 1px solid #2671E2;
  418. font-size: 30rpx;
  419. color: #2671E2;
  420. font-weight: 400;
  421. line-height: 48rpx;
  422. text-align: center;
  423. margin-left: 30rpx;
  424. }
  425. .zuoname {
  426. font-size: 30rpx;
  427. font-weight: bold;
  428. color: #333333;
  429. line-height: 30rpx;
  430. margin-left: 20rpx;
  431. }
  432. }
  433. .cen {
  434. // width:50%;
  435. color: #E7483C;
  436. text-align: center;
  437. }
  438. .you {
  439. // width: 25%;
  440. height: 100%;
  441. display: flex;
  442. align-items: center;
  443. margin-right: 30rpx;
  444. .youimg1 {
  445. width: 12rpx;
  446. height: 12rpx;
  447. border-radius: 50%;
  448. background: #2B6EFF;
  449. }
  450. .you-img {
  451. width: 24rpx;
  452. height: 32rpx;
  453. margin-left: 24rpx;
  454. }
  455. .youimg1-1 {
  456. width: 12rpx;
  457. height: 12rpx;
  458. border-radius: 50%;
  459. background: #F2A269;
  460. }
  461. .youtext {
  462. font-size: 30rpx;
  463. font-weight: 400;
  464. color: #292929;
  465. line-height: 30rpx;
  466. margin-left: 10rpx;
  467. }
  468. }
  469. }
  470. .centerbox {
  471. .centerbox-che {
  472. width: 100%;
  473. margin-top: 30rpx;
  474. height: 30rpx;
  475. font-size: 30rpx;
  476. font-weight: 400;
  477. color: #666666;
  478. line-height: 30rpx;
  479. text-indent: 30rpx;
  480. .shizai {
  481. color: #333333;
  482. }
  483. }
  484. .centerbox-che2 {
  485. width: 100%;
  486. margin-top: 30rpx;
  487. height: 30rpx;
  488. font-size: 30rpx;
  489. font-weight: 400;
  490. color: #666666;
  491. line-height: 30rpx;
  492. text-indent: 30rpx;
  493. display: flex;
  494. .Workcard {
  495. width: 50%;
  496. }
  497. }
  498. }
  499. .footer-button {
  500. // margin-top: 30rpx;
  501. width: 100%;
  502. height: 108rpx;
  503. display: flex;
  504. font-size: 30rpx;
  505. font-weight: 400;
  506. color: #333333;
  507. border-top: 1rpx solid #E0E0E0;
  508. justify-content: flex-end;
  509. line-height: 58rpx;
  510. .footer1 {
  511. // flex: 1;
  512. text-align: center;
  513. margin-top: 24rpx;
  514. // line-height: 90rpx;
  515. // border-right: 1rpx solid #E0E0E0;
  516. width: 156rpx;
  517. height: 60rpx;
  518. background: #FFFFFF;
  519. border-radius: 30rpx;
  520. border: 1px solid #999999;
  521. margin-left: 30rpx;
  522. }
  523. .footer3 {
  524. // flex: 1;
  525. text-align: center;
  526. margin-top: 24rpx;
  527. // line-height: 90rpx;
  528. width: 156rpx;
  529. height: 60rpx;
  530. background: #FFFFFF;
  531. border-radius: 30rpx;
  532. border: 1px solid #999999;
  533. margin-left: 30rpx;
  534. margin-right: 30rpx;
  535. }
  536. }
  537. }
  538. .add {
  539. width: 90rpx;
  540. height: 90rpx;
  541. position: fixed;
  542. bottom: 270rpx;
  543. right: 44rpx;
  544. }
  545. .add2 {
  546. width: 90rpx;
  547. height: 90rpx;
  548. position: fixed;
  549. bottom: 150rpx;
  550. right: 44rpx;
  551. }
  552. .content-sec {
  553. padding: 28rpx 30rpx 32rpx;
  554. width: 100%;
  555. display: flex;
  556. justify-content: space-between;
  557. .left {
  558. flex-shrink: 0;
  559. width: 100%;
  560. display: flex;
  561. align-items: center;
  562. .adviser {
  563. flex-shrink: 0;
  564. margin-right: 10rpx;
  565. padding: 5rpx 11rpx;
  566. border-radius: 50%;
  567. border: 1rpx solid #2671E2;
  568. background: #2671E2;
  569. font-size: 30rpx;
  570. color: #fff;
  571. }
  572. .cus {
  573. font-size: 30rpx;
  574. font-weight: 400;
  575. color: #666666;
  576. overflow: hidden;/*超出部分隐藏*/
  577. text-overflow:ellipsis;/* 超出部分显示省略号 */
  578. white-space: nowrap;/*规定段落中的文本不进行换行 */
  579. }
  580. .arriveNum {
  581. flex-shrink: 0;
  582. font-size: 30rpx;
  583. font-weight: 400;
  584. margin-left: 10rpx;
  585. }
  586. }
  587. .right {
  588. flex-shrink: 0;
  589. font-size: 28rpx;
  590. font-weight: 400;
  591. color: #2671E2;
  592. display: flex;
  593. align-items: center;
  594. .img {
  595. margin-right: 10rpx;
  596. width: 32rpx;
  597. height: 32rpx;
  598. }
  599. }
  600. }
  601. .content-last {
  602. padding: 0 30rpx 34rpx;
  603. font-size: 30rpx;
  604. font-weight: 400;
  605. color: #666666;
  606. display: flex;
  607. align-items: center;
  608. justify-content: space-between;
  609. .c-items {
  610. flex-shrink: 0;
  611. display: flex;
  612. align-items: center;
  613. font-size: 28rpx;
  614. .c-items-img {
  615. margin-right: 10rpx;
  616. width: 32rpx;
  617. height: 32rpx;
  618. }
  619. }
  620. }
  621. </style>