From 5519cbf2e00c7ba4c650a542d98da99978124a30 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期四, 24 四月 2025 16:43:01 +0800
Subject: [PATCH] test: 测试生产管理
---
src/pages/production/detail/twistDetail.vue | 44 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/src/pages/production/detail/twistDetail.vue b/src/pages/production/detail/twistDetail.vue
index c4e5230..6ccb078 100644
--- a/src/pages/production/detail/twistDetail.vue
+++ b/src/pages/production/detail/twistDetail.vue
@@ -1,12 +1,21 @@
<template>
<view>
- <ProductCard />
+ <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"
+ :url="`/pages/production/twist/report/index?id=${paramsId}`"
text="鎶ュ伐"
/>
<!-- <wd-grid-item
@@ -18,13 +27,13 @@
<wd-grid-item
icon="tips"
link-type="navigateTo"
- url="/pages/production/twist/backman/index"
+ :url="`/pages/production/twist/backman/index?id=${paramsId}`"
text="鏉傚伐"
/>
<wd-grid-item
icon="wallet"
link-type="navigateTo"
- url="/pages/production/twist/receive/index"
+ :url="`/pages/production/twist/receive/index?id=${paramsId}`"
text="鏉愭枡棰嗙敤"
/>
</wd-grid>
@@ -33,7 +42,34 @@
</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>
--
Gitblit v1.9.3