optimize fee config

This commit is contained in:
java110 2023-01-30 16:35:38 +08:00
parent 00f6b31c10
commit becbca38b6
4 changed files with 55 additions and 93 deletions

View File

@ -1,5 +1,4 @@
<div id="addFeeFormulaModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div id="addFeeFormulaModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
@ -14,8 +13,7 @@
<span><vc:i18n name="公式" namespace="addFeeFormula"></vc:i18n></span>
</label>
<div class="col-sm-10">
<textarea :placeholder="vc.i18n('必填,请填写公式','addFeeFormula')" class="form-control"
v-model="addFeeFormulaInfo.formulaValue">
<textarea :placeholder="vc.i18n('必填,请填写公式','addFeeFormula')" class="form-control" v-model="addFeeFormulaInfo.formulaValue">
</textarea>
</div>
</div>
@ -24,8 +22,7 @@
<span><vc:i18n name="单价" namespace="addFeeFormula"></vc:i18n></span>
</label>
<div class="col-sm-10">
<input :placeholder="vc.i18n('必填,请填写单价','addFeeFormula')" type="text"
class="form-control" v-model="addFeeFormulaInfo.price">
<input :placeholder="vc.i18n('必填,请填写单价','addFeeFormula')" type="text" class="form-control" v-model="addFeeFormulaInfo.price">
</div>
</div>
<div class="form-group row">
@ -33,9 +30,7 @@
<span><vc:i18n name="描述" namespace="addFeeFormula"></vc:i18n></span>
</label>
<div class="col-sm-10">
<textarea v-model="addFeeFormulaInfo.formulaDesc"
:placeholder="vc.i18n('选填,请填写描述','addFeeFormula')"
class="form-control">
<textarea v-model="addFeeFormulaInfo.formulaDesc" :placeholder="vc.i18n('选填,请填写描述','addFeeFormula')" class="form-control">
</textarea>
</div>
</div>
@ -53,8 +48,7 @@
<div>L 代表房屋对应楼栋房屋数</div>
<div>D 代表房屋对应单元房屋数</div>
<div>
<span><vc:i18n name="举例" namespace="addFeeFormula"></vc:i18n></span>:公共区域公摊电费
电量/楼栋面积*房屋面积
<span><vc:i18n name="举例" namespace="addFeeFormula"></vc:i18n></span>:公共区域公摊电费 电量/楼栋面积*房屋面积
</div>
<div>
<span><vc:i18n name="公式" namespace="addFeeFormula"></vc:i18n></span>T/F * R
@ -62,12 +56,10 @@
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="saveFeeFormulaInfo()">
<button class="btn btn-primary float-right" type="button" v-on:click="saveFeeFormulaInfo()">
<i class="fa fa-check"></i>&nbsp;保存
</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal">
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">
<span><vc:i18n name="取消" namespace="addFeeFormula"></vc:i18n></span>
</button>
</div>
@ -77,4 +69,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
(function (vc) {
(function(vc) {
vc.extends({
propTypes: {
callBackListener: vc.propTypes.string, //父组件名称
@ -12,10 +12,9 @@
price: ''
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('addFeeFormula', 'openAddFeeFormulaModal', function () {
_initMethod: function() {},
_initEvent: function() {
vc.on('addFeeFormula', 'openAddFeeFormulaModal', function() {
$('#addFeeFormulaModel').modal('show');
});
},
@ -24,8 +23,7 @@
return vc.validate.validate({
addFeeFormulaInfo: vc.component.addFeeFormulaInfo
}, {
'addFeeFormulaInfo.formulaValue': [
{
'addFeeFormulaInfo.formulaValue': [{
limit: "required",
param: "",
errInfo: "公式不能为空"
@ -36,8 +34,7 @@
errInfo: "公式太复杂"
}
],
'addFeeFormulaInfo.price': [
{
'addFeeFormulaInfo.price': [{
limit: "required",
param: "",
errInfo: "单价不能为空"
@ -46,23 +43,16 @@
limit: "moneyModulus",
param: "",
errInfo: "单价填写有误如1.5000"
},
{
limit: "num",
param: "",
errInfo: "单价必须是数字"
}
],
'addFeeFormulaInfo.formulaDesc': [
{
limit: "maxLength",
param: "200",
errInfo: "描述太长"
}
],
'addFeeFormulaInfo.formulaDesc': [{
limit: "maxLength",
param: "200",
errInfo: "描述太长"
}],
});
},
saveFeeFormulaInfo: function () {
saveFeeFormulaInfo: function() {
if (!vc.component.addFeeFormulaValidate()) {
vc.toast(vc.validate.errInfo);
return;
@ -76,11 +66,10 @@
}
vc.http.apiPost(
'/feeFormula/saveFeeFormula',
JSON.stringify(vc.component.addFeeFormulaInfo),
{
JSON.stringify(vc.component.addFeeFormulaInfo), {
emulateJSON: true
},
function (json, res) {
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
@ -94,12 +83,12 @@
vc.toast(_json.msg);
}
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
},
clearAddFeeFormulaInfo: function () {
clearAddFeeFormulaInfo: function() {
vc.component.addFeeFormulaInfo = {
formulaValue: '',
formulaDesc: '',
@ -108,4 +97,4 @@
}
}
});
})(window.vc);
})(window.vc);

View File

@ -1,5 +1,4 @@
<div id="editFeeFormulaModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div id="editFeeFormulaModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
@ -14,8 +13,7 @@
<span><vc:i18n name="公式" namespace="editFeeFormula"></vc:i18n></span>
</label>
<div class="col-sm-10">
<input v-model="editFeeFormulaInfo.formulaValue" type="text"
:placeholder="vc.i18n('必填,请填写公式','editFeeFormula')" class="form-control">
<input v-model="editFeeFormulaInfo.formulaValue" type="text" :placeholder="vc.i18n('必填,请填写公式','editFeeFormula')" class="form-control">
</div>
</div>
<div class="form-group row">
@ -23,8 +21,7 @@
<span><vc:i18n name="单价" namespace="editFeeFormula"></vc:i18n></span>
</label>
<div class="col-sm-10">
<input :placeholder="vc.i18n('必填,请填写单价','editFeeFormula')" type="text"
class="form-control" v-model="editFeeFormulaInfo.price">
<input :placeholder="vc.i18n('必填,请填写单价','editFeeFormula')" type="text" class="form-control" v-model="editFeeFormulaInfo.price">
</div>
</div>
<div class="form-group row">
@ -32,8 +29,7 @@
<span><vc:i18n name="描述" namespace="editFeeFormula"></vc:i18n></span>
</label>
<div class="col-sm-10">
<input v-model="editFeeFormulaInfo.formulaDesc" type="text"
:placeholder="vc.i18n('选填,请填写描述','editFeeFormula')" class="form-control">
<input v-model="editFeeFormulaInfo.formulaDesc" type="text" :placeholder="vc.i18n('选填,请填写描述','editFeeFormula')" class="form-control">
</div>
</div>
<div class="form-group row">
@ -50,8 +46,7 @@
<div>L 代表房屋对应楼栋房屋数</div>
<div>D 代表房屋对应单元房屋数</div>
<div>
<span><vc:i18n name="举例" namespace="editFeeFormula"></vc:i18n></span>:公共区域公摊电费
电量/楼栋面积*房屋面积
<span><vc:i18n name="举例" namespace="editFeeFormula"></vc:i18n></span>:公共区域公摊电费 电量/楼栋面积*房屋面积
</div>
<div>
<span><vc:i18n name="公式" namespace="editFeeFormula"></vc:i18n></span>T/F * R
@ -62,8 +57,7 @@
<button class="btn btn-primary float-right" type="button" v-on:click="editFeeFormula()">
<i class="fa fa-check"></i>&nbsp;保存
</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal">
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">
<span><vc:i18n name="取消" namespace="editFeeFormula"></vc:i18n></span>
</button>
</div>
@ -73,4 +67,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
(function (vc, vm) {
(function(vc, vm) {
vc.extends({
data: {
editFeeFormulaInfo: {
@ -8,10 +8,9 @@
price: ''
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('editFeeFormula', 'openEditFeeFormulaModal', function (_params) {
_initMethod: function() {},
_initEvent: function() {
vc.on('editFeeFormula', 'openEditFeeFormulaModal', function(_params) {
vc.component.refreshEditFeeFormulaInfo();
$('#editFeeFormulaModel').modal('show');
vc.copyObject(_params, vc.component.editFeeFormulaInfo);
@ -19,12 +18,11 @@
});
},
methods: {
editFeeFormulaValidate: function () {
editFeeFormulaValidate: function() {
return vc.validate.validate({
editFeeFormulaInfo: vc.component.editFeeFormulaInfo
}, {
'editFeeFormulaInfo.formulaValue': [
{
'editFeeFormulaInfo.formulaValue': [{
limit: "required",
param: "",
errInfo: "公式不能为空"
@ -35,8 +33,7 @@
errInfo: "公式太复杂"
}
],
'editFeeFormulaInfo.price': [
{
'editFeeFormulaInfo.price': [{
limit: "required",
param: "",
errInfo: "单价不能为空"
@ -45,41 +42,31 @@
limit: "moneyModulus",
param: "",
errInfo: "单价填写有误如1.5000"
},
{
limit: "num",
param: "",
errInfo: "单价必须是数字"
}
],
'editFeeFormulaInfo.formulaDesc': [
{
limit: "maxLength",
param: "200",
errInfo: "描述太长"
}
],
'editFeeFormulaInfo.formulaId': [
{
limit: "required",
param: "",
errInfo: "公式ID不能为空"
}
]
'editFeeFormulaInfo.formulaDesc': [{
limit: "maxLength",
param: "200",
errInfo: "描述太长"
}],
'editFeeFormulaInfo.formulaId': [{
limit: "required",
param: "",
errInfo: "公式ID不能为空"
}]
});
},
editFeeFormula: function () {
editFeeFormula: function() {
if (!vc.component.editFeeFormulaValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
vc.http.apiPost(
'/feeFormula/updateFeeFormula',
JSON.stringify(vc.component.editFeeFormulaInfo),
{
JSON.stringify(vc.component.editFeeFormulaInfo), {
emulateJSON: true
},
function (json, res) {
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
@ -92,12 +79,12 @@
vc.toast(_json.msg);
}
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
},
refreshEditFeeFormulaInfo: function () {
refreshEditFeeFormulaInfo: function() {
vc.component.editFeeFormulaInfo = {
formulaId: '',
formulaValue: '',
@ -107,4 +94,4 @@
}
}
});
})(window.vc, window.vc.component);
})(window.vc, window.vc.component);