Browse Source

feat(设备库存): 增加总条数 序号 库存设备分类过滤

master
betaqi 1 month ago
parent
commit
4ed8065851
  1. 2
      src/components/dashboard/Edfs-table/index.vue
  2. 5
      src/pages/deviceInfo/index.vue
  3. 30
      src/pages/deviceStorage/components/data-filter.vue
  4. 5
      src/pages/deviceStorage/index.vue

2
src/components/dashboard/Edfs-table/index.vue

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:width-type="1"
layout="prev, pager, next, jumper"
layout="total,prev, pager, next, jumper"
:total="pageTotal"
background
@current-change="onPageCurrentChange"

5
src/pages/deviceInfo/index.vue

@ -24,6 +24,11 @@ @@ -24,6 +24,11 @@
row-class-name="row"
@pageCurrentChange="handleJump"
>
<el-table-column type="index" label="序号" align="center" width="80">
<template #default="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<template v-for="(col, idx) in deviceTableCol" :key="idx">
<el-table-column
v-if="col.prop.endsWith('Time')"

30
src/pages/deviceStorage/components/data-filter.vue

@ -58,6 +58,21 @@ @@ -58,6 +58,21 @@
</el-select>
<el-checkbox v-model="checkbox.status" size="large" disabled />
</div>
<div class="item">
<el-cascader
v-model="filterData.categoryId"
:options="categoryTreeData"
placeholder="请选择设备分类"
style="width: 100%"
:props="{
checkStrictly: true,
value: 'id',
label: 'name',
emitPath: false,
}"
/>
<el-checkbox v-model="checkbox.categoryId" size="large" />
</div>
<div class="item item-btn">
<EdfsButton
inner-text="搜索"
@ -79,6 +94,7 @@ import { isResError } from '@/hooks/useMessage' @@ -79,6 +94,7 @@ import { isResError } from '@/hooks/useMessage'
import type { CustomerVO } from '@/api/module/eam/customer'
import { statusList } from '../utils'
import { useMessage } from '@/hooks/useMessage'
import { getCategoryTree, ICategoryTree } from "@/api/module/eam/device/category";
const locale = zhCn
const msg = useMessage()
@ -99,6 +115,7 @@ type FilterKeys = keyof typeof filterData.value @@ -99,6 +115,7 @@ type FilterKeys = keyof typeof filterData.value
const filterData = ref({
// startDay: dayjs().subtract(15, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
// endDay: dayjs().add(1, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
categoryId: '',
startDay: '',
endDay: '',
status: 3,
@ -108,6 +125,7 @@ const filterData = ref({ @@ -108,6 +125,7 @@ const filterData = ref({
const checkbox = ref<Record<FilterKeys, boolean>>({
startDay: false,
categoryId: false,
endDay: false,
status: true,
sn: false,
@ -138,6 +156,7 @@ const placeholderMap = { @@ -138,6 +156,7 @@ const placeholderMap = {
endDay: '终止时间',
sn: '设备SN',
customerId: '客户',
categoryId: '设备分类',
}
function validate() {
@ -176,6 +195,7 @@ function onReset() { @@ -176,6 +195,7 @@ function onReset() {
status: 3,
sn: '',
customerId: '',
categoryId: '',
}
checkbox.value = {
startDay: false,
@ -183,11 +203,19 @@ function onReset() { @@ -183,11 +203,19 @@ function onReset() {
status: true,
sn: false,
customerId: false,
categoryId: false,
}
onSearch()
}
const categoryTreeData = ref<ICategoryTree[]>([])
async function loadDeviceTypeTree() {
const res = await getCategoryTree()
if (!isResError(res)) {
categoryTreeData.value = res.data
}
}
onMounted(() => {
loadDeviceTypeTree()
onSearch()
})
</script>

5
src/pages/deviceStorage/index.vue

@ -21,6 +21,11 @@ @@ -21,6 +21,11 @@
row-class-name="row"
@pageCurrentChange="handleJump"
>
<el-table-column type="index" label="序号" align="center" width="80">
<template #default="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<template v-for="(col, idx) in tableCol" :key="idx">
<el-table-column
v-if="col.prop.endsWith('Time')"

Loading…
Cancel
Save