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.
 
 
 

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