index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item" :class="modalName == 'move-box-' + index ? 'move-cur' : ''" v-for="(item, index) in getData" :key="index" :data-target="'move-box-' + index" @tap="goDetail(item)">
  5. <view class="content" style="left: 0; width: 80%">
  6. <view class="pro-title">
  7. <view class="cut">计划:{{ item.plan_name }}</view>
  8. </view>
  9. <view class="pro-des">
  10. <view class="text-cut"> 点位:{{ item.spot_name }} </view>
  11. </view>
  12. <view class="pro-date">{{ item.wc_time }}</view>
  13. </view>
  14. <view class="nav-right num mr10">
  15. <view class="text-grey">
  16. <button class="cu-btn radius bg-green sm" v-if="item.spot_abnormal == 0">正常</button>
  17. <button class="cu-btn radius bg-orange sm" v-if="item.spot_abnormal == 1">异常</button>
  18. <button class="cu-btn radius bg-red sm" v-if="item.spot_abnormal == 2">故障</button>
  19. <button class="cu-btn radius bg-orange sm" v-if="item.spot_abnormal == 3">其他</button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script setup>
  27. import { ref, onMounted, reactive, computed, getCurrentInstance, toRefs, inject, shallowRef } from "vue";
  28. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  29. import { getInspectionRecordList } from "@/api/business/zhaf/xunJian/record.js";
  30. const modalName = ref(null);
  31. const getData = ref([]);
  32. const { proxy } = getCurrentInstance();
  33. // 巡检记录列表数据请求
  34. function goRecordList(params = {}) {
  35. getInspectionRecordList(params).then((res) => {
  36. getData.value = res.data;
  37. });
  38. }
  39. function goDetail(item) {
  40. uni.navigateTo({
  41. url: "/pages/business/zhaf/xunJian/record/recordDetail/index?id=" + item.id,
  42. });
  43. }
  44. onLoad((option) => {
  45. goRecordList({ company_code: uni.getStorageSync("selectedCode") });
  46. });
  47. onShow(() => {
  48. //调用系统主题颜色
  49. proxy.$settingStore.systemThemeColor([1]);
  50. });
  51. </script>
  52. <style lang="scss">
  53. .cu-item {
  54. height: 180rpx !important;
  55. }
  56. </style>