冰雪专题App端 物资管理 添加和详情

This commit is contained in:
huangchenhao 2025-11-12 18:12:45 +08:00
parent cbf4e4e327
commit 81412db42f

View File

@ -13,15 +13,24 @@
style="font-size: 18px; font-weight: bold; line-height: inherit"
>
</van-cell>
<van-cell :title="'物资名称: ' + wzDetailData.wzmc"> </van-cell>
<van-cell :title="'数量: ' + wzDetailData.sl"> </van-cell>
<van-cell :title="'余量: ' + wzDetailData.ye"> </van-cell>
<van-cell :title="'单位: ' + wzDetailData.dw"> </van-cell>
<van-cell :title="'存放地点: ' + wzDetailData.cfdd"> </van-cell>
<van-cell :title="'区县名称: ' + wzDetailData.qxmc"> </van-cell>
<van-cell :title="'物资名称: ' + wzDetailData.wzmc">
<template #right-icon>
<van-image
:src="photos[0]?.photoUrl"
fit="cover"
width="100px"
@click="showImage(photos)"
></van-image>
</template>
</van-cell>
<van-cell :title="'余量: ' + wzDetailData.ye + ' ' + wzDetailData.dw">
</van-cell>
<van-cell :title="'物资经度: ' + wzDetailData.jd"> </van-cell>
<van-cell :title="'物资纬度: ' + wzDetailData.wd"> </van-cell>
<van-cell :title="'负责人: ' + wzDetailData.fzr"> </van-cell>
<van-cell :title="'联系电话: ' + wzDetailData.lxdh"> </van-cell>
<van-cell :title="'入库日期: ' + wzDetailData.rkrq"> </van-cell>
<van-cell :title="'入库日期: ' + wzDetailData.rksj"> </van-cell>
<van-cell :title="'所属养护站: ' + wzDetailData.yhzMc"> </van-cell>
<van-cell :title="'备注: ' + wzDetailData.remark"> </van-cell>
</van-cell-group>
</div>
</div>
@ -32,7 +41,7 @@ import "vant/es/toast/style";
import "vant/es/popup/style";
import { ref, onMounted, toRaw, reactive } from "vue";
import { useRouter, useRoute } from "vue-router";
import { showToast, showLoadingToast } from "vant";
import { showToast, showLoadingToast, showImagePreview } from "vant";
import { request } from "../../../../shared/utils/request";
const router = useRouter();
@ -41,6 +50,7 @@ const route = useRoute();
const yhzDetail = ref({});
const wzData = ref([]);
const wzDetailData = ref({}); //
const photos = ref([]); //
onMounted(() => {
const data = JSON.parse(decodeURIComponent(route.params.data));
@ -59,6 +69,7 @@ const getwzDetail = async () => {
});
if (res.code && res.code === "00000") {
wzDetailData.value = res.data.material;
photos.value = res.data.photos;
} else {
throw new Error(res.message);
}
@ -77,6 +88,14 @@ const onClickLeft = () => {
params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) },
});
};
const showImage = (photos) => {
const photosArr = photos.map((item) => item.photoUrl);
showImagePreview({
images: photosArr,
closeable: true,
});
};
</script>
<style scoped>