25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

492 satır
12 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view v-if="waitCustomList.length==0" style="width: 100%;height: 100%;display: flex;align-items: center;">
  4. <view style="width: 100%;padding-top: 200rpx;">
  5. <view style="width: 100%;text-align: center;">
  6. <image style="width: 220rpx;height: 200rpx;"
  7. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  8. </view>
  9. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  10. </view>
  11. </view>
  12. <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  13. @click="tapThevisiting(item)">
  14. <view class="title">
  15. <view class="zuo">
  16. <!-- <view class="zuoimg">A</view> -->
  17. <view class="zuoname">{{item.name}}</view>
  18. </view>
  19. <view class="you">
  20. <view class="youimg1" v-if="item.status!=0"></view>
  21. <view class="youimg1-1" v-if="item.status==0"></view>
  22. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view>
  23. </view>
  24. </view>
  25. <view class="centerbox" v-if="item.status!=0">
  26. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  27. <view class="centerbox-che">开始时间:<text class="shizai">{{item.createTime}}</text></view>
  28. <view class="centerbox-che">顾问姓名:<text class="shizai" style="color: #333333;">{{item.agentName}}</text>
  29. </view>
  30. <view class="centerbox-che2" v-if="item.status==1">
  31. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==0">设备状态:<text
  32. class="shizai" style="color: red;">离线</text></view>
  33. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine!=0">工牌电量:<text
  34. class="shizai" style="color: #333333;">{{item.zkEquipmentState.electricity}}%</text></view>
  35. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==1">录音状态:
  36. <text v-if="item.zkEquipmentState.audioStatus=='true'" class="shizai"
  37. style="color: #333333;">使用中</text>
  38. <text v-if="item.zkEquipmentState.audioStatus=='false'" class="shizai"
  39. style="color: #333333;">未使用</text>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- checkAuthority('顾问指派顾问') -->
  44. <view class="footer-button" v-if="item.status!=0">
  45. <view class="footer1" @click.stop="addTime(item)">接待延时</view>
  46. <template v-if="zhipai">
  47. <view class="footer1" @click.stop="assign(item)">重新指派</view>
  48. </template>
  49. <template v-if="endReception">
  50. <view class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  51. </template>
  52. </view>
  53. <view class="centerbox" v-if="item.status==0">
  54. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  55. </view>
  56. <view class="footer-button" v-if="item.status==0">
  57. <template v-if="zhipai">
  58. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  59. </template>
  60. <template v-if="checkAuthority('删除接待记录')">
  61. <view @tap.stop="deleteReception(item)" class="footer3">删除接待</view>
  62. </template>
  63. </view>
  64. </view>
  65. <image v-if="dataCode!=6||(dataCode==6&&addAccount==0)" @click="addreception()" class="add"
  66. src="/static/images/add.png" mode=""></image>
  67. <image class="add2" @click="reshCustom()" src="https://static.quhouse.com/zhikong_xcx_img/refresh.png" mode="">
  68. </image>
  69. <u-tabbar activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList"></u-tabbar>
  70. <!-- 加载组件 -->
  71. <loading v-model="LOADING"></loading>
  72. </view>
  73. </template>
  74. <script>
  75. var util = require("../../utils/util.js");
  76. var config = require("../../config");
  77. import tabbarList from '@/utils/tabbar.js'
  78. import loading from "@/components/loading/index.vue"
  79. export default {
  80. components: {
  81. loading
  82. },
  83. data() {
  84. return {
  85. noClick: true,
  86. tabbarList: tabbarList,
  87. current: 0,
  88. buildingID: '',
  89. waitCustomList: [],
  90. dataCode: '',
  91. addAccount: '',
  92. endReception: true,
  93. fdFlag: null,
  94. isAdd: 0, // 默认能指派
  95. };
  96. },
  97. computed: {
  98. zhipai() {
  99. if (this.isAdd == 0) {
  100. // 如果改角色是顾问
  101. if (this.dataCode == 6) {
  102. return this.checkAuthority('顾问指派顾问')
  103. } else return true
  104. } else {
  105. return false
  106. }
  107. }
  108. },
  109. components: {},
  110. onShow() {
  111. this.LOADING = true
  112. this.buildingID = uni.getStorageSync('buildingID').id;
  113. const {
  114. addAccount,
  115. dataCode
  116. } = uni.getStorageSync("weapp_session_userInfo_data");
  117. let menulist = uni.getStorageSync('weapp_session_Menu_data')
  118. this.endReception = menulist.findIndex(item => {
  119. return item.name == '结束接待'
  120. }) != -1
  121. this.addAccount = addAccount;
  122. this.dataCode = dataCode;
  123. this.init()
  124. this.updateInit()
  125. this.queryHaveDept()
  126. },
  127. methods: {
  128. // 删除接待
  129. deleteReception(data) {
  130. this.$u.get(`/customer/delete?id=${data.id}`).then(res => {
  131. if (!res) {
  132. this.init()
  133. }
  134. }).catch(e => {
  135. console.log(e)
  136. uni.showToast({
  137. title: '网络异常,请稍后重试~',
  138. icon: 'none'
  139. });
  140. })
  141. },
  142. // 获取未读消息数量
  143. updateInit() {
  144. uni.request({
  145. url: config.service.notReadNum,
  146. method: "GET",
  147. data: {
  148. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  149. projectId: uni.getStorageSync('buildingID').id,
  150. },
  151. header: {
  152. 'content-type': 'application/json',
  153. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  154. },
  155. success: (res) => {
  156. this.count = res.data.data
  157. this.tabbarList[3].count = res.data.data || 0
  158. }
  159. })
  160. },
  161. reshCustom() {
  162. this.init()
  163. },
  164. tapThevisiting(item) {
  165. uni.showLoading({
  166. title: '加载中',
  167. mask: true
  168. });
  169. if (item.status == 0) {
  170. setTimeout(function() {
  171. uni.hideLoading();
  172. }, 2000);
  173. uni.showToast({
  174. icon: "none",
  175. title: "排队中"
  176. })
  177. return
  178. } else {
  179. const parames = {
  180. pageNum: 1,
  181. pageSize: 100,
  182. query: {
  183. customerId: item.id,
  184. }
  185. }
  186. var itemsd = {
  187. bg: 0,
  188. customerId: item.id,
  189. id: '',
  190. onebest: ''
  191. }
  192. this.$u.post("/corpus/findByPage", parames).then(res => {
  193. setTimeout(function() {
  194. uni.hideLoading();
  195. }, 2000);
  196. if (res) {
  197. let newobj = res[0];
  198. uni.navigateTo({
  199. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  200. })
  201. } else {
  202. uni.showToast({
  203. icon: "none",
  204. title: "暂无音频"
  205. })
  206. return
  207. }
  208. })
  209. }
  210. },
  211. init() {
  212. this.waitCustomList = []
  213. let parames = {
  214. itemId: this.buildingID
  215. }
  216. this.$u.post("/customer/reception", parames).then(data => {
  217. this.LOADING = false
  218. this.waitCustomList = data;
  219. }).catch(e => {
  220. this.LOADING = false
  221. });
  222. },
  223. //延时接待
  224. addTime(item) {
  225. uni.showModal({
  226. content: "确定延长半小时接待时间?",
  227. cancelColor: "#999999",
  228. success: res => {
  229. if (res.confirm) {
  230. this.$u.post("/customer/delayed", {
  231. cusId: item.id
  232. }).then(res => {
  233. uni.showToast({
  234. icon: "none",
  235. title: "操作成功"
  236. })
  237. });
  238. }
  239. }
  240. })
  241. },
  242. //结束接待
  243. changeEnd(id) {
  244. uni.showModal({
  245. content: "确定更改当前客户接待状态为结束?",
  246. cancelColor: "#999999",
  247. success: res => {
  248. if (this.noClick) {
  249. this.noClick = false;
  250. if (res.confirm) {
  251. if (res.confirm) {
  252. this.$u.post("/customer/endReception", {
  253. id: id,
  254. houseId: this.buildingID
  255. }).then(res => {
  256. uni.showToast({
  257. icon: "none",
  258. title: "操作成功"
  259. })
  260. this.init();
  261. });
  262. }
  263. }
  264. setTimeout(() => {
  265. this.noClick = true;
  266. }, 2000)
  267. } else {
  268. // 这里是重复点击的判断
  269. }
  270. }
  271. })
  272. },
  273. // 检测是否有添加顾问的权限
  274. queryHaveDept() {
  275. uni.request({
  276. url: config.service.getSelfAssignedByHouseId + "?houseId=" + uni.getStorageSync('buildingID').id,
  277. method: "GET",
  278. header: {
  279. 'content-type': 'application/json',
  280. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  281. },
  282. success: (data) => {
  283. if (data.data.code == 10000) {
  284. this.isAdd = data.data.data.selfAssigned
  285. }
  286. }
  287. })
  288. },
  289. //新增接待
  290. addreception() {
  291. const {
  292. dataCode,
  293. addAccount
  294. } = uni.getStorageSync("weapp_session_userInfo_data");
  295. if (dataCode == 6) {
  296. if (addAccount != 0) {
  297. uni.showToast({
  298. title: '不允许自建客户!',
  299. duration: 2000
  300. });
  301. return
  302. }
  303. uni.navigateTo({
  304. url: '/pages/mine/reception/addreception'
  305. });
  306. } else {
  307. uni.navigateTo({
  308. url: '/pages/mine/reception/addreception'
  309. });
  310. }
  311. },
  312. assign(item) {
  313. let url = `/pages/mine/reception/consultant?id=${item.id}`
  314. if (item.beforeAgentId) {
  315. url += `&beforeAgentId=${item.beforeAgentId}`;
  316. }
  317. uni.navigateTo({
  318. url: url
  319. })
  320. },
  321. },
  322. };
  323. </script>
  324. <style lang="scss" scoped>
  325. .cented-box {
  326. background: #F8F8F8;
  327. width: 100%;
  328. height: 100vh;
  329. padding-bottom: 30rpx;
  330. }
  331. .customer {
  332. margin-top: 30rpx;
  333. width: 100%;
  334. background: #FFFFFF;
  335. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  336. .title {
  337. height: 90rpx;
  338. border-bottom: 1px solid #E0E0E0;
  339. display: flex;
  340. align-items: center;
  341. .zuo {
  342. width: 80%;
  343. height: 100%;
  344. display: flex;
  345. align-items: center;
  346. .zuoimg {
  347. width: 52rpx;
  348. height: 52rpx;
  349. border-radius: 50%;
  350. border: 1px solid #C9C9C9;
  351. font-size: 30rpx;
  352. color: #292929;
  353. font-weight: 400;
  354. line-height: 52rpx;
  355. text-align: center;
  356. margin-left: 30rpx;
  357. }
  358. .zuoname {
  359. font-size: 30rpx;
  360. font-weight: 500;
  361. color: #333333;
  362. line-height: 30rpx;
  363. margin-left: 20rpx;
  364. }
  365. }
  366. .you {
  367. width: 20%;
  368. height: 100%;
  369. display: flex;
  370. align-items: center;
  371. .youimg1 {
  372. width: 12rpx;
  373. height: 12rpx;
  374. border-radius: 50%;
  375. background: #2B6EFF;
  376. }
  377. .youimg1-1 {
  378. width: 12rpx;
  379. height: 12rpx;
  380. border-radius: 50%;
  381. background: #F2A269;
  382. }
  383. .youtext {
  384. font-size: 30rpx;
  385. font-weight: 400;
  386. color: #292929;
  387. line-height: 30rpx;
  388. margin-left: 10rpx;
  389. }
  390. }
  391. }
  392. .centerbox {
  393. .centerbox-che {
  394. width: 100%;
  395. margin-top: 30rpx;
  396. height: 30rpx;
  397. font-size: 30rpx;
  398. font-weight: 400;
  399. color: #666666;
  400. line-height: 30rpx;
  401. text-indent: 30rpx;
  402. .shizai {
  403. color: #333333;
  404. }
  405. }
  406. .centerbox-che2 {
  407. width: 100%;
  408. margin-top: 30rpx;
  409. height: 30rpx;
  410. font-size: 30rpx;
  411. font-weight: 400;
  412. color: #666666;
  413. line-height: 30rpx;
  414. text-indent: 30rpx;
  415. display: flex;
  416. .Workcard {
  417. width: 50%;
  418. }
  419. }
  420. }
  421. .footer-button {
  422. margin-top: 30rpx;
  423. width: 100%;
  424. height: 90rpx;
  425. display: flex;
  426. font-size: 30rpx;
  427. font-weight: 400;
  428. color: #333333;
  429. border-top: 1rpx solid #E0E0E0;
  430. .footer1 {
  431. flex-grow: 1;
  432. text-align: center;
  433. line-height: 90rpx;
  434. border-right: 1rpx solid #E0E0E0;
  435. }
  436. .footer3 {
  437. flex-grow: 1;
  438. text-align: center;
  439. line-height: 90rpx;
  440. }
  441. }
  442. }
  443. .add {
  444. width: 90upx;
  445. height: 90upx;
  446. position: fixed;
  447. bottom: 275upx;
  448. right: 44upx;
  449. }
  450. .add2 {
  451. width: 90upx;
  452. height: 90upx;
  453. position: fixed;
  454. bottom: 160upx;
  455. right: 44upx;
  456. }
  457. </style>