Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

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