diff --git a/public/components/common/addResourceStoreType/addResourceStoreType.js b/public/components/common/addResourceStoreType/addResourceStoreType.js index a79ed79e3..c17275834 100644 --- a/public/components/common/addResourceStoreType/addResourceStoreType.js +++ b/public/components/common/addResourceStoreType/addResourceStoreType.js @@ -1,4 +1,4 @@ -(function (vc) { +(function(vc) { vc.extends({ propTypes: { callBackListener: vc.propTypes.string, //父组件名称 @@ -12,10 +12,9 @@ description: '' } }, - _initMethod: function () { - }, - _initEvent: function () { - vc.on('addResourceStoreType', 'openAddResourceStoreTypeModal', function (rstId) { + _initMethod: function() {}, + _initEvent: function() { + vc.on('addResourceStoreType', 'openAddResourceStoreTypeModal', function(rstId) { if (rstId != null && rstId != '' && rstId != 'undefined' && rstId.length > 0) { vc.component.addResourceStoreTypeInfo.parentId = rstId } @@ -27,23 +26,19 @@ return vc.validate.validate({ addResourceStoreTypeInfo: vc.component.addResourceStoreTypeInfo }, { - 'addResourceStoreTypeInfo.name': [ - { - limit: "required", - param: "", - errInfo: "物品类型名称不能为空" - }, - ], - 'addResourceStoreTypeInfo.description': [ - { - limit: "maxLength", - param: "200", - errInfo: "描述不能超过200位" - }, - ] + 'addResourceStoreTypeInfo.name': [{ + limit: "required", + param: "", + errInfo: "物品类型名称不能为空" + }, ], + 'addResourceStoreTypeInfo.description': [{ + limit: "maxLength", + param: "200", + errInfo: "描述不能超过200位" + }, ] }); }, - saveResourceStoreTypeInfo: function () { + saveResourceStoreTypeInfo: function() { if (!vc.component.addResourceStoreTypeValidate()) { vc.toast(vc.validate.errInfo); return; @@ -57,17 +52,17 @@ } vc.http.post('addResourceStoreType', 'save', - JSON.stringify(vc.component.addResourceStoreTypeInfo), - { + JSON.stringify(vc.component.addResourceStoreTypeInfo), { emulateJSON: true }, - function (json, res) { + function(json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); - if (res.status == 200) { + let _json = JSON.parse(json) + if (_json.code != 0) { //关闭model $('#addResourceStoreTypeModel').modal('hide'); - if (vc.component.addResourceStoreTypeInfo.parentId != null && vc.component.addResourceStoreTypeInfo.parentId != '' - && vc.component.addResourceStoreTypeInfo.parentId != 'undefined' && vc.component.addResourceStoreTypeInfo.parentId != '0') { + if (vc.component.addResourceStoreTypeInfo.parentId != null && vc.component.addResourceStoreTypeInfo.parentId != '' && + vc.component.addResourceStoreTypeInfo.parentId != 'undefined' && vc.component.addResourceStoreTypeInfo.parentId != '0') { vc.component.clearAddResourceStoreTypeInfo(); vc.emit('listSonResourceStoreType', 'listSonResourceStoreTypes', {}); } else { @@ -77,13 +72,14 @@ vc.toast("添加成功") return; } + vc.toast(_json.msg) }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, - clearAddResourceStoreTypeInfo: function () { + clearAddResourceStoreTypeInfo: function() { vc.component.addResourceStoreTypeInfo = { rstId: '', parentId: "0", @@ -93,4 +89,4 @@ } } }); -})(window.vc); +})(window.vc); \ No newline at end of file diff --git a/public/pages/property/addOwnerRoomBinding/addOwnerRoomBinding.js b/public/pages/property/addOwnerRoomBinding/addOwnerRoomBinding.js index 48446ea37..df5ff248e 100755 --- a/public/pages/property/addOwnerRoomBinding/addOwnerRoomBinding.js +++ b/public/pages/property/addOwnerRoomBinding/addOwnerRoomBinding.js @@ -76,7 +76,8 @@ if (res.status == 200) { vc.toast('处理成功'); //关闭model - vc.jumpToPage("/#/pages/property/listOwner?" + vc.objToGetParam(JSON.parse(json))); + //vc.jumpToPage("/#/pages/property/listOwner?" + vc.objToGetParam(JSON.parse(json))); + vc.goBack(); return; } vc.toast(json);