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
<!-- 20230418 <apex:page controller="RentalFixtureSetDetilSelectController" showHeader="false" sidebar="false" id="allPage" action="{!init}"> -->
<apex:page controller="RentalFixtureSetDetilSelectController" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStylesheets="true">
<head>
<title>借出备品配套明细选择</title>
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:stylesheet value="{!URLFOR($Resource.RentalFixtureSetDetilSelectCss)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230624 ljh lightning  -->
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
<!-- 20230511 ljh lightning start -->
<style type="text/css">
    table.list td  input[type="text"]{width:55%;}
 
    /*备品智能化项目对应 20231122 by lc Start*/
    .modal {
       display:none;
       position: fixed; /* Stay in place */
       z-index: 10; /* Sit on top */
       left: 0;
       top: 0;
       width: 100%; /* Full width */
       height: 100%; /* Full height */
       overflow: auto; /* Enable scroll if needed */
       background-color: rgb(0,0,0); /* Fallback color */
       background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }
    span.dateFormat {
        display: none;
    }
 
    /* Modal Content/Box */
    .modal-content {
       background-color: #fefefe;
       margin-left: 6px;
       margin-top: 100px;
       padding: 20px;
       border: 1px solid #888;
       right: 5%;
       position: absolute;
       /* 20230628 ljh */
       /* width: 200px; */
       width: 300px;
    }
    .modal-content-cancel {
       background-color: #fefefe;
       margin-left: -150px;
       margin-top: 100px;
       padding: 20px;
       border: 1px solid #888;
       left: 50%;
       position: absolute;
       width: 310px;
    }
    .modal-content-cancel select {
        margin-bottom: 8px;
    }
    /*备品智能化项目对应 20231122 by lc End*/
</style>
<!-- 20230511 ljh lightning end -->
<script type="text/javascript">
    var heightAjustment = 120;
    var widthAjustment = 30;
 
    // 备品智能化项目对应 20231122 by lc Start
    function checkInterventionReason() {
        if ({!isNeedReason}) {
            j$('#inputReason').show();
        } else {
            blockme();
            save();
        }
    }
 
    function saveInterventionReasonJs() {
        var reason = j$(escapeVfId('allPage:allForm:Intervention_Reason')).value();
        if(reason == "") {
            j$("#errormessage span").html('请输入人工干预理由!');
            j$("#errormessage").css('display', ''); 
        } else {
            j$("#errormessage").css('display', 'none');
            blockme();
            save();
        }
    }
    // 备品智能化项目对应 20231122 by lc End
 
</script>
</head>
    <apex:form id="allForm">
 
        <apex:outputPanel id="message">
            <apex:pageMessages />
        </apex:outputPanel>
        <apex:actionFunction name="saveAndSort" action="{!save}" rerender="allForm, checEventFrame" oncomplete="unblockUI();">
            <apex:param name="firstParam" assignTo="{!saveType}" value="" />
            <apex:param name="secondParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="save" action="{!save}" rerender="allForm, checEventFrame" oncomplete="unblockUI();" />
 
        <!-- 备品智能化项目对应 20231122 by lc Start -->
        <div id="inputReason" class="modal">
            <div class="modal-content-cancel">
                <table>
                    <tr style="display: none;" id="errormessage">
                        <td colspan="2">
                            <span style="color: #F00; font-weight:bold"></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Intervention_Reason__c.label}" />
                        </td>
                        <td>
                            <apex:inputText value="{!interventionReason}" id="Intervention_Reason" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            <apex:commandButton style="margin: 8px 20px;" value="确定" onclick="saveInterventionReasonJs(); return false;" />
                            <apex:commandButton style="margin: 8px 20px;" value="取消" onclick="j$('#inputReason').hide();return false;"/>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <!-- 备品智能化项目对应 20231122 by lc End -->
 
        <apex:outputPanel id="pageallPanel">
            <apex:pageBlock id="searchBlock" tabStyle="Report">
                <!-- 20230522 ljh lightning start -->
                <!-- <apex:pageBlockButtons location="bottom">
                        <apex:commandButton style="float:left;" action="{!save}" value="確定" onclick="blockme();" rerender="allForm, checEventFrame" oncomplete="unblockUI();" />
                        <apex:commandButton style="float:right;" value="返回上一级" action="{!goBack}"/>
                        <apex:commandButton style="float:right;" value="返回申请单" action="{!cancel}"/>
                </apex:pageBlockButtons>  
                <div style="clear:both;"></div>   -->
                <!-- 20230522 ljh lightning end -->
                <table>
                    <tr>
                        <td style="text-align:right;">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Name.label}:</td>
                        <td style="text-align:left;"><apex:outputText value="{!parentObj.Name}" style="width:100px"/></td>
                    </tr>
                    <tr>
                        <td style="text-align:right;">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Fixture_Set_Idx__c.label}:</td>
                        <td style="text-align:left;"><apex:outputText value="{!parentObj.Fixture_Set_Idx__c}" style="width:100px"/></td>
                    </tr>
                    <tr>
                        <td style="text-align:right;">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_name_F__c.label}:</td>
                        <td style="text-align:left;"><apex:outputText value="{!parentObj.Loaner_name_F__c}" style="width:100px"/></td>
                    </tr>
<!--                        <tr>
                        <td colspan="2">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_code__c.label}</td>
                        <td colspan="3"><apex:outputText value="{!parentObj.Loaner_code__c}" style="width:100px"/></td>
                    </tr> -->
                    <!-- <tr>
                        <td colspan="2">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Rental_Num__c.label}</td>
                        <td colspan="3"><apex:outputText value="{!parentObj.Rental_Num__c}" style="width:100px"/></td>
                    </tr> -->
<!--TODO  同一附属品:レ -->
 
                </table>
                <!-- 20230522 ljh lightning start -->
                <div style="width:50%;float:right;">
                        <!-- <apex:commandButton style="float:left;" action="{!save}" value="確定" onclick="blockme();" rerender="allForm, checEventFrame" oncomplete="unblockUI();" /> -->
                        <apex:commandButton style="float:left;" onclick="checkInterventionReason();return false;"  value="確定" />
                        <apex:commandButton style="float:right;" value="返回上一级" action="{!goBack}"/>
                        <apex:commandButton style="float:right;" value="返回申请单" action="{!cancel}"/>
                <div style="clear:both;"></div>
                </div>
                <!-- 20230522 ljh lightning end -->
            </apex:pageBlock>
            <c:RelationListPagingCmp id="cmpid" pgController="{!this}" hasCheckbox="false" noSort="true"/>
        </apex:outputPanel>
    </apex:form>
    <apex:outputPanel id="checEventFrame">
      <script type="text/javascript">
          // 数量添加加减符号
          j$(".dataCellBorder1.col_Rental_Num__c").each(function () {
            //   20230614 ljh lightning start 
              if(!this.firstElementChild.disabled){
                //   j$(this).append('<input type="button" style="width: auto;" class="inc btn" value="+" /><input type="button" style="width: auto;" class="dec btn" value="-" />');
                  j$(this).append('<input type="button" style="width:1.5rem;line-height:1.5rem;" class="inc btn" value="+" /><input type="button" style="width:1.5rem;line-height:1.5rem;" class="dec btn" value="-" />');
                }
              else{
                //   j$(this).append('<input type="button" style="width: auto;" class="dec btn" value="-" />');
                  j$(this).append('<input type="button" style="width:1.5rem;line-height:1.5rem;" class="dec btn" value="-" />');
              }
            //   20230614 ljh lightning end 
          });
          j$(".dataCellBorder1.col_Rental_Num__c input[type=button]").on("click", function() {
              var $button = j$(this);
              var oldValue = $button.parent().find("input[type=text]").val();
              if ($button.val() == "+") {
                  var newVal = parseFloat(oldValue) + 1;
              } else {
                  // Don't allow decrementing below zero
                  if (oldValue > 0) {
                    var newVal = parseFloat(oldValue) - 1;
                  } else {
                    newVal = 0;
                  }
              }
              $button.parent().find("input[type=text]").val(newVal);
          });
      </script>
    </apex:outputPanel>
</apex:page>