123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=9" />
- <title>应急响应值班安排表填报</title>
- <!--引入QUI框架js -->
- <%@include file="../../../../include.jsp" %>
- <script type="text/javascript" src="<%=path%>/scripts/setiframeheight.js" ></script>
- <script>
- var flag=false;
- var isNew=false; //是否是新增记录
- var isNewSave=true; //新增记录是否保存
- var editingRow; // 双击的当前编辑行
- var isValida=true; //是否需要验证
- //取得用户真实名字
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //部门名称
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var g;
- var demandid;
- var departNode;
- var newrowid=200;
-
- var deptUrl = $.pathname() + '/ws/dept/DeptService/getDepartTree';
- $.post(deptUrl,{id:parentId,name:''},function(data){
- $("#RECIPIENT_DEPARTMENT").data("data",data);
- $("#RECIPIENT_DEPARTMENT").render();
- }, "json");
-
- function initComplete(){
- if((window.location.href).indexOf('?')>-1){
- demandid = (window.location.href).split('?')[1];//获取记录id
- var url = $.pathname() + '/ws/equip/RespEquipmentService/getEquipById/';
- var params = {demandid : demandid};
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data){
- top.Dialog.alert("访问服务成功!");
- $('#editForm').ajaxWrite({data:data});
-
- },
- error : function(e){
- top.Dialog.alert("访问服务失败!");
- }
- });
- }
- initGrid();
- }
-
-
-
- function initGrid(){
- g = $("#maingrid").quiGrid({
- columns: [
- {name:'fd_objectid',hide:true},
- {name:'demand_id',hide:true},
- { display: '队伍专业', name: 'team_major', align: 'center', width: 200,editor: { type: 'text' }},
- { display: '需求人数', name: 'need_number', align: 'center', width: 200,editor: { type: 'text' }},
- { display: '操作', isSort: false, width: 120, 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> ";
- }
- return h;
- }
- }
- ],
- url: $.pathname() + '/ws/equip/RespEquipmentService/getDetailById/',
- params :{"demandid":demandid},
- rownumbers:true,
- pageSize:10,
- dataAction:"server",
- usePager: false,
- percentWidthMode : true,
- height: '100%', width:'100%',enabledEdit: true,clickToEdit: false,onDblClickRow:function(rowdata, rowindex){
- if(flag){
- top.Dialog.alert("请先完成当前记录的编辑!");
- return;
- }
-
- editingRow=parseInt(rowindex.slice(1))-1001;
-
- g.beginEdit(rowindex);
- },onBeforeEdit: onBeforeEdit, onBeforeSubmitEdit: onBeforeSubmitEdit,onAfterSubmitEdit: onAfterSubmitEdit,
- toolbar:
- {
- items: [
- { text: '新增', click: addUser, iconClass: 'icon_add' },
- { line: true }
-
- ]
- }
- });
- }
-
- //查看
- function onView(rowidx){
-
- }
- //删除
- function onDelete(rowidx){
- alert("rowidx"+rowidx);
- alert("editingRow"+editingRow);
- alert("flag"+flag);
- alert("isNew"+isNew);
-
- if(rowidx!=editingRow && flag==true){
- top.Dialog.alert("请先完成当前记录的编辑!");
- return;
- }
- if(rowidx != editingRow){
- top.Dialog.confirm("此删除操作将无法撤回,是否继续?",function(){
- //删除记录
- var row = g.getRow(rowidx)
- // alert(row.fd_objectid)
- //删除操作
- $.post($.pathname() + '/ws/equip/RespEquipmentService/delDetailByID',
- {"fd_objectid":row.fd_objectid},
- function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- g.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- },"json");
-
-
- });
- }
-
- else if(!isNew){
- isNewSave=false;
- isValida=false;
- isNew=false;
- g.loadData();
- }else{
- top.Dialog.confirm("确定要删除该记录吗?",function(){
- isNewSave=false;
- isValida=false;
- endEdit(rowidx);
- //删除记录
- var row = g.getRow(rowidx)
- // alert(row.fd_objectid)
- //删除操作
- g.deleteRow(row);
-
-
- });
-
- }
-
- }
-
- //编辑
- function beginEdit(rowid) {
-
- g.beginEdit(rowid);
- }
-
- //取消编辑
- function cancelEdit(rowid) {
- g.cancelEdit(rowid);
- }
-
- //结束编辑
- function endEdit(rowid)
- {
- // editingRow='';
- isNew=false;
- g.endEdit(rowid);
- }
-
- //新增
- function addUser(){
- if(flag){
- top.Dialog.alert("请先完成当前记录的编辑!");
- return;
- }
- isNew=true;
- editingRow=0;
- var row = g.getRow(0);
- var rowData={
-
-
- };
-
- g.addEditRow(rowData, row, true);
- //在这里做新增处理
-
- }
-
- //将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='&EquipmentDetail.fd_objectid='+row.fd_objectid+'&EquipmentDetail.equipment_name='+row.equipment_name+'&EquipmentDetail.equipment_model='+row.equipment_model+'&EquipmentDetail.equipment_number='+row.equipment_number;
- 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.equipment_name==""){
- top.Dialog.alert("队伍专业列有输入值为空!");
- return false;
- }
- if(e.newdata.equipment_model==""){
- top.Dialog.alert("需求人数列有输入值为空!");
- return false;
- }
- }
- isValida=true;
- }
-
- //编辑后事件
- function onAfterSubmitEdit(e)
- {
- if(isNewSave){
- var fd_objectid = e.record.fd_objectid;
- var rowData = e.newdata;
- var row = JSON.stringify(rowData);
- row += ";"+demandid+";"+fd_objectid;
- //ajax方式提交数据到数据库
- // $.post($.pathname() + '/ws/duty/DutyRecordsService/saveDetail',row,function(data){
- // g.loadData();
- // },"json");
- $.ajax({
- url : $.pathname() + '/ws/equip/RespEquipmentService/saveDetailByID',
- type : 'post',
- timeout : 15000,
- data : row,
- dataType : 'text',
- success : function(result){
- top.Dialog.alert("保存成功!");
- isNew=false;
- },
- error : function(e){
- top.Dialog.alert("保存失败!");
- }
- });
-
- }
- isNewSave=true;
- }
- var token = 0;
- function saveDuty(validaFormId){
-
- var valid=$(validaFormId).validationEngine({returnIsValid: true});
- if(true){
- if(token>0){
- top.Dialog.alert("已经保存过!");
- return;
- }
- token++;
- var rows = g.getData();
- var rowsjson=JSON.stringify(rows);
- var forms = $('#editForm').serialize();
- forms =forms +"&"+"fd_objectid="+demandid;
- alert(forms);
- $.ajax({
- url : $.pathname() + '/ws/equip/RespEquipmentService/updateDemand',
- type : 'post',
- timeout : 15000,
- data : forms,
- dataType : 'json',
- success : function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("保存成功!");
- // history.go(-1);
- } else {
- top.Dialog.alert("保存失败!");
- }
- },
- error : function(e){
- top.Dialog.alert("保存失败");
- }
- });
- }
- /* function resetDuty(){
- window.location.href="TeamEdit.jsp";
- } */
- }
- </script>
- </head>
- <body style="height:700px;overflow:auto; overflow-x:hidden;background-color:white">
- <div style="height: 50px;background: #F8F8F8;" align="center">
- <a href="javascript:;">
- <img id="back" align="left" alt="返回" src="/nwyj/images/temp/back.png" title="返回" onclick="javascript:window.location.href='TeamManage.jsp';" />
- </a>
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;" >修改应急队伍调拨申请</font>
- </div>
- <form id="editForm">
- <input name="REPORTED_STATE" id="REPORTED_STATE" type="hidden" >
- <input name="AUDIT_STATE" id="AUDIT_STATE" type="hidden" >
- <table style="width:100%" border="0">
- <tr>
- <td colspan="5" align="right"><input type="button" onclick="javascript:saveDuty('#editForm');" value="保存" /> <input type="button" onclick="javascript:resetDuty();" value="重置" /> </td>
- </tr>
- <td width="15%" align="right"><span class="star">*</span>被支援单位:</td>
- <td width="35%"><input type="text" maxlength="50" name="BY_BOOST_SECTOR_391" id="BY_BOOST_SECTOR_391" class="validate[required,length[0,50]]"/></td>
- <td width="15%" align="right"><span class="star">*</span>到达时间:</td>
- <td width="35%"><input type="text" readonly="readonly" maxlength="26" dateFmt="yyyy-MM-dd HH:mm:ss" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss',skin:themeColor})" name="ARRIVE_391" id="ARRIVE_391" class="date validate[required,custom[date]]"/></td>
- </tr>
- <tr>
- <td align="right"><span class="star">*</span>受灾情况:</td>
- <td colspan="3"><textarea style="height:40px;width:854px" maxlength="450" name="INJURY_CASE_391" id="INJURY_CASE_391" class="validate[length[0,500]]"></textarea></td>
- </tr>
- <tr>
- <td align="right"><span class="star">*</span>抢修任务:</td>
- <td colspan="3"><textarea style="height:40px;width:854px" maxlength="450" name="REPAIR_TASK_391" id="REPAIR_TASK_391" class="validate[length[0,500]]"></textarea></td>
- </tr>
- <tr>
- <td align="right"><span class="star">*</span>地质地貌:</td>
- <td colspan="3"><textarea style="height:40px;width:854px" maxlength="450" name="GEOLOGY_PHYSIOGNOMY_391" id="GEOLOGY_PHYSIOGNOMY_391" class="validate[length[0,500]]"></textarea></td>
- </tr>
- <tr>
- <td align="right"><span class="star">*</span>气候状况:</td>
- <td colspan="3"><textarea style="height:40px;width:854px" maxlength="450" name="WEATHER_CASE_391" id="WEATHER_CASE_391" class="validate[length[0,500]]"></textarea></td>
- </tr>
- <tr >
- <td align="right"><span class="star">*</span>住宿装备:</td>
- <td colspan="3"><textarea style="height:40px;width:854px" maxlength="450" name="STAY_GEAR_391" id=""STAY_GEAR_391"" class="validate[length[0,500]]"></textarea></td></td>
- </tr>
- <tr>
- <td align="right"><span class="star">*</span>施工机具:</td>
- <td colspan="3"><textarea style="height:40px;width:854px" maxlength="450" name="EXECUTION_IMPLEMENT_391" id="EXECUTION_IMPLEMENT_391" class="validate[length[0,500]]"></textarea></td></td>
- </tr>
-
- </table>
- </form>
- <div class="padding_right5">
- <div id="maingrid"></div>
- </div>
-
- </div>
- </body>
- </html>
|