From c9eca8cc96e5ca31a0a4d2675d0b1b97d286c291 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 8 Dec 2021 15:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/addAccountBond/addAccountBond.js | 56 +++++++--------- .../deleteAccountBond/deleteAccountBond.js | 22 +++---- .../common/editAccountBond/editAccountBond.js | 65 ++++++++----------- 3 files changed, 62 insertions(+), 81 deletions(-) diff --git a/public/components/common/addAccountBond/addAccountBond.js b/public/components/common/addAccountBond/addAccountBond.js index 1c918afa7..b0b20ca49 100644 --- a/public/components/common/addAccountBond/addAccountBond.js +++ b/public/components/common/addAccountBond/addAccountBond.js @@ -1,4 +1,4 @@ -(function (vc) { +(function(vc) { vc.extends({ propTypes: { @@ -16,11 +16,11 @@ remark: '' } }, - _initMethod: function () { - + _initMethod: function() { + }, - _initEvent: function () { - vc.on('addAccountBond', 'openAddAccountBondModal', function () { + _initEvent: function() { + vc.on('addAccountBond', 'openAddAccountBondModal', function() { $('#addAccountBondModel').modal('show'); }); }, @@ -29,8 +29,7 @@ return vc.validate.validate({ addAccountBondInfo: vc.component.addAccountBondInfo }, { - 'addAccountBondInfo.bondName': [ - { + 'addAccountBondInfo.bondName': [{ limit: "required", param: "", errInfo: "保证金名称不能为空" @@ -41,8 +40,7 @@ errInfo: "保证金名称超长了" }, ], - 'addAccountBondInfo.amount': [ - { + 'addAccountBondInfo.amount': [{ limit: "required", param: "", errInfo: "保证金金额不能为空" @@ -53,34 +51,29 @@ errInfo: "保证金金额格式有误" }, ], - 'addAccountBondInfo.bondMonth': [ - { - limit: "num", - param: "", - errInfo: "有效月份格式错误" - }, - ], - 'addAccountBondInfo.objId': [ - { - limit: "maxin", - param: "1,30", - errInfo: "类型ID超长了" - }, - ], + 'addAccountBondInfo.bondMonth': [{ + limit: "num", + param: "", + errInfo: "有效月份格式错误" + }, ], + 'addAccountBondInfo.objId': [{ + limit: "maxin", + param: "1,30", + errInfo: "类型ID超长了" + }, ], }); }, - saveAccountBondInfo: function () { + saveAccountBondInfo: function() { if (!vc.component.addAccountBondValidate()) { vc.toast(vc.validate.errInfo); return; } - vc.component.addAccountBondInfo.communityId = vc.getCurrentCommunity().communityId; //不提交数据将数据 回调给侦听处理 if (vc.notNull($props.callBackListener)) { vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addAccountBondInfo); @@ -90,11 +83,10 @@ vc.http.apiPost( '/accountBond/saveAccountBond', - JSON.stringify(vc.component.addAccountBondInfo), - { + JSON.stringify(vc.component.addAccountBondInfo), { 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) { @@ -108,21 +100,21 @@ vc.message(_json.msg); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.message(errInfo); }); }, - setAddBondName:function(_objId){ + setAddBondName: function(_objId) { $that.accountBondManageInfo.shopTypes.forEach(item => { if (item.shopTypeId == _objId) { $that.addAccountBondInfo.bondName = item.typeName; } }); }, - clearAddAccountBondInfo: function () { + clearAddAccountBondInfo: function() { vc.component.addAccountBondInfo = { bondName: '', amount: '', @@ -136,4 +128,4 @@ } }); -})(window.vc); +})(window.vc); \ No newline at end of file diff --git a/public/components/common/deleteAccountBond/deleteAccountBond.js b/public/components/common/deleteAccountBond/deleteAccountBond.js index 24912e3a7..cad9860fa 100644 --- a/public/components/common/deleteAccountBond/deleteAccountBond.js +++ b/public/components/common/deleteAccountBond/deleteAccountBond.js @@ -1,4 +1,4 @@ -(function (vc, vm) { +(function(vc, vm) { vc.extends({ data: { @@ -6,11 +6,11 @@ } }, - _initMethod: function () { + _initMethod: function() { }, - _initEvent: function () { - vc.on('deleteAccountBond', 'openDeleteAccountBondModal', function (_params) { + _initEvent: function() { + vc.on('deleteAccountBond', 'openDeleteAccountBondModal', function(_params) { vc.component.deleteAccountBondInfo = _params; $('#deleteAccountBondModel').modal('show'); @@ -18,15 +18,13 @@ }); }, methods: { - deleteAccountBond: function () { - vc.component.deleteAccountBondInfo.communityId = vc.getCurrentCommunity().communityId; + deleteAccountBond: function() { vc.http.apiPost( '/accountBond/deleteAccountBond', - JSON.stringify(vc.component.deleteAccountBondInfo), - { + JSON.stringify(vc.component.deleteAccountBondInfo), { 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) { @@ -37,16 +35,16 @@ } vc.message(_json.msg); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.message(json); }); }, - closeDeleteAccountBondModel: function () { + closeDeleteAccountBondModel: function() { $('#deleteAccountBondModel').modal('hide'); } } }); -})(window.vc, window.vc.component); +})(window.vc, window.vc.component); \ No newline at end of file diff --git a/public/components/common/editAccountBond/editAccountBond.js b/public/components/common/editAccountBond/editAccountBond.js index eff7d146c..7f701af72 100644 --- a/public/components/common/editAccountBond/editAccountBond.js +++ b/public/components/common/editAccountBond/editAccountBond.js @@ -1,4 +1,4 @@ -(function (vc, vm) { +(function(vc, vm) { vc.extends({ data: { @@ -13,24 +13,22 @@ } }, - _initMethod: function () { + _initMethod: function() { }, - _initEvent: function () { - vc.on('editAccountBond', 'openEditAccountBondModal', function (_params) { + _initEvent: function() { + vc.on('editAccountBond', 'openEditAccountBondModal', function(_params) { vc.component.refreshEditAccountBondInfo(); $('#editAccountBondModel').modal('show'); vc.copyObject(_params, vc.component.editAccountBondInfo); - vc.component.editAccountBondInfo.communityId = vc.getCurrentCommunity().communityId; }); }, methods: { - editAccountBondValidate: function () { + editAccountBondValidate: function() { return vc.validate.validate({ editAccountBondInfo: vc.component.editAccountBondInfo }, { - 'editAccountBondInfo.bondName': [ - { + 'editAccountBondInfo.bondName': [{ limit: "required", param: "", errInfo: "保证金名称不能为空" @@ -41,8 +39,7 @@ errInfo: "保证金名称超长了" }, ], - 'editAccountBondInfo.amount': [ - { + 'editAccountBondInfo.amount': [{ limit: "required", param: "", errInfo: "保证金金额不能为空" @@ -53,30 +50,25 @@ errInfo: "保证金金额格式有误" }, ], - 'editAccountBondInfo.bondMonth': [ - { - limit: "num", - param: "", - errInfo: "有效月份格式错误" - }, - ], - 'editAccountBondInfo.objId': [ - { - limit: "maxin", - param: "1,30", - errInfo: "类型ID超长了" - }, - ], - 'editAccountBondInfo.bondId': [ - { - limit: "required", - param: "", - errInfo: "保证金ID不能为空" - }] + 'editAccountBondInfo.bondMonth': [{ + limit: "num", + param: "", + errInfo: "有效月份格式错误" + }, ], + 'editAccountBondInfo.objId': [{ + limit: "maxin", + param: "1,30", + errInfo: "类型ID超长了" + }, ], + 'editAccountBondInfo.bondId': [{ + limit: "required", + param: "", + errInfo: "保证金ID不能为空" + }] }); }, - editAccountBond: function () { + editAccountBond: function() { if (!vc.component.editAccountBondValidate()) { vc.toast(vc.validate.errInfo); return; @@ -84,11 +76,10 @@ vc.http.apiPost( '/accountBond/updateAccountBond', - JSON.stringify(vc.component.editAccountBondInfo), - { + JSON.stringify(vc.component.editAccountBondInfo), { 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) { @@ -99,13 +90,13 @@ } vc.message(_json.msg); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.message(errInfo); }); }, - refreshEditAccountBondInfo: function () { + refreshEditAccountBondInfo: function() { vc.component.editAccountBondInfo = { bondId: '', bondName: '', @@ -120,4 +111,4 @@ } }); -})(window.vc, window.vc.component); +})(window.vc, window.vc.component); \ No newline at end of file