feat(报表/库存管理): 添加表单验证并优化表格显示

为报工表单添加必填字段验证,确保炉号、进料单和客户定单在相应工序中必须填写
调整库存管理页面表格列显示,隐藏仓库编码和名称,增加工单号和备注列
This commit is contained in:
2026-01-17 10:12:07 +08:00
parent 0abec15bdc
commit 4e684cf78b
2 changed files with 39 additions and 18 deletions

View File

@@ -538,7 +538,7 @@
</el-dialog> </el-dialog>
<!-- 进出库记录弹出框 --> <!-- 进出库记录弹出框 -->
<el-dialog :title="title" v-model="openRecord" width="80%" top="5vh"> <el-dialog :title="title" v-model="openRecord" width="90%" top="5vh">
<el-form :model="queryParamsRecord" label-position="right" inline ref="queryRecordRef" @submit.prevent> <el-form :model="queryParamsRecord" label-position="right" inline ref="queryRecordRef" @submit.prevent>
<el-form-item label="出入库" prop="searchType"> <el-form-item label="出入库" prop="searchType">
<el-select @change="handleRecordFlagChange" v-model="queryParamsRecord.recordFlag" filterable placeholder="请选择出入库"> <el-select @change="handleRecordFlagChange" v-model="queryParamsRecord.recordFlag" filterable placeholder="请选择出入库">
@@ -585,8 +585,6 @@
<el-table-column prop="outboundNo" label="出库单号" align="center" /> <el-table-column prop="outboundNo" label="出库单号" align="center" />
<el-table-column prop="materialCode" label="物料编码" align="center" /> <el-table-column prop="materialCode" label="物料编码" align="center" />
<el-table-column prop="materialName" label="物料名称" align="center" v-if="columns.showColumn('materialName')" /> <el-table-column prop="materialName" label="物料名称" align="center" v-if="columns.showColumn('materialName')" />
<el-table-column prop="warehouseCode" label="仓库编码" align="center" v-if="columns.showColumn('warehouseCode')" />
<el-table-column prop="warehouseName" label="仓库名称" align="center" v-if="columns.showColumn('warehouseName')" />
<el-table-column prop="locationCode" label="库位编码" align="center" v-if="columns.showColumn('locationCode')" /> <el-table-column prop="locationCode" label="库位编码" align="center" v-if="columns.showColumn('locationCode')" />
<el-table-column prop="locationName" label="库位名称" align="center" v-if="columns.showColumn('locationName')" /> <el-table-column prop="locationName" label="库位名称" align="center" v-if="columns.showColumn('locationName')" />
<el-table-column prop="quantity" label="出库数量" align="center" v-if="columns.showColumn('quantity')"> <el-table-column prop="quantity" label="出库数量" align="center" v-if="columns.showColumn('quantity')">
@@ -612,15 +610,9 @@
disabled disabled
>已撤销</el-button >已撤销</el-button
> >
<el-button <el-button v-else type="info" size="small" title="撤销" v-hasPermi="['mmrecordinbound:delete']" @click="handleCancel(scope.row)"
v-else
type="info"
size="small"
title="撤销"
v-hasPermi="['mmrecordinbound:delete']"
@click="handleCancel(scope.row)"
>撤销</el-button >撤销</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -651,9 +643,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="transactionType" label="入库类型" align="center" v-if="columns.showColumn('transactionType')" /> <el-table-column prop="transactionType" label="入库类型" align="center" v-if="columns.showColumn('transactionType')" />
<el-table-column prop="warehouseCode" label="仓库编码" align="center" v-if="columns.showColumn('warehouseCode')" />
<el-table-column prop="batchNo" label="批次号" align="center" v-if="columns.showColumn('batchNo')" /> <el-table-column prop="batchNo" label="批次号" align="center" v-if="columns.showColumn('batchNo')" />
<el-table-column prop="operator" label="操作员" align="center" v-if="columns.showColumn('operator')" /> <el-table-column prop="workorder" label="工单号" align="center" />
<el-table-column prop="operator" label="操作员" align="center" />
<el-table-column prop="remarks" label="备注" align="center" />
<el-table-column label="操作"> <el-table-column label="操作">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -717,8 +710,8 @@ const queryParams = reactive({
const columns = ref([ const columns = ref([
// { visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' }, // { visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' },
{ visible: true, align: 'center', type: '', prop: 'materialCode', label: '物料编码', showOverflowTooltip: true }, { visible: true, align: 'center', type: '', prop: 'materialCode', label: '物料编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'warehouseCode', label: '仓库编码', showOverflowTooltip: true }, { visible: false, align: 'center', type: '', prop: 'warehouseCode', label: '仓库编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'warehouseName', label: '仓库名称', showOverflowTooltip: true }, { visible: false, align: 'center', type: '', prop: 'warehouseName', label: '仓库名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'locationCode', label: '库位编码', showOverflowTooltip: true }, { visible: true, align: 'center', type: '', prop: 'locationCode', label: '库位编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'locationName', label: '库位名称', showOverflowTooltip: true }, { visible: true, align: 'center', type: '', prop: 'locationName', label: '库位名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'batchNo', label: '批次号', showOverflowTooltip: true }, { visible: true, align: 'center', type: '', prop: 'batchNo', label: '批次号', showOverflowTooltip: true },

View File

@@ -17,9 +17,9 @@
<el-card v-if="formData.workorder" class="mt-4"> <el-card v-if="formData.workorder" class="mt-4">
<v-text-field type="number" :label="processId === 10 ? '报工数' : '完成数'" v-model="formData.finishNum"></v-text-field> <v-text-field type="number" :label="processId === 10 ? '报工数' : '完成数'" v-model="formData.finishNum"></v-text-field>
<v-text-field type="number" label="不良数" v-model="formData.badNum"></v-text-field> <v-text-field type="number" label="不良数" v-model="formData.badNum"></v-text-field>
<v-text-field v-if="processId === 10" label="炉号" v-model="formData.stoveCode"></v-text-field> <v-text-field v-if="processId === 10" label="炉号" v-model="formData.stoveCode" required></v-text-field>
<v-text-field v-if="processId === 10" label="进料单" v-model="formData.feedOrder"></v-text-field> <v-text-field v-if="processId === 10" label="进料单" v-model="formData.feedOrder" required></v-text-field>
<v-text-field v-if="processId === 90" label="客户定单" v-model="formData.customerOrder"></v-text-field> <v-text-field v-if="processId === 90" label="客户定单" v-model="formData.customerOrder" required></v-text-field>
<v-text-field label="作业员" v-model="formData.worker"></v-text-field> <v-text-field label="作业员" v-model="formData.worker"></v-text-field>
<div class="d-flex justify-end"> <div class="d-flex justify-end">
<v-btn class="bg-blue-darken-1" @click="submit">{{ getButtonName() }}</v-btn> <v-btn class="bg-blue-darken-1" @click="submit">{{ getButtonName() }}</v-btn>
@@ -321,6 +321,34 @@ function processChange() {
} }
function submit() { function submit() {
// 表单验证
if (processId.value === 10) {
// 领料工序:炉号和进料单必填
if (!formData.value.stoveCode) {
dialog.show = true
dialog.class = 'bg-amber'
dialog.title = '验证提示'
dialog.text = '请填写炉号'
return
}
if (!formData.value.feedOrder) {
dialog.show = true
dialog.class = 'bg-amber'
dialog.title = '验证提示'
dialog.text = '请填写进料单'
return
}
} else if (processId.value === 90) {
// 出货工序:客户定单必填
if (!formData.value.customerOrder) {
dialog.show = true
dialog.class = 'bg-amber'
dialog.title = '验证提示'
dialog.text = '请填写客户定单'
return
}
}
proxy proxy
.$confirm('确定提交数据吗?') .$confirm('确定提交数据吗?')
.then(() => { .then(() => {