|
@@ -1,37 +1,37 @@
|
|
<template>
|
|
<template>
|
|
<div class="hc-table-stats-ref-box">
|
|
<div class="hc-table-stats-ref-box">
|
|
- <el-table :data="tableData" border v-loading="isLoading" :span-method="objectSpanMethod" height="100%">
|
|
|
|
|
|
+ <el-table v-loading="isLoading" :data="tableData" border :span-method="objectSpanMethod" height="100%">
|
|
<el-table-column class-name="hc-table-stats-column" align="center" width="90" :resizable="false">
|
|
<el-table-column class-name="hc-table-stats-column" align="center" width="90" :resizable="false">
|
|
<template #header>
|
|
<template #header>
|
|
<div>分组</div>
|
|
<div>分组</div>
|
|
</template>
|
|
</template>
|
|
- <template #default="{row}">
|
|
|
|
|
|
+ <template #default="{ row }">
|
|
<div>{{ row.name }}</div>
|
|
<div>{{ row.name }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="总案卷(卷)" align="center">
|
|
<el-table-column label="总案卷(卷)" align="center">
|
|
- <template #default="{row}">
|
|
|
|
- <div class="num">{{ row.num1 }}</div>
|
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <div class="num">{{ row.total }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="已抽检(卷)" align="center">
|
|
<el-table-column label="已抽检(卷)" align="center">
|
|
- <template #default="{row}">
|
|
|
|
- <div class="num text-orange">{{ row.num2 }}</div>
|
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <div class="num text-orange">{{ row.endInspect }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="需整改(卷)" align="center">
|
|
<el-table-column label="需整改(卷)" align="center">
|
|
- <template #default="{row}">
|
|
|
|
- <div class="num text-red">{{ row.num5 }}</div>
|
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <div class="num text-red">{{ row.needUpdate }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="抽检率" align="center">
|
|
<el-table-column label="抽检率" align="center">
|
|
- <template #default="{row}">
|
|
|
|
- <div class="num text-green">{{ row.num3 }}</div>
|
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <div class="num text-green">{{ row.inspectRatio }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="总抽检率" align="center">
|
|
<el-table-column label="总抽检率" align="center">
|
|
- <template #default="{row}">
|
|
|
|
- <div class="num xl text-blue">{{ row.num4 }}</div>
|
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <div class="num xl text-blue">{{ `${totalInspectRatio}%` }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -39,52 +39,73 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import {ref, onMounted} from "vue";
|
|
|
|
-import {getArrValue} from "js-fast-way"
|
|
|
|
|
|
+import { onMounted, ref } from 'vue'
|
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
|
+import initialgApi from '~api/initial/initial'
|
|
|
|
|
|
//参数
|
|
//参数
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
projectId: {
|
|
projectId: {
|
|
- type: [String,Number],
|
|
|
|
- default: ''
|
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: '',
|
|
},
|
|
},
|
|
contractId: {
|
|
contractId: {
|
|
- type: [String,Number],
|
|
|
|
- default: ''
|
|
|
|
- }
|
|
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: '',
|
|
|
|
+ },
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+const eimt = defineEmits('changeTips')
|
|
//变量
|
|
//变量
|
|
-const projectId = ref(props.projectId);
|
|
|
|
-const contractId = ref(props.contractId);
|
|
|
|
|
|
+const projectId = ref(props.projectId)
|
|
|
|
+const totalInspectRatio = ref('')
|
|
|
|
+const tips = ref('')
|
|
|
|
|
|
//渲染完成
|
|
//渲染完成
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
-
|
|
|
|
|
|
+ getTableData()
|
|
})
|
|
})
|
|
|
|
|
|
//表格数据
|
|
//表格数据
|
|
const isLoading = ref(false)
|
|
const isLoading = ref(false)
|
|
const tableData = ref([
|
|
const tableData = ref([
|
|
- {name: '业主组', num1: 1786, num2: 210, num5: 2, num3: '12%', num4: '54%'},
|
|
|
|
- {name: '监理组', num1: 899, num2: 145, num5: 1, num3: '12%', num4: '54%'},
|
|
|
|
- {name: '施工组', num1: 3123, num2: 432, num5: 0, num3: '12%', num4: '54%'},
|
|
|
|
- {name: '声像组', num1: 226, num2: 11, num5: 0, num3: '12%', num4: '54%'},
|
|
|
|
- {name: '竣工图组', num1: 145, num2: 76, num5: 0, num3: '12%', num4: '54%'},
|
|
|
|
|
|
+ { name: '业主组', num1: 1786, num2: 210, num5: 2, num3: '12%', num4: '54%' },
|
|
|
|
+ { name: '监理组', num1: 899, num2: 145, num5: 1, num3: '12%', num4: '54%' },
|
|
|
|
+ { name: '施工组', num1: 3123, num2: 432, num5: 0, num3: '12%', num4: '54%' },
|
|
|
|
+ { name: '声像组', num1: 226, num2: 11, num5: 0, num3: '12%', num4: '54%' },
|
|
|
|
+ { name: '竣工图组', num1: 145, num2: 76, num5: 0, num3: '12%', num4: '54%' },
|
|
])
|
|
])
|
|
|
|
+const getTableData = async () => {
|
|
|
|
+ isLoading.value = true
|
|
|
|
+ const { error, code, data } = await initialgApi.projectInspectStat({
|
|
|
|
+
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ })
|
|
|
|
+ isLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ tableData.value = getArrValue(data['list'])
|
|
|
|
+ totalInspectRatio.value = data['totalInspectRatio']
|
|
|
|
+ tips.value = data['tips']
|
|
|
|
+ eimt('changeTips', tips.value)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ tableData.value = []
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
+}
|
|
//处理合并
|
|
//处理合并
|
|
-const objectSpanMethod = ({rowIndex, columnIndex}) => {
|
|
|
|
|
|
+const objectSpanMethod = ({ rowIndex, columnIndex }) => {
|
|
if (columnIndex === 5) {
|
|
if (columnIndex === 5) {
|
|
if (rowIndex === 0) {
|
|
if (rowIndex === 0) {
|
|
return {
|
|
return {
|
|
rowspan: 5,
|
|
rowspan: 5,
|
|
- colspan: 1
|
|
|
|
|
|
+ colspan: 1,
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
return {
|
|
return {
|
|
rowspan: 0,
|
|
rowspan: 0,
|
|
- colspan: 0
|
|
|
|
|
|
+ colspan: 0,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|