feat(wms): 入库单物料打印条码支持按入库状态筛选

- 新增入库状态筛选功能,根据路由参数设置初始筛选值
- 添加实际入库时间列
- 调整部分列的显示逻辑,根据入库状态动态显示
- 优化查询和重置功能,保留入库状态筛选条件
master
zangch@mesnac.com 12 hours ago
parent 53d9a72e5a
commit bef644015a

@ -38,10 +38,10 @@
<el-form-item label="物料规格" prop="materialSpe">
<el-input v-model="queryParams.materialSpe" placeholder="请输入物料规格" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计量单位名称" prop="unitName">
<el-form-item label="计量单位名称" prop="unitName" label-width="120px">
<el-input v-model="queryParams.unitName" placeholder="请输入计量单位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="是否有条码" prop="codeYesNo">
<el-form-item label="是否有条码" prop="codeYesNo" label-width="120px">
<el-select v-model="queryParams.codeYesNo" placeholder="请选择物料大类">
<el-option
v-for="dict in wms_barcode_if"
@ -111,7 +111,18 @@
</template>
</el-table-column>
<el-table-column label="物料大类" align="center" prop="materialCategoryName" v-if="columns[12].visible">
</el-table-column>
<!-- <el-table-column label="推荐库位id" align="center" prop="recommendWarehouseId" v-if="inboundStatusdVisble.value">
</el-table-column>
<el-table-column label="入库状态(0-待入库,1-已入库,2-入库中)" align="center" prop="inboundStatus" v-if="inboundStatusdVisble.value">
<template #default="scope">
<dict-tag :options="wms_inbound_status" :value="scope.row.inboundStatus"/>
</template>
</el-table-column> -->
<el-table-column label="实际入库时间" align="center" prop="actualInboundTime" width="120px" v-if="inboundStatusdVisble">
<template #default="scope">
<span>{{ parseTime(scope.row.actualInboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
@ -201,27 +212,7 @@ const materialList = ref([]);
const queryFormRef = ref<ElFormInstance>();
const instockPrintFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `入库单子表主键`, visible: true },
{ key: 1, label: `入库单号`, visible: true },
{ key: 2, label: `创建时间`, visible: true },
{ key: 3, label: `批次码`, visible: true },
{ key: 4, label: `条码数量`, visible: true },
{ key: 5, label: `分包数量`, visible: true },
{ key: 6, label: `物料id`, visible: true },
{ key: 7, label: `物料编码`, visible: true },
{ key: 8, label: `物料名称`, visible: true },
{ key: 9, label: `物料规格`, visible: true },
{ key: 10, label: `计量单位名称`, visible: true },
{ key: 11, label: `是否有条码`, visible: true },
{ key: 12, label: `物料大类`, visible: true },
]);
const initFormData: InstockPrintForm = {
instockPrintId: undefined,
@ -237,6 +228,9 @@ const initFormData: InstockPrintForm = {
codeYesNo: undefined,
materialCategoryId: undefined,
materialCategoryName: undefined,
locationId: undefined,
inboundStatus: undefined,
actualInboundTime: undefined,
}
const data = reactive<PageData<InstockPrintForm, InstockPrintQuery>>({
form: {...initFormData},
@ -256,6 +250,9 @@ const data = reactive<PageData<InstockPrintForm, InstockPrintQuery>>({
codeYesNo: undefined,
materialCategoryId: undefined,
materialCategoryName: undefined,//
locationId: undefined,
inboundStatus: undefined,
actualInboundTime: undefined,
params: {
}
},
@ -301,6 +298,49 @@ const data = reactive<PageData<InstockPrintForm, InstockPrintQuery>>({
const { queryParams, form, rules } = toRefs(data);
//
const route = useRoute();
//
const inboundStatusdVisble = ref(false);
//
let routeInboundStatusValue = '';
if (route.query.inboundStatus ) {
//
const inboundStatusdValue = Array.isArray(route.query.inboundStatus )
? route.query.inboundStatus[0]
: route.query.inboundStatus;
queryParams.value.inboundStatus = inboundStatusdValue;
routeInboundStatusValue = inboundStatusdValue; //
//
inboundStatusdVisble.value = true;
}
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `入库单子表主键`, visible: true },
{ key: 1, label: `入库单号`, visible: true },
{ key: 2, label: `创建时间`, visible: true },
{ key: 3, label: `批次码`, visible: true },
{ key: 4, label: `条码数量`, visible: true },
{ key: 5, label: `分包数量`, visible: true },
{ key: 6, label: `物料id`, visible: true },
{ key: 7, label: `物料编码`, visible: true },
{ key: 8, label: `物料名称`, visible: true },
{ key: 9, label: `物料规格`, visible: true },
{ key: 10, label: `计量单位名称`, visible: true },
{ key: 11, label: `是否有条码`, visible: true },
{ key: 12, label: `物料大类`, visible: true },
// { key: 13, label: `id`, visible: inboundStatusdVisble.value },
// { key: 14, label: `(0-,1-,2-)`, visible: inboundStatusdVisble.value },
// { key: 15, label: ``, visible: inboundStatusdVisble.value },
]);
/** 查询入库单-物料打印条码列表 */
const getList = async () => {
loading.value = true;
@ -319,18 +359,21 @@ const cancel = () => {
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
queryParams.value.inboundStatus = routeInboundStatusValue;
instockPrintFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
queryParams.value.inboundStatus = routeInboundStatusValue;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
queryParams.value.inboundStatus = routeInboundStatusValue;
handleQuery();
}

Loading…
Cancel
Save