优化 停车费创建

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

View File

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