|
|
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; } <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" /> <script src="~/Content/js/select2/select2.min.js"></script> <script> var list = ""; var CERTIFICATETPYECODE = $.request("CERTIFICATETPYECODE"); var ID = $.request("ID"); var WorkPoints = $.request("WorkPoint"); $(function () { debugger; //InitControl1(); //if (CERTIFICATETPYECODE != null && CERTIFICATETPYECODE != "") { $("#sel_WorkPoint").attr("disabled", "disabled"); $("#sel_WorkPoint").val(WorkPoints); $.ajax({ url: "/SRM/RFQAdd/GetWorkPointByUser" + "?" + Math.random(), dataType: "json", async: false, success: function (data) { $("#sel_WorkPoint").val(data.rows[0].F_Location).trigger("change"); } }); //加载物料编码 $.ajax({ url: "/SRM/RFQAdd/GetBidItemCode" + "?" + Math.random() + "&WorkPoint=" + WorkPoints, dataType: "json", async: false, success: function (data) { if (data.BidItemCode != '') { $("#txt_InvCode").val(data.BidItemCode); $("#txtBidCode").attr("disabled", "disabled"); } } });
}) //function InitControl1() { // var $VenCode = $("#sel_WorkPoint"); // $VenCode.select2({ // allowClear: true, // escapeMarkup: function (m) { // return m; // } // }); // $.ajax({ // url: "/SRM/ASNAdd/GetVendors" + "?" + Math.random(), // dataType: "json", // async: false, // success: function (data) { // $.each(data, function (index, item) { // $VenCode.append("<option value='" + item.WorkPointCode + "'> " + item.WorkPointName + "</option>"); // }); // } // }); //}
//保存项目资料 function submitForm() { debugger var CustomerSpecified = ''; var INVCODE = $("#txt_InvCode").val();//编码 var InvName = $("#txt_InvName").val();//名称 var WorkPoint = $("#sel_WorkPoint").children('option:selected').val(); var InvStd = $("#txt_InvStd").val();//规格 var INVUOM = $("#txt_INVUOM").val();//单位 var InvDesc = $("#txt_InvDesc").val();//物料描述 var ManuFacturer = $("#txt_ManuFacturer").val();//制造商 var ManuFacturerInvCode = $("#txt_ManuFacturerInvCode").val();//制造商编码 var YearQty = $("#txt_YearQty").val();//年用量 var ProjectInfo = $("#txt_ProjectInfo").val();//项目信息 var MaterialGrade = $("#txt_MaterialGrade").val();//物料等级 /* var CustomerSpecified = $("#txt_CustomerSpecified").val();//是否为客户指定*/ if (($("#txt_NEW").is(':checked') == true)) { CustomerSpecified = "1"; } else if (($("#txt_NG").is(':checked') == true)) { CustomerSpecified = "0"; } var TechnicalDirector = $("#txt_TechnicalDirector").val();//技术负责人 var arrayData_item = new Array(); if (INVCODE == "" || InvName == "" || InvStd == "" || INVUOM == "" || InvDesc == "" || ManuFacturer == "" || ManuFacturerInvCode == "" || YearQty == "" || ProjectInfo == "" || MaterialGrade == "" || CustomerSpecified == "" || TechnicalDirector == "") { $.modalAlert("必填项不能为空!", "warning") return false; } //提交 //var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 var objs = []; //for (var i = 0; i < ids.length; i++) { var obj = { ID: GUID(), 物料代码: INVCODE, 物料名称: InvName, 预计需求量: null, 物料规格: InvStd, 单位: INVUOM, 物料描述: InvDesc, 制造商: ManuFacturer, 制造商编码: ManuFacturerInvCode, 年用量: YearQty, 项目信息: ProjectInfo, 物料等级: MaterialGrade, 是否为客户指定: CustomerSpecified, 技术负责人: TechnicalDirector, //DeliveryTime: null, Source:"手工",
}; objs.push(obj); //} var obj = { INVCODE: INVCODE, InvName: InvName, WorkPoint: WorkPoint, InvStd:InvStd, INVUOM:INVUOM }; //arrayData_item.push(obj); //$.ajax({ // url: "/SRM/BicDoc_Publish/SubmitICSBicDocAddFCS?" + Math.random(), // param: { keyValue: JSON.stringify(arrayData_item)}, // success: function (data) { //// if (data.msg != "") { // $.modalClose(); //return objs //} // } //}) return objs } function GUID() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); }
</script> <form id="form1"> <div style="padding-top: 10px; margin-left: 50px;"> <table class="form"> <tr> <th class="formTitle"><span style="color: red;">*</span>站点:</th> <td class="formValue"> <input id="sel_WorkPoint" type="text" class="form-control" placeholder="站点" style="width: 327px;"> @*<select id="sel_WorkPoint" name="sel_WorkPoint" class="form-control select2" style="width: 120px" placeholder="请选择站点..."></select>*@ <input type="hidden" id="hidetext" /> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>物料编码:</th> <td class="formValue"> <input id="txt_InvCode" type="text" class="form-control" placeholder="物料编码" style="width: 327px;"> </td> </tr> <tr></tr> <tr> <th class="formTitle"><span style="color: red;">*</span>物料名称:</th> <td class="formValue"> <input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>规格型号:</th> <td class="formValue"> <input id="txt_InvStd" type="text" class="form-control" placeholder="规格型号" style="width: 327px;"> </td> </tr>
<tr> <th class="formTitle"><span style="color: red;">*</span>物料描述:</th> <td class="formValue"> <input id="txt_InvDesc" type="text" class="form-control" placeholder="物料描述" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>制造商:</th> <td class="formValue"> <input id="txt_ManuFacturer" type="text" class="form-control" placeholder="制造商" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>制造商料号:</th> <td class="formValue"> <input id="txt_ManuFacturerInvCode" type="text" class="form-control" placeholder="制造商料号" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>单位:</th> <td class="formValue"> <input id="txt_INVUOM" type="text" class="form-control" placeholder="单位" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>年用量:</th> <td class="formValue"> <input id="txt_YearQty" type="text" class="form-control" placeholder="年用量" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>项目信息:</th> <td class="formValue"> <input id="txt_ProjectInfo" type="text" class="form-control" placeholder="项目信息" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>物料等级:</th> <td class="formValue"> <input id="txt_MaterialGrade" type="text" class="form-control" placeholder="物料等级" style="width: 327px;"> </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>是否为客户指定:</th> <td class="formValue"> <input type="radio" id="txt_NEW" name="checkbox" style="width:30px;margin-left:1%">是 <input type="radio" id="txt_NG" name="checkbox" style="width:30px;margin-left:1%">否 </td> </tr> <tr> <th class="formTitle"><span style="color: red;">*</span>技术负责人:</th> <td class="formValue"> <input id="txt_TechnicalDirector" type="text" class="form-control" placeholder="技术负责人" style="width: 327px;"> </td> </tr> </table> </div> </form>
|