Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

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