GWY
2022-05-16 a9baff8a4508c1850e650f68831d857b953eace4
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
<apex:page controller="LoanerStockDownCheckController" showHeader="true" sidebar="false" id="allPage" action="{!init}" title="下架检查">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<script>
function saveJs() {
    if(confirm('是否保存修改?')==true){
        blockme();
        saveBtn();
    }
}
function checkAll() {
    var productCount = j$(escapeVfId('linesize')).value();
    if (j$(escapeVfId('checkall')).attr('checked') == 'checked') {
        for (var i = 0; i < productCount; i++) {
            j$(escapeVfId('allPage:allForm:allBlock:lines:' + i + ':check')).attr('checked',true);
        }
    } else {
        for (var i = 0; i < productCount; i++) {
            j$(escapeVfId('allPage:allForm:allBlock:lines:' + i + ':check')).attr('checked',false);
        }
    }
 
}
 
function fillAll(){
    var count = {!datalineSize};
    var value = j$(escapeVfId('allPage:allForm:allBlock:lines:0:downStotus'));
    var valueNone = document.getElementById('allPage:allForm:allBlock:lines:0:downStotus');
    for (var i = 1; i < count; i++) {
        var select =document.getElementById('allPage:allForm:allBlock:lines:'+i+':downStotus');
        var len = select.options.length;
        for (var j = 0; j < len; j++) {
            if(select.options[j].value == valueNone.value){
                select.options[j].selected = true;
            }
        }
    }
}
        
</script>
 
    <apex:form id="allForm">
        <apex:actionFunction name="saveBtn" action="{!saveBtn}" rerender="allForm,message,allPanel" onComplete="unblockUI();">
        </apex:actionFunction>
 
        <apex:outputPanel id="message">
            <apex:messages />
        </apex:outputPanel>
 
        <input type="hidden" id='linesize' value="{!datalineSize}"/>
 
        <apex:outputPanel id="allPanel">
            <apex:pageBlock id="allBlock">
                <apex:pageBlockButtons location="top">
 
                    <apex:commandButton action="{!cancelBtn}" value="返回" rerender="dummy" style="width: 70px;"/>
                    <apex:commandButton onclick="saveJs();" value="确认" rerender="dummy" style="width: 70px;"/>
                    <apex:commandButton onclick="fillAll();" value="适用" reRender="dummy" style="width: 70px;"/>
                    
                </apex:pageBlockButtons>
                
                <table border="0" style="border-collapse: collapse;width:1000px;table-layout:fixed;">
                    <colgroup>
                        <col width="25"/>
                        <col width="25"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                    </colgroup>
                    <tr>
                        <th style="text-align: center; border-bottom-style: ridge;"><input type="checkbox" id="checkall" onclick="checkAll();" /></th>
                        <th style="text-align: center; border-bottom-style: ridge;">No.</th>
                        <th style="text-align: center; border-bottom-style: ridge;">样机名称</th> 
                        <th style="text-align: center; border-bottom-style: ridge;">{!$ObjectType.loaner_application_detail__c.fields.SerialNumber__c.label}</th>
                        <th style="text-align: center; border-bottom-style: ridge;">{!$ObjectType.loaner_application_detail__c.fields.Internal_Asset_number__c.label}</th>
                        <th style="text-align: center; border-bottom-style: ridge;">{!$ObjectType.loaner_application_detail__c.fields.OTCODE__c.label}</th>
                        <th style="text-align: center; border-bottom-style: ridge;">{!$ObjectType.loaner_application_detail__c.fields.ECCode__c.label}</th>
                        <th style="text-align: center; border-bottom-style: ridge;">
                        {!$ObjectType.loaner_application_detail__c.fields.Inspection_result__c.label}</th>
                        <th style="text-align: center; border-bottom-style: ridge;">
                        {!$ObjectType.loaner_application_detail__c.fields.StockDownRemark__c.label}</th>
                        <th style="text-align: center; border-bottom-style: ridge;">样机备注</th>
                    </tr>
                    <apex:variable value="{!1}" var="cnt" />
                    <apex:repeat value="{!dataLines}" var="line" id="lines">
                    <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
                        <td class="dataCell" style="text-align: center;">
                            <apex:inputCheckbox id="check" value="{!line.checkFlag}"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputText value="{!line.lineNo}"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputText value="{!line.lad.LOANER__r.Name}"/>
                        </td>  
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputText value="{!line.lad.SerialNumber__c}"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputText value="{!line.lad.Internal_Asset_number__c}"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputText value="{!line.lad.OTCODE__c}"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputText value="{!line.lad.ECCode__c}"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:inputField value="{!line.lad.Inspection_result__c }" id="downStotus"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:inputField value="{!line.lad.StockDownRemark__c }"/>
                        </td>
                        <td class="dataCell" style="text-align: center;">
                            <apex:outputField value="{!line.lad.LOANER__r.Remarks2__c }"/>
                        </td>
                        <apex:variable value="{!cnt + 1}" var="cnt" />
                    </tr>
                    </apex:repeat>
                </table>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
</apex:page>