From 913796ff8463b132be6ebb92c44f0dabb2ff279f Mon Sep 17 00:00:00 2001 From: 曹睿 <360930172@qq.com> Date: 星期三, 23 四月 2025 11:10:18 +0800 Subject: [PATCH] feat: 绞线单丝领用完成保存 --- src/pages/production/detail/twistDetail.vue | 33 ++++++++++++++++++++++++++++++--- 1 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/pages/production/detail/twistDetail.vue b/src/pages/production/detail/twistDetail.vue index c4e5230..5c12575 100644 --- a/src/pages/production/detail/twistDetail.vue +++ b/src/pages/production/detail/twistDetail.vue @@ -1,12 +1,12 @@ <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 @@ -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