mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化前段界面 bug
This commit is contained in:
parent
4697e51474
commit
fff4b5b945
@ -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);
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user