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.
 
 
 

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