|
@@ -15,12 +15,11 @@
|
|
|
<el-col :span="12">
|
|
|
<div class=""><i></i>新增信息</div>
|
|
|
<el-form-item label="社区名称" prop="communityName">
|
|
|
- <el-input v-model="ruleForm.name"></el-input>
|
|
|
+ <el-input v-model="ruleForm.communityName"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所在地区" prop="region">
|
|
|
- <el-select v-model="ruleForm.locationId" placeholder="请选择地区">
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
|
+ <el-select v-model="ruleForm.regionId" placeholder="请选择地区">
|
|
|
+ <el-option v-for="(item,index) in ruleForm.locationList" :label="item.label" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所属公司" required>
|
|
@@ -37,26 +36,26 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="详细地址" prop="type">
|
|
|
<div @click="addressQueryClick">
|
|
|
- <el-input v-model="ruleForm.name" suffix-icon="el-icon-location-outline"></el-input>
|
|
|
+ <el-input v-model="ruleForm.address" suffix-icon="el-icon-location-outline"></el-input>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="占地面积">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.coveredArea"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="建筑面积">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.buildingArea"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="商业面积">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.commercialArea"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="住宅面积">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.dwellingArea"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="绿化面积">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.greenArea"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车位面积">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.parkingArea"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="社区图片">
|
|
|
<el-upload
|
|
@@ -73,16 +72,16 @@
|
|
|
<el-col :span="12">
|
|
|
<div>负责人</div>
|
|
|
<el-form-item label="负责人姓名" prop="name">
|
|
|
- <el-input v-model="ruleForm.name"></el-input>
|
|
|
+ <el-input v-model="ruleForm.contactPerson"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="手机号码" prop="phoneNumber">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.phone"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="固定电话">
|
|
|
- <el-input v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input v-model="ruleForm.telephone"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注信息">
|
|
|
- <el-input type="textarea" :rows="4" v-model="ruleForm.remark" maxlength="300">
|
|
|
+ <el-input type="textarea" :rows="4" v-model="ruleForm.remarks" maxlength="300">
|
|
|
</el-input>
|
|
|
<span style="position:absolute;bottom:0;right:10px">{{ruleForm.remark.length}}/300</span>
|
|
|
</el-form-item>
|
|
@@ -91,7 +90,7 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div style="text-align: right;">
|
|
|
- <el-button type="primary">提交</el-button>
|
|
|
+ <el-button type="primary" @click="submit">提交</el-button>
|
|
|
<el-button>取消</el-button>
|
|
|
</div>
|
|
|
|
|
@@ -106,13 +105,23 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
ruleForm: {
|
|
|
- name: '',
|
|
|
- locationId:'',//所在地区
|
|
|
+ communityName: '',
|
|
|
+ locationList:[],
|
|
|
+ regionId:'',//所在地区
|
|
|
+ companyOrgList:[],
|
|
|
companyOrgId:'',//所属公司
|
|
|
deptOrgId:'',//所属部门
|
|
|
+ coveredArea:'',//占地面积
|
|
|
+ buildingArea:'',//建筑面积
|
|
|
+ commercialArea:'',//商业面积
|
|
|
+ dwellingArea:'',//住宅面积
|
|
|
+ greenArea:'',//绿化面积
|
|
|
+ parkingArea:'',//车位面积
|
|
|
+ contactPerson:'',//负责人
|
|
|
+ phone:'',//负责人手机号
|
|
|
+ telephone:'',//固定电话
|
|
|
+ address:'',//详细地址
|
|
|
region: '',
|
|
|
- date1: '',
|
|
|
- date2: '',
|
|
|
delivery: false,
|
|
|
type: [],
|
|
|
resource: '',
|
|
@@ -121,7 +130,7 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
communityName: [
|
|
|
- { required: true, message: '请输入活动名称', trigger: 'change' },
|
|
|
+ { required: true, message: '请输入社区名称', trigger: 'change' },
|
|
|
// { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
|
|
|
],
|
|
|
region: [
|
|
@@ -147,7 +156,7 @@ export default {
|
|
|
{ required: true, message: '请填写活动形式', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
- mapPopUpStatus:true,//地图弹出框
|
|
|
+ mapPopUpStatus:false,//地图弹出框
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
@@ -155,16 +164,121 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- submitForm(formName) {
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- alert('submit!');
|
|
|
- } else {
|
|
|
- console.log('error submit!!');
|
|
|
- return false;
|
|
|
+
|
|
|
+ //保存
|
|
|
+ submit() {
|
|
|
+ let submitData='';
|
|
|
+ if(this.$route.query.newEditType=="edit"){
|
|
|
+ let communityInformation=JSON.parse(sessionStorage.getItem('communityInformation'))
|
|
|
+ submitData={
|
|
|
+ "address": this.ruleForm.address,
|
|
|
+ "buildingArea": this.ruleForm.buildingArea,
|
|
|
+ "cityId": 440300,
|
|
|
+ "commercialArea": this.ruleForm.commercialArea,
|
|
|
+ "communityName": this.ruleForm.communityName,
|
|
|
+ "companyOrgId": 0,
|
|
|
+ "contactPerson": this.ruleForm.contactPerson,
|
|
|
+ "coveredArea": this.ruleForm.coveredArea,
|
|
|
+ "deptOrgId": 461,
|
|
|
+ "dwellingArea": this.ruleForm.dwellingArea,
|
|
|
+ "greenArea": this.ruleForm.greenArea,
|
|
|
+ "id": communityInformation.id,
|
|
|
+ 'latitude':'1',
|
|
|
+ 'longitude':'2',
|
|
|
+ "parkingArea": this.ruleForm.parkingArea,
|
|
|
+ "phone": this.ruleForm.phone,
|
|
|
+ "pictureUrl": "",
|
|
|
+ "provinceId": 440000,
|
|
|
+ "regionId": this.ruleForm.regionId,
|
|
|
+ "remarks": "",
|
|
|
+ "telephone": this.ruleForm.telephone
|
|
|
}
|
|
|
+ this.$http.post('/sc-community/assets/community/update', submitData).then((data) => {
|
|
|
+ // this.deviceOptions = data;
|
|
|
+ let locationObj='';
|
|
|
+ data.map(resData=>{
|
|
|
+ locationObj={
|
|
|
+ label:resData.name,
|
|
|
+ id:resData.pid,
|
|
|
+ }
|
|
|
+ self.ruleForm.locationList.push(locationObj)
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ submitData={
|
|
|
+ "address": this.ruleForm.address,
|
|
|
+ "buildingArea": this.ruleForm.buildingArea,
|
|
|
+ "cityId": 440300,
|
|
|
+ "commercialArea": 0,
|
|
|
+ "communityName": this.ruleForm.communityName,
|
|
|
+ "companyOrgId": 0,
|
|
|
+ "contactPerson": this.ruleForm.contactPerson,
|
|
|
+ "coveredArea": this.ruleForm.coveredArea,
|
|
|
+ "deptOrgId": 461,
|
|
|
+ "dwellingArea": this.ruleForm.dwellingArea,
|
|
|
+ "greenArea": this.ruleForm.greenArea,
|
|
|
+ "id": 0,
|
|
|
+ 'latitude':'1',
|
|
|
+ 'longitude':'2',
|
|
|
+ "parkingArea": this.ruleForm.parkingArea,
|
|
|
+ "phone": this.ruleForm.phone,
|
|
|
+ "pictureUrl": "",
|
|
|
+ "provinceId": 440000,
|
|
|
+ "regionId": this.ruleForm.regionId,
|
|
|
+ "remarks": "",
|
|
|
+ "telephone": this.ruleForm.telephone
|
|
|
+ }
|
|
|
+ this.$http.post('/sc-community/assets/community/add', submitData).then((data) => {
|
|
|
+ // this.deviceOptions = data;
|
|
|
+ let locationObj='';
|
|
|
+ data.map(resData=>{
|
|
|
+ locationObj={
|
|
|
+ label:resData.name,
|
|
|
+ id:resData.pid,
|
|
|
+ }
|
|
|
+ self.ruleForm.locationList.push(locationObj)
|
|
|
+
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ //所属地区
|
|
|
+ regionalQuery(){
|
|
|
+ let self=this;
|
|
|
+ this.$http.postForm('/sc-user-center/area/selectAll', {id:123}).then(({ data }) => {
|
|
|
+ // this.deviceOptions = data;
|
|
|
+ let locationObj='';
|
|
|
+ data.map(resData=>{
|
|
|
+ locationObj={
|
|
|
+ label:resData.name,
|
|
|
+ id:resData.pid,
|
|
|
+ }
|
|
|
+ self.ruleForm.locationList.push(locationObj)
|
|
|
+
|
|
|
+ })
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ //所属公司
|
|
|
+ companyQuery(){
|
|
|
+ let self=this;
|
|
|
+ this.$http.postForm('/sc-user-center/org/getOrgUserTree', {orgType:'company',id:'000'}).then(({ data }) => {
|
|
|
+ console.log(data,'+++++++++++++++++++++++++++++++')
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //所属部门
|
|
|
+ departmentQuery(){
|
|
|
+ let self=this;
|
|
|
+ this.$http.postForm('/sc-user-center/org/getOrgUserTree', {orgType:'department',id:'460'}).then(({ data }) => {
|
|
|
+ console.log(data,'+++++++++++++++++++++++++++++++')
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
resetForm(formName) {
|
|
|
this.$refs[formName].resetFields();
|
|
|
},
|
|
@@ -198,7 +312,34 @@ export default {
|
|
|
|
|
|
},
|
|
|
created() {
|
|
|
+ let self=this;
|
|
|
+ this.regionalQuery();
|
|
|
+ this.companyQuery();
|
|
|
+ this.departmentQuery();
|
|
|
+ if(self.$route.query.newEditType=="edit"){
|
|
|
+ let communityInformation=JSON.parse(sessionStorage.getItem('communityInformation'))
|
|
|
+ // this.ruleForm={
|
|
|
+ // "communityName":communityInformation.communityName,
|
|
|
+ // "locationId":communityInformation.regionId,
|
|
|
+ // "coveredArea":communityInformation.coveredArea,
|
|
|
+ // }
|
|
|
+ this.ruleForm.address=communityInformation.address;
|
|
|
+ this.ruleForm.communityName=communityInformation.communityName;
|
|
|
+ this.ruleForm.regionId=communityInformation.regionId;
|
|
|
+ this.ruleForm.coveredArea=communityInformation.coveredArea;
|
|
|
+ this.ruleForm.contactPerson=communityInformation.contactPerson;
|
|
|
+ this.ruleForm.buildingArea=communityInformation.buildingArea;
|
|
|
+ this.ruleForm.commercialArea=communityInformation.commercialArea;
|
|
|
+ this.ruleForm.dwellingArea=communityInformation.dwellingArea;
|
|
|
+ this.ruleForm.greenArea=communityInformation.greenArea;
|
|
|
+ this.ruleForm.parkingArea=communityInformation.parkingArea;
|
|
|
+ this.ruleForm.phone=communityInformation.phone;
|
|
|
+ this.ruleForm.telephone=communityInformation.telephone;
|
|
|
+
|
|
|
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|