From 27c9ec2ba1c3e454cc10f1664ba36399a39e5bb3 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 4 Jul 2022 12:16:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BA=BA=20=E6=94=B9=E6=88=90=20=E7=94=B3=E8=AF=B7=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addPurchaseApplyView.html | 13 +++---- .../addPurchaseApplyView.js | 39 +++++++++---------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/public/components/common/addPurchaseApplyView/addPurchaseApplyView.html b/public/components/common/addPurchaseApplyView/addPurchaseApplyView.html index 50362f48c..a53e349cb 100755 --- a/public/components/common/addPurchaseApplyView/addPurchaseApplyView.html +++ b/public/components/common/addPurchaseApplyView/addPurchaseApplyView.html @@ -9,24 +9,21 @@
- +
-
+
-
+
-
+
- + \ No newline at end of file diff --git a/public/components/common/addPurchaseApplyView/addPurchaseApplyView.js b/public/components/common/addPurchaseApplyView/addPurchaseApplyView.js index be51986ed..e96f7e3e0 100755 --- a/public/components/common/addPurchaseApplyView/addPurchaseApplyView.js +++ b/public/components/common/addPurchaseApplyView/addPurchaseApplyView.js @@ -1,4 +1,4 @@ -(function (vc) { +(function(vc) { vc.extends({ propTypes: { @@ -8,40 +8,41 @@ data: { addPurchaseApplyViewInfo: { flowComponent: 'addPurchaseApplyView', - description:'', - endUserName:'', - endUserTel:'', + description: '', + endUserName: '', + endUserTel: '', } }, watch: { addPurchaseApplyViewInfo: { deep: true, - handler: function () { + handler: function() { vc.component.saveAddComplainInfo(); } } }, - _initMethod: function () { - + _initMethod: function() { + let userInfo = vc.getData('/nav/getUserInfo'); + $that.addPurchaseApplyViewInfo.endUserName = userInfo.name; + $that.addPurchaseApplyViewInfo.endUserTel = userInfo.tel; }, - _initEvent: function () { + _initEvent: function() { - vc.on('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', function () { + vc.on('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', function() { vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addPurchaseApplyViewInfo); }); - vc.on('addPurchaseApplyViewInfo', 'onIndex', function (_index) { + vc.on('addPurchaseApplyViewInfo', 'onIndex', function(_index) { vc.component.addPurchaseApplyViewInfo.index = _index; }); }, methods: { - addComplainValidate: function () { + addComplainValidate: function() { return vc.validate.validate({ addPurchaseApplyViewInfo: vc.component.addPurchaseApplyViewInfo }, { - 'addPurchaseApplyViewInfo.description': [ - { + 'addPurchaseApplyViewInfo.description': [{ limit: "required", param: "", errInfo: "申请说明不能为空" @@ -52,8 +53,7 @@ errInfo: "申请说明不能超过200位" }, ], - 'addPurchaseApplyViewInfo.endUserName': [ - { + 'addPurchaseApplyViewInfo.endUserName': [{ limit: "required", param: "", errInfo: "联系人不能为空" @@ -64,8 +64,7 @@ errInfo: "联系人不能超过50位" }, ], - 'addPurchaseApplyViewInfo.endUserTel': [ - { + 'addPurchaseApplyViewInfo.endUserTel': [{ limit: "required", param: "", errInfo: "联系电话不能为空" @@ -79,12 +78,12 @@ }); }, - saveAddComplainInfo: function () { + saveAddComplainInfo: function() { if (vc.component.addComplainValidate()) { //侦听回传 vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addPurchaseApplyViewInfo); return; - }else{ + } else { vc.toast(vc.validate.errInfo); vc.emit($props.callBackListener, $props.callBackFunction, null); } @@ -92,4 +91,4 @@ } }); -})(window.vc); +})(window.vc); \ No newline at end of file