✨ feat(mes): 重命名产品收货单相关类和接口
重命名产品收货单及其相关的 VO、DO、Service 和 API 接口,以统一命名为“Receipt”,提升代码可读性和一致性。此变更包括多个文件的重命名和相应的引用更新,确保系统功能不受影响。pull/871/MERGE
parent
21cfbb9314
commit
c2e397e84c
|
|
@ -0,0 +1,53 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 产品入库单明细 VO
|
||||
export interface WmProductReceiptDetailVO {
|
||||
id: number
|
||||
lineId: number
|
||||
receiptId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
quantity: number
|
||||
batchId: number
|
||||
warehouseId: number
|
||||
warehouseName: string
|
||||
locationId: number
|
||||
locationName: string
|
||||
areaId: number
|
||||
areaName: string
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 产品入库单明细 API
|
||||
export const WmProductReceiptDetailApi = {
|
||||
// 查询产品入库单明细列表
|
||||
getProductReceiptDetailList: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt-detail/list', params })
|
||||
},
|
||||
|
||||
// 根据行项目ID查询产品入库单明细列表
|
||||
getProductReceiptDetailListByLineId: async (lineId: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt-detail/list-by-line', params: { lineId } })
|
||||
},
|
||||
|
||||
// 查询产品入库单明细详情
|
||||
getProductReceiptDetail: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt-detail/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增产品入库单明细
|
||||
createProductReceiptDetail: async (data: WmProductReceiptDetailVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-receipt-detail/create', data })
|
||||
},
|
||||
|
||||
// 修改产品入库单明细
|
||||
updateProductReceiptDetail: async (data: WmProductReceiptDetailVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt-detail/update', data })
|
||||
},
|
||||
|
||||
// 删除产品入库单明细
|
||||
deleteProductReceiptDetail: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-receipt-detail/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 产品入库单 VO
|
||||
export interface WmProductReceiptVO {
|
||||
id: number
|
||||
code: string
|
||||
name: string
|
||||
workOrderId: number
|
||||
workOrderCode: string
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
specification: string
|
||||
unitMeasureName: string
|
||||
receiptDate: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 产品入库单 API
|
||||
export const WmProductReceiptApi = {
|
||||
// 查询产品入库单分页
|
||||
getProductReceiptPage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt/page', params })
|
||||
},
|
||||
|
||||
// 查询产品入库单详情
|
||||
getProductReceipt: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增产品入库单
|
||||
createProductReceipt: async (data: WmProductReceiptVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-receipt/create', data })
|
||||
},
|
||||
|
||||
// 修改产品入库单
|
||||
updateProductReceipt: async (data: WmProductReceiptVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt/update', data })
|
||||
},
|
||||
|
||||
// 删除产品入库单
|
||||
deleteProductReceipt: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-receipt/delete?id=' + id })
|
||||
},
|
||||
|
||||
// 提交产品入库单
|
||||
submitProductReceipt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt/submit?id=' + id })
|
||||
},
|
||||
|
||||
// 执行上架
|
||||
stockProductReceipt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt/stock?id=' + id })
|
||||
},
|
||||
|
||||
// 执行入库
|
||||
executeProductReceipt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt/execute?id=' + id })
|
||||
},
|
||||
|
||||
// 取消产品入库单
|
||||
cancelProductReceipt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt/cancel?id=' + id })
|
||||
},
|
||||
|
||||
// 校验产品入库单明细数量
|
||||
checkProductReceiptQuantity: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt/check-quantity?id=' + id })
|
||||
},
|
||||
|
||||
// 导出产品入库单 Excel
|
||||
exportProductReceipt: async (params: any) => {
|
||||
return await request.download({ url: '/mes/wm/product-receipt/export-excel', params })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 产品入库单行 VO
|
||||
export interface WmProductReceiptLineVO {
|
||||
id: number
|
||||
receiptId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
specification: string
|
||||
unitMeasureName: string
|
||||
quantity: number
|
||||
batchId: number
|
||||
batchCode: string
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 产品入库单行 API
|
||||
export const WmProductReceiptLineApi = {
|
||||
// 查询产品入库单行分页
|
||||
getProductReceiptLinePage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt-line/page', params })
|
||||
},
|
||||
|
||||
// 查询产品入库单行详情
|
||||
getProductReceiptLine: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-receipt-line/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增产品入库单行
|
||||
createProductReceiptLine: async (data: WmProductReceiptLineVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-receipt-line/create', data })
|
||||
},
|
||||
|
||||
// 修改产品入库单行
|
||||
updateProductReceiptLine: async (data: WmProductReceiptLineVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-receipt-line/update', data })
|
||||
},
|
||||
|
||||
// 删除产品入库单行
|
||||
deleteProductReceiptLine: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-receipt-line/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 产品入库单明细 VO
|
||||
export interface WmProductRecptDetailVO {
|
||||
id: number
|
||||
lineId: number
|
||||
recptId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
quantity: number
|
||||
batchId: number
|
||||
warehouseId: number
|
||||
warehouseName: string
|
||||
locationId: number
|
||||
locationName: string
|
||||
areaId: number
|
||||
areaName: string
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 产品入库单明细 API
|
||||
export const WmProductRecptDetailApi = {
|
||||
// 查询产品入库单明细列表
|
||||
getProductRecptDetailList: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt-detail/list', params })
|
||||
},
|
||||
|
||||
// 根据行项目ID查询产品入库单明细列表
|
||||
getProductRecptDetailListByLineId: async (lineId: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt-detail/list-by-line', params: { lineId } })
|
||||
},
|
||||
|
||||
// 查询产品入库单明细详情
|
||||
getProductRecptDetail: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt-detail/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增产品入库单明细
|
||||
createProductRecptDetail: async (data: WmProductRecptDetailVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-recpt-detail/create', data })
|
||||
},
|
||||
|
||||
// 修改产品入库单明细
|
||||
updateProductRecptDetail: async (data: WmProductRecptDetailVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt-detail/update', data })
|
||||
},
|
||||
|
||||
// 删除产品入库单明细
|
||||
deleteProductRecptDetail: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-recpt-detail/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 产品入库单 VO
|
||||
export interface WmProductRecptVO {
|
||||
id: number
|
||||
code: string
|
||||
name: string
|
||||
workOrderId: number
|
||||
workOrderCode: string
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
specification: string
|
||||
unitMeasureName: string
|
||||
receiptDate: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 产品入库单 API
|
||||
export const WmProductRecptApi = {
|
||||
// 查询产品入库单分页
|
||||
getProductRecptPage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt/page', params })
|
||||
},
|
||||
|
||||
// 查询产品入库单详情
|
||||
getProductRecpt: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增产品入库单
|
||||
createProductRecpt: async (data: WmProductRecptVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-recpt/create', data })
|
||||
},
|
||||
|
||||
// 修改产品入库单
|
||||
updateProductRecpt: async (data: WmProductRecptVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt/update', data })
|
||||
},
|
||||
|
||||
// 删除产品入库单
|
||||
deleteProductRecpt: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-recpt/delete?id=' + id })
|
||||
},
|
||||
|
||||
// 提交产品入库单
|
||||
submitProductRecpt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt/submit?id=' + id })
|
||||
},
|
||||
|
||||
// 执行上架
|
||||
stockProductRecpt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt/stock?id=' + id })
|
||||
},
|
||||
|
||||
// 执行入库
|
||||
executeProductRecpt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt/execute?id=' + id })
|
||||
},
|
||||
|
||||
// 取消产品入库单
|
||||
cancelProductRecpt: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt/cancel?id=' + id })
|
||||
},
|
||||
|
||||
// 校验产品入库单明细数量
|
||||
checkProductRecptQuantity: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt/check-quantity?id=' + id })
|
||||
},
|
||||
|
||||
// 导出产品入库单 Excel
|
||||
exportProductRecpt: async (params: any) => {
|
||||
return await request.download({ url: '/mes/wm/product-recpt/export-excel', params })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 产品入库单行 VO
|
||||
export interface WmProductRecptLineVO {
|
||||
id: number
|
||||
recptId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
specification: string
|
||||
unitMeasureName: string
|
||||
quantity: number
|
||||
batchId: number
|
||||
batchCode: string
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 产品入库单行 API
|
||||
export const WmProductRecptLineApi = {
|
||||
// 查询产品入库单行分页
|
||||
getProductRecptLinePage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt-line/page', params })
|
||||
},
|
||||
|
||||
// 查询产品入库单行详情
|
||||
getProductRecptLine: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/product-recpt-line/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增产品入库单行
|
||||
createProductRecptLine: async (data: WmProductRecptLineVO) => {
|
||||
return await request.post({ url: '/mes/wm/product-recpt-line/create', data })
|
||||
},
|
||||
|
||||
// 修改产品入库单行
|
||||
updateProductRecptLine: async (data: WmProductRecptLineVO) => {
|
||||
return await request.put({ url: '/mes/wm/product-recpt-line/update', data })
|
||||
},
|
||||
|
||||
// 删除产品入库单行
|
||||
deleteProductRecptLine: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/product-recpt-line/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -300,5 +300,5 @@ export enum DICT_TYPE {
|
|||
MES_WM_QUALITY_STATUS = 'mes_wm_quality_status', // MES 质量状态
|
||||
MES_WM_RETURN_ISSUE_STATUS = 'mes_wm_return_issue_status', // MES 生产退料单状态
|
||||
MES_WM_RETURN_ISSUE_TYPE = 'mes_wm_return_issue_type', // MES 退料类型
|
||||
MES_WM_PRODUCT_RECPT_STATUS = 'mes_wm_product_recpt_status', // MES 成品入库单状态
|
||||
MES_WM_PRODUCT_RECPT_STATUS = 'mes_wm_product_receipt_status', // MES 成品入库单状态
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ export const MesWmProductProduceStatusEnum = {
|
|||
}
|
||||
|
||||
/** MES 产品入库单状态枚举 */
|
||||
export const MesWmProductRecptStatusEnum = {
|
||||
export const MesWmProductReceiptStatusEnum = {
|
||||
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||
APPROVING: MesOrderStatusConstants.APPROVING,
|
||||
APPROVED: MesOrderStatusConstants.APPROVED,
|
||||
|
|
|
|||
|
|
@ -41,16 +41,16 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmProductRecptDetailApi, WmProductRecptDetailVO } from '@/api/mes/wm/productrecpt/detail'
|
||||
import { WmProductReceiptDetailApi, WmProductReceiptDetailVO } from '@/api/mes/wm/productreceipt/detail'
|
||||
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'
|
||||
import WmWarehouseAreaSelect from '@/views/mes/wm/warehouse/components/WmWarehouseAreaSelect.vue'
|
||||
|
||||
defineOptions({ name: 'ProductRecptDetailForm' })
|
||||
defineOptions({ name: 'ProductReceiptDetailForm' })
|
||||
|
||||
const props = defineProps<{
|
||||
recptId: number
|
||||
receiptId: number
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
|
|
@ -67,7 +67,7 @@ const formRef = ref()
|
|||
const formData = ref({
|
||||
id: undefined as number | undefined,
|
||||
lineId: undefined as number | undefined,
|
||||
recptId: undefined as number | undefined,
|
||||
receiptId: undefined as number | undefined,
|
||||
itemId: undefined as number | undefined,
|
||||
quantity: undefined as number | undefined,
|
||||
warehouseId: undefined as number | undefined,
|
||||
|
|
@ -92,7 +92,7 @@ const open = async (type: string, lineId: number, itemId?: number, detailId?: nu
|
|||
if (detailId) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmProductRecptDetailApi.getProductRecptDetail(detailId)
|
||||
formData.value = await WmProductReceiptDetailApi.getProductReceiptDetail(detailId)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -109,14 +109,14 @@ const submitForm = async () => {
|
|||
try {
|
||||
const data = {
|
||||
...formData.value,
|
||||
recptId: props.recptId,
|
||||
receiptId: props.receiptId,
|
||||
lineId: currentLineId.value
|
||||
} as unknown as WmProductRecptDetailVO
|
||||
} as unknown as WmProductReceiptDetailVO
|
||||
if (formType.value === 'create') {
|
||||
await WmProductRecptDetailApi.createProductRecptDetail(data)
|
||||
await WmProductReceiptDetailApi.createProductReceiptDetail(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await WmProductRecptDetailApi.updateProductRecptDetail(data)
|
||||
await WmProductReceiptDetailApi.updateProductReceiptDetail(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
|
|
@ -131,7 +131,7 @@ const resetForm = () => {
|
|||
formData.value = {
|
||||
id: undefined,
|
||||
lineId: undefined,
|
||||
recptId: undefined,
|
||||
receiptId: undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
warehouseId: undefined,
|
||||
|
|
@ -25,12 +25,12 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmProductRecptDetailApi, WmProductRecptDetailVO } from '@/api/mes/wm/productrecpt/detail'
|
||||
import { WmProductReceiptDetailApi, WmProductReceiptDetailVO } from '@/api/mes/wm/productreceipt/detail'
|
||||
|
||||
defineOptions({ name: 'ProductRecptDetailList' })
|
||||
defineOptions({ name: 'ProductReceiptDetailList' })
|
||||
|
||||
const props = defineProps<{
|
||||
recptId: number
|
||||
receiptId: number
|
||||
lineId: number
|
||||
itemId: number
|
||||
formType: string
|
||||
|
|
@ -42,13 +42,13 @@ const { t } = useI18n()
|
|||
const message = useMessage()
|
||||
|
||||
const loading = ref(false)
|
||||
const list = ref<WmProductRecptDetailVO[]>([])
|
||||
const list = ref<WmProductReceiptDetailVO[]>([])
|
||||
|
||||
/** 查询明细列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
list.value = await WmProductRecptDetailApi.getProductRecptDetailListByLineId(props.lineId)
|
||||
list.value = await WmProductReceiptDetailApi.getProductReceiptDetailListByLineId(props.lineId)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ defineExpose({ getList })
|
|||
const handleDelete = async (detailId: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmProductRecptDetailApi.deleteProductRecptDetail(detailId)
|
||||
await WmProductReceiptDetailApi.deleteProductReceiptDetail(detailId)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<!-- 非新建模式展示行项目信息(收货物料) -->
|
||||
<template v-if="formData.id">
|
||||
<el-divider content-position="center">物料信息</el-divider>
|
||||
<ProductRecptLineList :recpt-id="formData.id" :form-type="formType" />
|
||||
<ProductReceiptLineList :receipt-id="formData.id" :form-type="formType" />
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button v-if="isUpdate" @click="submitForm" type="primary" :disabled="formLoading">
|
||||
|
|
@ -87,11 +87,11 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import { WmProductRecptApi, WmProductRecptVO } from '@/api/mes/wm/productrecpt'
|
||||
import { WmProductReceiptApi, WmProductReceiptVO } from '@/api/mes/wm/productreceipt'
|
||||
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
||||
import ProductRecptLineList from './ProductRecptLineList.vue'
|
||||
import ProductReceiptLineList from './ProductReceiptLineList.vue'
|
||||
|
||||
defineOptions({ name: 'ProductRecptForm' })
|
||||
defineOptions({ name: 'ProductReceiptForm' })
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ const open = async (type: string, id?: number) => {
|
|||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmProductRecptApi.getProductRecpt(id)
|
||||
formData.value = await WmProductReceiptApi.getProductReceipt(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -153,14 +153,14 @@ const submitForm = async () => {
|
|||
await formRef.value.validate()
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as WmProductRecptVO
|
||||
const data = formData.value as unknown as WmProductReceiptVO
|
||||
if (formType.value === 'create') {
|
||||
const res = await WmProductRecptApi.createProductRecpt(data)
|
||||
const res = await WmProductReceiptApi.createProductReceipt(data)
|
||||
message.success('新增成功')
|
||||
formData.value.id = res
|
||||
formType.value = 'update'
|
||||
} else {
|
||||
await WmProductRecptApi.updateProductRecpt(data)
|
||||
await WmProductReceiptApi.updateProductReceipt(data)
|
||||
message.success('修改成功')
|
||||
}
|
||||
emit('success')
|
||||
|
|
@ -175,12 +175,12 @@ const handleStock = async () => {
|
|||
await message.confirm('确认执行上架?')
|
||||
formLoading.value = true
|
||||
// 校验明细数量与行收货数量是否一致
|
||||
const quantityMatch = await WmProductRecptApi.checkProductRecptQuantity(formData.value.id!)
|
||||
const quantityMatch = await WmProductReceiptApi.checkProductReceiptQuantity(formData.value.id!)
|
||||
if (!quantityMatch) {
|
||||
await message.confirm('明细数量与行收货数量不一致,确认执行上架?')
|
||||
}
|
||||
// 执行上架
|
||||
await WmProductRecptApi.stockProductRecpt(formData.value.id!)
|
||||
await WmProductReceiptApi.stockProductReceipt(formData.value.id!)
|
||||
message.success('上架成功')
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
>
|
||||
<el-table-column type="expand">
|
||||
<template #default="scope">
|
||||
<ProductRecptDetailList
|
||||
<ProductReceiptDetailList
|
||||
:ref="(el: any) => setDetailListRef(scope.row.id, el)"
|
||||
:recpt-id="props.recptId"
|
||||
:receipt-id="props.receiptId"
|
||||
:line-id="scope.row.id"
|
||||
:item-id="scope.row.itemId"
|
||||
:form-type="props.formType"
|
||||
|
|
@ -110,23 +110,23 @@
|
|||
</Dialog>
|
||||
|
||||
<!-- 上架明细添加/编辑弹窗 -->
|
||||
<ProductRecptDetailForm
|
||||
<ProductReceiptDetailForm
|
||||
ref="detailFormRef"
|
||||
:recpt-id="props.recptId"
|
||||
:receipt-id="props.receiptId"
|
||||
@success="onDetailFormSuccess"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmProductRecptLineApi, WmProductRecptLineVO } from '@/api/mes/wm/productrecpt/line'
|
||||
import { WmProductReceiptLineApi, WmProductReceiptLineVO } from '@/api/mes/wm/productreceipt/line'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import ProductRecptDetailList from './ProductRecptDetailList.vue'
|
||||
import ProductRecptDetailForm from './ProductRecptDetailForm.vue'
|
||||
import ProductReceiptDetailList from './ProductReceiptDetailList.vue'
|
||||
import ProductReceiptDetailForm from './ProductReceiptDetailForm.vue'
|
||||
|
||||
defineOptions({ name: 'ProductRecptLineList' })
|
||||
defineOptions({ name: 'ProductReceiptLineList' })
|
||||
|
||||
const props = defineProps<{
|
||||
recptId: number
|
||||
receiptId: number
|
||||
formType: string
|
||||
}>()
|
||||
|
||||
|
|
@ -138,20 +138,20 @@ const isStock = computed(() => props.formType === 'stock')
|
|||
|
||||
// ==================== 列表 ====================
|
||||
const loading = ref(false)
|
||||
const list = ref<WmProductRecptLineVO[]>([])
|
||||
const list = ref<WmProductReceiptLineVO[]>([])
|
||||
const total = ref(0)
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
recptId: undefined as number | undefined
|
||||
receiptId: undefined as number | undefined
|
||||
})
|
||||
|
||||
/** 查询行列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
queryParams.recptId = props.recptId
|
||||
const data = await WmProductRecptLineApi.getProductRecptLinePage(queryParams)
|
||||
queryParams.receiptId = props.receiptId
|
||||
const data = await WmProductReceiptLineApi.getProductReceiptLinePage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
|
@ -163,7 +163,7 @@ const getList = async () => {
|
|||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmProductRecptLineApi.deleteProductRecptLine(id)
|
||||
await WmProductReceiptLineApi.deleteProductReceiptLine(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
|
|
@ -176,7 +176,7 @@ const formLoading = ref(false)
|
|||
const lineFormType = ref('')
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
recptId: undefined as number | undefined,
|
||||
receiptId: undefined as number | undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
batchId: undefined,
|
||||
|
|
@ -198,7 +198,7 @@ const openForm = async (type: string, id?: number) => {
|
|||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmProductRecptLineApi.getProductRecptLine(id)
|
||||
formData.value = await WmProductReceiptLineApi.getProductReceiptLine(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -210,12 +210,12 @@ const submitForm = async () => {
|
|||
await formRef.value.validate()
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = { ...formData.value, recptId: props.recptId } as unknown as WmProductRecptLineVO
|
||||
const data = { ...formData.value, receiptId: props.receiptId } as unknown as WmProductReceiptLineVO
|
||||
if (lineFormType.value === 'create') {
|
||||
await WmProductRecptLineApi.createProductRecptLine(data)
|
||||
await WmProductReceiptLineApi.createProductReceiptLine(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await WmProductRecptLineApi.updateProductRecptLine(data)
|
||||
await WmProductReceiptLineApi.updateProductReceiptLine(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
|
|
@ -229,7 +229,7 @@ const submitForm = async () => {
|
|||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
recptId: undefined,
|
||||
receiptId: undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
batchId: undefined,
|
||||
|
|
@ -240,7 +240,7 @@ const resetForm = () => {
|
|||
}
|
||||
|
||||
// ==================== 展开行:上架明细 ====================
|
||||
const detailListRefs = ref<Record<number, InstanceType<typeof ProductRecptDetailList>>>({})
|
||||
const detailListRefs = ref<Record<number, InstanceType<typeof ProductReceiptDetailList>>>({})
|
||||
|
||||
/** 缓存子组件 ref */
|
||||
const setDetailListRef = (lineId: number, el: any) => {
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['mes:wm-product-recpt:create']"
|
||||
v-hasPermi="['mes:wm-product-receipt:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['mes:wm-product-recpt:export']"
|
||||
v-hasPermi="['mes:wm-product-receipt:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
|
|
@ -83,8 +83,8 @@
|
|||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-recpt:update']"
|
||||
v-if="scope.row.status === MesWmProductRecptStatusEnum.PREPARE"
|
||||
v-hasPermi="['mes:wm-product-receipt:update']"
|
||||
v-if="scope.row.status === MesWmProductReceiptStatusEnum.PREPARE"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
link
|
||||
type="warning"
|
||||
@click="handleSubmit(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-recpt:update']"
|
||||
v-if="scope.row.status === MesWmProductRecptStatusEnum.PREPARE"
|
||||
v-hasPermi="['mes:wm-product-receipt:update']"
|
||||
v-if="scope.row.status === MesWmProductReceiptStatusEnum.PREPARE"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
|
|
@ -101,8 +101,8 @@
|
|||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-recpt:delete']"
|
||||
v-if="scope.row.status === MesWmProductRecptStatusEnum.PREPARE"
|
||||
v-hasPermi="['mes:wm-product-receipt:delete']"
|
||||
v-if="scope.row.status === MesWmProductReceiptStatusEnum.PREPARE"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
|
|
@ -111,8 +111,8 @@
|
|||
link
|
||||
type="success"
|
||||
@click="openForm('stock', scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-recpt:update']"
|
||||
v-if="scope.row.status === MesWmProductRecptStatusEnum.APPROVING"
|
||||
v-hasPermi="['mes:wm-product-receipt:update']"
|
||||
v-if="scope.row.status === MesWmProductReceiptStatusEnum.APPROVING"
|
||||
>
|
||||
执行上架
|
||||
</el-button>
|
||||
|
|
@ -121,8 +121,8 @@
|
|||
link
|
||||
type="primary"
|
||||
@click="handleExecute(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-recpt:execute']"
|
||||
v-if="scope.row.status === MesWmProductRecptStatusEnum.APPROVED"
|
||||
v-hasPermi="['mes:wm-product-receipt:execute']"
|
||||
v-if="scope.row.status === MesWmProductReceiptStatusEnum.APPROVED"
|
||||
>
|
||||
执行入库
|
||||
</el-button>
|
||||
|
|
@ -131,11 +131,11 @@
|
|||
link
|
||||
type="danger"
|
||||
@click="handleCancel(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-product-recpt:update']"
|
||||
v-hasPermi="['mes:wm-product-receipt:update']"
|
||||
v-if="
|
||||
[
|
||||
MesWmProductRecptStatusEnum.APPROVING,
|
||||
MesWmProductRecptStatusEnum.APPROVED
|
||||
MesWmProductReceiptStatusEnum.APPROVING,
|
||||
MesWmProductReceiptStatusEnum.APPROVED
|
||||
].includes(scope.row.status)
|
||||
"
|
||||
>
|
||||
|
|
@ -152,26 +152,26 @@
|
|||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<ProductRecptForm ref="formRef" @success="getList" />
|
||||
<ProductReceiptForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter2 } from '@/utils/formatTime'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import download from '@/utils/download'
|
||||
import { WmProductRecptApi, WmProductRecptVO } from '@/api/mes/wm/productrecpt'
|
||||
import { WmProductReceiptApi, WmProductReceiptVO } from '@/api/mes/wm/productreceipt'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
||||
import ProductRecptForm from './ProductRecptForm.vue'
|
||||
import { MesWmProductRecptStatusEnum } from '@/views/mes/utils/constants'
|
||||
import ProductReceiptForm from './ProductReceiptForm.vue'
|
||||
import { MesWmProductReceiptStatusEnum } from '@/views/mes/utils/constants'
|
||||
|
||||
defineOptions({ name: 'MesWmProductRecpt' })
|
||||
defineOptions({ name: 'MesWmProductReceipt' })
|
||||
|
||||
const message = useMessage()
|
||||
const { t } = useI18n()
|
||||
|
||||
const loading = ref(true)
|
||||
const list = ref<WmProductRecptVO[]>([])
|
||||
const list = ref<WmProductReceiptVO[]>([])
|
||||
const total = ref(0)
|
||||
const exportLoading = ref(false)
|
||||
const queryParams = reactive({
|
||||
|
|
@ -189,7 +189,7 @@ const formRef = ref()
|
|||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await WmProductRecptApi.getProductRecptPage(queryParams)
|
||||
const data = await WmProductReceiptApi.getProductReceiptPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
|
@ -218,7 +218,7 @@ const openForm = (type: string, id?: number) => {
|
|||
const handleSubmit = async (id: number) => {
|
||||
try {
|
||||
await message.confirm('确认提交该产品入库单?')
|
||||
await WmProductRecptApi.submitProductRecpt(id)
|
||||
await WmProductReceiptApi.submitProductReceipt(id)
|
||||
message.success('提交成功')
|
||||
await getList()
|
||||
} catch {}
|
||||
|
|
@ -228,7 +228,7 @@ const handleSubmit = async (id: number) => {
|
|||
const handleExecute = async (id: number) => {
|
||||
try {
|
||||
await message.confirm('确认执行入库?执行后将更新库存台账。')
|
||||
await WmProductRecptApi.executeProductRecpt(id)
|
||||
await WmProductReceiptApi.executeProductReceipt(id)
|
||||
message.success('入库成功')
|
||||
await getList()
|
||||
} catch {}
|
||||
|
|
@ -238,7 +238,7 @@ const handleExecute = async (id: number) => {
|
|||
const handleCancel = async (id: number) => {
|
||||
try {
|
||||
await message.confirm('确认取消该产品入库单?取消后不可恢复。')
|
||||
await WmProductRecptApi.cancelProductRecpt(id)
|
||||
await WmProductReceiptApi.cancelProductReceipt(id)
|
||||
message.success('取消成功')
|
||||
await getList()
|
||||
} catch {}
|
||||
|
|
@ -248,7 +248,7 @@ const handleCancel = async (id: number) => {
|
|||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmProductRecptApi.deleteProductRecpt(id)
|
||||
await WmProductReceiptApi.deleteProductReceipt(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
|
|
@ -259,7 +259,7 @@ const handleExport = async () => {
|
|||
try {
|
||||
await message.exportConfirm()
|
||||
exportLoading.value = true
|
||||
const data = await WmProductRecptApi.exportProductRecpt(queryParams)
|
||||
const data = await WmProductReceiptApi.exportProductReceipt(queryParams)
|
||||
download.excel(data, '产品入库单.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
Loading…
Reference in New Issue