From 2fa9c764993b4a7ad51754d0e8587990f96f1529 Mon Sep 17 00:00:00 2001 From: 曹睿 <360930172@qq.com> Date: 星期二, 22 四月 2025 16:33:27 +0800 Subject: [PATCH] feat: 完成至扫码 --- src/pages/production/detail/twistDetail.vue | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/pages/production/detail/twistDetail.vue b/src/pages/production/detail/twistDetail.vue index 936e58e..5c12575 100644 --- a/src/pages/production/detail/twistDetail.vue +++ b/src/pages/production/detail/twistDetail.vue @@ -1,20 +1,20 @@ <template> <view> - <ProductCard /> + <ProductCard :data="cardData" /> <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 + <!-- <wd-grid-item icon="chart" text="鑷" link-type="navigateTo" url="/pages/production/twist/selfInspect/index" - /> + /> --> <wd-grid-item icon="tips" link-type="navigateTo" @@ -24,7 +24,7 @@ <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 +33,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