main
bibi 3 years ago
parent 5170215707
commit 84b3ae2034

@ -17,7 +17,7 @@ export function buildInsert(params) {
data: params,
})
}
// 楼栋新增
// 楼栋详情
export function buildInfo(params) {
return httpService({
url: `/user/building/findById`,
@ -41,6 +41,22 @@ export function buildingDel(params) {
data: params,
})
}
// 全部楼栋
export function allBuilding(params) {
return httpService({
url: `/user/building/findAllBuilding`,
method: 'get',
params: params,
})
}
// 楼栋查单元
export function findByBuildingId(params) {
return httpService({
url: `/user/unit/findByBuildingId`,
method: 'get',
params: params,
})
}
/**
* 单元
* list update del
@ -83,6 +99,22 @@ export function houseInsert(params) {
data: params,
})
}
// 房屋修改
export function houseInfo(params) {
return httpService({
url: `/user/estate/findById`,
method: 'get',
params: params,
})
}
// 房屋修改
export function houseUpdate(params) {
return httpService({
url: `/user/estate/update`,
method: 'post',
data: params,
})
}
// 房屋删除
export function houseDel(params) {
return httpService({

@ -24,19 +24,3 @@ export function quit(params) {
data: params,
})
}
// 省市区
export function allCity(params) {
return httpService({
url: `/city/allCity`,
method: 'get',
params: params,
})
}
// 查找所有小区【api不需要communityCode】
export function findcommunity(params) {
return httpService({
url: `/community/findAll`,
method: 'get',
params: params,
})
}

@ -35,7 +35,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.id;
}
"
>

@ -85,8 +85,8 @@
</div>
</a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
<span style="color: #00000073"
>单张最多不超过4M最多上传2张支持JPG,PNG格式</span
>

@ -82,7 +82,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.id;
}
"
>

@ -40,9 +40,9 @@ export const columns = [
case 1:
return '审核中'
case 2:
return '驳回'
return '驳回'
case 3:
return '通过'
return '通过'
default:
break;
}
@ -64,13 +64,11 @@ export const columns = [
]
// 搜索项
export const searchForm = {
status:null,
identity: null
identity: undefined,
}
export function reset() {
this.searchForm = {
status:null,
identity:null,
identity: undefined,
}
this.getData()
}

@ -7,11 +7,12 @@
default-value="1"
button-style="solid"
@change="tabsChange"
v-model="activeName"
>
<a-radio-button value="1"> 待审核 </a-radio-button>
<a-radio-button value="3"> 已通过 </a-radio-button>
<a-radio-button value="2"> 已驳回 </a-radio-button>
<a-radio-button value="0"> 全部 </a-radio-button>
<a-radio-button> 全部 </a-radio-button>
</a-radio-group>
</a-space>
</div>
@ -19,7 +20,9 @@
<a-row>
<a-col :span="20">
<a-space size="large">
<a-select placeholder="请选择用户身份" style="width: 200px" />
<a-select placeholder="请选择用户身份" v-model="searchForm.identity" style="width: 200px" >
<a-select-option v-for="item in options.identity" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
<a-button type="primary" @click="getData()"> </a-button>
<a-button @click="reset"> </a-button>
</a-space>
@ -61,7 +64,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.estateReviewId;
}
"
>
@ -77,10 +80,10 @@
</span>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="audit(row.estateReviewId, 1)"
<a class="ant-dropdown-link" @click="audit(row.estateReviewId, 1)" :disabled="row.status!==1"
>通过</a
>
<a class="ant-dropdown-link" @click="audit(row.estateReviewId, 2)"
<a class="ant-dropdown-link" @click="audit(row.estateReviewId, 2)" :disabled="row.status!==1"
>驳回</a
>
</a-space>
@ -137,6 +140,27 @@ export default {
tableChoosed: [],
tableData: [],
ActionsList: [],
activeName:'1',
options:{
identity:[
{
id:1,
name:'业主'
},
{
id:2,
name:'业主亲属'
},
{
id:3,
name:'租户'
},
{
id:4,
name:'租户亲属'
},
]
}
};
},
mounted() {
@ -147,17 +171,12 @@ export default {
const res = await reviewList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
status: this.searchForm.status,
status: this.activeName,
identity: this.searchForm.identity,
});
this.tableData = res.data.rows;
},
tabsChange(e) {
if (e.target.value === "0") {
this.searchForm.status = null;
} else {
this.searchForm.status = e.target.value;
}
tabsChange() {
this.getData();
},
// 1 2
@ -187,7 +206,7 @@ export default {
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
this.selectedRowKeys = data;
},
reset: reset,
},

@ -55,7 +55,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.id;
}
"
>

@ -47,8 +47,8 @@ export const columns = [
// 搜索项
export const searchForm = {
name: "",
isEnableLease: null,
manageEstateTypeId:null
isEnableLease: undefined,
manageEstateTypeId:undefined
}
// 分页
export const pagination = {

@ -5,6 +5,7 @@
// 表单
export const form = {
id:undefined,
manageBuildingId:undefined,
manageUnitId:undefined,
floorLocation:undefined,
@ -19,14 +20,28 @@ export const form = {
estateImgUrls:[],
remarks:undefined,
}
// 校验
export const rules = {
manageBuildingId:[
{ required: true, message: "请选择楼栋", trigger: "change" },
],
manageUnitId:[
{ required: true, message: "请选择单元", trigger: "change" },
],
floorLocation: [
{ required: true, message: "楼层位置", trigger: "blur" },
{ required: true, message: "请输入楼层位置", trigger: "blur" },
],
name: [
{ required: true, message: "请输入房屋名称", trigger: "blur" },
],
manageEstateTypeId: [
{ required: true, message: "请选择房屋类型", trigger: "change" },
],
isEnableLease: [
{ required: true, message: "请选择是否开启租赁", trigger: "change" },
],
}
// 请求头
import store from "@/store";
export const uploadHeaders = {
"manage-login-token": store.getters.getToken,

@ -13,17 +13,22 @@
<a-select
v-model="form.manageBuildingId"
placeholder="请选择楼栋"
/>
@change='changeBuild'
>
<a-select-option v-for="item in options.building" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="单元" prop="manageUnitId">
<a-select v-model="form.manageUnitId" placeholder="请选择单元" />
<a-select v-model="form.manageUnitId" placeholder="请选择单元" @change='changeUnit'>
<a-select-option v-for="item in options.unit" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="楼层" prop="floorLocation">
<a-select v-model="form.floorLocation" placeholder="请选择楼层" />
<a-input-number v-model.number="form.floorLocation" placeholder="楼层" :min='0' :max='options.floor'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -38,6 +43,7 @@
v-model="form.indoorArea"
placeholder="请输入室内面积"
suffix="㎡"
:min='0'
/>
</a-form-model-item>
</a-col>
@ -48,21 +54,25 @@
type="number"
suffix="㎡"
placeholder="请输入建筑面积"
:min='0'
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="房屋类型" prop="manageEstateTypeId">
<a-select
mode="multiple"
v-model="form.manageEstateTypeId"
placeholder="请选择房屋类型"
/>
>
<a-select-option v-for="item in options.houseType" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="是否开启租赁" prop="isEnableLease">
<a-select v-model="form.isEnableLease" />
<a-select placeholder='请选择是否开启租赁' v-model="form.isEnableLease" >
<a-select-option v-for="item in options.isEnableLease" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -84,27 +94,25 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="房屋照片" prop="estateImgUrls">
<a-upload
<div>房屋照片</div>
<a-upload
:action="`${$upload}`"
:headers="uploadHeaders"
list-type="picture-card"
accept='.jpg,.JPG,.png,.PNG,.jpeg,.JPEG'
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
@change="fileChange"
>
<div v-if="fileList.length < 5">
<a-icon type="plus" />
<div class="ant-upload-text">Upload</div>
<div v-if="fileList.length < 2">
<!-- <a-icon type="plus" /> -->
<a-icon :type="imgLoading ? 'loading' : 'plus'" />
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload>
<a-modal
:visible="previewVisible"
:footer="null"
@cancel="handleCancel"
>
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</a-form-model-item>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remarks">
@ -118,6 +126,7 @@
<script>
import { form, rules, uploadHeaders } from "./form.js";
import { allBuilding, findByBuildingId, estateType, houseInsert, houseUpdate, houseInfo } from "@/api/basic/estate"
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
@ -128,7 +137,10 @@ function getBase64(file) {
}
export default {
props: {
editId: Number,
editId: {
default:null,
type:Number
},
},
data() {
return {
@ -137,10 +149,76 @@ export default {
uploadHeaders,
fileList: [],
previewVisible: false,
imgLoading: false,
previewImage: "",
formType:'add',
options:{
building:[],//
unit:[],//
floor:0,//
houseType:[],//
isEnableLease:[//
{
id:1,
name:'开启'
},
{
id:2,
name:'关闭'
},
],
}
};
},
mounted() {
allBuilding().then(res=>{
this.options.building = res.data
})
estateType().then(res=>{
this.options.houseType = res.data
})
if(this.editId !== null){
this.getInfo(this.editId)
}
},
methods: {
async getInfo(id){
this.formType = 'edit'
let res = await houseInfo({estateId:id})
this.form.id = id
this.form.manageBuildingId = res.data.manageBuildingId
//
await this.changeBuild(res.data.manageBuildingId)
this.form.manageUnitId = res.data.manageUnitId
for(let item of this.options.unit){
if(item.id === res.data.manageUnitId){
this.options.floor = item.floor
this.form.floorLocation = res.data.floorLocation
}
}
this.form.name = res.data.name
this.form.manageEstateTypeId = res.data.manageEstateTypeId
this.form.indoorArea = res.data.indoorArea
this.form.constructionArea = res.data.constructionArea
this.form.houseTypeHall = res.data.houseTypeHall
this.form.houseTypeRoom = res.data.houseTypeRoom
this.form.houseTypeBathroom = res.data.houseTypeBathroom
this.form.remarks = res.data.remarks
this.form.isEnableLease = res.data.isEnableLease
// this.form.estateImgUrls = res.data.estateImgUrls
const file = []
for(let item of res.data.estateImgList){
let obj = {
name:item.url.split('_')[0] +'.'+ item.url.split('.')[1],
url: this.$ImgUrl(item.url),
uid:item.url.split('_')[1],
status:'done',
thumbUrl: this.$ImgUrl(item.url),
}
file.push(obj)
}
this.fileList = file
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
@ -148,15 +226,80 @@ export default {
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
async changeBuild(data){
this.form.manageUnitId = undefined
this.options.floor = 0
let res = await findByBuildingId({buildingId:data})
this.options.unit = res.data
},
changeUnit(data){
this.options.floor = 0
for(let item of this.options.unit){
if(item.id === data){
console.log(item);
this.options.floor = item.floor
}
}
},
addSubmit(){
let file = []
for(let item of this.fileList){
//
if(item.response){
file.push(item.response.data)
}else{
//
file.push(item.url.split('/')[item.url.split('/').length-1])
}
}
this.form.estateImgUrls = file
this.$refs.ruleForm.validate(async valid => {
if (valid) {
if(this.formType==='add'){
let res = await houseInsert(this.form)
if(res.code === 200){
this.$message.success(res.msg)
this.success()
}else{
this.$message.error(res.msg)
}
}else if(this.formType==='edit'){
let res = await houseUpdate(this.form)
if(res.code === 200){
this.$message.success(res.msg)
this.success()
}else{
this.$message.error(res.msg)
}
}
}
});
},
success(){
this.$emit('success')
},
close(){
this.$refs.ruleForm.resetFields();
this.formType = 'add'
},
handleCancel() {
this.previewVisible = false;
},
fileChange(info) {
this.fileList = info.fileList
},
handleChange({ fileList }) {
this.fileList = fileList;
console.log(this.fileList);
},
},
watch: {},
watch: {
editId(val){
if(val!==null){
this.getInfo(val)
}
}
}
};
</script>

@ -5,11 +5,15 @@
<a-row>
<a-col :span="20">
<a-space size="large">
<a-input placeholder="请输入房屋名称" />
<a-select style="width: 200px" placeholder="请选择房屋类型" />
<a-select style="width: 200px" placeholder="请选择是否开启租赁" />
<a-input v-model="searchForm.name" placeholder="请输入房间号" />
<a-select style="width: 200px" v-model='searchForm.manageEstateTypeId' placeholder="请选择房屋类型" >
<a-select-option v-for="item in options.houseType" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
<a-select style="width: 200px" v-model='searchForm.isEnableLease' placeholder="请选择是否开启租赁" >
<a-select-option v-for="item in options.isEnableLease" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
<a-button type="primary" @click="getData"> </a-button>
<a-button> </a-button>
<a-button @click="reset"> </a-button>
</a-space>
</a-col>
<a-col :span="4">
@ -55,7 +59,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.id;
}
"
>
@ -102,13 +106,13 @@
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<vue-form></vue-form>
<vue-form ref="form" @success='addSuccess' :editId="editId"></vue-form>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="addClose"> </a-button>
<a-button type="primary" @click="addHouse"> </a-button>
</div>
</a-drawer>
<!-- 房屋类型 -->
@ -190,13 +194,27 @@ export default {
id: null,
name: ''
},
editId:null,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
tableData: [],
typeList:[]
typeList:[],
options:{
houseType:[],//
isEnableLease:[//
{
id:1,
name:'开启'
},
{
id:2,
name:'关闭'
},
],
}
};
},
created() {
@ -204,6 +222,7 @@ export default {
this.getType()
},
methods: {
//
async getData() {
const res = await houseList({
pageNum: this.pagination.current,
@ -214,19 +233,40 @@ export default {
});
this.tableData = res.data.rows;
},
//
async getType() {
this.typeList = []
const res = await estateType();
this.options.houseType = res.data
const arr = res.data;
arr.forEach(ele => {
ele.show = false;
})
this.typeList = arr;
},
addHouse() {},
reset(){
this.searchForm.name= "",
this.searchForm.isEnableLease = undefined,
this.searchForm.manageEstateTypeId = undefined
this.getData()
},
//
addHouse() {
this.$refs.form.addSubmit()
},
//
addSuccess(){
this.getData()
this.addClose()
},
addClose() {
this.drawerConfig.addShow = false;
this.editId = null;
this.$refs.form.close()
},
edit(data){
this.editId = data.id
this.drawerConfig.addShow = true;
},
//
addShow(){
@ -324,6 +364,7 @@ export default {
houseDel({ estateIds: ids }).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}

@ -80,7 +80,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.id;
}
"
>

@ -194,7 +194,7 @@
</template>
<script>
import { loginTel, sendTelCode, allCity, findcommunity } from "../../api/public/login";
import { loginTel, sendTelCode, } from "../../api/public/login";
export default {
name: "Login",
data() {
@ -251,9 +251,15 @@ export default {
}
},
methods: {
async getCity(){
let res = await allCity()
this.cityList = res.data
getCity(){
this.$axios({
method:'get',
url:process.env.VUE_APP_URL+'manage/city/allCity',//apicommunityCode
}).then((response) =>{
this.cityList = response.data.data
}).catch((error) =>{
console.log(error) //
})
},
getCommunity(cityId){
this.$axios({
@ -304,7 +310,7 @@ export default {
},
//
getCode() {
if(this.communityCode===undefined) {
if(this.communityCode === undefined) {
this.$message.error('先选择小区')
return
}

Loading…
Cancel
Save