李彤
2022-03-31 229d5068acdb45849fa7e0f7e43bce252c46aefa
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<apex:page controller="AccountTargetTabController" showChat="false" showHeader="false" sidebar="false" action="{!init}" id="Page">
<title>目标数</title>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<style type="text/css">
    table {border-collapse: collapse;}
</style>
<script type="text/javascript">
    function checkNum(val, id) {
        if (val != "" && isNaN(parseInt(val))) {
            alert("请输入数值");
            document.getElementById(id).focus();
            return;
        }
    }
    function setReadonly() {
        var cnt = j$(escapeVfId('datasize')).value();
        var flg = j$(escapeVfId('Page:Form:ispast')).value();
        if (flg == "true") {
            for (var i = 0; i < cnt; i++) {
                j$(escapeVfId('Page:Form:repeat:' + i + ':field1')).attr("readonly",true);
                j$(escapeVfId('Page:Form:repeat:' + i + ':field2')).attr("readonly",true);
                // 2020/07/15 taoqz add start
                j$(escapeVfId('Page:Form:repeat:' + i + ':field4')).attr("disabled",true);
                // 2020/07/15 taoqz add end
            }
            j$(escapeVfId('Page:Form:submitCustomerTarget')).attr("disabled",true);
            j$(escapeVfId('Page:Form:DepartmentBudgetSumPrice')).attr("readonly",true);
            j$(escapeVfId('Page:Form:Proposal_target_customer')).attr("disabled",true);
        }
    }
</script>
 
<apex:form id="Form">
    <div style="height: 265px; overflow-y: auto;">
    <apex:pageMessages />
 
    <apex:outputPanel layout="none" rendered="{!NOT(ISNULL(history))}">
        <script type="text/javascript">
            var refreshAll = '{!refreshAll}';
            var dupliErr = '{!dupliErr}';
            if (refreshAll == "true") {
                // 新規後
                if (dupliErr == "true") {
                    //WLIG-BV8CHF 20201222 you  start
                    var ocmperiod= '{!history.rec.OCM_Period__c}'.substring(0, 3);
                    alert("FY"+(parseInt(ocmperiod,10)+1868)+"的数据已经存在。");    
                    //alert("{!history.rec.OCM_Period__c}的数据已经存在。");
                    //WLIG-BV8CHF 20201222 you  end
                    // defaultの期のデータを表示
                    parent.location.href='/apex/AccountTargetHospital?id={!accid}&t={!dupliID}';
                } else {
                    // 新規したデータを表示
                    parent.location.href='/apex/AccountTargetHospital?id={!accid}&t={!history.rec.Id}';
                }
            }
        </script>
 
        <table id="ocmTbl">
            <tr>
                <apex:outputPanel rendered="{!ISBLANK(history.rec.Id)}" layout="none">
                    <td style="text-align: right;">OCSM年度&nbsp;&nbsp;</td>
                    <td width="80">
                        <apex:selectList value="{!history.rec.OCM_Year__c}" size="1" style="width:98%"><apex:selectOptions value="{!ocmYearOptions}"/></apex:selectList>
                    </td>
                </apex:outputPanel>
                <apex:outputPanel rendered="{!NOT(ISBLANK(history.rec.Id))}" layout="none">
                    <td></td><td></td>
                </apex:outputPanel>
                <td width="100"><apex:commandButton id="savebtn" value="保存" action="{!save}" rerender="Form" style="width:98%;"/></td>
            </tr>
        </table>
 
        <apex:inputHidden id="ispast" value="{!history.isPast}"/>
        <input type="hidden" id="datasize" value="{!dataSize}"/>
 
        <table border="1" id="table">
            
            <!-- lt  目标客户的画面调整  20220106 start  -->
            <tr>
                <!-- 左 -->
                <td>
                    <table border="1" frame="void">
                        <tr>
                            <th width="100" style="height:20px;">&nbsp;</th>
                            <th width="100" style="text-align: center;">目标数</th>
                        </tr>
                        <apex:variable value="{!1}" var="cnt" />
                        <apex:repeat value="{!history.dataList}" var="data" id="repeat">
                            <tr>
                                <td style="height:20px;">{!data.label1}</td>
                                <td style="text-align: center;">
                                    <apex:inputField value="{!history.rec[data.field1]}" style="width:90%; height:14px; text-align: right; ime-mode: disabled;" id="field1" onblur="checkNum(this.value, this.id);" />
                                </td>
                            </tr>
                            <apex:variable value="{!cnt + 1}" var="cnt" />
                        </apex:repeat>
                        <tr>
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Proposal_target_customer__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.Proposal_target_customer__c}" style="width:50%; height:14px; text-align: center;"  id="Proposal_target_customer"/>
                            </td>
                        </tr>
                        <tr>
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Submit_Customer_target_new__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.Submit_Customer_target_new__c}" style="width:50%; height:14px; text-align: center;" id="submitCustomerTarget"/>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:120px;height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Department_Budget_Sum_Price__c.label}</td>
                            <td style="text-align: center;">
                                <apex:inputField value="{!history.rec.Department_Budget_Sum_Price__c}" style="width:90%; height:14px; text-align: right;" id="DepartmentBudgetSumPrice"/>
                            </td>
                        </tr>
                        <!-- 2022/01/07 ssm 左侧空行 start -->
                        <apex:repeat value="{!history.emptyLineLeft}" var="ell" id="ell_repeat">
                            <tr>
                                <td style="height:20px;"></td>
                                <td ></td>
                            </tr>
                        </apex:repeat>
                        <!-- 2022/01/07 ssm 左侧空行 end -->
                        <tr>
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.TargetCustomerModifier__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.TargetCustomerModifier__c}" style="width:90%; height:14px; text-align: right;" />
                            </td>
                        </tr>
                    </table>
                </td>
 
                <!-- 右 -->
                <td>
                    <table border="1" frame="void">
                        <tr>
                            <th width="110" style="height:20px;">&nbsp;</th>
                            <th width="100" style="text-align: center;">金额</th>
                            <th width="130">&nbsp;</th>
                            <!-- <th width="100" style="text-align: center;">主机数</th> -->
                            <th width="100">&nbsp;</th>
                        </tr>
                        <tr>
                            <td style="width:180px;height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Opp_Actual_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.Opp_Actual_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td>
                            <td>{!$ObjectType.Account_Number_of_target__c.fields.RivalCustomers_first__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.RivalCustomers_first__c}" style="width:90%; text-align: right;" />
                            </td>
                        </tr>
                        <tr>
                            <!-- 20220331 lt 今年注残字段修改 3.6.位置互换 -->
                            <!-- <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.BO_Forecast_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.BO_Forecast_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td> -->
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Opportunity_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.Opportunity_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td>
                            <td>{!$ObjectType.Account_Number_of_target__c.fields.RivalHostsProportion_first__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.RivalHostsProportion_first__c}" style="width:90%; text-align: right;" />
                            </td>
                        </tr>
                        <tr>
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.OP_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.OP_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td>
                            <td>{!$ObjectType.Account_Number_of_target__c.fields.RivalHostsNumber__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.RivalHostsNumber__c}" style="width:90%; text-align: right;" />
                            </td>
                            <!-- <td ></td>
                            <td ></td> -->
                        </tr>
                        <tr>
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Opp_Forecast_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.Opp_Forecast_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td>
                            <td>{!$ObjectType.Account_Number_of_target__c.fields.RivalHostsNumber_first__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.RivalHostsNumber_first__c}" style="width:90%; text-align: right;" />
                            </td>
                            <!-- <td ></td>
                            <td ></td> -->
                        </tr>
                        <tr>
                            <!-- 20220331 lt 今年注残字段修改 3.6.位置互换 -->
                            <!-- <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.Opportunity_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.Opportunity_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td> -->
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.BO_Forecast_ThousandY__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.BO_Forecast_ThousandY__c}" style="width:90%; text-align: right;" />
                            </td>
                            <td>{!$ObjectType.Account_Number_of_target__c.fields.AllHostsNumber__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.AllHostsNumber__c}" style="width:90%; text-align: right;" />
                            </td>
                            <!-- <td ></td>
                            <td ></td> -->
                        </tr>
                        <!-- 2022/01/07 ssm 右侧最后的地方拆成2行 与之前的效果保持一致 start -->
                        <tr>
                            <td style="height:20px;"></td>
                            <td style=""></td>
                            <td>{!$ObjectType.Account_Number_of_target__c.fields.AllHostsNumber_first__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.AllHostsNumber_first__c}" style="width:90%; text-align: right;" />
                            </td>
                        </tr>
                        <!-- 2022/01/07 ssm 右侧补空行 start -->
                        <apex:repeat value="{!history.emptyLineRight}" var="elr" id="elr_repeat">
                            <tr>
                                <td style="height:20px;"></td>
                                <td ></td>
                                <td ></td>
                                <td ></td>
                            </tr>
                        </apex:repeat>
                        <!-- 2022/01/07 ssm 右侧补空行 end -->
                        <tr>
                            <td style="height:20px;">{!$ObjectType.Account_Number_of_target__c.fields.TargetCustomerMTIME__c.label}</td>
                            <td style="text-align: center;">
                                <apex:outputField value="{!history.rec.TargetCustomerMTIME__c}" style="width:90%; text-align: right;" />
                            </td>
                            <td ></td>
                            <td ></td>
                        </tr>
                        <!-- 2022/01/07 ssm 右侧最后的地方拆成2行 与之前的效果保持一致 end -->
                    </table>
                </td>
            </tr>
            <!-- lt  目标客户的画面调整  20220106 end -->
        </table>
 
        <script>
            setReadonly();
        </script>
 
    </apex:outputPanel>
    </div>
</apex:form>
</apex:page>