AI销管
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.

customer.vue 17 KiB

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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. <!-- 底部导航栏 -->
  146. <!-- <u-tabbar :mid-button="true" activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList">
  147. </u-tabbar> -->
  148. </view>
  149. </template>
  150. <script>
  151. import tabbarList from '@/utils/tabbar.js'
  152. export default {
  153. data() {
  154. return {
  155. noClick:true,
  156. // tabbar配置项
  157. current: 0,
  158. tabbarList: tabbarList,
  159. //--- end --- tabbar配置项
  160. buildingID: '',
  161. waitCustomList: [],
  162. isAdd: '',
  163. dataCode: '',
  164. addAccount: '',
  165. permissions: {
  166. commonly1: false, //查看
  167. commonly2: false, //添加
  168. commonly3: false, //指派
  169. commonly4: false,
  170. commonly5: false,
  171. },
  172. };
  173. },
  174. onLoad() {},
  175. computed: {
  176. timestamp() {
  177. return (e) => {
  178. if (!e) return
  179. let totalTime = new Date(e).getTime() / 1000 + 60 * 60 * 2
  180. let nowTime = new Date().getTime() / 1000
  181. return totalTime - nowTime
  182. }
  183. }
  184. // judgeHalfAnHour(){
  185. // return (e)=>{
  186. // }
  187. // }
  188. },
  189. onShow() {
  190. this.buildingID = uni.getStorageSync('buildingID').id;
  191. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  192. this.permissions.commonly1 = newmenulist.jd_ck;
  193. this.permissions.commonly2 = newmenulist.jd_xz;
  194. this.permissions.commonly3 = newmenulist.jd_zp;
  195. this.permissions.commonly4 = newmenulist.jdys;
  196. this.permissions.commonly5 = newmenulist.jsjd;
  197. const {
  198. addAccount,
  199. dataCode
  200. } = uni.getStorageSync("weapp_session_userInfo_data");
  201. this.addAccount = addAccount;
  202. this.dataCode = dataCode;
  203. this.init()
  204. this.queryHaveDept()
  205. },
  206. onPullDownRefresh(){
  207. this.init()
  208. setTimeout(function () {
  209. uni.stopPullDownRefresh();
  210. }, 1000);
  211. },
  212. methods: {
  213. reshCustom() {
  214. this.init()
  215. },
  216. tapThevisiting(item) {
  217. if (this.permissions.commonly1 != true) {
  218. return
  219. }
  220. uni.showLoading({
  221. title: '加载中',
  222. mask: true
  223. });
  224. if (item.status == 0) {
  225. setTimeout(function() {
  226. uni.hideLoading();
  227. }, 2000);
  228. uni.showToast({
  229. icon: "none",
  230. title: "排队中"
  231. })
  232. return
  233. } else {
  234. const parames = {
  235. pageNum: 1,
  236. pageSize: 100,
  237. query: {
  238. customerId: item.id,
  239. }
  240. }
  241. var itemsd = {
  242. bg: 0,
  243. customerId: item.id,
  244. id: '',
  245. onebest: ''
  246. }
  247. this.$u.post("/corpus/findByPage", parames).then(res => {
  248. setTimeout(function() {
  249. uni.hideLoading();
  250. }, 2000);
  251. if (res) {
  252. let newobj = res[0];
  253. uni.navigateTo({
  254. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  255. })
  256. } else {
  257. uni.showToast({
  258. icon: "none",
  259. title: "暂无音频"
  260. })
  261. return
  262. }
  263. })
  264. }
  265. },
  266. queryHaveDept() {
  267. return new Promise((resolve, reject) => {
  268. this.$u.get("/user/queryHaveDept?houseId=" + this.buildingID).then(res => {
  269. this.isAdd = res;
  270. resolve();
  271. })
  272. })
  273. },
  274. init() {
  275. this.waitCustomList = []
  276. let parames = {
  277. itemId: this.buildingID
  278. }
  279. this.$u.post("/customer/reception", parames).then(data => {
  280. this.waitCustomList = data;
  281. });
  282. },
  283. //延时接待
  284. addTime(item) {
  285. uni.showModal({
  286. content: "确定延长半小时接待时间?",
  287. cancelColor: "#999999",
  288. success: res => {
  289. if (res.confirm) {
  290. this.$u.post("/customer/delayed", {
  291. cusId: item.id
  292. }).then(res => {
  293. uni.showToast({
  294. icon: "none",
  295. title: "操作成功"
  296. })
  297. });
  298. }
  299. }
  300. })
  301. },
  302. //结束接待
  303. changeEnd(id) {
  304. uni.showModal({
  305. content: "确定更改当前客户接待状态为结束?",
  306. cancelColor: "#999999",
  307. success: res => {
  308. if (this.noClick) {
  309. this.noClick= false;
  310. if (res.confirm) {
  311. this.$u.post("/customer/endReception", {
  312. id: id,
  313. houseId: this.buildingID
  314. }).then(res => {
  315. uni.showToast({
  316. icon: "none",
  317. title: "操作成功"
  318. })
  319. this.init();
  320. });
  321. }
  322. setTimeout(()=> {
  323. this.noClick= true;
  324. }, 2000)
  325. } else {
  326. // 这里是重复点击的判断
  327. }
  328. }
  329. })
  330. },
  331. //新增接待
  332. addreception() {
  333. const {
  334. dataCode,
  335. addAccount
  336. } = uni.getStorageSync("weapp_session_userInfo_data");
  337. if (dataCode == 6) {
  338. // if (addAccount != 0) {
  339. // uni.showToast({
  340. // title: '不允许自建客户!',
  341. // duration: 2000
  342. // });
  343. // return
  344. // }
  345. if (this.waitCustomList.length == 0) {
  346. uni.navigateTo({
  347. url: '/pages/mine/reception/addreception'
  348. })
  349. return
  350. } else {
  351. for (var i = 0; i < this.waitCustomList.length; i++) {
  352. if (this.waitCustomList[i].status == 1) {
  353. uni.showLoading({
  354. title: '当前还有未完成的客户项'
  355. });
  356. setTimeout(function() {
  357. uni.hideLoading();
  358. }, 1000);
  359. return
  360. } else {
  361. uni.navigateTo({
  362. url: '/pages/mine/reception/addreception'
  363. })
  364. return
  365. }
  366. }
  367. }
  368. } else {
  369. uni.navigateTo({
  370. url: '/pages/mine/reception/addreception'
  371. });
  372. }
  373. },
  374. assign(item) {
  375. let url = `/pages/mine/reception/consultant?id=${item.id}`
  376. if (item.beforeAgentId) {
  377. url += `&beforeAgentId=${item.beforeAgentId}`;
  378. }
  379. uni.navigateTo({
  380. url: url
  381. })
  382. },
  383. },
  384. };
  385. </script>
  386. <style lang="scss" scoped>
  387. .cented-box {
  388. background: #F8F8F8;
  389. width: 100%;
  390. min-height: calc(100vh - var(--window-bottom) - var(--window-top));
  391. padding-bottom: 30rpx;
  392. display: flex;
  393. flex-direction: column;
  394. .empty {
  395. flex-grow: 1;
  396. display: flex;
  397. align-items: center;
  398. }
  399. }
  400. .customer {
  401. margin-top: 30rpx;
  402. width: 100%;
  403. background: #FFFFFF;
  404. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  405. .title {
  406. height: 90rpx;
  407. border-bottom: 1px solid #E0E0E0;
  408. display: flex;
  409. align-items: center;
  410. justify-content: space-between;
  411. .zuo {
  412. // width: 25%;
  413. height: 100%;
  414. display: flex;
  415. align-items: center;
  416. .zuoimg {
  417. width: 52rpx;
  418. height: 52rpx;
  419. border-radius: 50%;
  420. // border: 1px solid #C9C9C9;
  421. border: 1px solid #2671E2;
  422. font-size: 30rpx;
  423. color: #2671E2;
  424. font-weight: 400;
  425. line-height: 48rpx;
  426. text-align: center;
  427. margin-left: 30rpx;
  428. }
  429. .zuoname {
  430. font-size: 30rpx;
  431. font-weight: bold;
  432. color: #333333;
  433. line-height: 30rpx;
  434. margin-left: 20rpx;
  435. }
  436. }
  437. .cen {
  438. // width:50%;
  439. color: #E7483C;
  440. text-align: center;
  441. }
  442. .you {
  443. // width: 25%;
  444. height: 100%;
  445. display: flex;
  446. align-items: center;
  447. margin-right: 30rpx;
  448. .youimg1 {
  449. width: 12rpx;
  450. height: 12rpx;
  451. border-radius: 50%;
  452. background: #2B6EFF;
  453. }
  454. .you-img {
  455. width: 24rpx;
  456. height: 32rpx;
  457. margin-left: 24rpx;
  458. }
  459. .youimg1-1 {
  460. width: 12rpx;
  461. height: 12rpx;
  462. border-radius: 50%;
  463. background: #F2A269;
  464. }
  465. .youtext {
  466. font-size: 30rpx;
  467. font-weight: 400;
  468. color: #292929;
  469. line-height: 30rpx;
  470. margin-left: 10rpx;
  471. }
  472. }
  473. }
  474. .centerbox {
  475. .centerbox-che {
  476. width: 100%;
  477. margin-top: 30rpx;
  478. height: 30rpx;
  479. font-size: 30rpx;
  480. font-weight: 400;
  481. color: #666666;
  482. line-height: 30rpx;
  483. text-indent: 30rpx;
  484. .shizai {
  485. color: #333333;
  486. }
  487. }
  488. .centerbox-che2 {
  489. width: 100%;
  490. margin-top: 30rpx;
  491. height: 30rpx;
  492. font-size: 30rpx;
  493. font-weight: 400;
  494. color: #666666;
  495. line-height: 30rpx;
  496. text-indent: 30rpx;
  497. display: flex;
  498. .Workcard {
  499. width: 50%;
  500. }
  501. }
  502. }
  503. .footer-button {
  504. // margin-top: 30rpx;
  505. width: 100%;
  506. height: 108rpx;
  507. display: flex;
  508. font-size: 30rpx;
  509. font-weight: 400;
  510. color: #333333;
  511. border-top: 1rpx solid #E0E0E0;
  512. justify-content: flex-end;
  513. line-height: 58rpx;
  514. .footer1 {
  515. // flex: 1;
  516. text-align: center;
  517. margin-top: 24rpx;
  518. // line-height: 90rpx;
  519. // border-right: 1rpx solid #E0E0E0;
  520. width: 156rpx;
  521. height: 60rpx;
  522. background: #FFFFFF;
  523. border-radius: 30rpx;
  524. border: 1px solid #999999;
  525. margin-left: 30rpx;
  526. }
  527. .footer3 {
  528. // flex: 1;
  529. text-align: center;
  530. margin-top: 24rpx;
  531. // line-height: 90rpx;
  532. width: 156rpx;
  533. height: 60rpx;
  534. background: #FFFFFF;
  535. border-radius: 30rpx;
  536. border: 1px solid #999999;
  537. margin-left: 30rpx;
  538. margin-right: 30rpx;
  539. }
  540. }
  541. }
  542. .add {
  543. width: 90upx;
  544. height: 90upx;
  545. position: fixed;
  546. bottom: 270upx;
  547. right: 44upx;
  548. }
  549. .add2 {
  550. width: 90upx;
  551. height: 90upx;
  552. position: fixed;
  553. bottom: 150upx;
  554. right: 44upx;
  555. }
  556. .content-sec {
  557. padding: 28rpx 30rpx 32rpx;
  558. width: 100%;
  559. display: flex;
  560. justify-content: space-between;
  561. .left {
  562. flex-shrink: 0;
  563. width: 100%;
  564. display: flex;
  565. align-items: center;
  566. .adviser {
  567. flex-shrink: 0;
  568. margin-right: 10rpx;
  569. padding: 5rpx 11rpx;
  570. border-radius: 50%;
  571. border: 1rpx solid #2671E2;
  572. background: #2671E2;
  573. font-size: 30rpx;
  574. color: #fff;
  575. }
  576. .cus {
  577. font-size: 30rpx;
  578. font-weight: 400;
  579. color: #666666;
  580. overflow: hidden;/*超出部分隐藏*/
  581. text-overflow:ellipsis;/* 超出部分显示省略号 */
  582. white-space: nowrap;/*规定段落中的文本不进行换行 */
  583. }
  584. .arriveNum {
  585. flex-shrink: 0;
  586. font-size: 30rpx;
  587. font-weight: 400;
  588. margin-left: 10rpx;
  589. }
  590. }
  591. .right {
  592. flex-shrink: 0;
  593. font-size: 28rpx;
  594. font-weight: 400;
  595. color: #2671E2;
  596. display: flex;
  597. align-items: center;
  598. .img {
  599. margin-right: 10rpx;
  600. width: 32rpx;
  601. height: 32rpx;
  602. }
  603. }
  604. }
  605. .content-last {
  606. padding: 0 30rpx 34rpx;
  607. font-size: 30rpx;
  608. font-weight: 400;
  609. color: #666666;
  610. display: flex;
  611. align-items: center;
  612. justify-content: space-between;
  613. .c-items {
  614. flex-shrink: 0;
  615. display: flex;
  616. align-items: center;
  617. font-size: 28rpx;
  618. .c-items-img {
  619. margin-right: 10rpx;
  620. width: 32rpx;
  621. height: 32rpx;
  622. }
  623. }
  624. }
  625. </style>