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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<apex:page controller="UploadOBPMController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="上传OBPM" lightningStylesheets="true">
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.jquerysuggestcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.StyleUtilColorCss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
 
    <script>
        sforce.connection.sessionId = '{!$Api.Session_ID}';
        // function addJs(){
        //     blockme();
        //     addLine();
        // }
        function uploadJs(){
            var IF_Approved = j$(escapeVfId('IF_Approved')).value();
            if(IF_Approved == 'true'){
                blockme();
                uploadOBPM();
            } else{
                alert("此会议不需要申请决裁!");
            }
        }
        function uploadSuccess(){
            alert('上传OBPM成功!');
            window.close();
        }
        function closeJs(){
            window.close();
        }
        function deleteJs(line){
            blockme();
            deleteLine(line);
        }
    </script>
    <style>
      
        body .pbHeader .pbButton {
            text-align: center;
        }
    </style>
    <apex:form id="allForm">
        <apex:actionFunction name="addLine" action="{!addLine}" rerender="allForm,allPanel,allBlock,records" oncomplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="deleteLine" action="{!deleteLine}" rerender="allForm,allPanel,allBlock,records" oncomplete="unblockUI();">
            <apex:param name="firstParam" assignTo="{!lineNo}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="uploadOBPM" action="{!uploadOBPM}" rerender="allForm,allPanel,allBlock,records" oncomplete="unblockUI();uploadSuccess();">
        </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <input type="hidden" id="hasError" value="{!hasError}"/>
            <input type="hidden" id="IF_Approved" value="{!IF_Approved}"/>
            <apex:pageBlock id="allBlock">
                <apex:pageBlockButtons location="top">
                    <apex:commandButton immediate="true" onclick="uploadJs();return false;" value="上传OBPM"/>
                    <apex:commandButton immediate="true" action="{!addLine}" onclick="blockme();" value="添加行"/>
                    <apex:commandButton immediate="true" onclick="closeJs();" value="关闭"/>
                </apex:pageBlockButtons>
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                </apex:outputPanel>
                <input type="hidden" id="hasError" value="{!hasError}"/>
                <label>申请决裁时如需要共同编辑人和抄送人,请填入下表:</label>
                <table class="linetable" border="1" style="border-collapse: collapse;width:590px;table-layout:fixed;">
                    <colgroup>
                        <col width="40px"/>
                        <col width="350px"/>
                        <col width="150px"/>
                        <col width="50px"/>
                    </colgroup>
                    <tr style="background-color:#f2f3f3;">
                        <th style="text-align:center">No.</th>
                        <th style="text-align:center">社内人员</th>
                        <th style="text-align:center">角色</th>
                        <th style="text-align:center">操作</th>
                    </tr>
                </table>
                <div style="width:610px;height:260px;overflow:auto;">
                <table id="linetable" class="linetable" border="1" style="border-collapse: collapse;width:590px;table-layout:fixed;">
                    <colgroup>
                        <col width="40px"/>
                        <col width="350px"/>
                        <col width="150px"/>
                        <col width="50px"/>
                    </colgroup>
                    <apex:repeat value="{!OBPMInfoList}" var="OBPMInfo" id="records">
                    <tr>
                        <td align="center">
                            <apex:outputText id="line" value="{!OBPMInfo.line}"></apex:outputText>
                        </td>
                        <td align="center">
                            <apex:inputField id="department" value="{!OBPMInfo.cam.Shared_User__c}" style="width:95%;"></apex:inputField>
                        </td>
                        <td align="center">
                            <!-- <select name = "pronvince" style="width:85%;">
                                <option selected="selected" disabled="disabled" style='display: none' value=''></option>
                                <option value ="共同编辑人">共同编辑人</option>
                                <option value ="抄送人">抄送人</option>
                            </select> -->
                            <apex:selectList value="{!OBPMInfo.Role}" size="1" style="position: relative; top: 6px;">
                                <apex:selectOptions value="{!items}"/>
                            </apex:selectList><p/>
                        </td>
                        <td align="center">
                            <input style="width:90%;" type="button" value="删除" onclick="deleteJs({!OBPMInfo.line})"/>
                        </td>
                    </tr>
                    </apex:repeat>
                </table>
                </div>
            </apex:pageBlock>
        </apex:outputPanel>
        <script>
             //复杂控件 放大镜
    var baseURL = '';
    var ObjectType = 'Campaign';
    var QueryFieldApiName = 'Shared_User__c';
    var inputFieldId = '';
    var inputFieldId_lktp = '';
    var SelectObj = 'User';
    var SelectFld = 'Name';
    var info = "{!OBPMInfoList}";
    var cntTemp = info.split('=');
    var last = cntTemp[cntTemp.length-1];
    var cnt = parseInt(last.substring(0,last.length-2));
    console.log(cnt)
    for (var i = 0; i < cnt; i++) {
        inputFieldId = 'allPage:allForm:allBlock:records:'+i+':department';
        inputFieldId_lktp = 'allPage:allForm:allBlock:records:'+i+':department_lktp';
        baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
        var obj = document.getElementById('allPage:allForm:allBlock:records:'+i+':department_lkwgt');
        if (obj != null) {
            obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
        }
    }
    function unblockUI(){
        j$("#sbArea").fadeOut(500, function(){
            j$("#sbArea").remove();
        });
    }
        </script>
    </apex:form>
 
</apex:page>