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

137 lines
5.2 KiB

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.MD.Web.Models.UserWithMachineModel>" %>
<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.USERID)%>
</th>
<td>
<%=Html.QC(p => p.USERID)%>
</td>
</tr>
<tr>
</tr>
</table>
</td>
</tr>
</table>
<table id="QDateGrid">
</table>
<%=Html.HiddenFor(p => p.MachineIds)%>
<%=Html.Hidden("EDITFLAG",0)%>
<%=Html.QPEnd() %>
<script language="javascript" type="text/javascript">
$(function () {
$('#USERID').combobox({
url: "/Dict/GetUserComboxSourceForEdit",
editable: 'false',
});
//画表格
$('#QDateGrid').datagrid({
width: 350,
height: 300,
fit: true,
nowrap: false,
striped: true,
collapsible: false,
pagination: true,
rownumbers: false,
remoteSort: false,
idField: 'MACHINEID',
columns: [[
{field : 'ck',checkbox : true},
{ field: 'MACHINECODDE', title: '设备编码', align: 'center', width: 150 },
{ field: 'MACHINENAME', title: '设备名称', align: 'center', width: 180 },
{ field: 'MACHINEID', title: '设备主键', align: 'center', width: 150, hidden: true }
]]
//**********************************************
});
//***************获取设备信息
$('#QDateGrid').datagrid("loadData", new Array());
var dataInfo = $('#QDateGrid').datagrid('getData');
//*********************************************
$.ajax({
url: "/UserWithMachine/GetMachineInfoList",
type: "POST",
cache: false,
dataType: "json",
async: false,
success: function (data) {
if (data == null || data == '') {
//alert("!");
MSI("提示", "未查到数据!")
}
else {
for (var i = 0; i < data.total; i++) {
var insertInfo = {
MACHINECODDE: data.rows[i].MACHINECODDE,
MACHINENAME: data.rows[i].MACHINENAME,
MACHINEID: data.rows[i].PID
};
dataInfo.rows.push(insertInfo);
}
$('#QDateGrid').datagrid('loadData', dataInfo);
}
}
});
//*************获取设备信息结束******************
});
//********************保存设备信息******************************************
function SaveUserWithMachine() {
if (isValidate() == false) {
return false;
}
//用户id(名称)
var userid = $('#USERID').combobox('getValue');
//Grid表信息
var post= $('#QDateGrid').datagrid('getSelections');
//当Grid表存在信息时
var i=post;
if (post.length>0) {
var materialID = "";
for (var i = 0; i < post.length; i++)
{
var materialDetail = post[i];
materialID = materialID + ";" + materialDetail.MACHINEID;
}
//将设备id存到字符串中
//$("#EDITFLAG").val("1");
$('#MachineIds').val(materialID.substring(1));
submitByButton("UserWithMachineSave");
}
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", "Save", "return SaveUserWithMachine();")%>
<%=Html.QTButtonBack("close", "DashBoardPlanList", "parent.closeAppWindow1();return false;")%>
</td>
</tr>
</table>
</asp:Content>