diff --git a/public/components/property/addDataPrivilege/addDataPrivilege.js b/public/components/property/addDataPrivilege/addDataPrivilege.js index 8c96e6885..6670c4eaa 100644 --- a/public/components/property/addDataPrivilege/addDataPrivilege.js +++ b/public/components/property/addDataPrivilege/addDataPrivilege.js @@ -23,7 +23,7 @@ methods: { addDataPrivilegeValidate() { return vc.validate.validate({ - addDataPrivilegeInfo: vc.component.addDataPrivilegeInfo + addDataPrivilegeInfo: $that.addDataPrivilegeInfo }, { 'addDataPrivilegeInfo.name': [ { @@ -76,20 +76,20 @@ }); }, saveDataPrivilegeInfo: function () { - if (!vc.component.addDataPrivilegeValidate()) { + if (!$that.addDataPrivilegeValidate()) { vc.toast(vc.validate.errInfo); return; } - vc.component.addDataPrivilegeInfo.communityId = vc.getCurrentCommunity().communityId; + $that.addDataPrivilegeInfo.communityId = vc.getCurrentCommunity().communityId; //不提交数据将数据 回调给侦听处理 if (vc.notNull($props.callBackListener)) { - vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addDataPrivilegeInfo); + vc.emit($props.callBackListener, $props.callBackFunction, $that.addDataPrivilegeInfo); $('#addDataPrivilegeModel').modal('hide'); return; } vc.http.apiPost( '/dataPrivilege.saveDataPrivilege', - JSON.stringify(vc.component.addDataPrivilegeInfo), { + JSON.stringify($that.addDataPrivilegeInfo), { emulateJSON: true }, function (json, res) { @@ -98,7 +98,7 @@ if (_json.code == 0) { //关闭model $('#addDataPrivilegeModel').modal('hide'); - vc.component.clearAddDataPrivilegeInfo(); + $that.clearAddDataPrivilegeInfo(); vc.emit('dataPrivilegeDiv', '_loadDataPrivilege', {}); vc.toast("添加成功"); return; @@ -112,10 +112,11 @@ }); }, clearAddDataPrivilegeInfo: function () { - vc.component.addDataPrivilegeInfo = { + let _communityId = $that.addDataPrivilegeInfo.communityId; + $that.addDataPrivilegeInfo = { name: '', code: '', - communityId: '', + communityId: _communityId, remark: '' }; } diff --git a/public/user.html b/public/user.html index 2a731b3ff..00d729873 100644 --- a/public/user.html +++ b/public/user.html @@ -39,7 +39,7 @@