123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>CheckProjectType</title>
- <link href="~/easyui/themes/default/easyui.css" rel="stylesheet" />
- <link href="~/easyui/themes/icon.css" rel="stylesheet" />
- <link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
- <link href="~/Content/js/plugins/layer/skin/layer.css" rel="stylesheet" />
- <script src="~/Content/js/jquery.min.js"></script>
- <script src="~/Content/js/bootstrap.min.js"></script>
- <script src="~/easyui/jquery.easyui.min.js"></script>
- <script src="~/easyui/jquery.easyui.mobile.js"></script>
- <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
- <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
- <script src="~/Content/js/plugins/layer/layer.min.js"></script>
- <script src="~/js/Utils.js"></script>
- <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
- @*<script src="~/Content/js/js/MarketJs.js"></script>*@
- <style>
- .td_1 {
- padding-bottom: 5px;
- padding-left: 5px;
- }
- </style>
- </head>
- <body>
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
- <input id="hid_IsLock" name="IsLock" type="hidden" value="N" />
- </section>
-
- <section class="container-fluid" style="height: 100vh; padding-top: 20px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar">
- <label>
- <input type="checkbox" id="DataToggle"> 显示已删除记录
- </label>
- </div>
- <div class="toolbar" id="CurdTool" style="float:left">
- <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-no" plain="true" onclick="DelOrRetore('Del')">删除</a>
- </div>
- <div class="col-sm-3" id="ResetTool">
- <a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="DelOrRetore('ReDel')">恢复删除</a>
- </div>
- </div>
- <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- toolbar: '#tbToolBar',
- fitColumns: true,
- remoteSort: false,
- loadFilter: pagerFilter,
- rownumbers: true,
- pagination: true,
- pageSize: 50,
- pageList: [15, 25, 50, 100]
- ">
- <thead>
- <tr>
- @*<th data-options="field:'CheckMethodId',width:150">检测方法编号</th>*@
- <th data-options="field:'CheckMethodName',width:150">检测方法名称</th>
- <th data-options="field:'Sort',width:60">排序值</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winCheckMethodInfo" class="easyui-window" title="检测方法信息维护" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:600px;height:350px;padding:10px 10px;">
- <div class="easyui-layout" data-options="fit:true">
- <div data-options="region:'center'" style="padding:5px;height:250px">
- <table cellpadding="10" cellspacing="0" style="margin-left:10px">
- <tr style="display: none">
- <td class="td_1">检测方法编号:</td>
- <td class="td_1">
- <input class="easyui-textbox" type="text" id="CheckMethodId" name="CheckMethodId" style="width:400px" readonly="readonly" />
- </td>
- </tr>
- <tr>
- <td class="td_1">检测方法名称:</td>
- <td class="td_1">
- <input class="easyui-textbox" type="text" id="CheckMethodName" name="CheckMethodName" data-options="required:true,min:0,precision:2" style="width:400px" />
- </td>
- </tr>
- <tr>
- <td class="td_1">排序值:</td>
- <td class="td_1">
- <input class="easyui-numberbox" type="text" id="Sort" name="Sort" data-options="required:true" style="width:400px" />
- </td>
- </tr>
- <tr>
- <td class="td_1">备注:</td>
- <td class="td_1">
- <input class="easyui-textbox" type="text" id="Remark" name="Remark" style="width:400px" />
- </td>
- </tr>
- </table>
- </div>
- <div data-options="region:'south',border:false" style="text-align:right;height:50px;padding-top:5px">
- <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save();" style="width:80px">确认</a>
- <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winCheckMethodInfo').window('close');" style="width:80px">取消</a>
- </div>
- </div>
- </div>
- </section>
- <script>
- //切换显示不同状态数据
- $("#DataToggle").on("click",
- function () {
- if ($('#hid_IsLock').val() === "N") {
- $('#hid_IsLock').val("Y");
- $("#CurdTool").hide();
- $("#ResetTool").show();
- } else {
- $('#hid_IsLock').val("N");
- $("#ResetTool").hide();
- $("#CurdTool").show();
- }
- window.LoadTable();
- });
- //添加
- function btn_Add() {
- $("#hid_Type").val("Add");
- $("#CheckMethodId").textbox("setValue", "");
- $("#CheckMethodName").textbox("setValue", "");
- $("#Sort").numberbox("setValue", "");
- $("#Remark").textbox("setValue", "");
- $('#winCheckMethodInfo').window('open');
- }
- //修改
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- var row = $('#dgTable').datagrid('getSelected');
- if (row) {
- console.log(row);
- //var row = rows[0];
-
- $("#CheckMethodId").textbox("setValue", row.CheckMethodId);
- $("#CheckMethodName").textbox("setValue", row.CheckMethodName);
- $("#Sort").numberbox("setValue", row.Sort);
- $("#Remark").textbox("setValue", row.Remark);
- $('#winCheckMethodInfo').window('open');
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- function DelOrRetore(type) {
- var checkMethodId = $('#dgTable').datagrid('getSelections')[0].CheckMethodId;
- if (!checkMethodId) {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- return;
- }
- if (type === 'Del' || type === "ReDel" ) {
- $.messager.confirm('删除或恢复', '确定删除或恢复这条记录?', function (r) {
- if (r) {
- $.ajax({
- url: "@Url.Action("CheckMethondsOper", "BaseInfo")",
- type: "post",
- data: {
- Type: type,
- CheckMethodId: checkMethodId
- },
- success: function (data) {
- if (CheckAajxData(data) == false) {
- return;
- }
- var msg = JSON.parse(data);
- if (msg != null && msg.Success == true) {
- LoadTable();
- layer.alert("操作成功!", { title: '提示信息' });
- } else {
- layer.alert(msg.ErrorInfo, { title: '提示信息' });
- }
- }
- });
- }
- })
- }
- }
- //提交
- function Save(type) {
- type = type || $("#hid_Type").val();
- if (isNaN($("#Sort").numberbox('getValue'))) {
- layer.alert('标准值必须为数字!', { title: '提示信息' });
- return;
- }
- var checkMethodId = type === "Edit" ? $('#dgTable').datagrid('getSelections')[0].CheckMethodId : '';
- $.ajax({
- url: "@Url.Action("CheckMethondsOper", "BaseInfo")",
- type: "post",
- data: {
- Type: type,
- CheckMethodName: $("#CheckMethodName").textbox('getValue'),
- Sort: $("#Sort").numberbox('getValue'),
- Remark: $("#Remark").textbox("getValue"),
- CheckMethodId: checkMethodId
- },
- success: function (data) {
- if (CheckAajxData(data) == false) {
- return;
- }
- var msg = JSON.parse(data);
- if (msg != null && msg.Success == true) {
- LoadTable();
- $('#winCheckMethodInfo').window('close');
- layer.alert("操作成功!", { title: '提示信息' });
- } else {
- layer.alert(msg.ErrorInfo, { title: '提示信息' });
- }
- }
- });
- }
-
- //加载表格数据
- function LoadTable() {
- $('#dgTable').datagrid({
- url: '@Url.Action("CheckMethondsList", "BaseInfo")' + '?IsLock=' + $('#hid_IsLock').val(),
- onDblClickRow: function () {
- if ($('#hid_IsLock').val() === "N") {
- btn_Edit();
- }
- },
- });
- }
- $(function () {
- //加载表格数据
- window.LoadTable();
-
- //加载日历控件
- //laydate({
- // elem: '#PractiseTime',
- // format: "YYYY-MM-DD",
- // min: "1980-01-01",
- // event: "focus"
- //});
- });
- </script>
- </body>
- </html>
|