实现选择机种后获取机种绑定的点检项目值,替换相同点检项目的点检值
效果
页面代码
@model SpotCheckInfo
@{
ViewBag.Menu = "保养校验-设备点检-点检数据录入";
}
<div class="banner-title">
@ViewBag.Menu
</div>
@using (Html.BeginForm("PointDataEntry", Html.ControllerName()))
{
<div>
<div class="content-body">
<table class="table">
<tbody>
<tr>
<td style="text-align:right"> @Html.LabelFor(m => m.LineName):</td>
<td>
@(Html.Kendo().DropDownListFor(m => m.LineName)
.DataTextField("Text")
.DataValueField("Value")
.DataSource(ds => ds
.Read(read => read.Action("GetLines", "MeasPoint").Type(HttpVerbs.Post))
)
.HtmlAttributes(new { style = "width: 88%" })
.Filter("contains")
.OptionLabel(Resource.请选择)
)
@Html.ValidationMessageFor(m => m.LineName)
<label style="color:red">*</label>
</td>
<td style="text-align:right">@Html.LabelFor(m => m.WorkCenter):</td>
<td>
@(Html.Kendo().DropDownListFor(m => m.WorkCenter)
.DataTextField("Text")
.DataValueField("Value")
.DataSource(ds => ds
.Read(read => read.Action("GetWC", "MachineManage").Type(HttpVerbs.Post))
)
.HtmlAttributes(new { style = "width: 88%" })
.Filter("contains")
.OptionLabel(Resource.请选择)
)
@Html.ValidationMessageFor(m => m.WorkCenter)
<label style="color:red">*</label>
</td>
<td style="text-align:right">@Html.LabelFor(m => m.MachineCode):</td>
<td>
@Html.Kendo().TextBoxFor(m => m.MachineName)
@Html.ValidationMessageFor(m => m.MachineName)
<label style="color:red">*</label>
</td>
@*<td class="table-dataCol">
@(Html.Kendo().DropDownListFor(m => m.MachineName)
.DataTextField("Text")
.DataValueField("Value")
.DataSource(dataSource => dataSource
.Read(read => read.Action("GetDJMachineList", Html.ControllerName()).Type(HttpVerbs.Post).Data(""))
).Value(Model.Machine_Id.ToString())
.Events(e => e.DataBound("changeMachineName"))
.HtmlAttributes(new { style = "width: 90%" })
)
@Html.ValidationMessageFor(m => m.MachineName)
<label style="color:red">*</label>
</td>*@
</tr>
<tr>
<td style="text-align:right">@Html.LabelFor(m => m.ModelName):</td>
<td>
@(Html.Kendo().DropDownListFor(m => m.ModelName)
.DataTextField("Text")
.DataValueField("Value")
.DataSource(ds => ds
.Read(read => read.Action("GetParam", "ESDStandard").Type(HttpVerbs.Post).Data("getParam('Product')"))
)
.HtmlAttributes(new { style = "width: 88%" })
.Filter("contains")
.OptionLabel(Resource.请选择)
)
<label style="color:white">*</label>
</td>
<td style="text-align:right">@Html.LabelFor(m => m.TerminalName):</td>
<td>
@(Html.Kendo().DropDownListFor(m => m.TerminalName)
.DataTextField("Text")
.DataValueField("Value")
.DataSource(ds => ds
.Read(read => read.Action("GetParam", "ESDStandard").Type(HttpVerbs.Post).Data("getParam('Terminal')"))
)
.HtmlAttributes(new { style = "width: 88%" })
.Filter("contains")
.OptionLabel(Resource.请选择)
)
<label style="color:white">*</label>
</td>
<td style="text-align:right">@Html.LabelFor(m => m.FilesName):</td>
<td>
<div class="demo-section k-content">
<input name="files" id="files" type="file" />
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="editObtSpot">
<div style="text-align:right;">
<button type="button" class="k-button k-primary" style="width: 120px;" onclick="sub()">获取点检项目</button>
</div>
@(Html.Kendo().Grid<EMS.Models.SpotCheckInfo>()
.Name("grid_Spot")
.Columns(columns =>
{
//columns.Bound(c => c.WorkCenter).Width(120);
columns.Bound(c => c.LineName).Width(80).Hidden(true);
columns.Bound(c => c.MachineCode).Width(80);
columns.Bound(c => c.MachineName).Width(80);
columns.Bound(c => c.OperationName).Width(100);
columns.Bound(c => c.Unit).Width(40);
columns.Bound(c => c.StdRange).Width(120); //标准范围
columns.Bound(c => c.CHECK_VALUE).ClientTemplate("#= operation(Id,OperationAction) #").Width(40).Filterable(false);
// columns.Bound(x =>