高章伟
2022-03-18 4bfe21c4b5ddc089ae5a95f4b10f6cff148b690d
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
<apex:page controller="RentalApplyJumpController" action="{!init}" showHeader="false" id="allPage">
    <head>
      <title>备品借出一览插队申请</title>
      <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
      <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
      <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    </head>
    <apex:form id="allForm">
        <script type="text/javascript">
            function back() {
                window.opener.parent.location.href = "/{!RaId}";
                top.window.close();
            }
            function alertSuccess() {
                var saveStatus = document.getElementById('{!$Component.allForm.saveStatus}').value;
                if (saveStatus == 'ok') {
                    alert('保存成功!');
                }
            }
            function checkSaveStatus() {
                var saveStatus = document.getElementById('{!$Component.allForm.saveStatus}').value;
                if (saveStatus == 'ok') {
                    window.open("/{!objId}");    
                    top.window.close();
                }
            }
            function checkAll() {
                j$("table td.col_chk input").each(function(){
                    if(!this.disabled) {
                        this.checked = j$("input#checker").prop('checked');
                    }
                })
            }
            function syJs() {
                var cnt = j$("#infoListSize").value();
                console.log(cnt);
                var Loaner_jump_Remarks = j$("#jumpReason").value();
                console.log(Loaner_jump_Remarks);
                for (var i = 0; i < cnt; i++) {
                  var lock = j$(escapeVfId('allPage:allForm:searchBlock:raesdLists:' + i + ':rowCheck'));
                  if(lock.prop('checked') == true){
                    j$(escapeVfId('allPage:allForm:searchBlock:raesdLists:' + i + ':jumpReason_row')).val(Loaner_jump_Remarks);
                  }
                }
            }
        </script>
        <apex:pageMessages />
        <input type="hidden" id="infoListSize" value="{!infoListSize}" />
        <apex:inputHidden value="{!saveStatus}" id="saveStatus"/>
        <div style="margin: 10px 15px;">
            <table>
                <tr>
                    <td  align="left">
                        插队原因:
                    </td>
                    <td align="left">
                        <textarea rows="2" cols="60" name="jumpReason"  id= "jumpReason" ></textarea>
                    </td>
                    <td  align="left">
                         <apex:commandButton style="margin: 0 0;" value="适用" onclick="syJs();return false;" rerender="allForm"/>
                    </td>
                </tr>
            </table>
        <!-- j$('#AllSplitModal').hide();blockme(); -->
        </div> 
        <apex:pageBlock id="searchBlock" tabStyle="Report">
            <apex:dataTable value="{!infoList}" var="info" id="raesdLists" border="1" cellpadding="5">
                <apex:column html-class="col_chk">
                    <apex:facet name="header">全选<input type='checkbox' onClick='checkAll();' id="checker"/></apex:facet>
                    <apex:inputCheckbox value="{!info.isSelect}" id="rowCheck"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">借出备品配套一览No.</apex:facet>
                    <apex:outputField value="{!info.raesd.Rental_Apply_Equipment_Set__c}" />
                </apex:column>
                <apex:column >
                    <apex:facet name="header">借出配套型号</apex:facet>
                    <apex:outputField value="{!info.raesd.Fixture_Model_No__c}" />
                </apex:column>
                <apex:column >
                    <apex:facet name="header">借出备品配套一览明细状态</apex:facet>
                    <apex:outputField value="{!info.raesd.RAESD_Status__c}" />
                </apex:column>
                <!-- <apex:column >
                    <apex:facet name="header">是否允许插队</apex:facet>
                    <apex:inputField value="{!info.raesd.Allow_Adjust_Queue_Flag__c}" id="Allow_Adjust_Queue_Flag"/>
                </apex:column> -->
                <apex:column >
                    <apex:facet name="header">插队原因</apex:facet>
                    <apex:inputField value="{!info.raesd.jumpReason__c}" id="jumpReason_row"/>
                </apex:column>
            </apex:dataTable>
            <div style="height: 15px"></div>
            <apex:commandButton value="确认插队" action="{!saveJump}" oncomplete="alertSuccess();checkSaveStatus();unblockUI();" onclick="blockme();" rerender="allForm" />
            <apex:commandButton value="返回" onclick="back(); return false;" rerender="allForm" oncomplete="unblockUI();" />
          </apex:pageBlock>
        </apex:form>
</apex:page>