|
@@ -1,105 +1,130 @@
|
|
|
<template>
|
|
|
<div class="default-main ">
|
|
|
- <div style="display: flex;justify-content: space-between;background: #ffffff;padding: 20px 20px">
|
|
|
+ <div style="display: flex;justify-content: space-between;background: #ffffff;padding: 20px">
|
|
|
<div style="display: flex;align-items: center">
|
|
|
- <span>区县:</span>
|
|
|
- <el-select v-model="districtId" placeholder="请选择区县" style="width: 150px;margin-right: 10px" @change="selectDstrict"
|
|
|
- :clearable="true">
|
|
|
- <el-option v-for="item in districtList" :label="item.districtName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- <span>小区:</span>
|
|
|
- <el-select v-model="communityId" placeholder="请选择小区" style="width: 150px;margin-right: 10px"
|
|
|
- @change="selectCommunity" :clearable="true">
|
|
|
- <el-option v-for="item in communityList" :label="item.communityName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- <span>楼号:</span>
|
|
|
- <el-select v-model="buildingId" placeholder="请选择楼号" style="width: 150px;margin-right: 10px" @change="selectBuilding"
|
|
|
- :clearable="true">
|
|
|
- <el-option v-for="item in buildingList" :label="item.buildingNumber" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <!-- <span>区县:</span>-->
|
|
|
+ <!-- <el-select v-model="districtId" placeholder="请选择区县" style="width: 150px;margin-right: 10px"-->
|
|
|
+ <!-- @change="selectDstrict"-->
|
|
|
+ <!-- :clearable="true">-->
|
|
|
+ <!-- <el-option v-for="item in districtList" :label="item.districtName" :value="item.id"></el-option>-->
|
|
|
+ <!-- </el-select>-->
|
|
|
+ <!-- <span>小区:</span>-->
|
|
|
+ <!-- <el-select v-model="communityId" placeholder="请选择小区" style="width: 150px;margin-right: 10px"-->
|
|
|
+ <!-- @change="selectCommunity" :clearable="true">-->
|
|
|
+ <!-- <el-option v-for="item in communityList" :label="item.communityName" :value="item.id"></el-option>-->
|
|
|
+ <!-- </el-select>-->
|
|
|
+ <!-- <span>楼号:</span>-->
|
|
|
+ <!-- <el-select v-model="buildingId" placeholder="请选择楼号" style="width: 150px;margin-right: 10px"-->
|
|
|
+ <!-- @change="selectBuilding"-->
|
|
|
+ <!-- :clearable="true">-->
|
|
|
+ <!-- <el-option v-for="item in buildingList" :label="item.buildingNumber" :value="item.id"></el-option>-->
|
|
|
+ <!-- </el-select>-->
|
|
|
<el-button v-if="auth('add')" type="primary" :disabled="buildingId == ''"
|
|
|
- @click="openDialog('add')">登记车位</el-button>
|
|
|
+ @click="openDialog('add')">登记车位
|
|
|
+ </el-button>
|
|
|
<el-button v-if="auth('map')" type="primary" :disabled="buildingId == ''"
|
|
|
- @click="parkingMapRef.open(buildingId)">车位绑定</el-button>
|
|
|
+ @click="parkingMapRef.open(buildingId)">车位绑定
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-input v-model="quickSearch" placeholder="通过车位编号模糊检索" @change="getData" clearable></el-input>
|
|
|
+ <el-input v-model="quickSearch" placeholder="通过车位编号模糊检索" @change="getData" clearable></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
- <el-table :data="parkingData" border @row-dblclick="detailDialogRef.open($event)">
|
|
|
- <el-table-column prop="districtName" label="区县"></el-table-column>
|
|
|
- <el-table-column prop="communityName" label="小区"></el-table-column>
|
|
|
- <el-table-column prop="parkingNumber" label="车位编号"></el-table-column>
|
|
|
- <el-table-column prop="parkingType" label="车位类型" width="100">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ row.parkingType == 1 ? '车库' : '车位' }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="售卖类型">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-tag v-if="row.isSale == 1" style="margin: 0 5px;">出售</el-tag>
|
|
|
- <el-tag v-if="row.isHire == 1" style="margin: 0 5px;">出租</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="销售金额" width="100">
|
|
|
- <template #default="{ row }">
|
|
|
- <span v-if="row.isSale == 1" style="margin: 0 5px;">{{ row.salePrice }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="出售状态" width="100">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-tag v-if="row.isSale == 1" :type="row.saleStatus == 1 ? 'info' : 'success'" style="margin: 0 5px;">{{ row.saleStatus
|
|
|
- == 1 ? '已售' : '待售' }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="租金" width="100">
|
|
|
- <template #default="{ row }">
|
|
|
- <span v-if="row.isHire == 1" style="margin: 0 5px;">{{ row.hirePrice }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="出租状态" width="100">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-tag v-if="row.isHire == 1" :type="row.hireStatus == 1 ? 'info' : 'success'" style="margin: 0 5px;">{{ row.hireStatus
|
|
|
- == 1 ? '已租' : '待租' }}</el-tag>
|
|
|
+ <div
|
|
|
+ style="display: flex;background-color: #ffffff;width: 100%;padding: 0 20px 20px 20px;justify-content: space-between">
|
|
|
+ <el-tree node-key="id" :expand-on-click-node="false" :data="treeData"
|
|
|
+ style="width: 250px;border: #d0d0d0 1px solid" highlight-current @nodeClick="treeNodeClick">
|
|
|
+ <template #default="{node,data}">
|
|
|
+ <span>{{ data.label ? data.label : data.buildingNumber }}</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="是否标记" width="100">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-tag :type="row.mapId == 0 ? 'danger' : 'success'" style="margin: 0 5px;">{{ row.mapId
|
|
|
- == 0 ? '未标记' : '已标记' }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="150" header-align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <div style="display: flex;justify-content: center;">
|
|
|
- <el-button v-if="auth('edit')" class="table-operate" size="small" type="warning" @click="openDialog('edit', row)">
|
|
|
- <icon name="el-icon-edit"></icon>
|
|
|
- </el-button>
|
|
|
- <el-popconfirm width="220" confirm-button-text="确定" cancel-button-text="取消" title="是否确定删除?"
|
|
|
- @confirm="deleteRow(row)">
|
|
|
- <template #reference>
|
|
|
- <el-button v-if="auth('del')" class="table-operate" type="danger" size="small">
|
|
|
- <icon name="el-icon-delete"></icon>
|
|
|
+ </el-tree>
|
|
|
+
|
|
|
+ <div style="width: calc(100% - 270px);">
|
|
|
+ <div style="color: #3f6ad8">
|
|
|
+ <span>当前位置:</span>
|
|
|
+ <span>{{ dir }}</span>
|
|
|
+ </div>
|
|
|
+ <el-table style="margin-top: 10px" :data="parkingData" border @row-dblclick="detailDialogRef.open($event)">
|
|
|
+ <el-table-column prop="districtName" label="区县"></el-table-column>
|
|
|
+ <el-table-column prop="communityName" label="小区"></el-table-column>
|
|
|
+ <el-table-column prop="parkingNumber" label="车位编号"></el-table-column>
|
|
|
+ <el-table-column prop="parkingType" label="车位类型" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span>{{ row.parkingType == 1 ? "车库" : "车位" }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="售卖类型">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tag v-if="row.isSale == 1" style="margin: 0 5px;">出售</el-tag>
|
|
|
+ <el-tag v-if="row.isHire == 1" style="margin: 0 5px;">出租</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="销售金额" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span v-if="row.isSale == 1" style="margin: 0 5px;">{{ row.salePrice }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="出售状态" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tag v-if="row.isSale == 1" :type="row.saleStatus == 1 ? 'info' : 'success'" style="margin: 0 5px;">
|
|
|
+ {{ row.saleStatus
|
|
|
+ == 1 ? "已售" : "待售" }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="租金" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span v-if="row.isHire == 1" style="margin: 0 5px;">{{ row.hirePrice }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="出租状态" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tag v-if="row.isHire == 1" :type="row.hireStatus == 1 ? 'info' : 'success'" style="margin: 0 5px;">
|
|
|
+ {{ row.hireStatus
|
|
|
+ == 1 ? "已租" : "待租" }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="是否标记" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tag :type="row.mapId == 0 ? 'danger' : 'success'" style="margin: 0 5px;">{{ row.mapId
|
|
|
+ == 0 ? "未标记" : "已标记" }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="150" header-align="center">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div style="display: flex;justify-content: center;">
|
|
|
+ <el-button v-if="auth('edit')" class="table-operate" size="small" type="warning"
|
|
|
+ @click="openDialog('edit', row)">
|
|
|
+ <icon name="el-icon-edit"></icon>
|
|
|
</el-button>
|
|
|
- </template>
|
|
|
- </el-popconfirm>
|
|
|
-
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-pagination style="background: #ffffff;padding: 20px 20px"
|
|
|
- v-model:current-page="currentPage"
|
|
|
- v-model:page-size="pageSize"
|
|
|
- :page-sizes="[10, 20, 50, 100]"
|
|
|
- :background = "true"
|
|
|
- layout="sizes, prev, pager, next, jumper"
|
|
|
- :total="total"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- />
|
|
|
+ <el-popconfirm width="220" confirm-button-text="确定" cancel-button-text="取消" title="是否确定删除?"
|
|
|
+ @confirm="deleteRow(row)">
|
|
|
+ <template #reference>
|
|
|
+ <el-button v-if="auth('del')" class="table-operate" type="danger" size="small">
|
|
|
+ <icon name="el-icon-delete"></icon>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination style="background: #ffffff;padding: 20px 20px"
|
|
|
+ v-model:current-page="currentPage"
|
|
|
+ v-model:page-size="pageSize"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ :background="true"
|
|
|
+ layout="sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<editDialog ref="editDialogRef" @close="getData"></editDialog>
|
|
|
<markDialog ref="parkingMapRef" @close="getData"></markDialog>
|
|
@@ -112,32 +137,34 @@
|
|
|
|
|
|
import { auth } from "/@/utils/common";
|
|
|
import request from "/@/api/request";
|
|
|
-import { building_list, community_list, district_list, parking } from "/@/api/controllerUrls";
|
|
|
-import { onMounted, ref } from "vue";
|
|
|
-import editDialog from "./editDialog.vue"
|
|
|
-import markDialog from "./markDialog.vue"
|
|
|
-import detailDialog from "./detailDialog.vue"
|
|
|
+import { building_list, buildingTree, community_list, district_list, parking } from "/@/api/controllerUrls";
|
|
|
+import { computed, onMounted, ref } from "vue";
|
|
|
+import editDialog from "./editDialog.vue";
|
|
|
+import markDialog from "./markDialog.vue";
|
|
|
+import detailDialog from "./detailDialog.vue";
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getDistrictList()
|
|
|
- getData()
|
|
|
-})
|
|
|
+ getDistrictList();
|
|
|
+ getData();
|
|
|
+ getInitData();
|
|
|
+});
|
|
|
|
|
|
-let districtId = ref('')
|
|
|
+let districtId = ref("");
|
|
|
|
|
|
-let editDialogRef = ref()
|
|
|
-let parkingMapRef = ref()
|
|
|
-let detailDialogRef = ref()
|
|
|
+let editDialogRef = ref();
|
|
|
+let parkingMapRef = ref();
|
|
|
+let detailDialogRef = ref();
|
|
|
|
|
|
-let quickSearch = ref('')
|
|
|
+let quickSearch = ref("");
|
|
|
|
|
|
-let total = ref(0)
|
|
|
-let currentPage = ref(1)
|
|
|
-let pageSize = ref(10)
|
|
|
+let total = ref(0);
|
|
|
+let currentPage = ref(1);
|
|
|
+let pageSize = ref(10);
|
|
|
|
|
|
//区县列表
|
|
|
-let districtList = ref([])
|
|
|
+let districtList = ref([]);
|
|
|
+
|
|
|
function getDistrictList() {
|
|
|
request.index(district_list, {}, "").then((res: any) => {
|
|
|
if (res.code == 1) {
|
|
@@ -146,7 +173,7 @@ function getDistrictList() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-let communityId = ref('')
|
|
|
+let communityId = ref("");
|
|
|
|
|
|
//小区列表
|
|
|
let communityList = ref([]);
|
|
@@ -158,15 +185,15 @@ function selectDstrict(event: any) {
|
|
|
}, "").then((res: any) => {
|
|
|
if (res.code == 1) {
|
|
|
communityList.value = res.data;
|
|
|
- communityId.value = ''
|
|
|
- buildingId.value = ''
|
|
|
- getData()
|
|
|
+ communityId.value = "";
|
|
|
+ buildingId.value = "";
|
|
|
+ getData();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
-let buildingId = ref('')
|
|
|
+let buildingId = ref("");
|
|
|
//楼号列表
|
|
|
let buildingList = ref([]);
|
|
|
|
|
@@ -177,45 +204,87 @@ function selectCommunity(event: any) {
|
|
|
}, "").then((res: any) => {
|
|
|
if (res.code == 1) {
|
|
|
buildingList.value = res.data;
|
|
|
- buildingId.value = ''
|
|
|
- getData()
|
|
|
+ buildingId.value = "";
|
|
|
+ getData();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
-let parkingData = ref([])
|
|
|
+let parkingData = ref([]);
|
|
|
|
|
|
function selectBuilding(event: any) {
|
|
|
- getData()
|
|
|
+ getData();
|
|
|
}
|
|
|
|
|
|
|
|
|
+//树相关
|
|
|
+let treeData = ref([]);
|
|
|
+let dir = ref("");
|
|
|
+
|
|
|
+function getInitData() {
|
|
|
+ request.index(buildingTree, {}, "").then((res: any) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ treeData.value = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function treeNodeClick(node: any, data: any) {
|
|
|
+ console.log(data);
|
|
|
+ districtId.value = "";
|
|
|
+ communityId.value = "";
|
|
|
+ buildingId.value = "";
|
|
|
+ if (data.level == 1) {
|
|
|
+ districtId.value = data.data.id;
|
|
|
+ dir.value = data.data.label;
|
|
|
+ } else if (data.level == 2) {
|
|
|
+ communityId.value = data.data.id;
|
|
|
+ districtId.value = data.parent.data.id;
|
|
|
+ dir.value = data.parent.data.label + " / " + data.data.label;
|
|
|
+ } else {
|
|
|
+ buildingId.value = data.data.id;
|
|
|
+ communityId.value = data.parent.data.id;
|
|
|
+ districtId.value = data.parent.parent.data.id;
|
|
|
+ dir.value = data.parent.parent.data.label + " / " + data.parent.data.label + " / " + data.data.buildingNumber;
|
|
|
+ }
|
|
|
+ getData();
|
|
|
+}
|
|
|
+
|
|
|
+let defaultExpanded = computed(() => {
|
|
|
+ let res = [];
|
|
|
+ for (let row of treeData.value) {
|
|
|
+ res.push(row.id);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
function getData() {
|
|
|
request.index(parking, {
|
|
|
districtId: districtId.value,
|
|
|
communityId: communityId.value,
|
|
|
buildingId: buildingId.value,
|
|
|
- quickSearch:quickSearch.value,
|
|
|
- limit:pageSize.value,
|
|
|
- page:currentPage.value
|
|
|
+ quickSearch: quickSearch.value,
|
|
|
+ limit: pageSize.value,
|
|
|
+ page: currentPage.value
|
|
|
}).then((res: any) => {
|
|
|
if (res.code == 1) {
|
|
|
parkingData.value = res.data.list;
|
|
|
- total.value = +res.data.total
|
|
|
+ total.value = +res.data.total;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
const handleSizeChange = (val: number) => {
|
|
|
- getData()
|
|
|
-}
|
|
|
+ getData();
|
|
|
+};
|
|
|
const handleCurrentChange = (val: number) => {
|
|
|
- getData()
|
|
|
-}
|
|
|
+ getData();
|
|
|
+};
|
|
|
|
|
|
function openDialog(type: string, data: any = {}) {
|
|
|
- editDialogRef.value.open(type, data, districtId, communityId, buildingId)
|
|
|
+ editDialogRef.value.open(type, data, districtId, communityId, buildingId);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -224,7 +293,7 @@ function deleteRow(row: any) {
|
|
|
ids: [row.id]
|
|
|
}).then((res: any) => {
|
|
|
if (res.code == 1) {
|
|
|
- getData()
|
|
|
+ getData();
|
|
|
}
|
|
|
});
|
|
|
}
|