Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

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