25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

1310 satır
34 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view class="Switchingbox">
  4. <view class="Switching1">
  5. <image class="Switching1-img" src="../../static/images/building.png" mode=""></image>
  6. </view>
  7. <view class="Switching2">{{ isPuqiang ? '项目' : '客户' }}:</view>
  8. <view class="Switching3">{{buildingname}}</view>
  9. <view class="Switching4" v-if="buildingishow" @click="piskbuilding()">切换项目</view>
  10. </view>
  11. <view class="title" style="margin-top: 30rpx;" v-if="Myworkcard">
  12. 我的工牌
  13. <template v-if="equipmentObj.imei">
  14. <text style="margin-left: 20rpx;">{{ equipmentObj.imei }}</text>
  15. </template>
  16. </view>
  17. <view v-if="Myworkcard">
  18. <view class="Workcard" v-if="Whetheroffline==true">
  19. <view class="Workcard-box">
  20. <view class="Workcardimg">
  21. <view class="Workcardimg1">
  22. <view v-if="percentage>20" class="bar" :style="{width : percentage + '%' }"></view>
  23. <view v-if="percentage<20" class="bar1" :style="{width : percentage + '%' }"></view>
  24. </view>
  25. </view>
  26. <view class="Workcardtext">电量:{{percentage}}%</view>
  27. </view>
  28. <view class="Workcard-box">
  29. <view class="Workcardimg">
  30. <image v-if="signalDevice==''" class="Workcardimg2" src="../../static/images/signal0.png"
  31. mode=""></image>
  32. <image v-else-if="signalDevice<20 && signalDevice>0" class="Workcardimg2"
  33. src="../../static/images/signal1.png" mode=""></image>
  34. <image v-else-if="signalDevice<50 && signalDevice>20" class="Workcardimg2"
  35. src="../../static/images/signal2.png" mode=""></image>
  36. <image v-else-if="signalDevice<70 && signalDevice>50" class="Workcardimg2"
  37. src="../../static/images/signal3.png" mode=""></image>
  38. <image v-else-if="signalDevice<90 && signalDevice>70" class="Workcardimg2"
  39. src="../../static/images/signal4.png" mode=""></image>
  40. <image v-else-if="signalDevice<=100 && signalDevice>90" class="Workcardimg2"
  41. src="../../static/images/signal5.png" mode=""></image>
  42. </view>
  43. <view class="Workcardtext">信号:{{signalDevicetext}}</view>
  44. </view>
  45. <view class="Workcard-box">
  46. <view class="Workcardimg">
  47. <image v-if="audioStatus=='true'" class="Workcardimg3"
  48. src="../../static/images/Thtapedrive1.png" mode=""></image>
  49. <image v-if="audioStatus=='false'" class="Workcardimg3"
  50. src="../../static/images/Thtapedrive2.png" mode=""></image>
  51. </view>
  52. <view v-if="audioStatus=='true'" class="Workcardtext">录音:已开启</view>
  53. <view v-if="audioStatus=='false'" class="Workcardtext">录音:未开启</view>
  54. </view>
  55. </view>
  56. <view class="Workcard" v-if="Whetheroffline==false">
  57. <view class="Workcard-box">
  58. <view class="Workcardimg">
  59. <image class="Workcardimg4" src="../../static/images/offline.png" mode=""></image>
  60. </view>
  61. <view class="Workcardtext">设备离线</view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 临期项目提醒 -->
  66. <view class="endworking" v-if="bulidIngObj.daysRemaining <= 60"
  67. :class="{sixty: (bulidIngObj.daysRemaining > 15 && bulidIngObj.daysRemaining <= 60), fifteen: bulidIngObj.daysRemaining <= 15}">
  68. 您的服务于{{ bulidIngObj.endWorking }}到期,为了避免影响您的使用,请与服务商联系
  69. </view>
  70. <template v-if="checkAuthority('转写时长剩余')">
  71. <view class="title">转写消费</view>
  72. <view class="shebenbox">
  73. <view class="shebenche">
  74. <view class="shebenchenum">{{paraphraseObj.rechargeSum || 0}}</view>
  75. <view class="shebenchetext">购买小时</view>
  76. </view>
  77. <view class="shebenche">
  78. <view class="shebenchenum">{{paraphraseObj.presenterSum || 0}}</view>
  79. <view class="shebenchetext">赠送小时</view>
  80. </view>
  81. <view class="shebenche">
  82. <view class="shebenchenum">{{paraphraseObj.useSum || 0}}</view>
  83. <view class="shebenchetext">已用小时</view>
  84. </view>
  85. <view class="shebenche">
  86. <view class="shebenchenum" :style="paraphraseObj.surplusSum < 100 ? 'color: red' : ''">{{paraphraseObj.surplusSum || 0}}</view>
  87. <view class="shebenchetext">剩余小时</view>
  88. </view>
  89. </view>
  90. </template>
  91. <template v-if="equipmentisshow">
  92. <view class="title" >设备</view>
  93. <view class="shebenbox">
  94. <view class="shebenche" @click="tapjumpequipment(0)">
  95. <view class="shebenchenum">{{equipmentobj.totalNum || 0}}</view>
  96. <view class="shebenchetext">设备总数</view>
  97. </view>
  98. <view class="shebenche" @click="tapjumpequipment(1)">
  99. <view class="shebenchenum">{{equipmentobj.onlineNum || 0}}</view>
  100. <view class="shebenchetext">在线</view>
  101. </view>
  102. <view class="shebenche" @click="tapjumpequipment(3)">
  103. <view class="shebenchenum">{{equipmentobj.activeNum || 0}}</view>
  104. <view class="shebenchetext">活跃</view>
  105. </view>
  106. <view class="shebenche" @click="tapjumpequipment(2)">
  107. <view class="shebenchenum" style="color: red;">{{equipmentobj.lowPowerNum || 0}}</view>
  108. <view class="shebenchetext">急需充电</view>
  109. </view>
  110. </view>
  111. </template>
  112. <view class="title">实时统计</view>
  113. <view class="real-timebox">
  114. <view class="timebox">
  115. <view class="real" @click="tapjumpreception(checkParams('1'))">
  116. <view class="realnum">{{realtimeobj.receptionCount || 0}}</view>
  117. <view class="realtext">接待量</view>
  118. </view>
  119. <view class="real" @click="tapjumpreception(checkParams('6'))">
  120. <view class="realnum">{{realtimeobj.activeCustomer|| 0}}</view>
  121. <view class="realtext">有效接待</view>
  122. </view>
  123. <view class="real" @click="tapjumpreception(checkParams('4'))">
  124. <view class="realnum">{{realtimeobj.tagCustomer || 0}}</view>
  125. <view class="realtext">未标顾问</view>
  126. </view>
  127. <view class="real">
  128. <view @click="prohibitedtap(1)" v-if="methodsisshow==true" class="realnum" style="color: red;">
  129. {{realtimeobj.prohibitedCustomer || 0}}
  130. </view>
  131. <view @click="prohibitedtap(1)" v-if="methodsisshow==true" class="realtext">违禁预警</view>
  132. </view>
  133. </view>
  134. <view class="timebox">
  135. <view class="real" @click="tapjumpreception(checkParams('auth'))">
  136. <view class="realnum">{{realtimeobj.avgDuration|| 0}}</view>
  137. <view class="realtext">平均接待时长</view>
  138. </view>
  139. <view class="real" @click="tapjumpreception(checkParams('auth'))">
  140. <view class="realnum">{{max100(realtimeobj.fraction)}}%</view>
  141. <view class="realtext">平均执行率</view>
  142. </view>
  143. <view class="real" @click="tapjumpreception(checkParams('6'))">
  144. <view class="realnum">{{max100(realtimeobj.wordFinishFraction)}}%</view>
  145. <view class="realtext">平均挖掘率</view>
  146. </view>
  147. <view class="real">
  148. <view class="realnum" >
  149. {{realtimeobj.sumLevelFraction || 0}}%
  150. </view>
  151. <view class="realtext">客户意向度</view>
  152. </view>
  153. </view>
  154. </view>
  155. <view class="title" style="display: flex;">
  156. <view style="width: 55%;">概览</view>
  157. <view class="cet" style="display: flex;">
  158. <view class="cetview" :class="{ activecllasscet: zhixingcenterindex == 2 }" @click="tabtimeclick(2)">近7天
  159. </view>
  160. <view class="cetview" :class="{ activecllasscet: zhixingcenterindex == 6 }" @click="tabtimeclick(6)">
  161. 近30天</view>
  162. <view class="cetview" :class="{ activecllasscet: zhixingcenterindex == 7 }" @click="tabtimeclick(7)">自定义
  163. </view>
  164. </view>
  165. </view>
  166. <view class="real-timebox">
  167. <view class="timebox">
  168. <view class="real" @click="tapjumpreception(checkParams('3'))">
  169. <view class="realnum">{{Thisweekobj.receptionCount || 0}}</view>
  170. <view class="realtext">接待量</view>
  171. </view>
  172. <view class="real" @click="tapjumpreception(checkParams('7'))">
  173. <view class="realnum">{{Thisweekobj.activeCustomer|| 0}}</view>
  174. <view class="realtext">有效接待</view>
  175. </view>
  176. <view class="real" @click="tapjumpreception(checkParams('4'))">
  177. <view class="realnum">{{Thisweekobj.tagCustomer || 0}}</view>
  178. <view class="realtext">未标顾问</view>
  179. </view>
  180. <view class="real" @click="prohibitedtap(2)" v-if="methodsisshow==true">
  181. <view class="realnum" style="color: red;">{{Thisweekobj.prohibitedCustomer || 0}}</view>
  182. <view class="realtext">违禁预警</view>
  183. </view>
  184. </view>
  185. <view class="timebox">
  186. <view class="real" @click="tapjumpreception(checkParams('333'))">
  187. <view class="realnum">{{Thisweekobj.avgDuration|| 0}}</view>
  188. <view class="realtext">平均接待时长</view>
  189. </view>
  190. <view class="real" @click="tapjumpreception(checkParams('333'))">
  191. <view class="realnum">{{max100(Thisweekobj.wordFinishFraction)}}%</view>
  192. <view class="realtext">平均挖掘率</view>
  193. </view>
  194. <view class="real" @click="tapjumpreception(checkParams('333'))">
  195. <view class="realnum">{{max100(Thisweekobj.fraction)}}%</view>
  196. <view class="realtext">平均执行率</view>
  197. </view>
  198. <view class="real">
  199. <view class="realnum" >
  200. {{Thisweekobj.sumLevelFraction || 0}}%
  201. </view>
  202. <view class="realtext">客户意向度</view>
  203. </view>
  204. </view>
  205. </view>
  206. <view class="title">常用功能</view>
  207. <view class="commonly-box">
  208. <!-- 权限菜单控制显隐 因为后台添加的按钮权限并不会在此返回所以需要手动添加 showMenu -->
  209. <view class="commonly" @click="Piabodata(item.name)" v-for="(item,index) in Menulist" :key="index"
  210. v-if="showMenu(item.name)">
  211. <view class="commonly-img">
  212. <image class="commonly-img1" :src="item.name | imgFilter" mode=""></image>
  213. </view>
  214. <view class="commonly-text">{{item.name}}</view>
  215. </view>
  216. </view>
  217. <!-- 项目切换 -->
  218. <view v-if="Showhiddenunits">
  219. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="lpanlist"
  220. @cancel="cancel" @confirm="confirm"></u-select>
  221. </view>
  222. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  223. <view class="update" v-if="isShowUpdate">
  224. <view class="updateBox">
  225. <view class="top">
  226. <image src="../../static/images/updateIcon.png"></image>
  227. </view>
  228. <view class="content">
  229. <view class="tit">{{tit}}</view>
  230. <u-parse class="ql-editor" :content="content" @preview="preview" @navigate="navigate" />
  231. <!-- <rich-text :nodes="content"></rich-text> -->
  232. </view>
  233. <view class="btn" @click="lookDetail">查看详情</view>
  234. <view class="close" @click="close">
  235. <u-icon name="close-circle" size="80" color="#FFFFFF"></u-icon>
  236. </view>
  237. </view>
  238. </view>
  239. <u-popup v-model="modalShow" border-radius="12" mode="center">
  240. <view class="modal-box">
  241. <view class="modal-title">今日接待</view>
  242. <view class="number-box">
  243. <view class="item">
  244. <view class="num">{{realtimeobj.receptionCount+realtimeobj.receivingCustomer || 0}}</view>
  245. <view class="num-text">接待次数</view>
  246. </view>
  247. <view class="item">
  248. <view class="num">{{realtimeobj.tagCustomer || 0}}</view>
  249. <view class="num-text">未标顾问</view>
  250. </view>
  251. </view>
  252. <view class="get" @click="modalShow=false">我知道了</view>
  253. </view>
  254. </u-popup>
  255. <!-- 加载组件 -->
  256. <loading v-model="LOADING"></loading>
  257. <u-tabbar activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList"></u-tabbar>
  258. </view>
  259. </template>
  260. <script>
  261. var config = require("../../config");
  262. import tabbarList from '@/utils/tabbar.js'
  263. import uParse from '../../components/gaoyia-parse/parse.vue'
  264. import loading from "@/components/loading/index.vue"
  265. export default {
  266. components: {
  267. uParse,
  268. loading
  269. },
  270. data() {
  271. return {
  272. modalShow: false,
  273. id: "",
  274. isShowUpdate: false,
  275. tit: "",
  276. content: "",
  277. tabbarList: tabbarList,
  278. current: 0,
  279. userInfo: {},
  280. Showhiddenunits: false,
  281. lpanlist: [], //项目列表
  282. buildingname: '', //项目名
  283. buildingID: '', //项目id
  284. buildingishow: false, //是否选择项目
  285. Myworkcard: false,
  286. percentage: '', //设备电量
  287. Whetheroffline: false, //是否离线
  288. signalDevice: 0, //信号
  289. signalDevicetext: "",
  290. audioStatus: false,
  291. equipmentisshow: false,
  292. equipmentobj: { // 统计设备状态
  293. totalNum: '',
  294. onlineNum: '',
  295. activeNum: '',
  296. lowPowerNum: '',
  297. },
  298. equipmentObj: {}, // 接口返回设备信息2
  299. Menulist: [],
  300. realtimeobj: {
  301. sumCustomer: '',
  302. receivingCustomer: '',
  303. activeCustomer: '',
  304. prohibitedCustomer: '',
  305. tagCustomer: '',
  306. fraction: '',
  307. wordFinishFraction: '',
  308. receptionCount: ''
  309. },
  310. Thisweekobj: {
  311. sumCustomer: '',
  312. receivingCustomer: '',
  313. activeCustomer: '',
  314. prohibitedCustomer: '',
  315. tagCustomer: '',
  316. fraction: '',
  317. wordFraction: '',
  318. wordFinishFraction: '',
  319. receptionCount: ''
  320. },
  321. methodsisshow: false,
  322. zhixingcenterindex: 2,
  323. totalTimeShow: false,
  324. statDateStart: '',
  325. statDateEnd: '',
  326. needShow: ['客户管理', '接待记录', '销讲数据', '设备管理', '值班顾问', '顾问排名', '违禁记录'], // 权限配置需要展示出来的功能入口
  327. paraphraseObj: {}, // 转写消费
  328. };
  329. },
  330. computed: {
  331. // 是否是普强小程序
  332. showMenu() {
  333. return name => {
  334. if (this.needShow.findIndex(item => item == name) != -1) {
  335. return true
  336. } else {
  337. return false
  338. }
  339. }
  340. },
  341. // 是否是普强小程序
  342. isPuqiang() {
  343. return config.service.host.indexOf('xitong.pachira.cn') == -1
  344. },
  345. },
  346. onLoad() {
  347. if (!this.isPuqiang) {
  348. uni.setNavigationBarTitle({
  349. title: 'AI营销辅助平台'
  350. })
  351. }
  352. this.initPopup()
  353. },
  354. onShow() {
  355. this.upDateBulidIngObj()
  356. this.LOADING = true
  357. this.getMenu()
  358. this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
  359. if (this.userInfo.dataCode == 6 || this.userInfo.dataCode == 3) {
  360. this.methodsisshow = false;
  361. } else {
  362. this.methodsisshow = true;
  363. }
  364. if (this.userInfo.zkProperties.length == 1) {
  365. this.buildingID = uni.getStorageSync('buildingID').id;
  366. this.buildingname = uni.getStorageSync('buildingID').name;
  367. this.buildingishow = false;
  368. } else {
  369. this.buildingishow = true;
  370. this.buildingname = uni.getStorageSync('buildingID').name;
  371. this.buildingID = uni.getStorageSync('buildingID').id;
  372. this.userInfo.zkProperties.forEach(item => {
  373. item.label = item.propertyName;
  374. item.value = item.id
  375. })
  376. this.lpanlist = this.userInfo.zkProperties
  377. }
  378. if (this.userInfo.dataCode == 6) {
  379. this.Myworkcard = true;
  380. this.equipmentisshow = false;
  381. this.iniodianloang()
  382. } else {
  383. this.equipmentisshow = true;
  384. this.Myworkcard = false;
  385. this.initequipment()
  386. }
  387. this.initworkThisWeek()
  388. this.initrealTimeStatistics()
  389. this.updateInit()
  390. this.findByHouseIdForRecharge()
  391. },
  392. onPullDownRefresh() {
  393. this.getMenu()
  394. this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
  395. if (this.userInfo.dataCode == 6 || this.userInfo.dataCode == 3) {
  396. this.methodsisshow = false;
  397. } else {
  398. this.methodsisshow = true;
  399. }
  400. if (this.userInfo.zkProperties.length == 1) {
  401. this.buildingID = uni.getStorageSync('buildingID').id;
  402. this.buildingname = uni.getStorageSync('buildingID').name;
  403. this.buildingishow = false;
  404. } else {
  405. this.buildingishow = true;
  406. this.buildingname = uni.getStorageSync('buildingID').name;
  407. this.buildingID = uni.getStorageSync('buildingID').id;
  408. this.userInfo.zkProperties.forEach(item => {
  409. item.label = item.propertyName;
  410. item.value = item.id
  411. })
  412. this.lpanlist = this.userInfo.zkProperties
  413. }
  414. if (this.userInfo.dataCode == 6) {
  415. // this.Myworkcard = true;
  416. this.equipmentisshow = false;
  417. this.iniodianloang()
  418. } else {
  419. this.equipmentisshow = true;
  420. // this.Myworkcard = false;
  421. this.initequipment()
  422. // this.waitForOperation()
  423. }
  424. this.initworkThisWeek()
  425. this.initrealTimeStatistics()
  426. this.findByHouseIdForRecharge()
  427. setTimeout(() => {
  428. uni.stopPullDownRefresh()
  429. }, 3000)
  430. },
  431. methods: {
  432. max100(num) {
  433. if (num > 100) {
  434. return 100
  435. } else if (!num) {
  436. return 0;
  437. } else {
  438. return num;
  439. }
  440. },
  441. towajue() {
  442. uni.navigateTo({
  443. url: "/pages/center/Piabodata/requireminingAnalysis"
  444. })
  445. },
  446. close() {
  447. this.isShowUpdate = false;
  448. },
  449. lookDetail() {
  450. let datas = {
  451. id: this.id,
  452. title: this.tit,
  453. content: this.content
  454. }
  455. this.$store.commit('setMessageObj', datas)
  456. uni.navigateTo({
  457. url: "../mine/messageDetail"
  458. })
  459. let data = {
  460. id: this.id,
  461. accountId: uni.getStorageSync('weapp_session_userInfo_data').accountId
  462. }
  463. uni.request({
  464. url: config.service.updateRead,
  465. method: "GET",
  466. header: {
  467. 'content-type': 'application/json',
  468. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  469. },
  470. data,
  471. success: (res) => {
  472. this.initPopup()
  473. }
  474. })
  475. this.isShowUpdate = false;
  476. },
  477. initPopup() {
  478. uni.request({
  479. url: config.service.updatePopup,
  480. method: "GET",
  481. header: {
  482. 'content-type': 'application/json',
  483. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  484. },
  485. data: {
  486. },
  487. success: (res) => {
  488. let data = res.data.data
  489. if (data) {
  490. this.first(data.id)
  491. this.content = data.content
  492. this.tit = data.title
  493. this.aid = data.accountId
  494. this.id = data.id
  495. this.isShowUpdate = data.readFlag == 0 ? true : false;
  496. }
  497. }
  498. })
  499. },
  500. first(id) {
  501. uni.request({
  502. url: config.service.firstShowPopup,
  503. method: "GET",
  504. header: {
  505. 'content-type': 'application/json',
  506. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  507. },
  508. data: {
  509. id
  510. },
  511. success: (res) => {}
  512. })
  513. },
  514. updateInit() {
  515. uni.request({
  516. url: config.service.notReadNum,
  517. method: "GET",
  518. data: {
  519. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  520. projectId: uni.getStorageSync('buildingID').id,
  521. },
  522. header: {
  523. 'content-type': 'application/json',
  524. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  525. },
  526. success: (res) => {
  527. this.count = res.data.data
  528. this.tabbarList[3].count = res.data.data || 0
  529. }
  530. })
  531. },
  532. //获取权限
  533. getMenu() {
  534. this.$u.get("/user/getMenu").then(data => {
  535. uni.setStorageSync("weapp_session_Menu_data", data)
  536. this.Menulist = uni.getStorageSync('weapp_session_Menu_data');
  537. let remind = uni.getStorageSync("remind");
  538. uni.setStorageSync("remind", 1);
  539. if (this.Menulist.length) {
  540. if (this.Menulist.findIndex(item => item.name == '今日接待弹框') != -1) {
  541. this.modalShow = remind == 0 ? true : false
  542. } else {
  543. this.modalShow = false
  544. }
  545. }
  546. })
  547. },
  548. //自定义时间
  549. totalTimeChange(e) {
  550. this.statDateStart = e.startDate;
  551. this.statDateEnd = e.endDate;
  552. this.zhixingcenterindex = 7;
  553. this.initworkThisWeek()
  554. },
  555. //时间选择
  556. tabtimeclick(i) {
  557. if (i == 7) {
  558. this.totalTimeShow = true;
  559. } else {
  560. this.zhixingcenterindex = i;
  561. this.initworkThisWeek()
  562. }
  563. },
  564. //获取概览数据
  565. initworkThisWeek() {
  566. uni.request({
  567. url: config.service.workThisWeek,
  568. method: "POST",
  569. header: {
  570. 'content-type': 'application/json',
  571. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  572. },
  573. data: {
  574. houseId: this.buildingID,
  575. dateType: this.zhixingcenterindex == 7 ? null : this.zhixingcenterindex,
  576. statDateStart: this.statDateStart,
  577. statDateEnd: this.statDateEnd
  578. },
  579. success: (data) => {
  580. if (data.data.data == null) {
  581. return
  582. } else {
  583. this.Thisweekobj = {
  584. sumCustomer: data.data.data.sumCustomer,
  585. receivingCustomer: data.data.data.receivingCustomer,
  586. activeCustomer: data.data.data.activeCustomer,
  587. prohibitedCustomer: data.data.data.prohibitedCustomer,
  588. avgDuration: Math.floor(data.data.data.avgDuration / 60) || 0,
  589. tagCustomer: data.data.data.tagCustomer,
  590. fraction: data.data.data.fraction,
  591. wordFinishFraction: data.data.data.wordFinishFraction,
  592. receptionCount: data.data.data.receptionCount
  593. }
  594. }
  595. }
  596. })
  597. },
  598. //实时统计
  599. initrealTimeStatistics() {
  600. uni.request({
  601. url: config.service.realTimeStatistics,
  602. method: "POST",
  603. header: {
  604. 'content-type': 'application/json',
  605. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  606. },
  607. data: {
  608. houseId: this.buildingID
  609. },
  610. success: (data) => {
  611. this.LOADING = false
  612. if (data.data.data == null) {
  613. return
  614. } else {
  615. this.realtimeobj = {
  616. sumCustomer: data.data.data.sumCustomer || 0,
  617. receivingCustomer: data.data.data.receivingCustomer || 0,
  618. activeCustomer: data.data.data.activeCustomer || 0,
  619. prohibitedCustomer: data.data.data.prohibitedCustomer || 0,
  620. avgDuration: Math.floor(data.data.data.avgDuration / 60) || 0,
  621. tagCustomer: data.data.data.tagCustomer || 0,
  622. fraction: data.data.data.fraction || 0,
  623. wordFinishFraction: data.data.data.wordFinishFraction || 0,
  624. receptionCount: data.data.data.receptionCount || 0
  625. }
  626. }
  627. },
  628. fail: () => {
  629. this.LOADING = false
  630. }
  631. })
  632. },
  633. // 转写充值剩余
  634. findByHouseIdForRecharge() {
  635. this.$u.get(`/cusLvStatistics/findByHouseIdForRecharge?houseId=${this.buildingID}`).then(res => {
  636. console.log(res)
  637. if (res) {
  638. this.paraphraseObj = res.list
  639. }
  640. })
  641. },
  642. //设备
  643. initequipment() {
  644. uni.request({
  645. url: config.service.findEquipmentState,
  646. method: "POST",
  647. header: {
  648. 'content-type': 'application/json',
  649. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  650. },
  651. data: {
  652. propertyId: this.buildingID
  653. },
  654. success: (data) => {
  655. if (data.data.data == null) {
  656. return
  657. } else {
  658. this.equipmentobj = {
  659. totalNum: data.data.data.totalNum,
  660. onlineNum: data.data.data.onlineNum,
  661. activeNum: data.data.data.activeNum,
  662. lowPowerNum: data.data.data.lowPowerNum,
  663. }
  664. }
  665. }
  666. })
  667. },
  668. //我的工牌
  669. iniodianloang() {
  670. uni.request({
  671. url: config.service.findElectricity,
  672. method: "POST",
  673. header: {
  674. 'content-type': 'application/json',
  675. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  676. },
  677. data: {},
  678. success: (data) => {
  679. if (data.data.data == null) {
  680. return
  681. } else {
  682. if (data.data.data > 100) {
  683. this.percentage = 100;
  684. } else {
  685. this.equipmentObj = data.data.data
  686. if (data.data.data.onLine == 0) {
  687. this.Whetheroffline = false;
  688. } else {
  689. this.Whetheroffline = true;
  690. this.percentage = data.data.data.electricity;
  691. this.signalDevice = data.data.data.signalDevice / 1;
  692. console.log(this.signalDevice)
  693. this.audioStatus = data.data.data.audioStatus;
  694. if (this.signalDevice > 80) {
  695. this.signalDevicetext = '高';
  696. } else {
  697. if (this.signalDevice == 0) {
  698. this.signalDevicetext = '无';
  699. } else {
  700. this.signalDevicetext = '低';
  701. }
  702. }
  703. }
  704. }
  705. }
  706. }
  707. })
  708. },
  709. //选择项目弹框
  710. piskbuilding() {
  711. // this.Showhiddenunits = true;
  712. uni.navigateTo({
  713. url: "../mine/selectBuilding"
  714. })
  715. },
  716. // 项目选择确认
  717. confirm(e) {
  718. this.buildingname = e[0].label;
  719. this.buildingID = e[0].value;
  720. let lopan = {
  721. id: e[0].value,
  722. name: e[0].label
  723. }
  724. uni.setStorageSync("buildingID", lopan); //项目id写入缓存
  725. this.initworkThisWeek()
  726. this.initrealTimeStatistics()
  727. this.initequipment()
  728. this.iniodianloang()
  729. },
  730. // 项目选择取消
  731. cancel() {
  732. this.Showhiddenunits = false;
  733. },
  734. // 设备模块跳转
  735. tapjumpequipment(i) {
  736. if (this.checkAuthority('设备管理')) {
  737. uni.navigateTo({
  738. url: '/pages/mine/equipment/index?active=' + i
  739. });
  740. }
  741. },
  742. // 违禁模块跳转
  743. prohibitedtap(i) {
  744. let str = ''
  745. if (i == 1) {
  746. str = '&activeTotal=0'
  747. } else {
  748. if (this.zhixingcenterindex == 2) {
  749. str = '&activeTotal=2'
  750. } else if (this.zhixingcenterindex == 6) {
  751. str = '&activeTotal=3'
  752. } else {
  753. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}`
  754. }
  755. }
  756. uni.navigateTo({
  757. url: `/pages/center/prohibited/index?refresh=refresh&violatedStatus=1${str}`
  758. })
  759. },
  760. // 跳转正在接待页面
  761. switchJump() {
  762. uni.switchTab({
  763. url: '/pages/index/customer'
  764. });
  765. },
  766. // 跳转参数
  767. checkParams(i) {
  768. let str = ''
  769. switch (i) {
  770. case '1':
  771. str = '&activeTotal=0';
  772. break;
  773. case 'auth':
  774. str = '&activeTotal=0&validInvalid=0'
  775. break;
  776. case '3':
  777. // 筛选时间类型后传的参数
  778. if (this.zhixingcenterindex == 2) {
  779. str = '&activeTotal=2'
  780. } else if (this.zhixingcenterindex == 6) {
  781. str = '&activeTotal=3'
  782. } else {
  783. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}`
  784. }
  785. break;
  786. case '333':
  787. case '7':
  788. if (this.zhixingcenterindex == 2) {
  789. str = '&activeTotal=2&validInvalid=0'
  790. } else if (this.zhixingcenterindex == 6) {
  791. str = '&activeTotal=3&validInvalid=0'
  792. } else {
  793. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}&validInvalid=0`
  794. }
  795. break;
  796. case '6':
  797. str = '&activeTotal=0&validInvalid=0'
  798. break;
  799. case '4':
  800. str = '&activeTotal=0&markAdvisor=0&validInvalid=0'
  801. break;
  802. default:
  803. str = '&activeTotal=0&markAdvisor=0'
  804. break;
  805. }
  806. return str
  807. },
  808. // 接待记录跳转
  809. tapjumpreception(params) {
  810. // 校验是否有权限
  811. if (this.checkAuthority('接待记录')) {
  812. uni.navigateTo({
  813. url: `/pages/center/records/index?refresh=refresh${params}`
  814. });
  815. }
  816. },
  817. // 权限菜单跳转
  818. Piabodata(item) {
  819. if (item == '销讲数据') {
  820. uni.navigateTo({
  821. url: '/pages/center/Piabodata/index'
  822. });
  823. } else if (item == '接待记录') {
  824. uni.navigateTo({
  825. url: '/pages/center/records/index?refresh=refresh'
  826. });
  827. } else if (item == '值班顾问') {
  828. uni.navigateTo({
  829. url: '/pages/mine/consultanonduty/index'
  830. });
  831. } else if (item == '设备管理') {
  832. uni.navigateTo({
  833. url: '/pages/mine/equipment/index'
  834. });
  835. } else if (item == '顾问排名') {
  836. uni.navigateTo({
  837. url: '/pages/center/Piabodata/Employeesstatistics'
  838. });
  839. } else if (item == '违禁记录') {
  840. uni.navigateTo({
  841. url: '/pages/center/prohibited/index?refresh=refresh'
  842. });
  843. } else {
  844. uni.navigateTo({
  845. url: '/pages/center/consumer/index?refresh=refresh'
  846. });
  847. }
  848. },
  849. },
  850. filters: {
  851. imgFilter(type) {
  852. let path = ''
  853. switch (type) {
  854. case '客户管理':
  855. path = '../../static/images/function1.png'
  856. break
  857. case '接待记录':
  858. path = '../../static/images/function2.png'
  859. break
  860. case '销讲数据':
  861. path = '../../static/images/function4.png'
  862. break
  863. case '设备管理':
  864. path = '../../static/images/function5.png'
  865. break
  866. case '值班顾问':
  867. path = '../../static/images/function6.png'
  868. break
  869. case '顾问排名':
  870. path = '../../static/images/rankingguwen.png'
  871. break
  872. case '违禁记录':
  873. path = '../../static/images/prohibited.png'
  874. break
  875. }
  876. return path
  877. }
  878. }
  879. };
  880. </script>
  881. <style lang="scss" scoped>
  882. .modal-box {
  883. display: flex;
  884. flex-direction: column;
  885. align-items: center;
  886. width: 590rpx;
  887. padding: 50rpx 30rpx 60rpx;
  888. .modal-title {
  889. text-align: center;
  890. height: 45rpx;
  891. font-size: 32rpx;
  892. font-family: PingFangSC-Medium, PingFang SC;
  893. font-weight: 500;
  894. color: #333333;
  895. line-height: 45rpx;
  896. margin-bottom: 60rpx;
  897. }
  898. .number-box {
  899. width: 100%;
  900. display: flex;
  901. justify-content: space-around;
  902. margin-bottom: 80rpx;
  903. .item {
  904. display: flex;
  905. flex-direction: column;
  906. align-items: center;
  907. .num {
  908. margin-bottom: 12rpx;
  909. height: 60rpx;
  910. font-size: 42rpx;
  911. font-family: PingFangSC-Semibold, PingFang SC;
  912. font-weight: 600;
  913. color: #333333;
  914. line-height: 60rpx;
  915. margin-bottom: 12rpx;
  916. }
  917. .num-text {
  918. height: 45rpx;
  919. font-size: 32rpx;
  920. font-family: PingFangSC-Regular, PingFang SC;
  921. font-weight: 400;
  922. color: #333333;
  923. line-height: 45rpx;
  924. }
  925. }
  926. }
  927. .get {
  928. width: 400rpx;
  929. height: 80rpx;
  930. background: #3E50E8;
  931. border-radius: 8rpx;
  932. text-align: center;
  933. line-height: 80rpx;
  934. color: #fff;
  935. }
  936. }
  937. .update {
  938. width: 100%;
  939. height: 100%;
  940. background: rgba(0, 0, 0, 0.5);
  941. position: fixed;
  942. top: 0;
  943. left: 0;
  944. bottom: 0;
  945. right: 0;
  946. z-index: 9999;
  947. .updateBox {
  948. width: 80%;
  949. background: #FFFFFF;
  950. position: relative;
  951. left: 50%;
  952. margin-left: -40%;
  953. padding: 20rpx;
  954. border-radius: 10rpx;
  955. top: 140rpx;
  956. .top {
  957. width: 350rpx;
  958. height: 220rpx;
  959. margin: 0 auto;
  960. image {
  961. width: 100%;
  962. height: 100%;
  963. }
  964. }
  965. .btn {
  966. width: 510rpx;
  967. height: 88rpx;
  968. background: #2671E2;
  969. margin: 0 auto;
  970. display: flex;
  971. justify-content: center;
  972. align-items: center;
  973. font-size: 36rpx;
  974. border-radius: 8rpx;
  975. color: #FFFFFF;
  976. }
  977. .content {
  978. height: 268rpx;
  979. overflow-y: auto;
  980. margin: 46rpx 0;
  981. }
  982. .tit {
  983. font-size: 40rpx;
  984. text-align: center;
  985. font-weight: bold;
  986. }
  987. .close {
  988. position: absolute;
  989. bottom: -100rpx;
  990. left: 50%;
  991. margin-left: -50rpx;
  992. }
  993. }
  994. }
  995. .activecllasscet {
  996. font-size: 28rpx;
  997. font-weight: 400;
  998. color: #008ef2;
  999. }
  1000. .cet {
  1001. font-size: 28rpx;
  1002. font-weight: 400;
  1003. color: #333333;
  1004. .cetview {
  1005. margin-left: 20rpx;
  1006. }
  1007. }
  1008. .cented-box {
  1009. position: relative;
  1010. padding: 30rpx 0;
  1011. background: #F8F8F8;
  1012. width: 100%;
  1013. height: 100%;
  1014. }
  1015. .Switchingbox {
  1016. padding: 0 30rpx;
  1017. width: 100%;
  1018. height: 44rpx;
  1019. display: flex;
  1020. align-items: center;
  1021. .Switching1 {
  1022. width: 44rpx;
  1023. height: 44rpx;
  1024. .Switching1-img {
  1025. width: 44rpx;
  1026. height: 44rpx;
  1027. }
  1028. }
  1029. .Switching2 {
  1030. margin-left: 12rpx;
  1031. font-size: 32rpx;
  1032. color: #303030;
  1033. font-weight: 500;
  1034. }
  1035. .Switching3 {
  1036. width: calc(100% - 280rpx);
  1037. font-size: 32rpx;
  1038. color: #303030;
  1039. font-weight: 500;
  1040. }
  1041. .Switching4 {
  1042. width: 112rpx;
  1043. font-size: 28rpx;
  1044. color: #303030;
  1045. font-weight: 400;
  1046. text-align: right;
  1047. text-decoration: underline
  1048. }
  1049. }
  1050. .Workcard {
  1051. width: 100%;
  1052. background: #FFFFFF;
  1053. height: 154rpx;
  1054. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1055. border-radius: 12rpx;
  1056. display: flex;
  1057. .Workcard-box {
  1058. flex: 1;
  1059. height: 100%;
  1060. .Workcardimg {
  1061. width: 100%;
  1062. display: flex;
  1063. justify-content: center;
  1064. margin-top: 42rpx;
  1065. .Workcardimg1 {
  1066. width: 64rpx;
  1067. height: 36rpx;
  1068. background-image: url(../../static/images/battery.png);
  1069. background-size: 100% 100%;
  1070. padding: 8rpx;
  1071. .bar {
  1072. background-color: #43CD80;
  1073. height: 100%;
  1074. border-radius: 4rpx;
  1075. }
  1076. .bar1 {
  1077. background-color: red;
  1078. height: 100%;
  1079. border-radius: 4rpx;
  1080. }
  1081. }
  1082. .Workcardimg2 {
  1083. width: 56rpx;
  1084. height: 36rpx;
  1085. }
  1086. .Workcardimg3 {
  1087. width: 34rpx;
  1088. height: 36rpx;
  1089. }
  1090. .Workcardimg4 {
  1091. width: 50rpx;
  1092. height: 40rpx;
  1093. }
  1094. }
  1095. .Workcardtext {
  1096. width: 100%;
  1097. text-align: center;
  1098. font-size: 24rpx;
  1099. font-weight: 400;
  1100. color: #666666;
  1101. margin-top: 20rpx;
  1102. }
  1103. }
  1104. }
  1105. .title {
  1106. margin: 48rpx 0 24rpx;
  1107. padding: 0 30rpx;
  1108. width: 100%;
  1109. font-size: 30rpx;
  1110. font-weight: 600;
  1111. color: #333333;
  1112. }
  1113. .shebenbox {
  1114. margin: 0 auto;
  1115. width: 690rpx;
  1116. height: 156rpx;
  1117. background: #FFFFFF;
  1118. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1119. border-radius: 12rpx;
  1120. display: flex;
  1121. .shebenche {
  1122. width: 25%;
  1123. height: 100%;
  1124. .shebenchenum {
  1125. width: 100%;
  1126. font-size: 36rpx;
  1127. font-weight: 600;
  1128. color: #333333;
  1129. text-align: center;
  1130. margin-top: 28rpx;
  1131. }
  1132. .shebenchetext {
  1133. width: 100%;
  1134. font-size: 24rpx;
  1135. font-weight: 400;
  1136. color: #666666;
  1137. text-align: center;
  1138. margin-top: 24rpx;
  1139. }
  1140. }
  1141. }
  1142. .real-timebox {
  1143. margin: 0 auto;
  1144. width: 690rpx;
  1145. background: #FFFFFF;
  1146. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1147. border-radius: 12rpx;
  1148. padding-bottom: 36rpx;
  1149. .timebox {
  1150. width: 100%;
  1151. display: flex;
  1152. .real {
  1153. flex: 1;
  1154. height: 100%;
  1155. .realnum {
  1156. width: 100%;
  1157. font-size: 36rpx;
  1158. font-weight: 600;
  1159. color: #333333;
  1160. text-align: center;
  1161. margin-top: 36rpx;
  1162. }
  1163. .realtext {
  1164. width: 100%;
  1165. font-size: 24rpx;
  1166. font-weight: 400;
  1167. color: #666666;
  1168. text-align: center;
  1169. margin-top: 24rpx;
  1170. }
  1171. }
  1172. }
  1173. }
  1174. .commonly-box {
  1175. margin: 0 auto;
  1176. width: 690rpx;
  1177. background: #FFFFFF;
  1178. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1179. border-radius: 12rpx;
  1180. display: flex;
  1181. flex-wrap: wrap;
  1182. padding-bottom: 36rpx;
  1183. .commonly {
  1184. width: 25%;
  1185. margin-top: 36rpx;
  1186. .commonly-img {
  1187. width: 100%;
  1188. height: 68rpx;
  1189. text-align: center;
  1190. .commonly-img1 {
  1191. width: 68rpx;
  1192. height: 68rpx;
  1193. border-radius: 50%;
  1194. }
  1195. }
  1196. .commonly-text {
  1197. width: 100%;
  1198. text-align: center;
  1199. font-size: 24rpx;
  1200. font-weight: 400;
  1201. color: #333333;
  1202. margin-top: 16rpx;
  1203. }
  1204. }
  1205. }
  1206. .endworking {
  1207. margin-top: 20rpx;
  1208. padding: 15rpx 30rpx;
  1209. width: 100%;
  1210. }
  1211. .sixty {
  1212. background-color: #FDFCDA;
  1213. }
  1214. .fifteen {
  1215. background-color: #F9C8C8;
  1216. color: #ff0000;
  1217. }
  1218. </style>