优化代码

This commit is contained in:
java110 2020-11-26 17:38:34 +08:00
parent eb1fba2d7b
commit bb8479f207
3 changed files with 124 additions and 0 deletions

View File

@ -239,10 +239,13 @@
function (json, res) {
var _feeConfigManageInfo = JSON.parse(json);
vc.component.addMeterWaterInfo.feeConfigs = _feeConfigManageInfo.feeConfigs;
},
function (errInfo, error) {
console.log('请求失败处理');
});
$that._queryPreMeterWater($that.addMeterWaterInfo.roomId);
},
_queryPreMeterWater: function (_roomId) {
let _meterType = '1010';

View File

@ -0,0 +1,47 @@
<div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>折扣信息</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddFeeDiscountModal()">
<i class="glyphicon glyphicon-plus"></i>
特殊折扣
</button>
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">折扣类型</th>
<th class="text-center">折扣名称</th>
<th class="text-center">规则</th>
<th class="text-center">折扣金额</th>
</tr>
</thead>
<tbody>
<tr v-for="feeDiscount in payFeeDiscountInfo.feeDiscounts">
<td class="text-center">{{feeDiscount.discountType == '1001'?'优惠':'违约'}}</td>
<td class="text-center">{{feeDiscount.discountName}}</td>
<td class="text-center">
<div v-for="(item,index) in feeDiscount.feeDiscountSpecs">
{{item.specName}}{{item.specValue}}</div>
</td>
<td class="text-center">30</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,74 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 20;
vc.extends({
data: {
payFeeDiscountInfo: {
feeDiscounts: [],
feeId: '',
cycles: 1
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('payFeeDiscount', 'computeFeeDiscount', function (_param) {
vc.copyObject(_param, $that.payFeeDiscountInfo);
vc.component._listFeeDiscounts(DEFAULT_PAGE, DEFAULT_ROWS);
});
},
methods: {
_listFeeDiscounts: function (_page, _rows) {
vc.component.payFeeDiscountInfo.conditions.page = _page;
vc.component.payFeeDiscountInfo.conditions.row = _rows;
let param = {
params: {
page: DEFAULT_PAGE,
row: DEFAULT_ROWS,
feeId: $that.payFeeDiscountInfo.feeId,
communityId: $that.payFeeDiscountInfo.communityId,
cycles: $that.payFeeDiscountInfo.cycles
}
};
//发送get请求
vc.http.apiGet('/feeDiscount/queryFeeDiscount',
param,
function (json, res) {
let _payFeeDiscountInfo = JSON.parse(json);
$that.payFeeDiscountInfo.feeDiscounts = _payFeeDiscountInfo.data;
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openAddFeeDiscountModal: function () {
vc.emit('addFeeDiscount', 'openAddFeeDiscountModal', {});
},
_openEditFeeDiscountModel: function (_feeDiscount) {
vc.emit('editFeeDiscount', 'openEditFeeDiscountModal', _feeDiscount);
},
_openDeleteFeeDiscountModel: function (_feeDiscount) {
vc.emit('deleteFeeDiscount', 'openDeleteFeeDiscountModal', _feeDiscount);
},
_queryFeeDiscountMethod: function () {
vc.component._listFeeDiscounts(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function () {
if (vc.component.payFeeDiscountInfo.moreCondition) {
vc.component.payFeeDiscountInfo.moreCondition = false;
} else {
vc.component.payFeeDiscountInfo.moreCondition = true;
}
}
}
});
})(window.vc);