移除盘点管理中的计划开始和结束时间字段,优化盘点范围显示逻辑支持按仓库/库区/库位展示对应名称,调整盘点范围选择抽屉底部按钮样式
This commit is contained in:
@@ -40,30 +40,6 @@
|
||||
<!-- 盘点范围选择抽屉 -->
|
||||
<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-input v-model="form.assigneeId" placeholder="请输入负责人" />
|
||||
@@ -109,8 +85,6 @@ const form = reactive({
|
||||
locationIds: [] as string[],
|
||||
countType: undefined as number | undefined,
|
||||
scope: 1 as number,
|
||||
plannedStartTime: '',
|
||||
plannedEndTime: '',
|
||||
assigneeId: '',
|
||||
participants: [] as string[],
|
||||
remark: '',
|
||||
@@ -171,8 +145,7 @@ const openDialog = async (row?: any) => {
|
||||
form.description = data.description || '';
|
||||
form.countType = data.countType;
|
||||
form.scope = data.scope || 1;
|
||||
form.plannedStartTime = data.plannedStartTime || '';
|
||||
form.plannedEndTime = data.plannedEndTime || '';
|
||||
|
||||
form.assigneeId = data.assigneeId || '';
|
||||
form.remark = data.remark || '';
|
||||
// 处理仓库/库区/库位ID(后端返回warehouseIDs,前端使用warehouseIds)
|
||||
@@ -202,8 +175,7 @@ const resetForm = () => {
|
||||
form.locationIds = [];
|
||||
form.countType = undefined;
|
||||
form.scope = 1;
|
||||
form.plannedStartTime = '';
|
||||
form.plannedEndTime = '';
|
||||
|
||||
form.assigneeId = '';
|
||||
form.participants = [];
|
||||
form.remark = '';
|
||||
@@ -255,8 +227,6 @@ const handleSubmit = async () => {
|
||||
description: form.description || undefined,
|
||||
countType: form.countType,
|
||||
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,
|
||||
remark: form.remark || undefined,
|
||||
};
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
<el-button style="margin-bottom: 10px;" @click="handleClose">取消</el-button>
|
||||
<el-button style="margin-bottom: 10px; margin-right: 10px; " type="primary" @click="handleConfirm">确定</el-button>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
@@ -71,7 +71,11 @@
|
||||
{{ scope.row.scopeText || getScopeLabel(scope.row.scope) }}
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<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] || '未知';
|
||||
};
|
||||
|
||||
// 根据盘点范围获取显示名称
|
||||
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 tagMap: Record<number, string> = {
|
||||
|
||||
Reference in New Issue
Block a user