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.
 
 
 

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