移除盘点管理中的计划开始和结束时间字段,优化盘点范围显示逻辑支持按仓库/库区/库位展示对应名称,调整盘点范围选择抽屉底部按钮样式

This commit is contained in:
WUSIJIAN
2026-02-24 10:33:28 +08:00
parent d266e5f9e5
commit dcfceb2d0e
3 changed files with 25 additions and 35 deletions

View File

@@ -40,30 +40,6 @@
<!-- 盘点范围选择抽屉 --> <!-- 盘点范围选择抽屉 -->
<ScopeSelectDrawer ref="scopeDrawerRef" @confirm="onScopeConfirm" /> <ScopeSelectDrawer ref="scopeDrawerRef" @confirm="onScopeConfirm" />
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="计划开始" prop="plannedStartTime">
<el-date-picker
v-model="form.plannedStartTime"
type="datetime"
placeholder="请选择计划开始时间"
style="width: 100%"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划结束" prop="plannedEndTime">
<el-date-picker
v-model="form.plannedEndTime"
type="datetime"
placeholder="请选择计划结束时间"
style="width: 100%"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="负责人" prop="assigneeId"> <el-form-item label="负责人" prop="assigneeId">
<el-input v-model="form.assigneeId" placeholder="请输入负责人" /> <el-input v-model="form.assigneeId" placeholder="请输入负责人" />
@@ -109,8 +85,6 @@ const form = reactive({
locationIds: [] as string[], locationIds: [] as string[],
countType: undefined as number | undefined, countType: undefined as number | undefined,
scope: 1 as number, scope: 1 as number,
plannedStartTime: '',
plannedEndTime: '',
assigneeId: '', assigneeId: '',
participants: [] as string[], participants: [] as string[],
remark: '', remark: '',
@@ -171,8 +145,7 @@ const openDialog = async (row?: any) => {
form.description = data.description || ''; form.description = data.description || '';
form.countType = data.countType; form.countType = data.countType;
form.scope = data.scope || 1; form.scope = data.scope || 1;
form.plannedStartTime = data.plannedStartTime || '';
form.plannedEndTime = data.plannedEndTime || '';
form.assigneeId = data.assigneeId || ''; form.assigneeId = data.assigneeId || '';
form.remark = data.remark || ''; form.remark = data.remark || '';
// 处理仓库/库区/库位ID后端返回warehouseIDs前端使用warehouseIds // 处理仓库/库区/库位ID后端返回warehouseIDs前端使用warehouseIds
@@ -202,8 +175,7 @@ const resetForm = () => {
form.locationIds = []; form.locationIds = [];
form.countType = undefined; form.countType = undefined;
form.scope = 1; form.scope = 1;
form.plannedStartTime = '';
form.plannedEndTime = '';
form.assigneeId = ''; form.assigneeId = '';
form.participants = []; form.participants = [];
form.remark = ''; form.remark = '';
@@ -255,8 +227,6 @@ const handleSubmit = async () => {
description: form.description || undefined, description: form.description || undefined,
countType: form.countType, countType: form.countType,
scope: form.scope, scope: form.scope,
plannedStartTime: form.plannedStartTime || undefined,
plannedEndTime: form.plannedEndTime || undefined,
participants: participantsInput.value ? participantsInput.value.split(',').map(s => s.trim()).filter(s => s) : undefined, participants: participantsInput.value ? participantsInput.value.split(',').map(s => s.trim()).filter(s => s) : undefined,
remark: form.remark || undefined, remark: form.remark || undefined,
}; };

View File

@@ -106,8 +106,8 @@
</div> </div>
<template #footer> <template #footer>
<el-button @click="handleClose">取消</el-button> <el-button style="margin-bottom: 10px;" @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button style="margin-bottom: 10px; margin-right: 10px; " type="primary" @click="handleConfirm">确定</el-button>
</template> </template>
</el-drawer> </el-drawer>
</template> </template>

View File

@@ -71,7 +71,11 @@
{{ scope.row.scopeText || getScopeLabel(scope.row.scope) }} {{ scope.row.scopeText || getScopeLabel(scope.row.scope) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="warehouseName" label="仓库" width="120" show-overflow-tooltip /> <el-table-column label="仓库/库区/库位" width="150" show-overflow-tooltip>
<template #default="scope">
{{ getScopeDisplayNames(scope.row) }}
</template>
</el-table-column>
<el-table-column prop="statusText" label="状态" width="100" align="center"> <el-table-column prop="statusText" label="状态" width="100" align="center">
<template #default="scope"> <template #default="scope">
<el-tag :type="getStatusTag(scope.row.status)">{{ scope.row.statusText || getStatusLabel(scope.row.status) }}</el-tag> <el-tag :type="getStatusTag(scope.row.status)">{{ scope.row.statusText || getStatusLabel(scope.row.status) }}</el-tag>
@@ -170,6 +174,22 @@ const getScopeLabel = (scope: number) => {
return labelMap[scope] || '未知'; return labelMap[scope] || '未知';
}; };
// 根据盘点范围获取显示名称
const getScopeDisplayNames = (row: any) => {
const scope = row.scope;
if (scope === 1) {
// 按仓库盘点,显示仓库名称
return (row.warehouseNames || []).join('、') || '-';
} else if (scope === 2) {
// 按库区盘点,显示库区名称
return (row.zoneNames || []).join('、') || '-';
} else if (scope === 3) {
// 按库位盘点,显示库位名称
return (row.locationNames || []).join('、') || '-';
}
return '-';
};
// 获取状态标签 // 获取状态标签
const getStatusTag = (status: number) => { const getStatusTag = (status: number) => {
const tagMap: Record<number, string> = { const tagMap: Record<number, string> = {