123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- var g;
- //列表加载参数
- var loadParams = {
- "listId" : '361',
- "condition" : 'IS_DEL=0'
- };
- //初始化列表
- function initComplete(){
-
- g = $("#maingrid").quiGrid({
- columns: [
- { name: 'FD_OBJECTID361', hide : true},
- { display: '部门', name: 'DEPT_361',align: 'center', width: "20%"},
- { display: '交班人', name: 'RELIEVED_MAN_361',align: 'center', width: "20%"},
- { display: '接班人', name: 'SUCCEED_MAN_361', align: 'center', width: "20%" },
- { display: '交接班时间', name: 'RELIEVED_TIME_361',align: 'center', width: "20%" },
- { display: '状态', name: 'DAILY_STATE_361',align: 'center', width: "20%" }
- ],
- url :$.pathname() + '/ws/crud/CRUDService/queryQui',
- params : loadParams,
- sortName : 'FD_OBJECTID361',
- sortOrder : 'desc nulls last',
- rownumbers:true,
- checkbox:true,
- height: '100%',
- width:"100%",
- pageSize: 10,
- percentWidthMode:true,
- //顶部图标按钮栏
- toolbar:
- {
- items: [
- { text: '新增', click: onAdd, iconClass: 'icon_add', disabled: false },
- { line: true },
- { text: '详细信息', click: onView, iconClass: 'icon_view', disabled: false },
- { line: true },
- { text: '删除', click: onDelete, iconClass: 'icon_delete', disabled: false },
- { line: true },
- { text: '修改', click: onEdit, iconClass: 'icon_edit', disabled: false },
- { line: true },
- { text: '发布', click: onRelease, iconClass: 'icon_release', disabled: false },
- { line: true }
- ]
- }
- });
-
- $("#searchPanel").bind("stateChange",function(e,state){
- g.resetHeight();
- });
- }
- function searchHandler(){
- var search = $('#RELIEVED_MAN_361').val();
- var condition = "IS_DEL=0";
- if(search!=""){
- condition += " AND RELIEVED_MAN LIKE '%" +search+"%'";
- }
- g.setOptions({//重置加载列表的参数
- params : {
- "listId" :'361' ,
- "condition" : condition
- }
- });
- g.setNewPage(1);
- g.loadData();//刷新列表
- }
- //详细信息
- function onView(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID361;
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_info.jsp?"+fd_id;
- }
- //修改
- function onEdit(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID361;
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_update.jsp?"+fd_id;
- }
- //新增
- function onAdd(){
- //获取iframe中的元素值
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_add.jsp";
- }
- //删除
- function onDelete(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID361 + ",";
- }
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 361
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("删除成功",null,null,null,1);
- // 刷新表格数据
- g.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
- });
- }
- //发布
- function onRelease(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID361;
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_release.jsp?"+fd_id;
- }
-
- $.messager=top.Dialog;
- //刷新表格 表单提交的回调
- function afterFormSubmit(){
- g.loadData();
- }
-
|