style:任务单排产-排产-产能来源改成从字典获取

main
黄伟杰 2 days ago
parent e5c9c61943
commit 85b759406d

@ -7,6 +7,7 @@
<el-descriptions :column="1" border size="small">
<el-descriptions-item label="设备名称">{{ activePreviewDevice.deviceName }}</el-descriptions-item>
<el-descriptions-item label="设备ID">{{ activePreviewDevice.deviceId }}</el-descriptions-item>
<el-descriptions-item v-if="activePreviewDevice.capacityType !== undefined" label="产能来源">{{ getCapacityTypeLabel(activePreviewDevice.capacityType) }}</el-descriptions-item>
<el-descriptions-item label="产能">{{ activePreviewDevice.ratedCapacity ?? '-' }}</el-descriptions-item>
<el-descriptions-item v-if="'dailyAverageValue' in activePreviewDevice" label="每日报工平均值">{{ activePreviewDevice.dailyAverageValue ?? '-' }}</el-descriptions-item>
<el-descriptions-item v-if="'dataCollectionCapacity' in activePreviewDevice" label="数据采集产能">{{ activePreviewDevice.dataCollectionCapacity ?? '-' }}</el-descriptions-item>
@ -72,6 +73,7 @@
import dayjs from 'dayjs'
import { gantt } from 'dhtmlx-gantt'
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css'
import { getDictOptions } from '@/utils/dict'
defineOptions({ name: 'ScheduleGanttPanelEditable' })
@ -89,6 +91,13 @@ const message = useMessage()
const ganttContainerRef = ref<HTMLDivElement>()
const activePreviewDevice = ref<any>()
const activePreviewTask = ref<any>()
const getCapacityTypeLabel = (value: any) => {
if (value === undefined || value === null) return '-'
const options = getDictOptions('capacity_sources')
const found = options.find((opt) => Number(opt.value) === Number(value))
return found?.label ?? String(value)
}
const tooltipCleanupFns = ref<(() => void)[]>([])
const ganttEventIds = ref<string[]>([])
const ganttSyncing = ref(false)

@ -216,7 +216,8 @@
</template>
<script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { useDictStoreWithOut } from '@/store/modules/dict'
import { TaskApi } from '@/api/mes/task'
import { ProductApi } from '@/api/erp/product/product'
import { DeviceLedgerApi } from '@/api/mes/deviceledger'
@ -228,8 +229,10 @@ import TaskSchedulePreviewDialog from './TaskSchedulePreviewDialog.vue'
defineOptions({ name: 'TaskScheduleDialog' })
const message = useMessage()
const { t } = useI18n() //
const { t } = useI18n()
const emit = defineEmits(['success'])
const dictStore = useDictStoreWithOut()
const dictReady = ref(false)
const dialogVisible = ref(false)
const taskLoading = ref(false)
@ -270,11 +273,10 @@ const scheduleRuleOptions = computed(() => [
{ label: t('ProductionPlan.TaskSummary.scheduleRuleCategory'), value: 3 },
{ label: t('ProductionPlan.TaskSummary.scheduleRuleDelivery'), value: 4 }
])
const capacityTypeOptions = computed(() => [
{ label: t('ProductionPlan.TaskSummary.capacityTypeRated'), value: 1 },
{ label: t('ProductionPlan.TaskSummary.capacityTypeDailyAvg'), value: 2 },
{ label: t('ProductionPlan.TaskSummary.capacityTypeDataCollection'), value: 3 }
])
const capacityTypeOptions = computed(() => {
if (!dictReady.value) return []
return getIntDictOptions('capacity_sources')
})
const searchForm = reactive({
inventoryTaskSchedule: false,
@ -774,6 +776,8 @@ const handleSubmit = async () => {
}
const open = async () => {
await dictStore.setDictMap()
dictReady.value = true
dialogVisible.value = true
await loadTaskList()
}

Loading…
Cancel
Save