|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="main">
|
|
|
<div class="search">
|
|
|
- <el-input placeholder="车位号" class="search-input"></el-input>
|
|
|
- <el-select v-model="communityName" placeholder="请选择社区名称" @change="communityChoice">
|
|
|
+ <el-input v-model="query.garageName" placeholder="车位号" class="search-input"></el-input>
|
|
|
+ <el-select v-model="query.communityName" placeholder="请选择社区名称">
|
|
|
<el-option label="清空" value=""></el-option>
|
|
|
<el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
@@ -11,7 +11,7 @@
|
|
|
</el-button>
|
|
|
<div class="search-icon">
|
|
|
<!-- 删除 新增 -->
|
|
|
-<!-- <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除"></i>-->
|
|
|
+ <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除"></i>
|
|
|
<i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增"></i>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -28,7 +28,7 @@
|
|
|
<template slot-scope="scope" slot="opt">
|
|
|
<i @click="addOrEdit('edit', scope)" class="iconfont" style="color:#2787F1;margin-right:30px" v-txt-tip data-txt="编辑"></i>
|
|
|
<i @click="deleteOne(scope.row.id)" class="iconfont" style="color:#FF7272;margin-right:30px;" v-txt-tip data-txt="删除"></i>
|
|
|
- <i @click="partitionManagement" class="iconfont" style="color:#2787F1;" v-txt-tip data-txt="分区管理"></i>
|
|
|
+ <i @click="partitionManagement(scope)" class="iconfont" style="color:#2787F1;" v-txt-tip data-txt="分区管理"></i>
|
|
|
</template>
|
|
|
</zz-table>
|
|
|
</div>
|
|
@@ -36,14 +36,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import list from '@utils/list.js';
|
|
|
export default {
|
|
|
+ mixins: [list],
|
|
|
data() {
|
|
|
return {
|
|
|
parkingNumber:'',
|
|
|
communityList:[],//社区名称下拉列表
|
|
|
- communityName:'',//社区名称
|
|
|
communityId:'',//社区id
|
|
|
selectName: 'parkingLot',
|
|
|
+ query:{
|
|
|
+ communityName:'',//社区名称
|
|
|
+ garageName:'',//车库名称
|
|
|
+ },
|
|
|
cols: [
|
|
|
{
|
|
|
label: '所属社区',
|
|
@@ -64,6 +69,7 @@
|
|
|
}
|
|
|
],
|
|
|
// tableData: []
|
|
|
+ selectRow: [],
|
|
|
};
|
|
|
},
|
|
|
props:{
|
|
@@ -71,6 +77,10 @@
|
|
|
type: Array,
|
|
|
default: "",
|
|
|
},
|
|
|
+ tableTotal:{
|
|
|
+ type:Number,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
//获取社区名称下拉列表
|
|
@@ -87,6 +97,35 @@
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ mixins_search(){
|
|
|
+ console.log(this.query.communityName)
|
|
|
+ this.communityId=this.query.communityName
|
|
|
+ this.garageLotList();
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取列表数据
|
|
|
+ garageLotList(){
|
|
|
+ let submitData={
|
|
|
+ "communityId":this.communityId,
|
|
|
+ "garageName":this.query.garageName,
|
|
|
+ "pageNum": 1,
|
|
|
+ "pageSize": 10
|
|
|
+ }
|
|
|
+ this.$http.post('/sc-community/assets/garage/page', submitData).then(res=> {
|
|
|
+ this.tableData=res.data.list;
|
|
|
+ this.mixins_pageset = {
|
|
|
+ total:parseInt(res.data.total),
|
|
|
+ // pageNum: this.mixins_pageset.pageNum,
|
|
|
+ // pageSize: this.mixins_pageset.pageSize
|
|
|
+ };
|
|
|
+ this.mixins_onQuery=false;
|
|
|
+ // this.mixins_list=data.data.list;
|
|
|
+ // this.mixins_onQuery=false;
|
|
|
+ }).catch(function () {
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
addOrEdit(todo, scope) {
|
|
|
let self=this;
|
|
|
new Promise((resolve) => {
|
|
@@ -94,34 +133,39 @@
|
|
|
title = '编辑车库';
|
|
|
if ('add' == todo) {
|
|
|
title = '新增车库';
|
|
|
+ this.addEditPopUps(title,row,todo)
|
|
|
} else {
|
|
|
this.$http.get('/sc-community-web/assets/garage/find/'+scope.row.id, {}).then((res) => {
|
|
|
// sessionStorage.setItem('communityInformation',JSON.stringify(data))
|
|
|
row=res.data;
|
|
|
+ this.addEditPopUps(title,row,todo)
|
|
|
});
|
|
|
}
|
|
|
- setTimeout(function(){
|
|
|
- self.$store.dispatch('openModal', {
|
|
|
- url: '/parkingLotAdministration/pageJump/garageSaveEdits.vue',
|
|
|
- title: title,
|
|
|
- width: '850px',
|
|
|
- height: '600px',
|
|
|
- props: {
|
|
|
- data: row,
|
|
|
- todo: todo,
|
|
|
- callback: self.mixins_search
|
|
|
- }
|
|
|
- });
|
|
|
- },1000)
|
|
|
|
|
|
}).then(() => {
|
|
|
this.mixins_search();
|
|
|
});
|
|
|
},
|
|
|
+ addEditPopUps(title,row,todo){
|
|
|
+ this.$store.dispatch('openModal', {
|
|
|
+ url: '/parkingLotAdministration/pageJump/garageSaveEdits.vue',
|
|
|
+ title: title,
|
|
|
+ width: '850px',
|
|
|
+ height: '600px',
|
|
|
+ props: {
|
|
|
+ data: row,
|
|
|
+ todo: todo,
|
|
|
+ callback: this.mixins_search
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
//分区管理
|
|
|
- partitionManagement(){
|
|
|
- this.$router.push('/parkingLotAdministration/pageJump/partitionManagement')
|
|
|
+ partitionManagement(scope){
|
|
|
+ sessionStorage.setItem('communityId',scope.row.communityId);
|
|
|
+ sessionStorage.setItem('garageId',scope.row.id);
|
|
|
+ this.$router.push({ name: '/parkingLotAdministration/pageJump/partitionManagement'})
|
|
|
+
|
|
|
},
|
|
|
//单个删除
|
|
|
deleteOne(ids) {
|
|
@@ -146,9 +190,46 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ deleteRow() {
|
|
|
+ // 获取选中列表的ids
|
|
|
+ let ids = [];
|
|
|
+ if (!this.selectRow.length) {
|
|
|
+ this.$message.error('您尚未选择要删除的记录,请选择后再操作批量删除');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.selectRow.forEach((v) => {
|
|
|
+ ids.push(v.id);
|
|
|
+ });
|
|
|
+ this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
|
|
|
+ .then((_) => {
|
|
|
+ this.$http.post('/sc-community-web/assets/garage/delete', ids).then(({ status, data, msg }) => {
|
|
|
+ if (0 === status) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ this.mixins_search();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ selectionChange(val){
|
|
|
+ this.selectRow = val;
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.communityNameList();
|
|
|
+ this.mixins_onQuery=false;
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ tableTotal(item) {
|
|
|
+ this.mixins_pageset = {
|
|
|
+ total:item,
|
|
|
+ // pageNum: this.mixins_pageset.pageNum,
|
|
|
+ // pageSize: this.mixins_pageset.pageSize
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|