优化一次性缴费 不不能选缴费周期

This commit is contained in:
java110 2020-07-01 21:54:57 +08:00
parent 9c7728fa7e
commit 37d817e974
2 changed files with 97 additions and 89 deletions

View File

@ -35,12 +35,14 @@
<label class=" col-form-label">{{payFeeOrderInfo.endTime}}</label>
</div>
</div>
<div class="form-group row">
<div class="form-group row" v-if="payFeeOrderInfo.feeFlag != '2006012'">
<label class="col-sm-2 col-form-label">缴费周期</label>
<div class="col-sm-6">
<select class="custom-select" v-model="payFeeOrderInfo.cycles" @change="_changeMonth(payFeeOrderInfo.cycles)">
<select class="custom-select" v-model="payFeeOrderInfo.cycles"
@change="_changeMonth(payFeeOrderInfo.cycles)">
<option disabled value="">必填,请选择缴费周期</option>
<option v-for="item in payFeeOrderInfo.paymentCycles" :value="item">{{item}}个月</option>
<option v-for="item in payFeeOrderInfo.paymentCycles" :value="item">{{item}}个月
</option>
<option value="-101">自定义</option>
</select>
</div>
@ -48,23 +50,27 @@
</div>
<div class="col-4" style="padding-left: 30px;">
<div class="row">
<label class="col-sm-3 col-form-label" style="line-height: 50px;padding-right:0px;" >应收款:</label>
<label class="col-sm-8 col-form-label" style="font-size: 30px;color: red;padding-left:0px;">¥{{payFeeOrderInfo.totalFeePrice}}</label>
<label class="col-sm-3 col-form-label"
style="line-height: 50px;padding-right:0px;">应收款:</label>
<label class="col-sm-8 col-form-label"
style="font-size: 30px;color: red;padding-left:0px;">¥{{payFeeOrderInfo.totalFeePrice}}</label>
</div>
<div class="row form-group">
<label class="col-sm-3 col-form-label" style="padding-right:0px;">支付方式:</label>
<label class="col-sm-4 col-form-label" style="padding-left:5px;">现金</label>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label" style="padding-right:0px;">实收款</label>
<div class="col-sm-8" style="padding-left:5px;"><input type="text" placeholder="请输入实际收款金额" v-model="payFeeOrderInfo.receivedAmount"
class="form-control"></div>
<label class="col-sm-3 col-form-label" style="padding-right:0px;">实收款</label>
<div class="col-sm-8" style="padding-left:5px;"><input type="text"
placeholder="请输入实际收款金额" v-model="payFeeOrderInfo.receivedAmount"
class="form-control"></div>
</div>
<div class="form-group row">
</div>
<div class="form-group row">
<div class="col-sm-8">
<button type="button" class="btn btn-warning btn-lg btn-block" @click="_payFee()">提交收费</button>
<button type="button" class="btn btn-warning btn-lg btn-block"
@click="_payFee()">提交收费</button>
</div>
</div>
</div>
@ -93,4 +99,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,80 +1,82 @@
(function(vc){
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data:{
payFeeOrderInfo:{
feeId:'',
feeName:'',
data: {
payFeeOrderInfo: {
feeId: '',
feeName: '',
feeTypeCdName: '',
endTime: '',
feePrice:0.00,
cycles:'1',
paymentCycles:[],
totalFeePrice:0.00,
receivedAmount:'',
communityId:vc.getCurrentCommunity().communityId
feeFlag: '',
feePrice: 0.00,
cycles: '1',
paymentCycles: [],
totalFeePrice: 0.00,
receivedAmount: '',
communityId: vc.getCurrentCommunity().communityId
}
},
_initMethod:function(){
if(vc.notNull(vc.getParam("feeId"))){
vc.component.payFeeOrderInfo.feeId = vc.getParam('feeId');
vc.component.payFeeOrderInfo.feeName = vc.getParam('feeName');
vc.component.payFeeOrderInfo.feeTypeCdName = vc.getParam('feeTypeCdName');
vc.component.payFeeOrderInfo.endTime = vc.getParam('endTime').replace(/%3A/g,':');
vc.component.payFeeOrderInfo.feePrice = vc.getParam('feePrice');
$that.payFeeOrderInfo.paymentCycles = [];
for(let _index=1 ; _index < 7; _index ++){
_initMethod: function () {
if (vc.notNull(vc.getParam("feeId"))) {
vc.component.payFeeOrderInfo.feeId = vc.getParam('feeId');
vc.component.payFeeOrderInfo.feeName = vc.getParam('feeName');
vc.component.payFeeOrderInfo.feeTypeCdName = vc.getParam('feeTypeCdName');
vc.component.payFeeOrderInfo.endTime = vc.getParam('endTime').replace(/%3A/g, ':');
vc.component.payFeeOrderInfo.feePrice = vc.getParam('feePrice');
$that.payFeeOrderInfo.feeFlag = vc.getParam('feeFlag');
$that.payFeeOrderInfo.paymentCycles = [];
for (let _index = 1; _index < 7; _index++) {
$that.payFeeOrderInfo.paymentCycles.push(_index * vc.getParam('paymentCycle'))
}
}
};
vc.component.payFeeOrderInfo.totalFeePrice = vc.component.payFeeOrderInfo.feePrice;
vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice ;
vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice;
},
_initEvent:function(){
_initEvent: function () {
},
methods:{
payFeeValidate:function(){
return vc.validate.validate({
payFeeOrderInfo:vc.component.payFeeOrderInfo
},{
'payFeeOrderInfo.feeId':[
{
limit:"required",
param:"",
errInfo:"费用ID不能为空"
}
],
'payFeeOrderInfo.cycles':[
{
limit:"required",
param:"",
errInfo:"缴费周期不能为空"
}
],
'payFeeOrderInfo.receivedAmount':[
{
limit:"required",
param:"",
errInfo:"实收金额不能为空"
},
{
limit:"money",
param:"",
errInfo:"实收金额不是有效的金额"
}
]
});
},
_payFee:function(_page,_row){
if(!vc.component.payFeeValidate()){
methods: {
payFeeValidate: function () {
return vc.validate.validate({
payFeeOrderInfo: vc.component.payFeeOrderInfo
}, {
'payFeeOrderInfo.feeId': [
{
limit: "required",
param: "",
errInfo: "费用ID不能为空"
}
],
'payFeeOrderInfo.cycles': [
{
limit: "required",
param: "",
errInfo: "缴费周期不能为空"
}
],
'payFeeOrderInfo.receivedAmount': [
{
limit: "required",
param: "",
errInfo: "实收金额不能为空"
},
{
limit: "money",
param: "",
errInfo: "实收金额不是有效的金额"
}
]
});
},
_payFee: function (_page, _row) {
if (!vc.component.payFeeValidate()) {
vc.toast(vc.validate.errInfo);
return ;
return;
}
vc.http.post(
@ -82,39 +84,39 @@
'payFee',
JSON.stringify(vc.component.payFeeOrderInfo),
{
emulateJSON:true
},
function(json,res){
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if(res.status == 200){
if (res.status == 200) {
//关闭model
$("#payFeeResult").modal({
backdrop: "static",//点击空白处不关闭对话框
show:true
});
return ;
$("#payFeeResult").modal({
backdrop: "static",//点击空白处不关闭对话框
show: true
});
return;
}
vc.toast(json);
},
function(errInfo,error){
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
});
},
_changeMonth:function(_cycles){
if('-101' == _cycles){
_changeMonth: function (_cycles) {
if ('-101' == _cycles) {
vc.component.payFeeOrderInfo.totalFeePrice = 0.00;
vc.component.payFeeOrderInfo.receivedAmount = '';
return ;
return;
}
vc.component.payFeeOrderInfo.totalFeePrice = Math.floor(parseFloat(_cycles)*parseFloat(vc.component.payFeeOrderInfo.feePrice)*100)/100;
vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice ;
vc.component.payFeeOrderInfo.totalFeePrice = Math.floor(parseFloat(_cycles) * parseFloat(vc.component.payFeeOrderInfo.feePrice) * 100) / 100;
vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice;
},
_back:function(){
_back: function () {
$('#payFeeResult').modal("hide");
vc.getBack();
},
_printAndBack:function(){
_printAndBack: function () {
$('#payFeeResult').modal("hide");
vc.getBack();