<apex:page Controller="TransferShippmentReceived6Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="调拨出库入库">
|
<head>
|
<meta name="format-detection" content="telephone=no"/>
|
</head>
|
<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:stylesheet value="{!URLFOR($Resource.TransferShippmentReceivedcss)}"/>
|
<apex:stylesheet value="{!URLFOR($Resource.jquery_confirm, 'jquery-confirm.min.css')}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery_confirm, 'jquery-confirm.min.js')}"/>
|
<script type="text/javascript">
|
function getQueryVariable(variable)
|
{
|
var query = window.location.search.substring(1);
|
var vars = query.split("&");
|
for (var i=0;i<vars.length;i++) {
|
var pair = vars[i].split("=");
|
if(pair[0] == variable){return pair[1];}
|
}
|
return(false);
|
}
|
|
function showConfirm(message, okhandler, errorhandler) {
|
j$.confirm({
|
title: '确认',
|
content: message,
|
boxWidth: '50%',
|
useBootstrap: false,
|
buttons: {
|
OK: function () {
|
okhandler();
|
},
|
cancel: {
|
text: '取消', // With spaces and symbols
|
action: function () {
|
errorhandler();
|
}
|
}
|
}
|
});
|
}
|
function savejs() {
|
blockme();
|
var saveable = true;
|
j$("input[name$='arrivalin']:checked").each(function() {
|
if (j$(this).parent().children("[name='onetoone']").size() > 0) {
|
var val = j$(this).parent().children("[name='onetoone']").val();
|
if (j$("input[name='onetoone_main'][value='"+val+"']").size() == 0) {
|
saveable = false;
|
} else {
|
var eachchk = false;
|
j$("input[name='onetoone_main'][value='"+val+"']").parent().children("[name$='arrivalin']").each(function(idx,val) {
|
if (j$(val).attr("checked") == "checked") eachchk = true;
|
})
|
saveable = saveable ? eachchk : saveable;
|
}
|
}
|
})
|
if (!saveable) {
|
showConfirm("有未勾选主体的一对一附属品,是否拆分上架并放到备用库?", function() {
|
save();
|
}, function() {
|
unblockUI();
|
})
|
} else {
|
save();
|
}
|
}
|
function deleteDetailJs(ele) {
|
blockme();
|
deleteDetail(j$(ele).next().val());
|
}
|
function changeloc(ele) {
|
var assert = j$(ele).parent().data("assert");
|
j$("[data-assert='"+assert+"']").children("input[type='text']").val(j$(ele).val());
|
}
|
function filljs1() {
|
j$("input[name$='arrivalin']").prop("checked", true);
|
}
|
function filljsQR1(qrcode) {
|
blockme();
|
var select1 = j$("[data-qr='"+qrcode+"']").children("input[type='checkbox']");
|
if (select1.size() > 1) {
|
alert("数量管理附属品请手动打勾!");
|
} else {
|
select1.prop("checked", true);
|
}
|
unblockUI();
|
j$("#scanedqr").append("<li>"+qrcode+"</li>");
|
j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
|
}
|
function filljsQR2(qrcode, setId) {
|
blockme();
|
addAccessory(qrcode, setId);
|
|
j$("#scanedqr").append("<li>"+qrcode+"</li>");
|
j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
|
}
|
|
function resetDetailDivMargintop() {
|
var handerHeight = document.getElementById('hander').clientHeight;
|
document.getElementById('detailDiv').style.marginTop = handerHeight + 'px';
|
}
|
|
window.onload = function hiddenName(){
|
if( document.getElementById('allPage:allForm:CDS_staff_mlktp')){
|
document.getElementById('allPage:allForm:CDS_staff_mlktp').style.visibility="hidden" ;
|
document.getElementById('allPage:allForm:CDS_staff_mlktp').style.width="200px" ;
|
}
|
resetDetailDivMargintop();
|
}
|
|
function checkMessage() {
|
if (j$(escapeVfId('allPage:allForm:done_flg')).val() == 'true') {
|
alert("保存完了");
|
}
|
}
|
|
</script>
|
<style type="text/css">
|
.menu div.m_title{
|
width: 308px;
|
text-align: left;
|
margin: 0;
|
background:#DCDCDC;
|
border-radius:8px 8px 0 0;
|
}
|
.menu blockquote{
|
margin: 0;
|
padding: 1px;
|
list-style: none;
|
border-top: 1px solid #ddd;
|
}
|
.menu {
|
border-radius:8px;
|
border:1px solid #D1D1D1;
|
}
|
.dateFormat {
|
display: none;
|
}
|
#Step_tab {
|
list-style-type: none;
|
padding: 0;
|
height: 25px;
|
border-bottom: 5px solid #3b5998;
|
}
|
#Step_tab li {
|
position: relative;
|
width: 20%;
|
float: left;
|
margin: 0;
|
padding: 0;
|
text-align: center;
|
cursor: pointer;
|
}
|
#Step_tab li span {
|
margin: 0;
|
padding: 15px 0 11px;
|
color: #2daae1;
|
font-size: 12px;
|
font-weight: bold;
|
line-height: 1;
|
}
|
#Step_tab li.selected {
|
background: #3b5998;
|
}
|
#Step_tab li.selected span {
|
color: #fff;
|
}
|
|
div#main {
|
width: 320px;
|
}
|
hr {
|
border-top: 2px dotted #f00;
|
color: #fff;
|
background-color: #fff;
|
height: 1px;
|
width: 90%;
|
}
|
.close {
|
color: #aaaaaa;
|
float: right;
|
font-size: 28px;
|
font-weight: bold;
|
}
|
.close:hover,
|
.close:focus {
|
color: #000;
|
text-decoration: none;
|
cursor: pointer;
|
}
|
</style>
|
|
<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">
|
<apex:actionFunction name="save" action="{!save}" rerender="allForm" onComplete="unblockUI();checkMessage();resetDetailDivMargintop();" />
|
<apex:actionFunction name="addAccessory" action="{!addAccessory}" rerender="detail,message" onComplete="unblockUI();" >
|
<apex:param name="firstParam" assignTo="{!AccessoryId}" value="" />
|
<apex:param name="secondParam" assignTo="{!AccessorySetId}" value="" />
|
</apex:actionFunction>
|
<apex:actionFunction name="deleteDetail" action="{!deleteDetail}" rerender="allForm" oncomplete="unblockUI();">
|
<apex:param name="firstParam" assignTo="{!UnCheckedId}" value="" />
|
</apex:actionFunction>
|
<apex:inputHidden value="{!done_flg}" id="done_flg"/>
|
<div id="main">
|
<input type="hidden" id="QRType" value="1"/>
|
<input type="hidden" id="QRTypeID" value=""/>
|
<div id="hander" class="freezehander">
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<div style="text-align: right;margin-top: 10px;">
|
<apex:commandButton styleClass="commandbutton" onclick="savejs();" value="保存" rerender="dummy" disabled="{!saveBtnDisabled}"/>
|
</div>
|
<apex:outputText id="saveBtnDisabled" value="{!saveBtnDisabled}" style="display: none;"/>
|
<table style="border-collapse: collapse; font-size:13px;">
|
<colgroup>
|
<col width="150" />
|
<col width="170" />
|
</colgroup>
|
<tr>
|
<!-- 状态切换btn -->
|
<th colspan="2" style="font-size:20px;text-align: center;width:380px;">
|
<ul id="Step_tab">
|
<li class="selected"><span class="tabsize">上架</span></li>
|
</ul>
|
</th>
|
</tr>
|
</table>
|
<div style="font-size: 14px;">缺少一对一回库:<apex:inputCheckbox value="{!forceSave}" /></div>
|
<div style="text-align: right">
|
<apex:commandButton styleClass="commandbutton" onclick="qrsacn()" value="扫一扫" rerender="dummy" rendered="{!IF(Step_status='上架', true, false)}"/>
|
<apex:commandButton styleClass="commandbutton" onclick="filljs1();" value="全部OK" rerender="dummy" rendered="{!IF(Step_status='上架', true, false)}"/>
|
</div>
|
</div>
|
<apex:outputPanel id="detail">
|
|
<div id="detailDiv" class="detail" style="margin-top:157px;">
|
<apex:variable var="indexloop" value="{!0}" />
|
<apex:variable var="SetName" value="" />
|
<apex:variable var="main_loc" value="" />
|
<apex:repeat value="{!esdList}" var="esdInfo" id="esdList" rendered="{!IF(SR_status='Shippment', true, false)}">
|
<apex:outputPanel layout="none" rendered="{!esdInfo.accessoryFlg}" >
|
<br/>
|
<h3 style="padding: 5px;">追加附属品</h3>
|
<div class="menu">
|
<h2><div class="m_title"> <apex:outputField value="{!esdInfo.rec2.Name}" />
|
</div><apex:commandButton styleClass="commandbutton" onclick="deleteDetailJs(this)" style="float:right;margin-top: -2px;" value="删除" rerender="dummy"/><input type="hidden" value="{!esdInfo.rec2.Id}"/></h2>
|
<ul>
|
<li>
|
<span>{!$ObjectType.Asset.fields.WH_location__c.label}: </span>
|
<span><span>{!main_loc}</span></span>
|
</li>
|
<li>
|
<span>{!$ObjectType.Asset.fields.SerialNumber.label}: </span>
|
<span><apex:outputField value="{!esdInfo.rec2.SerialNumber}" style="margin:3px;width:75px;"/></span>
|
</li>
|
</ul>
|
</div>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!NOT(esdInfo.accessoryFlg)}" >
|
<apex:variable var="indexloop" value="{!indexloop+1}"/>
|
<apex:variable var="SetName" value="{!IF(SetName='', esdInfo.rec.TransferApplySummary__c, SetName)}" />
|
<apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec.TransferApplySummary__c && indexloop != 1, true, false)}">
|
<br/>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec.TransferApplySummary__c, false, true)}">
|
<hr/>
|
<h3 style="padding: 5px;" class="detailtab">{!esdInfo.fsName}</h3>
|
<apex:commandButton styleClass="commandbutton" onclick="qrsacn2('{!esdInfo.rec.TransferApplySummary__c}')" value="扫一扫附属品" rerender="dummy" rendered="{!esdInfo.rec.Main_OneToOne__c}"/>
|
<apex:variable var="SetName" value="{!esdInfo.rec.TransferApplySummary__c}" />
|
</apex:outputPanel>
|
|
<apex:outputPanel layout="none" rendered="{!IF(indexloop == 1, true, false)}">
|
<h3 style="padding: 5px;" class="detailtab">{!esdInfo.fsName}</h3>
|
<apex:commandButton styleClass="commandbutton" onclick="qrsacn2('{!esdInfo.rec.TransferApplySummary__c}')" value="扫一扫附属品" rerender="dummy" rendered="{!esdInfo.rec.Main_OneToOne__c}"/>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!IF(esdInfo.errorInfo=null, false, true)}">
|
<div>
|
<span style="color:red;font-weight: bold;">异常: </span><span style="color:red;font-weight: bold;">{!esdInfo.errorInfo}</span>
|
</div>
|
</apex:outputPanel>
|
<div class="menu">
|
<h2><div class="m_title"> <apex:outputField value="{!esdInfo.rec.AssetName__c}" /> <apex:outputPanel layout="none" rendered="{!esdInfo.rec.OneToOneAccessory__c}">(一对一附属品)</apex:outputPanel>
|
</div></h2>
|
<ul>
|
<li>
|
<span>检测结果: </span><span>
|
<apex:outputField value="{!esdInfo.rec.Inspection_result_after_F__c}" style="margin:3px;width:75px;"/></span>
|
</li>
|
<li>
|
<span>检测NG区分: </span><span>
|
<apex:outputField value="{!esdInfo.rec.Inspection_result_after_NG_F__c}" style="margin:3px;width:75px;"/></span>
|
</li>
|
<li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}">
|
<span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Arrival_in_wh__c.label}: </span>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.editable}">
|
<apex:inputField id="arrivalin" value="{!esdInfo.rec.Arrival_in_wh__c}" style="margin:3px;width:75px;" />
|
<apex:outputPanel layout="none" rendered="{!esdInfo.rec.OneToOneAccessory__c}">
|
<input type="hidden" name="onetoone" value="{!esdInfo.rec.TransferApplySummary__c}"/>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.rec.Main_OneToOne__c}">
|
<apex:variable var="main_loc" value="{!esdInfo.wh_location}" />
|
<input type="hidden" name="onetoone_main" value="{!esdInfo.rec.TransferApplySummary__c}"/>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!(NOT(esdInfo.editable))}">
|
<span><apex:outputField value="{!esdInfo.rec.Arrival_in_wh__c}" style="margin:3px;width:75px;" /></span>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.rec.Main_OneToOne__c}">
|
<apex:variable var="main_loc" value="{!esdInfo.wh_location}" />
|
</apex:outputPanel>
|
</apex:outputPanel>
|
</li>
|
<li data-assert="{!esdInfo.rec.Fixture_QRCode_F__c}_loc">
|
<span>{!$ObjectType.TransferApplyDetail__c.fields.WH_location__c.label}: </span>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.discardFlg}">
|
<span><span>废弃区</span></span>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.editable && NOT(esdInfo.discardFlg)}">
|
<apex:inputText id="WHlocation" value="{!esdInfo.wh_location}" style="margin:3px;width:75px;" onchange="changeloc(this)"/>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!NOT(esdInfo.editable) && NOT(esdInfo.discardFlg)}">
|
<span><apex:outputField value="{!esdInfo.rec.Asset__r.WH_location__c}" style="margin:3px;width:75px;"/></span>
|
</apex:outputPanel>
|
</li>
|
<li>
|
<span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.SerialNumber_F__c.label}: </span>
|
<span><apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/></span>
|
</li>
|
</ul>
|
</div>
|
</apex:outputPanel>
|
|
</apex:repeat>
|
</div>
|
</apex:outputPanel>
|
</div>
|
<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});
|
|
function filljsQR(content) {
|
if (j$("#QRType").val() == 2) {
|
filljsQR2(content, j$("#QRTypeID").val());
|
} else {
|
filljsQR1(content);
|
}
|
}
|
scanner.addListener('scan', function (content) {
|
filljsQR(content);
|
});
|
|
function qrsacn() {
|
j$("#QRType").val(1);
|
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 qrsacn2(setId) {
|
j$("#QRType").val(2);
|
j$("#QRTypeID").val(setId);
|
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;
|
}
|
});
|
});
|
</script>
|
</apex:form>
|
</apex:page>
|