mrzcc
2020-03-06 ecdac8a738f254db2b2ea28cbe3248f7a6a7eb2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(function (vc) {
 
    vc.extends({
        propTypes: {
            callBackListener: vc.propTypes.string, //父组件名称
            callBackFunction: vc.propTypes.string //父组件监听方法
        },
        data: {
            addPurchaseApplyViewInfo: {
                flowComponent: 'addPurchaseApplyView',
                description:''
 
            }
        },
        watch: {
            addPurchaseApplyViewInfo: {
                deep: true,
                handler: function () {
                    vc.component.saveAddComplainInfo();
                }
            }
        },
        _initMethod: function () {
 
        },
        _initEvent: function () {
 
 
            vc.on('addPurchaseApplyViewInfo', 'setPurchaseApplyInfo', function () {
                vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addPurchaseApplyViewInfo);
            });
 
            vc.on('addPurchaseApplyViewInfo', 'onIndex', function (_index) {
                vc.component.addPurchaseApplyViewInfo.index = _index;
            });
        },
        methods: {
            addComplainValidate: function () {
                return vc.validate.validate({
                    addPurchaseApplyViewInfo: vc.component.addPurchaseApplyViewInfo
                }, {
                    'addPurchaseApplyViewInfo.description': [
                        {
                            limit: "required",
                            param: "",
                            errInfo: "申请说明不能为空"
                        },
                        {
                            limit: "maxLength",
                            param: "200",
                            errInfo: "申请说明不能超过200位"
                        },
                    ],
 
                });
            },
            saveAddComplainInfo: function () {
                if (vc.component.addComplainValidate()) {
                    //侦听回传
                    vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addPurchaseApplyViewInfo);
                    return;
                }
            }
        }
    });
 
})(window.vc);