<apex:page controller="RentalFixtureSetAssignAgencyController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="办事处分配/发货">
|
<!-- 20210624 ljh update SFDC-C448GR --><!-- title="办事处分配/下架/发货" -->
|
<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 */
|
}
|
span.dateFormat {
|
display: none;
|
}
|
|
/* Modal Content/Box */
|
.modal-content {
|
background-color: #fefefe;
|
margin-left: 6px;
|
margin-top: 100px;
|
padding: 20px;
|
border: 1px solid #888;
|
right: 5%;
|
position: absolute;
|
width: 200px;
|
}
|
.modal-content-cancel {
|
background-color: #fefefe;
|
margin-left: -150px;
|
margin-top: 100px;
|
padding: 20px;
|
border: 1px solid #888;
|
left: 50%;
|
position: absolute;
|
width: 300px;
|
}
|
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 checkMessage() {
|
if (j$(escapeVfId('allPage:allForm:done_flg')).val() == 'true') {
|
alert("保存成功");
|
}
|
}
|
function filljsQR(qrcode) {
|
if(!qrcode) return;
|
blockme();
|
if(scanType == '1'){
|
j$("input[name$='SlipNo']").val(qrcode);
|
}
|
//20210513 ljh 1829 add start
|
else if(scanType.indexOf('2;') != -1){
|
scanAndMatch(qrcode+';'+scanType);
|
}
|
//20210513 ljh 1829 add end
|
else{
|
scanAndMatch(qrcode);
|
}
|
j$("#scanedqr").append("<li>"+qrcode+"</li>");
|
j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
|
unblockUI();
|
}
|
function checkAll() {
|
j$("table td.dataCellBorder1.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]:enabled").each(function(){
|
this.checked = globalChecked;
|
})
|
}
|
/**
|
20210707 SFDC-C448KZ you start
|
function cancelModalConfirm() {
|
//检查取消理由和取消理由备注
|
var reason = j$.trim(j$("select[name$=cancelReason]").val());
|
var remark = j$.trim(j$("input[name$=cancelReasonRemark]").val());
|
//20210420 ljh 1711 update start
|
//if(reason == "" || remark == "") {
|
if(reason == "" && remark == "") {
|
j$("#errormessage span").html('取消理由和取消理由备注不可为空!');
|
j$("#errormessage").css('display', '');
|
}
|
else if(reason == "") {
|
j$("#errormessage span").html('取消理由不可为空!');
|
j$("#errormessage").css('display', '');
|
}
|
else if(remark == "") {
|
j$("#errormessage span").html('取消理由备注不可为空!');
|
j$("#errormessage").css('display', '');
|
}
|
//20210420 ljh 1711 update end
|
else {
|
j$("#errormessage").css('display', 'none');
|
blockme();
|
cancelSet();
|
}
|
}
|
**/
|
function cancelModalConfirm() {
|
//检查取消理由和取消理由备注 cancle Reason Lcr
|
var reason = j$(escapeVfId('allPage:allForm:Cancel_Reason')).value();
|
var remark = j$(escapeVfId('allPage:allForm:Loaner_cancel_reason')).value();
|
var Lcr = j$(escapeVfId('allPage:allForm:Loaner_cancel_request')).value();
|
if(reason == "" && remark == "") {
|
j$("#errormessage span").html('取消理由和备品申请取消理由不可为空!');
|
j$("#errormessage").css('display', '');
|
}
|
else if(reason == "") {
|
j$("#errormessage span").html('取消理由不可为空!');
|
j$("#errormessage").css('display', '');
|
}
|
else if(remark == "") {
|
j$("#errormessage span").html('一览取消理由不可为空!');
|
j$("#errormessage").css('display', '');
|
}else if(remark == "其他" && Lcr =="") {
|
j$("#errormessage span").html('取消理由备注不可为空!');
|
j$("#errormessage").css('display', '');
|
}
|
else {
|
j$("#errormessage").css('display', 'none');
|
blockme();
|
cancelSet();
|
}
|
}
|
/**20210707 SFDC-C448KZ you end**/
|
|
function showCancelModal() {
|
var hasChecked = false;
|
j$("table td.dataCellBorder1.col_chk input").each(function(){
|
if(this.checked) {
|
hasChecked = true;
|
}
|
})
|
if(!hasChecked) {
|
alert('未选择取消的一览!');
|
return;
|
}
|
j$('#cancelModal').show();
|
j$('#searchBlock1').show();
|
|
}
|
/** 20210707 SFDC-C448KZ you start**/
|
function changeCancleReasonJs(){
|
var Cancel_Reason = j$(escapeVfId('allPage:allForm:Cancel_Reason')).value();
|
if(Cancel_Reason != '被动取消'){
|
j$(escapeVfId('allPage:allForm:Loaner_cancel_request')).val('');
|
j$(escapeVfId('allPage:allForm:Loaner_cancel_request')).attr('disabled',true);
|
}
|
}
|
function changeReasonJs(){
|
var reason = j$(escapeVfId('allPage:allForm:Loaner_cancel_reason')).value();
|
if(reason != null && reason == '其他'){
|
j$(escapeVfId('allPage:allForm:Loaner_cancel_request')).attr('disabled',false);
|
}else{
|
j$(escapeVfId('allPage:allForm:Loaner_cancel_request')).val('');
|
j$(escapeVfId('allPage:allForm:Loaner_cancel_request')).attr('disabled',true);
|
}
|
}
|
/** 20210707 SFDC-C448KZ you end**/
|
</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: 60px; overflow: auto">
|
</ul>
|
</div>
|
</div>
|
|
<apex:form id="allForm" styleclass="pbBody">
|
<!-- 20210624 ljh update SFDC-C448GR -->
|
<!-- <apex:actionFunction name="stockDown" action="{!stockDown}" rerender="detail,message,done_flg" oncomplete="unblockUI();checkMessage();checEventFrame();"/> -->
|
<apex:actionFunction name="scanAndMatch" action="{!scanAndMatch}" rerender="detail,message,done_flg" oncomplete="unblockUI();checkMessage();checEventFrame();">
|
<apex:param name="firstParam" assignTo="{!qrcode}" value="" />
|
</apex:actionFunction>
|
<apex:actionFunction name="cancelSet" action="{!cancelSet}" rerender="allForm" oncomplete="unblockUI();checkMessage();checEventFrame();j$('#cancelModal').hide();"/>
|
<apex:actionFunction name="changeStep" rerender="allForm" oncomplete="unblockUI();"/>
|
|
<apex:inputHidden value="{!done_flg}" id="done_flg"/>
|
<apex:inputHidden value="{!readOnly}" id="readOnly"/>
|
<div id="cancelModal" class="modal">
|
<div class="modal-content-cancel">
|
<table>
|
<tr>
|
<td colspan="2" align="center">
|
<apex:commandButton style="margin: 0 20px;" value="确定" onclick="cancelModalConfirm(); return false;" />
|
<apex:commandButton style="margin: 0 20px;" value="取消" onclick="j$('#errormessage').css('display', 'none');j$('#cancelModal').hide();return false;"/>
|
</td>
|
</tr>
|
<tr style="display: none;" id="errormessage">
|
<td colspan="2">
|
<span style="color: #F00; font-weight:bold"></span>
|
</td>
|
</tr>
|
<!--
|
<tr>
|
<td>
|
<apex:outputLabel value="取消理由"/>
|
</td>
|
<td>
|
<apex:selectList id="cancelReason" size="1" value="{!cancelReason}">
|
<apex:selectOption itemValue="" itemLabel="--无--"/>
|
<apex:selectOption itemValue="主动取消" itemLabel="主动取消"/>
|
<apex:selectOption itemValue="被动取消" itemLabel="被动取消"/>
|
</apex:selectList>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<apex:outputLabel value="取消理由备注"/>
|
</td>
|
<td>
|
<apex:inputText id="cancelReasonRemark" value="{!cancelReasonRemark}"/>
|
</td>
|
</tr>
|
-->
|
<!-- 20210707 SFDC-C448KZ you start-->
|
<tr>
|
<td>
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Cancel_Reason__c.label}" />
|
</td>
|
<td>
|
<apex:inputField value="{!parentObj.Cancel_Reason__c}" id="Cancel_Reason" onchange="changeCancleReasonJs();"/>
|
</td>
|
</tr>
|
<tr rendered="true">
|
<td>
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_cancel_reason__c.label}" for="Loaner_cancel_reason"/>
|
</td>
|
<td>
|
<apex:inputField value="{!parentObj.Loaner_cancel_reason__c}" id="Loaner_cancel_reason" onchange="changeReasonJs();"/>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_cancel_Remarks__c.label}" for="Loaner_cancel_request"/>
|
</td>
|
<td>
|
<apex:inputField value="{!parentObj.Loaner_cancel_request__c}" id="Loaner_cancel_request" html-disabled="true"/>
|
</td>
|
</tr>
|
<!-- 20210707 SFDC-C448KZ you end-->
|
<!--<tr> 20210707 SFDC-C448KZ you start-->
|
<!-- <apex:pageBlock id="searchBlock1" tabStyle="Report">
|
<apex:pageBlockSection title="备品借出申请一览取消" collapsible="false" id="cancle">
|
<apex:pageBlockSectionItem id="CR">
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Cancel_Reason__c.label}" />
|
<apex:inputField value="{!parentObj.Cancel_Reason__c}" id="Cancel_Reason" onchange="changeCancleReasonJs();"/>
|
</apex:pageBlockSectionItem>
|
|
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem rendered="true" id="Reason">
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_cancel_reason__c.label}" for="Loaner_cancel_reason"/>
|
<apex:inputField value="{!parentObj.Loaner_cancel_reason__c}" id="Loaner_cancel_reason" onchange="changeReasonJs();"/>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem id="Lcr">
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_cancel_Remarks__c.label}" for="Loaner_cancel_request"/>
|
<apex:inputField value="{!parentObj.Loaner_cancel_request__c}" id="Loaner_cancel_request" html-disabled="true"/>
|
</apex:pageBlockSectionItem>
|
</apex:pageBlockSection>
|
</apex:pageBlock> -->
|
<!-- 20210707 SFDC-C448KZ you end
|
</tr>-->
|
</table>
|
</div>
|
</div>
|
|
<apex:pageBlock id="searchBlock" tabStyle="Report">
|
<apex:pageBlockButtons location="top">
|
预计出货日
|
<apex:inputField id="rentalStartDate" value="{!parentObj.Asset_loaner_start_day__c}"/>
|
<apex:commandButton value="适用" action="{!applyDate}" onclick="blockme();" reRender="allForm" disabled="{!readOnly}" oncomplete="unblockUI();checkMessage();checEventFrame();"/>
|
|
出库
|
<apex:selectList size="1" value="{!stepName}" onchange="blockme();changeStep();return false;">
|
<apex:selectOption itemValue="无" itemLabel="无"/>
|
<apex:selectOption itemValue="分配" itemLabel="分配"/>
|
<!-- 20210624 ljh update SFDC-C448GR -->
|
<!-- <apex:selectOption itemValue="下架" itemLabel="下架"/> -->
|
<apex:selectOption itemValue="发货" itemLabel="发货"/>
|
</apex:selectList>
|
|
<!-- 20210517 ljh update 1829 start -->
|
<!-- <apex:commandButton value="扫一扫" onclick="qrscan();return false;" disabled="{!readOnly || stepName!='分配'}"/> -->
|
<apex:commandButton value="扫一扫" onclick="qrscan(0);return false;" disabled="{!readOnly || stepName!='分配'}"/>
|
<!-- 20210517 ljh update 1829 end -->
|
<apex:commandButton value="分配" action="{!assign}" onclick="blockme();" reRender="allForm" disabled="{!readOnly || stepName!='分配'}" oncomplete="unblockUI();checkMessage();checEventFrame();"/>
|
<!-- 20210624 ljh update SFDC-C448GR -->
|
<!-- <apex:commandButton value="下架" action="{!stockdown}" onclick="blockme();" reRender="allForm" disabled="{!readOnly || stepName!='下架'}" oncomplete="unblockUI();checkMessage();checEventFrame();"/> -->
|
<apex:commandButton value="发货" action="{!shipment}" onclick="blockme();" reRender="allForm" disabled="{!readOnly || stepName!='发货'}" oncomplete="unblockUI();checkMessage();checEventFrame();"/>
|
|
<apex:commandButton value="全选/取消全选" onclick="checkGlobal(); return false;" disabled="{!readOnly}"/>
|
<apex:commandButton value="取消" onclick="showCancelModal(); return false;" disabled="{!readOnly}"/>
|
</apex:pageBlockButtons>
|
<apex:pageBlockSection title="办事处分配">
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply__c.fields.Name.Label}"/>
|
<apex:outputField value="{!parentObj.Name}"/>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="主单预计出货日"/>
|
<apex:outputText value="{0,date, yyyy/MM/dd}">
|
<apex:param value="{!masterDate}"/>
|
</apex:outputText>
|
</apex:pageBlockSectionItem>
|
<!-- 20210508 ljh add 1672 start -->
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply__c.fields.demo_purpose2__c.Label}"/>
|
<apex:outputField value="{!parentObj.demo_purpose2__c}"/>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
|
</apex:pageBlockSectionItem>
|
<!-- 20210508 ljh add 1672 end -->
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Name.Label}"/>
|
<apex:outputPanel >
|
<apex:inputField value="{!slip.Name}" id="SlipNo" rendered="{!slipEnabled && stepName == '发货'}"/>
|
<apex:outputField value="{!slip.Name}" rendered="{!NOT(slipEnabled && stepName == '发货')}"/>
|
<apex:commandButton value="扫运输单" onclick="qrscan(1);return false;" disabled="{!NOT(slipEnabled && stepName == '发货')}"/>
|
<apex:commandButton value="检索" action="{!searchSlip}" onclick="blockme();" reRender="allForm" disabled="{!NOT(slipEnabled && stepName == '发货')}" oncomplete="unblockUI();checEventFrame();"/>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryType__c.Label}"/>
|
<apex:outputPanel >
|
<apex:inputField value="{!slip.DeliveryType__c}" id="deliveryType" rendered="{!slipEnabled && stepName == '发货'}"/>
|
<apex:outputField value="{!slip.DeliveryType__c}" rendered="{!NOT(slipEnabled && stepName == '发货')}"/>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Distributor_method__c.Label}"/>
|
<apex:outputPanel >
|
<apex:inputField value="{!slip.Distributor_method__c}" id="distributorMethod" rendered="{!slipEnabled && stepName == '发货'}"/>
|
<apex:outputField value="{!slip.Distributor_method__c}" rendered="{!NOT(slipEnabled && stepName == '发货')}"/>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryCompany__c.Label}"/>
|
<apex:outputPanel >
|
<apex:inputField value="{!slip.DeliveryCompany__c}" id="deliveryCompany" rendered="{!slipEnabled && stepName == '发货'}"/>
|
<apex:outputField value="{!slip.DeliveryCompany__c}" rendered="{!NOT(slipEnabled && stepName == '发货')}"/>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Wh_Staff__c.Label}"/>
|
<apex:outputPanel >
|
<apex:inputField value="{!slip.Wh_Staff__c}" styleClass="hideDropdown" rendered="{!slipEnabled && stepName == '发货'}"/>
|
<apex:outputField value="{!slip.Wh_Staff__c}" rendered="{!NOT(slipEnabled && stepName == '发货')}"/>
|
</apex:outputPanel>
|
</apex:pageBlockSectionItem>
|
<!-- 20201209 ljh add start-->
|
<apex:pageBlockSectionItem >
|
<apex:outputLabel value="{!$ObjectType.Rental_Apply__c.fields.Delivery_Agency__c.Label}"/>
|
<!-- 20210624 ljh update SFDC-C448GR start-->
|
<!-- <apex:outputPanel >
|
<apex:inputField value="{!parentObj.Delivery_Agency__c}" styleClass="hideDropdown" rendered="{!parentObj.StockDown_ng_num__c == 0 && stepName == '发货'}" />
|
<apex:outputField value="{!parentObj.Delivery_Agency__c}" rendered="{!NOT(parentObj.StockDown_ng_num__c == 0 && stepName == '发货')}"/>
|
</apex:outputPanel> -->
|
<apex:outputPanel >
|
<apex:inputField value="{!parentObj.Delivery_Agency__c}" styleClass="hideDropdown" rendered="{!parentObj.Wei_Assigned_Cnt__c == 0 && stepName == '发货'}" />
|
<apex:outputField value="{!parentObj.Delivery_Agency__c}" rendered="{!NOT(parentObj.Wei_Assigned_Cnt__c == 0 && stepName == '发货')}"/>
|
</apex:outputPanel>
|
<!-- 20210624 ljh update SFDC-C448GR end-->
|
</apex:pageBlockSectionItem>
|
<apex:pageBlockSectionItem html-style="display: none;">
|
<apex:inputField value="{!parentObj.SalesdeptSelect__c}" style="display: none;" />
|
</apex:pageBlockSectionItem>
|
<!-- 20201209 ljh add end-->
|
</apex:pageBlockSection>
|
</apex:pageBlock>
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
|
<apex:outputPanel id="detail">
|
<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> 申请型号 </td>
|
<td> 存放地 </td>
|
<td> 固定资产编号(Key) </td>
|
<td> 机身编号 </td>
|
<td> 预计出货日 </td>
|
<td style="{!IF(stepName='分配','background-color: #cfeef9','')}"> 分配 </td>
|
<!-- 20210624 ljh update SFDC-C448GR -->
|
<!-- <td style="{!IF(stepName='下架','background-color: #cfeef9','')}"> 下架 </td> -->
|
<td> 借出备品一览明细状态 </td>
|
<td> 备品分类 </td><!-- 20210508 ljh add 1672 -->
|
<td> 操作 </td>
|
<!-- 20210510 ljh add 1829 -->
|
</tr>
|
<apex:variable value="{!0}" var="Cnt" />
|
<apex:repeat id="dataline_L" value="{!esdList}" var="esdInfo">
|
<tr class="" id="tableData_L_{!Cnt}" style="{!IF(esdInfo.rec.AgencyTempCancel__c, 'display: none','')}">
|
<td class="dataCellBorder1 col_chk" align="center">
|
<apex:inputCheckbox styleClass="rowchkcls" rendered="{!esdInfo.rec.Is_Body__c}" value="{!esdInfo.checked}" id="rowCheck" disabled="{!!esdInfo.editable}" html-qrscan="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/>
|
<!-- 20210514 ljh 1829 add html-qrscan -->
|
</td>
|
<td> <apex:outputText value="{!esdInfo.tempModel}"/> </td>
|
<td> {!esdInfo.tempLocation} </td>
|
<td> {!esdInfo.tempKey}</td>
|
<td> {!esdInfo.tempSerial} </td>
|
<td>
|
<apex:inputField value="{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Start_Date__c}" rendered="{!esdInfo.editable && stepName=='分配'}"/>
|
<apex:outputText value="{0,date, yyyy/MM/dd}" rendered="{!NOT(esdInfo.editable && stepName=='分配')}">
|
<apex:param value="{!esdInfo.tempDate}"/>
|
</apex:outputText>
|
</td>
|
<td style="{!IF(stepName='分配','background-color: #cfeef9','')}">
|
{!esdInfo.tempStatus}
|
</td>
|
<!-- 20210624 ljh update SFDC-C448GR -->
|
<!-- <td style="{!IF(stepName='下架','background-color: #cfeef9','')}">
|
<apex:outputField value="{!esdInfo.rec.StockDown__c}"/>
|
</td> -->
|
<td> <apex:outputText value="{!esdInfo.tempDetailStatus}"/> </td>
|
<td> {!esdInfo.tempEquipmentType}</td>
|
<!-- 20210508 ljh add 1672 -->
|
<td>
|
<apex:commandButton rendered="{!esdInfo.rec.Is_Body__c}" value="分配代替品" onclick="qrscan('2;{!esdInfo.rec.Rental_Apply_Equipment_Set__c}');return false;" disabled="{!readOnly || esdInfo.IsCanSub || stepName != '分配'}"/>
|
</td>
|
<!-- 20210508 ljh add 1829 -->
|
</tr>
|
<apex:variable value="{!Cnt+1}" var="Cnt" />
|
</apex:repeat>
|
</table>
|
</div>
|
</apex:outputPanel>
|
<apex:outputPanel id="checEventFrame">
|
<script>
|
checEventFrame();
|
</script>
|
</apex:outputPanel>
|
</apex:form>
|
<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.toString();//20210518 ljh update toString 1829
|
//20210514 ljh add 1829 start
|
//console.log(scanType+':~'+scanType.indexOf('2;'));
|
if(scanType.indexOf('2;') != -1){
|
j$("input[type=checkbox][qrscan='"+scanType.split('2;')[1]+"']").prop("checked", true);
|
}
|
//20210514 ljh add 1829 end
|
if (!standalone && !safari && ios) {
|
window.location.href="sfqr://scan";
|
} else {
|
j$("#myModal").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$("#myModal").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);
|
|
}
|
// checEventFrame();
|
</script>
|
</apex:page>
|