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.
 
 
 

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