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.
 
 
 

1299 lines
33 KiB

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