AI营销辅助 普强使用
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.
 
 
 

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