style:产能报表-添加时间筛选入参

main
黄伟杰 4 days ago
parent 0d7ae49a10
commit 88797b7760

@ -1355,20 +1355,29 @@ export default {
workshop: 'Workshop',
ratedCapacity: 'Rated Capacity (Planned Capacity)',
reportCapacity: 'Report Capacity',
reportCapacityTooltip: 'Average of data from the last half year (excluding today)',
reportCapacityTooltip: 'Default query for average of data from the last half year (excluding today)',
reportCapacityViewDetail: 'View Detail',
actualCapacity: 'Actual Capacity',
actualCapacityTooltip: 'Average of data from the last half year (excluding today)',
actualCapacityTooltip: 'Default query for average of data from the last half year (excluding today)',
placeholderDeviceCode: 'Please input device code',
placeholderDeviceName: 'Please input device name',
placeholderDeviceType: 'Please input device type',
placeholderDeviceStatus: 'Please select device status',
placeholderWorkshop: 'Please input workshop',
baogongTime: 'Capacity Statistics Time',
placeholderBaogongTimeStart: 'Start Time',
placeholderBaogongTimeEnd: 'End Time',
shortcutLastWeek: 'Last Week',
shortcutLastHalfYear: 'Last Half Year',
shortcutLastYear: 'Last Year',
dialogTitlePrefix: 'Report Capacity Detail - ',
dialogProductCode: 'Product Code',
dialogProductCodePlaceholder: 'Please input product code',
dialogProductName: 'Product Name',
dialogProductNamePlaceholder: 'Please input product name',
dialogBaogongTime: 'Report Time',
dialogBaogongTimeStart: 'Report Start Time',
dialogBaogongTimeEnd: 'Report End Time',
dialogTaskCode: 'Task Code',
dialogTaskCodePlaceholder: 'Please input task code',
dialogBaogongTotal: 'Report Total',

@ -1345,20 +1345,29 @@ export default {
workshop: '所属车间',
ratedCapacity: '额定产能(计划产能)',
reportCapacity: '报工产能',
reportCapacityTooltip: '近半年的数据均值(不包含今日)',
reportCapacityTooltip: '默认查询近半年的数据均值(不包含今日)',
reportCapacityViewDetail: '查看明细',
actualCapacity: '实际产能',
actualCapacityTooltip: '近半年的数据均值(不包含今日)',
actualCapacityTooltip: '默认查询近半年的数据均值(不包含今日)',
placeholderDeviceCode: '请输入设备编码',
placeholderDeviceName: '请输入设备名称',
placeholderDeviceType: '请输入设备类型',
placeholderDeviceStatus: '请选择设备状态',
placeholderWorkshop: '请输入所属车间',
baogongTime: '产能统计时间',
placeholderBaogongTimeStart: '开始时间',
placeholderBaogongTimeEnd: '结束时间',
shortcutLastWeek: '近一周',
shortcutLastHalfYear: '近半年',
shortcutLastYear: '近一年',
dialogTitlePrefix: '报工产能明细 - ',
dialogProductCode: '产品编码',
dialogProductCodePlaceholder: '请输入产品编码',
dialogProductName: '产品名称',
dialogProductNamePlaceholder: '请输入产品名称',
dialogBaogongTime: '报工时间',
dialogBaogongTimeStart: '报工开始时间',
dialogBaogongTimeEnd: '报工结束时间',
dialogTaskCode: '任务编码',
dialogTaskCodePlaceholder: '请输入任务编码',
dialogBaogongTotal: '报工总数',

@ -1,5 +1,5 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="1200" :scroll="true" max-height="70vh" align-center>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="1300" :scroll="true" max-height="70vh" align-center>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="auto">
<el-form-item :label="t('EquipmentManagement.CapacityReport.dialogProductCode')" prop="productCode">
<el-input
@ -19,6 +19,13 @@
class="!w-200px"
/>
</el-form-item>
<el-form-item :label="t('EquipmentManagement.CapacityReport.dialogBaogongTime')" prop="baogongTime">
<el-date-picker v-model="baogongTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
:start-placeholder="t('EquipmentManagement.CapacityReport.dialogBaogongTimeStart')"
:end-placeholder="t('EquipmentManagement.CapacityReport.dialogBaogongTimeEnd')"
:shortcuts="baogongTimeShortcuts"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-240px" />
</el-form-item>
<el-form-item>
<el-button @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" />
@ -83,8 +90,40 @@ const queryParams = reactive({
pageSize: 10,
deviceId: undefined as number | undefined,
productCode: undefined as string | undefined,
productName: undefined as string | undefined
productName: undefined as string | undefined,
beginBaogongTime: undefined as string | undefined,
endBaogongTime: undefined as string | undefined
})
const baogongTime = ref<[string, string]>(['', ''])
const baogongTimeShortcuts = [
{
text: t('EquipmentManagement.CapacityReport.shortcutLastWeek'),
value: () => {
const end = new Date()
const start = new Date()
start.setDate(start.getDate() - 7)
return [start, end]
}
},
{
text: t('EquipmentManagement.CapacityReport.shortcutLastHalfYear'),
value: () => {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
return [start, end]
}
},
{
text: t('EquipmentManagement.CapacityReport.shortcutLastYear'),
value: () => {
const end = new Date()
const start = new Date()
start.setFullYear(start.getFullYear() - 1)
return [start, end]
}
}
]
const queryFormRef = ref()
const getList = async () => {
@ -95,7 +134,12 @@ const getList = async () => {
}
loading.value = true
try {
const data = await PlanApi.getProductCapacityPage(queryParams)
const params = {
...queryParams,
beginBaogongTime: baogongTime.value?.[0] || undefined,
endBaogongTime: baogongTime.value?.[1] || undefined
}
const data = await PlanApi.getProductCapacityPage(params)
list.value = data.list
total.value = data.total
} finally {
@ -110,6 +154,7 @@ const handleQuery = () => {
const resetQuery = () => {
queryFormRef.value?.resetFields()
baogongTime.value = ['', '']
queryParams.deviceId = props.deviceId
handleQuery()
}

@ -12,6 +12,13 @@
:placeholder="t('EquipmentManagement.CapacityReport.placeholderDeviceName')" clearable
@keyup.enter="handleQuery" class="!w-240px" />
</el-form-item>
<el-form-item :label="t('EquipmentManagement.CapacityReport.baogongTime')" prop="baogongTime">
<el-date-picker v-model="baogongTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
:start-placeholder="t('EquipmentManagement.CapacityReport.placeholderBaogongTimeStart')"
:end-placeholder="t('EquipmentManagement.CapacityReport.placeholderBaogongTimeEnd')"
:shortcuts="baogongTimeShortcuts"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-240px" />
</el-form-item>
<el-form-item v-if="filterCount > 3">
<el-button type="text" class="text-primary" @click="toggleFilters">
@ -102,17 +109,50 @@ const queryParams = reactive({
deviceCode: undefined,
deviceName: undefined,
deviceType: undefined,
workshop: undefined
workshop: undefined,
beginTime: undefined,
endTime: undefined
})
const baogongTime = ref<[string, string]>(['', ''])
const queryFormRef = ref()
const exportLoading = ref(false)
const showAllFilters = ref(false)
const filterCount = 2
const filterCount = 3
const selectedIds = ref<number[]>([])
const productCapacityVisible = ref(false)
const productCapacityDeviceId = ref<number>()
const productCapacityDeviceName = ref<string>()
const baogongTimeShortcuts = [
{
text: t('EquipmentManagement.CapacityReport.shortcutLastWeek'),
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
}
},
{
text: t('EquipmentManagement.CapacityReport.shortcutLastHalfYear'),
value: () => {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
return [start, end]
}
},
{
text: t('EquipmentManagement.CapacityReport.shortcutLastYear'),
value: () => {
const end = new Date()
const start = new Date()
start.setFullYear(start.getFullYear() - 1)
return [start, end]
}
}
]
const openProductCapacity = (row: CapacityReportVO) => {
productCapacityDeviceId.value = row.id
productCapacityDeviceName.value = row.deviceName
@ -127,7 +167,12 @@ const toggleFilters = () => {
const getList = async () => {
loading.value = true
try {
const data = await DeviceLedgerApi.getCapacityReportPage(queryParams)
const params = {
...queryParams,
beginTime: baogongTime.value?.[0] || undefined,
endTime: baogongTime.value?.[1] || undefined
}
const data = await DeviceLedgerApi.getCapacityReportPage(params)
list.value = data.list
total.value = data.total
} finally {
@ -143,6 +188,7 @@ const handleQuery = () => {
const resetQuery = () => {
queryFormRef.value?.resetFields()
baogongTime.value = ['', '']
selectedIds.value = []
handleQuery()
}

Loading…
Cancel
Save