优化添加费用

This commit is contained in:
wuxw 2022-05-10 13:07:24 +08:00
parent 92b237b968
commit 1e5a7f0191
2 changed files with 46 additions and 50 deletions

View File

@ -20,7 +20,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="费用" namespace="addFeeCombo"></vc:i18n></span></label>
<label class="col-sm-2 col-form-label"><span><vc:i18n name="费用" namespace="addFeeCombo"></vc:i18n></span></label>
<div class="col-sm-10">
<select class="selectpicker" id="configIds" v-model="addFeeComboInfo.configIds" multiple>
<option v-for="(item,index) in addFeeComboInfo.configs" :key="index"

View File

@ -10,6 +10,7 @@
payerObjId: '',
payerObjName: '',
payerObjType: '',
comboId: ''
}
},
_initMethod: function () {
@ -22,6 +23,7 @@
},
_initEvent: function () {
vc.on('createFeeByCombo', 'chooseFeeCombo', function (_feeCombo) {
$that.createFeeByComboInfo.comboId = _feeCombo.comboId;
$that._listFeeComboMembers(_feeCombo);
})
},
@ -43,9 +45,11 @@
param,
function (json, res) {
let _feeComboMemberManageInfo = JSON.parse(json);
$that.createFeeByComboInfo.selectConfigIds = [];
_feeComboMemberManageInfo.data.forEach(config => {
config.startTime = '';
config.endTime=''
config.endTime = '',
$that.createFeeByComboInfo.selectConfigIds.push(config.configId);
})
vc.component.createFeeByComboInfo.feeConfigs = _feeComboMemberManageInfo.data;
$that.$forceUpdate();
@ -67,40 +71,29 @@
}
);
},
_doPayFee: function() {
_createFee: function () {
let _fees = [];
let _printFees = [];
if ($that.createFeeByComboInfo.primeRate == '') {
vc.toast('请选择支付方式');
return;
}
$that.createFeeByComboInfo.selectConfigIds.forEach(function (_item) {
$that.createFeeByComboInfo.batchFees.forEach(function(_batchFeeItem) {
if (_item == _batchFeeItem.feeId) {
_batchFeeItem.primeRate = $that.createFeeByComboInfo.primeRate;
$that.createFeeByComboInfo.feeConfigs.forEach(function (_batchFeeItem) {
if (_item == _batchFeeItem.configId) {
_fees.push(_batchFeeItem);
_printFees.push({
feeId: _item,
squarePrice: _batchFeeItem.squarePrice,
additionalAmount: _batchFeeItem.additionalAmount,
feeName: _batchFeeItem.feeName,
amount: _batchFeeItem.feePrice,
roomName: $that.createFeeByComboInfo.roomName,
primeRate: $that.createFeeByComboInfo.primeRate
});
}
})
})
if (_fees.length < 1) {
vc.toast('未选中要缴费的项目');
vc.toast('未选中要创建的费用套餐');
return;
}
let _data = {
communityId: vc.getCurrentCommunity().communityId,
fees: _fees
configs: _fees,
payerObjId: $that.createFeeByComboInfo.payerObjId,
payerObjName: $that.createFeeByComboInfo.payerObjName,
payerObjType: $that.createFeeByComboInfo.payerObjType,
comboId: $that.createFeeByComboInfo.comboId
}
vc.http.apiPost(
'/fee.payBatchFee',
'/fee.createFeeByCombo',
JSON.stringify(_data), {
emulateJSON: true
},
@ -133,6 +126,9 @@
} else { // 如果是去掉全选则清空checkbox选项绑定数组
vc.component.createFeeByComboInfo.selectConfigIds = [];
}
},
_goBack:function(){
vc.goBack();
}
}
});