This commit is contained in:
Aiden 2024-10-10 10:55:47 +08:00
commit 175faec877
2 changed files with 25 additions and 2 deletions

View File

@ -71,3 +71,11 @@ export const check_freebox = (data) => {
data,
});
};
//入库取消
export const cancel = (data) => {
return request({
url: "/containeradm/v1/box_rel_bucket/cancel_freebox",
method: "POST",
data,
});
};

View File

@ -28,6 +28,8 @@
style="width: 336rpx; margin: auto; height: 80rpx"
color="#BABABA"
throttleTime="5"
disabled="isButtonDisabled"
@click="closeFn"
>取消</up-button
>
<up-button
@ -35,7 +37,7 @@
color="#EFC54E"
throttleTime="5"
@click="doneSet"
:disabled="isButtonDisabled"
disabled="closeButton"
:loading="loading"
>{{ buttonText }}</up-button
>
@ -46,10 +48,11 @@
import { ref, reactive, onBeforeMount } from "vue";
import useToast from "@/hooks/toast/useToast.js";
import { onLoad } from "@dcloudio/uni-app";
import { freebox,bind,check_freebox} from "@/api/login.js";
import { freebox,bind,check_freebox,cancel} from "@/api/login.js";
const { showMessage } = useToast();
const loading = ref(false);
const isButtonDisabled = ref(false);
const closeButton = ref(false);
const buttonText = ref("确认");
const state = reactive({
id: "",
@ -104,6 +107,18 @@ const doneSet = async () => {
}
loading.value = false;
};
//
const closeFn = async () => {
const res = await cancel({
boxUid : state.boxUid
});
if(res.status === 0){
}else{
showMessage({ type: "error", message: res.msg });
isButtonDisabled.value = true;
closeButton.value = true;
}
}
//
const check = async () => {
const res = await check_freebox({