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.
 
 
 

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