diff --git a/public/components/property/addFeeFormula/addFeeFormula.html b/public/components/property/addFeeFormula/addFeeFormula.html index 209e9624b..c89379d3e 100755 --- a/public/components/property/addFeeFormula/addFeeFormula.html +++ b/public/components/property/addFeeFormula/addFeeFormula.html @@ -1,5 +1,4 @@ - - + \ No newline at end of file diff --git a/public/components/property/addFeeFormula/addFeeFormula.js b/public/components/property/addFeeFormula/addFeeFormula.js index bb0cfa55a..8f04aafa8 100755 --- a/public/components/property/addFeeFormula/addFeeFormula.js +++ b/public/components/property/addFeeFormula/addFeeFormula.js @@ -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); \ No newline at end of file diff --git a/public/components/property/editFeeFormula/editFeeFormula.html b/public/components/property/editFeeFormula/editFeeFormula.html index 85aca3235..8e47fe198 100755 --- a/public/components/property/editFeeFormula/editFeeFormula.html +++ b/public/components/property/editFeeFormula/editFeeFormula.html @@ -1,5 +1,4 @@ - \ No newline at end of file diff --git a/public/components/property/editFeeFormula/editFeeFormula.js b/public/components/property/editFeeFormula/editFeeFormula.js index 7c0932a50..b4476a0e7 100755 --- a/public/components/property/editFeeFormula/editFeeFormula.js +++ b/public/components/property/editFeeFormula/editFeeFormula.js @@ -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); \ No newline at end of file