AI销管
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.
 
 
 
 

1910 lines
54 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view class="Switchingbox">
  4. <view class="Switching1">
  5. <image class="Switching1-img" src="../../static/images/loupan.png" mode=""></image>
  6. </view>
  7. <view class="Switching2 u-line-1">项目:{{buildingname}}</view>
  8. <view class="Switching4" v-if="buildingishow" @click="piskbuilding()">切换项目</view>
  9. </view>
  10. <view class="title" style="margin-top: 30rpx; display: flex; justify-content: space-between;"
  11. v-if="permissions.wdsb">
  12. <view class="gongpai">
  13. 我的工牌:{{imeiCode||'未绑定'}}
  14. </view>
  15. <view class="" style="color: #2671E2; font-weight: normal;">
  16. {{openFlag=='start'?'接待中':''}}
  17. </view>
  18. </view>
  19. <view v-if="permissions.wdsb" style="margin-bottom: 20rpx">
  20. <view class="Workcard" v-if="Whetheroffline">
  21. <view class="Workcard-box">
  22. <view class="Workcardimg">
  23. <view class="Workcardimg1">
  24. <view v-if="percentage>20" class="bar" :style="{width : percentage + '%' }"></view>
  25. <view v-if="percentage<20" class="bar1" :style="{width : percentage + '%' }"></view>
  26. </view>
  27. </view>
  28. <view class="Workcardtext">电量:{{percentage}}%</view>
  29. </view>
  30. <view v-if="equipmentType != 3" class="Workcard-box">
  31. <view class="Workcardimg">
  32. <image v-if="signalDevice==''" class="Workcardimg2" src="../../static/images/signal0.png"
  33. mode=""></image>
  34. <image v-else-if="signalDevice<20 && signalDevice>0" class="Workcardimg2"
  35. src="../../static/images/signal1.png" mode=""></image>
  36. <image v-else-if="signalDevice<50 && signalDevice>20" class="Workcardimg2"
  37. src="../../static/images/signal2.png" mode=""></image>
  38. <image v-else-if="signalDevice<70 && signalDevice>50" class="Workcardimg2"
  39. src="../../static/images/signal3.png" mode=""></image>
  40. <image v-else-if="signalDevice<90 && signalDevice>70" class="Workcardimg2"
  41. src="../../static/images/signal4.png" mode=""></image>
  42. <image v-else-if="signalDevice<=100 && signalDevice>90" class="Workcardimg2"
  43. src="../../static/images/signal5.png" mode=""></image>
  44. </view>
  45. <view class="Workcardtext">信号:{{signalDevicetext}}</view>
  46. </view>
  47. <view v-else class="Workcard-box">
  48. <view class="Workcardimg">
  49. <image v-if="bsignalDevice<90 && bsignalDevice>0" class="Workcardimg2"
  50. src="../../static/images/signal5.png" mode=""></image>
  51. <image v-else class="Workcardimg2" src="../../static/images/signal0.png"
  52. mode=""></image>
  53. </view>
  54. <view class="Workcardtext">信号:{{bsignalDevice<90 && bsignalDevice>0?'正常':'无'}}</view>
  55. </view>
  56. <view class="Workcard-box">
  57. <view class="Workcardimg">
  58. <image v-if="audioStatus=='true'" class="Workcardimg3"
  59. src="../../static/images/Thtapedrive1.png" mode=""></image>
  60. <image v-if="audioStatus=='false'" class="Workcardimg3"
  61. src="../../static/images/Thtapedrive2.png" mode=""></image>
  62. </view>
  63. <view v-if="audioStatus=='true'" class="Workcardtext">录音:已开启</view>
  64. <view v-if="audioStatus=='false'" class="Workcardtext">录音:未开启</view>
  65. </view>
  66. </view>
  67. <view class="Workcard" v-if="Whetheroffline==false">
  68. <view class="Workcard-box">
  69. <view class="Workcardimg">
  70. <image class="Workcardimg4" src="../../static/images/offline.png" mode=""></image>
  71. </view>
  72. <view class="Workcardtext">设备离线</view>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 临期项目提醒 -->
  77. <view class="endworking" v-if="bulidIngObj.daysRemaining <= 60"
  78. :class="{sixty: (bulidIngObj.daysRemaining > 15 && bulidIngObj.daysRemaining <= 60), fifteen: bulidIngObj.daysRemaining <= 15}">
  79. 您的服务于{{ bulidIngObj.endWorking }}到期,为了避免影响您的使用,请与服务商联系
  80. </view>
  81. <template v-if="CHECKAUTHORITY('zxscsy')">
  82. <view class="contbox">
  83. <view class="title">
  84. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  85. mode="" />
  86. 转写消费
  87. </view>
  88. <view class="shebenbox">
  89. <view class="shebenche">
  90. <view class="shebenchenum">{{paraphraseObj.rechargeSum || 0}}</view>
  91. <view class="shebenchetext">购买小时</view>
  92. </view>
  93. <view class="shebenche">
  94. <view class="shebenchenum">{{paraphraseObj.presenterSum || 0}}</view>
  95. <view class="shebenchetext">赠送小时</view>
  96. </view>
  97. <view class="shebenche">
  98. <view class="shebenchenum">{{paraphraseObj.useSum || 0}}</view>
  99. <view class="shebenchetext">已用小时</view>
  100. </view>
  101. <view class="shebenche">
  102. <view class="shebenchenum" :style="paraphraseObj.surplusSum < 100 ? 'color: red' : ''">
  103. {{paraphraseObj.surplusSum || 0}}
  104. </view>
  105. <view class="shebenchetext">剩余小时</view>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <!-- 设备总览 -->
  111. <view class="contbox" v-if="permissions.sbtj">
  112. <view class="title">
  113. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  114. mode="" />
  115. 设备总览
  116. </view>
  117. <view class="shebenbox">
  118. <view class="shebenche" @click="tapjumpequipment(0)">
  119. <view class="shebenchenum">{{equipmentobj.totalNum || 0}}</view>
  120. <view class="shebenchetext">设备总数</view>
  121. </view>
  122. <view class="shebenche" @click="tapjumpequipment(1)">
  123. <view class="shebenchenum">{{equipmentobj.onlineNum || 0}}</view>
  124. <view class="shebenchetext">在线</view>
  125. </view>
  126. <view class="shebenche" @click="tapjumpequipment(3)">
  127. <view class="shebenchenum">{{equipmentobj.activeNum || 0}}</view>
  128. <view class="shebenchetext">活跃</view>
  129. </view>
  130. <view class="shebenche" @click="tapjumpequipment(2)">
  131. <view class="shebenchenum" style="color: red;">{{operation.lowPowerNum || 0}}</view>
  132. <view class="shebenchetext">低电工牌</view>
  133. </view>
  134. </view>
  135. </view>
  136. <!-- 今日工作 -->
  137. <view class="contbox" v-if="permissions.sstj">
  138. <view class="title" >
  139. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  140. mode="" />今日工作
  141. <view style="width: 33%;"/>
  142. <view class="title1" style="flex: 1;">
  143. <view class="title1-box" @click="taptimeisshow1(0)">
  144. <view style="height: 42rpx;" :class="{ activecltab1: eharTab.active1 == 0 }">全部</view>
  145. </view>
  146. <view class="title1-box" @click="taptimeisshow1(1)">
  147. <view style="height: 42rpx;" :class="{ activecltab1: eharTab.active1 == 1 }">首访</view>
  148. </view>
  149. <view class="title1-box" @click="taptimeisshow1(2)">
  150. <view style="height: 42rpx;" :class="{ activecltab1: eharTab.active1 == 2 }">复访</view>
  151. </view>
  152. </view>
  153. </view>
  154. <view class="real-timebox">
  155. <view class="timebox">
  156. <view class="real" @click="tapjumpreception(checkParams('1'))">
  157. <view class="realnum">{{realtimeobj.receptionCount || 0}}</view>
  158. <view class="realtext">接待量</view>
  159. </view>
  160. <view class="real" @click="tapjumpreception(checkParams('6'))">
  161. <view class="realnum">{{realtimeobj.activeCustomer|| 0}}</view>
  162. <view class="realtext">有效接待</view>
  163. </view>
  164. <view class="real" @click="tapjumpreception(checkParams('4'))">
  165. <view class="realnum">{{realtimeobj.tagCustomer || 0}}</view>
  166. <view class="realtext">未标顾问</view>
  167. </view>
  168. <view class="real" @click="prohibitedtap(1)" v-if="methodsisshow">
  169. <view class="realnum" style="color: red;">
  170. {{realtimeobj.prohibitedCustomer || 0}}
  171. </view>
  172. <view class="realtext">违禁次数</view>
  173. </view>
  174. </view>
  175. <view class="timebox">
  176. <view class="real" @click="tapjumpreception(checkParams('auth'))">
  177. <view class="realnum u-flex" style="justify-content: center">{{realtimeobj.fraction || 0}}<text
  178. style="font-weight: 400;font-family: SimHei;font-size: 30rpx;">%</text>
  179. <!-- <image class="qushi-icon" src="/static/images/excute.png" mode="" /> -->
  180. </view>
  181. <view class="realtext">平均执行率</view>
  182. </view>
  183. <view class="real" @click="tapjumpreception(checkParams('auth'))">
  184. <view class="realnum">{{realtimeobj.avgDuration|| 0}}<text
  185. style="font-size: 30rpx;font-weight: 400;font-family: SimHei">min</text></view>
  186. <view class="realtext">平均接待时长</view>
  187. </view>
  188. <view class="real" @click="tapjumpreception(checkParams('6'))">
  189. <view class="realnum">{{realtimeobj.wordFraction|| 0}}%</view>
  190. <view class="realtext">平均挖掘执行率</view>
  191. </view>
  192. <view class="real" @click="toCustomerManagement('dateType')">
  193. <view class="realnum">{{realtimeobj.sumLevelFraction || 0}}%</view>
  194. <view class="realtext">平均意向度</view>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. <!-- 近30天 -->
  200. <view class="contbox" v-if="permissions.gzlj">
  201. <view class="title">
  202. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  203. mode="" />
  204. <view style="width: 50%;" @click="taptimeisshow">
  205. <!-- 概览 -->
  206. {{choiceIndex}}累计<u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  207. </view>
  208. <view class="title2" style="flex: 1;">
  209. <view class="title2-box" @click="taptimeisshow2(0)">
  210. <view style="height: 42rpx;" :class="{ activecltab2: eharTab.active2 == 0 }">全部</view>
  211. </view>
  212. <view class="title2-box" @click="taptimeisshow2(1)">
  213. <view style="height: 42rpx;" :class="{ activecltab2: eharTab.active2 == 1 }">首访</view>
  214. </view>
  215. <view class="title2-box" @click="taptimeisshow2(2)">
  216. <view style="height: 42rpx;" :class="{ activecltab2: eharTab.active2 == 2 }">复访</view>
  217. </view>
  218. </view>
  219. </view>
  220. <view class="real-timebox">
  221. <view class="timebox">
  222. <view class="real" @click="tapjumpreception(checkParams('3'))">
  223. <view class="realnum">{{Thisweekobj.receptionCount || 0}}</view>
  224. <view class="realtext">接待量</view>
  225. </view>
  226. <view class="real" @click="tapjumpreception(checkParams('7'))">
  227. <view class="realnum">{{Thisweekobj.activeCustomer|| 0}}</view>
  228. <view class="realtext">有效接待</view>
  229. </view>
  230. <view class="real" @click="tapjumpreception(checkParams('44'))">
  231. <view class="realnum">{{Thisweekobj.tagCustomer || 0}}</view>
  232. <view class="realtext">未标顾问</view>
  233. </view>
  234. <view class="real" @click="prohibitedtap(2)" v-if="methodsisshow">
  235. <view class="realnum" style="color: red;">{{Thisweekobj.prohibitedCustomer || 0}}</view>
  236. <view class="realtext">违禁次数</view>
  237. </view>
  238. </view>
  239. <view class="timebox" style="margin-bottom:0;">
  240. <view class="real" @click="tapjumpreception(checkParams('333'))">
  241. <view class="realnum u-flex" style="justify-content: center">{{Thisweekobj.fraction || 0}}<text
  242. style="font-weight: 400;font-family: SimHei;font-size: 30rpx;">%</text>
  243. </view>
  244. <view class="realtext">平均执行率</view>
  245. </view>
  246. <view class="real" @click="tapjumpreception(checkParams('333'))">
  247. <view class="realnum">{{Thisweekobj.avgDuration || 0}}<text
  248. style="font-size: 30rpx;font-weight: 400;font-family: SimHei">min</text></view>
  249. <view class="realtext">平均接待时长</view>
  250. </view>
  251. <view class="real" @click="tapjumpreception(checkParams('333'))">
  252. <view class="realnum">{{Thisweekobj.wordFraction || 0}}%</view>
  253. <view class="realtext">平均挖掘执行率</view>
  254. </view>
  255. <view class="real" @click="toCustomerManagement()">
  256. <view class="realnum">{{Thisweekobj.sumLevelFraction || 0}}%</view>
  257. <view class="realtext">平均意向度</view>
  258. </view>
  259. </view>
  260. </view>
  261. </view>
  262. <!-- 常用功能 -->
  263. <view class="contbox">
  264. <view class="title" v-if="hospitalityShow">
  265. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  266. mode="" />接待管理
  267. </view>
  268. <view class="commonly-box">
  269. <view class="commonly" @click="Piabodata('接待记录')" v-if="permissions.jdjl">
  270. <view class="commonly-img">
  271. <template v-if="$domain == 'zh.aihxz.com'">
  272. <image class="commonly-img1"
  273. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu1.png" mode="">
  274. </image>
  275. </template>
  276. <template v-else>
  277. <image class="commonly-img1"
  278. src="https://static.quhouse.com/4649b5bd19124afca0f1a809f93bfd73.png" mode=""></image>
  279. </template>
  280. </view>
  281. <view class="commonly-text">接待记录</view>
  282. </view>
  283. <view class="commonly" @click="Piabodata('违禁记录')" v-if="permissions.wjjl">
  284. <view class="commonly-img">
  285. <template v-if="$domain == 'zh.aihxz.com'">
  286. <image class="commonly-img1"
  287. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu7.png" mode="">
  288. </image>
  289. </template>
  290. <template v-else>
  291. <image class="commonly-img1"
  292. src="https://static.quhouse.com/b1dd1da2a969465bbbf41818320b8487.png" mode=""></image>
  293. </template>
  294. </view>
  295. <view class="commonly-text">违禁记录</view>
  296. </view>
  297. <view class="commonly" @click="toUserinsightinto()" v-if="permissions.tddb">
  298. <view class="commonly-img">
  299. <template v-if="$domain == 'zh.aihxz.com'">
  300. <image class="commonly-img1"
  301. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu6.png" mode="">
  302. </image>
  303. </template>
  304. <template v-else>
  305. <image class="commonly-img1"
  306. src="https://static.quhouse.com/c2c2e1af3d5f41d180ec55a04a5d4f26.png" mode=""></image>
  307. </template>
  308. </view>
  309. <view class="commonly-text">客户画像</view>
  310. </view>
  311. </view>
  312. <view class="title" v-if="dataAnalysisShow">
  313. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  314. mode="" />数据分析
  315. </view>
  316. <view class="commonly-box">
  317. <view class="commonly" @click="Piabodata('销讲分析')" v-if="permissions.xjfx">
  318. <view class="commonly-img">
  319. <template v-if="$domain == 'zh.aihxz.com'">
  320. <image class="commonly-img1"
  321. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu9.png" mode="">
  322. </image>
  323. </template>
  324. <template v-else>
  325. <image class="commonly-img1"
  326. src="https://static.quhouse.com/1f01dfa38203493b88d9668a506fdff3.png" mode=""></image>
  327. </template>
  328. </view>
  329. <view class="commonly-text">销讲分析</view>
  330. </view>
  331. <view class="commonly" @click="toTrendAnalysis()" v-if="permissions.lpdb">
  332. <view class="commonly-img">
  333. <template v-if="$domain == 'zh.aihxz.com'">
  334. <image class="commonly-img1"
  335. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu8.png" mode="">
  336. </image>
  337. </template>
  338. <template v-else>
  339. <image class="commonly-img1"
  340. src="https://static.quhouse.com/df070b1a2d5e48359c7de5654e4f7a17.png" mode=""></image>
  341. </template>
  342. </view>
  343. <view class="commonly-text">销讲趋势</view>
  344. </view>
  345. <view class="commonly" @click="Piabodata('顾问排名')" v-if="permissions.gwpm">
  346. <view class="commonly-img">
  347. <template v-if="$domain == 'zh.aihxz.com'">
  348. <image class="commonly-img1"
  349. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu10.png" mode="">
  350. </image>
  351. </template>
  352. <template v-else>
  353. <image class="commonly-img1"
  354. src="https://static.quhouse.com/f5a6b2d6032348a1b256cfd7083be436.png" mode=""></image>
  355. </template>
  356. </view>
  357. <view class="commonly-text">顾问排名</view>
  358. </view>
  359. <view class="commonly" @click="toStaffAnalysis()" v-if="permissions.xjqs">
  360. <view class="commonly-img">
  361. <template v-if="$domain == 'zh.aihxz.com'">
  362. <image class="commonly-img1"
  363. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu3.png" mode="">
  364. </image>
  365. </template>
  366. <template v-else>
  367. <image class="commonly-img1"
  368. src="https://static.quhouse.com/c2d3801540cf4880a68cce0e04eb59b0.png" mode=""></image>
  369. </template>
  370. </view>
  371. <view class="commonly-text">员工分析</view>
  372. </view>
  373. <view class="commonly" @click="toRequireAnalysis()" v-if="permissions.xqwjfx">
  374. <view class="commonly-img">
  375. <template v-if="$domain == 'zh.aihxz.com'">
  376. <image class="commonly-img1"
  377. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu3.png" mode="">
  378. </image>
  379. </template>
  380. <template v-else>
  381. <image class="commonly-img1"
  382. src="https://static.quhouse.com/c2d3801540cf4880a68cce0e04eb59b0.png" mode=""></image>
  383. </template>
  384. </view>
  385. <view class="commonly-text">需求挖掘分析</view>
  386. </view>
  387. <view class="commonly" @click="toDataBoard" v-if="permissions.sjkb_sy">
  388. <view class="commonly-img">
  389. <template v-if="$domain == 'zh.aihxz.com'">
  390. <image class="commonly-img1"
  391. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu12.png" mode="">
  392. </image>
  393. </template>
  394. <template v-else>
  395. <image class="commonly-img1" src="https://static.quhouse.com/20230523104819.jpg" mode="">
  396. </image>
  397. </template>
  398. </view>
  399. <view class="commonly-text">数据看板</view>
  400. </view>
  401. <view class="commonly" @click="toWoring" v-if="permissions.xmyj_sy">
  402. <view class="commonly-img">
  403. <template v-if="$domain == 'zh.aihxz.com'">
  404. <image class="commonly-img1"
  405. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu1.png" mode="">
  406. </image>
  407. </template>
  408. <template v-else>
  409. <image class="commonly-img1" src="https://static.quhouse.com/20230523104803.jpg" mode="">
  410. </image>
  411. </template>
  412. </view>
  413. <view class="commonly-text">项目预警</view>
  414. </view>
  415. </view>
  416. <view class="title" v-if="teamManagementShow">
  417. <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
  418. mode="" />团队管理
  419. </view>
  420. <view class="commonly-box">
  421. <view class="commonly" @click="Theteamcompared()" v-if="permissions.gwnl">
  422. <view class="commonly-img">
  423. <template v-if="$domain == 'zh.aihxz.com'">
  424. <image class="commonly-img1"
  425. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu2.png" mode="">
  426. </image>
  427. </template>
  428. <template v-else>
  429. <image class="commonly-img1"
  430. src="https://static.quhouse.com/4f5a3a61c06a4508a806eb290ef678e6.png" mode="">
  431. </image>
  432. </template>
  433. </view>
  434. <view class="commonly-text">团队对比</view>
  435. </view>
  436. <view class="commonly" @click="Groupcontrast()" v-if="permissions.yhhx">
  437. <view class="commonly-img">
  438. <template v-if="$domain == 'zh.aihxz.com'">
  439. <image class="commonly-img1"
  440. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu13.png" mode="">
  441. </image>
  442. </template>
  443. <template v-else>
  444. <image class="commonly-img1"
  445. src="https://static.quhouse.com/759c2e3240e54213827196559ce38fa4.png" mode="">
  446. </image>
  447. </template>
  448. </view>
  449. <view class="commonly-text">集团对比</view>
  450. </view>
  451. <view class="commonly" @click="Piabodata('设备管理')" v-if="permissions.sbgl">
  452. <view class="commonly-img">
  453. <template v-if="$domain == 'zh.aihxz.com'">
  454. <image class="commonly-img1"
  455. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu4.png" mode="">
  456. </image>
  457. </template>
  458. <template v-else>
  459. <image class="commonly-img1"
  460. src="https://static.quhouse.com/e617133ecbbd46498e30719444fc02e8.png" mode="">
  461. </image>
  462. </template>
  463. </view>
  464. <view class="commonly-text">设备管理</view>
  465. </view>
  466. <view class="commonly" @click="Piabodata('值班顾问')" v-if="permissions.zbgw">
  467. <view class="commonly-img">
  468. <template v-if="$domain == 'zh.aihxz.com'">
  469. <image class="commonly-img1"
  470. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/bianzu/bianzu5.png" mode="">
  471. </image>
  472. </template>
  473. <template v-else>
  474. <image class="commonly-img1"
  475. src="https://static.quhouse.com/196fcbc7f6aa456cb9dff22cd3753445.png" mode="">
  476. </image>
  477. </template>
  478. </view>
  479. <view class="commonly-text">值班顾问</view>
  480. </view>
  481. </view>
  482. </view>
  483. <!-- 项目切换 -->
  484. <view v-if="Showhiddenunits">
  485. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="lpanlist"
  486. @cancel="cancel" @confirm="confirm"></u-select>
  487. </view>
  488. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  489. <u-popup v-model="timeshow" mode="bottom">
  490. <view class="timeview" :style="{ color: zhixingcenterindex == 2 ? '#2B6EFF' : '#333333' }"
  491. @click="tabtimetap(2,'近7天')">近7天</view>
  492. <view class="timeview" :style="{ color: zhixingcenterindex == 6 ? '#2B6EFF' : '#333333' }"
  493. @click="tabtimetap(6,'近30天')">近30天</view>
  494. <view class="timeview" :style="{ color: zhixingcenterindex == 7 ? '#2B6EFF' : '#333333' }"
  495. @click="tabtimetap(7,'自定义')">自定义</view>
  496. </u-popup>
  497. <!-- 弹窗显示蓝牙列表,链接按钮 -->
  498. <u-popup v-model="bluetoothShow" mode="bottom">
  499. <view class="bluetoothBox">
  500. <view class="bluetoothTitle">
  501. <view class="bluetoothTitleText">蓝牙列表</view>
  502. </view>
  503. <view class="bluetoothList">
  504. <view class="bluetoothItem" v-for="item in blist" :key="item.deviceId">
  505. {{item.name}}
  506. <view @click="connectDevice(item)" class="bluetoothBtn">链接</view>
  507. </view>
  508. </view>
  509. </view>
  510. </u-popup>
  511. <!-- 加载组件 -->
  512. <u-loadings v-model="LOADING"></u-loadings>
  513. </view>
  514. </template>
  515. <script>
  516. import { sendData, setNotification,ab2hex,connectBlue } from "@/utils/blue.js";
  517. import { mapState, mapMutations } from 'vuex';
  518. var config = require("../../config");
  519. export default {
  520. data() {
  521. return {
  522. activeTotal: 4,
  523. eharTab: {
  524. active1: 0,
  525. active2: 0,
  526. active3: 0,
  527. active4: 0,
  528. },
  529. // tabbar配置项
  530. $domain: this.$domain,
  531. //--- end --- tabbar配置项
  532. userInfo: {},
  533. Showhiddenunits: false,
  534. lpanlist: [], //项目列表
  535. buildingname: '', //项目名
  536. buildingID: '', //项目id
  537. buildingishow: false, //是否选择项目
  538. // Myworkcard: false,
  539. percentage: '', //设备电量
  540. Whetheroffline: false, //是否离线
  541. signalDevice: 0, //信号
  542. bsignalDevice: 0,
  543. signalDevicetext: "",
  544. imeiCode: '', //设备号
  545. openFlag: '', //接待是否
  546. choiceIndex: '近7天',
  547. audioStatus: false,
  548. equipmentisshow: false,
  549. timeshow: false,
  550. equipmentobj: {
  551. totalNum: '',
  552. onlineNum: '',
  553. activeNum: '',
  554. lowPowerNum: '',
  555. },
  556. operation: {
  557. receptionCount: '',
  558. accountCount: '',
  559. forbiddenCount: '',
  560. lowPowerNum: ''
  561. },
  562. Menulist: [],
  563. realtimeobj: {
  564. sumCustomer: '',
  565. receivingCustomer: '',
  566. activeCustomer: '',
  567. prohibitedCustomer: '',
  568. tagCustomer: '',
  569. fraction: '',
  570. receptionCount: '',
  571. sumLevelFraction: '',
  572. },
  573. Thisweekobj: {
  574. sumCustomer: '',
  575. receivingCustomer: '',
  576. activeCustomer: '',
  577. prohibitedCustomer: '',
  578. tagCustomer: '',
  579. fraction: '',
  580. receptionCount: ''
  581. },
  582. methodsisshow: false,
  583. zhixingcenterindex: 2,
  584. totalTimeShow: false,
  585. statDateStart: '',
  586. statDateEnd: '',
  587. visitRecord: null,
  588. visitRecord1: null,
  589. permissions: {}, // 权限菜单
  590. paraphraseObj: {}, // 转写消费
  591. blist: [],
  592. bluetoothShow: false,
  593. equipmentType: 0,
  594. //蓝牙状态
  595. wifiDetail: '' //wifi信号
  596. };
  597. },
  598. computed: {
  599. ...mapState(['connectDev','connectState']),
  600. // 团队管理
  601. teamManagementShow() {
  602. let permissions = this.permissions
  603. return permissions.gwnl || permissions.yhhx || permissions.sbgl || permissions.zbgw
  604. },
  605. // 数据分析
  606. dataAnalysisShow() {
  607. let permissions = this.permissions
  608. return permissions.xjfx || permissions.lpdb || permissions.gwpm || permissions.xjqs || permissions
  609. .sjkb_sy || permissions.xmyj_sy
  610. },
  611. // 接待管理
  612. hospitalityShow() {
  613. let permissions = this.permissions
  614. return permissions.jdjl || permissions.wjjl || permissions.tddb
  615. },
  616. },
  617. watch: {
  618. connectDev(newVal) {
  619. if (newVal) {
  620. this.notiInit();
  621. }
  622. }
  623. },
  624. onLoad() {
  625. console.log(this.$domain, 'this.$domain')
  626. if (this.$domain == 'zh.aihxz.com') {
  627. uni.setNavigationBarTitle({
  628. title: '云筑数智助手',
  629. })
  630. }
  631. this.equipmentType = uni.getStorageSync('equipmentType') || 0;
  632. this.LOADING = true
  633. this.sendLog({
  634. houseId: uni.getStorageSync('buildingID').id,
  635. houseName: uni.getStorageSync('buildingID').name
  636. })
  637. },
  638. onPullDownRefresh() {
  639. this.getMenu()
  640. this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
  641. if (this.userInfo.dataCode == 6 || this.userInfo.dataCode == 3) {
  642. this.methodsisshow = false;
  643. } else {
  644. this.methodsisshow = true;
  645. }
  646. if (this.userInfo.zkProperties.length == 1) {
  647. this.buildingID = uni.getStorageSync('buildingID').id;
  648. this.buildingname = uni.getStorageSync('buildingID').name;
  649. this.buildingishow = false;
  650. } else {
  651. this.buildingishow = true;
  652. this.buildingname = uni.getStorageSync('buildingID').name;
  653. this.buildingID = uni.getStorageSync('buildingID').id;
  654. this.userInfo.zkProperties.forEach(item => {
  655. item.label = item.propertyName;
  656. item.value = item.id
  657. })
  658. this.lpanlist = this.userInfo.zkProperties
  659. }
  660. if (this.userInfo.dataCode == 6) {
  661. // this.Myworkcard = true;
  662. this.equipmentisshow = false;
  663. this.iniodianloang()
  664. } else {
  665. //蓝牙获取信息
  666. if (this.equipmentType == 3) this.notiInit();
  667. uni.setStorageSync("equipmentType", 0)
  668. this.equipmentisshow = true;
  669. // this.Myworkcard = false;
  670. this.initequipment()
  671. this.waitForOperation()
  672. }
  673. this.initworkThisWeek()
  674. this.initrealTimeStatistics()
  675. setTimeout(() => {
  676. uni.stopPullDownRefresh()
  677. }, 3000)
  678. },
  679. onShow() {
  680. this.upDateBulidIngObj()
  681. this.getMenu()
  682. this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
  683. if (this.userInfo.dataCode == 6 || this.userInfo.dataCode == 3) {
  684. this.methodsisshow = false;
  685. } else {
  686. this.methodsisshow = true;
  687. }
  688. if (this.userInfo.zkProperties && this.userInfo.zkProperties.length == 1) {
  689. this.buildingID = uni.getStorageSync('buildingID').id;
  690. this.buildingname = uni.getStorageSync('buildingID').name;
  691. this.buildingishow = false;
  692. uni.setStorageSync('orgCode', this.userInfo.zkProperties[0].orgCode)
  693. } else {
  694. this.buildingishow = true;
  695. this.buildingname = uni.getStorageSync('buildingID').name;
  696. this.buildingID = uni.getStorageSync('buildingID').id;
  697. if (this.userInfo.zkProperties && this.userInfo.zkProperties.length) {
  698. this.userInfo.zkProperties.forEach(item => {
  699. item.label = item.propertyName;
  700. item.value = item.id
  701. })
  702. }
  703. this.lpanlist = this.userInfo.zkProperties
  704. }
  705. if (this.userInfo.dataCode == 6) {
  706. // this.Myworkcard = true;
  707. this.equipmentisshow = false;
  708. this.iniodianloang()
  709. } else {
  710. if (this.equipmentType == 3) this.notiInit();
  711. uni.setStorageSync("equipmentType", 0)
  712. this.equipmentisshow = true;
  713. // this.Myworkcard = false;
  714. this.initequipment()
  715. this.waitForOperation()
  716. }
  717. this.initworkThisWeek()
  718. this.initrealTimeStatistics()
  719. this.updateInit()
  720. this.findByHouseIdForRecharge()
  721. //蓝牙获取信息
  722. this.notiInit();
  723. },
  724. methods: {
  725. notiInit() {
  726. var that = this;
  727. if (this.connectDev) {
  728. setNotification().then(() => {
  729. uni.onBLECharacteristicValueChange((res) => {
  730. let data = ab2hex(res.value);
  731. if (data.pre[1] == "81") {
  732. that.wifiDetail = JSON.parse(data.value)
  733. console.log(1112,that.wifiDetail)
  734. //获取绝对值
  735. that.bsignalDevice = that.wifiDetail?Math.abs(that.wifiDetail.rssi):0
  736. console.log(1113,that.bsignalDevice)
  737. }
  738. });
  739. })
  740. setTimeout(() => {
  741. sendData([0xA0,0x81,0x00]);
  742. },1000)
  743. }
  744. },
  745. // 跳转客户详情
  746. toCustomerManagement(str) {
  747. console.log(str)
  748. console.log(this.zhixingcenterindex)
  749. if (str != 'dateType') {
  750. // dateType == 2 //
  751. if (this.zhixingcenterindex != 7) {
  752. let index = this.zhixingcenterindex == 6 ? 3 : 2
  753. uni.navigateTo({
  754. url: `/pages/center/consumer/index?refresh=refresh&dateType=${index}`
  755. })
  756. } else {
  757. uni.navigateTo({
  758. url: `/pages/center/consumer/index?refresh=refresh&dateType=4&staTime=${this.statDateStart}&endTime=${this.statDateEnd}`
  759. })
  760. }
  761. } else {
  762. console.log('adasdasljdlks', str)
  763. uni.navigateTo({
  764. url: `/pages/center/consumer/index?refresh=refresh&dateType=0`
  765. })
  766. }
  767. },
  768. // 数据看板
  769. toDataBoard() {
  770. uni.navigateTo({
  771. url: '/pages/center/dataBoard/dataBoard'
  772. });
  773. },
  774. toWoring() {
  775. uni.navigateTo({
  776. url: '/pages/center/warningList/warningList'
  777. });
  778. },
  779. // 需求挖掘分析
  780. toRequireAnalysis() {
  781. uni.navigateTo({
  782. url: '/pages/center/Piabodata/requireminingAnalysis'
  783. });
  784. },
  785. updateInit() {
  786. this.$u.get(config.service.notReadNum, {
  787. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  788. projectId: uni.getStorageSync('buildingID').id
  789. }).then(res => {
  790. if (res > 0) {
  791. uni.setTabBarBadge({ //显示数字
  792. index: 4, //tabbar下标
  793. text: `${res}` //数字
  794. })
  795. } else {
  796. uni.removeTabBarBadge({
  797. index: 4
  798. })
  799. }
  800. }).catch(e => {
  801. uni.removeTabBarBadge({
  802. index: 4
  803. })
  804. })
  805. },
  806. indexStatus(i) {
  807. if (this.permissions.sbgl == true) {
  808. if (i == 0) {
  809. uni.switchTab({
  810. url: "/pages/index/customer"
  811. })
  812. } else if (i == 1) {
  813. uni.navigateTo({
  814. url: '/pages/center/records/index?refresh=refresh&markAdvisor=0'
  815. });
  816. } else if (i == 3) {
  817. uni.navigateTo({
  818. url: '/pages/center/prohibited/index?refresh=refresh'
  819. });
  820. }
  821. }
  822. },
  823. //时间选择
  824. tabtimetap(index, str) {
  825. this.timeshow = false;
  826. if (index == 7) {
  827. this.totalTimeShow = true;
  828. } else {
  829. console.log(str)
  830. this.choiceIndex = str
  831. this.zhixingcenterindex = index;
  832. this.initworkThisWeek()
  833. }
  834. },
  835. taptimeisshow() {
  836. this.timeshow = true;
  837. },
  838. taptimeisshow1(idx) {
  839. this.eharTab.active1 = idx
  840. if(idx == 0){
  841. this.visitRecord = null
  842. }else{
  843. this.visitRecord = idx
  844. }
  845. this.initrealTimeStatistics()
  846. },
  847. taptimeisshow2(idx) {
  848. this.eharTab.active2 = idx
  849. if(idx == 0){
  850. this.visitRecord1 = null
  851. }else{
  852. this.visitRecord1 = idx
  853. }
  854. this.initworkThisWeek()
  855. },
  856. //获取权限
  857. getMenu() {
  858. uni.request({
  859. url: config.service.getMenu,
  860. method: "POST",
  861. header: {
  862. 'content-type': 'application/json',
  863. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  864. },
  865. success: (data) => {
  866. console.log(data, 'dsadjsakljlkj123kl12321')
  867. let rescor = data.data;
  868. if (rescor.code == 0) {
  869. uni.setStorageSync("weapp_session_Menu_data", rescor.data)
  870. console.log(rescor.data, '这里')
  871. this.permissions = rescor.data;
  872. console.log(this.permissions, '这里per')
  873. }
  874. }
  875. })
  876. },
  877. //自定义时间
  878. totalTimeChange(e) {
  879. this.statDateStart = e.startDate;
  880. this.statDateEnd = e.endDate;
  881. this.choiceIndex = `${e.startDate.replace(/\-/g, '.')}-${e.endDate.replace(/\-/g, '.')}`
  882. this.zhixingcenterindex = 7;
  883. this.initworkThisWeek()
  884. },
  885. tabtimeclick(i) {
  886. if (i == 7) {
  887. this.totalTimeShow = true;
  888. } else {
  889. this.zhixingcenterindex = i;
  890. this.initworkThisWeek()
  891. }
  892. },
  893. initworkThisWeek() {
  894. uni.request({
  895. url: config.service.workThisWeek,
  896. method: "POST",
  897. header: {
  898. 'content-type': 'application/json',
  899. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  900. },
  901. data: {
  902. houseId: this.buildingID,
  903. dateType: this.zhixingcenterindex == 7 ? null : this.zhixingcenterindex,
  904. statDateStart: this.statDateStart,
  905. statDateEnd: this.statDateEnd,
  906. visitRecord: this.visitRecord1
  907. },
  908. success: (data) => {
  909. if (data.data.data == null) {
  910. return
  911. } else {
  912. this.Thisweekobj = data.data.data
  913. }
  914. }
  915. })
  916. },
  917. //实时统计
  918. initrealTimeStatistics() {
  919. uni.request({
  920. url: config.service.realTimeStatistics,
  921. method: "POST",
  922. header: {
  923. 'content-type': 'application/json',
  924. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  925. },
  926. data: {
  927. houseId: this.buildingID,
  928. visitRecord: this.visitRecord
  929. },
  930. success: (data) => {
  931. this.LOADING = false
  932. if (data.data.data == null) {
  933. return
  934. } else {
  935. this.realtimeobj = data.data.data
  936. if (data.data.data.receivingCustomer > 0) {
  937. uni.setTabBarBadge({
  938. index: 0,
  939. text: `${data.data.data.receivingCustomer}`
  940. })
  941. } else {
  942. uni.removeTabBarBadge({
  943. index: 0,
  944. })
  945. }
  946. }
  947. },
  948. fail: () => {
  949. this.LOADING = false
  950. }
  951. })
  952. },
  953. // 转写充值剩余
  954. findByHouseIdForRecharge() {
  955. this.$u.get(`/cusLvStatistics/findByHouseIdForRecharge?houseId=${this.buildingID}`).then(res => {
  956. console.log(res)
  957. if (res) {
  958. this.paraphraseObj = res.list
  959. }
  960. })
  961. },
  962. //设备
  963. initequipment() {
  964. uni.request({
  965. url: config.service.findEquipmentState,
  966. method: "POST",
  967. header: {
  968. 'content-type': 'application/json',
  969. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  970. },
  971. data: {
  972. propertyId: this.buildingID
  973. },
  974. success: (data) => {
  975. if (data.data.data == null) {
  976. return
  977. } else {
  978. this.equipmentobj = {
  979. totalNum: data.data.data.totalNum,
  980. onlineNum: data.data.data.onlineNum,
  981. activeNum: data.data.data.activeNum,
  982. lowPowerNum: data.data.data.lowPowerNum,
  983. }
  984. }
  985. }
  986. })
  987. },
  988. // 待处理
  989. waitForOperation() {
  990. this.$u.post('/cusLvStatistics/waitForOperation ', {
  991. houseId: this.buildingID
  992. })
  993. .then(res => {
  994. // console.log(res,'带接待')
  995. this.operation.receptionCount = res.receptionCount
  996. this.operation.accountCount = res.accountCount
  997. this.operation.forbiddenCount = res.forbiddenCount
  998. this.operation.lowPowerNum = res.lowPowerNum
  999. })
  1000. },
  1001. //我的工牌
  1002. iniodianloang() {
  1003. uni.request({
  1004. url: config.service.findElectricity,
  1005. method: "POST",
  1006. header: {
  1007. 'content-type': 'application/json',
  1008. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  1009. },
  1010. data: {
  1011. propertyId: this.buildingID,
  1012. accPhone: this.userInfo.username
  1013. },
  1014. success: (data) => {
  1015. if (data.data.data == null) {
  1016. return
  1017. } else {
  1018. this.imeiCode = data.data.data.imei
  1019. this.openFlag = data.data.data.recCmd
  1020. this.equipmentType = data.data.data.equipmentType;
  1021. uni.setStorageSync("equipmentType", this.equipmentType);
  1022. uni.setStorageSync("imeiCode", this.imeiCode);
  1023. if (this.equipmentType == 3) {
  1024. this.bluetooth();
  1025. }
  1026. if (data.data.data > 100) {
  1027. this.percentage = 100;
  1028. } else {
  1029. if (data.data.data.onLine == 0) {
  1030. this.Whetheroffline = false;
  1031. } else {
  1032. this.Whetheroffline = true;
  1033. this.percentage = data.data.data.electricity;
  1034. this.audioStatus = data.data.data.simAudioStatus;
  1035. if (this.equipmentType != 3) {
  1036. this.signalDevice = data.data.data.signalDevice / 1;
  1037. if (this.signalDevice > 80) {
  1038. this.signalDevicetext = '高';
  1039. } else {
  1040. if (this.signalDevice == 0) {
  1041. this.signalDevicetext = '无';
  1042. } else {
  1043. this.signalDevicetext = '低';
  1044. }
  1045. }
  1046. }
  1047. }
  1048. }
  1049. }
  1050. }
  1051. })
  1052. },
  1053. //选择项目弹框
  1054. piskbuilding() {
  1055. // this.Showhiddenunits = true;
  1056. uni.navigateTo({
  1057. url: "../mine/selectBuilding"
  1058. })
  1059. },
  1060. // 项目选择确认
  1061. confirm(e) {
  1062. this.buildingname = e[0].label;
  1063. this.buildingID = e[0].value;
  1064. let lopan = {
  1065. id: e[0].value,
  1066. name: e[0].label
  1067. }
  1068. uni.setStorageSync("buildingID", lopan); //项目id写入缓存
  1069. uni.setStorageSync("orgCode", e[0].orgCode); //项目id写入缓存
  1070. this.initworkThisWeek()
  1071. this.initrealTimeStatistics()
  1072. this.waitForOperation()
  1073. this.initequipment()
  1074. this.iniodianloang()
  1075. },
  1076. // 项目选择取消
  1077. cancel() {
  1078. this.Showhiddenunits = false;
  1079. },
  1080. tapjumpequipment(i) {
  1081. if (this.permissions.sbgl == true) {
  1082. uni.navigateTo({
  1083. url: '/pages/mine/equipment/index?active=' + i
  1084. });
  1085. }
  1086. },
  1087. prohibitedtap(i) {
  1088. if (i == 1) {
  1089. uni.navigateTo({
  1090. url: '/pages/center/prohibited/index?refresh=refresh&activeTotal=0' + '&violatedStatus=1'
  1091. });
  1092. } else {
  1093. if (this.zhixingcenterindex == 2) {
  1094. uni.navigateTo({
  1095. url: '/pages/center/prohibited/index?refresh=refresh&activeTotal=2' +
  1096. '&violatedStatus=1'
  1097. });
  1098. } else if (this.zhixingcenterindex == 6) { //近30天
  1099. uni.navigateTo({
  1100. url: '/pages/center/prohibited/index?refresh=refresh&activeTotal=3' +
  1101. '&violatedStatus=1'
  1102. });
  1103. } else { // 自定义时间段
  1104. uni.navigateTo({
  1105. url: '/pages/center/prohibited/index?refresh=refresh&activeTotal=4&staTime=' + this
  1106. .statDateStart + '&endtime=' + this.statDateEnd + '&violatedStatus=1'
  1107. });
  1108. }
  1109. }
  1110. },
  1111. // 跳转参数
  1112. checkParams(i) {
  1113. let str = ''
  1114. switch (i) {
  1115. case '1':
  1116. str = '&activeTotal=0'+'&visitRecords='+this.visitRecord;
  1117. break;
  1118. case 'auth':
  1119. str = '&activeTotal=0&validInvalid=0'+'&visitRecords='+this.visitRecord;
  1120. break;
  1121. case '3':
  1122. // 筛选时间类型后传的参数
  1123. if (this.zhixingcenterindex == 2) {
  1124. str = '&activeTotal=2'+'&visitRecords='+this.visitRecord1
  1125. } else if (this.zhixingcenterindex == 6) {
  1126. str = '&activeTotal=3'+'&visitRecords='+this.visitRecord1
  1127. } else {
  1128. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}`+'&visitRecords='+this.visitRecord1
  1129. }
  1130. break;
  1131. case '333':
  1132. case '7':
  1133. if (this.zhixingcenterindex == 2) {
  1134. str = '&activeTotal=2&validInvalid=0'+'&visitRecords='+this.visitRecord1
  1135. } else if (this.zhixingcenterindex == 6) {
  1136. str = '&activeTotal=3&validInvalid=0'+'&visitRecords='+this.visitRecord1
  1137. } else {
  1138. str = `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}&validInvalid=0`
  1139. }
  1140. break;
  1141. case '6':
  1142. str = '&activeTotal=0&validInvalid=0'+'&visitRecords='+this.visitRecord;
  1143. break;
  1144. case '4':
  1145. str = '&activeTotal=0&markAdvisor=0&validInvalid=0'+'&visitRecords='+this.visitRecord;
  1146. break;
  1147. case '44':
  1148. if (this.zhixingcenterindex == 2) {
  1149. str = '&activeTotal=2&validInvalid=0&markAdvisor=0'+'&visitRecords='+this.visitRecord1
  1150. } else if (this.zhixingcenterindex == 6) {
  1151. str = '&activeTotal=3&validInvalid=0&markAdvisor=0'+'&visitRecords='+this.visitRecord1
  1152. } else {
  1153. str =
  1154. `&activeTotal=4&staTime=${this.statDateStart}&endtime=${this.statDateEnd}&validInvalid=0&markAdvisor=0`+'&visitRecords='+this.visitRecord1
  1155. }
  1156. break;
  1157. default:
  1158. str = '&activeTotal=0&markAdvisor=0'
  1159. break;
  1160. }
  1161. // str=str+'&visitRecords='+this.visitRecord
  1162. return str
  1163. },
  1164. // 跳转
  1165. tapjumpreception(params) {
  1166. // 校验是否有权限
  1167. if (this.permissions.jdjl) {
  1168. uni.navigateTo({
  1169. url: `/pages/center/records/index?refresh=refresh${params}`
  1170. });
  1171. }
  1172. },
  1173. // tapjumpreception(i) {
  1174. // if (this.permissions.jdjl == true) {
  1175. // if (i == 1) {
  1176. // uni.navigateTo({
  1177. // url: '/pages/center/records/index?refresh=refresh&activeTotal=0&validInvalid=0'
  1178. // });
  1179. // } else if (i == 11) {
  1180. // uni.navigateTo({
  1181. // url: '/pages/center/records/index?refresh=refresh&activeTotal=0'
  1182. // });
  1183. // } else if (i == 2) {
  1184. // uni.switchTab({
  1185. // url: '/pages/index/customer'
  1186. // });
  1187. // } else if (i == 3) {
  1188. // if (this.zhixingcenterindex == 2) { // 近7天
  1189. // uni.navigateTo({
  1190. // url: '/pages/center/records/index?refresh=refresh&activeTotal=2&validInvalid=0'
  1191. // });
  1192. // } else if (this.zhixingcenterindex == 6) { //近30天
  1193. // uni.navigateTo({
  1194. // url: '/pages/center/records/index?refresh=refresh&activeTotal=3&validInvalid=0'
  1195. // });
  1196. // } else { // 自定义时间段
  1197. // uni.navigateTo({
  1198. // url: '/pages/center/records/index?refresh=refresh&activeTotal=4&validInvalid=0&staTime=' +
  1199. // this.statDateStart + '&endtime=' + this.statDateEnd
  1200. // });
  1201. // }
  1202. // } else if (i == 33) {
  1203. // if (this.zhixingcenterindex == 2) { // 近7天
  1204. // uni.navigateTo({
  1205. // url: '/pages/center/records/index?refresh=refresh&activeTotal=2'
  1206. // });
  1207. // } else if (this.zhixingcenterindex == 6) { //近30天
  1208. // uni.navigateTo({
  1209. // url: '/pages/center/records/index?refresh=refresh&activeTotal=3'
  1210. // });
  1211. // } else { // 自定义时间段
  1212. // uni.navigateTo({
  1213. // url: '/pages/center/records/index?refresh=refresh&activeTotal=4&staTime=' + this
  1214. // .statDateStart + '&endtime=' + this.statDateEnd
  1215. // });
  1216. // }
  1217. // } else if (i == 6) {
  1218. // uni.navigateTo({
  1219. // url: '/pages/center/records/index?refresh=refresh&activeTotal=0&validInvalid=0'
  1220. // });
  1221. // } else if (i == 7) {
  1222. // if (this.zhixingcenterindex == 2) {
  1223. // uni.navigateTo({
  1224. // url: '/pages/center/records/index?refresh=refresh&activeTotal=2&validInvalid=0'
  1225. // });
  1226. // } else if (this.zhixingcenterindex == 6) {
  1227. // uni.navigateTo({
  1228. // url: '/pages/center/records/index?refresh=refresh&activeTotal=3&validInvalid=0'
  1229. // });
  1230. // } else {
  1231. // uni.navigateTo({
  1232. // url: '/pages/center/records/index?refresh=refresh&activeTotal=4&validInvalid=0&staTime=' +
  1233. // this.statDateStart + '&endtime=' + this.statDateEnd
  1234. // });
  1235. // }
  1236. // } else {
  1237. // uni.navigateTo({
  1238. // url: '/pages/center/records/index?refresh=refresh&activeTotal=0&markAdvisor=0&validInvalid=0'
  1239. // });
  1240. // }
  1241. // }
  1242. // },
  1243. //集团对比
  1244. Groupcontrast() {
  1245. uni.navigateTo({
  1246. url: '/pages/center/Piabodata/Groupcontrast'
  1247. });
  1248. },
  1249. //团队对比
  1250. Theteamcompared() {
  1251. // if (this.teamList.length == 0) {
  1252. // uni.showToast({
  1253. // title: '没有团队呢',
  1254. // icon: 'none'
  1255. // })
  1256. // return
  1257. // }
  1258. uni.navigateTo({
  1259. url: '/pages/center/Piabodata/Theteamcompared'
  1260. });
  1261. },
  1262. //用户洞察
  1263. toUserinsightinto() {
  1264. uni.navigateTo({
  1265. url: '/pages/center/Piabodata/Userinsightinto'
  1266. });
  1267. },
  1268. //趋势分析
  1269. toTrendAnalysis() {
  1270. uni.navigateTo({
  1271. url: '/pages/center/Piabodata/TrendAnalysis'
  1272. });
  1273. },
  1274. //员工分析
  1275. toStaffAnalysis() {
  1276. // if (this.staffList.length == 0) {
  1277. // uni.showToast({
  1278. // title: '没有团队呢',
  1279. // icon: 'none'
  1280. // })
  1281. // return
  1282. // }
  1283. uni.navigateTo({
  1284. url: '/pages/center/Piabodata/StaffAnalysis'
  1285. });
  1286. },
  1287. Piabodata(item) {
  1288. if (item == '销讲分析') {
  1289. uni.navigateTo({
  1290. url: '/pages/center/Piabodata/index'
  1291. });
  1292. } else if (item == '接待记录') {
  1293. uni.navigateTo({
  1294. url: '/pages/center/records/index?refresh=refresh'
  1295. });
  1296. } else if (item == '值班顾问') {
  1297. uni.navigateTo({
  1298. url: '/pages/mine/consultanonduty/index'
  1299. });
  1300. } else if (item == '设备管理') {
  1301. uni.navigateTo({
  1302. url: '/pages/mine/equipment/index'
  1303. });
  1304. } else if (item == '顾问排名') {
  1305. uni.navigateTo({
  1306. url: '/pages/center/Piabodata/Employeesstatistics'
  1307. });
  1308. } else if (item == '违禁记录') {
  1309. uni.navigateTo({
  1310. url: '/pages/center/prohibited/first?refresh=refresh'
  1311. // pages/center/prohibited/index
  1312. });
  1313. } else if (item == '日报') {
  1314. uni.navigateTo({
  1315. url: '/pages/mine/daily/dailyList?refresh=refresh'
  1316. });
  1317. } else {
  1318. uni.navigateTo({
  1319. url: '/pages/center/consumer/index?refresh=refresh'
  1320. });
  1321. }
  1322. },
  1323. //蓝牙相关
  1324. bluetooth() {
  1325. //判断如果是意外断开直接提示
  1326. if(!this.$store.state.connectState || !this.$store.state.connectDev){
  1327. var that = this;
  1328. uni.authorize({
  1329. scope: 'scope.bluetooth',
  1330. success: () => {
  1331. uni.openBluetoothAdapter({
  1332. success: (res) => {
  1333. uni.hideLoading();
  1334. that.$store.commit('setConnectState', true);
  1335. that.getBluetoothAdapterState();
  1336. },
  1337. fail: () => {
  1338. // uni.showModal({
  1339. // title: '提示',
  1340. // content: '请打开蓝牙后再重新连接',
  1341. // confirmText: '前往连接',
  1342. // success: (res) => {
  1343. // if (res.confirm) {
  1344. // uni.redirectTo({
  1345. // url:"/pages/bluetooth/connect"
  1346. // })
  1347. // }
  1348. // }
  1349. // })
  1350. }
  1351. });
  1352. },
  1353. fail: () => {
  1354. uni.hideLoading();
  1355. uni.showModal({
  1356. title: '提示',
  1357. content: '需要使用蓝牙功能,请授权使用',
  1358. showCancel: false,
  1359. success: () => {
  1360. uni.openSetting();
  1361. }
  1362. })
  1363. }
  1364. })
  1365. }
  1366. },
  1367. //搜索蓝牙
  1368. getBluetoothAdapterState() {
  1369. var that = this;
  1370. that.blist = [];
  1371. uni.getBluetoothAdapterState({
  1372. success: function(res) {
  1373. if (!res.discovering) {
  1374. that.startBluetoothDevicesDiscovery();
  1375. }
  1376. },
  1377. fail: function(res) {
  1378. uni.showToast({
  1379. title: '适配蓝牙失败',
  1380. icon: "none"
  1381. })
  1382. }
  1383. });
  1384. },
  1385. //搜索蓝牙
  1386. startBluetoothDevicesDiscovery() {
  1387. var that = this;
  1388. uni.startBluetoothDevicesDiscovery({
  1389. allowDuplicatesKey: false,
  1390. success: function(res) {
  1391. setTimeout(() => {
  1392. that.lanya5()
  1393. }, 3000)
  1394. that.onBluetoothDeviceFound();
  1395. },
  1396. fail: function(res) {
  1397. uni.showToast({
  1398. title: '搜索蓝牙设备失败',
  1399. icon: "none"
  1400. })
  1401. }
  1402. })
  1403. },
  1404. // 获取所有已发现的设备
  1405. onBluetoothDeviceFound() {
  1406. var that = this;
  1407. let blist = uni.getStorageSync("connectDevList");
  1408. let names = [];
  1409. blist.filter(v => {
  1410. names.push(v.name);
  1411. })
  1412. let connectBloo = false;
  1413. uni.onBluetoothDeviceFound((res) => {
  1414. res.devices.filter(v => {
  1415. if ( names.indexOf(v.name) > -1 && !connectBloo) {
  1416. connectBloo = true;
  1417. let item = {deviceId:v.deviceId,name:v.name};
  1418. uni.setStorageSync("lyDetail",item)
  1419. connectBlue(item).then(() => {
  1420. that.notiInit();
  1421. })
  1422. }
  1423. })
  1424. })
  1425. },
  1426. //停止搜索周边设备
  1427. lanya5() {
  1428. uni.getBluetoothAdapterState({
  1429. success: function(res) {
  1430. if (res.discovering) {
  1431. uni.stopBluetoothDevicesDiscovery({
  1432. success: function(res) {
  1433. console.log("蓝牙停止搜索")
  1434. }
  1435. })
  1436. }
  1437. }
  1438. })
  1439. },
  1440. connectDevice(item) {
  1441. this.bluetoothShow = false;
  1442. //connectBlue(item)
  1443. }
  1444. },
  1445. };
  1446. </script>
  1447. <style lang="scss" scoped>
  1448. .activecllasscet {
  1449. font-size: 28rpx;
  1450. font-weight: 400;
  1451. color: #008ef2;
  1452. }
  1453. .cet {
  1454. font-size: 28rpx;
  1455. font-weight: 400;
  1456. color: #333333;
  1457. .cetview {
  1458. margin-left: 20rpx;
  1459. }
  1460. }
  1461. .cented-box {
  1462. padding: 30rpx;
  1463. background: #F8F8F8;
  1464. width: 100%;
  1465. height: 100%;
  1466. }
  1467. .Switchingbox {
  1468. width: 100%;
  1469. height: 44rpx;
  1470. margin-bottom: 30rpx;
  1471. display: flex;
  1472. align-items: center;
  1473. .Switching1 {
  1474. width: 44rpx;
  1475. height: 44rpx;
  1476. .Switching1-img {
  1477. width: 44rpx;
  1478. height: 44rpx;
  1479. }
  1480. }
  1481. .Switching2 {
  1482. margin: 0 12rpx;
  1483. flex: 1;
  1484. height: 44rpx;
  1485. font-size: 32rpx;
  1486. font-family: PingFangSC-Medium, PingFang SC;
  1487. font-weight: 500;
  1488. color: #303030;
  1489. line-height: 44rpx;
  1490. }
  1491. .Switching4 {
  1492. width: 112rpx;
  1493. font-size: 28rpx;
  1494. color: #303030;
  1495. font-weight: 400;
  1496. text-align: right;
  1497. text-decoration: underline;
  1498. font-family: PingFangSC-Regular, PingFang SC;
  1499. }
  1500. }
  1501. .gongpai {
  1502. margin-bottom: 20rpx;
  1503. }
  1504. .Workcard {
  1505. width: 100%;
  1506. background: #FFFFFF;
  1507. height: 154rpx;
  1508. box-shadow: 0px 0px 12rpx 0px rgba(224, 224, 224, 0.3);
  1509. border-radius: 12rpx;
  1510. display: flex;
  1511. .Workcard-box {
  1512. flex: 1;
  1513. height: 100%;
  1514. .Workcardimg {
  1515. width: 100%;
  1516. display: flex;
  1517. justify-content: center;
  1518. margin-top: 42rpx;
  1519. .Workcardimg1 {
  1520. width: 64rpx;
  1521. height: 36rpx;
  1522. background-image: url(../../static/images/battery.png);
  1523. background-size: 100% 100%;
  1524. padding: 8rpx;
  1525. transform: rotate(-90deg);
  1526. .bar {
  1527. background-color: #43CD80;
  1528. height: 100%;
  1529. border-radius: 4rpx;
  1530. }
  1531. .bar1 {
  1532. background-color: red;
  1533. height: 100%;
  1534. border-radius: 4rpx;
  1535. }
  1536. }
  1537. .Workcardimg2 {
  1538. width: 56rpx;
  1539. height: 36rpx;
  1540. }
  1541. .Workcardimg3 {
  1542. width: 34rpx;
  1543. height: 36rpx;
  1544. }
  1545. .Workcardimg4 {
  1546. width: 50rpx;
  1547. height: 40rpx;
  1548. }
  1549. }
  1550. .Workcardtext {
  1551. width: 100%;
  1552. text-align: center;
  1553. font-size: 24rpx;
  1554. font-weight: 400;
  1555. color: #666666;
  1556. margin-top: 20rpx;
  1557. }
  1558. }
  1559. }
  1560. .contbox {
  1561. width: 690rpx;
  1562. background: #FFFFFF;
  1563. border-radius: 12rpx;
  1564. padding: 24rpx 0 30rpx;
  1565. margin-bottom: 20rpx;
  1566. .title {
  1567. height: 42rpx;
  1568. font-size: 30rpx;
  1569. font-family: PingFangSC-Semibold, PingFang SC;
  1570. font-weight: 600;
  1571. color: #333333;
  1572. line-height: 42rpx;
  1573. margin-bottom: 24rpx;
  1574. display: flex;
  1575. align-items: center;
  1576. .title-icon {
  1577. width: 12rpx;
  1578. height: 20rpx;
  1579. margin-right: 18rpx;
  1580. }
  1581. .title1 {
  1582. flex: 3;
  1583. height: 90rpx;
  1584. display: flex;
  1585. align-items: center;
  1586. justify-content: flex-end;
  1587. padding-right: 30rpx;
  1588. .title1-box {
  1589. display: flex;
  1590. align-items: center;
  1591. width: 25%;
  1592. justify-content: center;
  1593. .activecltab1 {
  1594. color: #2671E2;
  1595. border-bottom: 4rpx solid #2671E2;
  1596. }
  1597. }
  1598. }
  1599. .title2 {
  1600. flex: 3;
  1601. height: 90rpx;
  1602. display: flex;
  1603. align-items: center;
  1604. justify-content: flex-end;
  1605. padding-right: 30rpx;
  1606. .title2-box {
  1607. display: flex;
  1608. align-items: center;
  1609. width: 25%;
  1610. justify-content: center;
  1611. .activecltab2 {
  1612. color: #2671E2;
  1613. border-bottom: 4rpx solid #2671E2;
  1614. }
  1615. }
  1616. }
  1617. }
  1618. .timeshow {
  1619. height: 40rpx;
  1620. font-size: 28rpx;
  1621. font-family: PingFangSC-Regular, PingFang SC;
  1622. font-weight: 400;
  1623. color: #666666;
  1624. line-height: 40rpx;
  1625. margin: -18rpx 0 24rpx 35rpx;
  1626. }
  1627. }
  1628. .shebenbox {
  1629. width: 100%;
  1630. display: flex;
  1631. .shebenche {
  1632. width: 25%;
  1633. height: 100%;
  1634. .shebenchenum {
  1635. width: 100%;
  1636. text-align: center;
  1637. height: 50rpx;
  1638. font-size: 36rpx;
  1639. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  1640. font-weight: bold;
  1641. color: #333333;
  1642. line-height: 50rpx;
  1643. }
  1644. .shebenchetext {
  1645. width: 100%;
  1646. color: #666666;
  1647. text-align: center;
  1648. margin-top: 8rpx;
  1649. height: 32rpx;
  1650. font-size: 24rpx;
  1651. font-family: PingFangSC-Regular, PingFang SC;
  1652. font-weight: 400;
  1653. line-height: 32rpx;
  1654. }
  1655. }
  1656. }
  1657. //今日工作
  1658. .real-timebox {
  1659. width: 100%;
  1660. .timebox {
  1661. width: 100%;
  1662. display: flex;
  1663. margin-bottom: 20rpx;
  1664. .real {
  1665. flex: 1;
  1666. height: 100%;
  1667. .realnum {
  1668. width: 100%;
  1669. text-align: center;
  1670. height: 50rpx;
  1671. font-size: 36rpx;
  1672. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  1673. font-weight: bold;
  1674. color: #333333;
  1675. line-height: 50rpx;
  1676. .qushi-icon {
  1677. width: 28rpx;
  1678. height: 14rpx;
  1679. margin-left: 2rpx;
  1680. }
  1681. }
  1682. .realtext {
  1683. width: 100%;
  1684. text-align: center;
  1685. margin-top: 8rpx;
  1686. height: 32rpx;
  1687. font-size: 24rpx;
  1688. font-family: PingFangSC-Regular, PingFang SC;
  1689. font-weight: 400;
  1690. color: #666666;
  1691. line-height: 32rpx;
  1692. }
  1693. }
  1694. }
  1695. }
  1696. .commonly-box {
  1697. width: 100%;
  1698. display: flex;
  1699. flex-wrap: wrap;
  1700. .commonly {
  1701. width: 25%;
  1702. margin-bottom: 28rpx;
  1703. .commonly-img {
  1704. width: 100%;
  1705. height: 80rpx;
  1706. text-align: center;
  1707. .commonly-img1 {
  1708. width: 80rpx;
  1709. height: 80rpx;
  1710. }
  1711. }
  1712. .commonly-text {
  1713. width: 100%;
  1714. text-align: center;
  1715. margin-top: 12rpx;
  1716. height: 32rpx;
  1717. font-size: 24rpx;
  1718. font-family: PingFangSC-Regular, PingFang SC;
  1719. font-weight: 400;
  1720. color: #333333;
  1721. line-height: 32rpx;
  1722. }
  1723. }
  1724. }
  1725. .timeview {
  1726. height: 90rpx;
  1727. line-height: 90rpx;
  1728. width: 100%;
  1729. text-align: center;
  1730. border-bottom: 1rpx solid #f8f8f8;
  1731. }
  1732. .endworking {
  1733. margin-top: 20rpx;
  1734. padding: 15rpx 30rpx;
  1735. width: 100%;
  1736. }
  1737. .sixty {
  1738. background-color: #FDFCDA;
  1739. }
  1740. .fifteen {
  1741. background-color: #F9C8C8;
  1742. color: #ff0000;
  1743. }
  1744. .bluetoothBox {
  1745. background-color: #fff;
  1746. border-top-left-radius: 20rpx;
  1747. border-top-right-radius: 20rpx;
  1748. box-sizing: border-box;
  1749. padding: 32rpx 32rpx 100rpx;
  1750. .bluetoothTitle {
  1751. text-align: center;
  1752. font-size: 32rpx;
  1753. font-weight: 600;
  1754. margin-bottom: 20rpx;
  1755. }
  1756. .bluetoothList {
  1757. width: 100%;
  1758. padding:0 20rpx;
  1759. .bluetoothItem {
  1760. box-sizing: border-box;
  1761. padding: 0 20rpx;
  1762. display: flex;
  1763. align-items: center;
  1764. justify-content: space-between;
  1765. width: 100%;
  1766. height: 90rpx;
  1767. line-height: 90rpx;
  1768. border-bottom: 1rpx solid #f8f8f8;
  1769. .bluetoothBtn {
  1770. width: 120rpx;
  1771. height: 50rpx;
  1772. line-height: 50rpx;
  1773. text-align: center;
  1774. background-color: #2671E2;
  1775. color: #fff;
  1776. border-radius: 10rpx;
  1777. font-size: 24rpx;
  1778. }
  1779. }
  1780. }
  1781. }
  1782. </style>