120 lines
2.9 KiB
Vue
120 lines
2.9 KiB
Vue
<template>
|
|
<div>
|
|
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
|
<el-form-item label="仓库" prop="warehouseId">
|
|
<el-select
|
|
v-model="formData.warehouseId"
|
|
placeholder="请选择仓库"
|
|
clearable
|
|
:style="{width: '15%'}"
|
|
>
|
|
<el-option
|
|
v-for="item in warehouseOptions"
|
|
:key="item.warehouseId"
|
|
:label="item.warehouseName"
|
|
:value="item.warehouseId"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="托盘码" prop="trayCode">
|
|
<el-input
|
|
v-model="formData.trayCode"
|
|
placeholder="请输入托盘码"
|
|
:maxlength="8"
|
|
show-word-limit
|
|
clearable
|
|
prefix-icon='el-icon-mobile'
|
|
:style="{width: '15%'}"
|
|
></el-input>
|
|
</el-form-item>
|
|
<el-form-item size="large">
|
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
<el-button @click="resetForm">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
</div>
|
|
</template>
|
|
<script>
|
|
|
|
import { emptyTrayIn} from '@/api/rf/rf'
|
|
import {listWarehouse} from "@/api/bas/warehouse";
|
|
|
|
|
|
export default {
|
|
components: {},
|
|
props: [],
|
|
data() {
|
|
return {
|
|
formData: {
|
|
trayCode: '',
|
|
warehouseId: '',
|
|
},
|
|
loading: false,
|
|
taskDetails: [],
|
|
rules: {
|
|
trayCode: [{
|
|
required: true,
|
|
message: '请输入托盘码',
|
|
trigger: 'blur'
|
|
}],
|
|
},
|
|
warehouseOptions:[],
|
|
queryWarehouseParams:{
|
|
pageNum:1,
|
|
pageSize:99
|
|
},
|
|
}
|
|
},
|
|
computed: {},
|
|
watch: {},
|
|
created() {
|
|
this.getWarehouseList()
|
|
|
|
},
|
|
mounted() {},
|
|
methods: {
|
|
/** 获取仓库列表 */
|
|
getWarehouseList() {
|
|
listWarehouse(this.queryWarehouseParams).then(response => {
|
|
this.warehouseOptions = response.rows;
|
|
if (this.warehouseOptions.length > 0) {
|
|
this.handleQuery();
|
|
}
|
|
});
|
|
},
|
|
async submitForm() {
|
|
const code = (this.formData.trayCode || '').toString().trim()
|
|
if (!code) {
|
|
this.$message.error('请输入托盘码')
|
|
return
|
|
}
|
|
const code1 = (this.formData.warehouseId || '').toString().trim()
|
|
if (!code1) {
|
|
this.$message.error('请选择仓库')
|
|
return
|
|
}
|
|
this.loading = true
|
|
try {
|
|
const res = await emptyTrayIn({ trayCode: code,warehouseId:code1 })
|
|
if (res.code === 200) {
|
|
this.$message.success('空托入库生成任务成功')
|
|
this.resetForm()
|
|
} else {
|
|
this.$message.error(res.msg || '空托入库生成任务失败')
|
|
}
|
|
} finally {
|
|
this.loading = false
|
|
}
|
|
},
|
|
resetForm() {
|
|
this.$refs['elForm'].resetFields()
|
|
this.taskDetails = []
|
|
},
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<style>
|
|
</style>
|