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.
 
 
 

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