<apex:page controller="Lost_Return_DeliverySlipController" showHeader="false" sidebar="false" id="allPage" action="{!init}">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.instascan)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
|
<style type="text/css">
|
.hideDropdown select{
|
display: none
|
}
|
.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 */
|
}
|
|
/* Modal Content/Box */
|
.modal-content {
|
background-color: #fefefe;
|
margin-left: 6px;
|
margin-top: 100px;
|
padding: 20px;
|
border: 1px solid #888;
|
width: 265px; /* Could be more or less, depending on screen size */
|
}
|
table.list td{
|
width:100px;
|
border-width: 1px;
|
}
|
table.list td.col_chk {
|
width:30px;
|
}
|
body .pbBody table.list tr.headerRow td, body .pbBody table.list tr.headerRow th {
|
border-width: 1px;
|
}
|
</style>
|
<script type="text/javascript">
|
function filljsQR(qrcode) {
|
if(!qrcode) return;
|
blockme();
|
if(scanType == 1){
|
j$("input[name$='SlipNo']").val(qrcode);
|
}
|
else{
|
var qrtag = j$("input[name=qrcode][value='"+qrcode+"']");
|
if(qrtag == undefined) {
|
return;
|
}
|
if(qrtag.size() > 1) {
|
alert("数量管理附属品请手动打勾!");
|
}
|
else if(qrtag.size() == 1) {
|
box = qrtag.siblings("input[type=checkbox]")[0];
|
box.disabled = false;
|
box.checked = true;
|
}
|
}
|
j$("#scanedqr").append("<li>"+qrcode+"</li>");
|
j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
|
unblockUI();
|
}
|
</script>
|
<div id="myModal" class="modal">
|
<!-- Modal content -->
|
<div class="modal-content">
|
<span class="close" onclick="stopScan()">×</span>
|
<p>扫描中</p>
|
<p>Code:<input type="text" id="qrcode"/></p>
|
<video playsinline="true" id="preview" style="width: 100%;z-index: 11;transform: scaleX(-1);margin-top: 10px;"></video>
|
扫码履历:
|
<ul id="scanedqr" style="list-style-type: none; text-align: center;padding: 0;width: 100%; height: 100px; overflow: auto">
|
</ul>
|
</div>
|
</div>
|
<apex:form id="allForm" styleclass="pbBody">
|
<apex:actionFunction name="searchSlip" action="{!searchSlip}" reRender="allForm" onComplete="unblockUI();" />
|
<apex:pageBlock id="searchBlock" tabStyle="Report" title="欠品发货">
|
<apex:pageBlockButtons location="top">
|
<apex:commandButton value="全选/取消全选" onclick="checkGlobal(); return false;" disabled="{!readOnly}"/>
|
<apex:commandButton value="扫一扫" onclick="qrscan(0);return false;" disabled="{!readOnly}"/>
|
<apex:commandButton value="发货" onclick="blockme();" action="{!returnDelivery}" reRender="allForm" oncomplete="unblockUI();"/>
|
</apex:pageBlockButtons>
|
<apex:pageBlockSection >
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Name.Label}"/>
|
<apex:outputPanel >
|
<apex:inputField value="{!slip.Name}" id="SlipNo"/>
|
<apex:commandButton value="扫运输单" onclick="qrscan(1);return false;" disabled="{!readOnly}"/>
|
<apex:commandButton value="检索" onclick="blockme();searchSlip(); return false;" disabled="{!readOnly}" oncomplete="checEventFrame();"/>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem />
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryType__c.Label}"/>
|
<apex:inputField value="{!slip.DeliveryType__c}" id="deliveryType"/>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Distributor_method__c.Label}"/>
|
<apex:inputField value="{!slip.Distributor_method__c}" id="distributorMethod"/>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryCompany__c.Label}"/>
|
<apex:inputField value="{!slip.DeliveryCompany__c}" id="deliveryCompany"/>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Wh_Staff__c.Label}"/>
|
<apex:outputPanel layout="none">
|
<apex:outputPanel layout="none" rendered="{!readOnly}">
|
<apex:outputField value="{!slip.Wh_Staff__c}" styleClass="hideDropdown"/>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!readOnly == false}">
|
<apex:inputField value="{!slip.Wh_Staff__c}" styleClass="hideDropdown"/>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
</apex:pageBlockSection>
|
</apex:pageBlock>
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<div id="out_Div_L">
|
<table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableHeader_L">
|
<tr class="headerRow" height="30px">
|
<td class="col_chk" align="center">
|
<input type='checkbox' onClick='checkAll();' id="checker"/>
|
</td>
|
<td style="width: 110px;">
|
{!SUBSTITUTE($ObjectType.TransferApplyDetail__c.fields.Fixture_Model_No__c.Label, '(Sys)', '')}
|
</td>
|
<td style="width: 110px;">
|
{!SUBSTITUTE($ObjectType.TransferApplyDetail__c.fields.SerialNumber__c.Label, '(Sys)', '')}
|
</td>
|
<td style="width: 110px;">
|
{!SUBSTITUTE($ObjectType.TransferApplyDetail__c.fields.TAESD_Status__c.Label, '(Sys)', '')}
|
</td>
|
</tr>
|
</table>
|
</div>
|
<apex:outputPanel id="detail">
|
<div id="in_Div_L">
|
<table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableData_L">
|
<apex:variable value="{!0}" var="Cnt" />
|
<apex:repeat id="dataline_L" value="{!pbList}" var="esdInfo">
|
<tr class="" id="tableData_L_{!Cnt}">
|
<td class="dataCellBorder1 col_chk" align="center">
|
<apex:inputCheckbox styleClass="rowchkcls" value="{!esdInfo.checked}" id="rowCheck"/>
|
<input type="hidden" name="qrcode" value="{!esdInfo.tad.Fixture_QRCode_F__c}"/>
|
</td>
|
<td style="width: 110px;">
|
<apex:outputField value="{!esdInfo.tad.Fixture_Model_No__c}"/>
|
</td>
|
<td style="width: 110px;">
|
<apex:outputField value="{!esdInfo.tad.SerialNumber__c}"/>
|
</td>
|
<td style="width: 110px;">
|
<apex:outputField value="{!esdInfo.tad.TAESD_Status__c}"/>
|
</td>
|
</tr>
|
<apex:variable value="{!Cnt+1}" var="Cnt" />
|
</apex:repeat>
|
</table>
|
</div>
|
</apex:outputPanel>
|
<script type="text/javascript">
|
var standalone = window.navigator.standalone,
|
userAgent = window.navigator.userAgent.toLowerCase(),
|
safari = /safari/.test( userAgent ),
|
ios = /iphone|ipod|ipad/.test( userAgent ),
|
ver = '';
|
if (ios) {
|
ver = (navigator.userAgent).match(/OS (\d)?\d_\d(_\d)?/i)[0].split('_')[0].replace("OS ","");
|
}
|
let scanner = new Instascan.Scanner({ video: document.getElementById('preview'), scanPeriod: 5 ,mirror: false});
|
scanner.addListener('scan', function (content) {
|
filljsQR(content);
|
});
|
|
function qrscan(stype) {
|
scanType = stype;
|
if (!standalone && !safari && ios) {
|
window.location.href="sfqr://scan";
|
} else {
|
j$(".modal").show();
|
Instascan.Camera.getCameras().then(function (cameras) {
|
if (cameras.length > 0) {
|
if (ver >= 13) {
|
scanner.start(cameras[1]);
|
} else {
|
scanner.start(cameras[0]);
|
}
|
} else {
|
console.error('No cameras found.');
|
}
|
}).catch(function (e) {
|
console.error(e);
|
});
|
}
|
}
|
|
function stopScan() {
|
scanner.stop().then(function () {
|
j$(".modal").hide();
|
});
|
j$("#scanedqr").children().remove();
|
}
|
j$(document).ready(function(){
|
j$( '#qrcode' ).unbind();
|
j$( '#qrcode' ).keypress( function ( e ) {
|
if ( e.which == 13 ) {
|
filljsQR(j$( '#qrcode' ).val());
|
return false;
|
}
|
});
|
});
|
function checEventFrame() {
|
// j$('select[name$="deliveryType"]').val('回寄');
|
j$('select[name$="deliveryType"]').prop('disabled', true);
|
// j$("input[name=onetoone]").siblings("input[type=checkbox]").each(function(){
|
// this.disabled = true;
|
// })
|
if (j$(escapeVfId('allPage:allForm:readOnly')).val() == 'true') {
|
j$("input#checker").attr('disabled', 'disabled');
|
}
|
else {
|
j$("input#checker").removeAttr('disabled');
|
}
|
setTimeout(function() {
|
// j$('select[name$="distributorMethod"]').children('option[value="空运"]').remove();
|
// j$('select[name$="deliveryCompany"]').children('option[value="莱比特"],option[value="嘉里大通"]').remove();
|
if (j$(escapeVfId('allPage:allForm:readOnly')).val() == 'true') {
|
j$("input[type=text],select").each(function(){
|
this.disabled = true;
|
})
|
}
|
}, 500);
|
|
}
|
function checkAll() {
|
j$("table#tableData_L td.col_chk input").each(function(){
|
if(!this.disabled) {
|
this.checked = j$("input#checker").prop('checked');
|
}
|
})
|
}
|
var globalChecked = false;
|
function checkGlobal() {
|
globalChecked = !globalChecked;
|
j$("table td.col_chk input[type=checkbox]").each(function(){
|
this.checked = globalChecked;
|
})
|
}
|
checEventFrame();
|
</script>
|
</apex:form>
|
</apex:page>
|