ソースを参照

修改复制手机号出现空格的bug

DESKTOP-4G80JF4\long 3 年 前
コミット
af950f34a2

+ 6 - 6
operationSupport/src/components/common/treeHouse.vue

@@ -146,13 +146,13 @@ export default {
     watch: {
         selectHouse(val) {
             // this.$refs.tree.filter(val);
-        },
-        dataPeopleList(val) {
-            console.log('====================================');
-            console.log('dataPeopleList', val);
-            console.log('====================================');
-            this.$refs.tree.filter(val);
         }
+        // dataPeopleList(val) {
+        //     console.log('====================================');
+        //     console.log('dataPeopleList', val);
+        //     console.log('====================================');
+        //     this.$refs.tree.filter(val);
+        // }
     },
     computed: {},
     methods: {

+ 1 - 0
operationSupport/src/utils/newValidate.js

@@ -332,6 +332,7 @@ export default {
     // 手机号校验
     patternPhoneNumber(required = true) {
         let pattern = /^(1[3|4|5|6|7|8|9])\d{9}$|^0\d{2,3}-?\d{6,8}$/,
+            // let pattern = /(0\d{2,3}-\d{7,8})|(1[3-9]\d{9})/,
             message = '您输入的手机号有误';
         return { required, pattern, message, trigger: 'blur' };
     }

+ 13 - 13
operationSupport/src/views/propertyManagement/inform.vue

@@ -513,8 +513,8 @@ export default {
             this.uploadFileUrl.push(obj);
         },
         handleExceed(files, fileList) {
-            this.$message.warning(
-                `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`
+            this.$message.error(
+                `当前最多可选 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`
             );
         },
         beforeRemove(file, fileList) {
@@ -560,7 +560,7 @@ export default {
                         this.ruleForm.issueRoom.radioStaff = '';
                         this.ruleForm.issueRoom.staff = false;
                     } else {
-                        this.$message.warning('获取房间失败');
+                        this.$message.error('获取房间失败');
                     }
                 });
         },
@@ -738,7 +738,7 @@ export default {
                         content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
                             img.push(capture);
                         });
-                        if (img.length >= 3) {
+                        if (img.length > 3) {
                             return this.$message.warning('最多插入三张图片');
                         }
                         if (
@@ -775,7 +775,8 @@ export default {
                         };
                         this.$http.post('/sc-community-web/notice/add', query).then((res) => {
                             if (res.status === 0) {
-                                this.$message.success('发布成功');
+                                this.mixins_search();
+                                this.$message.success(res.msg);
                                 this.$refs.endit.setContent('');
                                 this.$refs['ruleForm'].resetFields();
                                 this.successImageList = [];
@@ -785,14 +786,13 @@ export default {
                                 if (this.showUploadImage) {
                                     this.$refs.upImages.clearImageList('');
                                 }
-                                this.mixins_search();
+                                this.centerDialogVisible = false;
                             } else {
-                                this.$message('发布失败,请稍后重试');
-                                this.successImageList = [];
-                                this.contentHtml = '';
-                                this.clear();
+                                this.$message.error(res.msg);
+                                // this.successImageList = [];
+                                // this.contentHtml = '';
+                                // this.clear();
                             }
-                            this.centerDialogVisible = false;
                             console.log('点击发布', res);
                         });
                     } else {
@@ -882,7 +882,7 @@ export default {
                     this.filterPeopleName(this.peopleData);
                     this.houseDataNames = this.PeopleNames.toString();
                 } else {
-                    this.$message(warning, '获取人员失败,请稍后重试');
+                    this.$message(error, res.msg);
                 }
             });
         },
@@ -955,7 +955,7 @@ export default {
                     this.centerDialogVisible = true;
                     this.showDetail = false;
                 } else {
-                    return this.$message('获取详情失败!请稍后重试');
+                    return this.$message.error('获取详情失败!请稍后重试');
                 }
             });
         }

+ 4 - 4
operationSupport/src/views/propertyManagement/neighbor.vue

@@ -291,7 +291,7 @@ export default {
         message(status, text) {
             if (status === 0) {
                 this.$message({
-                    message: `${text}成功`,
+                    message: `${text}`,
                     type: 'success'
                 });
                 this.centerDialogVisible = false;
@@ -299,8 +299,8 @@ export default {
                 this.mixins_search();
             } else {
                 this.$message({
-                    message: `${text}失败请稍后重试`,
-                    type: 'warning'
+                    message: `${text}`,
+                    type: 'error'
                 });
             }
         },
@@ -341,7 +341,7 @@ export default {
                             this.detailData = res.data;
                         }
                     } else {
-                        this.$message('获取详情失败!请稍后重试');
+                        this.$message.error('获取详情失败!请稍后重试');
                     }
                 });
             } else {

+ 33 - 35
operationSupport/src/views/propertyManagement/phone.vue

@@ -39,7 +39,7 @@
             </div>
             <!-- 详情弹框 -->
             <div class="dialog-info">
-                <el-dialog :visible.sync="centerDialogVisible" width="524px">
+                <el-dialog :visible.sync="centerDialogVisible" width="524px" :close-on-click-modal="false">
                     <div class="dialog">
                         <div class="dialog-header">
                             <i class="el-dialog__close el-icon el-icon-close" @click="dialogButton('clear')"></i>
@@ -58,24 +58,18 @@
                                             :key="index"
                                             :label="item.label"
                                             :value="item.id"
-                                            >{{ item.label }}</el-option
-                                        >
+                                        ></el-option>
                                     </el-select>
                                 </el-form-item>
                                 <el-form-item label="管理处名称" prop="newManagementName">
-                                    <el-input
-                                        v-model="ruleForm.newManagementName"
-                                        placeholder="不能超过20字"
-                                        @keyup.enter.native="dialogButton('addSave')"
-                                        maxlength="20"
-                                    ></el-input>
+                                    <el-input v-model="ruleForm.newManagementName" placeholder="不能超过20字" maxlength="20"></el-input>
                                 </el-form-item>
                                 <el-form-item label="电话号码" prop="newPhone">
                                     <el-input
-                                        v-model="ruleForm.newPhone"
+                                        @blur="ruleForm.newPhone = $event.target.value.trim()"
+                                        v-model.trim="ruleForm.newPhone"
                                         placeholder="例如:010-26888888,13888888888"
                                         maxlength="13"
-                                        @keyup.enter.native="dialogButton('addSave')"
                                     ></el-input>
                                 </el-form-item>
                                 <el-form-item class="dialog-footer">
@@ -194,6 +188,9 @@ export default {
             this.centerDialogVisible = true;
             this.enditShow = false;
             this.$refs['ruleForm'].resetFields();
+            // this.ruleForm.newPhone = '';
+            // this.ruleForm.communityList = [];
+            // this.ruleForm.newManagementName = '';
         },
         /**查询按钮*/
         searchInfo() {
@@ -213,30 +210,32 @@ export default {
                         //     return this.$message.warning('不能包含中心');
                         // }
                         let newManagementName = this.ruleForm.newManagementName.trim();
+                        var communityId = this.ruleForm.communityList;
+                        if (this.ruleForm.communityList !== NaN) {
+                            this.communityListCreate.forEach((item) => {
+                                if (item.label == this.ruleForm.communityList) {
+                                    return (communityId = item.id);
+                                }
+                            });
+                        }
                         let query = {
-                            communityId: this.ruleForm.communityList,
+                            communityId: communityId,
                             name: newManagementName,
                             telephone: this.ruleForm.newPhone,
                             id: this.ruleForm.id
                         };
-                        if (type === 'addSave') {
-                            console.log('query', query);
-                            if (!this.enditShow) {
-                                this.$http.post('/sc-community-web/property/telephone/add', query).then((res) => {
-                                    this.message(res.status, res.msg);
-                                    this.$refs['ruleForm'].resetFields();
-                                });
-                                console.log('点击保存', this.ruleForm);
-                            }
-                            // this.centerDialogVisible=false;
-                            else {
-                                this.$http.post('/sc-community-web/property/telephone/update', query).then((res) => {
-                                    this.message(res.status, res.msg);
-                                });
-                            }
-                        } else {
-                            this.centerDialogVisible = false;
-                            this.$refs['ruleForm'].resetFields();
+                        console.log('query', query);
+                        if (!this.enditShow) {
+                            this.$http.post('/sc-community-web/property/telephone/add', query).then((res) => {
+                                this.message(res.status, res.msg);
+                            });
+                            console.log('新增保存', this.ruleForm);
+                        }
+                        // this.centerDialogVisible=false;
+                        else {
+                            this.$http.post('/sc-community-web/property/telephone/update', query).then((res) => {
+                                this.message(res.status, res.msg);
+                            });
                         }
                     } else {
                         return false;
@@ -244,7 +243,6 @@ export default {
                 });
             } else {
                 this.centerDialogVisible = false;
-                this.$refs['ruleForm'].resetFields();
             }
         },
         // 删除按钮
@@ -260,16 +258,16 @@ export default {
         message(status, text) {
             if (status === 0) {
                 this.$message({
-                    message: `${text}成功`,
+                    message: `${text}`,
                     type: 'success'
                 });
                 this.centerDialogVisible = false;
                 this.dialogVisibleDelete = false;
                 this.mixins_search();
             } else {
-                this.$message({
-                    message: `${text}失败请稍后重试`,
-                    type: 'warning'
+                return this.$message({
+                    message: `${text}`,
+                    type: 'error'
                 });
             }
         },