2023-06-19 15:37:14 +08:00
|
|
|
<template>
|
2023-06-20 19:58:03 +08:00
|
|
|
<div class="table-box">
|
|
|
|
|
<div class="table">
|
|
|
|
|
<ProTable
|
|
|
|
|
ref="proTable"
|
|
|
|
|
title="考勤设备列表"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:requestApi="getTableList"
|
|
|
|
|
:dataCallback="dataCallback"
|
|
|
|
|
:tool-button="false"
|
|
|
|
|
:pagination="true"
|
|
|
|
|
background
|
|
|
|
|
:isShowSearch="false"
|
|
|
|
|
:onReset="true"
|
|
|
|
|
>
|
|
|
|
|
<!-- <template #formButton="scope">
|
|
|
|
|
<el-button class="addButtonStyle" @click="handleAddItem">新增</el-button>
|
|
|
|
|
</template> -->
|
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
<el-button type="primary" link @click="handleLookItem(row)">
|
|
|
|
|
<img src="@/assets/images/tableIcon/look.png" alt="" class="configureIcon" />
|
|
|
|
|
<span>查看</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #state="{ row }">
|
|
|
|
|
<span>{{
|
|
|
|
|
row.state == 1
|
|
|
|
|
? "执法中"
|
|
|
|
|
: row.state == 2
|
|
|
|
|
? "待整改"
|
|
|
|
|
: row.state == 3
|
|
|
|
|
? "待审核"
|
|
|
|
|
: row.state == 4
|
|
|
|
|
? "已闭合"
|
|
|
|
|
: row.state == 5
|
|
|
|
|
? "已驳回"
|
|
|
|
|
: ""
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</ProTable>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 执法单信息 -->
|
|
|
|
|
<transformInfo v-model:detailsDialog="detailsDialog" :relativeId="relativeId" @confirm="allConfirm"></transformInfo>
|
|
|
|
|
<!-- 执法单新增 -->
|
|
|
|
|
<orderAdd v-model:orderDialog="orderDialog" @confirm="allConfirm"></orderAdd>
|
|
|
|
|
</div>
|
2023-06-19 15:37:14 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="tsx" name="ProjectSupervisionRecord">
|
2023-06-20 19:58:03 +08:00
|
|
|
import { ref, reactive, nextTick, onMounted } from "vue";
|
|
|
|
|
import { ElMessage, ElMessageBox, ElTree, FormInstance } from "element-plus";
|
|
|
|
|
import { ColumnProps } from "@/components/ProTable/interface";
|
|
|
|
|
import ProTable from "@/components/ProTable/index.vue";
|
|
|
|
|
import transformInfo from "./components/transformInfo.vue";
|
|
|
|
|
import orderAdd from "./components/orderAdd.vue";
|
|
|
|
|
import { statisticsInfo, statisticsTable } from "@/api/modules/goverment";
|
|
|
|
|
const statisticsOption = ref([
|
|
|
|
|
{
|
|
|
|
|
name: "累计下达整改单",
|
|
|
|
|
value: 0,
|
|
|
|
|
img: new URL("@/assets/images/govermentImg/整改单.png", import.meta.url).href,
|
|
|
|
|
prop: "inspectNum"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "累计下达停工单",
|
|
|
|
|
value: 0,
|
|
|
|
|
img: new URL("@/assets/images/govermentImg/停工单.png", import.meta.url).href,
|
|
|
|
|
prop: "shutdownNum"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "累计问题数",
|
|
|
|
|
value: 0,
|
|
|
|
|
img: new URL("@/assets/images/govermentImg/问题数.png", import.meta.url).href,
|
|
|
|
|
prop: "questionNum"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "累计闭合问题数",
|
|
|
|
|
value: 0,
|
|
|
|
|
img: new URL("@/assets/images/govermentImg/闭合问题数.png", import.meta.url).href,
|
|
|
|
|
prop: "solveNum"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "总检查次数",
|
|
|
|
|
value: 0,
|
|
|
|
|
img: new URL("@/assets/images/govermentImg/总检查次数.png", import.meta.url).href,
|
|
|
|
|
prop: "recordNum"
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
// 表格配置项
|
|
|
|
|
const columns: ColumnProps[] = [
|
|
|
|
|
{ type: "index", label: "序号", width: 80 },
|
|
|
|
|
{
|
|
|
|
|
prop: "engineeringName",
|
|
|
|
|
label: "工程名称",
|
|
|
|
|
search: { el: "input" }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "inspectUserName",
|
|
|
|
|
label: "监督员"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "createTime",
|
|
|
|
|
label: "检查时间"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "buildEnt",
|
|
|
|
|
label: "建设单位"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "supervisorEnt",
|
|
|
|
|
label: "监理单位"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "opEnt",
|
|
|
|
|
label: "施工单位"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "surveyEnt",
|
|
|
|
|
label: "勘察单位"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "designEnt",
|
|
|
|
|
label: "设计单位"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "state",
|
|
|
|
|
label: "状态"
|
|
|
|
|
},
|
|
|
|
|
{ prop: "operation", label: "操作", fixed: "right", width: 260 }
|
|
|
|
|
];
|
|
|
|
|
const detailsDialog = ref(false);
|
|
|
|
|
const orderDialog = ref(false);
|
|
|
|
|
const relativeId = ref("");
|
|
|
|
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
|
|
|
|
const proTable = ref();
|
|
|
|
|
// 新增执法单
|
|
|
|
|
const handleAddItem = () => {
|
|
|
|
|
orderDialog.value = true;
|
|
|
|
|
};
|
|
|
|
|
// 全部审核完成
|
|
|
|
|
const allConfirm = () => {
|
|
|
|
|
proTable.value.getTableList();
|
|
|
|
|
};
|
|
|
|
|
const handleLookItem = row => {
|
|
|
|
|
console.log(row);
|
|
|
|
|
relativeId.value = row.id;
|
|
|
|
|
detailsDialog.value = true;
|
|
|
|
|
};
|
|
|
|
|
const getTableList = (params: any) => {
|
|
|
|
|
let newParams = JSON.parse(JSON.stringify(params));
|
|
|
|
|
console.log(newParams);
|
|
|
|
|
if (newParams.createTime) {
|
|
|
|
|
newParams.createTime_begin = newParams.createTime[0];
|
|
|
|
|
newParams.createTime_end = newParams.createTime[1];
|
|
|
|
|
delete newParams.createTime;
|
|
|
|
|
}
|
|
|
|
|
newParams.type = 2;
|
|
|
|
|
return statisticsTable(newParams);
|
|
|
|
|
};
|
|
|
|
|
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total && pageNum && pageSize 这些字段,那么你可以在这里进行处理成这些字段
|
|
|
|
|
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
|
|
|
|
const dataCallback = (data: any) => {
|
|
|
|
|
// console.log(data);
|
|
|
|
|
return {
|
|
|
|
|
list: data.records,
|
|
|
|
|
total: Number(data.total),
|
|
|
|
|
pageNo: Number(data.current),
|
|
|
|
|
pageSize: Number(data.size)
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
// 获取顶部统计信息
|
|
|
|
|
const getInfo = async () => {
|
|
|
|
|
const res = await statisticsInfo({ type: 2 });
|
|
|
|
|
statisticsOption.value.map(item => {
|
|
|
|
|
item.value = res.result[item.prop];
|
|
|
|
|
});
|
|
|
|
|
console.log(res);
|
|
|
|
|
};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getInfo();
|
|
|
|
|
});
|
2023-06-19 15:37:14 +08:00
|
|
|
</script>
|
2023-06-20 19:58:03 +08:00
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.table-box {
|
2023-07-02 11:50:09 +08:00
|
|
|
height: 100%;
|
2023-06-20 19:58:03 +08:00
|
|
|
.table {
|
2023-07-02 11:50:09 +08:00
|
|
|
height: 100%;
|
2023-06-20 19:58:03 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 500;
|
2023-07-02 11:50:09 +08:00
|
|
|
.table-main {
|
|
|
|
|
height: calc(100% - 100px);
|
|
|
|
|
}
|
2023-06-20 19:58:03 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|