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.
 
 
 

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