优化代码

This commit is contained in:
java110 2020-11-30 01:04:17 +08:00
parent a201a1b076
commit e04089ac4a
8 changed files with 116 additions and 21 deletions

8
app.js
View File

@ -36,14 +36,14 @@ let opts = {
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
//app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
//app.use('/callComponent',proxy('http://127.0.0.1:8012',opts));
//app.use('/app',proxy('http://127.0.0.1:8012',opts));
app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
app.use('/app',proxy('http://192.168.1.16:8012',opts));
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
//app.use('/app',proxy('http://192.168.1.16:8012',opts));
//app.listen(3000);
app.use(express.json());

View File

@ -1,5 +1,5 @@
<div>
<div class="row">
<div class="row" v-if="payFeeDiscountInfo.feeDiscounts.length>0">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
@ -16,7 +16,9 @@
<thead>
<tr>
<th class="text-center">
<input type="checkbox" class="i-checks" v-bind:checked="payFeeDiscountInfo.quanDiscount == true" @click="checkAllDiscount($event)" >
<input type="checkbox" class="i-checks"
v-bind:checked="payFeeDiscountInfo.quanDiscount == true"
@click="checkAllDiscount($event)">
</th>
<th class="text-center">折扣类型</th>
<th class="text-center">折扣名称</th>
@ -27,7 +29,9 @@
<tbody>
<tr v-for="feeDiscount in payFeeDiscountInfo.feeDiscounts">
<td class="text-center">
<input type="checkbox" class="i-checks checkDiscountItem" v-bind:value="feeDiscount.discountId" v-model="payFeeDiscountInfo.selectDiscountIds" >
<input type="checkbox" class="i-checks checkDiscountItem"
v-bind:value="feeDiscount.discountId"
v-model="payFeeDiscountInfo.selectDiscountIds">
</td>
<td class="text-center">{{feeDiscount.discountType == '1001'?'优惠':'违约'}}</td>
<td class="text-center">{{feeDiscount.discountName}}</td>

View File

@ -35,6 +35,7 @@
},
_initEvent: function () {
vc.on('payFeeDiscount', 'computeFeeDiscount', function (_param) {
$that.payFeeDiscountInfo.selectDiscountIds = [];
vc.copyObject(_param, $that.payFeeDiscountInfo);
if ($that.payFeeDiscountInfo.cycles < 0) {
return;
@ -90,7 +91,7 @@
let _selectDiscount = [];
$that.payFeeDiscountInfo.selectDiscountIds.forEach(item => {
$that.payFeeDiscountInfo.feeDiscounts.forEach(disItem => {
if (item == disItem.discountId) {
if (item == disItem.discountId && disItem.discountPrice > 0) {
_totalDiscountMoney += parseFloat(disItem.discountPrice);
_selectDiscount.push(disItem);
}

View File

@ -0,0 +1,46 @@
<div id="viewFeeDetailDiscountModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="viewFeeDetailDiscountModel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="chooseFloorModelLabel">折扣</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class=" row">
<div class="col-lg-12">
<div class="ibox ">
<div class="table-responsive" style="margin-top:15px">
<table class="table table-striped">
<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="discount in viewFeeDetailDiscountInfo.feeDetailDiscounts">
<td class="text-center">{{discount.discountName}}</td>
<td class="text-center">{{discount.discountType == '1001'?'优惠':'违约'}}</td>
<td class="text-center">
<div v-for="(item,index) in discount.feeDiscountSpecs">
{{item.specName}}{{item.specValue}}</div>
</td>
<td class="text-center">{{discount.discountPrice}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,42 @@
(function (vc) {
vc.extends({
data: {
viewFeeDetailDiscountInfo: {
feeDetailDiscounts: []
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('viewFeeDetailDiscount', 'openModel', function (_param) {
$('#viewFeeDetailDiscountModel').modal('show');
$that.viewFeeDetailDiscountInfo.feeDetailDiscounts = [];
vc.component._loadAllFeeDetailDiscountInfo(_param);
});
},
methods: {
_loadAllFeeDetailDiscountInfo: function (_param) {
var param = {
params: {
page: 1,
row: 30,
communityId: vc.getCurrentCommunity().communityId,
detailId: _param.detailId
}
};
//发送get请求
vc.http.apiGet('/feeDiscount/queryFeeDetailDiscount',
param,
function (json) {
var _feeDetailDiscountInfo = JSON.parse(json);
$that.viewFeeDetailDiscountInfo.feeDetailDiscounts = _feeDetailDiscountInfo.data;
}, function () {
console.log('请求失败处理');
}
);
}
}
});
})(window.vc);

View File

@ -42,9 +42,6 @@
$that.payFeeOrderInfo.builtUpArea = vc.getParam('builtUpArea');
$that.payFeeOrderInfo.squarePrice = vc.getParam('squarePrice');
$that.payFeeOrderInfo.additionalAmount = vc.getParam('additionalAmount');
$that.payFeeOrderInfo.paymentCycles = [];
for (let _index = 1; _index < 7; _index++) {
$that.payFeeOrderInfo.paymentCycles.push(_index * vc.getParam('paymentCycle'))

View File

@ -40,13 +40,12 @@
<th data-hide="phone">周期</th>
<th data-hide="phone">应收金额</th>
<th data-hide="phone">实收金额</th>
<th data-hide="phone">打折率</th>
<th data-hide="phone">备注</th>
<th data-hide="phone">缴费时间</th>
<th data-hide="phone">缴费起始时间</th>
<th data-hide="phone">缴费结束时间</th>
<th data-hide="phone">状态</th>
<th data-hide="phone">操作</th>
<th data-hide="phone">备注</th>
<th data-hide="phone" class="text-right">操作</th>
</tr>
</thead>
<tbody>
@ -62,13 +61,7 @@
</td>
<td>
{{feeDetail.receivedAmount}} 元
</td>
<td>
{{feeDetail.primeRate}}
</td>
<td>
{{feeDetail.remark}}
</td>
</td>
<td>
{{feeDetail.createTime}}
</td>
@ -82,11 +75,19 @@
{{feeDetail.stateName}}
</td>
<td>
{{feeDetail.remark}}
</td>
<td class="text-right">
<div class="btn-group" v-if="feeDetail.state=='1400' || feeDetail.state== 1200">
<button class="btn-white btn btn-xs"
v-on:click="_openRefundModel(feeDetail)">申请退费
</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openFeeDetailDiscountModal(feeDetail)">折扣
</button>
</div>
</td>
</tr>
@ -107,4 +108,5 @@
</div>
</div>
<vc:create path="property/returnPayFee"></vc:create>
<vc:create path="property/viewFeeDetailDiscount"></vc:create>
</div>

View File

@ -86,6 +86,9 @@
_openRefundModel:function (_feeDetail) {
_feeDetail.mainFeeInfo = vc.component.mainFeeInfo;
vc.emit('returnPayFee', 'openReturnPayFeeModel', _feeDetail);
},
_openFeeDetailDiscountModal:function(_detail){
vc.emit('viewFeeDetailDiscount', 'openModel',_detail);
}
}
});