pda_uniapp/pages/work/wms/emptyPalletOut.vue

261 lines
5.4 KiB
Vue
Raw Normal View History

2025-08-07 15:33:34 +08:00
<template>
<view class="container">
2025-09-05 15:22:43 +08:00
<cu-custom :isBack="true">
<block slot="backText"></block>
2025-08-07 15:33:34 +08:00
<block slot="content">空容器出库</block>
2025-09-05 15:22:43 +08:00
</cu-custom>
<view class="example">
<uni-forms ref="form" :model="formData" labelWidth="80px">
<uni-forms-item label="空容器" name="palletCode">
<view class="fromItem">
<uni-easyinput v-model="ktpCode" disabled />
<image style="width: 28rpx;" src="/static/images/right.png" mode="widthFix"></image>
</view>
</uni-forms-item>
<uni-forms-item label="货位编号" name="locCode">
<view class="fromItem">
<uni-easyinput v-model="formData.locCode" placeholder="请扫描货位编号" @blur="trimLocInput" />
<image style="width: 28rpx;" src="/static/images/right.png" mode="widthFix"></image>
</view>
</uni-forms-item>
<uni-forms-item label="容器数量" name="skuQty">
<view class="fromItem">
<uni-easyinput v-model="formData.skuQty" disabled type="number" placeholder="请输入物料数量" />
<image style="width: 28rpx;" src="/static/images/right.png" mode="widthFix"></image>
</view>
</uni-forms-item>
</uni-forms>
<!-- <view class="button-group">
<button type="primary" style="width: 200px;" :disabled="isButtonDisabled"
@click="submitPallet">呼叫出库</button>
</view> -->
</view>
<bottomBtn :isSubmit="true" :isWhite="false" position="fixed" :disable="isButtonDisabled"
:texts="['确认叫料']" @onSubmit="submitPallet"></bottomBtn>
<view class="cu-modal" :class="msgModalName=='Modal'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{msgTitleName}}</view>
<view class="action" @tap="hideMsgModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
{{msg}}
2025-08-07 15:33:34 +08:00
</view>
</view>
</view>
</view>
</template>
<script>
import {
2025-09-05 15:22:43 +08:00
getSkuDictionary,
getSkuTypes
2025-08-07 15:33:34 +08:00
} from "@/api/wms/sku.js"
import {
callEmptyOut
} from "@/api/wms/bill.js"
import {
getDictionary
} from "@/api/wms/dictData.js"
import {
formatDate
} from 'tough-cookie';
2025-09-05 15:22:43 +08:00
import {bottomBtn} from '@/components/bottomBtn/bottomBtn.vue'
2025-08-07 15:33:34 +08:00
export default {
data() {
return {
2025-09-05 15:22:43 +08:00
isButtonDisabled: false,
autoCall: true,
ktpCode: "KTP0001",
msgTitleName: '标题',
msg: '消息',
msgModalName: "",
2025-08-07 15:33:34 +08:00
//表单中的数据信息
formData: {
locCode: "",
skuQty: "1"
},
rules: {
locCode: {
rules: [{
required: true,
errorMessage: '请扫码货位号'
}]
},
skuQty: {
rules: [{
required: true,
errorMessage: '请输入物料数量'
}]
}
},
};
},
onLoad() {
2025-09-05 15:22:43 +08:00
2025-08-07 15:33:34 +08:00
},
onReady() {
this.$refs.form.setRules(this.rules)
},
2025-09-05 15:22:43 +08:00
component:{
bottomBtn
},
2025-08-07 15:33:34 +08:00
watch: {
},
methods: {
2025-09-05 15:22:43 +08:00
2025-08-07 15:33:34 +08:00
//去除空格
trimLocInput(event) {
2025-09-05 15:22:43 +08:00
this.formData.locCode = event.target.value.trim();
2025-08-07 15:33:34 +08:00
},
//呼叫AGV
submitPallet: function() {
//this.msgModalName='Modal'
2025-09-05 15:22:43 +08:00
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
if (!this.formData.locCode) {
this.$modal.closeLoading()
}
const whcode = this.$store.state.user.warehouse[0]?.warehouseCode;
var data = {
locCode: this.formData.locCode,
userCode: this.$store.state.user.name,
warehouseCode: whcode
}
callEmptyOut(data).then(response => {
console.log("response", response)
this.$modal.msgSuccess("呼叫入库成功")
}).finally(() => {
this.isButtonDisabled = false; // 恢复按钮可用
this.$modal.closeLoading()
});
2025-08-07 15:33:34 +08:00
},
hideMsgModal(e) {
//关闭信息模态框
this.msgModalName = null;
},
2025-09-05 15:22:43 +08:00
2025-08-07 15:33:34 +08:00
}
}
</script>
<style lang="scss">
2025-09-05 15:22:43 +08:00
.container {
background: rgb(242, 243, 245);
height: 100vh;
}
.uni-forms-item {
border-bottom: 1px solid #E5E6EB;
margin-bottom: 0;
padding: 24rpx 0;
}
::v-deep .uni-forms-item__label {
color: #1D2129;
font-size: 28rpx;
font-weight: 400;
}
::v-deep .uni-select {
border: 0px;
}
::v-deep.uni-select__input-placeholder {
font-size: 28rpx;
font-weight: 400;
color: #86909C;
}
.textarea{
background-color: #F2F3F5;
width: 100%;
}
::v-deep.full-width-textarea{
width: 100%!important;
border: unset!important;
}
::v-deep .is-input-border{
border: unset;
}
::v-deep .uni-easyinput__placeholder-class{
font-size: 28rpx;
color: #86909C;
}
::v-deep .uni-input-input{
font-size: 28rpx;
}
::v-deep .uni-select__input-placeholder{
font-size: 28rpx;
color: #86909C;
}
::v-deep .uniui-bottom{
display: none;
}
::v-deep .uniui-top{
display: none;
}
.fromItem{
display: flex;
align-items: center;
}
.example {
padding: 0 24rpx;
background-color: #fff;
width: 702rpx;
border-radius: 24rpx;
margin: 24rpx auto;
}
2025-08-07 15:33:34 +08:00
.cu-form-group .title {
min-width: calc(4em + 15px);
}
page {
background-color: #ffffff;
}
2025-09-05 15:22:43 +08:00
2025-08-07 15:33:34 +08:00
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
flex: 1;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
2025-09-05 15:22:43 +08:00
.switch-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
border-bottom: 1px solid #eee;
}
2025-08-07 15:33:34 +08:00
</style>