選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

498 行
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 (res.confirm) {
  257. uni.showLoading({
  258. mask: true,
  259. title: '结束中...'
  260. })
  261. this.$u.post("/customer/endReception", {
  262. id: id,
  263. houseId: this.buildingID
  264. }).then(res => {
  265. uni.hideLoading()
  266. uni.showToast({
  267. icon: "none",
  268. title: "操作成功"
  269. })
  270. this.init();
  271. }).catch(() => {
  272. uni.hideLoading()
  273. });
  274. }
  275. }
  276. })
  277. },
  278. // 检测是否有添加顾问的权限
  279. queryHaveDept() {
  280. uni.request({
  281. url: config.service.getSelfAssignedByHouseId + "?houseId=" + uni.getStorageSync('buildingID')
  282. .id,
  283. method: "GET",
  284. header: {
  285. 'content-type': 'application/json',
  286. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  287. },
  288. success: (data) => {
  289. if (data.data.code == 10000) {
  290. this.isAdd = data.data.data.selfAssigned
  291. }
  292. }
  293. })
  294. },
  295. //新增接待
  296. addreception() {
  297. const {
  298. dataCode,
  299. addAccount
  300. } = uni.getStorageSync("weapp_session_userInfo_data");
  301. if (dataCode == 6) {
  302. if (addAccount != 0) {
  303. uni.showToast({
  304. title: '不允许自建客户!',
  305. duration: 2000
  306. });
  307. return
  308. }
  309. uni.navigateTo({
  310. url: '/pages/mine/reception/addreception'
  311. });
  312. } else {
  313. uni.navigateTo({
  314. url: '/pages/mine/reception/addreception'
  315. });
  316. }
  317. },
  318. assign(item) {
  319. let url = `/pages/mine/reception/consultant?id=${item.id}`
  320. if (item.beforeAgentId) {
  321. url += `&beforeAgentId=${item.beforeAgentId}`;
  322. }
  323. uni.navigateTo({
  324. url: url
  325. })
  326. },
  327. },
  328. };
  329. </script>
  330. <style lang="scss" scoped>
  331. .cented-box {
  332. background: #F8F8F8;
  333. width: 100%;
  334. height: 100vh;
  335. padding-bottom: 30rpx;
  336. }
  337. .customer {
  338. margin-top: 30rpx;
  339. width: 100%;
  340. background: #FFFFFF;
  341. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  342. .title {
  343. height: 90rpx;
  344. border-bottom: 1px solid #E0E0E0;
  345. display: flex;
  346. align-items: center;
  347. .zuo {
  348. width: 80%;
  349. height: 100%;
  350. display: flex;
  351. align-items: center;
  352. .zuoimg {
  353. width: 52rpx;
  354. height: 52rpx;
  355. border-radius: 50%;
  356. border: 1px solid #C9C9C9;
  357. font-size: 30rpx;
  358. color: #292929;
  359. font-weight: 400;
  360. line-height: 52rpx;
  361. text-align: center;
  362. margin-left: 30rpx;
  363. }
  364. .zuoname {
  365. font-size: 30rpx;
  366. font-weight: 500;
  367. color: #333333;
  368. line-height: 30rpx;
  369. margin-left: 20rpx;
  370. }
  371. }
  372. .you {
  373. width: 20%;
  374. height: 100%;
  375. display: flex;
  376. align-items: center;
  377. .youimg1 {
  378. width: 12rpx;
  379. height: 12rpx;
  380. border-radius: 50%;
  381. background: #2B6EFF;
  382. }
  383. .youimg1-1 {
  384. width: 12rpx;
  385. height: 12rpx;
  386. border-radius: 50%;
  387. background: #F2A269;
  388. }
  389. .youtext {
  390. font-size: 30rpx;
  391. font-weight: 400;
  392. color: #292929;
  393. line-height: 30rpx;
  394. margin-left: 10rpx;
  395. }
  396. }
  397. }
  398. .centerbox {
  399. .centerbox-che {
  400. width: 100%;
  401. margin-top: 30rpx;
  402. height: 30rpx;
  403. font-size: 30rpx;
  404. font-weight: 400;
  405. color: #666666;
  406. line-height: 30rpx;
  407. text-indent: 30rpx;
  408. .shizai {
  409. color: #333333;
  410. }
  411. }
  412. .centerbox-che2 {
  413. width: 100%;
  414. margin-top: 30rpx;
  415. height: 30rpx;
  416. font-size: 30rpx;
  417. font-weight: 400;
  418. color: #666666;
  419. line-height: 30rpx;
  420. text-indent: 30rpx;
  421. display: flex;
  422. .Workcard {
  423. width: 50%;
  424. }
  425. }
  426. }
  427. .footer-button {
  428. margin-top: 30rpx;
  429. width: 100%;
  430. height: 90rpx;
  431. display: flex;
  432. font-size: 30rpx;
  433. font-weight: 400;
  434. color: #333333;
  435. border-top: 1rpx solid #E0E0E0;
  436. .footer1 {
  437. flex-grow: 1;
  438. text-align: center;
  439. line-height: 90rpx;
  440. border-right: 1rpx solid #E0E0E0;
  441. }
  442. .footer3 {
  443. flex-grow: 1;
  444. text-align: center;
  445. line-height: 90rpx;
  446. }
  447. }
  448. }
  449. .add {
  450. width: 90upx;
  451. height: 90upx;
  452. position: fixed;
  453. bottom: 275upx;
  454. right: 44upx;
  455. }
  456. .add2 {
  457. width: 90upx;
  458. height: 90upx;
  459. position: fixed;
  460. bottom: 160upx;
  461. right: 44upx;
  462. }
  463. </style>