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.
348 lines
15 KiB
348 lines
15 KiB
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
|
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Basic.ProcessSetModel>" %>
|
|
|
|
<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.PROCESSNAMETXT) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.PROCESSNAMETXT)%>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th align="right">
|
|
<%=Html.QV(p => p.PROCESSTYPETXT)%>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.PROCESSTYPETXT)%>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.PRODUCTTYPE) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.PRODUCTTYPE)%>
|
|
</td>
|
|
</tr>
|
|
<%-- <tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.PROCESSINDEX) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.PROCESSINDEX)%>
|
|
</td>
|
|
</tr>--%>
|
|
<%-- <tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.INTERVALVALUE) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.INTERVALVALUE)%>
|
|
</td>
|
|
</tr>--%>
|
|
<tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.LPNECCESSARY) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.LPNECCESSARY)%>
|
|
</td>
|
|
</tr>
|
|
<%-- <tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.ISMAIN) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.ISMAIN)%>
|
|
</td>
|
|
</tr>--%>
|
|
<%-- <tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.WIPSET) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.WIPSET)%>
|
|
</td>
|
|
</tr>--%>
|
|
<%--<tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.MINVALUE) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.MINVALUE)%>
|
|
</td>
|
|
</tr>--%>
|
|
<%--<tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.PRODUCEMINVALUE) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.PRODUCEMINVALUE)%>
|
|
</td>
|
|
</tr>--%>
|
|
<tr>
|
|
<th align="right">
|
|
<%=Html.QV(p=>p.MEMO) %>
|
|
</th>
|
|
<td>
|
|
<%=Html.QC(p => p.MEMO)%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<%=Html.HiddenFor(p => p.PID)%>
|
|
<%=Html.HiddenFor(p => p.PCID)%>
|
|
<%=Html.HiddenFor(p => p.CREATEDATE)%>
|
|
<%=Html.HiddenFor(p => p.CREATEUSER)%>
|
|
<%=Html.HiddenFor(p => p.UPDATEDATE)%>
|
|
<%=Html.HiddenFor(p => p.UPDATEUSER)%>
|
|
<%=Html.HiddenFor(p => p.PRODUCELINE)%>
|
|
<%=Html.HiddenFor(p => p.PROCESSTYPE)%>
|
|
<%=Html.HiddenFor(p => p.MAXPROCESSINDEX)%>
|
|
<%=Html.HiddenFor(p => p.OLDPROCESSINDEX)%>
|
|
<%=Html.HiddenFor(p => p.OLDPRODUCTTYPE)%>
|
|
<%=Html.HiddenFor(p => p.PROCESSNAME)%>
|
|
<%=Html.HiddenFor(p => p.PRODUCTNAME)%>
|
|
<%=Html.HiddenFor(p => p.PRODUCEMINVALUE)%>
|
|
<%=Html.HiddenFor(p => p.MINVALUE)%>
|
|
<%=Html.HiddenFor(p => p.WIPSET)%>
|
|
<%=Html.HiddenFor(p => p.ISMAIN)%>
|
|
<%=Html.HiddenFor(p => p.PROCESSINDEX)%>
|
|
<%=Html.HiddenFor(p => p.INTERVALVALUE)%>
|
|
<%=Html.QPEnd() %>
|
|
</asp:Content>
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
|
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td>
|
|
<%=Html.QTButtonSave("User", "Save", "return Save();")%>
|
|
<%=Html.QTButtonBack("close", "List", "parent.closeAppWindow1();return false;")%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
|
|
var PID = $("#PID").val();
|
|
if (PID == "") {
|
|
//新建工序设置信息时:初始化int类型的字段为空
|
|
$("#PROCESSINDEX").val("");
|
|
$("#INTERVALVALUE").val("");
|
|
}
|
|
//修改时,保存原工序顺序
|
|
var PROCESSINDEX = $("#PROCESSINDEX").val();
|
|
if (PROCESSINDEX == 0) {
|
|
$("#PROCESSINDEX").val("");
|
|
$("#OLDPROCESSINDEX").val("");
|
|
}
|
|
else {
|
|
$("#OLDPROCESSINDEX").val(PROCESSINDEX);
|
|
var PRODUCTTYPE = $("#PRODUCTTYPE").val();
|
|
$.ajax({
|
|
url: "/ProcessSet/GetProcessIndex",
|
|
data: {
|
|
'PRODUCTTYPE': PRODUCTTYPE
|
|
},
|
|
type: "POST",
|
|
cache: false,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data != null) {
|
|
var processSet = eval(data);
|
|
$("#MAXPROCESSINDEX").val(processSet.MAXPROCESSINDEX);
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
//修改时,保存原零件类别
|
|
var OLDPRODUCTTYPE = $("#PRODUCTTYPE").combobox("getValue");
|
|
if (OLDPRODUCTTYPE != "") {
|
|
$("#OLDPRODUCTTYPE").val(OLDPRODUCTTYPE);
|
|
}
|
|
//var WIPSET = $("#WIPSET").combobox("getValue");
|
|
|
|
//当“在制品工序设置”选择否时,隐藏“工序低储值设置”、“生产最小批次设置”
|
|
// if (WIPSET == 0 || WIPSET == "") {
|
|
|
|
// $("#MINVALUE").attr("readonly", true);
|
|
// $("#MINVALUE").css({ "backgroundColor": "#C0C0C0" });
|
|
// $("#PRODUCEMINVALUE").attr("readonly", true);
|
|
// $("#PRODUCEMINVALUE").css({ "backgroundColor": "#C0C0C0" });
|
|
|
|
// // $("#MINVALUEDIS").hide();
|
|
// // $("#PRODUCEMINVALUEDIS").hide();
|
|
// }
|
|
// else {
|
|
// $("#MINVALUE").attr("readonly", false);
|
|
// $("#MINVALUE").css({ "backgroundColor": "#FFFFFF" });
|
|
// $("#PRODUCEMINVALUE").attr("readonly", false);
|
|
// $("#PRODUCEMINVALUE").css({ "backgroundColor": "#FFFFFF" });
|
|
// }
|
|
// if (WIPSET == "") {
|
|
// $("#MINVALUEDIS").show();
|
|
// $("#PRODUCEMINVALUEDIS").show();
|
|
// }
|
|
|
|
//设置工序类型为只读
|
|
$("#PROCESSTYPETXT").attr("readonly", true)
|
|
$("#PROCESSTYPETXT").css({ "backgroundColor": "#C0C0C0" });
|
|
|
|
|
|
$('#PROCESSNAMETXT').combobox({
|
|
disabled: true
|
|
});
|
|
|
|
$('#PRODUCTTYPE').combobox({
|
|
disabled: true
|
|
});
|
|
|
|
//工序名称下拉事件,根据工序名称id,获取工序类别
|
|
$("#PROCESSNAMETXT").combobox({
|
|
onSelect: function () {
|
|
var PCID = $("#PROCESSNAMETXT").combobox("getValue");
|
|
if (PCID != "") {
|
|
$.ajax({
|
|
url: "/ProcessSet/GetProcessType",
|
|
data: {
|
|
'PCID': PCID
|
|
},
|
|
type: "GET",
|
|
cache: false,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
var processType = eval(data);
|
|
$("#PROCESSTYPETXT").val(processType.value);
|
|
$("#PROCESSTYPE").val(processType.key);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
//零件类别下拉事件,根据根据零件类别获取应插入的工序顺序
|
|
$("#PRODUCTTYPE").combobox({
|
|
onSelect: function () {
|
|
var PRODUCTTYPE = $("#PRODUCTTYPE").combobox("getValue");
|
|
$("#PRODUCTNAME").val($("#PRODUCTTYPE").combobox("getValue"));
|
|
$.ajax({
|
|
url: "/ProcessSet/GetProcessIndex",
|
|
data: {
|
|
'PRODUCTTYPE': PRODUCTTYPE
|
|
},
|
|
type: "POST",
|
|
cache: false,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data == null) {
|
|
$("#PROCESSINDEX").val(1);
|
|
}
|
|
else {
|
|
var processSet = eval(data);
|
|
$("#PROCESSINDEX").val(processSet.PROCESSINDEX);
|
|
$("#MAXPROCESSINDEX").val(processSet.MAXPROCESSINDEX);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//当“在制品工序设置”选择否时,隐藏“工序低储值设置”、“生产最小批次设置”
|
|
// $("#WIPSET").combobox({
|
|
// onSelect: function () {
|
|
// var WIPSET = $("#WIPSET").combobox("getValue");
|
|
//
|
|
// if (WIPSET == 0 || WIPSET == "") {
|
|
// $("#MINVALUE").attr("readonly", true);
|
|
// $("#MINVALUE").css({ "backgroundColor": "#C0C0C0" });
|
|
// $("#PRODUCEMINVALUE").attr("readonly", true);
|
|
// $("#PRODUCEMINVALUE").css({ "backgroundColor": "#C0C0C0" });
|
|
// }
|
|
// else {
|
|
// $("#MINVALUE").attr("readonly", false);
|
|
// $("#MINVALUE").css({ "backgroundColor": "#FFFFFF" });
|
|
// $("#PRODUCEMINVALUE").attr("readonly", false);
|
|
// $("#PRODUCEMINVALUE").css({ "backgroundColor": "#FFFFFF" });
|
|
// }
|
|
// }
|
|
// });
|
|
|
|
});
|
|
function Save() {
|
|
if (isValidate() == false) {
|
|
return false;
|
|
}
|
|
//校验输入框
|
|
// var WIPSET = $("#WIPSET").combobox("getValue");
|
|
// if (WIPSET == 1) {
|
|
// var MINVALUE = $("#MINVALUE").val();
|
|
// var PRODUCEMINVALUE = $("#PRODUCEMINVALUE").val();
|
|
// if (MINVALUE == "") {
|
|
// MSI("提示", "当在“制品工序设置”选择是时,“工序低储值设置”为必填项!");
|
|
// return false;
|
|
// }
|
|
// if (PRODUCEMINVALUE == "") {
|
|
// MSI("提示", "当在“制品工序设置”选择是时“生产最小批次设置”为必填项!");
|
|
// return false;
|
|
// }
|
|
// }
|
|
// if (WIPSET == 0) {
|
|
// //清空“工序低储值设置”、“生产最小批次设置”
|
|
// ClearWipSet();
|
|
// }
|
|
//把工序名称下拉控件的Text、Value属性传到后台保存到数据库
|
|
var PROCESSNAMETXT = $("#PROCESSNAMETXT").combobox("getText"); //工序名称
|
|
var PCID = $("#PROCESSNAMETXT").combobox("getValue"); //工序ID
|
|
$('#PROCESSNAME').val(PROCESSNAMETXT);
|
|
$("#PCID").val(PCID); //工序ID
|
|
|
|
//校验工序顺序
|
|
var PROCESSINDEX = parseInt($("#PROCESSINDEX").val());
|
|
var OLDPROCESSINDEX = parseInt($("#OLDPROCESSINDEX").val());
|
|
var MAXPROCESSINDEX = parseInt($("#MAXPROCESSINDEX").val());
|
|
if (PROCESSINDEX == 0) {
|
|
MSI("提示", "工序顺序不能为0!");
|
|
}
|
|
//新建时
|
|
if ($("#OLDPROCESSINDEX").val() == 0) {
|
|
if (PROCESSINDEX != MAXPROCESSINDEX + 1) {
|
|
if (PROCESSINDEX > MAXPROCESSINDEX + 1) {
|
|
MSI("提示", "应插入工序顺序为" + parseInt(parseInt($("#MAXPROCESSINDEX").val()) + 1));
|
|
$("#PROCESSINDEX").val(parseInt(parseInt($("#MAXPROCESSINDEX").val()) + 1));
|
|
return false;
|
|
}
|
|
if (PROCESSINDEX < MAXPROCESSINDEX + 1) {
|
|
MSQ("提示", "该工序顺序已存在,是否确定修改?", function () {
|
|
submitByButton("Save");
|
|
})
|
|
}
|
|
}
|
|
else {
|
|
submitByButton("Save");
|
|
}
|
|
}
|
|
else {
|
|
submitByButton("Save");
|
|
}
|
|
}
|
|
|
|
//清空“工序低储值设置”、“生产最小批次设置”
|
|
function ClearWipSet() {
|
|
$("#MINVALUE").val("");
|
|
$("#PRODUCEMINVALUE").val("");
|
|
}
|
|
</script>
|
|
</asp:Content>
|
|
|