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.
 
 
 

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