✨ feat(mes): 新增到货通知单编码及相关逻辑处理
parent
43e80f868a
commit
166caaa72c
|
|
@ -419,6 +419,7 @@ export const MesAutoCodeRuleCode = {
|
|||
MD_WORKSTATION_CODE: 'MD_WORKSTATION_CODE', // 工作站编码
|
||||
TM_TOOL_CODE: 'TM_TOOL_CODE', // 工具编码
|
||||
TM_TOOL_TYPE_CODE: 'TM_TOOL_TYPE_CODE', // 工具类型编码
|
||||
WM_ARRIVAL_NOTICE_CODE: 'WM_ARRIVAL_NOTICE_CODE', // 到货通知单编码
|
||||
WM_ITEM_RECEIPT_CODE: 'WM_ITEM_RECEIPT_CODE', // 采购入库单编码
|
||||
WM_SN_CODE: 'WM_SN_CODE', // SN 码
|
||||
WM_PACKAGE_CODE: 'WM_PACKAGE_CODE', // 装箱单编码
|
||||
|
|
|
|||
|
|
@ -69,10 +69,10 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 编辑时展示物料信息 -->
|
||||
<template v-if="formType === 'update' && formData.id">
|
||||
<!-- 编辑/详情时展示物料信息 -->
|
||||
<template v-if="['update', 'detail'].includes(formType) && formData.id">
|
||||
<el-divider content-position="center">物料信息</el-divider>
|
||||
<ArrivalNoticeLineList :notice-id="formData.id" />
|
||||
<ArrivalNoticeLineList :notice-id="formData.id" :form-type="formType" />
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!isDetail">
|
||||
|
|
@ -84,7 +84,8 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import { AutoCodeRecordApi } from '@/api/mes/md/autocode/record'
|
||||
import { MesAutoCodeRuleCode } from '@/views/mes/utils/constants'
|
||||
import { WmArrivalNoticeApi, WmArrivalNoticeVO } from '@/api/mes/wm/arrivalnotice'
|
||||
import ArrivalNoticeLineList from './ArrivalNoticeLineList.vue'
|
||||
import MdVendorSelect from '@/views/mes/md/vendor/components/MdVendorSelect.vue'
|
||||
|
|
@ -126,8 +127,8 @@ const formRules = reactive({
|
|||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 生成通知单编号 */
|
||||
const generateCode = () => {
|
||||
formData.value.code = 'AN' + generateRandomStr(10)
|
||||
const generateCode = async () => {
|
||||
formData.value.code = await AutoCodeRecordApi.generateAutoCode(MesAutoCodeRuleCode.WM_ARRIVAL_NOTICE_CODE)
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- MES 到货通知单行列表子组件 -->
|
||||
<template>
|
||||
<div class="overflow-hidden">
|
||||
<el-button type="primary" plain @click="openForm('create')" class="mb-10px">
|
||||
<el-button v-if="isEditable" 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>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<el-table-column label="合格数量" align="center" prop="qualifiedQuantity" width="100" />
|
||||
<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">
|
||||
<el-table-column v-if="isEditable" 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>
|
||||
|
|
@ -105,8 +105,11 @@ defineOptions({ name: 'ArrivalNoticeLineList' })
|
|||
|
||||
const props = defineProps<{
|
||||
noticeId: number
|
||||
formType?: string
|
||||
}>()
|
||||
|
||||
const isEditable = computed(() => ['create', 'update'].includes(props.formType || ''))
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue