Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

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