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

371 lines
15 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">
插单时间
</th>
<td>
<input id="PLAN_DATE" name="PLAN_DATE" value="<%=Model.PLAN_DATE.ToString("yyyy-MM-dd HH:mm:ss") %>"
type="text" class="easyui-datetimebox" required="required" readonly ="readonly" %/>
</td>
</tr>
<tr>
<th align="right">
插单位置
</th>
<td>
<%=Html.QC(p => p.PLAN_SEQ, new { Readonly = "readonly" })%>
</td>
</tr>
<tr>
<th align="right">
插单数量
</th>
<td>
<%=Html.QC(p => p.QTY)%>
</td>
</tr>
<%--<tr>
<th align="right">
即时发布
</th>
<td>
<input name="PLAN_STATE" id="PLAN_STATE" checked="checked" type="checkbox" />
</td>
</tr>--%>
</table>
</td>
</tr>
</table>
<table id="QDateGrid">
</table>
<%=Html.HiddenFor(p => p.ORDER_TYPE)%>
<%=Html.HiddenFor(p => p.MaterialCodes)%>
<%=Html.Hidden("PLANSOURCE",2)%>
<%=Html.QPEnd() %>
<div id="addMatNoWindow" class="easyui-window" title="新增物料信息" iconcls="icon-save"
closed="true" style="width: 400px; height: 300px; padding: 5px;">
<div class="easyui-layout" fit="true">
<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
<table id="Table3">
<tr>
<th align="right">
<%=Html.QV(p => p.MATERIAL_CODE)%>
</th>
<td>
<%=Html.QC(p => p.MATERIAL_CODE)%>
</td>
</tr>
</table>
</div>
<div region="north" border="false" style="text-align: left;">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<%=Html.QTButtonSave("DoorPlankPlan", "TransitSave", "AddMatInfoSave()")%>
<%=Html.QTButtonBack("Home", "Index", "AddMatInfoCancel()")%>
</td>
</tr>
</table>
</div>
</div>
</div>
<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' },
{ field: 'MATERIAL_NAME', title: '物料名称', align: 'center' },
{ field: 'HBTYPE', title: '高低配', align: 'center' },
{ field: 'COLOR', title: '颜色', align: 'center' },
{ field: 'MATERIAL_TYPE_CODE', title: '物料类型', align: 'center', width: 150, hidden: true }
]],
//*************增加****************************
toolbar: [{
text: '添加',
iconCls: 'icon-add',
handler: function () {
OpenAddMatNo();
}
},
//************删除*****************************
{
text: '删除',
iconCls: 'icon-remove',
handler: function () {
//*******************************************************************
// var selectRow = $('#QDateGrid').datagrid('getSelected');
// //获取选中行的序列
// var rowIndex = $('#QDateGrid').datagrid('getRowIndex', selectRow);
// if (rowIndex == -1) {
// MSI("提示", "请选择要删除的物料信息!");
// return false;
// }
// var dataResultSubmit;
// //删除物料信息
// $('#QDateGrid').datagrid('deleteRow', rowIndex);
//****************************************
var selectedRowIds = $('#QDateGrid').datagrid('getSelections');
var len = selectedRowIds.length;
if (len == 0) {
MSI("提示", "请选择要删除的物料信息!");
return false;
}
for (var i = 0; i < len; i++) {
var rowIndex = $('#QDateGrid').datagrid('getRowIndex', selectedRowIds[0]);
$("#QDateGrid").datagrid("deleteRow", rowIndex);
}
//********************************************
}
}
]
//**********************************************
});
});
//*********************打开新增物料信息界面*************
function OpenAddMatNo() {
$('#addMatNoWindow').window({
title: '新增物料信息',
modal: true,
shadow: false,
closed: true,
left: 250,
top: 30,
width: 280,
closable: true,
minimizable: false,
maximizable: false,
height: 300,
collapsible: false
});
$('#addMatNoWindow').window('open');
//初始化物料信息下拉
//前台Grid表;
var matData = $('#QDateGrid').datagrid('getData');
mattypes = "";
if (matData.rows.length > 0) {
//当Grid表存在信息时,获取第一行物料号(此物料号是为了过滤掉信息),颜色,高低配
//默认选取第一行
var sendplanDetail = matData.rows[0];
var hbtype = sendplanDetail.HBTYPE;
var color = sendplanDetail.COLOR;
if (matData.rows.length > 0) {
var materials = "";
for (var i = 0; i < matData.rows.length; i++) {
var sendplanDetail = matData.rows[i];
materials = materials + ";" + sendplanDetail.MATERIAL_CODE;
mattypes = mattypes + ";" + sendplanDetail.MATERIAL_TYPE_CODE;
}
var materialcode = materials.substring(1)
mattypes = mattypes.substring(1);
};
};
if (matData.rows.length == 4) {
MSI('提示', '最多添加四条物料信息!');
$('#addMatNoWindow').window('close');
};
var type = document.getElementById("ORDER_TYPE").value;
var data1;
$.ajax({
url: "/Dict/GetMaterialDoorPlan?ordertype=" + type + "&color=" + color + "&hbtype=" + hbtype + "&mattypes=" + mattypes,
data: {
'MATERIAL_CODE': $('#MATERIAL_CODE').combobox('getValue')
},
type: "post",
datatype: "json",
success: function (resultdata) {
;
data1 = eval(resultdata);
if (data1.length == 1) {
//$("#PRODUCTLINEID").val(data1[0].ID);
$("#pl").hide();
}
else {
$('#MATERIAL_CODE').combobox({
data: data1,
editable: 'false',
valueField: 'MATERIAL_CODE',
textField: 'MATERIAL_NAME'
});
$("#pl").show();
}
}
});
}
//*********************物料新增界面点击保存事件************************
function AddMatInfoSave() {
//获取物料号
var materialcode = $('#MATERIAL_CODE').combobox('getValue');
if (materialcode == "") {
MSI("提示", "请选择物料信息!");
return false;
};
//前台Grid表信息
var matData = $('#QDateGrid').datagrid('getData');
//当Grid表存在信息时
if (matData.rows.length > 0) {
for (var i = 0; i < matData.rows.length; i++) {
var sendplanDetail = matData.rows[i];
if (sendplanDetail.MATERIAL_CODE == $('#MATERIAL_CODE').combobox('getValue')) {
MSI('提示', '已经添加了物料号为' + $('#MATERIAL_CODE').combobox('getValue') + '的物料信息!');
return false;
}
}
};
var sendDetailID = "";
//编辑界面,异步添加
// if ($('#SENDID').val() != "")
// {
//---------------------------改点CR13------------------------------
//获取是否优先
// var isPriorSendPlanMark = $("#ISPRIORSENDPLANDETAILbool:checked").val();
// if (isPriorSendPlanMark == "true")
// {
// isPriorSendPlanMark = "1";
// } else
// {
// isPriorSendPlanMark = "0";
// }
//------------------------------------------------------------------
//*******************************提交************************************
var dataResultSubmit;
$.ajax({
url: "/DoorPlankPlan/AddSendDetail",
data: {
'MATERIAL_CODE': $('#MATERIAL_CODE').combobox('getValue')
},
type: "GET",
cache: false,
dataType: "json",
async: false,
success: function (data) {
//将后台传递过来的Json串转成对象
dataResultSubmit = eval(data);
}
});
//新增失败时
if (dataResultSubmit.IsSuccess == false) {
MSI("提示", dataResultSubmit.Msg);
return false;
}
//将发货计划ID
//sendDetailID = dataResultSubmit.Result;
materialname = dataResultSubmit.MATERIAL_NAME;
hbtype = dataResultSubmit.HBTYPE;
color = dataResultSubmit.COLOR;
// }
//---------------------------改点CR13------------------------------
//获取是否优先
// var isPriorSendPlanTemp = $("#ISPRIORSENDPLANDETAILbool:checked").val();
// if (isPriorSendPlanTemp == "true") {
// isPriorSendPlanTemp = "是";
// } else {
// isPriorSendPlanTemp = "否";
// }
//------------------------------------------------------------------
//********************************填充数据****************************
matData.rows.push({
MATERIAL_CODE: $('#MATERIAL_CODE').combobox('getValue'),
MATERIAL_NAME: materialname,
HBTYPE: hbtype,
COLOR: color,
MATERIAL_TYPE_CODE: dataResultSubmit.MATERIAL_TYPE_CODE
});
$('#QDateGrid').datagrid('loadData', matData);
//************************保存成功后
// $('#PALLETTYPE').combobox('setValue', '');
// $('#MATID').combobox('setValue', '');
// $('#PLANQUAN').val('0');
// $("#ISPRIORSENDPLANDETAILbool").attr("checked", false);
$('#addMatNoWindow').window('close');
}
//**********************************************************************************
//关闭新增物料号信息
function AddMatInfoCancel() {
$('#addMatNoWindow').window('close');
}
//********************整车添加保存******************************************
function SaveDoorPlan() {
var plandate = $('#PLAN_DATE').val();
var qty = $('#QTY').val();
//var shiftcode = $('#SHIFT_CODE').combobox('getValue');
//Grid表信息
var matData = $('#QDateGrid').datagrid('getData');
//当Grid表存在信息时
if (matData.rows.length >= 1) {
var materialCode = "";
for (var i = 0; i < matData.rows.length; i++) {
var materialDetail = matData.rows[i];
materialCode = materialCode + ";" + materialDetail.MATERIAL_CODE;
}
$('#MaterialCodes').val(materialCode.substring(1));
submitByButton("SaveInsert");
}
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", "SaveInsert", "return SaveDoorPlan();")%>
<%=Html.QTButtonBack("close", "DashBoardPlanList", "parent.closeAppWindow1();return false;")%>
</td>
</tr>
</table>
</asp:Content>