|
|
|
|
@ -143,12 +143,19 @@
|
|
|
|
|
|
|
|
|
|
<div class="device-ledger-right">
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<div class="device-ledger__header">
|
|
|
|
|
<div v-for="card in statusCards" :key="card.key" class="device-ledger__stat"
|
|
|
|
|
:class="{ 'is-active': currentStatusKey === card.key }" @click="changeStatus(card.key, card.status, card.isSchedueld)">
|
|
|
|
|
<div class="device-ledger__stat-title">{{ card.label }}</div>
|
|
|
|
|
<div class="device-ledger__stat-value">{{ card.value }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-form
|
|
|
|
|
class="-mb-15px"
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
ref="queryFormRef"
|
|
|
|
|
:inline="true"
|
|
|
|
|
label-width="120px"
|
|
|
|
|
label-width="68px"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="t('EquipmentManagement.EquipmentLedger.deviceCode')"
|
|
|
|
|
@ -177,6 +184,7 @@
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="t('EquipmentManagement.EquipmentLedger.deviceStatus')"
|
|
|
|
|
prop="deviceStatus"
|
|
|
|
|
v-show="showAllFilters"
|
|
|
|
|
>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.deviceStatus"
|
|
|
|
|
@ -195,6 +203,7 @@
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="t('EquipmentManagement.EquipmentLedger.deviceType')"
|
|
|
|
|
prop="deviceType"
|
|
|
|
|
v-show="showAllFilters"
|
|
|
|
|
>
|
|
|
|
|
<el-tree-select
|
|
|
|
|
v-model="queryParams.deviceType"
|
|
|
|
|
@ -211,6 +220,7 @@
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="t('EquipmentManagement.EquipmentLedger.deviceBrand')"
|
|
|
|
|
prop="deviceBrand"
|
|
|
|
|
v-show="showAllFilters"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.deviceBrand"
|
|
|
|
|
@ -220,7 +230,7 @@
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.EquipmentLedger.sn')" prop="sn">
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.EquipmentLedger.sn')" prop="sn" v-show="showAllFilters">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.sn"
|
|
|
|
|
:placeholder="t('EquipmentManagement.EquipmentLedger.placeholderSn')"
|
|
|
|
|
@ -232,6 +242,7 @@
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="t('EquipmentManagement.EquipmentLedger.outgoingTime')"
|
|
|
|
|
prop="outgoingTime"
|
|
|
|
|
v-show="showAllFilters"
|
|
|
|
|
>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.outgoingTime"
|
|
|
|
|
@ -242,6 +253,12 @@
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="filterCount > 2">
|
|
|
|
|
<el-button type="text" class="text-primary" @click="toggleFilters">
|
|
|
|
|
<Icon :icon="showAllFilters ? 'ep:arrow-up' : 'ep:arrow-down'" class="mr-5px" />
|
|
|
|
|
{{ showAllFilters ? t('FactoryModeling.FactoryStructure.collapseText') : t('FactoryModeling.FactoryStructure.expandText') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery">
|
|
|
|
|
<Icon icon="ep:search" class="mr-5px" />
|
|
|
|
|
@ -678,20 +695,47 @@ const loading = ref(true) // 列表的加载中
|
|
|
|
|
const list = ref<DeviceLedgerVO[]>([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
const selectedDeviceLineId = ref<string | undefined>(undefined)
|
|
|
|
|
const currentStatusKey = ref('all')
|
|
|
|
|
const counters = reactive({
|
|
|
|
|
allCount: 0,
|
|
|
|
|
normalCount: 0,
|
|
|
|
|
disabledCount: 0,
|
|
|
|
|
scheduledCount: 0,
|
|
|
|
|
unscheduledCount: 0
|
|
|
|
|
})
|
|
|
|
|
const statusCards = computed(() => [
|
|
|
|
|
{ key: 'all', label: t('EquipmentManagement.EquipmentLedger.all'), value: counters.allCount, status: undefined, isSchedueld: undefined },
|
|
|
|
|
{ key: 'normal', label: t('EquipmentManagement.EquipmentLedger.normal'), value: counters.normalCount, status: 0, isSchedueld: undefined },
|
|
|
|
|
{ key: 'disabled', label: t('EquipmentManagement.EquipmentLedger.disabled'), value: counters.disabledCount, status: 1, isSchedueld: undefined },
|
|
|
|
|
{ key: 'scheduled', label: t('EquipmentManagement.EquipmentLedger.scheduled'), value: counters.scheduledCount, status: undefined, isSchedueld: 1 },
|
|
|
|
|
{ key: 'unscheduled', label: t('EquipmentManagement.EquipmentLedger.unscheduled'), value: counters.unscheduledCount, status: undefined, isSchedueld: 0 }
|
|
|
|
|
])
|
|
|
|
|
const changeStatus = (key: string, status?: number, isSchedueld?: number) => {
|
|
|
|
|
currentStatusKey.value = key
|
|
|
|
|
queryParams.deviceStatus = status
|
|
|
|
|
queryParams.isSchedueld = isSchedueld
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
deviceCode: undefined,
|
|
|
|
|
deviceName: undefined,
|
|
|
|
|
deviceStatus: undefined,
|
|
|
|
|
deviceStatus: undefined as number | undefined,
|
|
|
|
|
deviceBrand: undefined,
|
|
|
|
|
sn: undefined,
|
|
|
|
|
outgoingTime: undefined,
|
|
|
|
|
deviceType: undefined as string | undefined,
|
|
|
|
|
deviceLine: undefined as string | undefined
|
|
|
|
|
deviceLine: undefined as string | undefined,
|
|
|
|
|
isSchedueld: undefined as number | undefined
|
|
|
|
|
})
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false)
|
|
|
|
|
const showAllFilters = ref(false)
|
|
|
|
|
const filterCount = 7
|
|
|
|
|
const toggleFilters = () => {
|
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
const planTableMaxHeight = ref(520)
|
|
|
|
|
@ -1012,10 +1056,16 @@ const getList = async () => {
|
|
|
|
|
sn: queryParams.sn,
|
|
|
|
|
outgoingTime: queryParams.outgoingTime,
|
|
|
|
|
deviceType: queryParams.deviceType,
|
|
|
|
|
deviceLine: queryParams.deviceLine
|
|
|
|
|
deviceLine: queryParams.deviceLine,
|
|
|
|
|
isScheduled: queryParams.isSchedueld
|
|
|
|
|
})
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
list.value = data.list ?? []
|
|
|
|
|
total.value = data.total ?? 0
|
|
|
|
|
counters.allCount = Number(data?.allCount ?? data?.total ?? 0)
|
|
|
|
|
counters.normalCount = Number(data?.normalCount ?? 0)
|
|
|
|
|
counters.disabledCount = Number(data?.disabledCount ?? 0)
|
|
|
|
|
counters.scheduledCount = Number(data?.scheduledCount ?? 0)
|
|
|
|
|
counters.unscheduledCount = Number(data?.unscheduledCount ?? 0)
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
@ -1031,6 +1081,9 @@ const handleQuery = () => {
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
queryFormRef.value.resetFields()
|
|
|
|
|
currentStatusKey.value = 'all'
|
|
|
|
|
queryParams.deviceStatus = undefined
|
|
|
|
|
queryParams.isSchedueld = undefined
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1122,6 +1175,45 @@ onBeforeUnmount(() => {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger__header {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
|
|
|
gap: 12px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger__stat {
|
|
|
|
|
padding: 16px 18px;
|
|
|
|
|
border: 1px solid var(--el-border-color-light);
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: box-shadow 0.2s ease;
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
box-shadow: 0 10px 24px rgba(64, 158, 255, 0.12);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.is-active {
|
|
|
|
|
border-color: var(--el-color-primary);
|
|
|
|
|
box-shadow: 0 10px 24px rgba(64, 158, 255, 0.12);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger__stat-title {
|
|
|
|
|
color: var(--el-text-color-regular);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger__stat-value {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
color: var(--el-text-color-primary);
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
line-height: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.simple-grid-view {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|