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.
 
 
 

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