Pārlūkot izejas kodu

1、添加车位管理和车库管理增删改查

wangfen 3 gadi atpakaļ
vecāks
revīzija
6009e720f9

+ 3 - 2
operationSupport/src/config/env.development.js

@@ -12,7 +12,8 @@ module.exports = {
 
   baseUrl: "http://114.135.61.188:18093/sc-operation/", // 项目地址
   baseCeAPI:'http://114.135.61.186:21020',
-  baseApi: "http://192.168.0.121:8082/", // 本地api请求地址
+  // baseApi: "http://192.168.0.121:8082/", // 本地api请求地址
+  baseApi: "http://114.135.61.186:21020/", // 本地api请求地址
   baseMapApi: "http://114.135.61.187:38082", // arcgis API
   baseImgApi: "http://114.135.61.186:21020", // 图片api请求地址
   baseExcelApi: "http://114.135.61.187:38082", // excel请求地址
@@ -27,4 +28,4 @@ module.exports = {
     imageSize: 5, // MB
     excelSize: 10 // MB
   },
-};
+};

+ 3 - 3
operationSupport/src/views/communityManagement/pageJump/AddOrEdit.vue

@@ -107,10 +107,10 @@ export default {
             ruleForm: {
                 communityName: '',
                 locationList:[],
-                regionId:'',//所在地区
+                regionId:100000,//所在地区
                 companyOrgList:[],
-                companyOrgId:'',//所属公司
-                deptOrgId:'',//所属部门
+                companyOrgId:2,//所属公司
+                deptOrgId:1,//所属部门
                 coveredArea:'',//占地面积
                 buildingArea:'',//建筑面积
                 commercialArea:'',//商业面积

+ 51 - 34
operationSupport/src/views/parkingLotAdministration/garageList.vue

@@ -2,16 +2,16 @@
     <div class="main">
         <div class="search">
             <el-input placeholder="车位号" class="search-input"></el-input>
-            <el-select placeholder="请选择社区">
-                <el-option label="社区一" value="shanghai"></el-option>
-                <el-option label="社区二" value="beijing"></el-option>
+            <el-select v-model="communityName" placeholder="请选择社区名称" @change="communityChoice">
+                <el-option label="清空" value=""></el-option>
+                <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
             </el-select>
             <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search">查询
                 <!-- <i class="iconfont">&#xe6fc;</i> -->
             </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>
@@ -26,7 +26,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;margin-right:30px;" v-txt-tip data-txt="删除">&#xe63a;</i>
                     <i @click="partitionManagement" class="iconfont" style="color:#2787F1;" v-txt-tip data-txt="分区管理">&#xe645;</i>
                 </template>
@@ -39,6 +39,10 @@
     export default {
         data() {
             return {
+                parkingNumber:'',
+                communityList:[],//社区名称下拉列表
+                communityName:'',//社区名称
+                communityId:'',//社区id
                 selectName: 'parkingLot',
                 cols: [
                     {
@@ -49,7 +53,7 @@
                         prop: 'garageName'
                     },{
                         label: '车位数量',
-                        prop: 'parkingLotQuantity'
+                        prop: 'parkingNumber'
                     },{
                         label: '备注',
                         prop: 'remarks'
@@ -59,44 +63,57 @@
                         slot: 'opt'
                     }
                 ],
-                tableData: [{
-                    communityName: '王小虎',
-                    garageName:'深圳车库',
-                    parkingLotQuantity:'2123',
-                    remarks:'还有很多',
-                }, {
-                    communityName: '王小虎',
-                    garageName:'北京车库',
-                    parkingLotQuantity:'1521',
-                    remarks:'还有不少',
-                }]
+                // tableData: []
             };
         },
+        props:{
+            tableData:{
+                type: Array,
+                default: "",
+            },
+        },
         methods: {
-            handleClick(tab, event) {
-                console.log(tab, event);
+            //获取社区名称下拉列表
+            communityNameList(){
+                this.communityList=[];
+                let onOption='';
+                this.$http.get('/assets/community/list', {}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.communityName,
+                            id:res.id
+                        }
+                        this.communityList.push(onOption)
+                    })
+                });
             },
-            addOrEdit(todo, index) {
+            addOrEdit(todo, scope) {
+                let self=this;
                 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('/sc-community-web/assets/garage/find/'+scope.row.id, {}).then((res) => {
+                            // sessionStorage.setItem('communityInformation',JSON.stringify(data))
+                            row=res.data;
+                        });
                     }
-                    this.$store.dispatch('openModal', {
-                        url: '/parkingLotAdministration/pageJump/garageSaveEdits.vue',
-                        title: title,
-                        width: '850px',
-                        height: '600px',
-                        props: {
-                            data: row,
-                            todo: todo,
-                            callback: this.mixins_search
-                        }
-                    });
+                    setTimeout(function(){
+                        self.$store.dispatch('openModal', {
+                            url: '/parkingLotAdministration/pageJump/garageSaveEdits.vue',
+                            title: title,
+                            width: '850px',
+                            height: '600px',
+                            props: {
+                                data: row,
+                                todo: todo,
+                                callback: self.mixins_search
+                            }
+                        });
+                    },1000)
+
                 }).then(() => {
                     this.mixins_search();
                 });
@@ -131,7 +148,7 @@
             },
         },
         created() {
-
+            this.communityNameList();
         }
     };
 </script>

+ 8 - 5
operationSupport/src/views/parkingLotAdministration/index.vue

@@ -2,10 +2,10 @@
     <div class="main">
         <el-tabs v-model="selectName" @tab-click="handleClick">
             <el-tab-pane label="车位管理" name="parkingLot">
-                 <parking-space-list></parking-space-list>
+                 <parking-space-list :tableData="tableData"></parking-space-list>
             </el-tab-pane>
             <el-tab-pane label="车库管理" name="garage">
-                <garage-list></garage-list>
+                <garage-list :tableData="tableData"></garage-list>
             </el-tab-pane>
         </el-tabs>
     </div>
@@ -19,6 +19,7 @@
         data() {
             return {
                 selectName: 'parkingLot',
+                tableData:[],
             };
         },
         components: {
@@ -40,7 +41,8 @@
                     "pageNum": 1,
                     "pageSize": 10
                 }
-                this.$http.post('/sc-community/assets/garage/parking/page', submitData).then((data) => {
+                this.$http.post('/sc-community/assets/garage/parking/page', submitData).then(res=> {
+                    this.tableData=res.data.list;
                     // this.mixins_list=data.data.list;
                     // this.mixins_onQuery=false;
                 }).catch(function () {
@@ -52,7 +54,8 @@
                     "pageNum": 1,
                     "pageSize": 10
                 }
-                this.$http.post('/sc-community/assets/garage/page', submitData).then((data) => {
+                this.$http.post('/sc-community/assets/garage/page', submitData).then(res => {
+                    this.tableData=res.data.list;
                     // this.mixins_list=data.data.list;
                     // this.mixins_onQuery=false;
                 }).catch(function () {
@@ -61,7 +64,7 @@
             }
         },
         created() {
-           // this.parkingLotList()
+           this.parkingLotList()
         }
     };
 </script>

+ 98 - 11
operationSupport/src/views/parkingLotAdministration/pageJump/garageSaveEdits.vue

@@ -5,21 +5,24 @@
                 <el-row>
                     <el-col :span="24">
                         <el-form-item label="社区名称" prop="communityName">
-                            <el-input v-model="ruleForm.communityName"></el-input>
+                            <el-select v-model="ruleForm.communityName" placeholder="请选择社区名称" @change="communityChoice">
+                                <el-option label="清空" value=""></el-option>
+                                <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
+                            </el-select>
                         </el-form-item>
                         <el-form-item label="车库名称" prop="garageName">
-                            <el-select v-model="ruleForm.garageName" placeholder="请选择车库名称">
-                                <el-option label="北京车库" value="shanghai"></el-option>
-                                <el-option label="上海车库" value="beijing"></el-option>
+                            <el-select v-model="ruleForm.garageName" placeholder="请选择车库名称" @change="garageChoice">
+                                <el-option label="清空" value=""></el-option>
+                                <el-option v-for="(item,index) in garageList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
                         <el-form-item label="车位数量">
                             <el-input v-model="ruleForm.parkingLotQuantity"></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>
+                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remarks.length}}/300</span>
                         </el-form-item>
                     </el-col>
                 </el-row>
@@ -29,13 +32,21 @@
 </template>
 <script>
     export default {
+        props: ["params"],
         data() {
             return {
+                // parkingNumber:'',
+                communityList:[],//社区名称下拉列表
+                // communityName:'',//社区名称
+                // communityId:'',//社区id
+                garageList:[],//车库名称下拉列表
+                // garageName:'',//车库名称
                 ruleForm: {
                     communityName: '',//社区名称
+                    communityList:[],//社区名称下拉列表
                     garageName:'',//车库名称
                     parkingLotQuantity:'',//车位数量
-                    remark:'',//备注
+                    remarks:'',//备注
                 },
                 rules: {
                     communityName: [
@@ -52,10 +63,66 @@
         },
         computed: {},
         methods: {
+            //获取社区名称下拉列表
+            communityNameList(){
+                this.communityList=[];
+                let onOption='';
+                this.$http.get('/assets/community/list', {}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.communityName,
+                            id:res.id
+                        }
+                        this.communityList.push(onOption)
+                    })
+                });
+            },
+            communityChoice(e){
+                console.log(e)
+                this.communityId=e;
+                this.garageNameList();
+            },
+            //获取车库名称下拉列表
+            garageNameList(){
+                this.garageList=[];
+                let onOption='';
+                this.$http.post('/assets/garage/list', {communityId:this.communityId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.garageName,
+                            id:res.id
+                        }
+                        this.garageList.push(onOption)
+                    })
+                });
+            },
             submit() {
+                let formData='';
                 this.$refs['ruleForm'].validate((valid) => {
                     if (valid) {
-                        alert('submit!');
+                        if(this.params.todo=='edit'){
+                            formData={
+                                "communityId": this.communityId,
+                                "garageName": this.ruleForm.garageName,
+                                "id": 0,
+                                "parkingNumber":this.ruleForm.parkingLotQuantity,
+                                "remarks":this.ruleForm.remarks,
+                            }
+                            this.$http.post('/assets/garage/update', formData).then((res) => {
+
+                            });
+                        }else{
+                            formData={
+                                "communityId": this.communityId,
+                                "garageName": this.ruleForm.garageName,
+                                "id": 0,
+                                "parkingNumber":this.ruleForm.parkingLotQuantity,
+                                "remarks":this.ruleForm.remarks,
+                            }
+                            this.$http.post('/assets/garage/add', formData).then((res) => {
+
+                            });
+                        }
                     } else {
                         console.log('error submit!!');
                         return false;
@@ -90,12 +157,32 @@
             },
             addressQueryClick(){
                 this.mapPopUpStatus=true;
-            }
-
+            },
 
+            //展示添加和编辑
+            addEditPresentation(){
+                if(this.params.todo=='edit'){
+                    this.ruleForm.communityName=this.params.data.communityId;
+                    this.ruleForm.parkingBeginNumber=this.params.data.parkingBeginNumber;
+                    this.ruleForm.parkingEndNumber=this.params.data.parkingEndNumber;
+                    this.ruleForm.parkingType=String(this.params.data.parkingType);
+                    this.ruleForm.parkingArea=this.params.data.parkingArea;
+                    this.ruleForm.parkingNumber=this.params.data.parkingNumber;
+                    this.ruleForm.remarks=this.params.data.remarks;
+                }else{
+                    this.false=true;
+                    this.ruleForm.communityName='';
+                    this.ruleForm.parkingBeginNumber='';
+                    this.ruleForm.parkingEndNumber=this.params.data.parkingEndNumber;
+                    this.ruleForm.parkingType='1';
+                    this.ruleForm.parkingArea='';
+                    this.ruleForm.remarks='';
+                }
+            },
         },
         created() {
-
+            this.communityNameList();
+            this.addEditPresentation()
         }
     };
 </script>

+ 165 - 24
operationSupport/src/views/parkingLotAdministration/pageJump/parkingLotSaveEdits.vue

@@ -5,43 +5,50 @@
                 <el-row>
                     <el-col :span="12">
                         <el-form-item label="社区名称" prop="communityName">
-                            <el-input v-model="ruleForm.communityName"></el-input>
+<!--                            <el-input v-model="ruleForm.communityName"></el-input>-->
+                            <el-select v-model="ruleForm.communityName" placeholder="请选择社区名称" @change="communityChoice">
+                                <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
+                            </el-select>
                         </el-form-item>
                         <el-form-item label="车库区域">
-                            <el-select v-model="ruleForm.garageArea" placeholder="请选择车库区域">
-                                <el-option label="1车库区域" value="shanghai"></el-option>
-                                <el-option label="2车库区域" value="beijing"></el-option>
+                            <el-select v-model="ruleForm.garageArea" placeholder="请选择车库区域" @change="garageAreaChoice">
+                                <el-option v-for="(item,index) in garageAreaList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="前缀名称" prop="prefixName">
+                        <el-form-item label="前缀名称" prop="prefixName" v-if="codingStatus==false">
                             <el-input v-model="ruleForm.prefixName"></el-input>
                         </el-form-item>
-                        <el-form-item label="车位编号">
-                            <el-input v-model="ruleForm.parkingSpaceNumber"></el-input>
+                        <el-form-item label="起始编号" v-if="codingStatus==false">
+                            <el-input v-model="ruleForm.parkingBeginNumber" prop="parkingBeginNumber"></el-input>
+                        </el-form-item>
+                        <el-form-item label="车位编号" v-if="codingStatus==true">
+                            <el-input v-model="ruleForm.parkingNumber" prop="parkingNumber"></el-input>
                         </el-form-item>
                     </el-col>
                     <el-col :span="12">
                         <el-form-item label="车库名称" prop="garageName">
-                            <el-select v-model="ruleForm.garageName" placeholder="请选择车库名称">
-                                <el-option label="北京车库" value="shanghai"></el-option>
-                                <el-option label="上海车库" value="beijing"></el-option>
+                            <el-select v-model="ruleForm.garageName" placeholder="请选择车库名称" @change="garageChoice">
+                                <el-option v-for="(item,index) in garageList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="车位类别" prop="parkingLotCategory">
-                            <el-radio v-model="radio" label="1">公共车位</el-radio>
-                            <el-radio v-model="radio" label="2">私人车位</el-radio>
+                        <el-form-item label="车位类别" prop="parkingType">
+                            <el-radio v-model="ruleForm.parkingType" label="1">公共车位</el-radio>
+                            <el-radio v-model="ruleForm.parkingType" label="2">私人车位</el-radio>
                         </el-form-item>
                         <el-form-item label="车位面积">
-                            <el-input v-model="ruleForm.useArea"></el-input>
+                            <el-input v-model="ruleForm.parkingArea"></el-input>
+                        </el-form-item>
+                        <el-form-item label="结束编号" prop="parkingEndNumber" v-if="codingStatus==false">
+                            <el-input v-model="ruleForm.parkingEndNumber"></el-input>
                         </el-form-item>
                     </el-col>
                 </el-row>
                 <el-row>
                     <el-col :span="24">
                         <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>
+                            <span style="position:absolute;bottom:0;right:10px">{{ruleForm.remarks.length}}/300</span>
                         </el-form-item>
                     </el-col>
                 </el-row>
@@ -51,16 +58,27 @@
 </template>
 <script>
     export default {
+        props: ["params"],
         data() {
             return {
+                communityList:[],//社区名称下拉列表
+                garageList:[],//车库名称下拉列表
+                garageAreaList:[],//车库区域下拉列表
+                codingStatus:false,//编码状态
                 ruleForm: {
                     communityName: '',//社区名称
+                    communityId:'',//社区id
                     garageArea:'',//车位区域
+                    garageAreaId:'',//车库区域id
                     prefixName:'',//前缀名称
-                    parkingSpaceNumber:'',//车位编号
+                    parkingBeginNumber:'',//车位起始编号
+                    parkingEndNumber:'',//车位结束编号
+                    parkingNumber:'',//车位编号
                     garageName:'',//车库名称
-                    parkingLotCategory:'',//车位类别
-                    remark:'',//备注
+                    garageId:'',//车库名称id
+                    parkingType:'1',//车位类别
+                    parkingArea:'',//车位面积
+                    remarks:'',//备注
                 },
                 rules: {
                     communityName: [
@@ -68,8 +86,11 @@
                         // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                     ],
                     prefixName:[{ required: true, message: '请输入前缀名称', trigger: 'change' }],
-                    garageName:[{ required: true, message: '请输入前缀名称', trigger: 'change' }],
-                    parkingLotCategory:[{ required: true, message: '请输入前缀名称', trigger: 'change' }],
+                    garageName:[{ required: true, message: '请选择车库名称', trigger: 'change' }],
+                    parkingType:[{ required: true, message: '请选择车位类别', trigger: 'change' }],
+                    parkingBeginNumber:[{ required: true, message: '请填写起始编码', trigger: 'change' }],
+                    parkingEndNumber:[{ required: true, message: '请填写结束编码', trigger: 'change' }],
+                    parkingNumber:[{ required: true, message: '请填写车位编号', trigger: 'change' }],
                 },
                 radio: '1',
             }
@@ -79,15 +100,51 @@
         },
         computed: {},
         methods: {
+            //保存
             submit() {
+                let formData='';
                 this.$refs['ruleForm'].validate((valid) => {
                     if (valid) {
-                        alert('submit!');
+                        if(this.params.todo=='edit'){
+                            formData={
+                                "communityId": this.ruleForm.communityId,
+                                "garageAreaId": this.ruleForm.garageAreaId,
+                                "garageId": this.ruleForm.garageId,
+                                "id": this.params.data.id,
+                                "parkingArea": this.ruleForm.parkingArea,
+                                // "parkingBeginNumber": this.ruleForm.parkingBeginNumber,
+                                // "parkingEndNumber": this.ruleForm.parkingEndNumber,
+                                "parkingNumber": this.ruleForm.parkingNumber,
+                                "parkingType": this.ruleForm.parkingType,
+                                // "prefix": this.ruleForm.prefixName,
+                                "remarks": this.ruleForm.remarks
+                            }
+                            this.$http.post('/assets/garage/parking/update', formData).then((res) => {
+
+                            });
+                        }else{
+                            formData={
+                                "communityId": this.ruleForm.communityId,
+                                "garageAreaId": this.ruleForm.garageAreaId,
+                                "garageId": this.ruleForm.garageId,
+                                "id": 0,
+                                "parkingArea": this.ruleForm.parkingArea,
+                                "parkingBeginNumber": this.ruleForm.parkingBeginNumber,
+                                "parkingEndNumber": this.ruleForm.parkingEndNumber,
+                                "parkingType": this.ruleForm.parkingType,
+                                "prefix": this.ruleForm.prefixName,
+                                "remarks": this.ruleForm.remarks
+                            }
+                            this.$http.post('/assets/garage/parking/add', formData).then((res) => {
+
+                            });
+                        }
                     } else {
                         console.log('error submit!!');
                         return false;
                     }
                 });
+
             },
             resetForm(formName) {
                 this.$refs[formName].resetFields();
@@ -117,12 +174,96 @@
             },
             addressQueryClick(){
                 this.mapPopUpStatus=true;
-            }
+            },
+
+            //获取社区名称下拉列表
+            communityNameList(){
+                this.communityList=[];
+                let onOption='';
+                this.$http.get('/assets/community/list', {}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.communityName,
+                            id:res.id
+                        }
+                        this.communityList.push(onOption)
+                    })
+                });
+            },
+
+
+            communityChoice(e){
+                console.log(e)
+                this.ruleForm.communityId=e;
+                this.garageNameList();
+            },
 
+            //获取车库名称下拉列表
+            garageNameList(){
+                this.garageList=[];
+                let onOption='';
+                this.$http.post('/assets/garage/list', {communityId:this.ruleForm.communityId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.garageName,
+                            id:res.id
+                        }
+                        this.garageList.push(onOption)
+                    })
+                });
+            },
+
+            garageChoice(e){
+                console.log(e)
+                this.ruleForm.garageId=e;
+                this.garageAreaListQuery()
+            },
 
+            garageAreaListQuery(){
+                this.garageAreaList=[];
+                let onOption='';
+                this.$http.post('/assets/garage/area/list', {communityId:this.ruleForm.garageId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.areaName,
+                            id:res.id
+                        }
+                        this.garageAreaList.push(onOption)
+                    })
+                });
+            },
+
+            garageAreaChoice(e){
+                this.ruleForm.garageAreaId=e;
+            },
+
+
+            //展示添加和编辑
+            addEditPresentation(){
+                if(this.params.todo=='edit'){
+                    this.codingStatus=true;
+                    this.ruleForm.communityName=this.params.data.communityId;
+                    this.ruleForm.parkingBeginNumber=this.params.data.parkingBeginNumber;
+                    this.ruleForm.parkingEndNumber=this.params.data.parkingEndNumber;
+                    this.ruleForm.parkingType=String(this.params.data.parkingType);
+                    this.ruleForm.parkingArea=this.params.data.parkingArea;
+                    this.ruleForm.parkingNumber=this.params.data.parkingNumber;
+                    this.ruleForm.remarks=this.params.data.remarks;
+                }else{
+                    this.codingStatus=true;
+                    this.ruleForm.communityName='';
+                    this.ruleForm.parkingBeginNumber='';
+                    this.ruleForm.parkingEndNumber=this.params.data.parkingEndNumber;
+                    this.ruleForm.parkingType='1';
+                    this.ruleForm.parkingArea='';
+                    this.ruleForm.remarks='';
+                }
+            },
         },
         created() {
-
+            //获取社区名称下拉列表
+            this.communityNameList();
+            this.addEditPresentation()
         }
     };
 </script>

+ 20 - 17
operationSupport/src/views/parkingLotAdministration/pageJump/partitionManagement.vue

@@ -8,7 +8,7 @@
             <div class="search-icon">
                 <!-- 删除 新增 -->
                 <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
-                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>
+<!--                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>-->
             </div>
         </div>
         <div>
@@ -41,10 +41,10 @@
                         prop: 'garageName'
                     },{
                         label: '分区名称',
-                        prop: 'garageName'
+                        prop: 'areaName'
                     },{
                         label: '车位数量',
-                        prop: 'parkingLotQuantity'
+                        prop: 'parkingNumber'
                     },{
                         label: '备注',
                         prop: 'remarks'
@@ -54,17 +54,7 @@
                         slot: 'opt'
                     }
                 ],
-                tableData: [{
-                    communityName: '王小虎',
-                    garageName:'深圳车库',
-                    parkingLotQuantity:'2123',
-                    remarks:'还有很多',
-                }, {
-                    communityName: '王小虎',
-                    garageName:'北京车库',
-                    parkingLotQuantity:'1521',
-                    remarks:'还有不少',
-                }]
+                tableData: []
             };
         },
         methods: {
@@ -78,8 +68,8 @@
                     if ('add' == todo) {
                         title = '分区添加';
                     } else {
-                        row = this.mixins_list[index] || {};
-                        row = JSON.parse(JSON.stringify(row));
+                        // row = this.mixins_list[index] || {};
+                        // row = JSON.parse(JSON.stringify(row));
                     }
                     this.$store.dispatch('openModal', {
                         url: '/parkingLotAdministration/pageJump/zoneAddEdit.vue',
@@ -119,9 +109,22 @@
                         });
                     });
             },
+            garageManagementList(){
+                let submitData={
+                    "pageNum": 1,
+                    "pageSize": 10
+                }
+                this.$http.post('/sc-community-web/assets/garage/area/page', submitData).then(res => {
+                    if(res.status==0){
+                        this.tableData=res.data.list;
+                    }
+                }).catch(function () {
+
+                });
+            }
         },
         created() {
-
+            this.garageManagementList()
         }
     };
 </script>

+ 19 - 4
operationSupport/src/views/parkingLotAdministration/pageJump/zoneAddEdit.vue

@@ -5,9 +5,9 @@
                 <el-row>
                     <el-col :span="24">
                         <el-form-item label="车库名称" prop="garageName">
-                            <el-select v-model="ruleForm.garageName" placeholder="请选择车库名称">
-                                <el-option label="北京车库" value="shanghai"></el-option>
-                                <el-option label="上海车库" value="beijing"></el-option>
+                            <el-select v-model="ruleForm.garageName" placeholder="请选择车库名称" @change="garageChoice">
+                                <el-option label="清空" value=""></el-option>
+                                <el-option v-for="(item,index) in garageList" :label="item.label" :value="item.id"></el-option>
                             </el-select>
                         </el-form-item>
                         <el-form-item label="分区名称" prop="partitionName">
@@ -35,6 +35,7 @@
     export default {
         data() {
             return {
+                garageList:[],//车库名称下拉列表
                 ruleForm: {
                     garageName:'',//车库名称
                     partitionName:'',//分区名称
@@ -53,6 +54,20 @@
         },
         computed: {},
         methods: {
+            //获取车库名称下拉列表
+            garageNameList(){
+                this.garageList=[];
+                let onOption='';
+                this.$http.post('/assets/garage/list', {communityId:this.communityId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.garageName,
+                            id:res.id
+                        }
+                        this.garageList.push(onOption)
+                    })
+                });
+            },
             submit() {
                 this.$refs['ruleForm'].validate((valid) => {
                     if (valid) {
@@ -96,7 +111,7 @@
 
         },
         created() {
-
+           this.garageNameList();
         }
     };
 </script>

+ 106 - 66
operationSupport/src/views/parkingLotAdministration/parkingSpaceList.vue

@@ -2,20 +2,20 @@
     <div class="main">
         <div class="search">
             <el-input placeholder="车位号" class="search-input"></el-input>
-            <el-select placeholder="请选择社区">
-                <el-option label="社区一" value="shanghai"></el-option>
-                <el-option label="社区二" value="beijing"></el-option>
+            <el-select v-model="communityName" placeholder="请选择社区名称" @change="communityChoice">
+                <el-option label="清空" value=""></el-option>
+                <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id" @change="communityChoice"></el-option>
             </el-select>
-            <el-select placeholder="所属车库">
-                <el-option label="车库一" value="shanghai"></el-option>
-                <el-option label="车库二" value="beijing"></el-option>
+            <el-select v-model="garageName" placeholder="请选择车库名称" @change="garageChoice">
+                <el-option label="清空" value=""></el-option>
+                <el-option v-for="(item,index) in garageList" :label="item.label" :value="item.id"></el-option>
             </el-select>
             <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search">查询
                 <!-- <i class="iconfont">&#xe6fc;</i> -->
             </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>
@@ -42,9 +42,14 @@
     export default {
         data() {
             return {
+                parkingNumber:'',
+                communityList:[],//社区名称下拉列表
+                communityName:'',//社区名称
+                communityId:'',//社区id
+                garageList:[],//车库名称下拉列表
+                garageName:'',//车库名称
                 selectName: 'parkingLot',
-                cols: [
-                    {
+                cols: [{
                         label: '所属社区',
                         prop: 'communityName'
                     },
@@ -54,23 +59,23 @@
                     },
                     {
                         label: '所在地区',
-                        prop: 'region'
+                        prop: 'garageAreaName'
                     },
                     {
                         label: '车库区域',
-                        prop: 'garageArea'
+                        prop: 'garageAreaName'
                     },
                     {
                         label: '车位号',
-                        prop: 'parkingSpaceNumber'
+                        prop: 'parkingNumber'
                     },
                     {
                         label: '车位类别',
-                        prop: 'parkingSpaceCategory'
+                        prop: 'parkingType'
                     },
                     {
                         label: '车位面积',
-                        prop: 'parkingSpaceArea'
+                        prop: 'parkingArea'
                     },
                     {
                         label: '操作',
@@ -78,75 +83,107 @@
                         slot: 'opt'
                     }
                 ],
-                tableData: [{
-                    communityName: '王小虎',
-                    garageName:'深圳车库',
-                    region:'深圳',
-                    garageArea:'宝安区',
-                    parkingSpaceNumber:'001',
-                    parkingSpaceCategory:'丰田',
-                    parkingSpaceArea:'2.5米'
-                }, {
-                    communityName: '王小虎',
-                    garageName:'北京车库',
-                    region:'北京',
-                    garageArea:'定海区',
-                    parkingSpaceNumber:'002',
-                    parkingSpaceCategory:'红旗',
-                    parkingSpaceArea:'2.5米'
-                }, {
-                    communityName: '王小虎',
-                    garageName:'上海车库',
-                    region:'上海',
-                    garageArea:'闵行区',
-                    parkingSpaceNumber:'003',
-                    parkingSpaceCategory:'大众',
-                    parkingSpaceArea:'2.5米'
-                }, {
-                    communityName: '王小虎',
-                    garageName:'广州车库',
-                    region:'广州',
-                    garageArea:'天河区',
-                    parkingSpaceNumber:'004',
-                    parkingSpaceCategory:'本田',
-                    parkingSpaceArea:'2.5米'
-                }]
+                // tableData: []
             };
         },
+        props:{
+            tableData:{
+                type: Array,
+                default: "",
+            },
+        },
         methods: {
-            handleClick(tab, event) {
-                console.log(tab, event);
+            //获取社区名称下拉列表
+            communityNameList(){
+                this.communityList=[];
+                let onOption='';
+                this.$http.get('/assets/community/list', {}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.communityName,
+                            id:res.id
+                        }
+                        this.communityList.push(onOption)
+                    })
+                });
+            },
+            communityChoice(e){
+                console.log(e)
+                this.communityId=e;
+                this.garageNameList();
             },
-            addOrEdit(todo, index) {
+            //获取车库名称下拉列表
+            garageNameList(){
+                this.garageList=[];
+                let onOption='';
+                this.$http.post('/assets/garage/list', {communityId:this.communityId}).then((res) => {
+                    res.data.map(res=>{
+                        onOption={
+                            label:res.garageName,
+                            id:res.id
+                        }
+                        this.garageList.push(onOption)
+                    })
+                });
+            },
+            addOrEdit(todo, scope) {
+                let self=this;
                 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/garage/parking/find/'+scope.row.id, {}).then((res) => {
+                            // sessionStorage.setItem('communityInformation',JSON.stringify(data))
+                            row=res.data;
+                        });
                     }
-                    this.$store.dispatch('openModal', {
-                        url: '/parkingLotAdministration/pageJump/parkingLotSaveEdits.vue',
-                        title: title,
-                        width: '850px',
-                        height: '600px',
-                        props: {
-                            data: row,
-                            todo: todo,
-                            callback: this.mixins_search
-                        }
-                    });
+                    setTimeout(function(){
+                        self.$store.dispatch('openModal', {
+                            url: '/parkingLotAdministration/pageJump/parkingLotSaveEdits.vue',
+                            title: title,
+                            width: '850px',
+                            height: '600px',
+                            props: {
+                                data: row,
+                                todo: todo,
+                                callback: self.mixins_search
+                            }
+                        });
+                    },1000)
                 }).then(() => {
                     this.mixins_search();
                 });
             },
+
+            mixins_search(){
+                this.parkingLotList();
+            },
+
+
+            //获取列表数据
+            parkingLotList(){
+                let submitData={
+                    "communityId":this.communityId,
+                    "garageId":this.garageId,
+                    "parkingNumber":this.parkingNumber,
+                    "pageNum": 1,
+                    "pageSize": 10
+                }
+                this.$http.post('/sc-community/assets/garage/parking/page', submitData).then(res=> {
+                    this.tableData=res.data.list;
+                    // this.mixins_list=data.data.list;
+                    // this.mixins_onQuery=false;
+                }).catch(function () {
+
+                });
+            },
             //单个删除
             deleteOne(ids) {
                 this.$msgBox(`刪除字典`, '删除后将无法恢复,请问是否继续?')
                     .then(() => {
-                        this.$http.post('/dict/delete', [ids]).then(({ status, data, msg }) => {
+                        this.$http.get('/assets/garage/parking/delete', {id:ids}).then(({ status }) => {
                             if (0 === status) {
                                 this.$message({
                                     type: 'success',
@@ -166,8 +203,11 @@
                     });
             },
         },
-        created() {
+        mounted(){
 
+        },
+        created() {
+           this.communityNameList();
         }
     };
 </script>