|
|
|
|
@ -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()
|
|
|
|
|
}
|
|
|
|
|
|