Commit 684cc178 by 杨子

feat(库存管理): 新增盘点任务完成功能及借调单管理优化

1. 添加盘点任务完成API及前端操作按钮
2. 优化借调单管理界面及功能,包括:
   - 新增确认借调和归还功能
   - 调整表单字段及验证规则
   - 改进库存选择逻辑
3. 简化出入库报表界面,移除不必要元素
4. 优化库存选择对话框布局和查询逻辑
5. 为盘点任务添加状态显示功能
6. 移除盘点计划中仓库ID的必填验证
parent e840518b
......@@ -42,3 +42,21 @@ export function delWmsBorrowOrder(orderId) {
method: 'delete'
})
}
// 确认借调
export function borrowWmsBorrowOrder(data) {
return request({
url: '/ware/wmsBorrowOrder/borrow?orderId=' + data.orderId,
method: 'post',
data: data
})
}
// 归还借调
export function returnWmsBorrowOrder(data) {
return request({
url: '/ware/wmsBorrowOrder/return',
method: 'post',
data: data
})
}
......@@ -42,3 +42,11 @@ export function delWmsInventoryTask(taskId) {
method: 'delete'
})
}
// 结束盘点任务
export function completeWmsInventoryTask(taskId) {
return request({
url: '/ware/wmsInventoryTask/complete/' + taskId,
method: 'post'
})
}
<template>
<el-dialog :title="title" v-model="dialogVisible" width="1200px" append-to-body>
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="80px">
<el-form-item label="物资编码" prop="materialCode">
<el-input v-model="queryParams.materialCode" placeholder="请输入物资编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物资名称" prop="materialName">
<el-input v-model="queryParams.materialName" placeholder="请输入物资名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="货架" prop="locationId">
<el-input v-model="queryParams.locationName" placeholder="请选择货架" readonly clearable>
<template #append>
<el-button type="primary" @click="openLocationSelect">选择货架</el-button>
</template>
</el-input>
<el-form-item label="物资名称" prop="material.materialName" v-if="!defaultParams.materialId">
<el-input v-model="queryParams['material.materialName']" placeholder="请输入物资名称" clearable
@keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="批次号" prop="batchNo">
<el-input v-model="queryParams.batchNo" placeholder="请输入批次号" clearable @keyup.enter="handleQuery" />
......@@ -25,20 +16,22 @@
<el-table v-loading="loading" :data="inventoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="物资编码" align="center" prop="material.materialCode" />
<el-table-column label="物资编码" align="center" prop="material.materialCode" width="120" />
<el-table-column label="物资名称" align="center" prop="material.materialName" />
<el-table-column label="规格型号" align="center" prop="material.specification" />
<el-table-column label="计量单位" align="center" prop="material.unit" />
<el-table-column label="仓库" align="center" prop="warehouse.warehouseName" />
<el-table-column label="库区" align="center" prop="area.areaName" />
<el-table-column label="货架" align="center" prop="location.locationName" />
<el-table-column label="仓库/库区/货架" width="120">
<template #default="scope">
<div>{{ scope.row.warehouse?.warehouseName || '-' }} / {{ scope.row.area?.areaName || '-' }}/ {{
scope.row.location?.locationName || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="批次号" align="center" prop="batchNo" width="180" />
<el-table-column label="生产日期" align="center" prop="productionDate" width="180">
<el-table-column label="生产日期" align="center" prop="productionDate">
<template #default="scope">
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="失效日期" align="center" prop="expirationDate" width="180">
<el-table-column label="失效日期" align="center" prop="expirationDate">
<template #default="scope">
<span>{{ parseTime(scope.row.expirationDate, '{y}-{m}-{d}') }}</span>
</template>
......@@ -80,7 +73,7 @@ import LocationSelectDialog from './LocationSelectDialog.vue'
const { proxy } = getCurrentInstance()
const {sys_yes_no, inventory_status} = proxy.useDict('sys_yes_no', 'inventory_status')
const { sys_yes_no, inventory_status } = proxy.useDict('sys_yes_no', 'inventory_status')
const props = defineProps({
......@@ -131,10 +124,19 @@ const total = ref(0)
// 选中的库存
const selectedInventory = ref([])
const defaultParams = ref({})
// 搜索按钮操作
function handleQuery() {
function handleQuery(params) {
defaultParams.value = {
...defaultParams.value,
...params,
}
loading.value = true
listWmsInventory(queryParams.value).then(response => {
listWmsInventory({
...defaultParams.value,
...queryParams.value,
}).then(response => {
inventoryList.value = response.rows
total.value = response.total
loading.value = false
......
<template>
<div class="reports-view">
<div class="view-header">
<div class="header-actions">
<el-button type="primary" @click="exportReport">
<el-icon><Download /></el-icon>
导出报表
</el-button>
<el-button @click="refreshData">
<el-icon><Refresh /></el-icon>
刷新
</el-button>
</div>
</div>
<div class="view-content">
<!-- 过滤条件 -->
<el-card shadow="hover" class="filter-card">
<el-form :model="filterForm" :inline="true" label-width="100px">
<el-form-item label="报表类型">
<el-select v-model="filterForm.reportType" placeholder="请选择报表类型" clearable filterable style="width: 120px;">
<el-option label="出入库汇总" value="summary"></el-option>
<el-option label="周转率分析" value="turnover"></el-option>
<el-option label="效率分析" value="efficiency"></el-option>
<el-option label="异常统计" value="exception"></el-option>
</el-select>
</el-form-item>
<el-form-item label="时间范围">
<el-date-picker
v-model="filterForm.dateRange"
......@@ -89,9 +69,6 @@
<el-statistic title="库存周转天数" :value="statistics.turnoverDays" suffix="天" :value-style="{ color: '#909399' }"></el-statistic>
</el-card>
<el-card shadow="hover" class="stat-card">
<el-statistic title="作业效率" :value="statistics.operationEfficiency" suffix="件/小时" :value-style="{ color: '#67C23A' }"></el-statistic>
</el-card>
<el-card shadow="hover" class="stat-card">
<el-statistic title="异常率" :value="statistics.exceptionRate" suffix="%" :value-style="{ color: '#F56C6C' }"></el-statistic>
</el-card>
</div>
......@@ -126,7 +103,7 @@
<el-card shadow="hover" class="chart-card full-width">
<template #header>
<div class="card-header">
<span>周转率与效率分析</span>
<span>周转率分析</span>
</div>
</template>
<div ref="turnoverChartRef" class="chart-container"></div>
......@@ -582,7 +559,7 @@ const initCharts = () => {
const turnoverOption = {
title: {
text: '周转率与效率分析',
text: '周转率分析',
textStyle: {
fontSize: 16,
fontWeight: 'normal'
......@@ -593,7 +570,7 @@ const initCharts = () => {
trigger: 'axis'
},
legend: {
data: ['周转率', '作业效率', '异常率'],
data: ['周转率'],
top: 30
},
grid: {
......@@ -619,11 +596,6 @@ const initCharts = () => {
axisLabel: {
formatter: '{value}%'
}
},
{
type: 'value',
name: '作业效率(件/小时)',
position: 'right'
}
],
series: [
......@@ -636,24 +608,6 @@ const initCharts = () => {
},
yAxisIndex: 0
},
{
name: '作业效率',
type: 'line',
data: reportData.value.map(item => item.efficiency),
itemStyle: {
color: '#67C23A'
},
yAxisIndex: 1
},
{
name: '异常率',
type: 'line',
data: reportData.value.map(item => item.exceptionCount),
itemStyle: {
color: '#F56C6C'
},
yAxisIndex: 0
}
]
}
turnoverChart.setOption(turnoverOption)
......
......@@ -252,9 +252,6 @@ const data = reactive({
planType: [
{ required: true, message: "盘点类型不能为空", trigger: "change" }
],
warehouseId: [
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
],
startTime: [
{ required: true, message: "计划开始时间不能为空", trigger: "blur" }
],
......@@ -402,6 +399,7 @@ function handleAdd() {
function handleUpdate(row) {
reset()
form.value = row;
// form.value.warehouseName = row.areaIds || '|' + row.areaIds.split('|').filter(id => id).join('||') + '|'
open.value = true
title.value = "修改盘点计划"
}
......
......@@ -9,6 +9,9 @@
<el-descriptions-item label="任务名称">{{ taskInfo.taskName }}</el-descriptions-item>
<el-descriptions-item label="总盘点数">{{ taskInfo.totalItems }}</el-descriptions-item>
<el-descriptions-item label="已盘数">{{ taskInfo.countedItems }}</el-descriptions-item>
<el-descriptions-item label="任务状态">
<dict-tag :options="check_task_status" :value="taskInfo.taskStatus" />
</el-descriptions-item>
<el-descriptions-item label="备注" :span="2">{{ taskInfo.remark }}</el-descriptions-item>
</el-descriptions>
</div>
......@@ -57,7 +60,7 @@ import { listWmsInventoryTaskDetail } from "@/api/ware/wmsInventoryTaskDetail"
import { parseTime } from "@/utils/ruoyi"
const {proxy} = getCurrentInstance()
const {check_status, diff_type} = proxy.useDict('check_status','diff_type')
const {check_status, diff_type, check_task_status} = proxy.useDict('check_status','diff_type', 'check_task_status')
const props = defineProps({
visible: {
......
......@@ -33,6 +33,11 @@
<el-table-column label="仓库" align="center" prop="warehouseName" />
<el-table-column label="总盘点数" align="center" prop="totalItems" />
<el-table-column label="已盘数" align="center" prop="countedItems" />
<el-table-column label="任务状态" align="center" prop="taskStatus">
<template #default="scope">
<dict-tag :options="check_task_status" :value="scope.row.taskStatus" />
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="备注" align="center" prop="remark" width="240" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -41,8 +46,10 @@
v-hasPermi="['ware:wmsInventoryTask:detail']">详情</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['ware:wmsInventoryTask:remove']">删除</el-button>
<el-button link type="primary" icon="Scan" @click="handleExecute(scope.row)"
<el-button link type="primary" icon="Pointer" @click="handleExecute(scope.row)"
v-hasPermi="['ware:wmsInventoryTask:execute']">执行盘点</el-button>
<el-button v-if="scope.row.taskStatus === '1'" link type="primary" icon="Check" @click="handleComplete(scope.row)"
v-hasPermi="['ware:wmsInventoryTask:complete']">结束盘点</el-button>
</template>
</el-table-column>
</el-table>
......@@ -77,7 +84,7 @@
</template>
<script setup name="WmsInventoryTask">
import { listWmsInventoryTask, getWmsInventoryTask, delWmsInventoryTask, addWmsInventoryTask, updateWmsInventoryTask } from "@/api/ware/wmsInventoryTask"
import { listWmsInventoryTask, getWmsInventoryTask, delWmsInventoryTask, addWmsInventoryTask, updateWmsInventoryTask, completeWmsInventoryTask } from "@/api/ware/wmsInventoryTask"
import DetailInfo from "./components/DetailInfo.vue"
import AddForm from "./components/AddForm.vue"
import InventoryExecuteForm from "./components/InventoryExecuteForm.vue"
......@@ -88,6 +95,8 @@ const route = useRoute()
const { proxy } = getCurrentInstance()
const {check_task_status} = proxy.useDict('check_task_status')
const wmsInventoryTaskList = ref([])
const open = ref(false)
const loading = ref(true)
......@@ -270,6 +279,16 @@ function handleExecute(row) {
// 传递任务ID到执行盘点组件
inventoryExecuteFormRef.value?.open(row.taskId)
}
/** 结束盘点按钮操作 */
function handleComplete(row) {
proxy.$modal.confirm('是否确认结束盘点任务编号为"' + row.taskNo + '"的数据项?').then(function () {
return completeWmsInventoryTask(row.taskId)
}).then(() => {
getList()
proxy.$modal.msgSuccess("结束盘点成功")
}).catch(() => { })
}
// 监听路由参数中的action
watch(() => route.query.action, (newAction) => {
if (newAction === 'createTask') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment