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.
 
 
 

1254 rivejä
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. uni.setStorageSync("weapp_session_Menu_data", data)
  501. this.Menulist = uni.getStorageSync('weapp_session_Menu_data');
  502. let remind = uni.getStorageSync("remind");
  503. uni.setStorageSync("remind",1);
  504. if(this.Menulist.length){
  505. if (this.Menulist.findIndex(item => item.name == '今日接待弹框') != -1) {
  506. this.modalShow = remind==0?true:false
  507. } else {
  508. this.modalShow = false
  509. }
  510. }
  511. })
  512. },
  513. //自定义时间
  514. totalTimeChange(e) {
  515. this.statDateStart = e.startDate;
  516. this.statDateEnd = e.endDate;
  517. this.zhixingcenterindex = 7;
  518. this.initworkThisWeek()
  519. },
  520. //时间选择
  521. tabtimeclick(i) {
  522. if (i == 7) {
  523. this.totalTimeShow = true;
  524. } else {
  525. this.zhixingcenterindex = i;
  526. this.initworkThisWeek()
  527. }
  528. },
  529. //获取概览数据
  530. initworkThisWeek() {
  531. uni.request({
  532. url: config.service.workThisWeek,
  533. method: "POST",
  534. header: {
  535. 'content-type': 'application/json',
  536. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  537. },
  538. data: {
  539. houseId: this.buildingID,
  540. dateType: this.zhixingcenterindex == 7 ? null : this.zhixingcenterindex,
  541. statDateStart: this.statDateStart,
  542. statDateEnd: this.statDateEnd
  543. },
  544. success: (data) => {
  545. if (data.data.data == null) {
  546. return
  547. } else {
  548. this.Thisweekobj = {
  549. sumCustomer: data.data.data.sumCustomer,
  550. receivingCustomer: data.data.data.receivingCustomer,
  551. activeCustomer: data.data.data.activeCustomer,
  552. prohibitedCustomer: data.data.data.prohibitedCustomer,
  553. avgDuration: Math.floor(data.data.data.avgDuration / 60) || 0,
  554. tagCustomer: data.data.data.tagCustomer,
  555. fraction: data.data.data.fraction,
  556. wordFinishFraction: data.data.data.wordFinishFraction,
  557. receptionCount: data.data.data.receptionCount
  558. }
  559. }
  560. }
  561. })
  562. },
  563. //实时统计
  564. initrealTimeStatistics() {
  565. uni.request({
  566. url: config.service.realTimeStatistics,
  567. method: "POST",
  568. header: {
  569. 'content-type': 'application/json',
  570. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  571. },
  572. data: {
  573. houseId: this.buildingID
  574. },
  575. success: (data) => {
  576. this.LOADING = false
  577. if (data.data.data == null) {
  578. return
  579. } else {
  580. this.realtimeobj = {
  581. sumCustomer: data.data.data.sumCustomer||0,
  582. receivingCustomer: data.data.data.receivingCustomer||0,
  583. activeCustomer: data.data.data.activeCustomer||0,
  584. prohibitedCustomer: data.data.data.prohibitedCustomer||0,
  585. avgDuration: Math.floor(data.data.data.avgDuration / 60) || 0,
  586. tagCustomer: data.data.data.tagCustomer||0,
  587. fraction: data.data.data.fraction||0,
  588. wordFinishFraction: data.data.data.wordFinishFraction||0,
  589. receptionCount: data.data.data.receptionCount||0
  590. }
  591. }
  592. },
  593. fail: () => {
  594. this.LOADING = false
  595. }
  596. })
  597. },
  598. //设备
  599. initequipment() {
  600. uni.request({
  601. url: config.service.findEquipmentState,
  602. method: "POST",
  603. header: {
  604. 'content-type': 'application/json',
  605. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  606. },
  607. data: {
  608. propertyId: this.buildingID
  609. },
  610. success: (data) => {
  611. if (data.data.data == null) {
  612. return
  613. } else {
  614. this.equipmentobj = {
  615. totalNum: data.data.data.totalNum,
  616. onlineNum: data.data.data.onlineNum,
  617. activeNum: data.data.data.activeNum,
  618. lowPowerNum: data.data.data.lowPowerNum,
  619. }
  620. }
  621. }
  622. })
  623. },
  624. //我的工牌
  625. iniodianloang() {
  626. uni.request({
  627. url: config.service.findElectricity,
  628. method: "POST",
  629. header: {
  630. 'content-type': 'application/json',
  631. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  632. },
  633. data: {},
  634. success: (data) => {
  635. if (data.data.data == null) {
  636. return
  637. } else {
  638. if (data.data.data > 100) {
  639. this.percentage = 100;
  640. } else {
  641. this.equipmentObj = data.data.data
  642. if (data.data.data.onLine == 0) {
  643. this.Whetheroffline = false;
  644. } else {
  645. this.Whetheroffline = true;
  646. this.percentage = data.data.data.electricity;
  647. this.signalDevice = data.data.data.signalDevice / 1;
  648. console.log(this.signalDevice)
  649. this.audioStatus = data.data.data.audioStatus;
  650. if (this.signalDevice > 80) {
  651. this.signalDevicetext = '高';
  652. } else {
  653. if (this.signalDevice == 0) {
  654. this.signalDevicetext = '无';
  655. } else {
  656. this.signalDevicetext = '低';
  657. }
  658. }
  659. }
  660. }
  661. }
  662. }
  663. })
  664. },
  665. //选择项目弹框
  666. piskbuilding() {
  667. // this.Showhiddenunits = true;
  668. uni.navigateTo({
  669. url: "../mine/selectBuilding"
  670. })
  671. },
  672. // 项目选择确认
  673. confirm(e) {
  674. this.buildingname = e[0].label;
  675. this.buildingID = e[0].value;
  676. let lopan = {
  677. id: e[0].value,
  678. name: e[0].label
  679. }
  680. uni.setStorageSync("buildingID", lopan); //项目id写入缓存
  681. this.initworkThisWeek()
  682. this.initrealTimeStatistics()
  683. this.initequipment()
  684. this.iniodianloang()
  685. },
  686. // 项目选择取消
  687. cancel() {
  688. this.Showhiddenunits = false;
  689. },
  690. // 设备模块跳转
  691. tapjumpequipment(i) {
  692. if (this.checkAuthority('设备管理')) {
  693. uni.navigateTo({
  694. url: '/pages/mine/equipment/index?active=' + i
  695. });
  696. }
  697. },
  698. // 违禁模块跳转
  699. prohibitedtap(i) {
  700. let str = ''
  701. if (i == 1) {
  702. str = '&activeTotal=0'
  703. } else {
  704. if (this.zhixingcenterindex == 2) {
  705. str = '&activeTotal=2'
  706. } else if (this.zhixingcenterindex == 6) {
  707. str = '&activeTotal=3'
  708. } else {
  709. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}`
  710. }
  711. }
  712. uni.navigateTo({
  713. url: `/pages/center/prohibited/index?refresh=refresh&violatedStatus=1${str}`
  714. })
  715. },
  716. // 跳转正在接待页面
  717. switchJump() {
  718. uni.switchTab({
  719. url: '/pages/index/customer'
  720. });
  721. },
  722. // 跳转参数
  723. checkParams(i) {
  724. let str = ''
  725. switch (i) {
  726. case '1':
  727. str = '&activeTotal=0';
  728. break;
  729. case 'auth':
  730. str = '&activeTotal=0&validInvalid=0'
  731. break;
  732. case '3':
  733. // 筛选时间类型后传的参数
  734. if (this.zhixingcenterindex == 2) {
  735. str = '&activeTotal=2'
  736. } else if (this.zhixingcenterindex == 6) {
  737. str = '&activeTotal=3'
  738. } else {
  739. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}`
  740. }
  741. break;
  742. case '333':
  743. case '7':
  744. if (this.zhixingcenterindex == 2) {
  745. str = '&activeTotal=2&validInvalid=0'
  746. } else if (this.zhixingcenterindex == 6) {
  747. str = '&activeTotal=3&validInvalid=0'
  748. } else {
  749. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}&validInvalid=0`
  750. }
  751. break;
  752. case '6':
  753. str = '&activeTotal=0&validInvalid=0'
  754. break;
  755. case '4':
  756. str = '&activeTotal=0&markAdvisor=0&validInvalid=0'
  757. break;
  758. default:
  759. str = '&activeTotal=0&markAdvisor=0'
  760. break;
  761. }
  762. return str
  763. },
  764. // 接待记录跳转
  765. tapjumpreception(params) {
  766. // 校验是否有权限
  767. if (this.checkAuthority('接待记录')) {
  768. uni.navigateTo({
  769. url: `/pages/center/records/index?refresh=refresh${params}`
  770. });
  771. }
  772. },
  773. // 权限菜单跳转
  774. Piabodata(item) {
  775. if (item == '销讲数据') {
  776. uni.navigateTo({
  777. url: '/pages/center/Piabodata/index'
  778. });
  779. } else if (item == '接待记录') {
  780. uni.navigateTo({
  781. url: '/pages/center/records/index?refresh=refresh'
  782. });
  783. } else if (item == '值班顾问') {
  784. uni.navigateTo({
  785. url: '/pages/mine/consultanonduty/index'
  786. });
  787. } else if (item == '设备管理') {
  788. uni.navigateTo({
  789. url: '/pages/mine/equipment/index'
  790. });
  791. } else if (item == '顾问排名') {
  792. uni.navigateTo({
  793. url: '/pages/center/Piabodata/Employeesstatistics'
  794. });
  795. } else if (item == '违禁记录') {
  796. uni.navigateTo({
  797. url: '/pages/center/prohibited/index?refresh=refresh'
  798. });
  799. } else {
  800. uni.navigateTo({
  801. url: '/pages/center/consumer/index?refresh=refresh'
  802. });
  803. }
  804. },
  805. },
  806. filters: {
  807. imgFilter(type) {
  808. let path = ''
  809. switch (type) {
  810. case '客户管理':
  811. path = '../../static/images/function1.png'
  812. break
  813. case '接待记录':
  814. path = '../../static/images/function2.png'
  815. break
  816. case '销讲数据':
  817. path = '../../static/images/function4.png'
  818. break
  819. case '设备管理':
  820. path = '../../static/images/function5.png'
  821. break
  822. case '值班顾问':
  823. path = '../../static/images/function6.png'
  824. break
  825. case '顾问排名':
  826. path = '../../static/images/rankingguwen.png'
  827. break
  828. case '违禁记录':
  829. path = '../../static/images/prohibited.png'
  830. break
  831. }
  832. return path
  833. }
  834. }
  835. };
  836. </script>
  837. <style lang="scss" scoped>
  838. .modal-box{
  839. display: flex;
  840. flex-direction: column;
  841. align-items: center;
  842. width: 590rpx;
  843. padding: 50rpx 30rpx 60rpx;
  844. .modal-title{
  845. text-align: center;
  846. height: 45rpx;
  847. font-size: 32rpx;
  848. font-family: PingFangSC-Medium, PingFang SC;
  849. font-weight: 500;
  850. color: #333333;
  851. line-height: 45rpx;
  852. margin-bottom: 60rpx;
  853. }
  854. .number-box{
  855. width: 100%;
  856. display: flex;
  857. justify-content: space-around;
  858. margin-bottom: 80rpx;
  859. .item{
  860. display: flex;
  861. flex-direction: column;
  862. align-items: center;
  863. .num{
  864. margin-bottom: 12rpx;
  865. height: 60rpx;
  866. font-size: 42rpx;
  867. font-family: PingFangSC-Semibold, PingFang SC;
  868. font-weight: 600;
  869. color: #333333;
  870. line-height: 60rpx;
  871. margin-bottom: 12rpx;
  872. }
  873. .num-text{
  874. height: 45rpx;
  875. font-size: 32rpx;
  876. font-family: PingFangSC-Regular, PingFang SC;
  877. font-weight: 400;
  878. color: #333333;
  879. line-height: 45rpx;
  880. }
  881. }
  882. }
  883. .get{
  884. width: 400rpx;
  885. height: 80rpx;
  886. background: #3E50E8;
  887. border-radius: 8rpx;
  888. text-align: center;
  889. line-height: 80rpx;
  890. color: #fff;
  891. }
  892. }
  893. .update {
  894. width: 100%;
  895. height: 100%;
  896. background: rgba(0, 0, 0, 0.5);
  897. position: fixed;
  898. top: 0;
  899. left: 0;
  900. bottom: 0;
  901. right: 0;
  902. z-index: 9999;
  903. .updateBox {
  904. width: 80%;
  905. background: #FFFFFF;
  906. position: relative;
  907. left: 50%;
  908. margin-left: -40%;
  909. padding: 20rpx;
  910. border-radius: 10rpx;
  911. top: 140rpx;
  912. .top {
  913. width: 350rpx;
  914. height: 220rpx;
  915. margin: 0 auto;
  916. image {
  917. width: 100%;
  918. height: 100%;
  919. }
  920. }
  921. .btn {
  922. width: 510rpx;
  923. height: 88rpx;
  924. background: #2671E2;
  925. margin: 0 auto;
  926. display: flex;
  927. justify-content: center;
  928. align-items: center;
  929. font-size: 36rpx;
  930. border-radius: 8rpx;
  931. color: #FFFFFF;
  932. }
  933. .content {
  934. height: 268rpx;
  935. overflow-y: auto;
  936. margin: 46rpx 0;
  937. }
  938. .tit {
  939. font-size: 40rpx;
  940. text-align: center;
  941. font-weight: bold;
  942. }
  943. .close {
  944. position: absolute;
  945. bottom: -100rpx;
  946. left: 50%;
  947. margin-left: -50rpx;
  948. }
  949. }
  950. }
  951. .activecllasscet {
  952. font-size: 28rpx;
  953. font-weight: 400;
  954. color: #008ef2;
  955. }
  956. .cet {
  957. font-size: 28rpx;
  958. font-weight: 400;
  959. color: #333333;
  960. .cetview {
  961. margin-left: 20rpx;
  962. }
  963. }
  964. .cented-box {
  965. position: relative;
  966. padding: 30rpx 0;
  967. background: #F8F8F8;
  968. width: 100%;
  969. height: 100%;
  970. }
  971. .Switchingbox {
  972. padding: 0 30rpx;
  973. width: 100%;
  974. height: 44rpx;
  975. display: flex;
  976. align-items: center;
  977. .Switching1 {
  978. width: 44rpx;
  979. height: 44rpx;
  980. .Switching1-img {
  981. width: 44rpx;
  982. height: 44rpx;
  983. }
  984. }
  985. .Switching2 {
  986. margin-left: 12rpx;
  987. font-size: 32rpx;
  988. color: #303030;
  989. font-weight: 500;
  990. }
  991. .Switching3 {
  992. width: calc(100% - 280rpx);
  993. font-size: 32rpx;
  994. color: #303030;
  995. font-weight: 500;
  996. }
  997. .Switching4 {
  998. width: 112rpx;
  999. font-size: 28rpx;
  1000. color: #303030;
  1001. font-weight: 400;
  1002. text-align: right;
  1003. text-decoration: underline
  1004. }
  1005. }
  1006. .Workcard {
  1007. width: 100%;
  1008. background: #FFFFFF;
  1009. height: 154rpx;
  1010. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1011. border-radius: 12rpx;
  1012. display: flex;
  1013. .Workcard-box {
  1014. flex: 1;
  1015. height: 100%;
  1016. .Workcardimg {
  1017. width: 100%;
  1018. display: flex;
  1019. justify-content: center;
  1020. margin-top: 42rpx;
  1021. .Workcardimg1 {
  1022. width: 64rpx;
  1023. height: 36rpx;
  1024. background-image: url(../../static/images/battery.png);
  1025. background-size: 100% 100%;
  1026. padding: 8rpx;
  1027. .bar {
  1028. background-color: #43CD80;
  1029. height: 100%;
  1030. border-radius: 4rpx;
  1031. }
  1032. .bar1 {
  1033. background-color: red;
  1034. height: 100%;
  1035. border-radius: 4rpx;
  1036. }
  1037. }
  1038. .Workcardimg2 {
  1039. width: 56rpx;
  1040. height: 36rpx;
  1041. }
  1042. .Workcardimg3 {
  1043. width: 34rpx;
  1044. height: 36rpx;
  1045. }
  1046. .Workcardimg4 {
  1047. width: 50rpx;
  1048. height: 40rpx;
  1049. }
  1050. }
  1051. .Workcardtext {
  1052. width: 100%;
  1053. text-align: center;
  1054. font-size: 24rpx;
  1055. font-weight: 400;
  1056. color: #666666;
  1057. margin-top: 20rpx;
  1058. }
  1059. }
  1060. }
  1061. .title {
  1062. margin: 48rpx 0 24rpx;
  1063. padding: 0 30rpx;
  1064. width: 100%;
  1065. font-size: 30rpx;
  1066. font-weight: 600;
  1067. color: #333333;
  1068. }
  1069. .shebenbox {
  1070. margin: 0 auto;
  1071. width: 690rpx;
  1072. height: 156rpx;
  1073. background: #FFFFFF;
  1074. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1075. border-radius: 12rpx;
  1076. display: flex;
  1077. .shebenche {
  1078. width: 25%;
  1079. height: 100%;
  1080. .shebenchenum {
  1081. width: 100%;
  1082. font-size: 36rpx;
  1083. font-weight: 600;
  1084. color: #333333;
  1085. text-align: center;
  1086. margin-top: 28rpx;
  1087. }
  1088. .shebenchetext {
  1089. width: 100%;
  1090. font-size: 24rpx;
  1091. font-weight: 400;
  1092. color: #666666;
  1093. text-align: center;
  1094. margin-top: 24rpx;
  1095. }
  1096. }
  1097. }
  1098. .real-timebox {
  1099. margin: 0 auto;
  1100. width: 690rpx;
  1101. background: #FFFFFF;
  1102. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1103. border-radius: 12rpx;
  1104. padding-bottom: 36rpx;
  1105. .timebox {
  1106. width: 100%;
  1107. display: flex;
  1108. .real {
  1109. flex: 1;
  1110. height: 100%;
  1111. .realnum {
  1112. width: 100%;
  1113. font-size: 36rpx;
  1114. font-weight: 600;
  1115. color: #333333;
  1116. text-align: center;
  1117. margin-top: 36rpx;
  1118. }
  1119. .realtext {
  1120. width: 100%;
  1121. font-size: 24rpx;
  1122. font-weight: 400;
  1123. color: #666666;
  1124. text-align: center;
  1125. margin-top: 24rpx;
  1126. }
  1127. }
  1128. }
  1129. }
  1130. .commonly-box {
  1131. margin: 0 auto;
  1132. width: 690rpx;
  1133. background: #FFFFFF;
  1134. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  1135. border-radius: 12rpx;
  1136. display: flex;
  1137. flex-wrap: wrap;
  1138. padding-bottom: 36rpx;
  1139. .commonly {
  1140. width: 25%;
  1141. margin-top: 36rpx;
  1142. .commonly-img {
  1143. width: 100%;
  1144. height: 68rpx;
  1145. text-align: center;
  1146. .commonly-img1 {
  1147. width: 68rpx;
  1148. height: 68rpx;
  1149. border-radius: 50%;
  1150. }
  1151. }
  1152. .commonly-text {
  1153. width: 100%;
  1154. text-align: center;
  1155. font-size: 24rpx;
  1156. font-weight: 400;
  1157. color: #333333;
  1158. margin-top: 16rpx;
  1159. }
  1160. }
  1161. }
  1162. .endworking {
  1163. margin-top: 20rpx;
  1164. padding: 15rpx 30rpx;
  1165. width: 100%;
  1166. }
  1167. .sixty {
  1168. background-color: #FDFCDA;
  1169. }
  1170. .fifteen {
  1171. background-color: #F9C8C8;
  1172. color: #ff0000;
  1173. }
  1174. </style>