✨ feat(mes): 修改执行生产流转卡为完成生产流转卡
parent
0c4ee24dd3
commit
23799e7f21
|
|
@ -55,9 +55,9 @@ export const ProCardApi = {
|
||||||
return await request.put({ url: `/mes/pro/card/submit?id=` + id })
|
return await request.put({ url: `/mes/pro/card/submit?id=` + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 执行生产流转卡
|
// 完成生产流转卡
|
||||||
executeCard: async (id: number) => {
|
finishCard: async (id: number) => {
|
||||||
return await request.put({ url: `/mes/pro/card/execute?id=` + id })
|
return await request.put({ url: `/mes/pro/card/finish?id=` + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 取消生产流转卡
|
// 取消生产流转卡
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ export enum DICT_TYPE {
|
||||||
MES_INDICATOR_TYPE = 'mes_indicator_type', // MES 检测项类型
|
MES_INDICATOR_TYPE = 'mes_indicator_type', // MES 检测项类型
|
||||||
MES_QC_RESULT_TYPE = 'mes_qc_result_type', // MES 质检结果值类型
|
MES_QC_RESULT_TYPE = 'mes_qc_result_type', // MES 质检结果值类型
|
||||||
MES_DEFECT_LEVEL = 'mes_defect_level', // MES 缺陷等级
|
MES_DEFECT_LEVEL = 'mes_defect_level', // MES 缺陷等级
|
||||||
|
MES_DEFECT_TYPE = 'mes_defect_type', // MES 缺陷检测项类型
|
||||||
MES_PRO_WORK_ORDER_STATUS = 'mes_pro_work_order_status', // MES 生产工单状态
|
MES_PRO_WORK_ORDER_STATUS = 'mes_pro_work_order_status', // MES 生产工单状态
|
||||||
MES_PRO_WORK_ORDER_SOURCE_TYPE = 'mes_pro_work_order_source_type', // MES 工单来源类型
|
MES_PRO_WORK_ORDER_SOURCE_TYPE = 'mes_pro_work_order_source_type', // MES 工单来源类型
|
||||||
MES_PRO_WORK_ORDER_TYPE = 'mes_pro_work_order_type', // MES 工单类型
|
MES_PRO_WORK_ORDER_TYPE = 'mes_pro_work_order_type', // MES 工单类型
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@
|
||||||
>
|
>
|
||||||
提 交
|
提 交
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="isExecute" @click="handleExecute" type="success" :disabled="formLoading">
|
<el-button v-if="isFinish" @click="handleFinish" type="success" :disabled="formLoading">
|
||||||
执 行
|
完 成
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -96,11 +96,11 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ProCardApi, ProCardVO } from '@/api/mes/pro/card'
|
import { ProCardApi, ProCardVO } from '@/api/mes/pro/card'
|
||||||
import { generateRandomStr } from '@/utils'
|
import { AutoCodeRecordApi } from '@/api/mes/md/autocode/record'
|
||||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||||
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
import ProWorkOrderSelect from '@/views/mes/pro/workorder/components/ProWorkOrderSelect.vue'
|
||||||
import CardProcessList from './CardProcessList.vue'
|
import CardProcessList from './CardProcessList.vue'
|
||||||
import { MesProCardStatusEnum } from '@/views/mes/utils/constants'
|
import { MesProCardStatusEnum, MesAutoCodeRuleCode } from '@/views/mes/utils/constants'
|
||||||
|
|
||||||
defineOptions({ name: 'CardForm' })
|
defineOptions({ name: 'CardForm' })
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
|
|
@ -108,16 +108,16 @@ const emit = defineEmits(['success'])
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formType = ref<string>('create') // 表单的类型:create / update / execute / detail
|
const formType = ref<string>('create') // 表单的类型:create / update / finish / detail
|
||||||
const isEditable = computed(() => ['create', 'update'].includes(formType.value)) // 是否为编辑模式
|
const isEditable = computed(() => ['create', 'update'].includes(formType.value)) // 是否为编辑模式
|
||||||
const isExecute = computed(() => formType.value === 'execute') // 是否为执行模式
|
const isFinish = computed(() => formType.value === 'finish') // 是否为完成模式
|
||||||
const isDetail = computed(() => ['detail', 'execute'].includes(formType.value)) // 是否为详情模式(表单只读)
|
const isDetail = computed(() => ['detail', 'finish'].includes(formType.value)) // 是否为详情模式(表单只读)
|
||||||
const isHeaderReadonly = computed(() => ['execute', 'detail'].includes(formType.value)) // 头部是否只读
|
const isHeaderReadonly = computed(() => ['finish', 'detail'].includes(formType.value)) // 头部是否只读
|
||||||
const dialogTitle = computed(() => {
|
const dialogTitle = computed(() => {
|
||||||
const titles: Record<string, string> = {
|
const titles: Record<string, string> = {
|
||||||
create: '新增流转卡',
|
create: '新增流转卡',
|
||||||
update: '编辑流转卡',
|
update: '编辑流转卡',
|
||||||
execute: '执行流转卡',
|
finish: '完成流转卡',
|
||||||
detail: '流转卡详情'
|
detail: '流转卡详情'
|
||||||
}
|
}
|
||||||
return titles[formType.value] || formType.value
|
return titles[formType.value] || formType.value
|
||||||
|
|
@ -142,8 +142,8 @@ const formRef = ref() // 表单 Ref
|
||||||
const originalFormData = ref<string>('') // 原始表单数据快照,用于脏检查
|
const originalFormData = ref<string>('') // 原始表单数据快照,用于脏检查
|
||||||
|
|
||||||
/** 生成流转卡编码 */
|
/** 生成流转卡编码 */
|
||||||
const generateCode = () => {
|
const generateCode = async () => {
|
||||||
formData.value.code = 'CARD' + generateRandomStr(10)
|
formData.value.code = await AutoCodeRecordApi.generateAutoCode(MesAutoCodeRuleCode.PRO_CARD_CODE)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
|
|
@ -211,13 +211,13 @@ const handleSubmit = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 执行流转卡 */
|
/** 完成流转卡 */
|
||||||
const handleExecute = async () => {
|
const handleFinish = async () => {
|
||||||
try {
|
try {
|
||||||
await message.confirm('确认执行该流转卡?')
|
await message.confirm('确认完成该流转卡?')
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
await ProCardApi.executeCard(formData.value.id!)
|
await ProCardApi.finishCard(formData.value.id!)
|
||||||
message.success('执行成功')
|
message.success('完成成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
|
|
@ -109,11 +109,11 @@
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="success"
|
type="success"
|
||||||
@click="openForm('execute', scope.row.id)"
|
@click="openForm('finish', scope.row.id)"
|
||||||
v-hasPermi="['mes:pro-card:update']"
|
v-hasPermi="['mes:pro-card:finish']"
|
||||||
v-if="scope.row.status === MesProCardStatusEnum.CONFIRMED"
|
v-if="scope.row.status === MesProCardStatusEnum.CONFIRMED"
|
||||||
>
|
>
|
||||||
执行
|
完成
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,9 @@ export const MesAutoCodeRuleCode = {
|
||||||
PRO_PROCESS_CODE: 'PRO_PROCESS_CODE', // 工序编码
|
PRO_PROCESS_CODE: 'PRO_PROCESS_CODE', // 工序编码
|
||||||
PRO_ROUTE_CODE: 'PRO_ROUTE_CODE', // 工艺路线编码
|
PRO_ROUTE_CODE: 'PRO_ROUTE_CODE', // 工艺路线编码
|
||||||
PRO_FEEDBACK_CODE: 'PRO_FEEDBACK_CODE', // 生产报工单编码
|
PRO_FEEDBACK_CODE: 'PRO_FEEDBACK_CODE', // 生产报工单编码
|
||||||
PRO_WORK_ORDER_CODE: 'PRO_WORK_ORDER_CODE' // 生产工单编码
|
PRO_WORK_ORDER_CODE: 'PRO_WORK_ORDER_CODE', // 生产工单编码
|
||||||
|
QC_DEFECT_CODE: 'QC_DEFECT_CODE', // 缺陷类型编码
|
||||||
|
PRO_CARD_CODE: 'PRO_CARD_CODE' // 流转卡编码
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
/** 获取物料/产品标识的标签 */
|
/** 获取物料/产品标识的标签 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue