天津投入产出系统后端
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.
 
 
 
 
 
 

208 lines
8.7 KiB

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.FIS.DoorPlankPlanModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
整车添加门板编辑
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPEdit("信息", string.IsNullOrEmpty(Model.PID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%>
<table id="editTable" cellpadding="0" cellspacing="0">
<tr>
<td>
<table>
<tr>
<th align="right">
<%=Html.QV(p => p.PLAN_DATE)%>
</th>
<td>
<%=Html.QC(p => p.PLAN_DATE)%>
</td>
<th align="right">
<%=Html.QV(p => p.QTY)%>
</th>
<td>
<%=Html.QC(p => p.QTY)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.SHIFT_CODE)%>
</th>
<td>
<%=Html.QC(p => p.SHIFT_CODE)%>
</td>
<th align="right">
<%=Html.QV(p => p.MATERIAL_CODE)%>
</th>
<td>
<%=Html.QC(p => p.MATERIAL_CODE)%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table id="QDateGrid">
</table>
<%=Html.HiddenFor(p => p.ORDER_TYPE)%>
<%=Html.HiddenFor(p => p.MaterialCodes)%>
<%=Html.HiddenFor(p => p.AsmSetCode)%>
<%=Html.Hidden("PLANSOURCE",1)%>
<%=Html.QPEnd() %>
<script language="javascript" type="text/javascript">
$(function () {
$('#QDateGrid').datagrid({
width: 500,
height: 400,
fit: true,
nowrap: false,
striped: true,
collapsible: false,
pagination: true,
rownumbers: false,
remoteSort: false,
idField: 'MATERIAL_CODE',
columns: [[
{ field: 'MATERIAL_CODE', title: '物料号', align: 'center', width: 190 },
{ field: 'MATERIAL_NAME', title: '物料名称', align: 'center', width: 280 },
{ field: 'HBTYPE', title: '高低配', align: 'center', width: 80 },
{ field: 'COLOR', title: '颜色', align: 'center', width: 80 },
{ field: 'AsmSetCode', title: '前缀', align: 'center', width: 80, hidden:true}
]],
//*************按钮****************************
toolbar: [
//************删除*****************************
{
text: '删除',
iconCls: 'icon-remove',
handler: function ()
{
var selectedRowIds = $('#QDateGrid').datagrid('getSelections');
var len = selectedRowIds.length;
if (len == 0)
{
MSI("提示", "请选择要删除的门板计划信息!");
return false;
} else
{
MSQ("提示", "确定要删除选中的记录吗?", function ()
{
for (var i = 0; i < len; i++)
{
var rowIndex = $('#QDateGrid').datagrid('getRowIndex', selectedRowIds[0]);
$("#QDateGrid").datagrid("deleteRow", rowIndex);
}
})
}
//********************************************
}
}
]
//**********************************************
});
});
//*********************grid画完*************
//*********************物料信息*************
$('#MATERIAL_CODE').combobox({
url: "/Dict/GetFisDoorPlanForCD",
panelHeight: '150',
panelWidth: '370',
editable: 'false',
valueField: 'Id',
textField: 'Name',
onSelect: function () {
var materialcode = $('#MATERIAL_CODE').combobox('getValue');
if (materialcode != "") {
//获取四扇车门信息
$('#QDateGrid').datagrid("loadData", new Array());
var dataInfo = $('#QDateGrid').datagrid('getData');
$.ajax({
url: "/DoorPlankPlan/AddSendDetail",
data: {
'MATERIAL_CODE': $('#MATERIAL_CODE').combobox('getValue')
},
type: "POST",
cache: false,
dataType: "json",
async: false,
success: function (data) {
if (data == null || data == '') {
//alert("!");
MSI("提示", "未查到数据!")
}
else {
for (var i = 0; i < data.total; i++) {
var insertInfo =
{
MATERIAL_CODE: data.rows[i].MATERIAL_CODE,
MATERIAL_NAME: data.rows[i].MATERIAL_NAME,
HBTYPE: data.rows[i].HBTYPE,
COLOR: data.rows[i].COLOR,
AsmSetCode: data.rows[i].AsmSetCode
};
dataInfo.rows.push(insertInfo);
}
$('#QDateGrid').datagrid('loadData', dataInfo);
$('#addMatNoWindow').window('close');
}
}
});
}
else {
// alert("****");
}
}
});
//*********************物料信息结束*************
//********************整车添加保存******************************************
function SaveDoorPlan() {
var plandate = $('#PLAN_DATE').val();
if (plandate == "") {
MSI("提示", "计划日期不能为空!");
return;
}
var reg = /^[0-9]+$/;
var qty = $('#QTY').val();
if (!reg.test(qty)) {
MSI("提示", "计划数量只能输入数字!");
return;
}
var shiftcode = $('#SHIFT_CODE').combobox('getValue');
if (shiftcode == "") {
MSI("提示", "班次信息不能为空!");
return;
}
//Grid表信息
var matData = $('#QDateGrid').datagrid('getData');
//当Grid表存在信息时
if (matData.rows.length > 0) {
var materialCode = "";
for (var i = 0; i < matData.rows.length; i++) {
var materialDetail = matData.rows[i];
materialCode = materialCode + ";" + materialDetail.MATERIAL_CODE;
}
var setcode=matData.rows[0].AsmSetCode;
$('#MaterialCodes').val(materialCode.substring(1));
$('#AsmSetCode').val(setcode);
submitByButton("DoorPlanSave");
}
else {
MSI("提示", "整车添加需要四条物料信息!");
return false;
}
}
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<%=Html.QTButtonSave("DoorPlankPlan", "Save", "return SaveDoorPlan();")%>
<%=Html.QTButtonBack("close", "DashBoardPlanList", "parent.closeAppWindow1();return false;")%>
</td>
</tr>
</table>
</asp:Content>