|
@@ -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'
|
|
|
});
|
|
|
}
|
|
|
},
|