store-management-app/src/pages/detail/index.vue

173 lines
4.9 KiB
Vue
Raw Normal View History

2024-09-11 06:57:03 +00:00
<template>
<view class="content">
2024-09-14 03:31:59 +00:00
<navBar v-if="state.boxRelBucketStatus == 1"> 出库 </navBar>
2024-10-10 03:22:07 +00:00
<navBar v-if="state.boxRelBucketStatus == 2||state.boxRelBucketStatus ==4"> 画筒详情 </navBar>
2024-09-11 06:57:03 +00:00
<view class="container-box" >
2024-09-14 03:31:59 +00:00
<span style="font-weight: bold;text-align: center;" v-if="state.boxRelBucketStatus == 1">
2024-10-09 06:47:09 +00:00
确定要出库{{state.locateAddress}}
2024-09-11 06:57:03 +00:00
</span>
2024-09-14 07:57:06 +00:00
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="state.boxRelBucketStatus == 1"> {{state.pid}}画筒吗</span>
2024-10-10 03:22:07 +00:00
<span style="font-weight: bold;text-align: center;" v-if="state.boxRelBucketStatus == 2||state.boxRelBucketStatus ==4">画筒号{{state.pid}}</span>
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="state.boxRelBucketStatus == 2||state.boxRelBucketStatus ==4">所在位置{{ state.locateAddress }}</span>
2024-09-11 06:57:03 +00:00
<view class="painting-box" >
2024-09-14 07:57:06 +00:00
<span>画作名称{{ state.drawName }}</span>
<span style="margin-top: 20rpx;">画家{{ state.drawerName }}</span>
2024-09-11 06:57:03 +00:00
<span style="margin-top: 20rpx;">预览图</span>
<view class="image-container">
<up-image
2024-09-14 07:57:06 +00:00
:src=state.drawThumbnail
2024-09-11 06:57:03 +00:00
></up-image>
</view>
</view>
</view>
</view>
<view class="button-container">
2024-09-19 08:37:34 +00:00
<up-button
style="width: 336rpx; margin: auto; height: 80rpx"
color="#BABABA"
throttleTime="5"
v-if="state.boxRelBucketStatus == 1"
>取消</up-button
>
2024-09-11 06:57:03 +00:00
<up-button
2024-09-19 08:37:34 +00:00
style="width: 336rpx; margin: auto; height: 80rpx;"
2024-09-11 06:57:03 +00:00
color="#EFC54E"
throttleTime="5"
2024-09-14 07:57:06 +00:00
@click="doneSet"
2024-09-14 03:31:59 +00:00
v-if="state.boxRelBucketStatus == 1"
2024-09-19 07:40:39 +00:00
:disabled="isButtonDisabled"
> {{ buttonText }}</up-button
2024-09-11 06:57:03 +00:00
>
2024-09-19 08:37:34 +00:00
<up-button
2024-09-11 06:57:03 +00:00
style="width: 426rpx; margin: auto; height: 86rpx;"
color="#EFC54E"
throttleTime="5"
@click="login"
2024-10-10 03:22:07 +00:00
v-if="state.boxRelBucketStatus == 2||state.boxRelBucketStatus ==4"
2024-09-11 06:57:03 +00:00
>返回继续扫码</up-button
2024-09-19 08:37:34 +00:00
>
2024-09-11 06:57:03 +00:00
</view>
</template>
<script setup>
2024-09-14 03:31:59 +00:00
import { ref,reactive,onBeforeMount } from "vue";
import { onLoad } from "@dcloudio/uni-app";
2024-09-14 07:57:06 +00:00
import useToast from "@/hooks/toast/useToast.js";
import { pbDetail,outbound } from "@/api/login.js";
const { showMessage } = useToast();
2024-09-11 06:57:03 +00:00
const isDetail = ref(false);
2024-09-14 07:57:06 +00:00
const loading = ref(false);
2024-09-19 07:40:39 +00:00
const isButtonDisabled = ref(false);
const buttonText = ref("确认");
2024-09-14 03:31:59 +00:00
const state = reactive({
id: "",
pid: "",
containerName:"",
boxRelBucketStatus:"",
2024-09-14 07:57:06 +00:00
drawName:"",
drawerName:"",
drawThumbnail:"",
locateAddress:"",
2024-09-19 01:38:53 +00:00
boxUid:"",
2024-09-14 03:31:59 +00:00
});
onLoad((options) =>{
state.id = options.id;
state.pid = options.pid;
state.boxRelBucketStatus = options.boxRelBucketStatus;
2024-09-14 07:57:06 +00:00
paintingDetail()
2024-09-14 03:31:59 +00:00
});
2024-09-14 07:57:06 +00:00
const paintingDetail = async () => {
loading.value = true;
const res = await pbDetail({
id: state.id,
pid: state.pid,
});
if (res.status === 0) {
state.drawName = res.data.drawName;
state.drawerName = res.data.drawerName;
state.drawThumbnail = res.data.drawThumbnail;
state.locateAddress = res.data.locateAddress;
2024-09-19 01:38:53 +00:00
state.boxUid = res.data.boxUid;
2024-09-14 07:57:06 +00:00
}
2024-09-14 03:31:59 +00:00
2024-09-14 07:57:06 +00:00
};
const doneSet = async () => {
loading.value = true;
const res = await outbound({
id: state.id,
pid: state.pid,
2024-09-19 01:38:53 +00:00
boxUid:state.boxUid,
2024-09-14 07:57:06 +00:00
});
if (res.status === 0) {
showMessage({ type: "sucess", message: "出库成功" });
2024-09-19 07:40:39 +00:00
isButtonDisabled.value = true;
buttonText.value = "已出库";
2024-09-14 07:57:06 +00:00
}else{
showMessage({ type: "error", message: res.msg });
}
loading.value = false;
};
2024-09-11 06:57:03 +00:00
</script>
<style lang="scss" scoped>
page {
background: url("@/static/bgp.png") no-repeat;
background-size: 100% 100%;
background-attachment: fixed;
height: 100vh;
box-sizing: border-box;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.container-box {
height: 100%;
width: 98%;
display: flex;
flex-direction: column;
margin-top: 60rpx;
padding: 40rpx;
box-sizing: border-box;
}
.painting-box {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
margin-top: 60rpx;
padding: 20rpx;
box-sizing: border-box;
background-color: #fff;
box-shadow: 0 0 6px rgba(219, 218, 218, 0.5);
}
.image-container {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20rpx;
2024-09-14 07:57:06 +00:00
height:auto;
2024-09-11 06:57:03 +00:00
}
}
.button-container {
display: flex;
justify-content: space-between;
width: 100%;
position: fixed;
2024-09-29 06:15:56 +00:00
bottom: 1rpx;
2024-09-11 06:57:03 +00:00
left: 0;
padding: 0 20rpx;
box-sizing: border-box;
background-color: #fff;
height: 8%;
}
</style>