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.
 
 
 

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