|
|
|
@ -72,18 +72,7 @@
|
|
|
|
|
<a-input v-model="addForm.addressDetails" style="width: 260px" placeholder="请输入详细地址"></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="小区正门图片">
|
|
|
|
|
<a-upload
|
|
|
|
|
@change="addFile"
|
|
|
|
|
action=""
|
|
|
|
|
:defaultFileList="addForm.communityUrls"
|
|
|
|
|
class="avatar-uploader"
|
|
|
|
|
list-type="picture-card"
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<a-icon :type="'plus'" />
|
|
|
|
|
<div class="ant-upload-text">Upload</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-upload>
|
|
|
|
|
<imgUpload @handleChange="addFile"></imgUpload>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
<a-button @click="addConfirm" type="primary">确定</a-button>
|
|
|
|
@ -93,13 +82,15 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import imgUpload from "@/components/upload/index.vue"
|
|
|
|
|
import {getCommunityList, getAddCommunity, getAllRequest, updateCommunity} from "@/api/manage"
|
|
|
|
|
import {getAllCity, getCityByParent} from "@/api/city"
|
|
|
|
|
import {uploadImg} from "@/api/upload"
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
imgUpload
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
uploadImg: uploadImg,
|
|
|
|
|
form: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
size: 10,
|
|
|
|
@ -170,6 +161,9 @@ export default {
|
|
|
|
|
this.getData()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
img(val) {
|
|
|
|
|
console.log(val)
|
|
|
|
|
},
|
|
|
|
|
getData() {
|
|
|
|
|
getCommunityList(this.form).then(res => {
|
|
|
|
|
let data = res.data.rows;
|
|
|
|
@ -222,13 +216,13 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
addConfirm() {
|
|
|
|
|
if(this.modelType == 1) {
|
|
|
|
|
getAddCommunity(this.addForm).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
getAddCommunity(this.addForm).then(() => {
|
|
|
|
|
this.getData();
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
let obj = Object.assign({id: this.chosenId}, this.addForm)
|
|
|
|
|
updateCommunity(obj).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
updateCommunity(obj).then(() => {
|
|
|
|
|
this.getData();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.visible = false;
|
|
|
|
@ -249,7 +243,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//添加小区-上传图片
|
|
|
|
|
addFile(file) {
|
|
|
|
|
console.log(file)
|
|
|
|
|
console.log(file);
|
|
|
|
|
let communityUrls = [];
|
|
|
|
|
communityUrls.push(file[0].response.data);
|
|
|
|
|
this.addForm.communityUrls = communityUrls;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|