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.
182 lines
5.9 KiB
182 lines
5.9 KiB
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Form.cshtml";
|
|
}
|
|
<style>
|
|
#ISO {
|
|
width: 10px;
|
|
}
|
|
</style>
|
|
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
|
|
<script src="~/Content/js/select2/select2.min.js"></script>
|
|
<script>
|
|
var ID = $.request("ID");
|
|
var MouldCode = $.request("MouldCode");
|
|
//var WarehouseName = decodeURI($.getUrlParam("WarehouseName"));
|
|
var MouldCode = $.request("MouldCode");
|
|
var Describe = $.request("Describe");
|
|
var MouldName = decodeURI($.request("MouldName"));
|
|
var PicturePath = "";
|
|
$(function () {
|
|
debugger;
|
|
InitControl();
|
|
InitControl1();
|
|
if (ID != "") {
|
|
$("#sel_MouldCode").val([MouldCode]).trigger("change");
|
|
$("#MouldName").val(MouldName);
|
|
|
|
$("#Describe").val(Describe);
|
|
|
|
$("#MouldCode").val(MouldCode);
|
|
}
|
|
});
|
|
$.getUrlParam = function (name) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (r != null) return unescape(r[2]); return null;
|
|
}
|
|
;
|
|
|
|
function InitControl() {
|
|
debugger;
|
|
var $VenCode = $("#sel_MouldCode");
|
|
$VenCode.select2({
|
|
allowClear: true,
|
|
escapeMarkup: function (m) {
|
|
return m;
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/Boxes/BasicSettings/GetMouldCode" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$.each(data, function (index, item) {
|
|
$VenCode.append("<option value='" + item.MouldCode + "'>" + item.MouldCode + "</option>");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function InitControl1() {
|
|
debugger;
|
|
var $VenCode = $("#sel_MajorStates");
|
|
$VenCode.select2({
|
|
allowClear: true,
|
|
escapeMarkup: function (m) {
|
|
return m;
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/Boxes/BasicSettings/GetType?tableName=" + "ICSMouldLog" +"&" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$.each(data, function (index, item) {
|
|
$VenCode.append("<option value='" + item.TypeName + "'>" + item.TypeName + "</option>");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function submitForm() {
|
|
var MouldCode = $("#MouldCode").val();//模具代码
|
|
var MouldCode = $("#sel_MouldCode").find("option:selected").text();//模具编码
|
|
var Status = $("#sel_MajorStates").find("option:selected").text();//状态
|
|
var MouldName = $("#MouldName").val();//模具名称
|
|
var Describe = $("#Describe").val();//模具描述
|
|
if (MouldCode == "" || MouldCode == undefined) {
|
|
$.modalAlertNew("WMS00113");
|
|
return;
|
|
}
|
|
if (MouldCode == "" || MouldCode == undefined) {
|
|
$.modalAlertNew("WMS00114");
|
|
return;
|
|
}
|
|
if (MouldName == "" || MouldName == undefined) {
|
|
$.modalAlertNew("WMS00115");
|
|
return;
|
|
}
|
|
var objArr = {
|
|
ID: ID,
|
|
MouldCode: MouldCode,
|
|
MouldCode: MouldCode,
|
|
MouldName: MouldName,
|
|
Status: Status,
|
|
Describe: Describe
|
|
}
|
|
debugger;
|
|
if (ID != "") {
|
|
$.submitForm({
|
|
url: "/Boxes/BasicSettings/UpdateMouldStatus" + "?" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
} else {
|
|
$.submitForm({
|
|
url: "/Boxes/BasicSettings/InsertMouldAccount" + "?" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
//导入
|
|
function btn_Introduction() {
|
|
debugger;
|
|
$("#FileUp").click();
|
|
}
|
|
|
|
function btnUpLoad(up) {
|
|
var form = new FormData(document.getElementById("form1"));
|
|
$.ajax({
|
|
url: "/Boxes/BasicSettings/UpLoadFileImport?" + Math.random(),
|
|
type: "post",
|
|
data: form,
|
|
contentType: false,
|
|
processData: false,
|
|
success: function (data) {
|
|
if (data!="") {
|
|
alert("上传成功");
|
|
PicturePath = data.data;
|
|
}
|
|
},
|
|
error: function (aa) {
|
|
alert("上传失败:" + aa);
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<form id="form1">
|
|
<div style="padding-top: 50px; margin-right: 50px;">
|
|
<table class="form">
|
|
<tr>
|
|
<th class="formTitle">模具代码:</th>
|
|
<td style="width:150px">
|
|
<select id="sel_MouldCode" name="sel_MouldCode" class="form-control select2" style="width: 135px; height: 25px;" placeholder="模具代码" disabled></select>
|
|
<input type="hidden" id="hidetext" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">名称:</th>
|
|
<td class="formValue">
|
|
<input id="MouldName" name="MouldName" type="text" class="form-control required" maxlength="10" placeholder="名称" disabled/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">状态:</th>
|
|
<td class="formValue">
|
|
<select id="sel_MajorStates" name="sel_MajorStates" class="form-control select2" style="width: 135px; height: 25px;" placeholder="状态"></select>
|
|
<input type="hidden" id="hidetext" />
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</form>
|