|
|
@@ -1,6 +1,9 @@
|
|
|
<script lang="ts" setup>
|
|
|
+import { IotRdDailyReportApi } from '@/api/pms/iotrddailyreport'
|
|
|
+import { useTableComponents } from '@/components/ZmTable/useTableComponents'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
+import { useDebounceFn } from '@vueuse/core'
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
@@ -19,7 +22,7 @@ interface Query {
|
|
|
|
|
|
const query = ref<Query>({
|
|
|
pageNo: 1,
|
|
|
- pageSize: 12,
|
|
|
+ pageSize: 10,
|
|
|
deptId: id
|
|
|
})
|
|
|
|
|
|
@@ -54,18 +57,77 @@ interface ListItem {
|
|
|
partyaPrepare: number
|
|
|
partyaResource: number
|
|
|
otherNptTime: number
|
|
|
+ otherNptReason: string
|
|
|
+ nonProductFlag: boolean
|
|
|
+ nonProductionRate: number
|
|
|
+ contractName: string
|
|
|
+ timeRange: string
|
|
|
auditStatus: number
|
|
|
}
|
|
|
|
|
|
-const handleQuery = () => {}
|
|
|
+const list = ref<ListItem[]>([])
|
|
|
+const total = ref(0)
|
|
|
|
|
|
-const resetQuery = () => {}
|
|
|
+const loading = ref(false)
|
|
|
+
|
|
|
+const loadList = useDebounceFn(async function () {
|
|
|
+ loading.value = true
|
|
|
+ try {
|
|
|
+ const data = await IotRdDailyReportApi.getIotRdDailyReportPage(query.value)
|
|
|
+ list.value = data.list
|
|
|
+ total.value = data.total
|
|
|
+ } finally {
|
|
|
+ loading.value = false
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+function handleSizeChange(val: number) {
|
|
|
+ query.value.pageSize = val
|
|
|
+ handleQuery()
|
|
|
+}
|
|
|
+
|
|
|
+function handleCurrentChange(val: number) {
|
|
|
+ query.value.pageNo = val
|
|
|
+ loadList()
|
|
|
+}
|
|
|
+
|
|
|
+function handleQuery(setPage = true) {
|
|
|
+ if (setPage) {
|
|
|
+ query.value.pageNo = 1
|
|
|
+ }
|
|
|
+ loadList()
|
|
|
+}
|
|
|
+
|
|
|
+function resetQuery() {
|
|
|
+ query.value = {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ deptId: id
|
|
|
+ }
|
|
|
+
|
|
|
+ handleQuery()
|
|
|
+}
|
|
|
+
|
|
|
+watch(
|
|
|
+ [
|
|
|
+ () => query.value.deptId,
|
|
|
+ () => query.value.contractName,
|
|
|
+ () => query.value.taskName,
|
|
|
+ () => query.value.createTime
|
|
|
+ ],
|
|
|
+ () => {
|
|
|
+ handleQuery()
|
|
|
+ },
|
|
|
+ { immediate: true }
|
|
|
+)
|
|
|
|
|
|
const openForm = (type: 'create' | 'detail') => {}
|
|
|
|
|
|
const exportLoading = ref(false)
|
|
|
|
|
|
async function handleExport() {}
|
|
|
+
|
|
|
+const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -135,6 +197,21 @@ async function handleExport() {}
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <div class="bg-white dark:bg-[#1d1e1f] shadow rounded-lg flex flex-col p-4">
|
|
|
+ <div class="flex-1 relative">
|
|
|
+ <el-auto-resizer class="absolute">
|
|
|
+ <template #default="{ width, height }">
|
|
|
+ <zm-table
|
|
|
+ :data="list"
|
|
|
+ :loading="loading"
|
|
|
+ :width="width"
|
|
|
+ :max-height="height"
|
|
|
+ :height="height"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-auto-resizer>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|