瀏覽代碼

修复社区

Shannon_mu 3 年之前
父節點
當前提交
8ccb7fa746

+ 10 - 10
operationSupport/src/assets/css/main.scss

@@ -444,12 +444,7 @@ a {
             vertical-align: middle;
         }
     }
-    .search-icon {
-        float: right;
-        i:first-child {
-            margin-right: 0;
-        }
-    }
+
     .el-date-editor {
         width: 400px;
     }
@@ -717,10 +712,12 @@ a {
     }
 }
 .search .search-icon {
+    float: right;
     i.iconfont {
         margin-right: 20px;
         @include searchTextBotton;
     }
+
     i.zoniot_font {
         margin-right: 20px;
         line-height: inherit;
@@ -730,6 +727,9 @@ a {
         margin-right: 20px;
         @include searchTextBotton;
     }
+    i:last-child {
+        margin-right: 0;
+    }
 }
 .handle-box,
 .search,
@@ -770,7 +770,7 @@ div.box-40 {
 }
 .content {
     .content-right {
-      width: calc(100% - 280px);
-			float:right;
-  }
-}
+        width: calc(100% - 280px);
+        float: right;
+    }
+}

+ 16 - 0
operationSupport/src/store/store.js

@@ -41,6 +41,9 @@ const store = new Vuex.Store({
     nationArray: [],
     //所有籍贯
     nativeArray: [],
+    //公司部门
+    companyArray: [],
+    departmentArray: [],
   },
   getters: {
     getTheme(state) {
@@ -88,7 +91,14 @@ const store = new Vuex.Store({
     },
     getNativeArray(state) {
       return state.nativeArray
+    },
+    getCompanyArray(state) {
+      return state.companyArray
+    },
+    getDepartmentArray(state) {
+      return state.departmentArray
     }
+
   },
   mutations: {
     setSearchPointInfo(state, data) {
@@ -138,6 +148,12 @@ const store = new Vuex.Store({
     },
     setNativeArray(state, data) {
       state.nativeArray = data
+    },
+    setCompanyArray(state, data) {
+      state.companyArray = data
+    },
+    setDepartmentArray(state, data) {
+      state.departmentArray = data
     }
   },
   actions: {

+ 57 - 20
operationSupport/src/views/communityManagement/index.vue

@@ -1,11 +1,23 @@
 <template>
     <div class="main">
         <div class="search" v-if="!communitStatus">
-            <el-input placeholder="社区名称" class="search-input" v-model.trim="mixins_query.communityName" clearable></el-input>
-            <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search">查询 </el-button>
-            <div class="search-icon">
-                <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
-            </div>
+            <dmp-newsearch :normal="normal" :query="mixins_query" @search="queryList">
+                <template slot="companyOrgId">
+                    <select-tree
+                        class="new-select-tree"
+                        selectTreeTitle="请选择公司"
+                        placeholder="请选择公司"
+                        :options="companyArray"
+                        :props="defaultProps"
+                        v-model="mixins_query.companyOrgId"
+                    />
+                </template>
+                <div class="search-icon opt" slot="right-opt">
+                    <el-tooltip class="item" effect="light" placement="bottom" content="新增">
+                        <i class="iconfont" @click="addOrEdit('add')">&#xe641;</i>
+                    </el-tooltip>
+                </div>
+            </dmp-newsearch>
         </div>
         <zz-table
             v-if="!communitStatus"
@@ -71,14 +83,36 @@ export default {
                     slot: 'opt'
                 }
             ],
+            normal: [
+                {
+                    prop: 'communityName',
+                    placeholder: '社区名称'
+                },
+                {
+                    prop: 'companyOrgId',
+                    slot: 'companyOrgId'
+                }
+            ],
             activeData: {},
             isAdd: true,
-            communitStatus: ''
+            communitStatus: '',
+            defaultProps: {
+                value: 'id', // 唯一标识
+                label: 'orgName', // 标签显示
+                children: 'orgs' // 子级
+            }
         };
     },
+    computed: {
+        companyArray() {
+            return this.$store.getters['getCompanyArray'];
+        }
+    },
     methods: {
+        queryList(type = 'search') {
+            this.mixins_search(type);
+        },
         clerOwnerStatus() {
-            debugger;
             this.communitStatus = '';
             this.activeData = {};
             this.isAdd = true;
@@ -110,22 +144,25 @@ export default {
                 })
                 .catch(() => {});
         },
-        //获取列表数据
-        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 () {});
+        getCompany(type) {
+            this.$http.postForm('/sc-user-center/org/getOrgTree', { orgType: type }).then(({ status, data, msg }) => {
+                if (status === 0 && data) {
+                    if (type == 'company') {
+                        this.$store.commit('setCompanyArray', data);
+                    } else if (type == 'department') {
+                        this.$store.commit('setDepartmentArray', data);
+                    }
+                }
+            });
         }
     },
     created() {
+        if (this.$store.getters['getCompanyArray'].length === 0) {
+            this.getCompany('company');
+        }
+        if (this.$store.getters['getDepartmentArray'].length === 0) {
+            this.getCompany('department');
+        }
         this.mixins_post = 'post';
         this.mixins_dataUrl = '/assets/community/page';
         this.mixins_search();

+ 81 - 69
operationSupport/src/views/communityManagement/pageJump/AddOrEdit.vue

@@ -17,7 +17,7 @@
                     ></el-cascader>
                 </el-form-item>
                 <el-form-item label="所属公司" prop="companyOrgId">
-                    <el-cascader
+                    <!-- <el-cascader
                         v-model="companyOrgId"
                         :options="companyArray"
                         :props="defaultProps"
@@ -25,18 +25,26 @@
                         @change="productChange2($event)"
                         placeholder="请选择公司"
                     >
-                    </el-cascader>
+                    </el-cascader> -->
+
+                    <select-tree
+                        class="new-select-tree"
+                        selectTreeTitle="请选择公司"
+                        placeholder="请选择公司"
+                        :options="companyArray"
+                        :props="defaultProps"
+                        v-model="ruleForm.companyOrgId"
+                    />
                 </el-form-item>
                 <el-form-item label="所属部门">
-                    <el-cascader
-                        v-model="deptOrgId"
+                    <select-tree
+                        class="new-select-tree"
+                        placeholder="请选择部门"
                         :options="departmentArray"
+                        selectTreeTitle="请选择部门"
                         :props="defaultProps"
-                        @change="productChange3($event)"
-                        clearable
-                        placeholder="请选择部门"
-                    >
-                    </el-cascader>
+                        v-model="ruleForm.deptOrgId"
+                    />
                 </el-form-item>
                 <el-form-item label="详细地址" prop="address">
                     <div @click="addressQueryClick">
@@ -62,17 +70,6 @@
                     <el-input v-model="ruleForm.parkingArea"></el-input>
                 </el-form-item>
                 <el-form-item label="社区图片">
-                    <!-- <el-upload
-                        class="avatar-uploader"
-                        action="https://jsonplaceholder.typicode.com/posts/"
-                        :show-file-list="false"
-                        :on-success="handleAvatarSuccess"
-                        :before-upload="beforeAvatarUpload"
-                    >
-                        <img v-if="imageUrl" :src="imageUrl" class="avatar" />
-                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-                    </el-upload> -->
-
                     <el-upload
                         :headers="token"
                         ref="uploaduserlogo"
@@ -105,7 +102,7 @@
             </div>
         </el-form>
         <div style="text-align: right">
-            <el-button type="primary" @click="submit">提交</el-button>
+            <el-button type="primary" @click="addEdit">提交</el-button>
             <el-button @click="close">取消</el-button>
         </div>
 
@@ -130,8 +127,6 @@ export default {
     data() {
         return {
             regionId: '',
-            companyOrgId: '',
-            deptOrgId: '',
             locationList: [], //地区列表
             ruleForm: {
                 address: '', //详细地址
@@ -159,19 +154,22 @@ export default {
             token: {
                 [localStorage.getItem('SC_token') && 'Authorization']: 'Bearer ' + localStorage.getItem('SC_token')
             },
-            companyArray: [],
-            departmentArray: [],
             defaultProps: {
                 value: 'id', // 唯一标识
                 label: 'orgName', // 标签显示
                 children: 'orgs' // 子级
             },
             rules: {
-                communityName: [{ required: true, message: '请输入社区名称', trigger: 'change' }],
-                address: [{ required: true, message: '请选择地址', trigger: 'change' }],
-                regionId: [{ required: true, message: '请选择地区', trigger: 'blur' }],
-                companyOrgId: [{ required: true, message: '请选择公司', trigger: 'blur' }],
-                phone: [{ required: true, message: '请输入手机号码', trigger: 'change' }]
+                communityName: [this.$valid.selectRequired('请输入社区名称')],
+                address: [this.$valid.selectRequired('请选择地址')],
+                regionId: [this.$valid.selectRequired('请选择地区')],
+                companyOrgId: [this.$valid.selectRequired('请选择公司')],
+                phone: [
+                    this.$valid.inputRequired('输入手机号'),
+                    this.$valid.pattern(
+                        /^((0\d{2,3}-\d{7,8})|((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|147)\d{8})$/
+                    )
+                ]
             },
             mapPopUpStatus: false //地图弹出框
         };
@@ -179,7 +177,14 @@ export default {
     components: {
         MapPopup
     },
-    computed: {},
+    computed: {
+        companyArray() {
+            return this.$store.getters['getCompanyArray'];
+        },
+        departmentArray() {
+            return this.$store.getters['getDepartmentArray'];
+        }
+    },
     methods: {
         productChange(va) {
             debugger;
@@ -200,27 +205,51 @@ export default {
             this.mapPopUpStatus = !this.mapPopUpStatus;
         },
         //保存
-        submit() {
-            new Promise((resolve) => {
-                this.$refs.ruleForm.validate(resolve);
-            }).then(() => {
-                let url = '/sc-community/assets/community/add';
-                let params = this.ruleForm;
-                if (!this.isAdd) {
-                    url = '/sc-community/assets/community/update';
+        addEdit() {
+            this.$refs.ruleForm.validate((valid) => {
+                console.log(this.ruleForm);
+                if (valid) {
+                    let url = '/sc-community/assets/community/add';
+                    let params = this.ruleForm;
+                    if (!this.isAdd) {
+                        url = '/sc-community/assets/community/update';
+                    }
+                    this.$http
+                        .post(url, params)
+                        .then(({ status, msg }) => {
+                            if (status == 0) {
+                                this.$message.success(msg);
+                                this.close();
+                            } else {
+                                this.$message.error(msg);
+                            }
+                        })
+                        .catch(() => {});
                 }
-                this.$http
-                    .post(url, params)
-                    .then(({ status, msg }) => {
-                        if (status == 0) {
-                            this.$message.success(msg);
-                            this.close();
-                        } else {
-                            this.$message.error(msg);
-                        }
-                    })
-                    .catch(() => {});
             });
+            // new Promise((resolve) => {
+            //     this.$refs.ruleForm.validate(resolve);
+            // })
+            //     .then(() => {
+
+            //         let url = '/sc-community/assets/community/add';
+            //         let params = this.ruleForm;
+            //         if (!this.isAdd) {
+            //             url = '/sc-community/assets/community/update';
+            //         }
+            //         this.$http
+            //             .post(url, params)
+            //             .then(({ status, msg }) => {
+            //                 if (status == 0) {
+            //                     this.$message.success(msg);
+            //                     this.close();
+            //                 } else {
+            //                     this.$message.error(msg);
+            //                 }
+            //             })
+            //             .catch(() => {});
+            //     })
+            //     .catch(() => {});
         },
 
         //所属地区
@@ -232,21 +261,6 @@ export default {
             });
         },
 
-        //所属公司
-        companyQuery() {
-            this.$http.postForm('/sc-user-center/org/getOrgTree', { orgType: 'company' }).then(({ data }) => {
-                this.companyArray = data;
-            });
-        },
-
-        //所属部门
-        departmentQuery() {
-            let self = this;
-            this.$http.postForm('/sc-user-center/org/getOrgTree', { orgType: 'department' }).then(({ data }) => {
-                this.departmentArray = data;
-            });
-        },
-
         uploadsuccess(response, file, fileList) {
             this.$refs.uploaduserlogo.clearFiles();
             if (0 === response.status) {
@@ -276,8 +290,8 @@ export default {
                     if (0 === status) {
                         this.ruleForm = data;
                         this.regionId = [data.provinceId, data.cityId, data.regionId];
-                        this.companyOrgId = [null, null, data.companyOrgId];
-                        this.deptOrgId = [null, null, data.deptOrgId];
+                        // this.companyOrgId = [null, null, data.companyOrgId];
+                        // this.deptOrgId = [null, null, data.deptOrgId];
                     } else {
                         this.$message.error(msg);
                     }
@@ -290,8 +304,6 @@ export default {
     },
     created() {
         this.regionalQuery();
-        this.companyQuery();
-        this.departmentQuery();
 
         if (!!this.params.id) {
             this.getDetails(this.params.id);

+ 6 - 6
operationSupport/src/views/ownerManagement/index.vue

@@ -11,12 +11,12 @@
                     v-model.trim="mixins_query.name"
                 ></el-input>
                 <el-select v-model="mixins_query.householdType" clearable placeholder="住户类型">
-                    <el-option v-for="(item, index) in householdType" :key="index" :label="item.label" :value="item.status">{{
+                    <el-option v-for="item in householdType" :key="item" :label="item.label" :value="item.status">{{
                         item.label
                     }}</el-option>
                 </el-select>
                 <el-select v-model="mixins_query.residentStatus" clearable placeholder="住户状态">
-                    <el-option v-for="(item, index) in residentStatus" :key="index" :label="item.label" :value="item.status">{{
+                    <el-option v-for="item in residentStatus" :key="item" :label="item.label" :value="item.status">{{
                         item.label
                     }}</el-option>
                 </el-select>
@@ -61,8 +61,8 @@
                 :data="mixins_list"
                 :pageset="mixins_pageset"
                 @page-change="pageChange"
-                @selection-change="selectionChange">
-
+                @selection-change="selectionChange"
+            >
                 <template slot-scope="scope" slot="roomNumber">
                     <span>{{ scope.row.buildingName }}-{{ scope.row.unitName }}-{{ scope.row.roomNumber }}</span>
                 </template>
@@ -135,7 +135,7 @@ export default {
                 {
                     label: '房屋地址',
                     prop: 'roomNumber',
-                    slot:'roomNumber'
+                    slot: 'roomNumber'
                 },
                 {
                     label: '手机号',
@@ -352,7 +352,7 @@ export default {
         this.mixins_query = {
             questParams: ''
         };
-        this.mixins_search('search');
+        // this.mixins_search('search');
     }
 };
 </script>

+ 5 - 2
operationSupport/src/views/ownerManagement/stepPage/add.vue

@@ -455,10 +455,13 @@ export default {
                 .get(url)
                 .then(({ data, status, msg }) => {
                     if (0 === status) {
-                        const { effectiveDateStart, effectiveDateEnd } = data;
+                        let { effectiveDateStart, effectiveDateEnd } = data;
+                        if (effectiveDateStart == null || effectiveDateEnd == null) {
+                            effectiveDateStart = '';
+                            effectiveDateEnd = '';
+                        }
                         this.effectiveDate = [effectiveDateStart, effectiveDateEnd];
                         this.formData = data;
-                        console.log(data);
                     } else {
                         this.$message.error(msg);
                     }

+ 3 - 2
operationSupport/src/views/parkingLotAdministration/garageList.vue

@@ -181,10 +181,11 @@ export default {
             this.$store.dispatch('openModal', {
                 url: '/parkingLotAdministration/pageJump/garageSaveEdits.vue',
                 title: title,
-                width: '850px',
-                height: '600px',
+                width: '500px',
+                height: '420px',
                 props: {
                     data: row,
+                    communityList:this.communityList,
                     todo: todo,
                     callback: this.mixins_search
                 }

+ 6 - 61
operationSupport/src/views/parkingLotAdministration/pageJump/garageSaveEdits.vue

@@ -4,8 +4,8 @@
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
                 <el-row>
                     <el-col :span="24">
-                        <el-form-item label="社区名称" prop="communityName">
-                            <el-select v-model="ruleForm.communityName" placeholder="请选择社区名称" @change="communityChoice">
+                        <el-form-item label="社区名称" prop="communityId">
+                            <el-select v-model="ruleForm.communityId" placeholder="请选择社区名称">
                                 <el-option
                                     v-for="(item, index) in communityList"
                                     :label="item.label"
@@ -35,48 +35,22 @@ export default {
     props: ['params'],
     data() {
         return {
-            // parkingNumber:'',
             communityList: [], //社区名称下拉列表
-            // communityName:'',//社区名称
-            // communityId:'',//社区id
             ruleForm: {
-                communityName: '', //社区名称
+                communityId: '', //社区名称
                 garageName: '', //车库名称
                 parkingNumber: '', //车位数量
                 remarks: '' //备注
             },
             rules: {
-                communityName: [
-                    { required: true, message: '请输入社区名称', trigger: 'change' }
-                    // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
-                ],
+                communityId: [{ required: true, message: '请输入社区名称', trigger: 'change' }],
                 garageName: [{ required: true, message: '请输入车库名称', trigger: 'change' }]
-            },
-            radio: '1'
+            }
         };
     },
     components: {},
     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();
-        },
         submit() {
             this.$refs['ruleForm'].validate((valid) => {
                 if (valid) {
@@ -96,39 +70,10 @@ export default {
                     return false;
                 }
             });
-        },
-        resetForm(formName) {
-            this.$refs[formName].resetFields();
-        },
-
-        handleAvatarSuccess(res, file) {
-            this.imageUrl = URL.createObjectURL(file.raw);
-        },
-        beforeAvatarUpload(file) {
-            const isJPG = file.type === 'image/jpeg';
-            const isLt2M = file.size / 1024 / 1024 < 2;
-
-            if (!isJPG) {
-                this.$message.error('上传头像图片只能是 JPG 格式!');
-            }
-            if (!isLt2M) {
-                this.$message.error('上传头像图片大小不能超过 2MB!');
-            }
-            return isJPG && isLt2M;
-        },
-        coordinateClick() {
-            this.$confirm('确认关闭?')
-                .then((_) => {
-                    done();
-                })
-                .catch((_) => {});
-        },
-        addressQueryClick() {
-            this.mapPopUpStatus = true;
         }
     },
     created() {
-        this.communityNameList();
+        this.communityList = this.params.communityList;
         if (this.params.todo == 'edit') {
             this.ruleForm = this.params.data;
         }

+ 1 - 1
userCenter/src/views/system/organs/popups/EditForm.vue

@@ -33,7 +33,7 @@
                     v-else
                     slot="parentOrgId"
                     class="new-select-tree"
-                    empty-text="请选择上级机构"
+                    selectTreeTitle="请选择上级机构"
                     placeholder="请选择上级机构"
                     :disabled="isEdit !== 'edit' && isEdit !== 'add'"
                     :options="organList"