123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>应急预警值班安排表填报</title>
- <!--引入QUI框架js -->
- <%@include file="../../response/duty/need.jsp"%>
- <script type="text/javascript" src="<%=path%>/scripts/setiframeheight.js" ></script>
- <script type="text/javascript" src="<%=path%>/scripts/business/am/org/maintenance/orgSel.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/system/invoking/invoking.js"></script>
- <script>
- //取得用户真实姓名
- var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //部门名称
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- var corpName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var flag=false;
- var isNew=false; //是否是新增记录
- var editingRow; // 双击的当前编辑行
- var isValida=true; //是否需要验证
-
- var duty;
- var g;
- var dutyData={"list":[{"value":"0","key":"08:00-20:00"},{"value":"1","key":"20:00-08:00"}]};
- var departNode;
- var duty_man;
- var newrowid=200;
-
- //获得值班领导姓名
- function getZhiBanMan() {
- //alert("leida======"+companyId_Name);
- var urls = $.pathname() + '/ws/bgd_duty/BgdDutyService/getlei_ZhiBan_Man1';
-
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- deptId : deptId
- },
- dataType : 'json',
- success : function(data) {
- duty_man1 = data;
- },
- error : function(e) {
- alert("获取数据失败!!!!");
- }
- });
-
- }
- //选择值班成员
- function getZhiBanMan1() {
- //alert("leida======"+companyId_Name);
- var urls = $.pathname() + '/ws/bgd_duty/BgdDutyService/getlei_ZhiBan_Man';
-
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- deptId : deptId
- },
- dataType : 'json',
- success : function(data) {
- duty_man = data;
- },
- error : function(e) {
- alert("获取数据失败!!!!");
- }
- });
-
- }
-
- function initComplete(){
- getZhiBanMan1();
- getZhiBanMan();
- initGrid();
- $("#import_gpsUser").bind('click',function(){
- submitInfo();
- })
- var AUrl = $.pathname() + "/ws/crud/CRUDService/queryQui/";
- var Aparams = {
- listId : "365",
- condition : " IS_DEL ='0' AND IS_ALERT='0' and IS_SEND='5' and EARLY_WARNING_PROPERTY != '51' and WRITE_DEPT ='"+CorpArea+"'"
- };
- var Alist = [];
- $.post(AUrl, Aparams, function(result) {
- for (var i = 0; i < result.rows.length; i++) {
-
- var Akey = result.rows[i].EARLY_WARNING_ID_365;
- var val = result.rows[i].FD_OBJECTID365
- Alist.push({
- "value" : val,
- "key" : Akey
- })
-
- }
- var selData = {
- "list" : Alist
- };
- if(selData.list.length == 0){
- top.Dialog.alert("本单位没有已发布的预警通知单!不能选择预警编号!");
- }
- // 赋给data
- $("#name_id").data("data", selData);
- $("#name_id").render();
- }, "json");
-
- // $("#name_id").initYewuSelect("365","FD_OBJECTID","EARLY_WARNING_ID","is_del='0' and IS_ALERT = '0' and IS_SEND='5' and EARLY_WARNING_PROPERTY!='51' and WRITE_DEPT='"+deptId+"'"); //需求名称
- $("#name_id").bind("change",function(){
- var tm = $(this).attr("relText");
- if(tm == "请选择"){
- return;
- }
- var taskName = tm+"_"+corpName+"_"+getNowFormatDate1();
- $("#name").val(taskName);
- $("#name2").val(taskName);
- });
- $("#oper_name").html(realname);
- $("#opernames").val(realname);
- $("#dept_names").html(deptName);//显示
- $("#deptnames").val(deptId);//保存
-
- $("#oper_dept").val(CorpArea);
- $("#oper_dept_show").html(corpName);
-
- // var deptUrl = $.pathname() + '/ws/dept/DeptService/getDepartTree';
- // $.post(deptUrl,{id:parentId,name:''},function(data){
- // $("#oper_dept").data("data",data);
- // $("#oper_dept").render();
- // }, "json");
- //默认选中登录人所属部门
-
- //$('#oper_dept').attr('selectedValue',dpids);
-
- $("#INPUT_NAME_ID_335").val(userId);
-
- var url = $.pathname() + "/ws/sys/constantService/getQuiConstantByName/";
- var obj = this;
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- async:false,
- data: {
- "name" : 'BM_DUTYTIME'
- },
- dataType : 'json',
- success : function(data){
- $('#duty_time').data("data",data);
- $('#duty_time').render();
- },
- error : function(e){
- top.Dialog.alert("系统错误!");
- }
- })
- /* $.post(url,{
- "name" : 'BM_DUTYTIME'
- },function(result){
- alert(JSON.stringify(result))
- $('#duty_time').data("data",result);
- $('#duty_time').render();
- },"json"); */
- var myDate = getNowFormatDate();
- $("#oper_time").html(myDate);
- $("#opertimes").val(myDate);
- /* $("body").eq(0).showLoading(); */
- var uls=$.pathname() + '/ws/duty/DutyRecordsService/getDutyZHIBAN';
- var num = $('#duty_time').attr("relvalue");
- $.ajax({
- url : uls,
- type : 'post',
- timeout : 15000,
- data: {
- num : num,
- dept:deptName,
- deptid:deptId
- },
- async:false,
- dataType : 'json',
- success : function(data){
- /* $("body").eq(0).hideLoading(); */
- duty=data;
- initGrid();
- // g.setOptions({data:data});
- },
- error : function(e){
- top.Dialog.alert("系统错误!");
- }
- })
-
- $("#duty_time").bind("change",function(){
- var num = $(this).attr("relvalue");
- var uls=$.pathname() + '/ws/duty/DutyRecordsService/getDutyZHIBAN';
- $.ajax({
- url : uls,
- type : 'post',
- timeout : 15000,
- data: {
- num : num,
- dept:deptName,
- deptid:deptId
- },
- dataType : 'json',
- success : function(data){
- duty=data;
- initGrid();
-
- },
- error : function(e){
- top.Dialog.alert("系统错误!");
- }
- })
- })
- //initGrid();
-
- //getZhiBanMan();
- }
- //获得当前系统时间(年月日)
- function getNowFormatDate1(){
- var s="";
- var d = allGetServerTime();
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- // var h = d.getHours();
- // var m = d.getMinutes();
- s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay);
- return s;
- }
- function getNowFormatDate() {
-
- var date = allGetServerTime();
- var seperator1 = "-";
- var seperator2 = ":";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- var hour=date.getHours();
- var minu=date.getMinutes();
- var sec=date.getSeconds();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- if(hour>=0 && hour<=9){
- hour="0"+hour;
- }
- if(minu>=0 && minu<=9){
- minu="0"+minu;
- }
- if(sec>=0 && sec<=9){
- sec="0"+sec;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate
- + " " + hour + seperator2 + minu;
- return currentdate;
- }
- function getNoteTime(){
- var date = allGetServerTime();
- var seperator1 = "-";
- var seperator2 = ":";
-
- var hour=date.getHours();
- var minu=date.getMinutes();
- var sec=date.getSeconds();
-
- if(hour>=0 && hour<=9){
- hour="0"+hour;
- }
- if(minu>=0 && minu<=9){
- minu="0"+minu;
- }
- if(sec>=0 && sec<=9){
- sec="0"+sec;
- }
-
- var currentdate = hour + seperator2 + minu
- + seperator2 + sec;
- return currentdate;
-
- }
- //选择值班领导带出电话
- // $(".l-grid-body2 .l-grid-row .l-grid-row-cell:eq(2)").find("select").live("change",function()
- $(".l-grid-body2 .l-grid-row").find(".l-grid-row-cell select:eq(1)").live("change",function(i){//申请单位联系人的绑定事件
- var userId = $(this).data("selectedNode").userid;
- if(userId!=''){
- $.ajax({
- url : $.pathname() + '/ws/getPhone/BGDPhoneDUtyUser/getPhoneNoByDUtyUserId',
- type : 'post',
- //async : false,
- timeout : 15000,
- data: {
- userId : userId
- },
- dataType : 'json',
- success : function(result){
- $(".l-grid-body2 .l-grid-row .l-grid-row-cell input:eq(6)").val(result);
- },
- error : function(e){
- top.Dialog.alert("系统错误!");
- }
- });
- };
- });
- function getNowDate(){
- var date = allGetServerTime();
- var seperator1 = "-";
- var seperator2 = ":";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate;
- return currentdate;
-
- }
-
- function initGrid(){
- g = $("#maingrid").quiGrid({
- columns: [
-
- { display: '日期', name: 'day_time', align: 'center', width: "16%",editor: { type: 'date',dateFmt:'yyyy-MM-dd' }},
- { display: '时间段', name: 'date_time', align: 'center', width: "16%",editor: { type: 'select',data:dutyData,selWidth:145 },render:function (item){
- for (var i = 0; i < dutyData["list"].length; i++)
- {
- if (dutyData["list"][i]['value'] == item.date_time)
- return dutyData["list"][i]['key']
- }
- return item.date_time;
- }},
- { display: '部门', name: 'duty_dept', align: 'center', width: "16%",editor: { type : 'text'}},
- { display: '值班人员姓名', name: 'duty_name', align: 'center', width: "16%",editor: { type : 'select',data : duty_man,selWidth : 145}},
- { display: '手机', name: 'duty_name_tel', align: 'center', width: "16%",editor: { type: 'text',inputMode:'numberOnly'}},
- { display: '操作', isSort: false, width: "16%", render: function (rowdata, rowindex, value)
- {
- var h = "";
- if (!rowdata._editing)
- {
- flag=false;
- h += "<a onclick='onDelete(" + rowindex + ")'><span class='icon_delete'>删除</span></a> ";
- }
- else
- {
- flag=true;
- h += "<a onclick='endEdit(" + rowindex + ")'><span class='icon_ok'>确认</span></a> ";
- // h += "<a onclick='onDelete(" + rowindex + ")'><span class='icon_delete'>取消</span></a> ";
- h += "<a onclick='quxiaoEdit(" + rowindex + ")'><span class='icon_delete'>取消</span></a> ";
- }
- return h;
- }
- }
- ],
- data:duty,
- rownumbers:true,
- height: '500px',
- width:'100%',
- enabledEdit: true,
- clickToEdit: false,
- enabledSort:false,
- onDblClickRow:function(rowdata, rowindex){
- // if(flag){
- // top.Dialog.alert("请先完成当前记录的编辑!");
- // return;
- // }
-
- editingRow=parseInt(rowindex.slice(1))-1001;
- // $(g.getRowObj(rowindex)).children("td").eq(4).unbind("click").bind("click",openaddwindow);
- g.beginEdit(rowindex);
-
- },
- onBeforeEdit: onBeforeEdit,
- onBeforeSubmitEdit: onBeforeSubmitEdit,
- onAfterSubmitEdit: onAfterSubmitEdit,
- onAfterShowData:function(){setHight();},
- toolbar:
- {
- items: [
- { text: '新增', click: addUser, iconClass: 'icon_add' },
- { line: true }
-
- ]
- }
- });
-
- }
-
- // 导入方法
- function submitInfo() {
- var val = $("#import_report").val();
- var end = val.substring(val.indexOf(".") + 1);
- if (end == "xls" || end == "xlsx") {
- addfn();
- } else {
- top.Dialog.alert("请导入正确的excel文件");
- return;
- }
- };
-
- // 导入excle
- function addfn() {
- var $form = $("#RespDutyForm");
- fileToSave($form);
-
- };
- function fileToSave($form) {
- // showProgressBar("正在提交中...");
- // 表单异步提交处理
- $form.ajaxSubmit({
- url : $.pathname() + "/ws/DutyAlertImport/DutyEmImport/importdutytask?report_type=3",
- type : 'post',
- success : function(responseText, statusText, xhr, $form) {
- responseText = eval('(' + responseText + ')');
- gridData = responseText;
- var data = JSON.stringify(gridData);
- g.setOptions({
- "data" : JSON.parse(decodeURIComponent(data))
- });
- g.resetHeight();
- g.loadData();
- $("#onviewtype").hide();
- setThisHeight();
- },
- error : function(e) {
- // $.messager.alert('导入值班信息失败!');
- top.Dialog.alert("导入值班信息失败!");
- }
- });
- }
-
- //查看
- function onView(rowidx){}
- //取消cancelEdit
- function quxiaoEdit(rowidx){
- var row = g.getRow(rowidx);
-
- var dutyDate = row.day_time;//值班日期
- var dutyTime = row.date_time;//值班时间段
- var dutyDept = row.duty_dept;//值班部门
- var dutyPeopName = row.duty_name;//值班人员姓名
- var dutyPeopNameTel = row.duty_name_tel;//值班人员电话
-
- // if((dutyDate == undefined && dutyTime == "08:00-20:00" && dutyDept == "安全监管部" && dutyPeopName == undefined && dutyPeopNameTel == undefined)){//取消新增未确定(保存)的队伍信息(删除本行)
- if((dutyDate == undefined && dutyPeopName == undefined && dutyPeopNameTel == undefined)){//取消新增未确定(保存)的队伍信息(删除本行)
- allot=false;
- isValida=false;
- flag=false;
- endEdit(rowidx);
- g.deleteRow(row);//删除操作
- }else{//取消修改队伍信息(还原初始值)
- cancelEdit(rowidx);
- }
- }
- //删除
- function onDelete(rowidx){
-
- if(rowidx!=editingRow && flag==true){
- top.Dialog.alert("请先完成当前记录的编辑!");
- return;
- }
- top.Dialog.confirm("确定要删除该记录吗?",function(){
-
- isValida=false;
- flag=false;
- endEdit(rowidx);
- //删除记录
-
- var row = g.getRow(rowidx)
- //删除操作
- g.deleteRow(row);
-
- });
- }
-
- //编辑
- function beginEdit(rowid) {
- g.beginEdit(rowid);
- }
-
- //取消编辑
- function cancelEdit(rowid) {
- g.cancelEdit(rowid);
- }
-
- //结束编辑
- function endEdit(rowid){
- //editingRow='';
- g.endEdit(rowid);
- }
-
- //新增
- function addUser(){
-
- // $("#dutydept").html(deptName);//显示
- // $("#dutydept").val(deptId);//保存
- // alert(deptName);
-
- if(flag){
- top.Dialog.alert("请先完成当前记录的编辑!");
- return;
- }
- editingRow=0;
- isNew=true;
- var row = g.getRow(-1);
- var rowData={
- date_time:"08:00-20:00",
- duty_dept:deptName
- };
- g.addEditRow(rowData, row, false);
- //在这里做新增处理
- // var $duty_man_input = $("#maingrid .l-grid2 .l-grid-body-table").children("tbody").children("tr").children("td").eq(4);
- // $duty_man_input.on("click",openaddwindow)
-
- }
-
- //将row JSON对象转化为bo对象
- function rowToBO(row) {
- // var params = '&userinfor.userId='+row.userId+'&userinfor.userName='+row.userName+'&userinfor.userSex='+row.userSex+'&userinfor.userAge='+Math.ceil(row.userAge)+'&userinfor.userDepartment='+row.userDepartment+'&userinfor.userEmployTime='+row.userEmployTime+'&userinfor.userPassword='+row.userPassword+'&userinfor.userEducation='+row.userEducation+'&userinfor.userLoginName='+row.userLoginName;
- var params = '&EcmDutyDetail.fd_objectid='+row.fd_objectid+'&EcmDutyDetail.duty_id='+dutyid+'&EcmDutyDetail.duty_date='+row.duty_date+'&EcmDutyDetail.start_time='+row.start_time+'&EcmDutyDetail.end_time='+row.end_time+'&EcmDutyDetail.leader='+row.leader+'&EcmDutyDetail.leader_tel='+row.leader_tel+'&EcmDutyDetail.name='+row.name+'&EcmDutyDetail.telephone='+row.telephone+'&EcmDutyDetail.duty_way='+row.duty_way;
- //var params = '&EcmDutyDetail.fd_objectid='+row.fd_objectid+'&EcmDutyDetail.duty_id='+dutyid+'&EcmDutyDetail.start_time='+row.start_time+'&EcmDutyDetail.end_time='+row.end_time+'&EcmDutyDetail.leader='+row.leader+'&EcmDutyDetail.leader_tel='+row.leader_tel+'&EcmDutyDetail.name='+row.name+'&EcmDutyDetail.telephone='+row.telephone+'&EcmDutyDetail.duty_way='+row.duty_way;
- return params;
- }
-
- //删除后的提示
- function handleResult(result){
- if(result == 1){
- top.Dialog.alert("删除成功!",null,null,null,1);
- g.loadData();
- }else{
- top.Dialog.alert("删除失败!");
- }
- }
-
- //全部确认修改
- function endAllEdit(){
- g.endEdit();
- }
-
- //全部取消修改
- function cancelAllEdit(){
- g.cancelEdit();
- }
- //编辑前事件
- function onBeforeEdit(e){}
-
- //编辑提交前事件
- function onBeforeSubmitEdit(e){
- if(isValida){
- if(e.newdata.day_time=="" || e.newdata.day_time==undefined){
- top.Dialog.alert("日期列有输入值为空!");
- return false;
- }
- if(e.newdata.date_time==""){
- top.Dialog.alert("时间段列有输入值为空!");
- return false;
- }
- if(e.newdata.duty_dept==""){
- top.Dialog.alert("部门列有输入值为空!");
- return false;
- }
- if(e.newdata.duty_name==""){
- top.Dialog.alert("值班人员列有输入值为空!");
- return false;
- }
- var r=/^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/;
- if(r.test(e.newdata.duty_name_tel)){
- return true;
- }else{
- top.Dialog.alert("电话号码输入不正确!");
- return false;
- }
- }
- }
- isValida=true;
-
- //编辑后事件
- function onAfterSubmitEdit(e)
- {
- isNew=false;
- }
- var token = 0;
- function saveDuty(validaFormId,isPublish ){
- var datas = g.getData();//lj 判断表格里的数据是否为空
-
- //alert(JSON.stringify(g.options.columns));
- var str = "";
- for(var i=0;i<g.options.columns.length;i++){
- var json = g.options.columns[i];
- str += json["display"]+",";
- }
- var names = str.split(",");//获取表头的名字集合
- //alert(names[3]);
- for(var i=0;i<datas.length;i++){
-
- if(datas[i].day_time==""){
- top.Dialog.alert("第"+(i+1)+"行的"+names[0]+"不能为空!");
- return;
- }
- if(datas[i].date_time==""){
- top.Dialog.alert("第"+(i+1)+"行的"+names[1]+"不能为空!");
- return;
- }
- if(datas[i].duty_dept==""){
- top.Dialog.alert("第"+(i+1)+"行的"+names[2]+"不能为空!");
- return;
- }
- if(datas[i].duty_name==""){
- top.Dialog.alert("第"+(i+1)+"行的"+names[3]+"不能为空!");
- return;
- }
- if(datas[i].duty_name_tel==""){
- top.Dialog.alert("第"+(i+1)+"行的"+names[4]+"不能为空!");
- return;
- }
-
- }
-
-
- var dutyMsgNum = $("#maingrid").quiGrid().rows.length;//值班信息记录的条数
- if(dutyMsgNum == 0){
- top.Dialog.alert("值班信息不能为空!");
- return;
- }
-
- $("#release").val("0");
- if(flag){
- top.Dialog.alert("请先完成当前记录的编辑!");
- return;
- }
- var valid=$(validaFormId).validationEngine({returnIsValid: true});
- // CHECKREDBOX='请检查标红输入框!';
- if(!valid){
- top.Dialog.alert(CHECKREDBOX);
- }
-
- if(valid){
- // if(token>0){
- // top.Dialog.alert("已经保存过!");
- // return;
- // }
- if(g.getRow(0) == undefined){
- top.Dialog.alert("请安排值班人员!");
- return;
- }
- token++;
- var rows = g.getData();
- var rowsjson=JSON.stringify(rows);
- //保存并发布
- if(isPublish){
- $("#release").val("1");
- }
- var forms = $('#RespDutyForm').serialize();
- forms =forms +"#;#"+encodeURI(encodeURI(rowsjson));
- if(isPublish){
- top.Dialog.confirm("确定保存并发布吗?|发布", function() {
- $.ajax({
- url : $.pathname() + '/ws/alertduty/RespAlertDutyService/saveDuty',
- type : 'post',
- timeout : 15000,
- data : forms,
- dataType : 'json',
- success : function(result){
- // result = eval('('+result+')');
- if (result.Msg.sucsess == true) {
- top.Dialog.confirm("发布成功,是否发送短信通知?|提醒", function() {
- getNameTel(result.Msg.objectID);
- },function(){
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/alert/duty/resp_duty_list.jsp");
- });
- } else {
- top.Dialog.alert("保存失败!");
- }
- },
- error : function(e){
- top.Dialog.alert("保存失败");
- }
- });
- })
- }else{
- $("#release").val("0");
- $.ajax({
- url : $.pathname() + '/ws/alertduty/RespAlertDutyService/saveDuty',
- type : 'post',
- timeout : 15000,
- data : forms,
- dataType : 'json',
- success : function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("保存成功!");
- } else {
- top.Dialog.alert("保存失败!");
- }
- history.go(-1);
- },
- error : function(e){
- top.Dialog.alert("保存失败");
- }
- });
- }
- }
- }
- /* function getNameTel(data){
- $.ajax({
- url : $.pathname() + '/ws/bgd_duty/BgdDutyService/getNameTel/',
- type : 'post',
- data : data,
- async:false,
- dataType : 'json',
- success : function(data){
- var receiver = ""; //接收人员 + 领导
- var telephine = "";
- var arr = data.rows;
- for(var i=0;i<arr.length;i++){
- //值班成员
- receiver+=arr[i].DUTY_NAME+";";
- //电话
- telephine+=arr[i].DUTY_NAME_TEL+";";
- };
- addMsg(receiver,telephine,"新发布了一个预警值班安排表,请及时查看!","1");
- },
- error : function(e){
- // $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- top.Dialog.alert("系统错误!");
- }
- });
- } */
-
- function getNameTel(data){
- $.ajax({
- url : $.pathname() + '/ws/alertduty/RespAlertDutyService/sendDutyMsg/',
- type : 'post',
- data : {dept_id:data},
- async:false,
- dataType : 'text',
- success : function(data){
- if(data=="true"){
- top.Dialog.alert("发送短信成功!");
- }else{
- top.Dialog.alert("发送短信失败!");
- }
- },
- error : function(e){
- top.Dialog.alert("发送短信失败!");
- }
- });
- }
-
- function resetDuty(){
- window.location.href="resp_duty_edit.jsp";
- }
- $(function(){
- $("#back").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
- $("#downloadUserModel").bind('click',function(){
- window.open("/nwyj/excels/onBMDutyDemo.xls");
- })
- var bodyheight = $(window.document.body).height();
- $(parent.document.body).find("#frmright").height(bodyheight);
- $("body").eq(0).showLoading();
- })
-
- window.onload = function(){
-
- /* setTimeOut('1000','$("body").eq(0).hideLoading()'); */
- setTimeout("$('body').eq(0).hideLoading()", 1000);
-
- }
- </script>
- <style type="text/css">
- .title_font{
- font-weight: bold;
- font-size: 24px;
- line-height: 45px;
- color:#3e62a0;
- }
- .back{
- margin:10px 0px 10px 15px;
- }
- .title{
- height: 50px;
- /* background: #F8F8F8; */
- border-style:solid;
- border-width:1px;
- border-right:1px;
- border-left:1px;
- border-top:1px;
- border-color:#cdcaca;
- }
- .legend{
- font-family:宋体;
- font-weight: bold;
- font-size:14px;
- color:#3e62a0;
- }
- body{
- padding:0px;
- margin:0px;
- }
- </style>
- </head>
- <body style="width: 1000px; margin:0 auto; margin-top:15px" align="center" >
- <div class="box1" id="formContent" style="border: 1px solid #E4E4E4;background: #F8F8F8;">
- <div class="title" align="center">
- <a href="javascript:;"> <img id="back" class="back" align="left" alt="返回" title="返回"
- src="/nwyj/images/temp/back.png"
- onclick="javascript:window.location.href='resp_duty_list.jsp';" />
- </a> <font class="title_font">应急预警值班安排表填报</font>
- </div>
- <form id="RespDutyForm" method="post">
- <input id="INPUT_NAME_ID_335" name="INPUT_NAME_ID_335" type="hidden"/>
- <input name="release" id="release" type="hidden" value="0" >
- <input name="dept_names" id="deptnames" type="hidden"/>
- <input name="oper_name" id="opernames" type="hidden"/>
- <input name="oper_time" id="opertimes" type="hidden"/>
- <input name="duty_type" id="duty_type" type="hidden" value="1">
- <input type="hidden" name="classid" value="333" required="true" />
- <br/>
- <div style="float:right">
- <input type="button" onclick="javascript:saveDuty('#RespDutyForm',true)" value="保存并发布"/>
- <input type="button" onclick="javascript:saveDuty('#RespDutyForm');" value="保存" />
- <input type="button" onclick="javascript:resetDuty();" value="重置" /></td>
- </div>
- <br/>
- <fieldset style=" border-color:#999999; border-top-color: rgb(200,200,200); border-right-color: rgb(200,200,200); border-bottom-color: rgb(200,200,200); border-left-color: rgb(200,200,200); width: 960px " align="center" >
- <legend width="960px" class="legend">基本信息:</legend>
- <table width="960px" class="tableStyle" align="center">
- <tr>
- <td align="right">预警编号:</td>
- <td align="left"><select editable=false name="name_id" class="validate[required] selectWidth" id="name_id" selAlign="" prompt="请选择" swidth="94%"></select></td>
- <td width="10%" align="right"><span class="star">*</span>名称:</td>
- <td width="20%" align="left">
- <input style="width:98%;" id="name2" type="text" class="validate[required]" disabled="disabled"/>
- <input style="width:98%;" id="name" name="name" type="hidden" class="validate[required]" readonly="readonly"/>
- </td>
- </tr>
- <tr><td width="10%" align="right">单位:</td>
- <td width="20%" align="left">
- <input id="oper_dept" name="oper_dept" type="hidden"/>
- <div id="oper_dept_show"></div>
- </td>
- <td align="right">填报人员:</td>
- <td align="left"><div id="oper_name"></div></td>
- </tr>
- <tr>
- <td align="right">填报部门:</td>
- <td align="left"><div id="dept_names"></div></td>
- <td align="right">填报时间:</td>
- <td align="left"><div id="oper_time"></div></td>
- </tr>
- <tr>
- <td align="right">预计值班持续时间:</td>
- <td align="left"><select id="duty_time" name="duty_time"></select></td>
- <td></td>
- <td></td>
- </tr>
- </table>
- </fieldset>
- <fieldset style=" border-color:#999999; border-top-color: rgb(200,200,200); border-right-color: rgb(200,200,200); border-bottom-color: rgb(200,200,200); border-left-color: rgb(200,200,200); width: 960px " align="center" >
- <legend width="960px" class="legend">值班信息:</legend>
- <table>
- <tr>
- <td align="right" width="30%">选择导入文件:</td>
- <td width="25%"><input name="import_report" fileWidth="300" id="import_report" type="file" contenteditable="false" /></td>
- <td width="10%"><div><a href="javascript:;" ><input type="button" value="导入预警值班信息" id="import_gpsUser"/></a></div></td>
- <td align="left" ><div><input type="button" value="下载预警值班模版" id="downloadUserModel"/></div></td>
- </tr>
- </table>
- <div>
- <div class="padding_right5">
- <div id="maingrid"></div>
- </div>
- </div>
- </fieldset>
- </form>
- </div>
- </body>
- </html>
|