25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

454 satır
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. </view>
  63. </template>
  64. <script>
  65. var util = require("../../utils/util.js");
  66. var config = require("../../config");
  67. import tabbarList from '@/utils/tabbar.js'
  68. export default {
  69. data() {
  70. return {
  71. noClick:true,
  72. tabbarList:tabbarList,
  73. current: 0,
  74. buildingID: '',
  75. waitCustomList: [],
  76. isAdd: '',
  77. dataCode: '',
  78. addAccount: '',
  79. endReception: true,
  80. fdFlag:null
  81. };
  82. },
  83. components: {},
  84. onLoad() {},
  85. onShow() {
  86. this.buildingID = uni.getStorageSync('buildingID').id;
  87. const {
  88. addAccount,
  89. dataCode
  90. } = uni.getStorageSync("weapp_session_userInfo_data");
  91. let menulist = uni.getStorageSync('weapp_session_Menu_data')
  92. this.endReception = menulist.findIndex(item => { return item.name == '结束接待' }) != -1
  93. this.addAccount = addAccount;
  94. this.dataCode = dataCode;
  95. console.log(this.menulist)
  96. this.init()
  97. this.queryHaveDept()
  98. this.updateInit()
  99. },
  100. methods: {
  101. updateInit() {
  102. uni.request({
  103. url: config.service.notReadNum,
  104. method: "GET",
  105. data: {
  106. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  107. projectId: uni.getStorageSync('buildingID').id,
  108. },
  109. header: {
  110. 'content-type': 'application/json',
  111. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  112. },
  113. success: (res) => {
  114. this.count = res.data.data
  115. this.tabbarList[3].count = res.data.data || 0
  116. }
  117. })
  118. },
  119. reshCustom() {
  120. this.init()
  121. },
  122. tapThevisiting(item) {
  123. uni.showLoading({
  124. title: '加载中',
  125. mask: true
  126. });
  127. if (item.status == 0) {
  128. setTimeout(function() {
  129. uni.hideLoading();
  130. }, 2000);
  131. uni.showToast({
  132. icon: "none",
  133. title: "排队中"
  134. })
  135. return
  136. } else {
  137. const parames = {
  138. pageNum: 1,
  139. pageSize: 100,
  140. query: {
  141. customerId: item.id,
  142. }
  143. }
  144. var itemsd = {
  145. bg: 0,
  146. customerId: item.id,
  147. id: '',
  148. onebest: ''
  149. }
  150. this.$u.post("/corpus/findByPage", parames).then(res => {
  151. setTimeout(function() {
  152. uni.hideLoading();
  153. }, 2000);
  154. if (res) {
  155. let newobj = res[0];
  156. uni.navigateTo({
  157. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  158. })
  159. } else {
  160. uni.showToast({
  161. icon: "none",
  162. title: "暂无音频"
  163. })
  164. return
  165. }
  166. })
  167. }
  168. },
  169. queryHaveDept() {
  170. return new Promise((resolve, reject) => {
  171. this.$u.get("/user/queryHaveDept?houseId=" + this.buildingID).then(res => {
  172. this.isAdd = res;
  173. resolve();
  174. })
  175. })
  176. },
  177. init() {
  178. this.waitCustomList = []
  179. let parames = {
  180. itemId: this.buildingID
  181. }
  182. this.$u.post("/customer/reception", parames).then(data => {
  183. this.waitCustomList = data;
  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. if (this.waitCustomList.length == 0) {
  251. uni.navigateTo({
  252. url: '/pages/mine/reception/addreception'
  253. })
  254. return
  255. } else {
  256. for (var i = 0; i < this.waitCustomList.length; i++) {
  257. if (this.waitCustomList[i].status == 1) {
  258. uni.showLoading({
  259. title: '当前还有未完成的客户项'
  260. });
  261. setTimeout(function() {
  262. uni.hideLoading();
  263. }, 1000);
  264. return
  265. } else {
  266. uni.navigateTo({
  267. url: '/pages/mine/reception/addreception'
  268. })
  269. return
  270. }
  271. }
  272. }
  273. } else {
  274. uni.navigateTo({
  275. url: '/pages/mine/reception/addreception'
  276. });
  277. }
  278. },
  279. assign(item) {
  280. let url = `/pages/mine/reception/consultant?id=${item.id}`
  281. if (item.beforeAgentId) {
  282. url += `&beforeAgentId=${item.beforeAgentId}`;
  283. }
  284. uni.navigateTo({
  285. url: url
  286. })
  287. },
  288. },
  289. };
  290. </script>
  291. <style lang="scss" scoped>
  292. .cented-box {
  293. background: #F8F8F8;
  294. width: 100%;
  295. height: 100vh;
  296. padding-bottom: 30rpx;
  297. }
  298. .customer {
  299. margin-top: 30rpx;
  300. width: 100%;
  301. background: #FFFFFF;
  302. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  303. .title {
  304. height: 90rpx;
  305. border-bottom: 1px solid #E0E0E0;
  306. display: flex;
  307. align-items: center;
  308. .zuo {
  309. width: 80%;
  310. height: 100%;
  311. display: flex;
  312. align-items: center;
  313. .zuoimg {
  314. width: 52rpx;
  315. height: 52rpx;
  316. border-radius: 50%;
  317. border: 1px solid #C9C9C9;
  318. font-size: 30rpx;
  319. color: #292929;
  320. font-weight: 400;
  321. line-height: 52rpx;
  322. text-align: center;
  323. margin-left: 30rpx;
  324. }
  325. .zuoname {
  326. font-size: 30rpx;
  327. font-weight: 500;
  328. color: #333333;
  329. line-height: 30rpx;
  330. margin-left: 20rpx;
  331. }
  332. }
  333. .you {
  334. width: 20%;
  335. height: 100%;
  336. display: flex;
  337. align-items: center;
  338. .youimg1 {
  339. width: 12rpx;
  340. height: 12rpx;
  341. border-radius: 50%;
  342. background: #2B6EFF;
  343. }
  344. .youimg1-1 {
  345. width: 12rpx;
  346. height: 12rpx;
  347. border-radius: 50%;
  348. background: #F2A269;
  349. }
  350. .youtext {
  351. font-size: 30rpx;
  352. font-weight: 400;
  353. color: #292929;
  354. line-height: 30rpx;
  355. margin-left: 10rpx;
  356. }
  357. }
  358. }
  359. .centerbox {
  360. .centerbox-che {
  361. width: 100%;
  362. margin-top: 30rpx;
  363. height: 30rpx;
  364. font-size: 30rpx;
  365. font-weight: 400;
  366. color: #666666;
  367. line-height: 30rpx;
  368. text-indent: 30rpx;
  369. .shizai {
  370. color: #333333;
  371. }
  372. }
  373. .centerbox-che2 {
  374. width: 100%;
  375. margin-top: 30rpx;
  376. height: 30rpx;
  377. font-size: 30rpx;
  378. font-weight: 400;
  379. color: #666666;
  380. line-height: 30rpx;
  381. text-indent: 30rpx;
  382. display: flex;
  383. .Workcard {
  384. width: 50%;
  385. }
  386. }
  387. }
  388. .footer-button {
  389. margin-top: 30rpx;
  390. width: 100%;
  391. height: 90rpx;
  392. display: flex;
  393. font-size: 30rpx;
  394. font-weight: 400;
  395. color: #333333;
  396. border-top: 1rpx solid #E0E0E0;
  397. .footer1 {
  398. flex: 1;
  399. text-align: center;
  400. line-height: 90rpx;
  401. border-right: 1rpx solid #E0E0E0;
  402. }
  403. .footer3 {
  404. flex: 1;
  405. text-align: center;
  406. line-height: 90rpx;
  407. }
  408. }
  409. }
  410. .add {
  411. width: 90upx;
  412. height: 90upx;
  413. position: fixed;
  414. bottom:275upx;
  415. right: 44upx;
  416. }
  417. .add2 {
  418. width: 90upx;
  419. height: 90upx;
  420. position: fixed;
  421. bottom: 160upx;
  422. right: 44upx;
  423. }
  424. </style>