✨ feat(mes): 添加杂项出库单类型及状态枚举支持
新增杂项出库单类型和状态枚举,更新相关接口和前端表单以支持业务类型选择。确保系统能够正确处理杂项出库单的状态和类型,提高用户体验和系统的灵活性。pull/871/MERGE
parent
efa794d2ab
commit
16394f3f94
|
|
@ -0,0 +1,53 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 外协发料单明细 VO
|
||||
export interface WmOutsourceIssueDetailVO {
|
||||
id: number
|
||||
lineId: number
|
||||
issueId: number
|
||||
materialStockId: number
|
||||
itemId: number
|
||||
itemCode: string
|
||||
itemName: string
|
||||
specification: string
|
||||
unitMeasureName: string
|
||||
quantity: number
|
||||
batchId: number
|
||||
batchCode: string
|
||||
warehouseId: number
|
||||
warehouseName: string
|
||||
locationId: number
|
||||
locationName: string
|
||||
areaId: number
|
||||
areaName: string
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 外协发料单明细 API
|
||||
export const WmOutsourceIssueDetailApi = {
|
||||
// 查询外协发料单明细列表(按行编号)
|
||||
getOutsourceIssueDetailListByLineId: async (lineId: number) => {
|
||||
return await request.get({ url: '/mes/wm/outsource-issue-detail/list-by-line', params: { lineId } })
|
||||
},
|
||||
|
||||
// 查询外协发料单明细详情
|
||||
getOutsourceIssueDetail: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/outsource-issue-detail/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增外协发料单明细
|
||||
createOutsourceIssueDetail: async (data: WmOutsourceIssueDetailVO) => {
|
||||
return await request.post({ url: '/mes/wm/outsource-issue-detail/create', data })
|
||||
},
|
||||
|
||||
// 修改外协发料单明细
|
||||
updateOutsourceIssueDetail: async (data: WmOutsourceIssueDetailVO) => {
|
||||
return await request.put({ url: '/mes/wm/outsource-issue-detail/update', data })
|
||||
},
|
||||
|
||||
// 删除外协发料单明细
|
||||
deleteOutsourceIssueDetail: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/outsource-issue-detail/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 外协发料单 VO
|
||||
export interface WmOutsourceIssueVO {
|
||||
id: number
|
||||
code: string
|
||||
name: string
|
||||
vendorId: number
|
||||
vendorCode: string
|
||||
vendorName: string
|
||||
workorderId: number
|
||||
workorderCode: string
|
||||
workorderName: string
|
||||
issueDate: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// MES 外协发料单 API
|
||||
export const WmOutsourceIssueApi = {
|
||||
// 查询外协发料单分页
|
||||
getOutsourceIssuePage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/outsource-issue/page', params })
|
||||
},
|
||||
|
||||
// 查询外协发料单详情
|
||||
getOutsourceIssue: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/outsource-issue/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增外协发料单
|
||||
createOutsourceIssue: async (data: WmOutsourceIssueVO) => {
|
||||
return await request.post({ url: '/mes/wm/outsource-issue/create', data })
|
||||
},
|
||||
|
||||
// 修改外协发料单
|
||||
updateOutsourceIssue: async (data: WmOutsourceIssueVO) => {
|
||||
return await request.put({ url: '/mes/wm/outsource-issue/update', data })
|
||||
},
|
||||
|
||||
// 删除外协发料单
|
||||
deleteOutsourceIssue: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/outsource-issue/delete?id=' + id })
|
||||
},
|
||||
|
||||
// 执行外协发料出库
|
||||
executeOutsourceIssue: async (id: number) => {
|
||||
return await request.put({ url: '/mes/wm/outsource-issue/execute?id=' + id })
|
||||
},
|
||||
|
||||
// 导出外协发料单 Excel
|
||||
exportOutsourceIssue: async (params: any) => {
|
||||
return await request.download({ url: '/mes/wm/outsource-issue/export-excel', params })
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// MES 外协发料单行 VO
|
||||
export interface WmOutsourceIssueLineVO {
|
||||
id: number
|
||||
issueId: number
|
||||
materialStockId: 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 WmOutsourceIssueLineApi = {
|
||||
// 查询外协发料单行分页
|
||||
getOutsourceIssueLinePage: async (params: any) => {
|
||||
return await request.get({ url: '/mes/wm/outsource-issue-line/page', params })
|
||||
},
|
||||
|
||||
// 查询外协发料单行详情
|
||||
getOutsourceIssueLine: async (id: number) => {
|
||||
return await request.get({ url: '/mes/wm/outsource-issue-line/get?id=' + id })
|
||||
},
|
||||
|
||||
// 新增外协发料单行
|
||||
createOutsourceIssueLine: async (data: WmOutsourceIssueLineVO) => {
|
||||
return await request.post({ url: '/mes/wm/outsource-issue-line/create', data })
|
||||
},
|
||||
|
||||
// 修改外协发料单行
|
||||
updateOutsourceIssueLine: async (data: WmOutsourceIssueLineVO) => {
|
||||
return await request.put({ url: '/mes/wm/outsource-issue-line/update', data })
|
||||
},
|
||||
|
||||
// 删除外协发料单行
|
||||
deleteOutsourceIssueLine: async (id: number) => {
|
||||
return await request.delete({ url: '/mes/wm/outsource-issue-line/delete?id=' + id })
|
||||
}
|
||||
}
|
||||
|
|
@ -305,4 +305,5 @@ export enum DICT_TYPE {
|
|||
MES_WM_RETURN_SALES_STATUS = 'mes_wm_return_sales_status', // MES 销售退货单状态
|
||||
MES_WM_PRODUCT_SALES_STATUS = 'mes_wm_product_sales_status', // MES 销售出库单状态
|
||||
MES_SALES_NOTICE_STATUS = 'mes_sales_notice_status', // MES 发货通知单状态
|
||||
MES_WM_MISC_ISSUE_TYPE = 'mes_wm_misc_issue_type', // MES 杂项单类型
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,220 +0,0 @@
|
|||
<!-- MES 杂项出库明细列表(展开行内嵌子组件) -->
|
||||
<!-- TODO @AI:删除掉; -->
|
||||
<template>
|
||||
<div class="pl-60px pr-20px py-10px">
|
||||
<el-button
|
||||
v-if="isUpdate"
|
||||
type="primary"
|
||||
plain
|
||||
size="small"
|
||||
@click="openForm('create')"
|
||||
class="mb-10px"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 添加明细
|
||||
</el-button>
|
||||
<el-table v-loading="loading" :data="list" border size="small">
|
||||
<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" />
|
||||
<el-table-column label="数量" align="center" prop="quantity" width="100" />
|
||||
<el-table-column v-if="isUpdate" label="操作" align="center" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="openForm('update', scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 添加/编辑明细弹窗 -->
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<WmWarehouseSelect
|
||||
v-model="formData.warehouseId"
|
||||
@change="handleWarehouseChange"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库区" prop="locationId">
|
||||
<WmWarehouseLocationSelect
|
||||
v-model="formData.locationId"
|
||||
:warehouse-id="formData.warehouseId"
|
||||
@change="handleLocationChange"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位" prop="areaId">
|
||||
<WmWarehouseAreaSelect
|
||||
v-model="formData.areaId"
|
||||
:location-id="formData.locationId"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input-number
|
||||
v-model="formData.quantity"
|
||||
:precision="2"
|
||||
:min="0.01"
|
||||
controls-position="right"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WmMiscIssueDetailApi, WmMiscIssueDetailVO } from '@/api/mes/wm/miscissue/detail'
|
||||
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: 'MiscIssueDetailList' })
|
||||
|
||||
const props = defineProps<{
|
||||
issueId: number
|
||||
lineId: number
|
||||
itemId: number
|
||||
formType: string
|
||||
}>()
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const isUpdate = computed(() => ['create', 'update'].includes(props.formType)) // 是否为编辑模式
|
||||
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref<WmMiscIssueDetailVO[]>([]) // 明细列表
|
||||
|
||||
/** 查询明细列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
list.value = await WmMiscIssueDetailApi.getMiscIssueDetailListByLineId(props.lineId)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ getList })
|
||||
|
||||
/** 删除出库明细 */
|
||||
const handleDelete = async (detailId: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmMiscIssueDetailApi.deleteMiscIssueDetail(detailId)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// ==================== 添加/编辑表单 ====================
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const detailFormType = ref('') // 明细表单的类型
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
lineId: undefined as number | undefined,
|
||||
issueId: undefined as number | undefined,
|
||||
itemId: undefined as number | undefined,
|
||||
warehouseId: undefined,
|
||||
locationId: undefined,
|
||||
areaId: undefined,
|
||||
quantity: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
warehouseId: [{ required: true, message: '仓库不能为空', trigger: 'change' }],
|
||||
locationId: [{ required: true, message: '库区不能为空', trigger: 'change' }],
|
||||
areaId: [{ required: true, message: '库位不能为空', trigger: 'change' }],
|
||||
quantity: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 0.01, message: '数量必须大于等于0.01', trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 仓库变化时,清空库区和库位 */
|
||||
const handleWarehouseChange = () => {
|
||||
formData.value.locationId = undefined
|
||||
formData.value.areaId = undefined
|
||||
}
|
||||
|
||||
/** 库区变化时,清空库位 */
|
||||
const handleLocationChange = () => {
|
||||
formData.value.areaId = undefined
|
||||
}
|
||||
|
||||
/** 打开表单弹窗 */
|
||||
const openForm = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type === 'create' ? '添加出库明细' : '修改出库明细'
|
||||
detailFormType.value = type
|
||||
resetForm()
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await WmMiscIssueDetailApi.getMiscIssueDetail(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate()
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = {
|
||||
...formData.value,
|
||||
lineId: props.lineId,
|
||||
issueId: props.issueId,
|
||||
itemId: props.itemId
|
||||
} as unknown as WmMiscIssueDetailVO
|
||||
if (detailFormType.value === 'create') {
|
||||
await WmMiscIssueDetailApi.createMiscIssueDetail(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await WmMiscIssueDetailApi.updateMiscIssueDetail(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
await getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
lineId: undefined,
|
||||
issueId: undefined,
|
||||
itemId: undefined,
|
||||
warehouseId: undefined,
|
||||
locationId: undefined,
|
||||
areaId: undefined,
|
||||
quantity: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 初始化:延迟加载,展开时才触发 */
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -32,17 +32,16 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- TODO @AI:参考 index.vue 界面的要求; -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="杂项类型" prop="type">
|
||||
<el-form-item label="业务类型" prop="type">
|
||||
<el-select
|
||||
v-model="formData.type"
|
||||
placeholder="请选择杂项类型"
|
||||
placeholder="请选择业务类型"
|
||||
class="!w-1/1"
|
||||
:disabled="isHeaderReadonly"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_MISC_ISSUE_TYPE)"
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -136,10 +135,7 @@ const formData = ref({
|
|||
})
|
||||
const formRules = reactive({
|
||||
code: [{ required: true, message: '出库单编号不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '出库单名称不能为空', trigger: 'blur' }],
|
||||
// TODO @AI:type、issueDate 都是选填;
|
||||
type: [{ required: true, message: '杂项类型不能为空', trigger: 'change' }],
|
||||
issueDate: [{ required: true, message: '出库日期不能为空', trigger: 'change' }]
|
||||
name: [{ required: true, message: '出库单名称不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ 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'
|
||||
import MiscIssueDetailList from './MiscIssueDetailList.vue'
|
||||
|
||||
defineOptions({ name: 'MiscIssueLineList' })
|
||||
|
||||
|
|
|
|||
|
|
@ -25,17 +25,15 @@
|
|||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:杂项类型,改成“业务类型”; -->
|
||||
<el-form-item label="杂项类型" prop="type">
|
||||
<el-form-item label="业务类型" prop="type">
|
||||
<el-select
|
||||
v-model="queryParams.type"
|
||||
placeholder="请选择杂项类型"
|
||||
placeholder="请选择业务类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<!-- TODO @AI:字典枚举;MES_WM_MISC_ISSUE_TYPE:库存调整、报销出库 -->
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_MISC_ISSUE_TYPE)"
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -61,9 +59,8 @@
|
|||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<!-- TODO @AI:字典枚举;MES_WM_MISC_ISSUE_STATUS:草稿、待执行出库、已完成、已取消; -->
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_MISC_ISSUE_STATUS)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -106,7 +103,7 @@
|
|||
<el-table-column label="出库单名称" align="center" prop="name" min-width="150" />
|
||||
<el-table-column label="业务类型" align="center" prop="type" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.MES_MISC_ISSUE_TYPE" :value="scope.row.type" />
|
||||
<dict-tag :type="DICT_TYPE.MES_WM_MISC_ISSUE_TYPE" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- TODO @芋艿:【来源单据编号】【来源单据类型】;不用改 -->
|
||||
|
|
@ -119,7 +116,7 @@
|
|||
/>
|
||||
<el-table-column label="单据状态" align="center" prop="status" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.MES_MISC_ISSUE_STATUS" :value="scope.row.status" />
|
||||
<dict-tag :type="DICT_TYPE.MES_WM_MISC_ISSUE_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="240" fixed="right">
|
||||
|
|
|
|||
Loading…
Reference in New Issue