Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

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