fix(mes): 修复 SN 码查看条码缺少 bizType
- 新增 SN 码条码业务类型与配置 - 支持按 SN 明细查询对应条码 - 抽离 SN 码明细弹窗组件 - 同步 vben antd/ele 的条码入口 Refs: https://t.zsxq.com/1YCqDmaster
parent
05d6196780
commit
17428e9867
|
|
@ -13,6 +13,20 @@ export interface WmSnGroupVO {
|
|||
createTime?: Date
|
||||
}
|
||||
|
||||
export interface WmSnVO {
|
||||
id?: number
|
||||
uuid?: string
|
||||
code?: string
|
||||
itemId?: number
|
||||
itemCode?: string
|
||||
itemName?: string
|
||||
specification?: string
|
||||
unitName?: string
|
||||
batchCode?: string
|
||||
workOrderId?: number
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
export interface WmSnGenerateVO {
|
||||
itemId?: number
|
||||
batchCode?: string
|
||||
|
|
@ -30,6 +44,11 @@ export const getSnGroupPage = async (params: any) => {
|
|||
return await request.get({ url: `/mes/wm/sn/group-page`, params })
|
||||
}
|
||||
|
||||
// 获得批次 SN 码明细列表
|
||||
export const getSnListByUuid = async (uuid: string) => {
|
||||
return await request.get({ url: `/mes/wm/sn/list-by-uuid`, params: { uuid } })
|
||||
}
|
||||
|
||||
// 批量删除 SN 码(按批次 UUID)
|
||||
export const deleteSnBatch = async (uuid: string) => {
|
||||
return await request.delete({ url: `/mes/wm/sn/delete-batch`, params: { uuid } })
|
||||
|
|
|
|||
|
|
@ -515,6 +515,7 @@ export enum BarcodeBizTypeEnum {
|
|||
PACKAGE = 105,
|
||||
STOCK = 106,
|
||||
BATCH = 107,
|
||||
SN = 109,
|
||||
// PRO 生产模块 [300, 400)
|
||||
PROCARD = 300,
|
||||
WORKORDER = 301,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
<template>
|
||||
<Dialog v-model="dialogVisible" title="SN 码明细" width="1000px">
|
||||
<el-descriptions :column="3" border class="mb-20px">
|
||||
<el-descriptions-item label="物料编码">{{ detailGroup?.itemCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物料名称">{{ detailGroup?.itemName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="批次号">{{ detailGroup?.batchCode || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table v-loading="detailLoading" :data="detailList" stripe max-height="520">
|
||||
<el-table-column label="SN 码" align="center" prop="code" min-width="180" />
|
||||
<el-table-column label="物料编码" align="center" prop="itemCode" min-width="120" />
|
||||
<el-table-column label="物料名称" align="center" prop="itemName" min-width="150" />
|
||||
<el-table-column label="规格型号" align="center" prop="specification" min-width="120" />
|
||||
<el-table-column label="单位" align="center" prop="unitName" min-width="80" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" min-width="120" />
|
||||
<el-table-column
|
||||
label="生成时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" width="100" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleBarcode(scope.row)"
|
||||
v-hasPermi="['mes:wm-sn:query']"
|
||||
>
|
||||
条码
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</Dialog>
|
||||
|
||||
<!-- 条码详情弹窗 -->
|
||||
<BarcodeDetail ref="barcodeDetailRef" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as WmSnApi from '@/api/mes/wm/sn'
|
||||
import { BarcodeDetail } from '@/views/mes/wm/barcode/components'
|
||||
import { BarcodeBizTypeEnum } from '@/views/mes/utils/constants'
|
||||
|
||||
defineOptions({ name: 'WmSnDetailDialog' })
|
||||
|
||||
const dialogVisible = ref(false) // 明细弹窗是否展示
|
||||
const detailLoading = ref(false) // 明细列表的加载中
|
||||
const detailGroup = ref<WmSnApi.WmSnGroupVO>()
|
||||
const detailList = ref<WmSnApi.WmSnVO[]>([]) // 明细列表的数据
|
||||
|
||||
/** 查看 SN 码明细 */
|
||||
const open = async (row: WmSnApi.WmSnGroupVO) => {
|
||||
if (!row.uuid) {
|
||||
return
|
||||
}
|
||||
dialogVisible.value = true
|
||||
detailGroup.value = row
|
||||
detailLoading.value = true
|
||||
try {
|
||||
detailList.value = await WmSnApi.getSnListByUuid(row.uuid)
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
/** 查看 SN 码条码 */
|
||||
const barcodeDetailRef = ref()
|
||||
const handleBarcode = async (row: WmSnApi.WmSnVO) => {
|
||||
if (!row.id) {
|
||||
return
|
||||
}
|
||||
await barcodeDetailRef.value.openByBusiness(
|
||||
row.id,
|
||||
BarcodeBizTypeEnum.SN,
|
||||
row.code,
|
||||
row.itemName
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
|
@ -69,7 +69,18 @@
|
|||
<el-table-column label="规格型号" align="center" prop="specification" min-width="120" />
|
||||
<el-table-column label="单位" align="center" prop="unitName" min-width="80" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" min-width="120" />
|
||||
<el-table-column label="SN 码数量" align="center" prop="count" min-width="100" />
|
||||
<el-table-column label="SN 码数量" align="center" prop="count" min-width="100">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openDetail(scope.row)"
|
||||
v-hasPermi="['mes:wm-sn:query']"
|
||||
>
|
||||
{{ scope.row.count }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="生成时间"
|
||||
align="center"
|
||||
|
|
@ -77,8 +88,16 @@
|
|||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" width="220" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="240" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openDetail(scope.row)"
|
||||
v-hasPermi="['mes:wm-sn:query']"
|
||||
>
|
||||
查看明细
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
|
|
@ -95,14 +114,6 @@
|
|||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleBarcode(scope.row)"
|
||||
v-hasPermi="['mes:wm-sn:query']"
|
||||
>
|
||||
条码
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -117,8 +128,9 @@
|
|||
|
||||
<!-- 表单弹窗:生成 SN 码 -->
|
||||
<WmSnGenerateForm ref="formRef" @success="getList" />
|
||||
<!-- 条码详情弹窗 -->
|
||||
<BarcodeDetail ref="barcodeDetailRef" />
|
||||
|
||||
<!-- SN 码明细弹窗 -->
|
||||
<WmSnDetailDialog ref="detailRef" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
@ -127,8 +139,7 @@ import download from '@/utils/download'
|
|||
import * as WmSnApi from '@/api/mes/wm/sn'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import WmSnGenerateForm from './WmSnGenerateForm.vue'
|
||||
import { BarcodeDetail } from '@/views/mes/wm/barcode/components'
|
||||
import { BarcodeBizTypeEnum } from '@/views/mes/utils/constants'
|
||||
import WmSnDetailDialog from './WmSnDetailDialog.vue'
|
||||
|
||||
defineOptions({ name: 'MesWmSn' })
|
||||
|
||||
|
|
@ -180,6 +191,12 @@ const openForm = () => {
|
|||
formRef.value.open()
|
||||
}
|
||||
|
||||
/** 查看 SN 码明细 */
|
||||
const detailRef = ref()
|
||||
const openDetail = (row: WmSnApi.WmSnGroupVO) => {
|
||||
detailRef.value.open(row)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (uuid: string) => {
|
||||
try {
|
||||
|
|
@ -216,18 +233,6 @@ const handleExportDetail = async (uuid: string) => {
|
|||
} catch {}
|
||||
}
|
||||
|
||||
/** 查看 SN 码条码 */
|
||||
const barcodeDetailRef = ref()
|
||||
const handleBarcode = async (row: WmSnApi.WmSnGroupVO) => {
|
||||
// SN 码使用 uuid 作为业务 ID
|
||||
await barcodeDetailRef.value.openByBusiness(
|
||||
row.uuid,
|
||||
BarcodeBizTypeEnum.SN,
|
||||
row.batchCode,
|
||||
row.itemName
|
||||
)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
|
|
|||
Loading…
Reference in New Issue