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.
 
 
 

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