✨ feat(mes): 新增批次详情弹窗及相关逻辑
parent
884fb1bf66
commit
45f8ea64c7
|
|
@ -0,0 +1,131 @@
|
|||
<template>
|
||||
<Dialog title="批次详情" v-model="dialogVisible" width="980px">
|
||||
<el-form
|
||||
:model="formData"
|
||||
label-width="120px"
|
||||
v-loading="formLoading"
|
||||
disabled
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="批次编号">
|
||||
<el-input v-model="formData.code" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码">
|
||||
<el-input v-model="formData.itemCode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称">
|
||||
<el-input v-model="formData.itemName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="formData.itemSpecification" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="formData.unitName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产批号">
|
||||
<el-input v-model="formData.lotNumber" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产日期">
|
||||
<el-input :model-value="formData.produceDate ? formatDate(formData.produceDate, 'YYYY-MM-DD') : ''" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效期">
|
||||
<el-input :model-value="formData.expireDate ? formatDate(formData.expireDate, 'YYYY-MM-DD') : ''" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库日期">
|
||||
<el-input :model-value="formData.receiptDate ? formatDate(formData.receiptDate, 'YYYY-MM-DD') : ''" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="formData.vendorName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户">
|
||||
<el-input v-model="formData.clientName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工作站">
|
||||
<el-input v-model="formData.workstationCode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购订单编号">
|
||||
<el-input v-model="formData.purchaseOrderCode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售订单编号">
|
||||
<el-input v-model="formData.salesOrderCode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产工单">
|
||||
<el-input v-model="formData.workOrderCode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { BatchApi, BatchVO } from '@/api/mes/wm/batch'
|
||||
|
||||
defineOptions({ name: 'BatchForm' })
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const formLoading = ref(false)
|
||||
const formData = ref<BatchVO>({} as BatchVO)
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (id: number) => {
|
||||
dialogVisible.value = true
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await BatchApi.getBatch(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
|
@ -77,8 +77,19 @@
|
|||
<el-table-column label="规格型号" align="center" prop="specification" min-width="120" />
|
||||
<el-table-column label="在库数量" align="center" prop="quantity" min-width="100" />
|
||||
<el-table-column label="单位" align="center" prop="unitMeasureName" min-width="80" />
|
||||
<!-- TODO @AI:对齐 ktg,这里应该有个【批次详情】 -->
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" min-width="140" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" min-width="140">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="scope.row.batchId"
|
||||
link
|
||||
type="primary"
|
||||
@click="openBatchDetail(scope.row.batchId)"
|
||||
>
|
||||
{{ scope.row.batchCode }}
|
||||
</el-button>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" align="center" prop="warehouseName" min-width="100" />
|
||||
<el-table-column label="库区" align="center" prop="locationName" min-width="100" />
|
||||
<el-table-column label="库位" align="center" prop="areaName" min-width="100">
|
||||
|
|
@ -126,6 +137,9 @@
|
|||
|
||||
<!-- 库位详情弹窗 -->
|
||||
<AreaForm ref="areaFormRef" />
|
||||
|
||||
<!-- 批次详情弹窗 -->
|
||||
<BatchForm ref="batchFormRef" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
@ -134,6 +148,7 @@ import download from '@/utils/download'
|
|||
import { WmMaterialStockApi, WmMaterialStockVO } from '@/api/mes/wm/materialstock'
|
||||
import ItemTypeTree from '@/views/mes/md/item/ItemTypeTree.vue'
|
||||
import AreaForm from '@/views/mes/wm/warehouse/area/AreaForm.vue'
|
||||
import BatchForm from '@/views/mes/wm/batch/BatchForm.vue'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import WmWarehouseSelect from '@/views/mes/wm/warehouse/components/WmWarehouseSelect.vue'
|
||||
import WmWarehouseLocationSelect from '@/views/mes/wm/warehouse/components/WmWarehouseLocationSelect.vue'
|
||||
|
|
@ -213,6 +228,12 @@ const openAreaDetail = (areaId: number) => {
|
|||
areaFormRef.value.open('detail', areaId)
|
||||
}
|
||||
|
||||
/** 打开批次详情弹窗 */
|
||||
const batchFormRef = ref()
|
||||
const openBatchDetail = (batchId: number) => {
|
||||
batchFormRef.value.open(batchId)
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue