优化代码

This commit is contained in:
java110 2021-07-22 13:05:33 +08:00
parent 4b52063256
commit c100a0c938
3 changed files with 44 additions and 0 deletions

View File

@ -54,6 +54,8 @@ export function getRoomFees(_objData,_tmpRoom) {
_tmpRoom.feeName = _roomFee.feeName;
_tmpRoom.feeFlag = _roomFee.feeFlag;
_tmpRoom.paymentCycle = _roomFee.paymentCycle;
_tmpRoom.preDegrees = _roomFee.preDegrees;
_tmpRoom.curDegrees = _roomFee.curDegrees;
moreRooms.push(_tmpRoom);
});
resolve(moreRooms);

View File

@ -31,6 +31,18 @@
<view class="text-gray">缴费时间</view>
<view class="text-gray">{{item.createTime}}</view>
</view>
<view class="flex margin-top-xs justify-between" v-if="item.preDegrees">
<view class="text-gray">上期度数</view>
<view class="text-gray">{{item.preDegrees}}</view>
</view>
<view class="flex margin-top-xs justify-between" v-if="item.curDegrees">
<view class="text-gray">本期度数</view>
<view class="text-gray">{{item.curDegrees}}</view>
</view>
<view class="flex margin-top-xs justify-between" v-if="item.preDegrees">
<view class="text-gray">使用量</view>
<view class="text-gray">{{item.curDegrees-item.preDegrees}}</view>
</view>
<view class="flex margin-top-xs justify-between">
<view class="text-gray">备注</view>
<view class="text-gray">{{item.remark}}</view>

View File

@ -74,6 +74,31 @@
<text class="text-grey text-sm">{{endTime }}</text>
</view>
</view>
<view class="cu-item" v-if="preDegrees">
<view class="content">
<text class="text-grey">上期度数</text>
</view>
<view class="action">
<text class="text-grey text-sm">{{preDegrees }}</text>
</view>
</view>
<view class="cu-item" v-if="curDegrees">
<view class="content">
<text class="text-grey">本期度数</text>
</view>
<view class="action">
<text class="text-grey text-sm">{{curDegrees }}</text>
</view>
</view>
<view class="cu-item" v-if="curDegrees">
<view class="content">
<text class="text-grey">使用量</text>
</view>
<view class="action">
<text class="text-grey text-sm">{{curDegrees-preDegrees}}</text>
</view>
</view>
<vcDiscount ref="vcDiscountRef" @computeFeeDiscount="computeFeeDiscount" payerObjType="3333" :payerObjId="roomId" :endTime="formatEndTime" :feeId="feeId" :cycles="feeMonth" :communityId="communityId"></vcDiscount>
</view>
@ -154,6 +179,8 @@
feeFlag:'',
paymentCycle:1,
squarePrice: 0,
preDegrees:'',
curDegrees:''
};
},
@ -196,6 +223,8 @@
this.formatEndTime = date2String(_fee.endTime);
this.feeFlag = _fee.feeFlag;
this.squarePrice = _fee.squarePrice;
this.preDegrees = _fee.preDegrees;
this.curDegrees = _fee.curDegrees;
if(this.feeFlag == '2006012'){
return;
}
@ -207,6 +236,7 @@
this.feeMonth = this.paymentCycle;
let _endTime = addMonth(_lastDate, parseInt(this.feeMonth));
this.endTime = formatDate(_endTime);
this.$nextTick(() => {
this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth);