优化 停车费创建

This commit is contained in:
java110 2022-02-22 12:28:16 +08:00
parent f9448fbc99
commit c3c867d960
2 changed files with 59 additions and 56 deletions

View File

@ -68,8 +68,7 @@
carCreateFeeAddValidate() {
return vc.validate.validate({
carCreateFeeAddInfo: vc.component.carCreateFeeAddInfo
},
{
}, {
'carCreateFeeAddInfo.locationTypeCd': [{
limit: "required",
param: "",
@ -85,26 +84,22 @@
limit: "required",
param: "",
errInfo: "收费对象不能为空"
}
],
}],
'carCreateFeeAddInfo.feeTypeCd': [{
limit: "required",
param: "",
errInfo: "费用类型不能为空"
}
],
}],
'carCreateFeeAddInfo.configId': [{
limit: "required",
param: "",
errInfo: "费用项目不能为空"
}
],
}],
'carCreateFeeAddInfo.carState': [{
limit: "required",
param: "",
errInfo: "出账类型不能为空"
}
],
}],
'carCreateFeeAddInfo.startTime': [{
limit: "required",
param: "",
@ -114,7 +109,8 @@
limit: "datetime",
param: "",
errInfo: "计费起始时间格式错误 YYYY-MM-DD hh:mm:ss"
}]
}
]
});
},
saveCarCreateFeeInfo: function() {
@ -134,8 +130,7 @@
return;
}
vc.component.carCreateFeeAddInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.post('parkingSpaceCreateFeeAdd',
'save',
vc.http.apiPost('fee.saveParkingSpaceCreateFee',
JSON.stringify(vc.component.carCreateFeeAddInfo), {
emulateJSON: true
},
@ -147,6 +142,10 @@
vc.component.clearAddFeeConfigInfo();
vc.emit('listParkingSpaceFee', 'notify', {});
vc.emit('simplifyCarFee', 'notify', {});
if (_json.hasOwnProperty('code') && _json.code != 0) {
vc.toast(_json.msg);
return;
}
vc.toast("创建收费成功,总共[" + _json.totalCar + "]车位,成功[" + _json.successCar + "],失败[" + _json.errorCar + "]", 8000);
return;
}

View File

@ -167,7 +167,7 @@
_roomCreateFeeAddInfo.locationTypeCd = '3000';
}
_roomCreateFeeAddInfo.roomState = _roomCreateFeeAddInfo.roomState.join(',');
vc.http.post('roomCreateFeeAdd', 'save',
vc.http.apiPost('/fee.saveRoomCreateFee',
JSON.stringify(_roomCreateFeeAddInfo), {
emulateJSON: true
},
@ -178,9 +178,13 @@
var _json = JSON.parse(json);
$('#roomCreateFeeAddModel').modal('hide');
$that.clearAddFeeConfigInfo();
vc.toast("创建收费成功,总共[" + _json.totalRoom + "]房屋,成功[" + _json.successRoom + "],失败[" + _json.errorRoom + "]", 8000);
vc.emit('listRoomFee', 'notify', {});
vc.emit('simplifyRoomFee', 'notify', {});
if (_json.hasOwnProperty('code') && _json.code != 0) {
vc.toast(_json.msg);
return;
}
vc.toast("创建收费成功,总共[" + _json.totalRoom + "]房屋,成功[" + _json.successRoom + "],失败[" + _json.errorRoom + "]", 8000);
return;
}
vc.toast(json);