index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <template>
  2. <view class="content">
  3. <!--<view class="Homepage_header">-->
  4. <!--</view>-->
  5. <view class="Homepage_suspension" v-if="$has('app:InspectionRecord')&&$has('app:OnlineReport')&&$has('app:WithholdingRecord')">
  6. <view class="Suspension">
  7. <view class="online" @click="Onlinewarranty" v-if="$has('app:InspectionRecord')">
  8. <view>
  9. <!-- <img :src="srcxianshang1" alt="" style="margin-left: 5rpx;"> -->
  10. <u--image mode="widthFix" :src="srcxianshang1" width="80rpx" height="80rpx"></u--image>
  11. </view>
  12. <view style="font-size: 28rpx;color: #697081;">线上报修</view>
  13. </view>
  14. <view class="online" @click="Inspectionrecord" v-if="$has('app:OnlineReport')">
  15. <view>
  16. <u--image mode="widthFix" :src="srcxianshang2" width="80rpx" height="80rpx"></u--image>
  17. </view>
  18. <view style="font-size: 28rpx;color: #697081;">巡检记录</view>
  19. </view>
  20. <view class="online" @click="Withholdingrecord" v-if="$has('app:WithholdingRecord')">
  21. <view>
  22. <u--image mode="widthFix" :src="srcxianshang3" width="80rpx" height="80rpx"></u--image>
  23. </view>
  24. <view style="font-size: 28rpx;color: #697081;">扣缴记录</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="pending" v-if="$has('app:RealtimeInspection')">
  29. <view class="pending_middle">
  30. <view class="all">
  31. <view class="work">
  32. <span style="font-size: 30rpx;font-weight: bold;">实时巡检</span>
  33. </view>
  34. <view class="processing" v-if="$has('app:ImmediateInspection')">
  35. <view class="immediately" @click="Immediateinspection">
  36. <span style="font-size: 25rpx; color: #5c8fff; ">立即巡检</span>
  37. <u-icon name="arrow-right" color="#5c8fff" size="16rpx"></u-icon>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="wait">
  42. <view>
  43. <view style="font-size: 26rpx;color: #697081;">今日待巡检</view>
  44. <view style="text-align: center;font-size: 32rpx;color: #0C1935;padding-top: 15rpx;">
  45. {{inspectionInfoList.todayTotalNum}}</view>
  46. </view>
  47. <view>
  48. <view style="font-size: 26rpx;color: #697081;">今日已巡检</view>
  49. <view style="text-align: center;font-size: 32rpx;color: #0C1935;padding-top: 15rpx;">
  50. {{inspectionInfoList.todayNum}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="pending" v-if="$has('app:Tobeassigned')&&$has('app:Toberepaired')&&$has('app:hasrepaired')">
  56. <view class="pending_middle">
  57. <view class="all" >
  58. <view class="work">
  59. <span style="font-size: 30rpx;font-weight: bold;">工单待办</span>
  60. </view>
  61. <view class="processing" v-if="$has('app:WorkorderTobeDone')">
  62. <view class="immediately" @click="Workordertodone">
  63. <span style="font-size: 25rpx; color: #5c8fff; ">立即处理</span>
  64. <u-icon name="arrow-right" color="#5c8fff" size="16rpx"></u-icon>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="wait">
  69. <view v-if="$has('app:Tobeassigned')">
  70. <view style="font-size: 26rpx;color: #697081;">待指派</view>
  71. <view style="text-align: center;font-size: 32rpx;color: #0C1935;padding-top: 15rpx;">
  72. {{workList[1]}}</view>
  73. </view>
  74. <view v-if="$has('app:Toberepaired')">
  75. <view style="font-size: 26rpx;color: #697081;">待维修</view>
  76. <view style="text-align: center;font-size: 32rpx;color: #0C1935;padding-top: 15rpx;">
  77. {{workList[2]}}</view>
  78. </view>
  79. <view v-if="$has('app:hasrepaired')">
  80. <view style="font-size: 26rpx;color: #697081;">已维修</view>
  81. <view style="text-align: center;font-size: 32rpx;color: #0C1935;padding-top: 15rpx;">
  82. {{workList[3]}}</view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="equipment" v-if="$has('app:EquipmentException')">
  88. <view class="pending_middle">
  89. <view class="all" >
  90. <view class="work">
  91. <span style="font-size: 30rpx;font-weight: bold;">设备异常</span>
  92. </view>
  93. <view class="processing" v-if="$has('app:LookatImmediately')">
  94. <view class="immediately" @click="EquipmentException">
  95. <span style="font-size: 25rpx; color: #5c8fff; ">立即查看</span>
  96. <u-icon name="arrow-right" color="#5c8fff" size="16rpx"></u-icon>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="wait">
  101. <view>
  102. <view style="font-size: 26rpx;color: #697081;">异常总数</view>
  103. <view style="text-align: center;font-size: 32rpx;color: #FA5555;padding-top: 15rpx;">
  104. {{deviceArr.AirConditioner}}</view>
  105. </view>
  106. <view>
  107. <view style="font-size: 26rpx;color: #697081;">空调异常</view>
  108. <view style="text-align: center;font-size: 32rpx;color: #FA5555;padding-top: 15rpx;">
  109. {{deviceArr.Ammeter}}</view>
  110. </view>
  111. <view>
  112. <view style="font-size: 26rpx;color: #697081;">水表异常</view>
  113. <view style="text-align: center;font-size: 32rpx;color: #FA5555;padding-top: 15rpx;">
  114. {{deviceArr.WaterMeter}}</view>
  115. </view>
  116. <view>
  117. <view style="font-size: 26rpx;color: #697081;">电表异常</view>
  118. <view style="text-align: center;font-size: 32rpx;color: #FA5555;padding-top: 15rpx;">
  119. {{deviceArr.Relay}}</view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <!-- 管理员界面 -->
  125. <view class="arrears" v-if="$has('app:ArrearstobeCollected')">
  126. <view class="pending_middle">
  127. <view class="all" >
  128. <view class="work">
  129. <span style="font-size: 30rpx;font-weight: bold;">欠费待收</span>
  130. </view>
  131. <view class="processing" v-if="$has('app:ImmediateCollection')">
  132. <view class="immediately" @click="Immediatecollection">
  133. <span style="font-size: 25rpx; color: #5c8fff; ">立即催收</span>
  134. <u-icon name="arrow-right" color="#5c8fff" size="16rpx"></u-icon>
  135. </view>
  136. </view>
  137. </view>
  138. <t-table style="background-color: #fff;margin-top: 10rpx;">
  139. <t-tr>
  140. <t-th>欠费类型</t-th>
  141. <t-th>欠费租户数</t-th>
  142. <t-th>累计欠费(元)</t-th>
  143. </t-tr>
  144. <t-tr v-for="item in tableList" :key="item.name">
  145. <t-td>{{ item.name }}</t-td>
  146. <t-td>{{ item.tenant }}</t-td>
  147. <t-td>{{ item.arrears }}</t-td>
  148. </t-tr>
  149. </t-table>
  150. </view>
  151. </view>
  152. <!-- 租户界面 -->
  153. <view class="arrears1" v-if="$has('app:BillPending')">
  154. <view class="pending_middle">
  155. <view class="all">
  156. <view class="work">
  157. <span style="font-size: 30rpx;font-weight: bold;">账单待缴</span>
  158. </view>
  159. <view class="processing" v-if="$has('app:ImmediatePayment')">
  160. <view class="immediately" @click="BillPending">
  161. <span style="font-size: 25rpx; color: #5c8fff; ">立即缴费</span>
  162. <u-icon name="arrow-right" color="#5c8fff" size="16rpx"></u-icon>
  163. </view>
  164. </view>
  165. </view>
  166. <t-table style="background-color: #fff;margin-top: 10rpx;">
  167. <t-tr>
  168. <t-th>欠费类型</t-th>
  169. <t-th>本期待缴金额(元)</t-th>
  170. <t-th>累计待缴金额(元)</t-th>
  171. </t-tr>
  172. <t-tr v-for="item in tableList" :key="item.name">
  173. <t-td>{{ item.name }}</t-td>
  174. <t-td>{{ item.currentAmount }}</t-td>
  175. <t-td>{{ item.cumulativeAmount }}</t-td>
  176. </t-tr>
  177. </t-table>
  178. </view>
  179. </view>
  180. <u-tabbar
  181. :value="value1"
  182. :fixed="true"
  183. :placeholder="true"
  184. @change="name => value1 = name"
  185. activeColor="#2E69EB"
  186. :safeAreaInsetBottom="true"
  187. >
  188. <u-tabbar-item text="首页" icon="home" @click="click1" ></u-tabbar-item>
  189. <u-tabbar-item v-if="$has('app:worktable')" text="工作台" icon="list" @click="click2" ></u-tabbar-item>
  190. <u-tabbar-item text="我的" icon="account" @click="click3" ></u-tabbar-item>
  191. </u-tabbar>
  192. </view>
  193. </template>
  194. <script>
  195. import tTable from '@/components/t-table/t-table.vue';
  196. import tTh from '@/components/t-table/t-th.vue';
  197. import tTr from '@/components/t-table/t-tr.vue';
  198. import tTd from '@/components/t-table/t-td.vue';
  199. export default {
  200. components: {
  201. tTable,
  202. tTh,
  203. tTr,
  204. tTd
  205. },
  206. data() {
  207. return {
  208. value1: 0,
  209. srcxianshang1: require('@/static/index/repair-online.svg'),
  210. srcxianshang2: require('@/static/index/check-review.svg'),
  211. srcxianshang3: require('@/static/index/reduce-record.svg'),
  212. tableList: [],
  213. tabbardata: 0,
  214. workList: {}, //工单代办
  215. deviceArr: {}, //设备异常数据
  216. getuserInfo: {},
  217. inspectionInfoList: {},
  218. }
  219. },
  220. onLoad() {
  221. this.getalldata();
  222. this.getuserInfo = uni.getStorageSync('getuserInfo');
  223. },
  224. onPullDownRefresh() {
  225. // console.log('我下拉刷新页面了!!!!!!!!!!!!!!!', )
  226. this.getalldata();
  227. },
  228. methods: {
  229. click1(){
  230. uni.navigateTo({
  231. url: '/pages/index/index'
  232. })
  233. },
  234. click2(){
  235. uni.navigateTo({
  236. url: '/pages/Workorder/Workorder'
  237. })
  238. },
  239. click3(){
  240. uni.navigateTo({
  241. url: '/pages/my/my'
  242. })
  243. },
  244. getalldata() {
  245. this.$api.get('/home/homedata', {})
  246. .then(res => {
  247. uni.stopPullDownRefresh() //刷新数据之后停止刷新效果
  248. //console.log('111111111111111111', res.data.data)
  249. this.workList = res.data.data.workOrder;
  250. this.deviceArr = res.data.data.equip.maps;
  251. this.inspectionInfoList = res.data.data.inspectionInfo;
  252. this.tableList = res.data.data.billPaymentList.map(item => {
  253. let json = {};
  254. if (item.payType == 'Water') {
  255. item.payType = '水费'
  256. } else if (item.payType == 'Elec') {
  257. item.payType = '电费'
  258. } else if (item.payType == 'PropertyFee') {
  259. item.payType = '物业费'
  260. }
  261. json.name = item.payType;
  262. json.tenant = item.arrearageNum;
  263. json.arrears = item.arrearageAmount;
  264. json.currentAmount = item.currentAmount;
  265. json.cumulativeAmount = item.cumulativeAmount;
  266. return json
  267. })
  268. })
  269. },
  270. BillPending() {
  271. // console.log('111111111111111111',this.getuserInfo)
  272. uni.navigateTo({
  273. url: '/pages/index/BillPending/BillPending?info=' + encodeURIComponent(JSON.stringify(this.getuserInfo))
  274. });
  275. },
  276. Immediatecollection() {
  277. uni.navigateTo({
  278. url: '/pages/index/Immediatecollection/Immediatecollection'
  279. })
  280. },
  281. Workordertodone() {
  282. uni.navigateTo({
  283. url: '/pages/index/Workordertodone/Workordertodone'
  284. })
  285. },
  286. EquipmentException() {
  287. uni.navigateTo({
  288. url: '/pages/index/EquipmentException/EquipmentException'
  289. })
  290. },
  291. Onlinewarranty() {
  292. uni.navigateTo({
  293. url: '/pages/index/Onlinewarranty/Onlinewarranty'
  294. })
  295. },
  296. Immediateinspection() {
  297. uni.navigateTo({
  298. url: '/pages/index/Immediateinspection/Immediateinspection'
  299. })
  300. },
  301. Inspectionrecord() {
  302. uni.navigateTo({
  303. url: '/pages/index/Inspectionrecord/Inspectionrecord'
  304. })
  305. },
  306. Withholdingrecord() {
  307. uni.navigateTo({
  308. url: '/pages/index/Withholdingrecord/Withholdingrecord'
  309. })
  310. },
  311. }
  312. }
  313. </script>
  314. <style lang="scss">
  315. * {
  316. margin: 0;
  317. padding: 0;
  318. list-style: none;
  319. text-decoration: none;
  320. }
  321. .online {
  322. display: flex;
  323. flex-direction: column;
  324. justify-content: center;
  325. align-items: center;
  326. }
  327. .Homepage_header {
  328. width: 750rpx;
  329. height: 200rpx;
  330. background-color: #5c8fff;
  331. border-radius: 0px 0px 16px 16px;
  332. position: fixed;
  333. top: 0px;
  334. }
  335. .kongbai {
  336. height: 100rpx;
  337. width: 750rpx;
  338. }
  339. .Homepage_suspension {
  340. width: 690rpx;
  341. height: 200rpx;
  342. margin: 0 auto;
  343. background-color: #fff;
  344. display: flex;
  345. align-items: center;
  346. justify-content: space-between;
  347. border-radius: 10rpx;
  348. }
  349. .Suspension {
  350. width: 690rpx;
  351. // height: 200rpx;
  352. display: flex;
  353. align-items: center;
  354. justify-content: space-around;
  355. }
  356. .pending1 {
  357. width: 750rpx;
  358. height: 220rpx;
  359. // background-color: #ccc;
  360. display: flex;
  361. align-items: center;
  362. justify-content: center;
  363. position: relative;
  364. margin-top: 120rpx;
  365. }
  366. .pending {
  367. width: 750rpx;
  368. height: 260rpx;
  369. // background-color: #ccc;
  370. display: flex;
  371. align-items: center;
  372. justify-content: center;
  373. position: relative;
  374. }
  375. .pending_middle {
  376. width: 690rpx;
  377. // height: 100px;
  378. // background-color: #fff;
  379. }
  380. .all {
  381. width: 100%;
  382. display: flex;
  383. align-items: center;
  384. justify-content: space-between;
  385. }
  386. .work {
  387. // padding-left: 20rpx;
  388. // padding-top: 2rpx;
  389. }
  390. .wait {
  391. width: 690rpx;
  392. display: flex;
  393. align-items: center;
  394. background-color: #fff;
  395. justify-content: space-around;
  396. padding-top: 30rpx;
  397. text-align: center;
  398. height: 140rpx;
  399. margin-top: 10rpx;
  400. border-radius: 10rpx;
  401. }
  402. .immediately {
  403. display: flex;
  404. // padding-top: 2rpx;
  405. }
  406. .equipment {
  407. width: 750rpx;
  408. // height: 200rpx;
  409. display: flex;
  410. align-items: center;
  411. justify-content: center;
  412. position: relative;
  413. top: 20rpx;
  414. }
  415. .arrears {
  416. // width: 750rpx;
  417. // height: 350rpx;
  418. display: flex;
  419. flex: 1;
  420. align-items: center;
  421. justify-content: center;
  422. position: relative;
  423. top: 50rpx;
  424. }
  425. .arrears1 {
  426. // width: 750rpx;
  427. // height: 350rpx;
  428. display: flex;
  429. flex: 1;
  430. align-items: center;
  431. justify-content: center;
  432. position: relative;
  433. top: 80rpx;
  434. margin-bottom: 30rpx;
  435. }
  436. .type {
  437. display: flex;
  438. align-items: center;
  439. justify-content: space-around;
  440. text-align: center;
  441. flex: 1;
  442. margin-top: 10rpx;
  443. font-size: 30rpx;
  444. }
  445. tr {
  446. background-color: #fff;
  447. }
  448. </style>