|
|
|
@ -19,24 +19,19 @@
|
|
|
|
|
>
|
|
|
|
|
{{state.boxName}}
|
|
|
|
|
</span>
|
|
|
|
|
<span style="text-align: center; margin-top: 20rpx"> A列1行 </span>
|
|
|
|
|
<span style="text-align: center; margin-top: 20rpx"> {{state.column}}列{{state.row}}行 </span>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="button-container">
|
|
|
|
|
<up-button
|
|
|
|
|
style="width: 326rpx; margin: auto; height: 80rpx"
|
|
|
|
|
color="#BCBCBC"
|
|
|
|
|
throttleTime="5"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
>取消</up-button
|
|
|
|
|
>
|
|
|
|
|
<up-button
|
|
|
|
|
style="width: 326rpx; margin: auto; height: 80rpx"
|
|
|
|
|
style="width: 456rpx; margin: auto; height: 80rpx"
|
|
|
|
|
color="#EFC54E"
|
|
|
|
|
throttleTime="5"
|
|
|
|
|
@click="doneSet"
|
|
|
|
|
:disabled="isButtonDisabled"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
>确认</up-button
|
|
|
|
|
>{{ buttonText }}</up-button
|
|
|
|
|
>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
@ -45,14 +40,18 @@
|
|
|
|
|
import { ref, reactive, onBeforeMount } from "vue";
|
|
|
|
|
import useToast from "@/hooks/toast/useToast.js";
|
|
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
import { freebox } from "@/api/login.js";
|
|
|
|
|
import { freebox,bind} from "@/api/login.js";
|
|
|
|
|
const { showMessage } = useToast();
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const isButtonDisabled = ref(false);
|
|
|
|
|
const buttonText = ref("确认");
|
|
|
|
|
const state = reactive({
|
|
|
|
|
id: "",
|
|
|
|
|
pid: "",
|
|
|
|
|
containerName: "",
|
|
|
|
|
boxName:"",
|
|
|
|
|
boxUid:"",
|
|
|
|
|
containerUid:'',
|
|
|
|
|
});
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
|
|
|
|
@ -61,18 +60,43 @@ onLoad((options) => {
|
|
|
|
|
bindShelfHole();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const bindShelfHole = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
|
|
|
|
|
const res = await freebox();
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
state.containerName = res.data.containerName;
|
|
|
|
|
state.boxName = res.data.boxName;
|
|
|
|
|
state.containerUid=res.data.containerUid;
|
|
|
|
|
state.boxUid=res.data.boxUid;
|
|
|
|
|
if (state.boxName) {
|
|
|
|
|
const parts = state.boxName.split(/(\d+)/);
|
|
|
|
|
state.column = parts[0]; // 字母部分
|
|
|
|
|
state.row = parts[1]; // 数字部分
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loading.value = false;
|
|
|
|
|
};
|
|
|
|
|
//入库
|
|
|
|
|
const doneSet = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
const res = await bind({
|
|
|
|
|
paintingBucketId: state.id,
|
|
|
|
|
paintingBucketUid: state.pid,
|
|
|
|
|
boxUid:state.boxUid,
|
|
|
|
|
containerUid:state.containerUid,
|
|
|
|
|
containerName:state.containerName,
|
|
|
|
|
boxName:state.boxName,
|
|
|
|
|
});
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
showMessage({ type: "sucess", message: "入库成功" });
|
|
|
|
|
isButtonDisabled.value = true;
|
|
|
|
|
buttonText.value = "已入库";
|
|
|
|
|
}else{
|
|
|
|
|
showMessage({ type: "error", message: res.msg });
|
|
|
|
|
}
|
|
|
|
|
loading.value = false;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|