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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<apex:page id="Page" standardController="Product_Set__c" extensions="SearchSetProductController" sidebar="false" showHeader="false" action="{!init}" lightningStylesheets="true">
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <script type="text/javascript">
        function SetProductId(str) {
            //top.window.opener.setProductEntry(str);
            top.window.opener.setProductEntryGateway(str);
            top.window.close();
        }
        //kk 20231010 走js拼接字符串 start
        function  addIds(){
            console.log('进入addIds()');
            var checklist = j$("input[name='checklist']");
            var Ids='';
            console.log(j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ 1 +":setProductidFull")).val());
            console.log(checklist);
            for(var i=0; i<checklist.length; i++){
                if (checklist[i].checked) {
                    Ids +=j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":setProductidFull")).val()+',';
                }
            } 
 
            debugger; 
            Ids = Ids.substring(0, Ids.length - 1);
            debugger; 
            console.log(Ids);
            debugger
            top.window.opener.setProductEntryGateway(Ids);   
            top.window.close();   
        }
        
        // function SetMuiltProduct(){
        //     console.log('SetMuiltProduct进入');
        //     var Str = j$(escapeVfId("Page:mainForm:setPFString")).value();
        //     // alert(Str);
        //     var isPrepared = j$(escapeVfId("Page:mainForm:DataStatus")).value();
        //     // alert('123');
        //     if(isPrepared!='Fin'){
        //         confirm(isPrepared);
        //     }else if(Str==''||Str==null){
        //         if(confirm("您尚未选取任何产品配套,确认完成么?")){
        //             top.window.close();
        //         }else{
        //         }
        //     }else{
        //         console.log('123123');
        //         top.window.opener.setProductEntryGateway(Str);
        //         top.window.close();
        //     }
        // }
        // function DataPrepare() {
        //     // body...
        //     // j$(escapeVfId("Page:mainForm:DataStatus")).val('数据尚未准备好,请稍等');
        //     var Str = j$(escapeVfId("Page:mainForm:setPFString")).value();
        //     if(Str==''||Str==null){
        //         SelectDone();
        //     } else {
        //         SetMuiltProduct();
        //     }
        // }
        //kk 20231010 走js拼接字符串 end
    </script>
    <style type="text/css">
        div#iframelike {
            color: #fff;
            height: 300px;
            overflow-y: auto;
            overflow-x: hidden;
        }
th {
    font-size: 1em;
    font-weight: bold;
    color: black;
    width: 60px;
    padding-top: 10px;
}
body .slds-vf-data-table .headerRow th, body .slds-vf-data-table thead th, body .slds-vf-data-table thead td, .slds-vf-scope .slds-vf-data-table .headerRow th, .slds-vf-scope .slds-vf-data-table thead th, .slds-vf-scope .slds-vf-data-table thead td {
    white-space: nowrap;
    font-size: 1.1em;
    font-weight: bold;
}
body .slds-vf-data-table td, body .slds-vf-data-table .dataCell, .slds-vf-scope .slds-vf-data-table td, .slds-vf-scope .slds-vf-data-table .dataCell {
    white-space: normal;
    color: rgb(68, 68, 68);
}
body input[type="submit"], body .pbButton .btn, body .pbButtonb .btn, body input.btn, body .menuButton, .slds-vf-scope input[type="submit"], .slds-vf-scope .pbButton .btn, .slds-vf-scope .pbButtonb .btn, .slds-vf-scope input.btn, .slds-vf-scope .menuButton {
    -webkit-appearance: none;
    position: relative;
    display: inline-block;
    margin-right: 30px;
    border: 1px solid transparent;
    padding: 0;
    font-size: .75rem;
    line-height: 1.875rem;
    text-decoration: none;
    white-space: normal;
    border-radius: 0.25rem;
    background: transparent;
    background-clip: border-box;
    color: rgba(1, 118, 211, 1);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: color .05s linear,background-color .05s linear;
    transition: color .05s linear,background-color .05s linear;
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: center;
    vertical-align: middle;
    border: 1px solid rgb(201, 201, 201);
    -webkit-transition: border 0.15s linear;
    transition: border 0.15s linear;
    border-color: rgb(201, 201, 201);
    background-color: rgb(255, 255, 255);
}
    </style>
    <apex:outputPanel id="all">
        <apex:form id="mainForm">
    <!-- kk 20231010  改变添加方式不走后台拼接id字符串,使用js拼接 start-->
        <!-- <apex:actionFunction action="{!SelectDone}" name="SelectDone" reRender="setPFString,DataStatus" oncomplete="SetMuiltProduct();"/> -->
 
 <!--        <apex:actionFunction action="{!SelectDone}" name="SelectDone" reRender="DataStatus" oncomplete="SetMuiltProduct();"/> -->
<!-- 
        <apex:inputHidden value="{!setPFString}" id="setPFString"/>
        <apex:inputHidden value="{!DataStatus}" id="DataStatus"/> -->
        <!-- kk 20231010  改变添加方式不走后台拼接id字符串,使用js拼接  end-->
            <apex:pageBlock id="idSearchSetProduct" title="{!$Label.Set_Search}">
                <table width="900" border="0" style="background-color:#DCDCDC">
                    <colgroup>
                        <col width="12" />
                        <col width="20" />
                        <col width="20" />
                        <col width="200" />
                        <col width="200" />
                        <col width="200" />
                        <col width="100" />
                        <col width="128" />
                    </colgroup>
                    
                    <tr>
                        <td>&nbsp;</td>
                        <th>{!$Label.Search_Condition}</th>
                        <td>&nbsp;</td>
                        <th>{!$Label.Set_Name}</th>
                        <th>{!$Label.Set_Code}</th>
                        <th>{!$ObjectType.Product_Set__c.fields.Applicable_Department__c.label}</th>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td><apex:inputText value="{!SearchName}" style="width:150px" required="false"/></td>
                        <td><apex:inputText value="{!SearchCode}" style="width:150px" required="false"/></td>
                        <td><apex:selectList value="{! filterName }" size="1" style="width:150px" required="false">
                            <apex:selectOptions value="{! listViewOptions }"/>
                        </apex:selectList></td>
                        <td>
                            <!-- <apex:commandButton value="{!$Label.Search}" rerender="idRezultVisitor" action="{!serContact}" style="width:100px"  /></td> -->
                            <apex:commandButton value="{!$Label.Search}" action="{!serContact}" style="width:100px"  /></td>
                        
                        <td><apex:commandButton value="添加" onclick="addIds()" style="width:100px"/></td>
                    </tr>
                    <tr>
                        <td style="border-bottom: 1px solid #888;" colspan="15">&nbsp;</td>
                    </tr>
                </table>
                <table width="900" border="0" style="background-color:#DCDCDC">
                    <tr>
                        <td width="12">&nbsp;</td>
                        <th valign="top">{!$Label.Search_Result}</th>
                        <td width="20">&nbsp;</td>
                        <td>
                            <table border="0">
                                <tr>
                                    <td>
                                    <div id="iframelike" style="width:770px">
                                        <apex:pageBlockTable id="idRezultVisitor" value="{!activities}" var="c" border="1" columns="7" columnsWidth="30px,300px,120px,90x,200px,50px">
                                            <apex:column >
                                                <apex:facet name="header">选择</apex:facet>
                                                <input  type="checkbox" name="checklist" value=""/>
                                                
                                            </apex:column>
   
                                            <apex:column style="width=300px;" >
                                                <apex:facet name="header">{!$Label.Set_Name}</apex:facet>
                                                <apex:outputLink value="{!c.Name}" onclick="SetProductId('{!c.setProductidFull}')">{!c.Name}</apex:outputLink>
                                                <apex:inputHidden id="setProductidFull" value="{!c.setProductidFull}"/>
 
                                            </apex:column>
                                            <apex:column >
                                                <apex:facet name="header">{!$Label.Set_Code}</apex:facet>
                                                <apex:outputText value="{!c.Product_Set_CD_c}" />
                                            </apex:column>
                                            <apex:column >
                                                <apex:facet name="header">{!$Label.Quantity}</apex:facet>
                                                <apex:outputText value="{!c.Quantity}" />
                                            </apex:column>
                                            <apex:column >
                                                <apex:facet name="header">{!$ObjectType.Product_Set__c.Fields.Quote_Select_Info__c.Label}</apex:facet>
                                                <apex:outputText value="{!c.Quote_Select_Info_c}" />
                                            </apex:column>
                                            <apex:column >
                                                <apex:facet name="header">{!$Label.valid}</apex:facet>
                                                <apex:outputPanel layout="inline" rendered="{!IF(c.Valid_c,true,false)}" >
                                                    <img width="16" height="16" title="チェック" class="checkImg" alt="チェック" src="/img/checkbox_checked.gif"/>
                                                </apex:outputPanel>
                                            </apex:column>
                                        </apex:pageBlockTable>
                                    </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </apex:pageBlock>
        </apex:form>
    </apex:outputPanel>
</apex:page>