在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
效果图
数据库代码
create database CardManage use CardManage create table CardManage ( ID int identity(1,1) primary key, userDep nvarchar(10)not null, userName nvarchar(5)not null, userTel varchar(11)not null, carNum nvarchar(20)not null, fixedCarport nvarchar(20)null, ) insert CardManage values('研发部','小明','13527748096','洒B13580','博士二二二二') insert CardManage values('研发部','小仝','13527748096','洒B13580','博士二二二二') insert CardManage values('酱油部','小华','13527748096','洒B13580','博士二二二二') truncate table CardManage select*from CardManage --第二个表不清楚字段 和名字 我看文档那里有猜的 -- 确定再加上去 create table projectManage ( ID int identity primary key not null, projectName nvarchar(20)not null, manager_1 nvarchar(10) not null, manager_2 nvarchar(10) not null, monitor nvarchar(10) not null, isFire varchar(2) null , startTime datetime not null, endTime datetime not null, manager_1tel nvarchar(11) not null, manager_1company nvarchar(20) not null, manager_2tel nvarchar(11) not null, manager_2company nvarchar(20) not null, monitortel nvarchar(11) not null, monitorcompany nvarchar(20) not null ) select *from projectManage insert projectManage values('装机','小明','大明','工程监理','是','1990-9-9','2000-9-9','13527748096','13527748096','13527748096','13527748096','13527748096','13527748096') create proc a as truncate table CardManage go 车辆管理视图代码 @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <link href="~/Scripts/eastui/themes/icon.css" rel="stylesheet" /> <link href="~/Scripts/eastui/themes/default/easyui.css" rel="stylesheet" /> <script src="~/Scripts/eastui/jquery.min.js"></script> <script src="~/Scripts/eastui/jquery.easyui.min.js"></script> <script type="text/javascript"> $(function () { f(); }) function f() { $('#carportList').datagrid({ url: '../Che/select',//控制器/方法 pagination: true, pageSize: 10, //每页记录数 pageNumber: 1, //默认显示第几页 pageList: [10, 15, 20], //分页记录数数组 //singleSelect: true, rownumbers: true, //toolbar: "#toolbar", idField: 'ID', frozenColumns: [[ { field: 'ck', checkbox: true }, //{ title: '全选', field: 'EmpID', width: 80, sortable: true } ]], toolbar: [{ id: 'btnadd', text: '添加', iconCls: 'icon-add', handler: function () { $('#add_name').val(null);//清空文本框 $('#add_tel').val(null); $('#add_carNum').val(null); $('#add_dep').val(null); $('#add_fixedCarport').val(function () { var a = null }); $('#addCarWin').window('open'); } }, { text: '删除', id: 'btn_admin_del', iconCls: 'icon-cut', handler: function () { del(); }, }, { text: 'excel导出', id: 'excelout', handler: function () { window.open('/Che/ExportExcel'); } }, { text: 'npoi导出', id: 'npoiout', handler: function () { window.open('/Che/npoiout') } } ], columns: [[ { field: 'userName', title: '姓名', width: 80, align: 'center' }, { field: 'userTel', title: '联系电话', width: 100, align: 'center' }, { field: 'carNum', title: '车牌号码', width: 100, align: 'center' }, { field: 'userDep', title: '部门', width: 100, align: 'center' }, { field: 'fixedCarport', title: '固定车位', width: 150, align: 'center' }, { field: 'operation', width: 100, title: '操作', align: 'center', formatter: function (value, row, index) { return "<input id='delCarport' href='javascript:void(0)' type='button' value='删除' onclick='Detailed();' \>" } } ]] }); var p = $('#carportList').datagrid('getPager'); $(p).pagination({ beforePageText: '第',//页数文本框前显示的汉字 afterPageText: '页 共 {pages} 页', displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录' }); // 初始化添加车位信息窗口 $("#addCarWin").window({ title: '添加车位信息', iconCls: 'icon-add', width: 'auto', height: 'auto', top: 100, modal: true, shadow: false, closed: true, maximizable: false, minimizable: false, resizable: false, draggable: false }); } //添加 function save() { $('#fm_add').form("submit", { url: '/Che/insert', onSubmit: function () { return $(this).form("validate"); //提交前验证 }, success: function (result) { if (result == "1") { $('#addCarWin').dialog('close'); $.messager.alert("提示", "保存成功") $('#carportList').datagrid('load', {}) } else { $.messager.alert("提示", "失败"); } } }) } //搜索 function sele() { var name = $('#s_name').val(); var carnum = $('#s_carNum').val(); var scar = $('#s_carport').val(); $('#carportList').datagrid('load', { name: name, carnum: carnum, scar: scar }); }; //删除 function Detailed() { var row = $('#carportList').datagrid('getSelected'); var ID = row.ID; var userName = row.userName; $.messager.confirm('提示', '是否删除' + row.userName + '相关信息?', function (r) { if (!r) { return; } $.ajax({ type: 'post', url: "/Che/del", data: { id: ID }, success: function (msg) { if (msg.IsSuccess) { $.messager.alert('提示', '删除成功!', 'info', function () { $('#carportList').datagrid("reload"); $( 全部评论
专题导读
热门推荐
热门话题
阅读排行榜
|
请发表评论