Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.vue 29 KiB

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