曹睿
2025-04-24 5519cbf2e00c7ba4c650a542d98da99978124a30
src/pages/production/detail/wireDetail.vue
@@ -1,20 +1,39 @@
<template>
  <view>
    <ProductCard />
  <view class="pt-2">
    <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/report/wire"
          :url="`/pages/production/wire/report/wire?id=${paramsId}`"
          text="报工"
        />
        <wd-grid-item icon="chart" text="自检" />
        <wd-grid-item icon="tips" text="杂工" />
        <!-- <wd-grid-item
          icon="chart"
          text="自检"
          link-type="navigateTo"
          url="/pages/production/wire/selfInspect/index"
        /> -->
        <wd-grid-item
          icon="tips"
          link-type="navigateTo"
          :url="`/pages/production/wire/backman/index?id=${paramsId}`"
          text="杂工"
        />
        <wd-grid-item
          icon="wallet"
          link-type="navigateTo"
          url="/pages/production/receive/index"
          url="/pages/production/wire/receive/index"
          text="材料领用"
        />
      </wd-grid>
@@ -23,7 +42,34 @@
</template>
<script lang="ts" setup>
import { onLoad } from "@dcloudio/uni-app";
import ProductCard from "@/components/product_card/index.vue";
import WireApi from "@/api/product/wire";
const paramsId = ref();
const cardData = reactive({
  deviceModel: undefined,
  model: undefined,
  totalAmount: undefined,
  amount: undefined,
  unAmount: undefined,
});
const getDetailData = async (id: string) => {
  const { data } = await WireApi.getWireDetailById({
    id: id,
  });
  cardData.deviceModel = data.deviceModel;
  cardData.model = data.model;
  cardData.totalAmount = data.totalAmount;
  cardData.amount = data.amount;
  cardData.unAmount = data.unAmount;
};
onLoad((options: any) => {
  paramsId.value = options.id;
  getDetailData(options.id);
});
</script>
<style lang="scss" scoped></style>