<apex:page standardController="GuaranteePeriodAlterationApplication__c" extensions="GuaranteePeriodAlterationController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="保修期变更申请">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
|
<script>
|
function ClearJs(){
|
blockme();
|
document.getElementById("allPage:allForm:allBlock:searchBlock:text1").value = "";
|
document.getElementById("allPage:allForm:allBlock:searchBlock:val1").value = "";
|
|
searchConsumableorderdetails();
|
}
|
var selectedSize = 0;
|
var pageLimit = {!pageLimit};
|
function checkAll() {
|
selectedSize = 0;
|
var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount')).value();
|
if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
|
for (var i = 0; i < productCount; i++) {
|
if(selectedSize >= pageLimit){
|
window.alert("页面所选数据不能超过500条");
|
return;
|
}
|
j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).attr('checked',true);
|
selectedSize ++;
|
}
|
} else {
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).attr('checked',false);
|
}
|
}
|
}
|
|
function CheckSize(j){
|
var a = j.id;
|
var productCount = j$(escapeVfId(a)).attr('checked');
|
if (productCount == 'checked') {
|
if(selectedSize >= pageLimit){
|
window.alert("页面所选数据不能超过500条");
|
j$(escapeVfId(a)).attr('checked',false);
|
return;
|
}
|
selectedSize ++;
|
} else {
|
selectedSize --;
|
}
|
}
|
var flag = false ;
|
function ChangeReasonjs(){
|
var changeReason01 = j$(escapeVfId('allPage:allForm:allBlock:searchBlock:changeReason01')).value();
|
if (changeReason01 == '其他') {
|
flag = true ;
|
}
|
//alert(changeReason01);
|
}
|
|
function EditConsumable(){
|
//解除不可写状态
|
blockme();
|
setEditAble();
|
}
|
|
function backOrderJs(){
|
//解除不可写状态
|
blockme();
|
backOrder();
|
// UnabletoEdit();
|
}
|
function DeleteConsumable(){
|
//删除这一单
|
if(window.confirm('删除是不可恢复的,你确认要删除吗?')){
|
DelConsumable();
|
}
|
}
|
|
|
function saveJs() {
|
blockme();
|
// beforeSaveJs();
|
save();
|
}
|
|
// function beforeSaveJs() {
|
// var OffersPrice = j$(escapeVfId('allPage:allForm:allBlock:unEditable:sumPrice_buttom2')).value();
|
// j$(escapeVfId('allPage:allForm:allBlock:unEditable:theHiddenInput')).val(OffersPrice.replace(/,/g,""));
|
// }
|
|
|
function SorderJs() {
|
blockme();
|
Sorder();
|
}
|
function uploadingAttachmentJs(){
|
uploadingAttachment();
|
}
|
function searchProductJs() {
|
blockme();
|
var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount')).value();
|
var isChanged = false;
|
for (var i = 0; i < productCount; i++) {
|
var nowChk = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':sumablesCountproRowCheckbox')).attr('checked');
|
var oldChk = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':proRowOldCheckbox')).attr('checked');
|
var consumablesCount= j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':consumablesCount')).value();
|
var oldConsumableCount= j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':oldConsumableCount')).value();
|
if (nowChk != oldChk || (nowChk == 'checked' && consumablesCount != oldConsumableCount)) {
|
isChanged = true;
|
break;
|
}
|
}
|
|
searchConsumableorderdetails();
|
}
|
</script>
|
<style>
|
.dateFormat {
|
display: none;
|
}
|
td.columuslowercolour {
|
background-color:red;
|
text-align: right;
|
}
|
td.columuscuperolour {
|
background-color: yellow;
|
text-align: right;
|
}
|
</style>
|
<apex:form id="allForm">
|
|
<apex:actionFunction name="save" action="{!save}" rerender="editAble,ConsumableorderdetailsSection, message,editAble" onComplete="unblockUI();CheckStatusAfter();">
|
</apex:actionFunction>
|
<apex:actionFunction name="Sorder" action="{!Sorder}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();init();">
|
</apex:actionFunction>
|
<apex:actionFunction name="searchConsumableorderdetails" action="{!searchConsumableorderdetails}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
|
</apex:actionFunction>
|
<apex:actionFunction name="setEditAble" action="{!setEditAble}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
|
</apex:actionFunction>
|
<apex:actionFunction name="DelConsumable" action="{!DelConsumable}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
|
</apex:actionFunction>
|
<apex:actionFunction name="uploadingAttachmentJs" action="{!uploadingAttachment}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
|
</apex:actionFunction>
|
<!-- <apex:actionFunction name="returnChangePage" action="{!returnChangePage}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
|
</apex:actionFunction> -->
|
|
<apex:actionFunction name="backOrder" action="{!backOrder}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();searchConsumableorderdetails()">
|
</apex:actionFunction>
|
<!-- <apex:actionFunction name="UnabletoEdit" action="{!UnabletoEdit}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI()">
|
</apex:actionFunction> -->
|
|
<apex:outputPanel id="allPanel">
|
<apex:pageBlock id="allBlock" >
|
<apex:pageBlock id="EDCline_1" >
|
<apex:commandButton onclick="EditConsumable();" value="编辑" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble)}" disabled="{!IF(ambc.Change_status__c='已提交'||ambc.Change_status__c='批准'||ambc.Change_status__c='驳回',true,false)}"/>
|
|
<apex:commandButton onclick="SorderJs();" value="提交申请" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble )}" disabled="{!IF(ambc.Change_status__c='已提交'||ambc.Change_status__c='批准',true,false)}"/>
|
<apex:commandButton onclick="saveJs();" value="保存变更申请单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF((editAble) && ambc.Change_status__c !='驳回',true,false)}" />
|
<apex:commandButton onclick="saveJs();" value="保存变更申请单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF(ambc.Change_status__c='驳回' && editAble,true,false)}" />
|
<apex:commandButton onclick="DeleteConsumable();" value="删除" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble)}" disabled="{!IF(ambc.Change_status__c='已提交'||ambc.Change_status__c='批准'||ambc.Change_status__c='驳回',true,false)}"/>
|
<apex:commandButton onclick="backOrderJs();" value="再申请" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF(ambc.Change_status__c='驳回' && !editAble,true,false)}" />
|
</apex:pageBlock>
|
|
<apex:pageBlock title="变更申请单信息" id="unEditable" rendered="{!!(editAble)}">
|
<table>
|
<colgroup>
|
<col width="250px"/>
|
<!-- <col width="100px"/> -->
|
<!-- <col width="10px"/> -->
|
<!-- <col width="20px"/> -->
|
<col width="200px"/>
|
<col width="300px"/>
|
<col width="300px"/>
|
</colgroup>
|
|
<tr>
|
<td align="right" >申请单编码:</td>
|
<td align="left" ><apex:outputField id="OrderCode_out" value="{!ambc.Name}" style="width:200px"/></td>
|
<!-- <td/> -->
|
<td align="right" >状 态:</td>
|
<td align="left" ><apex:outputField id="OrderStatus_out" value="{!ambc.Change_status__c}" style="width:100px"/></td>
|
<!-- <td/> -->
|
</tr>
|
<tr>
|
|
<!-- <td/> -->
|
<td align="right">变更原因:</td>
|
<td align="left">
|
<apex:outputField value="{!ambc.ChangeReason__c}" style="width:200px"/>
|
</td>
|
<td align="right">变更原因其他:</td>
|
<td align="left"><apex:outputField value="{!ambc.ChangeReason_text__c}" style="width:200px"/></td>
|
</tr>
|
<tr>
|
<td align="right">安装日期:</td>
|
<td align="left"><apex:outputField value="{!ambc.WarrantyStartDate__c}" style="width:200px"/></td>
|
<!-- <td align="right">保修天数:</td>
|
<td align="left"><apex:outputField value="{!ambc.WarrantyDays__c}" style="width:200px"/></td> -->
|
</tr>
|
<!-- <tr>
|
<td align="right">保修期限:</td>
|
<td align="left"><apex:outputField value="{!ambc.GuaranteeTime__c}" style="width:200px"/></td>
|
</tr> -->
|
</table>
|
</apex:pageBlock>
|
<apex:pageBlock id="searchBlock" rendered="{!editAble}">
|
<table>
|
<colgroup>
|
<col width="10px"/>
|
<col width="10px"/>
|
<col width="60px"/>
|
<col width="85px"/>
|
<col width="60px"/>
|
<col width="60px"/>
|
<col width="180px"/>
|
<col width="60px"/>
|
<col width="60px"/>
|
<col width="180px"/>
|
<col width="60px"/>
|
<col width="60px"/>
|
|
</colgroup>
|
<tr>
|
<td align="right"></td>
|
<td></td>
|
<td/>
|
<td align="right">选择条件:</td>
|
<td>
|
<apex:selectList value="{!text1}" id="text1" size="1" style="width:90px"><apex:selectOptions value="{!textOpts}"/>
|
</apex:selectList>
|
</td>
|
<td>
|
<apex:inputText value="{!val1}"
|
id="val1" style="width:100px"/>
|
</td>
|
<td align="right"></td>
|
<td><apex:commandButton value="保有设备搜索" style="width: 100px;" onclick="searchProductJs('0');return false;" /></td>
|
<td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs();return false;" class="btn"/></td>
|
<td/>
|
</tr>
|
<tr>
|
<td colspan="14"></td>
|
</tr>
|
<tr >
|
|
<td colspan="3"/>
|
|
<td colspan="4"> 变更原因:<!-- <apex:selectList value="{!ambc.ChangeReason__c}" id="changeReason01" size="1" style="width:204px" onchange="ChangeReasonjs('{!ambc.ChangeReason__c}');"><apex:selectOptions value="{!changeReasonOpts}" /> -->
|
<!-- </apex:selectList> -->
|
<apex:inputField value="{!ambc.ChangeReason__c}" style="width:200px"></apex:inputField>
|
</td>
|
<td colspan="4">变更原因其他:<apex:inputText value="{!ambc.ChangeReason_text__c}" style="width:200px"/></td>
|
<!-- <td colspan="4">保修天数:<apex:inputText value="{!ambc.WarrantyDays__c}" style="width:200px"/></td> -->
|
|
</tr>
|
<!-- <tr></tr> -->
|
<tr>
|
<td colspan="3"/>
|
<!-- <td colspan="1"/> -->
|
<!-- <td colspan="5"> 变更原因其他:<apex:inputText value="{!ambc.ChangeReason_text__c}" style="width:200px"/></td> -->
|
<td colspan="4"> 安装日期:<apex:outputField value="{!ambc.WarrantyStartDate__c}" style="width:200px"/></td>
|
<!-- <td colspan="4"> 保修天数:<apex:inputText value="{!ambc.WarrantyDays__c}" style="width:200px"/></td> -->
|
<!-- <td colspan="4"/> -->
|
</tr>
|
|
</table>
|
</apex:pageBlock>
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<apex:pageBlock title="保有设备所属变更明细" id="ConsumableorderdetailsSection">
|
<input type="hidden" id="allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount" value="{!ConsumableorderdetailsviewCount}" />
|
<table class="list" border="0" cellpadding="0" cellspacing="0">
|
<tr class="headerRow">
|
<apex:variable var="v" value="" rendered="{!editAble}">
|
<th><input type='checkbox' onClick='checkAll()' id='checker'/>选择</th>
|
</apex:variable>
|
<th>保有设备名称</th>
|
<th>订单编码</th>
|
<th>机身编码</th>
|
<th>修理件数</th>
|
<th>保修天数</th>
|
</tr>
|
<apex:repeat value="{!guaranteePeriodAlterationDetaiRecordsview}" var="records" id="ConsumableorderdetailsTable">
|
<tr class="dataRow">
|
<apex:variable var="v" value="" rendered="{!editAble}" id="variableinfo">
|
<td>
|
<apex:inputCheckbox value="{!records.check}" onclick="CheckSize(this);" id="consumablesCountproRowCheckbox" disabled="{!!records.canSelect}"/>
|
<apex:inputCheckbox value="{!records.oldCheck}" id="proRowOldCheckbox" style="display:none"/></td>
|
</apex:variable>
|
<td class="dataCell">
|
<apex:outputText value="{!records.ast.Name}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputText value="{!records.ast.Order_No__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputText value="{!records.ast.SerialNumber}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputText value="{!records.ast.RepairQuantity__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputText value="{!records.ast.guarantee_period__c}"/>
|
</td>
|
</tr>
|
</apex:repeat>
|
</table>
|
|
</apex:pageBlock>
|
<!-- CHAN-BC6BV2 XHL AddStart 20190522 -->
|
<apex:pageBlock title="附件" id="accessory" rendered="{!isShow}">
|
|
<apex:pageBlockButtons location="top">
|
<apex:commandButton value="附件上传" onclick="uploadingAttachmentJs();" disabled="{!IF(ambc.Change_status__c='已提交'||ambc.Change_status__c='批准',true,false)}"/>
|
</apex:pageBlockButtons>
|
<apex:pageBlockTable value="{!attachments}" var="attachment" >
|
|
|
<apex:column headerValue="标题" style="width: 33%">
|
<apex:outputField value="{!attachment.Name}"/>
|
</apex:column>
|
<apex:column headerValue="上次修改时间" style="width: 33%">
|
<apex:outputField value="{!attachment.CreatedDate}"/>
|
</apex:column>
|
<apex:column headerValue="创建人" style="width: 33%">
|
<apex:outputField value="{!attachment.OwnerId}"/>
|
</apex:column>
|
|
</apex:pageBlockTable>
|
</apex:pageBlock>
|
<!-- CHAN-BC6BV2 XHL AddEnd 20190522 -->
|
</apex:pageBlock>
|
</apex:outputPanel>
|
</apex:form>
|
<script>
|
</script>
|
</apex:page>
|