<template>
|
<BaseProdProcess
|
v-model:active="active"
|
@onStep1="onStep1"
|
@onStep2="onStep2"
|
@onStep3="onStep3"
|
:loading="loading"
|
>
|
<template #step1="{ onSearch }">
|
<ProdQueryOptWithMode :loading="loading" @submit="onSearch"></ProdQueryOptWithMode>
|
</template>
|
<template #step2="{ contentHeight }">
|
<el-table
|
id="prod-inspection-table"
|
:data="tableData"
|
v-loading="loading"
|
:height="contentHeight + 'px'"
|
table-layout="fixed"
|
:show-overflow-tooltip="true"
|
size="small"
|
border
|
>
|
<el-table-column fixed="left" prop="index" label="编号" width="50"> </el-table-column>
|
<el-table-column
|
fixed="left"
|
prop="subTask.scensename"
|
label="名称"
|
:show-overflow-tooltip="true"
|
min-width="200"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="subTask.planstarttime"
|
label="巡查时间"
|
:formatter="timeFormat"
|
width="90"
|
/>
|
<!-- <el-table-column prop="provincename" label="省" width="90" />
|
<el-table-column prop="cityname" label="市" width="90" />
|
<el-table-column prop="districtname" label="区县" width="90" /> -->
|
<el-table-column prop="subTask.townname" label="街道" width="80" />
|
<el-table-column prop="problems.length" label="问题数" width="60" />
|
<el-table-column label="问题摘要" width="300">
|
<template #default="{ row }">
|
<template v-for="(value, index) in row.problems" :key="value.guid">
|
<br v-if="index > 0" />{{ index + 1 + '、' + value.problemname }}
|
</template>
|
</template>
|
</el-table-column>
|
<el-table-column prop="unChangeProblems.length" label="未整改数" width="60" />
|
<el-table-column label="未整改问题" width="300">
|
<template #default="{ row }">
|
<template v-for="(value, index) in row.unChangeProblems" :key="value.guid">
|
<br v-if="index > 0" />{{ index + 1 + '、' + value.problemname }}
|
</template>
|
</template>
|
</el-table-column>
|
<!-- <el-table-column
|
prop="evaluate.updatedate"
|
label="更新时间"
|
width="140"
|
:formatter="timeFormat"
|
/> -->
|
</el-table>
|
</template>
|
</BaseProdProcess>
|
</template>
|
<script setup>
|
import { ref, inject } from 'vue'
|
import dayjs from 'dayjs'
|
import BaseProdProcess from './components/BaseProdProcess.vue'
|
import dataprodbaseApi from '@/api/fysp/dataprodbaseApi.js'
|
import { conversionFromTable } from '@/utils/excel'
|
import { useProdStepChange } from './prod-step-change.js'
|
import ProdQueryOptWithMode from './components/ProdQueryOptWithMode.vue'
|
|
const { active, changeActive } = useProdStepChange()
|
const loading = ref(false)
|
const tableData = ref([])
|
|
function onStep1(opt) {
|
loading.value = true
|
dataprodbaseApi
|
.fetchProdInspectionInfo(opt)
|
.then((res) => {
|
if (res.success) {
|
tableData.value = res.data.map((item) => {
|
return {
|
...item,
|
unChangeProblems: item.problems.filter((p) => !p.ischanged),
|
}
|
})
|
}
|
changeActive()
|
})
|
.finally(() => {
|
loading.value = false
|
})
|
}
|
|
function onStep2() {
|
changeActive()
|
}
|
|
function onStep3(val) {
|
if (val.downloadType == '1') {
|
loading.value = true
|
conversionFromTable('prod-inspection-table', '整改清单')
|
loading.value = false
|
}
|
}
|
|
function timeFormat(row, column, cellValue, index) {
|
return dayjs(cellValue).format('YYYY-MM-DD')
|
}
|
</script>
|