|
@@ -8,14 +8,14 @@
|
|
|
v-model="listQuery.deviceName"
|
|
v-model="listQuery.deviceName"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
clearable
|
|
clearable
|
|
|
- @clear="getList"
|
|
|
|
|
|
|
+ @clear="handleChangeFilter"
|
|
|
placeholder="请选择设备名称"
|
|
placeholder="请选择设备名称"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in list"
|
|
|
|
|
|
|
+ v-for="item in groupList"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
- :label="item.deviceName"
|
|
|
|
|
- :value="item.deviceName"
|
|
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.name"
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
@@ -28,7 +28,7 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
placeholder="请输入卡号"
|
|
placeholder="请输入卡号"
|
|
|
clearable
|
|
clearable
|
|
|
- @clear="getList"
|
|
|
|
|
|
|
+ @clear="handleChangeFilter"
|
|
|
@keyup.enter.native="handleFilter"
|
|
@keyup.enter.native="handleFilter"
|
|
|
>
|
|
>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -41,7 +41,7 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
placeholder="请输入姓名"
|
|
placeholder="请输入姓名"
|
|
|
clearable
|
|
clearable
|
|
|
- @clear="getList"
|
|
|
|
|
|
|
+ @clear="handleChangeFilter"
|
|
|
@keyup.enter.native="handleFilter"
|
|
@keyup.enter.native="handleFilter"
|
|
|
>
|
|
>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -55,6 +55,7 @@
|
|
|
start-placeholder="开始时间"
|
|
start-placeholder="开始时间"
|
|
|
end-placeholder="结束时间"
|
|
end-placeholder="结束时间"
|
|
|
value-format="timestamp"
|
|
value-format="timestamp"
|
|
|
|
|
+ @change="handleChangeFilter($event)"
|
|
|
>
|
|
>
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
|
|
|
|
@@ -130,7 +131,7 @@
|
|
|
:total="total"
|
|
:total="total"
|
|
|
:page.sync="listQuery.page"
|
|
:page.sync="listQuery.page"
|
|
|
:limit.sync="listQuery.limit"
|
|
:limit.sync="listQuery.limit"
|
|
|
- @pagination="getListTotalPage"
|
|
|
|
|
|
|
+ @pagination="getList"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
@@ -140,7 +141,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import Pagination from "@/components/Pagination";
|
|
import Pagination from "@/components/Pagination";
|
|
|
-import { fetchList, searchList } from "@/api/accessrecords";
|
|
|
|
|
|
|
+import { fetchList, searchList, fetchGroupList } from "@/api/accessrecords";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
Pagination,
|
|
Pagination,
|
|
@@ -148,6 +149,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
list: [],
|
|
list: [],
|
|
|
|
|
+ groupList: [],
|
|
|
total: 0, //数据的总数//
|
|
total: 0, //数据的总数//
|
|
|
listQuery: {
|
|
listQuery: {
|
|
|
page: 1,
|
|
page: 1,
|
|
@@ -164,48 +166,93 @@ export default {
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
|
|
+ this.getgroupList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getList() {
|
|
getList() {
|
|
|
- fetchList({
|
|
|
|
|
- page: this.listQuery.page,
|
|
|
|
|
- limit: this.listQuery.limit,
|
|
|
|
|
- }).then((response) => {
|
|
|
|
|
- this.list = response.data;
|
|
|
|
|
- this.total = response.total;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- getListTotalPage() {
|
|
|
|
|
- //获取分页数据
|
|
|
|
|
if (
|
|
if (
|
|
|
|
|
+ this.listQuery.cardNumber ||
|
|
|
this.listQuery.deviceName ||
|
|
this.listQuery.deviceName ||
|
|
|
this.listQuery.userName ||
|
|
this.listQuery.userName ||
|
|
|
- this.listQuery.cardNumber ||
|
|
|
|
|
this.listQuery.time
|
|
this.listQuery.time
|
|
|
) {
|
|
) {
|
|
|
- this.handleFilter();
|
|
|
|
|
|
|
+ searchList(this.listQuery).then((response) => {
|
|
|
|
|
+ this.list = response.data;
|
|
|
|
|
+ this.total = response.total;
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ fetchList({
|
|
|
|
|
+ page: this.listQuery.page,
|
|
|
|
|
+ limit: this.listQuery.limit,
|
|
|
|
|
+ }).then((response) => {
|
|
|
|
|
+ this.list = response.data;
|
|
|
|
|
+ this.total = response.total;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getgroupList() {
|
|
|
|
|
+ fetchGroupList({ page: this.listQuery.page, limit: "999" }).then(
|
|
|
|
|
+ (response) => {
|
|
|
|
|
+ this.groupList = response.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
refreshGetList() {
|
|
refreshGetList() {
|
|
|
//刷新页面
|
|
//刷新页面
|
|
|
this.$router.go(0);
|
|
this.$router.go(0);
|
|
|
},
|
|
},
|
|
|
|
|
+ handleChangeFilter(e) {
|
|
|
|
|
+ if (e == null) {
|
|
|
|
|
+ // 清空时间
|
|
|
|
|
+ if (
|
|
|
|
|
+ !this.listQuery.userName &&
|
|
|
|
|
+ !this.listQuery.cardNumber &&
|
|
|
|
|
+ !this.listQuery.deviceName &&
|
|
|
|
|
+ !this.listQuery.time
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ searchList({
|
|
|
|
|
+ page: this.listQuery.page,
|
|
|
|
|
+ limit: this.listQuery.limit,
|
|
|
|
|
+ cardNumber: this.listQuery.cardNumber,
|
|
|
|
|
+ deviceName: this.listQuery.deviceName,
|
|
|
|
|
+ time1: this.listQuery.time === null ? null : this.listQuery.time[0],
|
|
|
|
|
+ time2: this.listQuery.time === null ? null : this.listQuery.time[1],
|
|
|
|
|
+ userName: this.listQuery.userName,
|
|
|
|
|
+ }).then((response) => {
|
|
|
|
|
+ this.list = response.data;
|
|
|
|
|
+ this.total = response.total;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 设置时间
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
handleFilter() {
|
|
handleFilter() {
|
|
|
//搜索数据
|
|
//搜索数据
|
|
|
- searchList({
|
|
|
|
|
- page: this.listQuery.page,
|
|
|
|
|
- limit: this.listQuery.limit,
|
|
|
|
|
- cardNumber: this.listQuery.cardNumber,
|
|
|
|
|
- deviceName: this.listQuery.deviceName,
|
|
|
|
|
- time1: this.listQuery.time[0],
|
|
|
|
|
- time2: this.listQuery.time[1],
|
|
|
|
|
- userName: this.listQuery.userName,
|
|
|
|
|
- }).then((response) => {
|
|
|
|
|
- this.list = response.data;
|
|
|
|
|
- this.total = response.total;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ !this.listQuery.userName &&
|
|
|
|
|
+ !this.listQuery.cardNumber &&
|
|
|
|
|
+ !this.listQuery.deviceName &&
|
|
|
|
|
+ !this.listQuery.time
|
|
|
|
|
+ ) {
|
|
|
|
|
+ alert("请输入搜索条件");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ searchList({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ limit: this.listQuery.limit,
|
|
|
|
|
+ cardNumber: this.listQuery.cardNumber,
|
|
|
|
|
+ deviceName: this.listQuery.deviceName,
|
|
|
|
|
+ time1: this.listQuery.time === null ? null : this.listQuery.time[0],
|
|
|
|
|
+ time2: this.listQuery.time === null ? null : this.listQuery.time[1],
|
|
|
|
|
+ userName: this.listQuery.userName,
|
|
|
|
|
+ }).then((response) => {
|
|
|
|
|
+ this.list = response.data;
|
|
|
|
|
+ this.total = response.total;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.listQuery.page = 1;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
timestampToTime(time) {
|
|
timestampToTime(time) {
|
|
|
//格式化时间
|
|
//格式化时间
|
|
@@ -243,30 +290,30 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.form-head {
|
|
.form-head {
|
|
|
margin: 0 40px;
|
|
margin: 0 40px;
|
|
|
- width: 1504px;
|
|
|
|
|
|
|
+ width: 1380px;
|
|
|
line-height: 118px;
|
|
line-height: 118px;
|
|
|
font-size: 9px;
|
|
font-size: 9px;
|
|
|
|
|
|
|
|
.input {
|
|
.input {
|
|
|
display: inline-block;
|
|
display: inline-block;
|
|
|
- margin-right: 30px;
|
|
|
|
|
|
|
+ margin-right: 10px;
|
|
|
width: 210px;
|
|
width: 210px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.input-select {
|
|
.input-select {
|
|
|
display: inline-block;
|
|
display: inline-block;
|
|
|
- margin-right: 29px;
|
|
|
|
|
|
|
+ margin-right: 10px;
|
|
|
width: 148px;
|
|
width: 148px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.button {
|
|
.button {
|
|
|
- margin-left: 41px;
|
|
|
|
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.form {
|
|
.form {
|
|
|
margin-left: 40px;
|
|
margin-left: 40px;
|
|
|
- width: 1480px;
|
|
|
|
|
|
|
+ width: 1400px;
|
|
|
|
|
|
|
|
.button-img {
|
|
.button-img {
|
|
|
img {
|
|
img {
|