优化稳定版添加费用项失败问题

This commit is contained in:
java110 2020-06-11 10:09:46 +08:00
parent f8f1f0a07e
commit 8d2671a05e
4 changed files with 253 additions and 140 deletions

View File

@ -7,19 +7,6 @@
<div class="ibox-content">
<div>
<div>
<!--<div class="form-group row">
<label class="col-sm-2 col-form-label">楼名称</label>
<div class="col-sm-10"><input v-model="addFloorInfo.name" type="text" placeholder="必填,请填写名称" class="form-control"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">楼编号</label>
<div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="email" placeholder="必填,请填写编号" class="form-control"></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">备注</label>
<div class="col-sm-10"><input v-model="addFloorInfo.remark" type="tel" placeholder="可填,请填写备注" class="form-control"></div>
</div>-->
<div class="form-group row">
<label class="col-sm-2 col-form-label">费用类型</label>
<div class="col-sm-10">
@ -46,6 +33,34 @@
<option value="2006012">一次性费用</option>
</select></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">付费类型</label>
<div class="col-sm-10">
<select class="custom-select" v-model="addFeeConfigInfo.paymentCd">
<option selected disabled value="">必填,请选择付费类型</option>
<option value="1200">预付费</option>
<option value="2100">后付费</option>
</select></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">缴费周期</label>
<div class="col-sm-10">
<input v-model="addFeeConfigInfo.paymentCycle" type="text" placeholder="必填,请填写缴费周期 单位为月"
class="form-control">
</div>
</div>
<div class="form-group row" >
<label class="col-sm-2 col-form-label">出账类型</label>
<div class="col-sm-10">
<select class="custom-select" v-model="addFeeConfigInfo.billType">
<option selected disabled value="">必填,请选择出账类型</option>
<option value="001">每年1月1日</option>
<option value="002">每月1日</option>
<option value="003">每日</option>
<option value="004">实时</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">计费起始时间</label>
<div class="col-sm-10">
@ -99,4 +114,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
(function(vc) {
(function (vc) {
vc.extends({
propTypes: {
@ -17,30 +17,34 @@
computingFormula: '',
squarePrice: '',
additionalAmount: '',
feeTypeCds:[],
computingFormulas:[]
feeTypeCds: [],
computingFormulas: [],
billType: '',
paymentCycle: '',
paymentCd: ''
}
},
_initMethod: function() {
_initMethod: function () {
vc.component._initAddFeeConfigDateInfo();
vc.getDict('pay_fee_config',"fee_type_cd",function(_data){
vc.getDict('pay_fee_config', "fee_type_cd", function (_data) {
vc.component.addFeeConfigInfo.feeTypeCds = _data;
});
vc.getDict('pay_fee_config',"computing_formula",function(_data){
vc.getDict('pay_fee_config', "computing_formula", function (_data) {
vc.component.addFeeConfigInfo.computingFormulas = _data;
});
},
_initEvent: function() {
_initEvent: function () {
vc.on('addFeeConfig', 'openAddFeeConfigModal',
function() {
$('#addFeeConfigModel').modal('show');
});
function () {
$('#addFeeConfigModel').modal('show');
});
},
methods: {
_initAddFeeConfigDateInfo: function () {
vc.component.addFeeConfigInfo.startTime = vc.dateFormat(new Date().getTime());
$('.addFeeConfigStartTime').datetimepicker({
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd hh:ii:ss',
initTime: true,
initialDate: new Date(),
@ -55,6 +59,7 @@
});
$('.addFeeConfigEndTime').datetimepicker({
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd hh:ii:ss',
initTime: true,
initialDate: new Date(),
@ -71,102 +76,130 @@
return vc.validate.validate({
addFeeConfigInfo: vc.component.addFeeConfigInfo
},
{
'addFeeConfigInfo.feeTypeCd': [{
limit: "required",
param: "",
errInfo: "费用类型不能为空"
},
{
limit: "num",
param: "",
errInfo: "费用类型格式错误"
},
],
'addFeeConfigInfo.feeName': [{
limit: "required",
param: "",
errInfo: "收费项目不能为空"
},
{
limit: "maxin",
param: "1,100",
errInfo: "收费项目不能超过100位"
},
],
'addFeeConfigInfo.feeFlag': [{
limit: "required",
param: "",
errInfo: "费用标识不能为空"
},
{
limit: "num",
param: "",
errInfo: "费用类型格式错误"
},
],
'addFeeConfigInfo.startTime': [{
limit: "required",
param: "",
errInfo: "计费起始时间不能为空"
},
{
limit: "dateTime",
param: "",
errInfo: "计费起始时间不是有效的时间格式"
},
],
'addFeeConfigInfo.endTime': [{
limit: "required",
param: "",
errInfo: "计费终止时间不能为空"
},
{
limit: "dateTime",
param: "",
errInfo: "计费终止时间不是有效的时间格式"
},
],
'addFeeConfigInfo.computingFormula': [{
limit: "required",
param: "",
errInfo: "计算公式不能为空"
},
{
limit: "num",
param: "",
errInfo: "计算公式格式错误"
},
],
'addFeeConfigInfo.squarePrice': [{
limit: "required",
param: "",
errInfo: "计费单价不能为空"
},
{
limit: "money",
param: "",
errInfo: "计费单价格式错误"
},
],
'addFeeConfigInfo.additionalAmount': [{
limit: "required",
param: "",
errInfo: "附加费用不能为空"
},
{
limit: "money",
param: "",
errInfo: "附加费用格式错误"
},
],
'addFeeConfigInfo.feeTypeCd': [{
limit: "required",
param: "",
errInfo: "费用类型不能为空"
},
{
limit: "num",
param: "",
errInfo: "费用类型格式错误"
},
],
'addFeeConfigInfo.feeName': [{
limit: "required",
param: "",
errInfo: "收费项目不能为空"
},
{
limit: "maxin",
param: "1,100",
errInfo: "收费项目不能超过100位"
},
],
'addFeeConfigInfo.feeFlag': [{
limit: "required",
param: "",
errInfo: "费用标识不能为空"
},
{
limit: "num",
param: "",
errInfo: "费用类型格式错误"
},
],
'addFeeConfigInfo.startTime': [{
limit: "required",
param: "",
errInfo: "计费起始时间不能为空"
},
{
limit: "dateTime",
param: "",
errInfo: "计费起始时间不是有效的时间格式"
},
],
'addFeeConfigInfo.endTime': [{
limit: "required",
param: "",
errInfo: "计费终止时间不能为空"
},
{
limit: "dateTime",
param: "",
errInfo: "计费终止时间不是有效的时间格式"
},
],
'addFeeConfigInfo.computingFormula': [{
limit: "required",
param: "",
errInfo: "计算公式不能为空"
},
{
limit: "num",
param: "",
errInfo: "计算公式格式错误"
},
],
'addFeeConfigInfo.squarePrice': [{
limit: "required",
param: "",
errInfo: "计费单价不能为空"
},
{
limit: "money",
param: "",
errInfo: "计费单价格式错误"
},
],
'addFeeConfigInfo.additionalAmount': [{
limit: "required",
param: "",
errInfo: "附加费用不能为空"
},
{
limit: "money",
param: "",
errInfo: "附加费用格式错误"
},
],
'addFeeConfigInfo.billType': [{
limit: "required",
param: "",
errInfo: "出账类型不能为空"
}
],
'addFeeConfigInfo.paymentCycle': [{
limit: "required",
param: "",
errInfo: "缴费周期不能为空"
},
{
limit: "num",
param: "",
errInfo: "缴费周期必须为数字 单位月"
},
],
'addFeeConfigInfo.paymentCd': [{
limit: "required",
param: "",
errInfo: "付费类型不能为空"
},
{
limit: "num",
param: "",
errInfo: "付费类型格式错误"
},
]
});
});
},
saveFeeConfigInfo: function() {
saveFeeConfigInfo: function () {
//固定费用
if(vc.component.addFeeConfigInfo.computingFormula == '2002'){
vc.component.addFeeConfigInfo.squarePrice = "0.00";
if (vc.component.addFeeConfigInfo.computingFormula == '2002') {
vc.component.addFeeConfigInfo.squarePrice = "0.00";
}
if (!vc.component.addFeeConfigValidate()) {
vc.toast(vc.validate.errInfo);
@ -185,28 +218,28 @@
vc.http.post('addFeeConfig', 'save', JSON.stringify(vc.component.addFeeConfigInfo), {
emulateJSON: true
},
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
//关闭model
$('#addFeeConfigModel').modal('hide');
vc.component.clearAddFeeConfigInfo();
vc.emit('feeConfigManage', 'listFeeConfig', {});
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
//关闭model
$('#addFeeConfigModel').modal('hide');
vc.component.clearAddFeeConfigInfo();
vc.emit('feeConfigManage', 'listFeeConfig', {});
return;
}
vc.toast(json);
return;
}
vc.toast(json);
},
function(errInfo, error) {
console.log('请求失败处理');
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
vc.toast(errInfo);
});
});
},
clearAddFeeConfigInfo: function() {
var _feeTypeCds = vc.component.addFeeConfigInfo.feeTypeCds;
clearAddFeeConfigInfo: function () {
var _feeTypeCds = vc.component.addFeeConfigInfo.feeTypeCds;
var _computingFormulas = vc.component.addFeeConfigInfo.computingFormulas;
vc.component.addFeeConfigInfo = {
feeTypeCd: '',
@ -217,9 +250,11 @@
computingFormula: '',
squarePrice: '',
additionalAmount: '',
feeTypeCds:_feeTypeCds,
computingFormulas:_computingFormulas
feeTypeCds: _feeTypeCds,
computingFormulas: _computingFormulas,
paymentCycle:'',
paymentCd:'',
billType: ''
};
}
}

View File

@ -33,6 +33,35 @@
<option value="2006012">一次性费用</option>
</select></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">付费类型</label>
<div class="col-sm-10">
<select class="custom-select" v-model="editFeeConfigInfo.paymentCd">
<option selected disabled value="">必填,请选择付费类型</option>
<option value="1200">预付费</option>
<option value="2100">后付费</option>
</select></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">缴费周期</label>
<div class="col-sm-10">
<input v-model="editFeeConfigInfo.paymentCycle" type="text" placeholder="必填,请填写缴费周期 单位为月"
class="form-control">
</div>
</div>
<div class="form-group row" >
<label class="col-sm-2 col-form-label">出账类型</label>
<div class="col-sm-10">
<select class="custom-select" v-model="editFeeConfigInfo.billType">
<option selected disabled value="">必填,请选择出账类型</option>
<option value="001">每年1月1日</option>
<option value="002">每月1日</option>
<option value="003">每日</option>
<option value="004">实时</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">计费起始时间</label>
<div class="col-sm-10">
@ -86,4 +115,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -14,7 +14,10 @@
additionalAmount: '0.00',
isDefault:'',
feeTypeCds:[],
computingFormulas:[]
computingFormulas:[],
billType:'',
paymentCycle:'',
paymentCd:''
}
},
_initMethod: function() {
@ -40,6 +43,7 @@
vc.component.editFeeConfigInfo.startTime = vc.dateFormat(new Date().getTime());
$('.editFeeConfigStartTime').datetimepicker({
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd hh:ii:ss',
initTime: true,
initialDate: new Date(),
@ -54,6 +58,7 @@
});
$('.editFeeConfigEndTime').datetimepicker({
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd hh:ii:ss',
initTime: true,
initialDate: new Date(),
@ -163,7 +168,34 @@
limit: "required",
param: "",
errInfo: "费用项ID不能为空"
}]
}],
'editFeeConfigInfo.billType': [{
limit: "required",
param: "",
errInfo: "出账类型不能为空"
}],
'editFeeConfigInfo.paymentCycle': [{
limit: "required",
param: "",
errInfo: "缴费周期不能为空"
},
{
limit: "num",
param: "",
errInfo: "缴费周期必须为数字 单位月"
},
],
'editFeeConfigInfo.paymentCd': [{
limit: "required",
param: "",
errInfo: "付费类型不能为空"
},
{
limit: "num",
param: "",
errInfo: "付费类型格式错误"
},
]
});
},
@ -209,7 +241,9 @@
computingFormula: '',
squarePrice: '',
additionalAmount: '',
isDefault:''
isDefault:'',
paymentCycle:'',
paymentCd:''
};
vc.component.editFeeConfigInfo.feeTypeCds = _feeTypeCds;
vc.component.editFeeConfigInfo.computingFormulas = _computingFormulas;