|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
- <div class="app-container"><el-row :gutter="20">
|
|
|
+ <div class="app-container">
|
|
|
+ <el-row :gutter="20">
|
|
|
<!--地址数据-->
|
|
|
- <el-col :span="4" :xs="24">
|
|
|
+ <el-col :span="4" :xs="24" class="treeBox">
|
|
|
<div class="head-container">
|
|
|
<el-input
|
|
|
v-model="addrName"
|
|
@@ -19,7 +20,7 @@
|
|
|
:expand-on-click-node="false"
|
|
|
:filter-node-method="filterNode"
|
|
|
ref="tree"
|
|
|
- default-expand-all
|
|
|
+ :accordion="true"
|
|
|
highlight-current
|
|
|
@node-click="handleNodeClick"
|
|
|
/>
|
|
@@ -27,34 +28,60 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="20" :xs="24">
|
|
|
- <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="任务名称" align="center" prop="name" />
|
|
|
- <el-table-column label="应检" align="center" prop="buildingNumber" />
|
|
|
- <el-table-column label="已检" align="center" prop="buildingNumber" />
|
|
|
- <el-table-column label="未检" align="center" prop="buildingNumber" />
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </el-col>
|
|
|
+ <div>
|
|
|
+ <el-select v-model="queryParams.natTaskId" @change="getList" placeholder="请选择任务">
|
|
|
+ <el-option
|
|
|
+ v-for="item in taskList"
|
|
|
+ :key="item.natTaskId"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.natTaskId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-tag style="margin: 0 0 20px 20px">应检:{{ num && num.totalCount }}</el-tag>
|
|
|
+ <el-tag style="margin: 0 20px 20px 20px" type="success">已检:{{ num && num.detectedCount }}</el-tag>
|
|
|
+ <el-tag type="danger">未检: {{ num && num.undetectedCount }}</el-tag>
|
|
|
+ </div>
|
|
|
+ <el-tabs type="card" @tab-click="tabClick" v-model="isName">
|
|
|
+ <el-tab-pane label="已检" name="1"></el-tab-pane>
|
|
|
+ <el-tab-pane label="未检" name="0"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="logList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column label="姓名" align="center" prop="name" />
|
|
|
+ <el-table-column label="手机号" align="center" prop="phone" />
|
|
|
+ <el-table-column label="是否代领" align="center" prop="entrusted" />
|
|
|
+ <el-table-column label="小区" align="center" prop="estateName" />
|
|
|
+ <el-table-column label="楼栋" align="center" prop="buildingNumber" />
|
|
|
+ <el-table-column label="单元" align="center" prop="unit" />
|
|
|
+ <el-table-column label="楼层" align="center" prop="floor" />
|
|
|
+ <el-table-column label="门牌" align="center" prop="number" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { addrTreeSelect } from "@/api/community/addr";
|
|
|
-import { listLog, getLog, delLog, addLog, updateLog } from "@/api/community/log";
|
|
|
+import { addrTreeSelect } from "@/api/community/addr";
|
|
|
+import { getrealtime, getrealtimenum, listTask } from "@/api/community/task";
|
|
|
|
|
|
export default {
|
|
|
name: "Log",
|
|
|
data() {
|
|
|
return {
|
|
|
+ num: {},
|
|
|
defaultProps: {},
|
|
|
// 地址树选项
|
|
|
addrOptions: undefined,
|
|
@@ -70,39 +97,39 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- natTaskId: null,
|
|
|
- residentId: null,
|
|
|
- name: null,
|
|
|
- houseId: null,
|
|
|
- buildingNumber: null,
|
|
|
- estateName: null,
|
|
|
- gridName: null,
|
|
|
- communityName: null,
|
|
|
- phone: null,
|
|
|
- status: null,
|
|
|
},
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ isName: '1',
|
|
|
+ loading: false,
|
|
|
+ taskList: []
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getList();
|
|
|
- this.getAddrTree();
|
|
|
+ async created() {
|
|
|
+ const res = await listTask();
|
|
|
+ this.taskList = res.rows;
|
|
|
+ await this.getAddrTree();
|
|
|
},
|
|
|
watch: {
|
|
|
// 根据名称筛选地址树
|
|
|
addrName(val) {
|
|
|
this.$refs.tree.filter(val);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
- /** 查询地址下拉树结构 */
|
|
|
+ init() {
|
|
|
+ this.queryParams.detectStatus = 1;
|
|
|
+ this.queryParams.natTaskId = this.taskList[0]?.natTaskId;
|
|
|
+ this.handleNodeClick(this.addrOptions[0]);
|
|
|
+ },
|
|
|
+ // 点击标签
|
|
|
+ tabClick(e) {
|
|
|
+ this.queryParams.detectStatus = e.name;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 查询地址下拉树结构 */
|
|
|
getAddrTree() {
|
|
|
- addrTreeSelect(this.queryParams).then(response => {
|
|
|
+ addrTreeSelect().then((response) => {
|
|
|
this.addrOptions = response.data;
|
|
|
+ this.init()
|
|
|
});
|
|
|
},
|
|
|
// 节点单击事件
|
|
@@ -120,37 +147,38 @@ export default {
|
|
|
/** 查询检测日志管理列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listLog(this.queryParams).then(response => {
|
|
|
- this.logList = response.rows;
|
|
|
+ const { addrType, addrInterId, natTaskId } = this.queryParams;
|
|
|
+ getrealtimenum({ addrType, addrInterId, natTaskId }).then((response) => {
|
|
|
+ this.num = response.data;
|
|
|
+ });
|
|
|
+ getrealtime(this.queryParams).then((response) => {
|
|
|
+ this.logList = response.rows.map(e => {
|
|
|
+ e.entrusted = e.entrusted == 0 ? '否' : '是'
|
|
|
+ return e;
|
|
|
+ });
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- natLogId: null,
|
|
|
- natTaskId: null,
|
|
|
- residentId: null,
|
|
|
- name: null,
|
|
|
- houseId: null,
|
|
|
- buildingNumber: null,
|
|
|
- estateName: null,
|
|
|
- gridName: null,
|
|
|
- communityName: null,
|
|
|
- phone: null,
|
|
|
- createTime: null,
|
|
|
- status: "0",
|
|
|
- remark: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.natLogId)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.natLogId);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
+<style scoped>
|
|
|
+.treeBox {
|
|
|
+ height: 80vh;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+::-webkit-scrollbar {
|
|
|
+ width: 1px;
|
|
|
+ background-color: skyblue;
|
|
|
+}
|
|
|
+::-webkit-scrollbar-thumb {
|
|
|
+ background-color: orange;
|
|
|
+}
|
|
|
+</style>
|