✨ feat(mes): 添加到货通知单的到货日期和状态枚举
新增到货日期字段到 MES 到货通知单请求 VO,并在查询中支持根据到货日期范围筛选。同时,添加到货通知单状态的枚举定义,提升系统的可维护性和可读性。pull/871/MERGE
parent
39187b441e
commit
5aea9a0428
|
|
@ -292,4 +292,5 @@ export enum DICT_TYPE {
|
|||
MES_PRO_ANDON_STATUS = 'mes_pro_andon_status', // MES 安灯处置状态
|
||||
MES_PRO_ANDON_LEVEL = 'mes_pro_andon_level', // MES 安灯级别
|
||||
MES_RQC_TYPE = 'mes_rqc_type', // MES 退货检验类型
|
||||
MES_WM_ARRIVAL_NOTICE_STATUS = 'mes_wm_arrival_notice_status', // MES 到货通知单状态
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,6 +199,22 @@ export const MesProFeedbackTypeEnum = {
|
|||
UNIFIED: 2 // 统一报工
|
||||
}
|
||||
|
||||
/** MES 到货通知单状态枚举 */
|
||||
export const MesWmArrivalNoticeStatusEnum = {
|
||||
PREPARE: 0, // 草稿
|
||||
SUBMITTED: 1, // 已提交
|
||||
APPROVED: 2, // 已审批
|
||||
FINISHED: 3 // 已完成
|
||||
}
|
||||
|
||||
/** MES 采购入库单状态枚举 */
|
||||
export const MesWmItemReceiptStatusEnum = {
|
||||
PREPARE: 0, // 草稿
|
||||
SUBMITTED: 1, // 已提交
|
||||
APPROVED: 2, // 已审批
|
||||
FINISHED: 3 // 已完成
|
||||
}
|
||||
|
||||
/** 获取物料/产品标识的标签 */
|
||||
export const getItemOrProductLabel = (value: string): string => {
|
||||
for (const item of Object.values(MesItemOrProductEnum)) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="860px">
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="960px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
|
|
@ -9,9 +9,14 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<!-- TODO @AI:生成功能,参考别的模块 -->
|
||||
<el-form-item label="通知单编号" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入通知单编号" />
|
||||
<el-input v-model="formData.code" placeholder="请输入通知单编号">
|
||||
<template #append>
|
||||
<el-button @click="generateCode" :disabled="formType === 'update'">
|
||||
生成
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
@ -75,7 +80,11 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- TODO @AI:这里缺少了“物料信息” -->
|
||||
<!-- 编辑时展示物料信息 -->
|
||||
<template v-if="formData.id">
|
||||
<el-divider content-position="center">物料信息</el-divider>
|
||||
<ArrivalNoticeLineList :notice-id="formData.id" />
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
|
|
@ -84,19 +93,21 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import { WmArrivalNoticeApi, WmArrivalNoticeVO } from '@/api/mes/wm/arrivalnotice'
|
||||
import { MdVendorApi } from '@/api/mes/md/vendor'
|
||||
import ArrivalNoticeLineList from './ArrivalNoticeLineList.vue'
|
||||
|
||||
defineOptions({ name: 'ArrivalNoticeForm' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const message = useMessage()
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const formLoading = ref(false)
|
||||
const formType = ref('')
|
||||
const vendorList = ref<any[]>([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const vendorList = ref<any[]>([]) // 供应商列表
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
|
|
@ -113,7 +124,12 @@ const formRules = reactive({
|
|||
vendorId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
|
||||
arrivalDate: [{ required: true, message: '请选择到货日期', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref()
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 生成通知单编号 */
|
||||
const generateCode = () => {
|
||||
formData.value.code = 'AN' + generateRandomStr(10)
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
<!-- MES 到货通知单行列表子组件 -->
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="primary" plain @click="openForm('create')" class="mb-10px">
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 添加物料
|
||||
</el-button>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" border>
|
||||
<el-table-column label="物料编码" align="center" prop="itemCode" min-width="120" />
|
||||
<el-table-column label="物料名称" align="center" prop="itemName" min-width="140" />
|
||||
<el-table-column label="规格型号" align="center" prop="specification" min-width="120" />
|
||||
<el-table-column label="单位" align="center" prop="unitMeasureName" width="80" />
|
||||
<el-table-column label="到货数量" align="center" prop="arrivalQuantity" width="100" />
|
||||
<el-table-column label="是否检验" align="center" prop="iqcCheckFlag" width="90">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.iqcCheckFlag" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" align="center" prop="qualifiedQuantity" width="100" />
|
||||
<!-- TODO @芋艿【不要删除】:后续需要怎么弄 -->
|
||||
<el-table-column label="检验单号" align="center" prop="iqcCode" min-width="140" />
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="120" />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<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>
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ArrivalNoticeLineForm ref="formRef" @success="getList" :noticeId="noticeId" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { WmArrivalNoticeLineApi, WmArrivalNoticeLineVO } from '@/api/mes/wm/arrivalnotice/line'
|
||||
import ArrivalNoticeLineForm from './line/ArrivalNoticeLineForm.vue'
|
||||
|
||||
defineOptions({ name: 'ArrivalNoticeLineList' })
|
||||
|
||||
const props = defineProps<{
|
||||
noticeId: number
|
||||
}>()
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref<WmArrivalNoticeLineVO[]>([]) // 行列表
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
noticeId: undefined as number | undefined
|
||||
})
|
||||
|
||||
/** 查询行列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
queryParams.noticeId = props.noticeId
|
||||
const data = await WmArrivalNoticeLineApi.getArrivalNoticeLinePage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 新增/修改 */
|
||||
const formRef = ref() // 表单弹窗
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
await WmArrivalNoticeLineApi.deleteArrivalNoticeLine(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
})
|
||||
</script>
|
||||
|
|
@ -49,7 +49,17 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:到货时间 -->
|
||||
<el-form-item label="到货日期" prop="arrivalDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.arrivalDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
|
|
@ -57,7 +67,6 @@
|
|||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<!-- TODO @AI:MES_WM_ARRIVAL_NOTICE_STATUS 枚举下 -->
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_ARRIVAL_NOTICE_STATUS)"
|
||||
:key="dict.value"
|
||||
|
|
@ -121,7 +130,6 @@
|
|||
<dict-tag :type="DICT_TYPE.MES_WM_ARRIVAL_NOTICE_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- TODO @AI:到货时间,看看怎么没了; -->
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
|
|
@ -129,16 +137,14 @@
|
|||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<!-- TODO @AI:fixed? -->
|
||||
<el-table-column label="操作" align="center" width="220">
|
||||
<!-- TODO @AI:需要在 mes constants 里; -->
|
||||
<el-table-column label="操作" align="center" width="220" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['mes:wm-arrival-notice:update']"
|
||||
v-if="scope.row.status === 0"
|
||||
v-if="scope.row.status === MesWmArrivalNoticeStatusEnum.PREPARE"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
|
@ -147,7 +153,7 @@
|
|||
type="warning"
|
||||
@click="handleSubmit(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-arrival-notice:update']"
|
||||
v-if="scope.row.status === 0"
|
||||
v-if="scope.row.status === MesWmArrivalNoticeStatusEnum.PREPARE"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
|
|
@ -156,7 +162,7 @@
|
|||
type="success"
|
||||
@click="handleApprove(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-arrival-notice:update']"
|
||||
v-if="scope.row.status === 1"
|
||||
v-if="scope.row.status === MesWmArrivalNoticeStatusEnum.SUBMITTED"
|
||||
>
|
||||
审批
|
||||
</el-button>
|
||||
|
|
@ -165,7 +171,7 @@
|
|||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['mes:wm-arrival-notice:delete']"
|
||||
v-if="scope.row.status === 0"
|
||||
v-if="scope.row.status === MesWmArrivalNoticeStatusEnum.PREPARE"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
|
|
@ -190,20 +196,19 @@ import download from '@/utils/download'
|
|||
import { WmArrivalNoticeApi, WmArrivalNoticeVO } from '@/api/mes/wm/arrivalnotice'
|
||||
import { MdVendorApi } from '@/api/mes/md/vendor'
|
||||
import ArrivalNoticeForm from './ArrivalNoticeForm.vue'
|
||||
|
||||
// TODO @AI:/Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/system/user/index.vue 里的注释风格,参考下;
|
||||
import { MesWmArrivalNoticeStatusEnum } from '@/views/mes/utils/constants'
|
||||
|
||||
defineOptions({ name: 'MesWmArrivalNotice' })
|
||||
|
||||
const message = useMessage()
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
const router = useRouter() // 路由
|
||||
|
||||
const loading = ref(true)
|
||||
const list = ref<WmArrivalNoticeVO[]>([])
|
||||
const total = ref(0)
|
||||
const exportLoading = ref(false)
|
||||
const vendorList = ref<any[]>([])
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<WmArrivalNoticeVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const vendorList = ref<any[]>([]) // 供应商列表
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -211,9 +216,10 @@ const queryParams = reactive({
|
|||
name: undefined,
|
||||
purchaseOrderCode: undefined,
|
||||
vendorId: undefined,
|
||||
arrivalDate: undefined,
|
||||
status: undefined
|
||||
})
|
||||
const queryFormRef = ref()
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
|
@ -240,7 +246,7 @@ const resetQuery = () => {
|
|||
}
|
||||
|
||||
/** 新增/修改 */
|
||||
const formRef = ref()
|
||||
const formRef = ref() // 表单弹窗
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue