<apex:page controller="ReceivingNoteDetailSelectController" showHeader="false" sidebar="false" id="allPage" action="{!init}">
|
<head>
|
<apex:outputPanel rendered="{!isAcceptance}">
|
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
</apex:outputPanel>
|
<title>收货清单配套明细选择</title>
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:stylesheet value="{!URLFOR($Resource.RentalFixtureSetDetilSelectCss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
|
<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">
|
var heightAjustment = 120;
|
var widthAjustment = 30;
|
function setEmailBody() {
|
j$.confirm({
|
title: '无配套明细提醒邮件',
|
boxWidth: '50%',
|
useBootstrap: false,
|
content: '' +
|
'<form action="" class="formName">' +
|
'<div style="overflow: hidden;">' +
|
'<label>请输入邮件内容<br/>' +
|
'<textarea placeholder="邮件内容" style="width:95%" class="name form-control" rows="3" required />' +
|
'</div>' +
|
'</form>',
|
buttons: {
|
formSubmit: {
|
text: '发送',
|
btnClass: 'btn-blue',
|
action: function () {
|
var body = this.$content.find('.name').val();
|
if(!body){
|
j$.alert({
|
title:'',
|
content: '未输入邮件内容!',
|
boxWidth: '50%',
|
useBootstrap: false,
|
});
|
return false;
|
}
|
j$.confirm({
|
title: '确认',
|
content: '输入的邮件内容为[' + body + ']' + '是否发送?',
|
boxWidth: '50%',
|
useBootstrap: false,
|
buttons: {
|
OK: function () {
|
blockme();
|
sendEmail(body);
|
},
|
cancel: {
|
text: '取消' // With spaces and symbols
|
}
|
}
|
});
|
}
|
},
|
cancel: {
|
text: '取消'
|
}
|
}
|
});
|
// var body = prompt('请输入无配套提醒邮件');
|
// if (body != null) {
|
// if (confirm('输入的邮件内容为[' + body + ']' + '是否发送?')) {
|
// blockme();
|
// sendEmail(body);
|
// }
|
// }
|
return false;
|
}
|
</script>
|
</head>
|
<apex:form id="allForm">
|
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<apex:actionFunction name="saveAndSort" action="{!save}" rerender="allForm, checEventFrame" oncomplete="unblockUI();">
|
<apex:param name="firstParam" assignTo="{!saveType}" value="" />
|
<apex:param name="secondParam" assignTo="{!sortKey}" value="" />
|
</apex:actionFunction>
|
<apex:actionFunction name="sendEmail" action="{!sendEmail}" rerender="allForm, checEventFrame" oncomplete="unblockUI();">
|
<apex:param name="emailBody" value="" />
|
</apex:actionFunction>
|
<apex:outputPanel id="pageallPanel">
|
<apex:pageBlock id="searchBlock" tabStyle="Report">
|
<apex:pageBlockButtons location="bottom">
|
<apex:commandButton style="float:left;" action="{!save}" value="确定" onclick="blockme();" rerender="allForm, checEventFrame" oncomplete="unblockUI();" />
|
<apex:commandButton style="float:left;" value="无配套明细提醒邮件" onclick="setEmailBody();" rerender="allForm, checEventFrame"/>
|
<apex:commandButton style="float:right;" value="{!IF(isAcceptance, '返回', '返回上一级')}" action="{!goBack}"/>
|
<apex:commandButton rendered="{!isAcceptance == false}" style="float:right;" value="返回数据确认画面" action="{!cancel}"/>
|
</apex:pageBlockButtons>
|
<div style="clear:both;"></div>
|
|
<table border="1" cellspacing="0" cellpadding="0" >
|
<tr>
|
<td colspan="2" width="200px">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Name.label}</td>
|
<td colspan="3" width="200px"><apex:outputText value="{!parentObj.Name}" style="width:100px"/></td>
|
</tr>
|
<!-- <tr>
|
<td colspan="2">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Fixture_Set_Idx__c.label}</td>
|
<td colspan="3"><apex:outputText value="{!parentObj.Fixture_Set_Idx__c}" style="width:100px"/></td>
|
</tr> -->
|
<tr>
|
<td colspan="2" width="200px">{!$ObjectType.Fixture_Set__c.fields.Loaner_name__c.label}</td>
|
<td colspan="3" width="200px"><apex:outputText value="{!parentObj.Fixture_Set__r.Loaner_name__c}" style="width:100px"/></td>
|
</tr>
|
<!-- <tr>
|
<td colspan="2">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Loaner_code__c.label}</td>
|
<td colspan="3"><apex:outputText value="{!parentObj.Loaner_code__c}" style="width:100px"/></td>
|
</tr> -->
|
<!-- <tr>
|
<td colspan="2">{!$ObjectType.Rental_Apply_Equipment_Set__c.fields.Rental_Num__c.label}</td>
|
<td colspan="3"><apex:outputText value="{!parentObj.Rental_Num__c}" style="width:100px"/></td>
|
</tr> -->
|
<!--TODO 同一附属品:レ -->
|
|
</table>
|
</apex:pageBlock>
|
<c:RelationListPagingCmp id="cmpid" pgController="{!this}" hasCheckbox="false" noSort="true"/>
|
</apex:outputPanel>
|
</apex:form>
|
<!-- add by rentx 20210729 start 新品收货_集中备品_建立新品入库标准配套 -->
|
<style>
|
table.list .col_Fixture_Set_New_Quantity__c input {width:55%;}
|
/*没找着这个输入框在哪设置的 就直接设置隐藏了 */
|
table.list .col_Rental_Num__c input { display: none;}
|
</style>
|
<!-- add by rentx 20210729 end 新品收货_集中备品_建立新品入库标准配套 -->
|
<apex:outputPanel id="checEventFrame">
|
<script type="text/javascript">
|
//update by rentx 20210729 start 新品收货_集中备品_建立新品入库标准配套
|
var i = 0;
|
// 数量添加加减符号
|
/*j$(".dataCellBorder1.col_Rental_Num__c").each(function () {
|
// if (i > 0) {
|
j$(this).append('<input type="button" style="width: auto;" class="inc btn" value="+" /><input type="button" style="width: auto;" class="dec btn" value="-" />');
|
// }
|
i ++;
|
});
|
j$(".dataCellBorder1.col_Rental_Num__c input[type=button]").on("click", function() {
|
var $button = j$(this);
|
var oldValue = $button.parent().find("input[type=text]").val();
|
if ($button.val() == "+") {
|
var newVal = parseFloat(oldValue) + 1;
|
} else {
|
// Don't allow decrementing below zero
|
if (oldValue > 0) {
|
var newVal = parseFloat(oldValue) - 1;
|
} else {
|
newVal = 0;
|
}
|
}
|
$button.parent().find("input[type=text]").val(newVal);
|
});
|
|
//
|
j$(document).ready(function(){
|
var count = j$(":text").length;
|
var inputbox = j$(":text")[count/2];
|
j$(inputbox).prop('disabled', true);
|
var a = j$("input.inc.btn")[0]
|
var b = j$("input.dec.btn")[0]
|
j$(a).prop('disabled', true);
|
j$(b).prop('disabled', true);
|
});*/
|
//设置数量只读
|
j$(".dataCellBorder1.col_Rental_Num__c input").each(function () {
|
var $button = j$(this);
|
var oldValue = $button.parent().find("input[type=text]").val();
|
$button.parent().append('<span>'+oldValue+'</span>');
|
});
|
//设置加减符号并设置一个隐藏的初始值
|
j$(".dataCellBorder1.col_Fixture_Set_New_Quantity__c").each(function () {
|
//oldValue 是初始值 设置他到一个hidden里 方便后面加减的时候做判断
|
var oldValue = j$(this).find("input[type=text]").val();
|
// var aaaa = j$(this).find("input[type=text]");
|
// var bbbb = j$(this).find("input[type=text]")[0];
|
// // var ccc = j$(this).find("input[type=text]").0;
|
// // bbbb.readonly='true';
|
// debugger;
|
//新品配套=false 时新品配套数量不可修改 直接隐藏就可以了 因为新品配套为false是 新品配套数是空
|
if (oldValue == 'NaN' || oldValue == '') {
|
j$(this).find("input[type=text]")[0].style.display = "None";
|
}else{
|
j$(this).find("input[type=text]")[0].readonly = true;
|
j$(this).append('<input type="button" style="width: auto;" class="inc btn" value="+" /><input type="button" style="width: auto;" class="dec btn" value="-" /> <input type="hidden" style="width: auto;" class="dec btn" value="'+oldValue+'" />');
|
}
|
i ++;
|
});
|
//点击加减符号时执行
|
j$(".dataCellBorder1.col_Fixture_Set_New_Quantity__c input[type=button]").on("click", function() {
|
var $button = j$(this);
|
//获取旧值 和 初始值
|
var oldValue = $button.parent().find("input[type=text]").val();
|
var firValue = $button.parent().find("input[type=hidden]").val();
|
// 初始值有值 并且不是nan的时候 新品配套有值
|
if (firValue != 'NaN' && firValue != '') {
|
//判断 如果用户点击的加号 判断 旧值是否大于初始值 若大于初始值 设置值为初始值
|
if ($button.val() == "+") {
|
var newVal = parseFloat(oldValue) + 1;
|
if (newVal > parseFloat(firValue)) {
|
var newVal = parseFloat(firValue);
|
}
|
|
} else {
|
// Don't allow decrementing below zero
|
if (oldValue > 0) {
|
var newVal = parseFloat(oldValue) - 1;
|
} else {
|
newVal = 0;
|
}
|
}
|
$button.parent().find("input[type=text]").val(newVal);
|
}else{
|
var a = j$("input.inc.btn")[0]
|
var b = j$("input.dec.btn")[0]
|
j$(a).prop('disabled', true);
|
j$(b).prop('disabled', true);
|
}
|
|
});
|
//输入框设置上线为初始值
|
j$(".dataCellBorder1.col_Fixture_Set_New_Quantity__c input[type=text]").on("change", function() {
|
console.log('12121');
|
var $text = j$(this);
|
//获取旧值 和 初始值
|
// var oldValue = $button.parent().find("input[type=text]").val();
|
var firValue = $text.parent().find("input[type=hidden]").val();
|
|
//取得当前值
|
var nowValue = $text.parent().find("input[type=text]").val();
|
|
//判断如果输入的值大于初始值 则设置当前值为初始值
|
if (parseFloat(nowValue) > parseFloat(firValue)) {
|
|
$text.parent().find("input[type=text]").val(firValue);
|
}
|
|
});
|
//update by rentx 20210729 end 新品收货_集中备品_建立新品入库标准配套
|
|
|
</script>
|
</apex:outputPanel>
|
</apex:page>
|