<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title>增加/修改</title>
|
[#include "/business/pages/include/static.html" /]
|
[#include "/component/DatePicker.html" /]
|
<script type="text/javascript" src="${common_static}/static/script/jquery.ssq.js"></script>
|
</head>
|
<body class="edit_txt_body">
|
<script type="text/javascript">
|
$(function() {
|
$.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
|
document.getElementById("myform").target = window.top.openDialog("1","操作",
|
{},
|
{"width":40,"height":40,"noclose":true},
|
[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
|
return true;
|
}});
|
|
|
$("#order_name").formValidator({empty:false,onFocus:"请输入工单名称"}).inputValidator({min:2,max:32,onError:"工单名称为1-16个汉字!"});
|
|
});
|
|
</script>
|
|
<div class="edit_txt">
|
<form action="${base}/business/pages/overageLoss/lossEditSubmit.html" method="post" id="myform" name="myform">
|
<input type="hidden" name="id" id="id" value="${id}"/>
|
<input type="hidden" id="order_code" name="order_code" value="${msgMap.order_code}" />
|
<input type="hidden" id="type" name="type" value="${type}" />
|
<input type="hidden" name="dealId" id="dealId" value="" />
|
<input type="hidden" name="dealName" id="dealName" value="" />
|
<input type="hidden" name="bz" id="bz" value="" />
|
<table class="edit_layout" width="99%">
|
<tr>
|
<th><label class="required">工单名称:</label></th>
|
<td colspan="3"><input class="general" type="text" name="order_name" id="order_name" value="${msgMap.order_name}" style="width:360px"/>
|
<div id="order_nameTip" style="display:inline-block;"></div>
|
</td>
|
</tr>
|
<tr>
|
<th><label>业务类型:</label></th>
|
<td>
|
<input class="general" type="hidden" value="${msgMap.status}" name="bus_type" id="bus_type" />报损
|
</td>
|
</tr>
|
<tr>
|
<th>
|
<label>报损备件数:</label>
|
</th>
|
<td>
|
<span id="bjCount"></span>
|
</td>
|
</tr>
|
<tr>
|
<th><label>备注:</label></th>
|
<td colspan="3"><textarea class="general" style="width:360px;" id="note" name="note" value="${msgMap.note}" /></textarea>
|
</td>
|
</tr>
|
</table>
|
|
|
<div class="edit_title">
|
<!-- 库存报损 0 -->
|
<h3>报损备件明细</h3>
|
<a class="add_associated" href="javascript:addBs('${id}');">新增</a>
|
<a class="add_associated" href="javascript:addPlBy();">批量设置报损原因</a>
|
</div>
|
<p style="font-size: 14px;padding-left: 50px">
|
</p>
|
|
<div class="fs_main clearfix">
|
<div id="main"></div>
|
<div id="pagination"></div>
|
</div>
|
|
</form>
|
</div>
|
|
|
<script type="text/javascript">
|
function query(){
|
var orderId=$("#id").val();
|
var url="${base}/business/pages/overageLoss/spareLoseListData.html";
|
loading($("#main"));
|
var params = {"orderId":orderId};
|
$.post(url,params,function(data,textStatus) {
|
loaded($("#main"));
|
$("#main").html(data);
|
countBj(orderId);
|
})
|
|
|
}
|
|
$(function(){
|
query();
|
});
|
|
function countBj(orderId){
|
$.post("${base}/business/pages/overageLoss/loseListCount.html", {"orderId":orderId},function(data){
|
$("#bjCount").text(data);
|
},"json");
|
}
|
//库存报损 增加页面
|
function addBs(id){
|
var deviceIds = new Array();
|
var $deviceId = $(":input[name='spareId']");
|
if ($deviceId.length > 0) {
|
$deviceId.each(function () {
|
deviceIds.push($(this).val());
|
})
|
}
|
var spart_ids = deviceIds.join("-");
|
var url = "${base}/business/pages/overageLoss/spareDeviceLose.html?orderId="+id+"&spart_ids="+spart_ids;
|
window.top.openDialog("1","添加备件实体",
|
{},
|
{"width":80,"height":80},
|
[{btnId:"btnSure", btnName:"选择", btnStyle:"bluebtn"}],
|
url);
|
}
|
|
//批量设置报损原因
|
function addPlBy() {
|
var detailIds = "";
|
$("#main :checkbox:checked").each(function () {
|
debugger;
|
detailIds += (detailIds ? "," : "") + $(this).val();
|
})
|
|
var checkedBox = $("#main :checkbox:checked");
|
if(checkedBox.length==0) {
|
popupTips("请选择备件");
|
return;
|
}
|
var url = "${base}/business/pages/overageLoss/loseByPlEdit.html?detailIds="+detailIds;
|
window.top.openDialog("plBy", "批量设置报溢报损原因",
|
{},
|
{"width": 60, "height": 80},
|
[{btnId: "btnSure", btnName: "确定", btnStyle: "bluebtn"}], url);
|
|
}
|
|
|
|
function onDialogBtnClick(btnID, dialogID, config) {
|
if (btnID == "btnSave") {
|
$("#myform").submit();
|
}
|
if(btnID == "btnSure"){
|
var order_name = $("#order_name").val();
|
if ($.util.isEmpty(order_name)) {
|
popupTips("请填写工单名称!");
|
return;
|
}
|
initbj();
|
}
|
}
|
function initDelivery(){
|
var orderId=$("#id").val();
|
var tip = "确定要提交吗?";
|
window.top.confirmInfo('提示', tip, function(){
|
$.post("${base}/business/pages/overageLoss/initDelivery.html", {"orderId":orderId},function(data){
|
if(data == "0"){
|
selSpareNextNode();
|
}else{
|
window.top.popupTips("存在备件没有设置报损原因!");
|
}
|
},"json");
|
})
|
|
}
|
function initbj(){
|
var orderId=$("#id").val();
|
$.post("${base}/business/pages/overageLoss/loseListCount.html", {"orderId":orderId},function(data){
|
if(data=="0"){
|
window.top.popupTips("请添加报损备件!");
|
return;
|
}else{
|
initDelivery();
|
}
|
},"json");
|
|
}
|
function selSpareNextNode(){
|
|
var orderId="";
|
var url = "${base}/business/pages/bpbj/deliveryApply/selSpareNextNode.html?orderId="+orderId+"&type=1";
|
window.top.openDialog("insideAllot","提交审核",
|
{},
|
{"width":60,"height":70},
|
[{btnId:"btnSure", btnName:"提交", btnStyle:"bluebtn"}],
|
url);
|
|
}
|
|
function showDealDeivce(devices) {
|
$.each(devices, function (i, item) {
|
var dealId = item.get("dealId");
|
var dealName = item.get("dealName");
|
var bz = item.get("bz");
|
$("#dealId").val(dealId);
|
$("#dealName").val(dealName);
|
$("#bz").val(bz);
|
})
|
$("#myform").submit();
|
}
|
//修改备件详细信息
|
function sparePartDetail(detail_id,bjId){
|
var orderId=$("#orderId").val();
|
var url = "${base}/business/pages/bpbj/stockApply/sparePartDetail.html?id="+bjId+"&detail_id="+detail_id+"&type=bsxg";
|
window.top.openDialog("xgbj", "修改备件",
|
{},
|
{"width": 60, "height": 80},
|
[{btnId: "btnSure", btnName: "确定", btnStyle: "bluebtn"}], url);
|
}
|
|
|
function delBj(id){
|
var tip = "确定要删除吗?";
|
window.top.confirmInfo('提示', tip, function(){
|
$.post("${base}/business/pages/overageLoss/deleteItem.html", {"id":id},function(data){
|
if(data == "1"){
|
window.top.popupTips("操作成功");
|
query();
|
}
|
},"json");
|
})
|
|
}
|
|
</script>
|
|
|
</body>
|
</html>
|