高章伟
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
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
<apex:page Controller="TransferEquipmentSetSRListController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="调拨配套一览">
<head>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
</head>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<script>
var standalone = window.navigator.standalone,
    userAgent = window.navigator.userAgent.toLowerCase(),
    safari = /safari/.test( userAgent ),
    ios = /iphone|ipod|ipad/.test( userAgent );
function checkAll(ele) {
    var ckd = j$(ele).attr("checked") ? true : false;
    j$('input[type="checkbox"]').prop("checked", ckd);
}
function go() {
    var type = j$(escapeVfId('allPage:allForm:allBlock:type')).value();
    var disabled = j$(escapeVfId('allPage:allForm:allBlock:type')).prop('disabled');
    var typeStr = j$(escapeVfId('allPage:allForm:allBlock:type')).children(':selected').text();
    var raesIds = j$('#checkRAES:checked').next().map(function() { return j$(this).val(); } ).get();
    var raesIdsStr = raesIds.join(',');
    if(disabled) {
        alert('当前用户不可操作');
        return
    }
    if (raesIdsStr == '') {
        alert('请选择至少一条备品一览');
        return
    }
    if (type == '无') {
        alert('请选择一种方式');
    } else {
        setType();
    }
}
 
function changePage() {
    var type = j$(escapeVfId('allPage:allForm:allBlock:type')).value();
    var typeStr = j$(escapeVfId('allPage:allForm:allBlock:type')).children(':selected').text();
    var raesIds = j$('#checkRAES:checked').next().map(function() { return j$(this).val(); } ).get();
    var raesIdsStr = raesIds.join(',');
    var url = '';
    if('{!showDown}'=='false' && (typeStr == '下架' || typeStr == '发货检测' || typeStr == '发货')) {
        alert('不可以操作下架相关画面!');
        return;
    }
    if('{!showUp}'=='false' && (typeStr == '欠品' || typeStr == '入库检测' || typeStr == '上架')) {
        alert('不可以操作上架相关画面!');
        return;
    }
    if (typeStr == '下架') {
        type = "Shippment";
        url = 'TransferShippmentReceived1';
    } else if (typeStr == '发货检测') {
        type = "Shippment";
        url='TransferShippmentReceived2'
    } else if (typeStr == '发货') {
        type = "Shippment";
        url='TransferShippmentReceived3'
    } else if (typeStr == '欠品') {
        type = "Received";
        url='TransferShippmentReceived4'
    } else if (typeStr == '入库检测') {
        type = "Received";
        url='TransferShippmentReceived5'
    } else if (typeStr == '上架') {
        type = "Received";
        url = 'TransferShippmentReceived6';
    }
    if (!standalone && !safari && ios) {
        window.location.href="/apex/"+url+"?id=" + raesIdsStr + "&type=" + type + "&open=web";
    } else {
        window.open("/apex/"+url+"?id=" + raesIdsStr + "&type=" + type + "&open=web",'id');
    }
}
 
</script>
<style type="text/css">
    .mainTitle {
        font-size: 23px !important;
    }
</style>
<apex:form id="allForm">
    <apex:pageBlock title="调拨配套一览" id="allBlock" rendered="true">
        <apex:actionFunction name="setType" action="{!setType}" oncomplete="changePage();"/>
        <apex:outputPanel id="message">
            <apex:pageMessages />
        </apex:outputPanel>
 
        <div style="font-size: 22px;">
            <table>
            <!-- 20210331 you WLIG-BV8CHF start-->
                <tr>
                    <td>
                        申请单号:
                        <c:PDFWbr targetStr="{!sr_apply_no}"/><input type="hidden" id="apply_no" value="{!sr_id}"/>
                    </td>
                    <td>
                        &nbsp;&nbsp;出库/入库:
                        <apex:selectList disabled="{!NOT(canSelect)}" id="type" value="{!selectedType}" size="1" style="height: 35px; font-size: 22px;">
                            <apex:selectOptions value="{!typeList}"/>
                        </apex:selectList>
                    </td>
                    <td>
                        <apex:commandButton style="font-size: 22px; margin-left: 1%;" value="确定" onclick="go(); return false;"/>
                    </td>
                </tr>
                <tr>
                    <td>调拨前地区:<c:PDFWbr targetStr="{!sr_FromLocation}"/></td>
                    <td>&nbsp;&nbsp;调拨至地区:<c:PDFWbr targetStr="{!sr_ToLocation}"/></td>
                </tr>
                <!-- 20210331 you WLIG-BV8CHF end-->
            </table>
        </div>
 
        <table border="1" style="border-collapse: collapse; font-size:23px;">
            <tr>
                <th style="text-align:center;"><input type="checkbox" checked="checked" onchange="checkAll(this)" />全选</th>
                <th style="text-align:center;">{!$ObjectType.TransferApply__c.fields.Name.label}</th>
                <th style="text-align:center;white-space:normal;">{!$ObjectType.Asset.fields.Fixture_Model_No_F__c.label}</th>
                <th style="text-align:center;">{!$ObjectType.Asset.fields.SerialNumber.label}</th>
                <th style="text-align:center;">{!$ObjectType.Asset.fields.Fixture_QRCode__c.label}</th>
                <th style="text-align:center;white-space:normal;">{!$ObjectType.TransferApplySummary__c.fields.TAS_Status__c.label}</th>
            </tr>
            <apex:repeat value="{!resList}" var="res" id="resList">
                <tr>
                    <td><input type="checkbox" id="checkRAES" checked="checked" /><input type="hidden" value="{!res.Id}"/></td>
                    <td style="text-align:center;"><a href="/apex/TransferEquipmentSetSRList?id={!res.TransferApply__r.Name}">{!res.TransferApply__r.Name}</a></td>
                    <td style="text-align:center;">{!res.First_TAD__r.Asset__r.Fixture_Model_No_F__c}</td>
                    <td style="text-align:center;">{!res.First_TAD__r.Asset__r.SerialNumber}</td>
                    <td style="text-align:center;">{!res.First_TAD__r.Asset__r.Fixture_QRCode__c}</td>
                    <td style="text-align:center;">{!res.TAS_Status__c}</td>
                </tr>
            </apex:repeat>
        </table>
 
    </apex:pageBlock>
</apex:form>
</apex:page>