spring
昨天 0358eb6e5308a21172e63be8fe4867deeed1b3ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
  <view class="card_box">
    <z-paging
      ref="pagingRef"
      v-model="list"
      :fixed="false"
      :auto-show-back-to-top="true"
      @query="getList"
    >
      <ProductCard
        v-for="(item, index) in list"
        :key="index"
        :data="item"
        :map="map"
        @click="toDetail(item.id, item.deviceType)"
      />
    </z-paging>
    <wd-toast />
  </view>
</template>
 
<script setup lang="ts">
import ProductCard from "../product_card/index.vue";
import { useUserStore } from "@/store/modules/user";
import zPaging from "@/components/z-paging/z-paging.vue";
import { useToast } from "wot-design-uni";
 
const toast = useToast();
const userStore = useUserStore();
const userInfo: any = computed(() => userStore.userInfo);
const pagingRef = ref();
const map = reactive({
  deviceModel: "deviceModel",
  model: "model",
  firstNo: "firstNo",
  recordDate: "recordDate",
  workShift: "workShift",
  teamName: "teamName",
  poleModel: "poleModel",
  poleNumber: "poleNumber",
  outputNumber: "outputNumber",
  inspectPerson: "inspectPerson",
  status: "status",
  productType: "productType",
  recordPosition: "recordPosition",
  rejectList: [
    {
      rejectPerson: "rejectPerson",
      rejectTime: "rejectTime",
      rejectReason: {
        reason: "reason",
      },
    },
  ], // 改为对象,包含所需的嵌套属性
});
const props = defineProps({
  api: {
    type: Function,
    default: () => {},
  },
  ProList: {
    type: Object,
    default: () => {},
  },
});
 
const list = ref<any[]>([]);
 
const toDetail = (id: number, deviceType: number) => {
  console.log("点击卡片", id, deviceType);
  if (deviceType == 1) {
    // 绞线
    uni.navigateTo({
      url: `/pages/routingInspection/detail/indexJX?id=${id}&deviceType=${deviceType}`,
    });
  } else if (deviceType == 0) {
    // 拉丝
    uni.navigateTo({
      url: `/pages/routingInspection/detail/indexLS?id=${id}&deviceType=${deviceType}`,
    });
  }
};
 
const getList = async (pageNo = 1, pageSize = 10) => {
  const { code, data } = await props.api({
    deviceModel: props.ProList.deviceModel,
    status: "0",
    deviceType: props.ProList.deviceType,
    teamName: props.ProList.teamName || "", // 班组名称搜索
    current: pageNo,
    size: pageSize,
  });
  if (code == 200) {
    map.deviceModel = "deviceModel";
    map.model = "model";
    map.firstNo = "firstNo";
    map.recordDate = "recordDate";
    map.workShift = "workShift";
    map.teamName = "teamName";
    map.poleModel = "poleModel";
    map.poleNumber = "poleNumber";
    map.outputNumber = "outputNumber";
    map.inspectPerson = "inspectPerson";
    map.productType = "productType";
    map.recordPosition = "recordPosition";
    map.rejectList = [
      {
        rejectPerson: "rejectPerson",
        rejectTime: "rejectTime",
        rejectReason: {
          reason: "reason",
        },
      },
    ];
    map.status = "status";
    if (data.total == 0) {
      pagingRef.value.complete(true);
    } else {
      console.log("data.records", data.records);
      pagingRef.value.complete(data.records);
    }
  }
};
</script>
 
<style lang="scss" scoped>
.card_box {
  height: calc(100vh - 120px);
}
</style>