liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<apex:page standardController="Lost_cancel_report__c"
           showHeader="false"  sidebar="false" id="LostReportCreate" title="新建询价失单/取消报告" lightningStylesheets="true">
    <apex:includeLightning />
    <div style="width:100%;height:100%;" id="CreateLostReport" />
    <script>
    init();
    function init(){
        console.log(getParam('RecordType'));
        if(getParam('RecordType') == {!$Label.LostCreate_1}){
            cancelReport();
            return;
        }
        if(getParam('RecordType') == {!$Label.LostCreate_2}){
            lostReport();
            return;
        }
        if(getParam('RecordType') != null){
            lostPartReport();
            return;
        }else{
            alert('报告记录类型选择错误,请重新选择!');
            window.open('/006/o','_self');
            return;
        }
    }
    function cancelReport() {
        // 这里 上线时需要改成
        var str = '/a1U/e?nooverride=1';
        if(getParam('RecordType') != null){
            str += '&RecordType='+getParam('RecordType');
        }
        if(getParam({!$Label.LostCreate_3}) != null){
            str += '&{!$Label.LostCreate_3}='+getParam({!$Label.LostCreate_3});
        }
        if(getParam({!$Label.LostCreate_4}) != null){
            str += '&{!$Label.LostCreate_4}='+getParam({!$Label.LostCreate_4});
        }//niwu LostCreate_4 = CF00N10000004lbGT_lkid
        if(getParam({!$Label.LostCreate_5}) != null){
            str += '&{!$Label.LostCreate_5}='+getParam({!$Label.LostCreate_5});
        }
        //niwu LostCreate_5 = CF00N10000006QShg
        if(getParam({!$Label.LostCreate_6}) != null){
            str += '&{!$Label.LostCreate_6}='+getParam({!$Label.LostCreate_6});
        }//niwu LostCreate_6 = CF00N10000006QShg_lkid
        if(getParam({!$Label.LostCreate_7}) != null){
            str += '&{!$Label.LostCreate_7}='+getParam({!$Label.LostCreate_7});
        }// LostCreate_7 = CF00N10000006QShq
        if(getParam({!$Label.LostCreate_8}) != null){
            str += '&{!$Label.LostCreate_8}='+getParam({!$Label.LostCreate_8});
        }//LostCreate_8 = CF00N10000006QShq_lkid
        if(getParam({!$Label.LostCreate_9}) != null){
            str += '&{!$Label.LostCreate_9}='+getParam({!$Label.LostCreate_9});
        }// LostCreate_9 CF00N10000006QShb
         console.log('LostCreate_9:' + getParam({!$Label.LostCreate_9}));
        if(getParam({!$Label.LostCreate_10}) != null){
            str += '&{!$Label.LostCreate_10}='+getParam({!$Label.LostCreate_10});
        }// LostCreate_10 CF00N10000006QShb_lkid
        if(getParam('retURL') != null){
            str += '&retURL='+getParam('retURL');
        }
        window.open(str,'_self');
    }
    //失单
    function lostReport(){
        // 这是询价的ID;
        var opportunityid = getParam({!$Label.LostCreate_4});
        console.log(opportunityid);
          var str = '/lightning/n/PCLLostReportPage#pageStatus=Create'  +'&oppId='+opportunityid +'&lostType=' +  '失单';
        window.open(str,'_self');
 
    }
    //部分失单
    function lostPartReport(){
        // 这是询价的ID;
        var opportunityid = getParamFromUrl({!$Label.LostCreate_4});
        console.log(opportunityid);
        var str = '/lightning/n/PCLLostReportPage#pageStatus=Create'  +'&oppId='+opportunityid +'&lostType=' + '部分失单';
        window.open(str,'_self');
        
    }
 
    function getParam(paramName) {
        paramValue = "", isFound = !1;
        if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
            arrSource = decodeURI(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
            while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
                }
        return paramValue == "" && (paramValue = null), paramValue;
    }
    
    </script>
    <script type="text/javascript">
    </script>
</apex:page>