天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

157 lines
4.1 KiB

//长春富维江森投料管理模块中产品相关信息的公用方法
function TableStyle(index, row) {
return '<div style="padding:2px"><table id="ddv-' + index + '"></table></div>';
}
//绑定数据列
function BindExpandRow(index, row) {
if (row == undefined) {
row = $("#QDateGrid").datagrid("getSelected");
}
if (index == undefined) {
index = $("#QDateGrid").datagrid("getRowIndex", row);
}
var getDetailUrl = $('#GETDETAILINFO').val();
$('#ddv-' + index).datagrid({
url: getDetailUrl + row.PID,
fitColumns: false,
singleSelect: true,
rownumbers: true,
loadMsg: '',
height: 'auto',
columns: [[
// { field: 'PID', title: '', width: 40, align: 'center',
// formatter: function (value, row, index) {
// return rowformater(value, row, index);
// }
// },
{ field: 'PPID', title: '产品主键', width: 90, align: 'center', hidden: true
},
{ field: 'MATERIALNAME', title: '物料名称', width: 90,
align: 'center'
},
{ field: 'MATERIALCODE', title: '物料号', width: 90, align: 'center'
},
{ field: 'MATERIALTYPE', title: '物料类别', width: 90,align: 'center'
},
{ field: 'MATERIALBATCH', title: '批次号', width: 90, align: 'center'
},
{ field: 'USEDWEIGHT', title: '注料重量', width: 90, align: 'left'
}
]],
onResize: function () {
$('#QDateGrid').datagrid('fixDetailRowHeight', index);
},
onLoadSuccess: function () {
setTimeout(function () {
$('#QDateGrid').datagrid('fixDetailRowHeight', index);
}, 0);
}
});
$('#QDateGrid').datagrid('fixDetailRowHeight', index);
}
//打开
function ShowMatSelectWindow() {
$('#matSelectWindow').window({
title: '修改批次号',
modal: true,
shadow: false,
closed: true,
left: 250,
top: 50,
width: 300,
closable: true,
minimizable: false,
maximizable: false,
height: 200,
collapsible: false
});
$('#matSelectWindow').window('open');
}
//function rowformater(value, row, index) {
// return "<a href='#' onclick='ShowInfo(\"" + value + "\",\"" + row.PPID + "\",\"" + row.MATERIALBATCH + "\")'>修改</a>";
//}
function MatSelectCancel() {
$("#MATERIALBATCH").val("");
$("#PRODUCTINID").val("");
$("#PRODUCTID").val("");
$('#matSelectWindow').window('close');
}
//批次号修改
function MatSelectOK() {
var materialBatch = $('#MATERIALBATCH').val();
var piid = $("#PRODUCTINID").val();
var proid = $("#PRODUCTID").val();
if (materialBatch == "" || materialBatch == null) {
MSI("提示", "批次号不能为空!");
return;
}
var SaveUrl = $('#SAVEURL').val();
var resultData;
$.ajax({
url: SaveUrl,
data: {
'PID': piid,
'MATERIALBATCH': materialBatch,
'PRODUCTPID': proid
},
type: "GET",
cache: false,
dataType: "json",
async: false,
success: function (data) {
//重新加载新数据
//BindExpandRow();
resultData = data;
}
});
if (resultData[0].isSuccess == true) {
//关闭窗口
MatSelectCancel();
var rowindex = $("#QDateGrid").datagrid("getRowIndex", proid);
$('#ddv-' + rowindex).datagrid("reload");
MSI("提示", "保存成功!");
} else {
MSI("提示", "保存失败!");
}
}
function ShowInfo(pid, ppid, materalBatch) {
$("#MATERIALBATCH").val(materalBatch);
$("#PRODUCTINID").val(pid);
$("#PRODUCTID").val(ppid);
ShowMatSelectWindow();
}
//打开修改批次窗体
function SelectWindow() {
ShowMatSelectWindow();
return false;
}