Procházet zdrojové kódy

1、添加车位列表和车库列表

wangfen před 3 roky
rodič
revize
1d617dbd6d

+ 1 - 1
operationSupport/src/components/common/SelectTree.vue

@@ -257,4 +257,4 @@ export default {
     line-height: 40px;
     padding-left: 8px;
 }
-</style>
+</style>

+ 1 - 1
operationSupport/src/store/store.js

@@ -188,4 +188,4 @@ const store = new Vuex.Store({
     }
   }
 })
-export default store;
+export default store;

+ 39 - 63
operationSupport/src/views/communityManagement/index.vue

@@ -15,7 +15,7 @@
             </el-button>
             <div class="search-icon">
                 <!-- 删除 新增 -->
-                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>
+<!--                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>-->
                 <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
             </div>
         </div>
@@ -30,7 +30,7 @@
                 @selection-change="selectionChange"
             >
                 <template slot-scope="scope" slot="opt">
-                    <i @click="addOrEdit('edit', scope.index)" class="iconfont" style="color:#2787F1;margin-right:30px" v-txt-tip data-txt="编辑">&#xe645;</i>
+                    <i @click="addOrEdit('edit', scope)" class="iconfont" style="color:#2787F1;margin-right:30px" v-txt-tip data-txt="编辑">&#xe645;</i>
                     <i @click="deleteOne(scope.row.id)"  class="iconfont" style="color:#FF7272" v-txt-tip data-txt="删除">&#xe63a;</i>
                 </template>
             </zz-table>
@@ -51,23 +51,23 @@ export default {
                 },
                 {
                     label: '所属公司',
-                    prop: 'corporateName'
+                    prop: 'companyName'
                 },
                 {
                     label: '所在地区',
-                    prop: 'location'
+                    prop: 'mangerName'
                 },
                 {
                     label: '详细地址',
-                    prop: 'detailedAddress'
+                    prop: 'address'
                 },
                 {
                     label: '负责人',
-                    prop: 'personCharge'
+                    prop: 'contactPerson'
                 },
                 {
                     label: '负责人电话',
-                    prop: 'personChargeTime'
+                    prop: 'phone'
                 },
                 {
                     label: '操作',
@@ -75,86 +75,44 @@ export default {
                     slot: 'opt'
                 }
             ],
-            selectRow: []
+            selectRow: [],
         };
     },
     methods: {
-        addOrEdit(todo, index) {
+        addOrEdit(todo, scope) {
             new Promise((resolve) => {
                 let row,
                     title = '编辑社区';
                 if ('add' == todo) {
                     title = '新增社区';
                 } else {
-                    row = this.mixins_list[index] || {};
-                    row = JSON.parse(JSON.stringify(row));
+                    this.$http.get('/assets/community/find/'+scope.row.id, {}).then(({ data }) => {
+                        sessionStorage.setItem('communityInformation',JSON.stringify(data))
+                    });
                 }
-                // this.$store.dispatch('openModal', {
-                //     url: '/communityManagement/popups/AddOrEdit.vue',
-                //     title: title,
-                //     width: '850px',
-                //     height: '600px',
-                //     props: {
-                //         data: row,
-                //         todo: todo,
-                //         callback: this.mixins_search
-                //     }
-                // });
-                this.$router.push('/communityManagement/pageJump/AddOrEdit')
+                this.$router.push({
+                    path:'/communityManagement/pageJump/AddOrEdit',
+                    query:{
+                        'newEditType':todo
+                    }
+                })
             }).then(() => {
                 this.mixins_search();
             });
 
-
-            // this.mixins_list=[
-            //     {
-            //         'communityName':'深圳南山区社团',
-            //         'corporateName':'腾讯',
-            //         'location':'南山深圳大学对面',
-            //         'detailedAddress':'深圳南山区',
-            //         'personCharge':'马化腾',
-            //         'personChargeTime':'110'
-            //     }
-            // ]
-        },
-        //批量删除
-        deleteRow() {
-            let ids = [];
-            if (!this.selectRow.length) {
-                this.$message.error('您尚未选择要删除的记录,请选择后再操作批量删除');
-                return;
-            }
-            this.selectRow.forEach((v) => {
-                ids.push(v.id);
-            });
-           this.$msgBox(`刪除社区`, '删除后将无法恢复,请问是否继续?')
-                .then(() => {
-                    this.$http.post('/dict/delete', ids).then(({ status, data, msg }) => {
-                        if (0 === status) {
-                            this.$message({
-                                type: 'success',
-                                message: '删除成功!'
-                            });
-                            this.mixins_search();
-                        } else {
-                            this.$message.error('删除失败!');
-                        }
-                    });
-                })
-                .catch(() => {
-                });
         },
+
         //单个删除
         deleteOne(ids) {
             this.$msgBox(`刪除字典`, '删除后将无法恢复,请问是否继续?')
                 .then(() => {
-                    this.$http.post('/dict/delete', [ids]).then(({ status, data, msg }) => {
+                    this.$http.get('/assets/community/delete', {id:ids}).then(({ status }) => {
                         if (0 === status) {
                             this.$message({
                                 type: 'success',
                                 message: '删除成功!'
                             });
-                            this.mixins_search();
+                            this.addOrEdit();
                         } else {
                             this.$message.error('删除失败!');
                         }
@@ -169,6 +127,23 @@ export default {
         },
         selectionChange(val) {
             this.selectRow = val;
+        },
+        mixins_search(){
+
+        },
+        //获取列表数据
+        communityList(){
+            let submitData={
+
+                "pageNum": 1,
+                "pageSize": 10
+            }
+            this.$http.post('/sc-community/assets/community/page', submitData).then((data) => {
+                this.mixins_list=data.data.list;
+                this.mixins_onQuery=false;
+            }).catch(function () {
+
+            });
         }
     },
     created() {
@@ -177,6 +152,7 @@ export default {
             keyWords: ''
         };
         this.mixins_search();
+        this.communityList();
     }
 };
 </script>

+ 170 - 29
operationSupport/src/views/communityManagement/pageJump/AddOrEdit.vue

@@ -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>

+ 31 - 1
operationSupport/src/views/parkingLotAdministration/index.vue

@@ -28,10 +28,40 @@
         methods: {
             handleClick(tab, event) {
                 console.log(tab, event);
+                if(tab.index=='0'){
+                    this.parkingLotList()
+                }else if(tab.index=='1'){
+                    this.garageManagementList();
+                }
+            },
+            //获取列表数据
+            parkingLotList(){
+                let submitData={
+                    "pageNum": 1,
+                    "pageSize": 10
+                }
+                this.$http.post('/sc-community/assets/garage/parking/page', submitData).then((data) => {
+                    // this.mixins_list=data.data.list;
+                    // this.mixins_onQuery=false;
+                }).catch(function () {
+
+                });
+            },
+            garageManagementList(){
+                let submitData={
+                    "pageNum": 1,
+                    "pageSize": 10
+                }
+                this.$http.post('/sc-community/assets/garage/page', submitData).then((data) => {
+                    // this.mixins_list=data.data.list;
+                    // this.mixins_onQuery=false;
+                }).catch(function () {
+
+                });
             }
         },
         created() {
-
+           // this.parkingLotList()
         }
     };
 </script>

+ 1 - 1
operationSupport/vue.config.js

@@ -125,7 +125,7 @@ module.exports = {
                 changeOrigin: true, // 允许websockets跨域
                 logLevel: 'debug',
                 pathRewrite: {
-                    // "^/api": "" 
+                    // "^/api": ""
                 }
             },
         }