index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. <systemReturn />
  26. </template>
  27. <script setup>
  28. import { ref, onMounted, reactive, computed, getCurrentInstance, toRefs, inject, shallowRef } from "vue";
  29. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  30. import { getInspectionRecordList } from "@/api/business/zhaf/xunJian/record.js";
  31. const modalName = ref(null);
  32. const getData = ref([]);
  33. const { proxy } = getCurrentInstance();
  34. // 巡检记录列表数据请求
  35. function goRecordList(params = {}) {
  36. getInspectionRecordList(params).then((res) => {
  37. getData.value = res.data;
  38. });
  39. }
  40. function goDetail(item) {
  41. uni.navigateTo({
  42. url: "/pages/business/zhaf/xunJian/record/recordDetail/index?id=" + item.id,
  43. });
  44. }
  45. onLoad((option) => {
  46. goRecordList({ company_code: uni.getStorageSync("selectedCode") });
  47. });
  48. onShow(() => {
  49. //调用系统主题颜色
  50. proxy.$settingStore.systemThemeColor([1]);
  51. });
  52. </script>
  53. <style lang="scss">
  54. .cu-item {
  55. height: 180rpx !important;
  56. }
  57. </style>