DESKTOP-0K9VGFE\hp
2022-03-11 6d766b0c8e9b31e7e03ffd344a94c2851aa9beb9
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
<!--仿EquipmentSetSRList2.page-->
<apex:page Controller="ReceivingNoteListController" 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"]:not(:disabled)').prop("checked", ckd);
}
function checkOK() {
    j$('input[name$="summarycheck"]:checked').each(function() {
        j$(this).parent().parent().find('select[name$="packageStatus"]').val("OK");
    });
}
function go() {
    var type = j$(escapeVfId('allPage:allForm:allBlock:type')).value();
    var typeStr = j$(escapeVfId('allPage:allForm:allBlock:type')).children(':selected').text();
    var raesIds = j$('input[type="checkbox"]:checked').next().map(function() { return j$(this).val(); } ).get();
 
    var hasgrey = j$('input[type="checkbox"]:checked').parent().parent().toArray().some(function(x) {return j$(x).css('background-color') == 'rgb(169, 169, 169)'});
 
    var raesIdsStr = raesIds.join(',');
    if (raesIdsStr == '') {
        alert('请选择至少一条收货清单配套一览');
        return;
    }
    if (type == '无') {
        alert('请选择一种方式');
    } else if(hasgrey && (type == '清点' || type == '验收' || type == '入库')) {
        alert('收货确认NG的一览不能操作');
    } else {
        setType();
    }
}
var photoType, photoId;
function goPhoto(type, pid) {
    photoType = type;
    photoId = pid;
    setType();
}
 
function openLink(linkStr) {
    if (!standalone && !safari && ios) {
        window.location.href = linkStr;
    } else {
        window.open(linkStr,'id');
    }
}
function changePage() {
    if (photoType != null) {
        window.location.href = '/'+photoType+'?id='+photoId+'&no='+j$('input[name$="receiving_note_no"]').val();
        photoType = null;
        photoId = null;
        return;
    }
    var type = j$(escapeVfId('allPage:allForm:allBlock:type')).value();
    var typeStr = j$(escapeVfId('allPage:allForm:allBlock:type')).children(':selected').text();
    var rndIdList = j$('input[type="checkbox"]:checked').next().map(function() { return j$(this).val(); } ).get();
    var rndIdsStr = rndIdList.join(',');
    var url = '';
    if (typeStr == '清点') {
        page = 'ReceivingNoteAcceptance';
        openLink("/apex/"+page+"?id=" + rndIdsStr);
    }
    else if(typeStr == '验收'){
        page = 'ReceivingNoteExamination';
        openLink("/apex/"+page+"?id=" + rndIdsStr);
    }
    else if(typeStr == '入库'){
        page = 'ReceivingNoteStockIn';
        openLink("/apex/"+page+"?id=" + rndIdsStr);
    }
    else if (typeStr == '收货确认'){
        receivedConfirm();
    }
    else if (typeStr == '取消收货确认'){
        receivedConfirm();
    }
}
 
</script>
<style type="text/css">
    .mainTitle {
        font-size: 23px !important;
    }
    th,td{
        text-align: left;
    }
    .pbButton {
        display: none;
    }
 
</style>
<apex:form id="allForm">
    <apex:pageBlock title="收货清单配套一览" id="allBlock" rendered="true">
        <apex:actionFunction name="setType" action="{!setType}" oncomplete="changePage();"/>
        <apex:actionFunction action="{!receivedConfirm}" name="receivedConfirm" reRender="allForm" oncomplete="if({!doneFlg}) {alert('{!selectedType}' == '收货确认' ?'收货确认成功':'取消收货确认成功');location.reload();}"/>
        <apex:outputPanel id="message">
            <apex:pageMessages />
        </apex:outputPanel>
        <!-- 20210331 you WLIG-BV8CHF start-->
        <div style="font-size: 18px;">
            <label>收货清单No.  {!receiving_note_no}</label>
            <apex:inputHidden value="{!receiving_note_no}" id="receiving_note_no"/>
            &nbsp;&nbsp;&nbsp;
            <label>操作 </label>
            <apex:selectList id="type" value="{!selectedType}" size="1" style="height: 35px; font-size: 18px;">
                <apex:actionSupport event="onchange" action="{!checkckb}" rerender="allForm"/>
                <apex:selectOptions value="{!typeList}"/>
            </apex:selectList>
            <apex:outputPanel layout="none" rendered="{!IF(selectedType = '收货确认' || selectedType = '取消收货确认' , TRUE, FALSE)}" >
                <apex:commandButton style="font-size: 18px; margin-left: 2%" value="全部OK" onclick="checkOK(); return false;"/>
                <apex:commandButton style="font-size: 18px; margin-left: 2%" value="保存" onclick="go(); return false;"/>
            </apex:outputPanel>
            <apex:outputPanel layout="none" rendered="{!IF(selectedType = '收货确认' || selectedType = '取消收货确认', FALSE, TRUE)}" >
                <apex:commandButton style="font-size: 18px; margin-left: 2%" value="确定" onclick="go(); return false;"/>
                <apex:commandButton style="font-size: 18px; margin-left: 2%;" value="拍照随货同行单" onclick="goPhoto('ReceivingPhoto','{!rnId}'); return false;"/>
            </apex:outputPanel>
 
        </div>
        <!-- 20210331 you WLIG-BV8CHF end-->
        <table border="1" style="border-collapse: collapse; font-size:18px;">
            <tr>
                <th style="text-align:center;"><input type="checkbox" onchange="checkAll(this)" />全选</th>
                <!--一览编号 -->
                <th style="text-align:center;white-space: normal;">收货清单配套一览No.</th>
                <!--备品配套明细型号-->
                <th style="text-align:center;white-space: normal;">备品配套明细型号</th>
                <!--机身编码-->
                <th style="text-align:center;">机身编码</th>
                <!--QRCODE-->
                <!-- <th style="text-align:center;white-space: normal;">备品QRCode/二维码</th> -->
                <!--备品类别-->
                <th style="text-align:center;">备品类别</th>
                <apex:outputPanel layout="none" rendered="{!IF(selectedType = '收货确认', TRUE, FALSE)}" >
                    <!--外包装是否完好-->
                    <th style="text-align:center;white-space: normal;">外包装是否完好</th>
                    <!--外包装情况备注-->
                    <th style="text-align:center;white-space: normal;">外包装情况备注</th>
                    <th style="text-align:center;">照片</th>
                </apex:outputPanel>
                <apex:outputPanel layout="none" rendered="{!IF(selectedType = '收货确认', FALSE, TRUE)}" >
                    <!--一览状态-->
                    <th style="text-align:center;white-space: normal;">收货清单配套一览状态</th>
                </apex:outputPanel>
            </tr>
            <apex:repeat value="{!summaryInfoList}" var="summaryInfo">
                <tr style="word-break: break-all;{!IF(summaryInfo.rns.Package_Status__c == 'NG', 'background-color: rgb(169, 169, 169);', '')}" >
                    <td><apex:inputCheckbox disabled="{!summaryInfo.canChange==false && contains(selectedType,'收货确认')}" value="{!summaryInfo.isChecked}" id="summarycheck"/><input type="hidden" value="{!summaryInfo.rns.Id}"/></td>
                    <!--一览.一览编号-->
                    <td><a href="openSafri?id={!summaryInfo.rns.Id}">{!summaryInfo.rns.ReceivingNoteSummaryNo__c}</a></td>
                    <!--一览.备品配套明细型号-->
                    <td>{!summaryInfo.rns.Fixture_Model_No_F__c}</td>
                    <!--一览.首条明细.机身编码-->
                    <td>{!summaryInfo.rns.First_RND__r.SerialNumber_F__c}</td>
                    <!--一览.清单.备品类别-->
                    <td>{!summaryInfo.rns.ReceivingNote__r.Asset_loaner_category__c}</td>
                    <apex:outputPanel layout="none" rendered="{!IF(selectedType = '收货确认', TRUE, FALSE)}" >
                        <apex:outputPanel layout="none" rendered="{!summaryInfo.canChange==true}">
                            <!--一览.外包装是否完好-->
                            <td><apex:inputField id="packageStatus" value="{!summaryInfo.rns.Package_Status__c}"/></td>
                            <!--一览.外包装情况备注-->
                            <td><apex:inputField value="{!summaryInfo.rns.Package_Status_Memo__c}"/></td>
                            <td>{!summaryInfo.fileCnt}张已上传<br/><a onclick="goPhoto('ReceivingSummaryPhoto','{!summaryInfo.rns.Id}'); return false;" href="#">追加</a></td>
                        </apex:outputPanel>
                        <apex:outputPanel layout="none" rendered="{!summaryInfo.canChange==false}">
                            <!--一览.外包装是否完好-->
                            <td><apex:outputField value="{!summaryInfo.rns.Package_Status__c}"/></td>
                            <!--一览.外包装情况备注-->
                            <td><apex:outputField value="{!summaryInfo.rns.Package_Status_Memo__c}"/></td>
                            <td>{!summaryInfo.fileCnt}张已上传</td>
                        </apex:outputPanel>
                    </apex:outputPanel>
                    <!--一览.首条明细.二维码-->
                    <!-- <td>{!summaryInfo.rns.First_RND__r.Fixture_QRCode_F__c}</td> -->
                    <!--一览.状态-->
                    <apex:outputPanel layout="none" rendered="{!IF(selectedType = '收货确认', FALSE, TRUE)}" >
                        <td>{!summaryInfo.rns.RNS_Status__c}</td>
                    </apex:outputPanel>
                </tr>
            </apex:repeat>
        </table>
    </apex:pageBlock>
</apex:form>
<apex:relatedList subject="{!relatedNote}" list="AttachedContentDocuments"/>
</apex:page>