Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

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