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.
 
 
 

1335 lines
34 KiB

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