✨ feat(mes): 更新领料出库单明细 API 接口及组件
- 修改领料出库单明细的 API 接口,支持按行编号查询明细列表 - 替换供应商选择组件,简化供应商选择逻辑 - 添加取消领料出库单的功能,增强用户操作体验pull/871/MERGE
parent
5e2366ace0
commit
1afe2e79e4
|
|
@ -21,9 +21,9 @@ export interface WmProductionIssueDetailVO {
|
||||||
|
|
||||||
// MES 领料出库明细 API
|
// MES 领料出库明细 API
|
||||||
export const WmProductionIssueDetailApi = {
|
export const WmProductionIssueDetailApi = {
|
||||||
// 查询领料出库明细分页
|
// 查询领料出库明细列表(按行编号)
|
||||||
getProductionIssueDetailPage: async (params: any) => {
|
getProductionIssueDetailListByLineId: async (lineId: number) => {
|
||||||
return await request.get({ url: '/mes/wm/production-issue-detail/page', params })
|
return await request.get({ url: '/mes/wm/production-issue-detail/list-by-line', params: { lineId } })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询领料出库明细详情
|
// 查询领料出库明细详情
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,11 @@ export const WmProductionIssueApi = {
|
||||||
return await request.put({ url: '/mes/wm/production-issue/stock?id=' + id })
|
return await request.put({ url: '/mes/wm/production-issue/stock?id=' + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 取消领料出库单
|
||||||
|
cancelProductionIssue: async (id: number) => {
|
||||||
|
return await request.put({ url: '/mes/wm/production-issue/cancel?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
// 完成领料出库单(执行出库)
|
// 完成领料出库单(执行出库)
|
||||||
finishProductionIssue: async (id: number) => {
|
finishProductionIssue: async (id: number) => {
|
||||||
return await request.put({ url: '/mes/wm/production-issue/finish?id=' + id })
|
return await request.put({ url: '/mes/wm/production-issue/finish?id=' + id })
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<el-button v-if="isUpdate" link type="danger" @click="handleDelete(scope.row.id)">
|
<el-button v-if="isUpdate" link type="danger" @click="handleDelete(scope.row.id)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="isStock" link type="success" @click="handleShelving(scope.row.id)">
|
<el-button v-if="isStock" link type="success" @click="handleStock(scope.row.id)">
|
||||||
上架
|
上架
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -314,7 +314,7 @@ const setDetailListRef = (lineId: number, el: any) => {
|
||||||
const detailFormRef = ref()
|
const detailFormRef = ref()
|
||||||
|
|
||||||
/** 上架:直接打开明细创建表单 */
|
/** 上架:直接打开明细创建表单 */
|
||||||
const handleShelving = (lineId: number) => {
|
const handleStock = (lineId: number) => {
|
||||||
const row = list.value.find((r) => r.id === lineId)
|
const row = list.value.find((r) => r.id === lineId)
|
||||||
openDetailForm('create', lineId, row?.itemId)
|
openDetailForm('create', lineId, row?.itemId)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,19 +26,7 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="供应商" prop="vendorId">
|
<el-form-item label="供应商" prop="vendorId">
|
||||||
<el-select
|
<MdVendorSelect v-model="queryParams.vendorId" class="!w-240px" />
|
||||||
v-model="queryParams.vendorId"
|
|
||||||
placeholder="请选择供应商"
|
|
||||||
clearable
|
|
||||||
class="!w-240px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="vendor in vendorList"
|
|
||||||
:key="vendor.id"
|
|
||||||
:label="vendor.name"
|
|
||||||
:value="vendor.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="入库日期" prop="receiptDate">
|
<el-form-item label="入库日期" prop="receiptDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|
@ -174,7 +162,7 @@ import { dateFormatter2 } from '@/utils/formatTime'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { WmItemReceiptApi, WmItemReceiptVO } from '@/api/mes/wm/itemreceipt'
|
import { WmItemReceiptApi, WmItemReceiptVO } from '@/api/mes/wm/itemreceipt'
|
||||||
import { MdVendorApi } from '@/api/mes/md/vendor'
|
import MdVendorSelect from '@/views/mes/md/vendor/components/MdVendorSelect.vue'
|
||||||
import ItemReceiptForm from './ItemReceiptForm.vue'
|
import ItemReceiptForm from './ItemReceiptForm.vue'
|
||||||
import { MesWmItemReceiptStatusEnum } from '@/views/mes/utils/constants'
|
import { MesWmItemReceiptStatusEnum } from '@/views/mes/utils/constants'
|
||||||
|
|
||||||
|
|
@ -187,7 +175,6 @@ const loading = ref(true) // 列表的加载中
|
||||||
const list = ref<WmItemReceiptVO[]>([]) // 列表的数据
|
const list = ref<WmItemReceiptVO[]>([]) // 列表的数据
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
const vendorList = ref<any[]>([]) // 供应商列表
|
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -282,8 +269,7 @@ const handleExport = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
vendorList.value = await MdVendorApi.getVendorSimpleList()
|
getList()
|
||||||
await getList()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -52,14 +52,8 @@ const list = ref<WmProductionIssueDetailVO[]>([]) // 明细列表
|
||||||
/** 查询明细列表 */
|
/** 查询明细列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
// TODO @AI:走 list 接口,不需要分页;检查下;
|
|
||||||
try {
|
try {
|
||||||
const data = await WmProductionIssueDetailApi.getProductionIssueDetailPage({
|
list.value = await WmProductionIssueDetailApi.getProductionIssueDetailListByLineId(props.lineId)
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
lineId: props.lineId
|
|
||||||
})
|
|
||||||
list.value = data.list
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,9 +107,10 @@ const formData = ref({
|
||||||
remark: undefined
|
remark: undefined
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
// TODO @AI:你看下 workorderid、需求时间,必填;
|
|
||||||
code: [{ required: true, message: '领料单编号不能为空', trigger: 'blur' }],
|
code: [{ required: true, message: '领料单编号不能为空', trigger: 'blur' }],
|
||||||
name: [{ required: true, message: '领料单名称不能为空', trigger: 'blur' }]
|
name: [{ required: true, message: '领料单名称不能为空', trigger: 'blur' }],
|
||||||
|
workOrderId: [{ required: true, message: '生产工单不能为空', trigger: 'change' }],
|
||||||
|
requiredTime: [{ required: true, message: '需求时间不能为空', trigger: 'change' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
:formatter="dateFormatter2"
|
:formatter="dateFormatter2"
|
||||||
width="180px"
|
width="180px"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="单据状态" align="center" prop="status" min-width="100">
|
<el-table-column label="单据状态" align="center" prop="status" min-width="110">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.MES_WM_PRODUCTION_ISSUE_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.MES_WM_PRODUCTION_ISSUE_STATUS" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -151,6 +151,20 @@
|
||||||
>
|
>
|
||||||
完成
|
完成
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<!-- 待拣货、待执行领出:取消 -->
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleCancel(scope.row.id)"
|
||||||
|
v-hasPermi="['mes:wm-production-issue:update']"
|
||||||
|
v-if="
|
||||||
|
[MesWmProductionIssueStatusEnum.APPROVING, MesWmProductionIssueStatusEnum.APPROVED].includes(
|
||||||
|
scope.row.status
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -242,6 +256,16 @@ const handleDelete = async (id: number) => {
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 取消按钮操作 */
|
||||||
|
const handleCancel = async (id: number) => {
|
||||||
|
try {
|
||||||
|
await message.confirm('确认取消该领料出库单?取消后不可恢复。')
|
||||||
|
await WmProductionIssueApi.cancelProductionIssue(id)
|
||||||
|
message.success('取消成功')
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
/** 完成按钮操作 */
|
/** 完成按钮操作 */
|
||||||
const handleFinish = async (id: number) => {
|
const handleFinish = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue