<apex:page Controller="EquipmentSetShippmentReceived1Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStylesheets="true" 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.EquipmentSetShippmentReceivedcss)}"/>
|
<apex:stylesheet value="{!URLFOR($Resource.sldsMy)}"/><!-- 20230925 ljh lightning -->
|
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilColorCss)}"/><!-- 20230619 ljh lightning -->
|
<script type="text/javascript">
|
function savejs() {
|
blockme();
|
var saveable = true;
|
j$("input[name$='inspectionResult']: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 {
|
if (j$("input[name='onetoone_main'][value='"+val+"']").parent().children("[name$='inspectionResult']").attr("checked") != "checked") saveable = false;
|
var stockdown = j$("input[name='onetoone_main'][value='"+val+"']").parent().find("[name='onetoone_main_down']").val();
|
if (stockdown == 'true') saveable = true;
|
}
|
}
|
})
|
if (saveable) {
|
save();
|
} else {
|
alert("一对一分配附属品不能单独下架!")
|
unblockUI();
|
}
|
}
|
function filljs1(ele) {
|
j$(ele).prop("disabled", true);
|
var cnt = {!esdListSize};
|
//获取两组元素
|
var checked = true
|
if(j$(ele).val() == "全部OK") {
|
checked = true;
|
j$(ele).val("全部取消");
|
} else {
|
checked = false;
|
j$(ele).val("全部OK");
|
}
|
for (var i=0; i<=cnt-1; i++) {
|
var targetSelect = document.getElementById('allPage:allForm:esdList:'+i+':inspectionResult');
|
if (targetSelect != null) {
|
// if (targetSelect.checked) checked=false;
|
targetSelect.checked=checked;
|
}
|
}
|
j$(ele).prop("disabled", false);
|
}
|
function filljsQR(qrcode) {
|
console.log('qrcode:'+qrcode);
|
blockme();
|
// 20230616 ljh start
|
// var cbox = j$("[data-qr='"+qrcode+"']").children("input[type='checkbox']");
|
var cbox = j$("[data-qr='"+qrcode+"']").children().children("input[type='checkbox']");
|
// 20230616 ljh end
|
if (cbox.size() > 1) {
|
alert("数量管理附属品请手动打勾!");
|
}else {
|
cbox.prop('checked',true);
|
}
|
j$("#scanedqr").append("<li>"+qrcode+"</li>");
|
j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
|
unblockUI();
|
}
|
function checkMessage() {
|
if (j$(escapeVfId('allPage:allForm:done_flg')).val() == 'true') {
|
alert("保存完了");
|
window.location.reload(false);
|
}
|
}
|
|
function resetDetailDivMargintop() {
|
var handerHeight = document.getElementById('hander').clientHeight;
|
document.getElementById('detailDiv').style.marginTop = handerHeight + 'px';
|
}
|
|
// 20231127 sx 贸易合规二期 add 弹窗提醒 start
|
function showModal(){
|
console.log('showModal====' + j$(escapeVfId('allPage:allForm:trade_fag')).val());
|
//贸易合规二期 ax add
|
if(j$(escapeVfId('allPage:allForm:trade_fag')).val() == 'true'){
|
//打开弹窗
|
j$('#cancelModal').show();
|
}else{
|
//如果合规直接走保存(原有逻辑)
|
savejs();
|
}
|
}
|
|
function cancelModalConfirm(){
|
//贸易合规二期 弹窗确认 点击确认就调原来的保存方法 点取消就不进行保存逻辑
|
savejs();
|
}
|
// 20231127 sx 贸易合规二期 add 弹窗提醒 end
|
|
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();
|
}
|
</script>
|
<style type="text/css">
|
.menu div.m_title{
|
/*width: 308px;*//*20230616 ljh*/
|
text-align: left;
|
margin: 0;
|
/*20230623 ljh start*/
|
background:#DCDCDC;
|
/* background:#95aee5; */
|
/*20230623 ljh end*/
|
/*height: 42px;*/
|
padding-left: 0.75rem;/*20230628 ljh*/
|
}
|
.dateFormat {
|
display: none;
|
}
|
#Step_tab {
|
list-style-type: none;
|
padding: 0;
|
/* 2023-04-23 zyh lightning升级 start */
|
/* height: 25px; */
|
height: 30px;
|
/* 2023-04-23 zyh lightning升级 end */
|
border-bottom: 5px solid #3b5998;
|
}
|
#Step_tab li {
|
position: relative;
|
/* 2023-04-23 zyh lightning升级 start */
|
/*width: 30%;*/
|
width: 50%;/*20230616 ljh*/
|
/* width: 20%; */
|
/* 2023-04-23 zyh lightning升级 end */
|
float: left;
|
margin: 0;
|
padding: 0;
|
text-align: center;
|
cursor: pointer;
|
/*20230616 ljh*/
|
height:30px;
|
line-height: 30px;
|
/*20230616 ljh*/
|
}
|
#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;
|
}
|
/*20230615 ljh*/
|
/*div#main {
|
width: 320px;
|
}*/
|
|
div.rtop, div.rbottom {display:block; background: transparent; font-size:1px;}
|
div.rtop div {
|
/*20230623 ljh start*/
|
background:#DCDCDC;
|
/* background:#95aee5; */
|
/*20230623 ljh end*/
|
}
|
div.r1, div.r2, div.r3, div.r4 {display:block; overflow:hidden;}
|
div.r1, div.r2, div.r3 {height:1px;}
|
div.r2, div.r3, div.r4 {border-left:1px solid silver; border-right:1px solid silver;}
|
div.r1 {margin: 0 5px; background:silver;}
|
div.r2 {margin: 0 3px; border-width:0 2px;}
|
div.r3 {margin: 0 2px;}
|
div.r4 {margin: 0 1px; height: 2px;}
|
hr {
|
border-top: 2px dotted #f00;
|
color: #fff;
|
background-color: #fff;
|
height: 1px;
|
/*20230620 ljh*/
|
/*width: 90%;*/
|
width: 98%;
|
/*20230620 ljh*/
|
}
|
.close {
|
color: #aaaaaa;
|
float: right;
|
font-size: 28px;
|
font-weight: bold;
|
}
|
.close:hover,
|
.close:focus {
|
color: #000;
|
text-decoration: none;
|
cursor: pointer;
|
}
|
.menu blockquote{
|
margin: 0;
|
padding: 1px;
|
list-style: none;
|
border-top: 1px solid #ddd;
|
}
|
.modal-content-cancel {
|
background-color: #fefefe;
|
margin-left: -150px;
|
margin-top: 100px;
|
padding: 20px;
|
border: 1px solid #888;
|
left: 50%;
|
position: absolute;
|
width: 310px;
|
}
|
</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="detail,message,done_flg" onComplete="unblockUI();checkMessage();" />
|
<apex:actionFunction name="Shippment1" action="{!Shippment1}" />
|
<apex:actionFunction name="Shippment2" action="{!Shippment2}" />
|
<apex:inputHidden value="{!done_flg}" id="done_flg"/>
|
<!-- 20231127 sx 贸易合规二期 add start -->
|
<apex:inputHidden value="{!trade_fag}" id="trade_fag"/>
|
<apex:inputHidden value="{!trade_String}" id="trade_String"/>
|
<apex:actionFunction name="tradeComplianceTWO" action="{!tradeComplianceTWO}" rerender="trade_fag" oncomplete="unblockUI();showModal();"/>
|
<!-- 20231127 sx 贸易合规二期 add end -->
|
<div id="main">
|
<div id="hander" class="freezehander">
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<!-- 20230616 ljh start-->
|
<!-- <div style="text-align: right;margin-top: 10px;">
|
<apex:commandButton styleClass="commandbutton" onclick="savejs();" value="保存" rerender="dummy" rendered="{!IF(open_type='web', true, false)}" disabled="{!saveBtnDisabled}"/>
|
</div> -->
|
<!-- <apex:outputText id="saveBtnDisabled" value="{!saveBtnDisabled}" style="display: none;"/> -->
|
<!-- 20230616 ljh end-->
|
<!-- <apex:outputText value="(出库指示后取消)" style="color:red;" rendered="{!IF(SR_status='Received' && es.cancel_after_loaner_arranged__c, true, false)}"/> -->
|
<!-- <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">
|
<apex:outputPanel layout="none" rendered="{!IF(SR_status='Shippment', true, false)}">
|
<apex:outputPanel layout="none" rendered="{!IF(Step_status='下架', true, false)}">
|
<li class="selected"><span class="tabsize">下架</span></li>
|
<li onclick="javascript:Shippment2();"><span class="tabsize">出库检测</span></li>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
|
</ul>
|
</th>
|
</tr>
|
</table> -->
|
<!-- <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(this);" value="全部OK" rerender="dummy" rendered="{!IF(Step_status='下架', true, false)}"/>
|
</div> -->
|
<apex:pageBlock >
|
<!-- 20231127 sx add 贸易合规二期 弹窗提醒 start -->
|
<div id="cancelModal" class="modal">
|
<div class="modal-content-cancel">
|
<table>
|
<tr>
|
<td>
|
<apex:outputText styleClass="title" value="您此次申请的业务可能存在贸易合规风险,是否继续下架,{!$Label.IFTradeComplianceAlert2}(一般需5-10个工作日)。"/>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2" test-align="center" style="padding-left: 30px;">
|
<apex:commandButton style="margin: 8px 20px;" value="确定" onclick="cancelModalConfirm(); return false;" oncomplete="j$('#cancelModal').hide();unblockUI();" />
|
<apex:commandButton style="margin: 8px 20px;" value="取消" onclick="j$('#cancelModal').hide(); return false;"/>
|
</td>
|
</tr>
|
</table>
|
</div>
|
</div>
|
<!-- 20231127 sx add 贸易合规二期 弹窗提醒 end -->
|
<table style="border-collapse: collapse; font-size:13px;">
|
<colgroup>
|
<col width="20%" />
|
<col width="80%" />
|
</colgroup>
|
<tr>
|
<!-- 状态切换btn -->
|
<th style="font-size:20px;text-align: center;width:280px;height: 50px;">
|
<ul id="Step_tab" style="margin:0;">
|
<apex:outputPanel layout="none" rendered="{!IF(SR_status='Shippment', true, false)}">
|
<apex:outputPanel layout="none" rendered="{!IF(Step_status='下架', true, false)}">
|
<li class="selected" ><span class="tabsize">下架</span></li>
|
<li onclick="javascript:Shippment2();"><span class="tabsize">出库检测</span></li>
|
</apex:outputPanel>
|
</apex:outputPanel>
|
</ul>
|
</th>
|
<th width="900px;" style="padding-left:50px;" class="myBtn" >
|
<apex:commandButton styleClass="commandbutton" onclick="qrsacn()" value="扫一扫" rerender="dummy" rendered="{!IF(Step_status='下架', true, false)}"/>
|
<apex:commandButton styleClass="commandbutton" onclick="filljs1(this);" value="全部OK" rerender="dummy" rendered="{!IF(Step_status='下架', true, false)}"/>
|
<!-- 20230616 ljh start-->
|
<!-- 贸易合规二期添加校验 sx start -->
|
<apex:commandButton styleClass="commandbutton" onclick="tradeComplianceTWO();" value="保存" rerender="dummy" rendered="{!IF(open_type='web', true, false)}" disabled="{!saveBtnDisabled}"/>
|
<!-- 贸易合规二期添加校验 sx end -->
|
<!-- 20230616 ljh end-->
|
</th>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
</div>
|
<apex:outputPanel id="detail">
|
<div id="detailDiv" class="detail">
|
<apex:variable var="indexloop" value="{!0}" />
|
<apex:variable var="SetName" value="" />
|
<apex:repeat value="{!esdList}" var="esdInfo" id="esdList" rendered="{!IF(SR_status='Shippment', true, false)}">
|
<apex:variable var="indexloop" value="{!indexloop+1}"/>
|
<apex:variable var="SetName" value="{!IF(SetName='', esdInfo.rec['Rental_Apply_Equipment_Set__r'].Id, SetName)}" />
|
<apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec['Rental_Apply_Equipment_Set__r'].Id && indexloop != 1, true, false)}">
|
<!-- <br/> -->
|
<!-- 20230623 ljh -->
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec['Rental_Apply_Equipment_Set__r'].Id, false, true)}">
|
<hr/>
|
<h3 style="padding: 5px 0.75rem;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3>
|
<apex:variable var="SetName" value="{!esdInfo.rec['Rental_Apply_Equipment_Set__r'].Id}" />
|
</apex:outputPanel>
|
|
<apex:outputPanel layout="none" rendered="{!IF(indexloop == 1, true, false)}">
|
<h3 style="padding: 5px 0.75rem;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3>
|
</apex:outputPanel>
|
<div class="rtop">
|
<div class="r1"></div>
|
<div class="r2"></div>
|
<div class="r3"></div>
|
<div class="r4"></div>
|
</div>
|
<div class="menu">
|
<h2><div class="m_title"> <apex:outputField value="{!esdInfo.rec.Fixture_Name_F__c}" />
|
<!-- 2023-08-01 zyh 机身编号换地方 start -->
|
<span>(<apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/>)</span>
|
<!-- 2023-08-01 zyh 机身编号换地方 end -->
|
</div></h2>
|
<!-- TODO 回库はSet単位で、明細一つ一つのquickCheck要らないが、SetのquickCheck要る? -->
|
<ul style="padding: 1px 0.75rem; {!IF(esdInfo.quickCheck, 'background:#A3DE59;', '')}">
|
<apex:outputPanel layout="none" rendered="{!IF(Step_status='下架', true, false)}">
|
<!-- <div style="position: relative; padding-left: 50px; background:{!IF(esdInfo.quickCheck, '#BBFF66', '')}"> -->
|
<li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}">
|
<!-- 202107721 ljh 1719 start -->
|
<!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.StockDown__c.label}: </span> -->
|
<span>下架: </span>
|
<!-- 202107721 ljh 1719 end -->
|
<apex:outputPanel layout="none" rendered="{!esdInfo.editable}">
|
<!-- 20230616 ljh -->
|
<!-- <apex:inputField id="inspectionResult" value="{!esdInfo.rec.StockDown__c}" style="margin:3px;width:75px;" /> -->
|
<span><apex:inputField id="inspectionResult" value="{!esdInfo.rec.StockDown__c}" style="margin:3px;" /></span>
|
<!-- 20230616 ljh -->
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!NOT(esdInfo.editable)}">
|
<span style="height: 35px;line-height: 35px;">
|
<!-- 20230620 ljh style="height: 35px;line-height: 35px;" -->
|
<apex:outputField id="inspectionResult1" value="{!esdInfo.rec.StockDown__c}" style="margin:3px;width:75px;" /></span>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.rec.FSD_OneToOneAccessory_Cnt__c > 0 && esdInfo.rec.Is_Body__c}">
|
<input type="hidden" name="onetoone_main" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/>
|
<input type="hidden" name="onetoone_main_down" value="{!esdInfo.rec.StockDown__c}"/>
|
</apex:outputPanel>
|
<apex:outputPanel layout="none" rendered="{!esdInfo.rec.FSD_OneToOneAccessory_Cnt__c > 0 && esdInfo.rec.FSD_Is_OneToOne__c && esdInfo.rec.OneToOne_Flag__c}">
|
<input type="hidden" name="onetoone" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/>
|
</apex:outputPanel>
|
</li>
|
<li>
|
<span>{!$ObjectType.Asset.fields.WH_location__c.label}: </span>
|
<span><apex:outputField value="{!esdInfo.rec.Asset__r.WH_location__c}" style="margin:3px;width:75px;"/></span>
|
</li>
|
<!-- 20230721 ljh 机身编码换位置 -->
|
<!-- 2023-08-01 zyh 机身编号换地方 start -->
|
<!-- <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> -->
|
<!-- 2023-08-01 zyh 机身编号换地方 end -->
|
<li>
|
<span>上次回收后检测时间: </span>
|
<span><apex:outputField value="{!esdInfo.rec.Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c}" style="margin:3px;width:75px;"/></span>
|
</li>
|
<li>
|
<span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Pre_After_Inspection_elapsed_days__c.label}: </span>
|
<span><apex:outputField value="{!esdInfo.rec.Pre_After_Inspection_elapsed_days__c}" style="margin:3px;width:75px;"/></span>
|
</li>
|
<!-- 20230721 ljh 机身编码换位置 -->
|
<!-- <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> -->
|
<!-- </div> -->
|
</apex:outputPanel>
|
</ul>
|
</div>
|
<div class="rbottom">
|
<div class="r4"></div>
|
<div class="r3"></div>
|
<div class="r2"></div>
|
<div class="r1"></div>
|
</div>
|
|
</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 = (navigator.userAgent).match(/OS (\d)?\d_\d(_\d)?/i)[0].split('_')[0].replace("OS ","");
|
|
// let scanner = new Instascan.Scanner({ video: document.getElementById('preview'), refractoryPeriod: 5000,scanPeriod: 5 ,mirror: false});
|
// scanner.addListener('scan', function (content) {
|
// filljsQR(content);
|
// });
|
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 qrsacn() {
|
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]);
|
// 20231105 zq 设置摄像头 start
|
if(cameras.length > 1){
|
scanner.start(cameras[1]);
|
}else{
|
scanner.start(cameras[0]);
|
}
|
// 20231105 zq 设置摄像头 end
|
}
|
} 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>
|