feat(工单管理): 添加不良品库支持和批量打印功能

- 在仓库选项中添加不良品库(WH007)
- 在物料位置管理中增加不良品类型选项
- 将审批人输入框改为可筛选的下拉选择框
- 新增工单批量打印功能,支持多选工单后调用打印接口
This commit is contained in:
2026-02-24 12:43:46 +08:00
parent 272ccff70f
commit 78ff08f56c
4 changed files with 51 additions and 4 deletions

View File

@@ -5,5 +5,6 @@ export const warehouseOptions = [
{ warehouseCode: 'WH004', warehouseName: '退货库' }, { warehouseCode: 'WH004', warehouseName: '退货库' },
{ warehouseCode: 'WH005', warehouseName: '转用库' }, { warehouseCode: 'WH005', warehouseName: '转用库' },
{ warehouseCode: 'WH006', warehouseName: '报废库' }, { warehouseCode: 'WH006', warehouseName: '报废库' },
{ warehouseCode: 'WH007', warehouseName: '不良品库' }
// 更多仓库... // 更多仓库...
] ]

View File

@@ -318,6 +318,10 @@ const state = reactive({
dictValue: '退货', dictValue: '退货',
dictLabel: '退货' dictLabel: '退货'
}, },
{
dictValue: '不良品',
dictLabel: '不良品'
},
{ {
dictValue: '转用', dictValue: '转用',
dictLabel: '转用' dictLabel: '转用'

View File

@@ -130,7 +130,9 @@
</el-col> </el-col>
<el-col :lg="12"> <el-col :lg="12">
<el-form-item label="审批人" prop="approver"> <el-form-item label="审批人" prop="approver">
<el-input v-model="approveForm.approver" placeholder="输入审批人姓名" /> <el-select v-model="approveForm.approver" filterable placeholder="选择审批人">
<el-option v-for="item in userOptions" :key="item.userId" :label="item.nickName" :value="item.nickName" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :lg="24"> <el-col :lg="24">

View File

@@ -75,6 +75,11 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button class="tool-box" color="#00aa00" icon="Upload" @click="handleExport"> 工单导出 </el-button> <el-button class="tool-box" color="#00aa00" icon="Upload" @click="handleExport"> 工单导出 </el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button class="tool-box" color="#ff6600" icon="Printer" @click="handlePrint" :disabled="selectedWorkorders.length === 0">
批量打印
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
@@ -87,8 +92,9 @@
size="small" size="small"
header-row-class-name="table-header" header-row-class-name="table-header"
:cell-class-name="tableCellClassName" :cell-class-name="tableCellClassName"
@sort-change="sortChange"> @sort-change="sortChange"
<el-table-column type="index" width="50" align="center" /> @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="priority" label="优先级" align="center"> <el-table-column prop="priority" label="优先级" align="center">
<template #default="scope"> <template #default="scope">
<dict-tag :options="options.priorityOptions" :value="scope.row.priority" /> <dict-tag :options="options.priorityOptions" :value="scope.row.priority" />
@@ -441,6 +447,9 @@ const defectDialogVisible = ref(false)
const selectedWorkorderId = ref(null) const selectedWorkorderId = ref(null)
const selectedWorkorderInfo = ref({}) const selectedWorkorderInfo = ref({})
// 多选相关变量
const selectedWorkorders = ref([])
var dictParams = [] var dictParams = []
const allList = ref([]) const allList = ref([])
@@ -1068,6 +1077,37 @@ function handleDefectSubmit(data) {
getList() getList()
} }
// 处理表格多选
function handleSelectionChange(selection) {
selectedWorkorders.value = selection
}
// 处理批量打印
function handlePrint() {
if (selectedWorkorders.value.length === 0) {
proxy.$modal.msgWarning('请选择要打印的工单')
return
}
// 提取选中的工单号为数组
const workorderArray = selectedWorkorders.value.map((item) => item.workorder)
// path暂时为空字符串
const path = ''
// 调用printByBarTender API
printByBarTender({ workorderArray, path })
.then((res) => {
if (res.code === 200) {
proxy.$modal.msgSuccess('打印请求已发送')
} else {
proxy.$modal.msgError('打印失败: ' + res.msg)
}
})
.catch((error) => {
proxy.$modal.msgError('打印失败: ' + error.message)
})
}
// initDict() // initDict()
getMaterialCodeList() getMaterialCodeList()
handleQuery() handleQuery()