You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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