曹睿
2025-04-24 5519cbf2e00c7ba4c650a542d98da99978124a30
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
<template>
  <view>
    <ProductCard
      :data="cardData"
      :map="{
        deviceModel: 'deviceModel',
        model: 'model',
        totalAmount: 'totalAmount',
        amount: 'amount',
        unAmount: 'unAmount',
      }"
    />
    <view class="mx-3">
      <wd-grid class="rounded-lg" clickable>
        <wd-grid-item
          icon="computer"
          link-type="navigateTo"
          :url="`/pages/production/twist/report/index?id=${paramsId}`"
          text="报工"
        />
        <!-- <wd-grid-item
          icon="chart"
          text="自检"
          link-type="navigateTo"
          url="/pages/production/twist/selfInspect/index"
        /> -->
        <wd-grid-item
          icon="tips"
          link-type="navigateTo"
          :url="`/pages/production/twist/backman/index?id=${paramsId}`"
          text="杂工"
        />
        <wd-grid-item
          icon="wallet"
          link-type="navigateTo"
          :url="`/pages/production/twist/receive/index?id=${paramsId}`"
          text="材料领用"
        />
      </wd-grid>
    </view>
  </view>
</template>
 
<script lang="ts" setup>
import { onLoad } from "@dcloudio/uni-app";
import ProductCard from "@/components/product_card/index.vue";
import TwistApi from "@/api/product/twist";
 
const paramsId = ref();
const cardData = reactive({
  deviceModel: undefined,
  model: undefined,
  totalAmount: undefined,
  amount: undefined,
  unAmount: undefined,
});
 
const getDetailData = async (id: string) => {
  const { data } = await TwistApi.getTwistDetailById({
    id: id,
  });
  cardData.deviceModel = data.deviceModel;
  cardData.model = data.model;
  cardData.totalAmount = data.totalLength;
  cardData.amount = data.length;
  cardData.unAmount = data.unLength;
};
 
onLoad((options: any) => {
  paramsId.value = options.id;
  getDetailData(options.id);
});
</script>
 
<style lang="scss" scoped></style>