選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

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