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.
 
 
 

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