|
|
|
|
@ -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
|
|
|
|
|
|