生产计划优化

main
liutao 2 days ago
parent a5421d47ba
commit 8f1476e2ad

@ -4869,6 +4869,7 @@ export default {
buttonResetText: 'Reset',
buttonExportText: 'Export',
tabAllLabel: 'All',
tabPlannedLabel: 'Scheduled',
tabStartLabel: 'Started',
tabTrialLabel: 'Trial',
@ -4897,6 +4898,7 @@ export default {
tableOperateColumn: 'Operate',
actionDetailLabel: 'Detail',
actionChangeLineLabel: 'Change Line',
actionEditLabel: 'Edit',
actionMaterialLabel: 'Material',
actionDispatchFeedingLabel: 'Feeding Dispatch',
@ -4915,6 +4917,23 @@ export default {
statusConfirmMessage: 'Plan: {code} confirm {action}?',
inspectConfirmTitle: 'Prompt',
inspectConfirmMessage: 'Plan: {code} confirm inspection?',
processDeviceLine: 'Process {index} ({process}): {device}',
lineChangeDialogTitle: 'Change Line',
lineChangeDialogTitleWithCode: 'Change Line - {code}',
lineChangeRouteEmptyText: 'No process route details',
lineChangeCurrentDeviceColumn: 'Current Device',
lineChangeNewDeviceColumn: 'New Device',
lineChangeRemarkColumn: 'Change Remark',
lineChangeCloseButton: 'Close',
lineChangeSaveButton: 'Save',
lineChangeFinishedWarning: 'A finished plan cannot change lines',
lineChangeMissingPlanIdWarning: 'Production plan ID is missing',
lineChangeSuccessMessage: 'Line changed successfully',
storeDialogTitle: 'Store',
storeWarehouseLabel: 'Warehouse',
storeWarehousePlaceholder: 'Please select warehouse',
dialogTaskLabel: 'Task Order',
dialogTaskPlaceholder: 'Please select task order',

@ -4765,6 +4765,7 @@ export default {
buttonResetText: '重置',
buttonExportText: '导出',
tabAllLabel: '所有',
tabPlannedLabel: '已排产',
tabStartLabel: '已开工',
tabTrialLabel: '试产',
@ -4793,6 +4794,7 @@ export default {
tableOperateColumn: '操作',
actionDetailLabel: '详情',
actionChangeLineLabel: '换线',
actionEditLabel: '编辑',
actionMaterialLabel: '物料',
actionDispatchFeedingLabel: '下料派工',
@ -4811,6 +4813,23 @@ export default {
statusConfirmMessage: '计划:{code}确定{action}吗?',
inspectConfirmTitle: '提示',
inspectConfirmMessage: '计划:{code}确定质检吗?',
processDeviceLine: '工序{index}{process}{device}',
lineChangeDialogTitle: '换线',
lineChangeDialogTitleWithCode: '换线 - {code}',
lineChangeRouteEmptyText: '暂无工艺路线明细',
lineChangeCurrentDeviceColumn: '当前设备',
lineChangeNewDeviceColumn: '换线后设备',
lineChangeRemarkColumn: '换线备注',
lineChangeCloseButton: '关闭',
lineChangeSaveButton: '保存',
lineChangeFinishedWarning: '完工状态不能换线',
lineChangeMissingPlanIdWarning: '缺少生产计划 ID',
lineChangeSuccessMessage: '换线成功',
storeDialogTitle: '入库',
storeWarehouseLabel: '选择仓库',
storeWarehousePlaceholder: '请选择仓库',
dialogTaskLabel: '任务单',
dialogTaskPlaceholder: '请选择任务单',

@ -131,7 +131,7 @@
{{ t('ProductionPlan.Plan.actionDetailLabel') }}
</el-button>
<el-button link type="primary" @click="openChangeLineDialog(scope.row)" v-hasPermi="['mes:plan:update']" v-if="String(scope.row.status) !== '9'">
换线
{{ t('ProductionPlan.Plan.actionChangeLineLabel') }}
</el-button>
<el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['mes:plan:update']"
v-if="scope.row.status === 0">
@ -228,46 +228,46 @@
:stripe="true"
:show-overflow-tooltip="true"
row-key="id"
empty-text="暂无工艺路线明细"
:empty-text="t('ProductionPlan.Plan.lineChangeRouteEmptyText')"
>
<el-table-column label="排序" prop="sort" width="70" align="center" />
<el-table-column label="工艺参数编码" prop="processParameterCode" min-width="140" align="center" />
<el-table-column label="工艺参数名称" prop="processParameterName" min-width="160" align="center" />
<el-table-column label="备注" prop="remark" min-width="140" align="center" />
<el-table-column label="当前设备" min-width="170" align="center">
<el-table-column :label="t('ProductionPlan.Plan.routeItemSortColumn')" prop="sort" width="70" align="center" />
<el-table-column :label="t('ProductionPlan.Plan.routeItemParameterCodeColumn')" prop="processParameterCode" min-width="140" align="center" />
<el-table-column :label="t('ProductionPlan.Plan.routeItemParameterNameColumn')" prop="processParameterName" min-width="160" align="center" />
<el-table-column :label="t('ProductionPlan.Plan.routeItemRemarkColumn')" prop="remark" min-width="140" align="center" />
<el-table-column :label="t('ProductionPlan.Plan.lineChangeCurrentDeviceColumn')" min-width="170" align="center">
<template #default="scope">
{{ scope.row.originalDeviceName || scope.row.originalDeviceId || '' }}
</template>
</el-table-column>
<el-table-column label="换线后设备" min-width="260" align="center">
<el-table-column :label="t('ProductionPlan.Plan.lineChangeNewDeviceColumn')" min-width="260" align="center">
<template #default="scope">
<el-input
:model-value="getLineChangeDeviceDisplay(scope.row)"
placeholder="请选择设备"
:placeholder="t('ProductionPlan.Plan.routeItemDevicePlaceholder')"
readonly
@click="openLineDeviceSelectDialog(scope.row)"
>
<template #append>
<el-button @click.stop="openLineDeviceSelectDialog(scope.row)">选择</el-button>
<el-button @click.stop="openLineDeviceSelectDialog(scope.row)">{{ t('ProductionPlan.Plan.routeItemDeviceSelectButton') }}</el-button>
</template>
</el-input>
</template>
</el-table-column>
<el-table-column label="换线备注" min-width="180" align="center">
<el-table-column :label="t('ProductionPlan.Plan.lineChangeRemarkColumn')" min-width="180" align="center">
<template #default="scope">
<el-input v-model="scope.row.lineChangeRemark" placeholder="请输入备注" clearable />
<el-input v-model="scope.row.lineChangeRemark" :placeholder="t('ProductionPlan.Plan.dialogRemarkPlaceholder')" clearable />
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button @click="lineChangeDialogVisible = false">关闭</el-button>
<el-button type="primary" :loading="lineChangeSaving" :disabled="!hasLineChangeChanges || lineChangeLoading" @click="submitLineChangeBatch"></el-button>
<el-button @click="lineChangeDialogVisible = false">{{ t('ProductionPlan.Plan.lineChangeCloseButton') }}</el-button>
<el-button type="primary" :loading="lineChangeSaving" :disabled="!hasLineChangeChanges || lineChangeLoading" @click="submitLineChangeBatch">{{ t('ProductionPlan.Plan.lineChangeSaveButton') }}</el-button>
</template>
</Dialog>
<TableSelectDialog
ref="lineDeviceSelectDialogRef"
title="选择设备"
:title="t('ProductionPlan.Plan.selectDeviceDialogTitle')"
:columns="lineDeviceColumns"
:fetch-api="fetchLineDeviceLedgerPage"
selection-type="single"
@ -279,17 +279,17 @@
<PlanDetail ref="detailRef" />
<!-- 入库仓库选择弹窗 -->
<Dialog v-model="storeDialogVisible" title="入库" width="400px">
<Dialog v-model="storeDialogVisible" :title="t('ProductionPlan.Plan.storeDialogTitle')" width="400px">
<el-form label-width="80px">
<el-form-item label="选择仓库">
<el-select v-model="storeWarehouseId" placeholder="请选择仓库" filterable style="width: 100%">
<el-form-item :label="t('ProductionPlan.Plan.storeWarehouseLabel')">
<el-select v-model="storeWarehouseId" :placeholder="t('ProductionPlan.Plan.storeWarehousePlaceholder')" filterable style="width: 100%">
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="storeDialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirmStore" :disabled="!storeWarehouseId">确定</el-button>
<el-button @click="storeDialogVisible = false">{{ t('ProductionPlan.Plan.dialogCancelButtonText') }}</el-button>
<el-button type="primary" @click="confirmStore" :disabled="!storeWarehouseId">{{ t('ProductionPlan.Plan.dialogSubmitButtonText') }}</el-button>
</template>
</Dialog>
@ -323,7 +323,7 @@ const taskList = ref<TaskVO[]>([]) // 列表
defineOptions({ name: 'Plan' })
const activeName = ref('') // tab
const planStatusTabs = computed(() => [
{ label: '所有', value: '' },
{ label: t('ProductionPlan.Plan.tabAllLabel'), value: '' },
...getStrDictOptions(DICT_TYPE.MES_PLAN_STATUS).map((item) => ({
label: item.label,
value: item.value
@ -396,26 +396,17 @@ const exportLoading = ref(false) // 导出的加载中
const showAllFilters = ref(false) //
const filterCount = 4 //
const chineseNumberText = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
const formatChineseNumber = (value: number) => {
if (value <= 10) return chineseNumberText[value] || String(value)
if (value < 20) return `${chineseNumberText[value - 10]}`
if (value < 100) {
const ten = Math.floor(value / 10)
const one = value % 10
return `${chineseNumberText[ten]}${one ? chineseNumberText[one] : ''}`
}
return String(value)
}
const getProcessDeviceLines = (row: PlanVO) => {
const items = Array.isArray(row.processRouteItems) ? row.processRouteItems : []
if (!items.length) return [row.deviceName || '-']
return items.map((item, index) => {
const processName = item.processParameterName || '-'
const deviceName = item.deviceName || '-'
return `工序${formatChineseNumber(index + 1)}${processName}${deviceName}`
return t('ProductionPlan.Plan.processDeviceLine', {
index: index + 1,
process: processName,
device: deviceName
})
})
}
/** 切换筛选框展开/折叠 */
@ -565,11 +556,13 @@ const hasLineChangeChanges = computed(() => changedLineChangeItems.value.length
const openChangeLineDialog = async (row: PlanVO) => {
if (!row?.id) return
if (String(row.status) === '9') {
message.warning('完工状态不能换线')
message.warning(t('ProductionPlan.Plan.lineChangeFinishedWarning'))
return
}
lineChangePlanId.value = row.id
lineChangeDialogTitle.value = row.code ? `换线 - ${row.code}` : '换线'
lineChangeDialogTitle.value = row.code
? t('ProductionPlan.Plan.lineChangeDialogTitleWithCode', { code: row.code })
: t('ProductionPlan.Plan.lineChangeDialogTitle')
lineChangeDialogVisible.value = true
lineChangeLoading.value = true
lineChangeSaving.value = false
@ -616,7 +609,7 @@ const handleLineDeviceSelectConfirm = (payload: { ids: (number | string)[]; rows
const submitLineChangeBatch = async () => {
const planId = lineChangePlanId.value
if (!planId) {
message.warning('缺少生产计划 ID')
message.warning(t('ProductionPlan.Plan.lineChangeMissingPlanIdWarning'))
return
}
const items = changedLineChangeItems.value.reduce<
@ -647,7 +640,7 @@ const submitLineChangeBatch = async () => {
row.originalDeviceName = row.selectedDeviceName || String(item.deviceId)
row.lineChangeRemark = ''
})
message.success('换线成功')
message.success(t('ProductionPlan.Plan.lineChangeSuccessMessage'))
await getList()
} finally {
lineChangeSaving.value = false

Loading…
Cancel
Save