|
|
@ -20,7 +20,6 @@
|
|
|
|
</a-button>
|
|
|
|
</a-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<a-table
|
|
|
|
<a-table
|
|
|
|
:scroll="{ x: 1300 }"
|
|
|
|
|
|
|
|
:columns="columns"
|
|
|
|
:columns="columns"
|
|
|
|
:data-source="tableData"
|
|
|
|
:data-source="tableData"
|
|
|
|
:pagination="pagination"
|
|
|
|
:pagination="pagination"
|
|
|
@ -32,7 +31,8 @@
|
|
|
|
"
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span slot="pics" slot-scope="text,record">
|
|
|
|
<span slot="pics" slot-scope="text,record">
|
|
|
|
<img :src="item.url" alt="" v-for="(item, index) in record.communityImgList" :key="index">
|
|
|
|
<img style="width: 40px;height: 40px" v-for="(item, index) in record.communityImgList" :src="$ImgUrl(item.url)" :key="index">
|
|
|
|
|
|
|
|
<!-- {{record.communityImgList}} -->
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span slot="action" slot-scope="text,record">
|
|
|
|
<span slot="action" slot-scope="text,record">
|
|
|
|
<a @click="detail(record)">修改</a>
|
|
|
|
<a @click="detail(record)">修改</a>
|
|
|
@ -52,18 +52,18 @@
|
|
|
|
</a-select>
|
|
|
|
</a-select>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
<a-form-model-item label="小区地址">
|
|
|
|
<a-form-model-item label="小区地址">
|
|
|
|
<a-select @change="cityChange1" style="width: 120px" placeholder="请选择省">
|
|
|
|
<a-select v-model="province" @change="cityChange1" style="width: 120px" placeholder="请选择省">
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in cityData" :key="index">
|
|
|
|
<a-select-option :value="item.id" v-for="(item) in cityData" :key="item.id">
|
|
|
|
{{item.name}}
|
|
|
|
{{item.name}}
|
|
|
|
</a-select-option>
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-select>
|
|
|
|
<a-select v-model="address1" @change="cityChange2" style="width: 120px;margin-left: 20px" placeholder="请选择市">
|
|
|
|
<a-select v-model="address1" @change="cityChange2" style="width: 120px;margin-left: 20px" placeholder="请选择市">
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in cityData2" :key="index">
|
|
|
|
<a-select-option :value="item.id" v-for="(item) in cityData2" :key="item.id">
|
|
|
|
{{item.name}}
|
|
|
|
{{item.name}}
|
|
|
|
</a-select-option>
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-select>
|
|
|
|
<a-select v-model="addForm.address" style="width: 120px;margin-left: 20px" placeholder="请选择区">
|
|
|
|
<a-select v-model="addForm.address" style="width: 120px;margin-left: 20px" placeholder="请选择区">
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in cityData3" :key="index">
|
|
|
|
<a-select-option :value="item.id" v-for="(item) in cityData3" :key="item.id">
|
|
|
|
{{item.name}}
|
|
|
|
{{item.name}}
|
|
|
|
</a-select-option>
|
|
|
|
</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-select>
|
|
|
@ -72,7 +72,7 @@
|
|
|
|
<a-input v-model="addForm.addressDetails" style="width: 260px" placeholder="请输入详细地址"></a-input>
|
|
|
|
<a-input v-model="addForm.addressDetails" style="width: 260px" placeholder="请输入详细地址"></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
<a-form-model-item label="小区正门图片">
|
|
|
|
<a-form-model-item label="小区正门图片">
|
|
|
|
<imgUpload @handleChange="addFile"></imgUpload>
|
|
|
|
<commonUpload @handleChange="addFile" :fileList="fileList"></commonUpload>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model>
|
|
|
|
</a-form-model>
|
|
|
|
<a-button @click="addConfirm" type="primary">确定</a-button>
|
|
|
|
<a-button @click="addConfirm" type="primary">确定</a-button>
|
|
|
@ -82,13 +82,9 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import imgUpload from "@/components/upload/index.vue"
|
|
|
|
|
|
|
|
import {getCommunityList, getAddCommunity, getAllRequest, updateCommunity, findByIdAdmin} from "@/api/manage"
|
|
|
|
import {getCommunityList, getAddCommunity, getAllRequest, updateCommunity, findByIdAdmin} from "@/api/manage"
|
|
|
|
import {getAllCity, getCityByParent} from "@/api/city"
|
|
|
|
import {getAllCity, getCityByParent} from "@/api/city"
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
|
|
|
|
imgUpload
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
@ -130,7 +126,7 @@ export default {
|
|
|
|
width: "200",
|
|
|
|
width: "200",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: "公司图片",
|
|
|
|
title: "小区图片",
|
|
|
|
dataIndex: "communityImgList",
|
|
|
|
dataIndex: "communityImgList",
|
|
|
|
width: "200",
|
|
|
|
width: "200",
|
|
|
|
scopedSlots: { customRender: "pics" },
|
|
|
|
scopedSlots: { customRender: "pics" },
|
|
|
@ -150,10 +146,12 @@ export default {
|
|
|
|
cityData: [],
|
|
|
|
cityData: [],
|
|
|
|
cityData2: [],
|
|
|
|
cityData2: [],
|
|
|
|
cityData3: [],
|
|
|
|
cityData3: [],
|
|
|
|
|
|
|
|
province: undefined,
|
|
|
|
address1: undefined,
|
|
|
|
address1: undefined,
|
|
|
|
// 添加/修改小区
|
|
|
|
// 添加/修改小区
|
|
|
|
modelType: 1, //1添加 2修改
|
|
|
|
modelType: 1, //1添加 2修改
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
|
|
|
|
fileList: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
@ -193,7 +191,39 @@ export default {
|
|
|
|
this.modelType = 2;
|
|
|
|
this.modelType = 2;
|
|
|
|
findByIdAdmin({communityId: record.id}).then(res => {
|
|
|
|
findByIdAdmin({communityId: record.id}).then(res => {
|
|
|
|
let data = res.data;
|
|
|
|
let data = res.data;
|
|
|
|
console.log(data)
|
|
|
|
this.addForm.name = data.name;
|
|
|
|
|
|
|
|
this.addForm.companyId = data.companyId;
|
|
|
|
|
|
|
|
this.addForm.addressDetails = data.addressDetails;
|
|
|
|
|
|
|
|
getCityByParent({parentId: data.provinceId}).then(res => {
|
|
|
|
|
|
|
|
let data = res.data;
|
|
|
|
|
|
|
|
this.cityData2 = data;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
getCityByParent({parentId: data.cityId}).then(res => {
|
|
|
|
|
|
|
|
let data = res.data;
|
|
|
|
|
|
|
|
this.cityData3 = data;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.province = data.provinceId //回调省
|
|
|
|
|
|
|
|
this.address1 = data.cityId //回调市
|
|
|
|
|
|
|
|
this.addForm.address = data.countyId //回调区
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
this.addForm.communityUrls = [];
|
|
|
|
|
|
|
|
if (res.data.imgList.length > 0) {
|
|
|
|
|
|
|
|
const pic = [];
|
|
|
|
|
|
|
|
this.addForm.communityUrls.push(res.data.imgList[0].url)
|
|
|
|
|
|
|
|
for (let item of res.data.imgList) {
|
|
|
|
|
|
|
|
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),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
pic.push(obj);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.fileList = pic;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.addForm.communityUrls=[]
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.chosenId = record.id; //小区id
|
|
|
|
this.chosenId = record.id; //小区id
|
|
|
|
this.visible = true;
|
|
|
|
this.visible = true;
|
|
|
@ -213,20 +243,42 @@ export default {
|
|
|
|
this.visible = true;
|
|
|
|
this.visible = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hanlderClose() {
|
|
|
|
hanlderClose() {
|
|
|
|
|
|
|
|
this.addForm = {
|
|
|
|
|
|
|
|
companyId: undefined,
|
|
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
|
|
address: undefined,
|
|
|
|
|
|
|
|
addressDetails: '',
|
|
|
|
|
|
|
|
communityUrls: []
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
this.province = undefined;
|
|
|
|
|
|
|
|
this.address1 = undefined;
|
|
|
|
|
|
|
|
this.cityData2 = [];
|
|
|
|
|
|
|
|
this.cityData3 = [];
|
|
|
|
this.visible = false;
|
|
|
|
this.visible = false;
|
|
|
|
|
|
|
|
this.fileList = [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addConfirm() {
|
|
|
|
addConfirm() {
|
|
|
|
if(this.modelType == 1) {
|
|
|
|
if(this.modelType == 1) {
|
|
|
|
getAddCommunity(this.addForm).then(() => {
|
|
|
|
getAddCommunity(this.addForm).then((res) => {
|
|
|
|
this.getData();
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
|
|
|
this.getData();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let obj = Object.assign({id: this.chosenId}, this.addForm)
|
|
|
|
let obj = Object.assign({id: this.chosenId}, this.addForm)
|
|
|
|
updateCommunity(obj).then(() => {
|
|
|
|
updateCommunity(obj).then((res) => {
|
|
|
|
this.getData();
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
|
|
|
this.getData();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.visible = false;
|
|
|
|
this.hanlderClose()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//添加小区-输入城市
|
|
|
|
//添加小区-输入城市
|
|
|
|
cityChange1(val) {
|
|
|
|
cityChange1(val) {
|
|
|
@ -244,9 +296,13 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//添加小区-上传图片
|
|
|
|
//添加小区-上传图片
|
|
|
|
addFile(file) {
|
|
|
|
addFile(file) {
|
|
|
|
let communityUrls = [];
|
|
|
|
this.fileList = file;
|
|
|
|
communityUrls.push(file[0].response.data);
|
|
|
|
this.addForm.communityUrls = [];
|
|
|
|
this.addForm.communityUrls = communityUrls;
|
|
|
|
file.forEach(ele => {
|
|
|
|
|
|
|
|
if(ele.status == 'done') {
|
|
|
|
|
|
|
|
this.addForm.communityUrls.push(ele.response.data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|