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.
 
 
 

469 lines
11 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. };
  95. },
  96. computed: {
  97. zhipai() {
  98. if (this.dataCode == 6) {
  99. return this.checkAuthority('顾问指派顾问')
  100. } else {
  101. return true
  102. }
  103. }
  104. },
  105. components: {},
  106. onShow() {
  107. this.LOADING = true
  108. this.buildingID = uni.getStorageSync('buildingID').id;
  109. const {
  110. addAccount,
  111. dataCode
  112. } = uni.getStorageSync("weapp_session_userInfo_data");
  113. let menulist = uni.getStorageSync('weapp_session_Menu_data')
  114. this.endReception = menulist.findIndex(item => {
  115. return item.name == '结束接待'
  116. }) != -1
  117. this.addAccount = addAccount;
  118. this.dataCode = dataCode;
  119. this.init()
  120. this.updateInit()
  121. },
  122. methods: {
  123. // 删除接待
  124. deleteReception(data) {
  125. this.$u.get(`/customer/delete?id=${data.id}`).then(res => {
  126. if (!res) {
  127. this.init()
  128. }
  129. }).catch(e => {
  130. console.log(e)
  131. uni.showToast({
  132. title: '网络异常,请稍后重试~',
  133. icon: 'none'
  134. });
  135. })
  136. },
  137. // 获取未读消息数量
  138. updateInit() {
  139. uni.request({
  140. url: config.service.notReadNum,
  141. method: "GET",
  142. data: {
  143. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  144. projectId: uni.getStorageSync('buildingID').id,
  145. },
  146. header: {
  147. 'content-type': 'application/json',
  148. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  149. },
  150. success: (res) => {
  151. this.count = res.data.data
  152. this.tabbarList[3].count = res.data.data || 0
  153. }
  154. })
  155. },
  156. reshCustom() {
  157. this.init()
  158. },
  159. tapThevisiting(item) {
  160. uni.showLoading({
  161. title: '加载中',
  162. mask: true
  163. });
  164. if (item.status == 0) {
  165. setTimeout(function() {
  166. uni.hideLoading();
  167. }, 2000);
  168. uni.showToast({
  169. icon: "none",
  170. title: "排队中"
  171. })
  172. return
  173. } else {
  174. const parames = {
  175. pageNum: 1,
  176. pageSize: 100,
  177. query: {
  178. customerId: item.id,
  179. }
  180. }
  181. var itemsd = {
  182. bg: 0,
  183. customerId: item.id,
  184. id: '',
  185. onebest: ''
  186. }
  187. this.$u.post("/corpus/findByPage", parames).then(res => {
  188. setTimeout(function() {
  189. uni.hideLoading();
  190. }, 2000);
  191. if (res) {
  192. let newobj = res[0];
  193. uni.navigateTo({
  194. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  195. })
  196. } else {
  197. uni.showToast({
  198. icon: "none",
  199. title: "暂无音频"
  200. })
  201. return
  202. }
  203. })
  204. }
  205. },
  206. init() {
  207. this.waitCustomList = []
  208. let parames = {
  209. itemId: this.buildingID
  210. }
  211. this.$u.post("/customer/reception", parames).then(data => {
  212. this.LOADING = false
  213. this.waitCustomList = data;
  214. }).catch(e => {
  215. this.LOADING = false
  216. });
  217. },
  218. //延时接待
  219. addTime(item) {
  220. uni.showModal({
  221. content: "确定延长半小时接待时间?",
  222. cancelColor: "#999999",
  223. success: res => {
  224. if (res.confirm) {
  225. this.$u.post("/customer/delayed", {
  226. cusId: item.id
  227. }).then(res => {
  228. uni.showToast({
  229. icon: "none",
  230. title: "操作成功"
  231. })
  232. });
  233. }
  234. }
  235. })
  236. },
  237. //结束接待
  238. changeEnd(id) {
  239. uni.showModal({
  240. content: "确定更改当前客户接待状态为结束?",
  241. cancelColor: "#999999",
  242. success: res => {
  243. if (this.noClick) {
  244. this.noClick = false;
  245. if (res.confirm) {
  246. if (res.confirm) {
  247. this.$u.post("/customer/endReception", {
  248. id: id,
  249. houseId: this.buildingID
  250. }).then(res => {
  251. uni.showToast({
  252. icon: "none",
  253. title: "操作成功"
  254. })
  255. this.init();
  256. });
  257. }
  258. }
  259. setTimeout(() => {
  260. this.noClick = true;
  261. }, 2000)
  262. } else {
  263. // 这里是重复点击的判断
  264. }
  265. }
  266. })
  267. },
  268. //新增接待
  269. addreception() {
  270. const {
  271. dataCode,
  272. addAccount
  273. } = uni.getStorageSync("weapp_session_userInfo_data");
  274. if (dataCode == 6) {
  275. if (addAccount != 0) {
  276. uni.showToast({
  277. title: '不允许自建客户!',
  278. duration: 2000
  279. });
  280. return
  281. }
  282. uni.navigateTo({
  283. url: '/pages/mine/reception/addreception'
  284. });
  285. } else {
  286. uni.navigateTo({
  287. url: '/pages/mine/reception/addreception'
  288. });
  289. }
  290. },
  291. assign(item) {
  292. let url = `/pages/mine/reception/consultant?id=${item.id}`
  293. if (item.beforeAgentId) {
  294. url += `&beforeAgentId=${item.beforeAgentId}`;
  295. }
  296. uni.navigateTo({
  297. url: url
  298. })
  299. },
  300. },
  301. };
  302. </script>
  303. <style lang="scss" scoped>
  304. .cented-box {
  305. background: #F8F8F8;
  306. width: 100%;
  307. height: 100vh;
  308. padding-bottom: 30rpx;
  309. }
  310. .customer {
  311. margin-top: 30rpx;
  312. width: 100%;
  313. background: #FFFFFF;
  314. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  315. .title {
  316. height: 90rpx;
  317. border-bottom: 1px solid #E0E0E0;
  318. display: flex;
  319. align-items: center;
  320. .zuo {
  321. width: 80%;
  322. height: 100%;
  323. display: flex;
  324. align-items: center;
  325. .zuoimg {
  326. width: 52rpx;
  327. height: 52rpx;
  328. border-radius: 50%;
  329. border: 1px solid #C9C9C9;
  330. font-size: 30rpx;
  331. color: #292929;
  332. font-weight: 400;
  333. line-height: 52rpx;
  334. text-align: center;
  335. margin-left: 30rpx;
  336. }
  337. .zuoname {
  338. font-size: 30rpx;
  339. font-weight: 500;
  340. color: #333333;
  341. line-height: 30rpx;
  342. margin-left: 20rpx;
  343. }
  344. }
  345. .you {
  346. width: 20%;
  347. height: 100%;
  348. display: flex;
  349. align-items: center;
  350. .youimg1 {
  351. width: 12rpx;
  352. height: 12rpx;
  353. border-radius: 50%;
  354. background: #2B6EFF;
  355. }
  356. .youimg1-1 {
  357. width: 12rpx;
  358. height: 12rpx;
  359. border-radius: 50%;
  360. background: #F2A269;
  361. }
  362. .youtext {
  363. font-size: 30rpx;
  364. font-weight: 400;
  365. color: #292929;
  366. line-height: 30rpx;
  367. margin-left: 10rpx;
  368. }
  369. }
  370. }
  371. .centerbox {
  372. .centerbox-che {
  373. width: 100%;
  374. margin-top: 30rpx;
  375. height: 30rpx;
  376. font-size: 30rpx;
  377. font-weight: 400;
  378. color: #666666;
  379. line-height: 30rpx;
  380. text-indent: 30rpx;
  381. .shizai {
  382. color: #333333;
  383. }
  384. }
  385. .centerbox-che2 {
  386. width: 100%;
  387. margin-top: 30rpx;
  388. height: 30rpx;
  389. font-size: 30rpx;
  390. font-weight: 400;
  391. color: #666666;
  392. line-height: 30rpx;
  393. text-indent: 30rpx;
  394. display: flex;
  395. .Workcard {
  396. width: 50%;
  397. }
  398. }
  399. }
  400. .footer-button {
  401. margin-top: 30rpx;
  402. width: 100%;
  403. height: 90rpx;
  404. display: flex;
  405. font-size: 30rpx;
  406. font-weight: 400;
  407. color: #333333;
  408. border-top: 1rpx solid #E0E0E0;
  409. .footer1 {
  410. flex: 1;
  411. text-align: center;
  412. line-height: 90rpx;
  413. border-right: 1rpx solid #E0E0E0;
  414. }
  415. .footer3 {
  416. flex-grow: 1;
  417. text-align: center;
  418. line-height: 90rpx;
  419. }
  420. }
  421. }
  422. .add {
  423. width: 90upx;
  424. height: 90upx;
  425. position: fixed;
  426. bottom: 275upx;
  427. right: 44upx;
  428. }
  429. .add2 {
  430. width: 90upx;
  431. height: 90upx;
  432. position: fixed;
  433. bottom: 160upx;
  434. right: 44upx;
  435. }
  436. </style>