优化库位和库区管理的仓库选择交互,将下拉选择改为弹窗选择模式,新增库位必填字段验证,调整盘点管理导入功能从列表操作移至详情操作,优化查询条件从ID改为名称模糊查询
This commit is contained in:
@@ -8,14 +8,10 @@
|
||||
<el-input size="default" v-model="tableData.param.keyword" placeholder="请输入库位名称" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库">
|
||||
<el-select size="default" v-model="tableData.param.warehouseId" placeholder="请选择仓库" clearable style="width: 180px" @change="onWarehouseChange">
|
||||
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.warehouseName" :value="item.id" />
|
||||
</el-select>
|
||||
<el-input size="default" v-model="tableData.param.warehouseName" placeholder="请输入仓库名称" clearable style="width: 180px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属库区">
|
||||
<el-select size="default" v-model="tableData.param.zoneId" placeholder="请选择库区" clearable style="width: 180px">
|
||||
<el-option v-for="item in filteredZoneOptions" :key="item.id" :label="item.zoneName" :value="item.id" />
|
||||
</el-select>
|
||||
<el-input size="default" v-model="tableData.param.zoneName" placeholder="请输入库区名称" clearable style="width: 180px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select size="default" v-model="tableData.param.status" placeholder="请选择状态" clearable style="width: 120px">
|
||||
@@ -90,7 +86,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { listLocations, deleteLocation } from '/@/api/assets/location';
|
||||
import { listWarehouses } from '/@/api/assets/warehouse';
|
||||
@@ -105,8 +101,8 @@ const tableData = reactive({
|
||||
loading: false,
|
||||
param: {
|
||||
keyword: '',
|
||||
warehouseId: '',
|
||||
zoneId: '',
|
||||
warehouseName: '',
|
||||
zoneName: '',
|
||||
status: undefined as string | undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -118,14 +114,6 @@ const warehouseOptions = ref<any[]>([]);
|
||||
// 库区选项
|
||||
const zoneOptions = ref<any[]>([]);
|
||||
|
||||
// 根据选中的仓库过滤库区选项
|
||||
const filteredZoneOptions = computed(() => {
|
||||
if (!tableData.param.warehouseId) {
|
||||
return zoneOptions.value;
|
||||
}
|
||||
return zoneOptions.value.filter((z: any) => z.warehouseId === tableData.param.warehouseId);
|
||||
});
|
||||
|
||||
// 编辑弹窗ref
|
||||
const editLocationRef = ref();
|
||||
// 日志弹窗ref
|
||||
@@ -151,11 +139,6 @@ const getZoneOptions = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 仓库选择变化时清空库区选择
|
||||
const onWarehouseChange = () => {
|
||||
tableData.param.zoneId = '';
|
||||
};
|
||||
|
||||
// 获取库位列表
|
||||
const getLocationList = async () => {
|
||||
tableData.loading = true;
|
||||
@@ -181,8 +164,8 @@ const getLocationList = async () => {
|
||||
// 重置查询
|
||||
const onResetQuery = () => {
|
||||
tableData.param.keyword = '';
|
||||
tableData.param.warehouseId = '';
|
||||
tableData.param.zoneId = '';
|
||||
tableData.param.warehouseName = '';
|
||||
tableData.param.zoneName = '';
|
||||
tableData.param.status = undefined;
|
||||
tableData.param.pageNum = 1;
|
||||
getLocationList();
|
||||
|
||||
Reference in New Issue
Block a user