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
<apex:page Controller="ConsumEquipmentSetReturnController" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStylesheets="true">
<head>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
</head>
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
 
<apex:stylesheet value="{!URLFOR($Resource.ConsumEquipmentSetReturnCss)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230619 ljh lightning  -->
<!-- 标准控件弹出页面修改 start -->
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
<!-- 标准控件弹出页面修改 end -->
 
<style type="text/css">
div#out_Div_L {
  position:relative;
  overflow: hidden;
  float:left;
  width: 30px;
}
div#in_Div_L {
  position:relative;
  overflow: hidden;
  float:left;
  height: 100px;
  width: 30px;
}
.apexp .bPageBlock .pbHeader .btn
{
    padding: 6px;
    font-size: 110%;
    margin-right: 20px;
}
/* add by yc 202202-17 **/
.col_EquipmentManagementCode_OldData__c {display: none;}
.col_Scroll{display: none;}
 
table.list .col_Fixture_Model_No__c {width:100px;}
table.list .col_Consumable_Guaranteen_end_F__c {width:100px;}
table.list .col_SerialNumber_F__c {width:100px;}
table.list .col_Salesdepartment__c {width:100px;}
table.list .col_Yi_Fa_Huo_Jia__c {width:100px;}
table.list .col_Dao_Huo_OK_Jia__c {width:100px;}
table.list .col_Dao_Huo_NG_Jia__c {width:100px;}
table.list .col_Yi_Xiao_Hao_Jia__c {width:100px;}
table.list .col_Hui_Ji_Jia__c {width:100px;}
table.list .col_Dai_Xiao_Hao_Jia__c {width:100px;}
table.list .col_ManagementCode__c {width:100px;}
table.list .col_EquipmentManagementCode__c {width:100px;}
table.list .col_EquipmentManagementCode_OldData__c {width:100px;}
 
tr.headerRow {
    height: 40px;
}
input.btn {
    padding: 1px 15px !important;
}
td.pbButton {
    text-align: center!important;
}
body select {
    width: 177px;
    margin: 10px 0px;
}
span.lookupInput {
    width: inherit;
    padding-right: 5px;
}
</style>
 
<apex:form id="allForm">
    <apex:inputHidden value="{!done_flg}" id="done_flg"/>
    <apex:outputPanel id="pageallPanel">
        <apex:pageBlock id="searchBlock" tabStyle="Report">
            <apex:pageBlockButtons location="top">
                <apex:commandButton onclick="blockme();" action="{!save}" value="保存" rerender="checEventFrame,allForm" oncomplete="unblockUI();checEventFrame()"/>
                <apex:commandButton onclick="blockme();" action="{!cancel}" value="取消" rerender="checEventFrame,allForm" oncomplete="unblockUI();checEventFrame()"/>
            </apex:pageBlockButtons>
             <table>
                <tr>
                    <td width="20px"/>
                    <td width="35%" colspan="2">
                      <apex:outputLabel for="slipNo" value="回寄-运输单号:" />
                      <apex:inputField id="slipNo" value="{!slip.Name}"/>
                      <apex:commandButton style="padding: 6px;font-size: 110%;" action="{!searchSlip}" value="检索" rerender="allForm,checEventFrame"  oncomplete="checEventFrame()"/>
                    </td>
                    <!-- <td width="10px"></td> -->
                    <td width="30%">
                      <apex:outputLabel for="deliveryType" value="回寄-运输单种类:" />
                      <apex:inputField required="false" id="deliveryType" value="{!slip.DeliveryType__c}"/>
                    </td>
                    <td width="10px"></td>
                    <td width="30%">
                      <apex:outputLabel for="distributorMethod" value="回寄-运输方式:" />
                      <apex:inputField required="false" id="distributorMethod" value="{!slip.Distributor_method__c}"/>
                    </td>
                </tr>
                <tr>
                    <td width="20px"/>
                    <td >
                      <apex:outputLabel for="deliveryCompany" value="回寄-物流公司:" />
                      <apex:inputField required="false" id="deliveryCompany" value="{!slip.DeliveryCompany__c}"/>
                    </td>
                    <td width="10px"></td>
                    <td >
                      <apex:outputLabel for="whStaff" value="回寄-担当者:" style="float: left;"/>
                      <apex:inputField required="false" id="whStaff" value="{!slip.Wh_Staff__c}" style="float: right;width: 185px;"/>
                    </td>
                    <td width="10px"></td>
                    <td></td>
                </tr>
            </table>
            
            <div style="clear:both;"></div>
 
        </apex:pageBlock>
        <apex:pageMessages id="message"/>
        <c:RelationListPagingCmp id="cmpid" pgController="{!this}" hasCheckbox="true"/>
    </apex:outputPanel>
</apex:form>
<apex:outputPanel id="checEventFrame">
<script type="text/javascript" >
    function checEventFrame() {
        // 运输单种类不可修改
        j$('select[name$="deliveryType"]').val('回寄');
        j$('select[name$="deliveryType"]').prop('disabled', true)
        
        // j$('select[name$="distributorMethod"]').children('option[value="空运"]').remove();
        j$('select[name$="deliveryCompany"]').children('option[value="莱比特"],option[value="嘉里大通"]').remove();
    }
    checEventFrame();
 
    // 【待消耗件数】随【回寄件数】变化
    j$("td.dataCellBorder1.col_Hui_Ji_Jia__c input").change(function(){
        var names = this.name.split(':');
        var i = names[names.length - 4];
        j$("input.rowchkcls")[i].checked = true;
        refreshLine(i);
    });
    checkMessage();
 
    function refreshLine(i){
        var Dao_Huo_OK_Jia__c =parseInt( j$(j$("td.dataCellBorder1.col_Dao_Huo_OK_Jia__c span")[i]).text());
        var Dao_Huo_NG_Jia__c = parseInt(j$(j$("td.dataCellBorder1.col_Dao_Huo_NG_Jia__c span")[i]).text());
        var Yi_Xiao_Hao_Jia__c = parseInt(j$(j$("td.dataCellBorder1.col_Yi_Xiao_Hao_Jia__c span")[i]).text());
        var Hui_Ji_Jia__c = parseInt(j$(j$("td.dataCellBorder1.col_Hui_Ji_Jia__c input")[i]).val());
        if(isNaN(Hui_Ji_Jia__c)){
            Hui_Ji_Jia__c = 0;
        }
        var total = Dao_Huo_OK_Jia__c + Dao_Huo_NG_Jia__c - Yi_Xiao_Hao_Jia__c;
        var Dai_Xiao_Hao_Jia__c = total - Hui_Ji_Jia__c;
        if(Hui_Ji_Jia__c > total){
            alert("回寄件数不可超过 "+(total).toString());
            j$(j$("td.dataCellBorder1.col_Hui_Ji_Jia__c input")[i]).val(null);
        }
        else{
            j$(j$("td.dataCellBorder1.col_Dai_Xiao_Hao_Jia__c span")[i]).text(Dai_Xiao_Hao_Jia__c);
        }
        return;
    }
 
    function checkMessage() {
        if (j$(escapeVfId('allPage:allForm:done_flg')).val() == 'true') {
            alert("保存成功");
            j$(escapeVfId('allPage:allForm:done_flg')).val('false');
            // 清除url里的save_flag (This can now be done in Chrome, Safari, Firefox 4+, and Internet Explorer 10pp4+!)
            if (window.history.pushState)
                window.history.pushState({},"", window.location.href.replace('&save=1',''));
        }
    }
    var inputBoxs = j$("td.dataCellBorder1.col_Hui_Ji_Jia__c input");
    for(var i = 0;i<inputBoxs.length;i++){
        refreshLine(i);
    }
    //标准控件弹出页面修改 start
    //查询参数列表
    let SelectFieldParamList=[
        // 
        {
            //原apex:inputField的id值,需要在页面上获取
            inputFieldId : 'allPage:allForm:searchBlock:whStaff',
            //查找字段所在对象
            ObjectType : 'FixtureDeliverySlip__c',
            //查找字段的api名称
            QueryFieldApiName : 'Wh_Staff__c',
            //查找字段的查找对象
            SelectObj : 'User',
            //搜索时使用的字段
            SelectFld : 'Name',
    
        }
    ]
    //初始化
    resetOpenPage(SelectFieldParamList);
    
    
    function unblockUI(){
        j$("#sbArea").fadeOut(500, function(){
            j$("#sbArea").remove();
        });
        resetOpenPage(SelectFieldParamList);
    }
    //标准控件弹出页面修改 end
 
</script>
</apex:outputPanel>
 
</apex:page>