3a78a56a3c7bcad7d0a013aadbe6f160c4ecfc13.svn-base 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <!DOCTYPE HTML>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=9" />
  7. <title>应急响应值班安排表填报</title>
  8. <!--引入QUI框架js -->
  9. <%@include file="../../../../include.jsp" %>
  10. <script type="text/javascript" src="<%=path%>/scripts/setiframeheight.js" ></script>
  11. <script type="text/javascript" src = "/nwyj/scripts/business/am/org/maintenance/orgSel.js"></script>
  12. <script>
  13. var flag=false;
  14. var isNew=false; //是否是新增记录
  15. var isNewSave=true; //新增记录是否保存
  16. var editingRow; // 双击的当前编辑行
  17. var isValida=true; //是否需要验证
  18. var reported = 1;//reported=1,只保存;reported=2,保存并报审
  19. //取得用户真实名字
  20. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  21. var realName_ID = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  22. //填报人电话
  23. var phone = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  24. //部门id
  25. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  26. //单位id
  27. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  28. //部门名称
  29. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  30. //用户所属单位
  31. var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  32. //父部门id
  33. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  34. var g;
  35. //var dutyData={"list":[{"value":"0","key":"发电车"},{"value":"1","key":"发电机"},{"value":"2","key":"移动餐车"},{"value":"3","key":"指挥(通信)车"}]};
  36. var dutyData={"list":[{"value":"0","key":"发电车"},{"value":"1","key":"发电机"}]};
  37. var demandid;
  38. var departNode;
  39. var newrowid=200;
  40. var deptUrl = $.pathname() + '/ws/dept/DeptService/getDepartTree';
  41. /* $.post(deptUrl,{id:parentId,name:''},function(data){
  42. $("#RECIPIENT_DEPARTMENT").data("data",data);
  43. $("#RECIPIENT_DEPARTMENT").render();
  44. }, "json"); */
  45. function initComplete(){
  46. /** 录入人信息start **/
  47. $("#TYPEIN_PEOPLE").html(realName);//录入人
  48. $("#TYPEIN_PEOPLE_PHONE_NUM").html(phone);//录入人电话
  49. $("#DEPT").html(deptName);//部门
  50. $("#UNITE").html(getCorp_names);//单位
  51. /** 录入人信息end **/
  52. if((window.location.href).indexOf('?')>-1){
  53. demandid = (window.location.href).split('?')[1];//获取记录id
  54. // alert(demandid)
  55. // var url = $.pathname() + '/ws/equip/RespEquipmentService/getEquipById/';
  56. // var params = {demandid : demandid};
  57. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  58. var params = {
  59. classid : '382',
  60. objectID : demandid
  61. };
  62. $.request.query(url,params,function(data){
  63. // alert(JSON.stringify(data))
  64. if(data.ISALERTORRESP_382 == 0){
  65. $("#isAlertOrResp").text("预警编号:");
  66. $("#TASK_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 RELEASE_UNIT='"+CorpArea+"')"); //预警编号
  67. }else if(data.ISALERTORRESP_382 == 1){
  68. $("#isAlertOrResp").text("响应编号:");
  69. $("#response").attr("checked","checked");
  70. $("#TASK_NAME_ID").initYewuSelect("365","FD_OBJECTID","EARLY_WARNING_ID","is_del='0' and (IS_ALERT = '1' and IS_SEND='5' and EARLY_WARNING_PROPERTY!='51' and RELEASE_UNIT='"+CorpArea+"')"); //响应编号
  71. }
  72. // $('#editForm').ajaxWrite({data:data});
  73. $("#REPORTING_DEPARTMENT").val(data.REPORTING_DEPARTMENT_382);
  74. $("#INFORMANT").val(data.INFORMANT_382);
  75. $("#REPORTING_TIME").val(data.REPORTING_TIME_382);
  76. $("#REPORTING_PHONE").val(data.REPORTING_PHONE_382);
  77. $("#TASK_NAME_ID").setValue(data.TASK_NAME_ID_382);
  78. $("#TASK_NAME").val(data.TASK_NAME_382);
  79. $("#RECIPIENT_DEPARTMENT").val(data.RECIPIENT_DEPARTMENT_382);
  80. $("#RECIPIENT_DEPARTMENT_391").val(data.RECIPIENT_DEPARTMENT_382_SHOW)
  81. $("#RECIPIENT_NAME").val(data.RECIPIENT_NAME_382);
  82. // $("#RECIPIENT").val(data.RECIPIENT_382);
  83. $("#RECIPIENT_PHONE").val(data.RECIPIENT_PHONE_382);
  84. $("#APPLY_TO_USE_TIME").val(data.APPLY_TO_USE_TIME_382);
  85. $("#USE_REASON").val(data.USE_REASON_382);
  86. $("#REQUIREMENT_DESCRIPTION").val(data.REQUIREMENT_DESCRIPTION_382);
  87. inputchange(data.RECIPIENT_382,data.RECIPIENT_2_382);
  88. $("#RECIPIENT_NAME_2").val(data.RECIPIENT_NAME_2_382);
  89. $("#RECIPIENT_PHONE_2").val(data.RECIPIENT_PHONE_2_382);
  90. })
  91. /* $.ajax({
  92. url : url = $.pathname() + '/ws/equip/RespEquipmentService/getEquipById/',
  93. type : 'post',
  94. timeout : 15000,
  95. data : {demandid : demandid},
  96. dataType : 'json',
  97. async : false,
  98. success : function(data){
  99. $('#editForm').ajaxWrite({data:data});
  100. $("#RECIPIENT_DEPARTMENT").val(data.RECIPIENT_DEPARTMENT);
  101. $("#RECIPIENT_NAME").val(data.RECIPIENT_NAME);
  102. var repDesc = data.REQUIREMENT_DESCRIPTION;//需求描述
  103. repDesc = repDesc.split("#;#")[0];
  104. if(repDesc == "null"){
  105. repDesc = "";
  106. }
  107. $("#REQUIREMENT_DESCRIPTION").val(repDesc);
  108. $("#RECIPIENT_2").attr("selectedValue",data.RECIPIENT_2);//申请单位联系人
  109. inputchange(data.RECIPIENT_2);
  110. $.ajax({
  111. url : $.pathname() + '/ws/equip/RespEquipmentService/getDeptNameByDeptId/',
  112. type : 'post',
  113. timeout : 15000,
  114. data : { dept_id : data.RECIPIENT_DEPARTMENT },
  115. dataType : 'text',
  116. success : function(result){
  117. $("#RECIPIENT_DEPARTMENT_391").val(result);
  118. // $("#show_RECIPIENT_DEPARTMENT").val(result);
  119. },
  120. error : function(e){
  121. top.Dialog.alert("访问服务失败!");
  122. }
  123. })
  124. // alert(JSON.stringify(data))
  125. },
  126. error : function(e){
  127. top.Dialog.alert("访问服务失败!!!!!!!!!!!!");
  128. }
  129. }); */
  130. }
  131. initGrid();
  132. //选择申请单位联系人,带出联系人电话
  133. $("#RECIPIENT").bind("listSelect",function(e,obj){//申请单位联系人自动提示框的绑定事件,选择完后,自动带入电话
  134. // $("#RECIPIENT").bind("change",function(){//申请单位联系人的绑定事件,选择完后,自动带入电话
  135. var userId = $("#RECIPIENT").attr("relValue");
  136. var userName=$("#RECIPIENT").attr("relText");
  137. $("#RECIPIENT_NAME").val(userName);
  138. if(userId!=''){
  139. $.ajax({
  140. url : $.pathname() + '/ws/TeamNeed/TeamNeedService/getPhoneNoByUserId',
  141. type : 'post',
  142. //async : false,
  143. timeout : 15000,
  144. data:userId,
  145. dataType : 'json',
  146. success : function(result){
  147. $("#RECIPIENT_PHONE").val(result);
  148. },
  149. error : function(e){
  150. top.Dialog.alert("系统错误!");
  151. }
  152. });
  153. };
  154. });
  155. //选择申请单位联系人备选人,带出联系人电话
  156. $("#RECIPIENT_2").bind("listSelect",function(e,obj){//申请单位联系人备选人自动提示框的绑定事件,选择完后,自动带入电话
  157. // $("#RECIPIENT").bind("change",function(){//申请单位联系人备选人的绑定事件,选择完后,自动带入电话
  158. var userId = $("#RECIPIENT_2").attr("relValue");
  159. var userName=$("#RECIPIENT_2").attr("relText");
  160. $("#RECIPIENT_NAME_2").val(userName);
  161. if(userId!=''){
  162. $.ajax({
  163. url : $.pathname() + '/ws/TeamNeed/TeamNeedService/getPhoneNoByUserId',
  164. type : 'post',
  165. //async : false,
  166. timeout : 15000,
  167. data:userId,
  168. dataType : 'json',
  169. success : function(result){
  170. $("#RECIPIENT_PHONE_2").val(result);
  171. },
  172. error : function(e){
  173. top.Dialog.alert("系统错误!");
  174. }
  175. });
  176. };
  177. });
  178. }
  179. //需求单位的改变,自动带入申请单位联系人和备选人(2共3)
  180. function inputchange(rec,rec_2){
  181. //var unitId = $("#FORM_SECTOR_391").val();//需求单位ID
  182. var unitId = $("#RECIPIENT_DEPARTMENT").val();//需求单位ID
  183. if(unitId!=''){
  184. $.ajax({
  185. url : $.pathname() + '/ws/TeamNeed/TeamNeedService/getPeopleByUnitId',
  186. type : 'post',
  187. //async : false,
  188. timeout : 15000,
  189. data:unitId,
  190. dataType : 'json',
  191. success : function(result){
  192. // console.log(JSON.stringify(result));
  193. if(result=='' || result==null){
  194. top.Dialog.alert("该单位没有对应的人员!");
  195. return;
  196. }else{
  197. $("#RECIPIENT").data("data",result);//加载申请单位联系人下拉框
  198. $("#RECIPIENT").render();
  199. $("#RECIPIENT_2").data("data",result);//加载申请单位联系人备选人下拉框
  200. $("#RECIPIENT_2").render();
  201. result = result.list;
  202. if(rec != ""){
  203. $("#RECIPIENT").attr("selectedValue",rec);//设置申请单位联系人初始选中值
  204. $("#RECIPIENT").render();
  205. }
  206. if(rec_2 != ""){
  207. $("#RECIPIENT_2").attr("selectedValue",rec_2);//设置申请单位联系人备选人初始选中值
  208. $("#RECIPIENT_2").render();
  209. }
  210. }
  211. },
  212. error : function(e){
  213. top.Dialog.alert("系统错误!");
  214. }
  215. });
  216. };
  217. }
  218. function initGrid(){
  219. g = $("#maingrid").quiGrid({
  220. columns: [
  221. {name:'fd_objectid',hide:true},
  222. {name:'demand_id',hide:true},
  223. { display: '装备类型', name: 'equipment_name', align: 'center', width: 200,editor: { type: 'select',data:dutyData,selWidth:155 },render:function (item){
  224. for (var i = 0; i < dutyData["list"].length; i++)
  225. {
  226. if (dutyData["list"][i]['value'] == item.equipment_name)
  227. return dutyData["list"][i]['key'];
  228. }
  229. }},
  230. { display: '装备容量(kVA)', name: 'equipment_model', align: 'center', width: 200,editor: { type: 'text' ,maxlength:'15',inputMode:'numberOnly',tip:'只能输入数字'}},
  231. { display: '装备数量', name: 'equipment_number', align: 'center', width: 200,editor: { type: 'text' ,maxlength:'15',inputMode:'numberOnly',tip:'只能输入数字'}},
  232. { display: '操作', isSort: false, width: 120, render: function (rowdata, rowindex, value)
  233. {
  234. var h = "";
  235. if (!rowdata._editing) {
  236. flag=false;
  237. h += "<a onclick='onDelete(" + rowindex + ")'><span class='icon_delete'>删除</span></a> ";
  238. } else {
  239. flag=true;
  240. h += "<a onclick='endEdit(" + rowindex + ")'><span class='icon_ok'>确认</span></a> ";
  241. h += "<a onclick='onDelete(" + rowindex + ")'><span class='icon_delete'>取消</span></a> ";
  242. }
  243. return h;
  244. }
  245. }
  246. ],
  247. url: $.pathname() + '/ws/equip/RespEquipmentService/getDetailById/',
  248. params :{"demandid":demandid},
  249. rownumbers:true,
  250. pageSize:10,
  251. dataAction:"server",
  252. usePager: false,
  253. percentWidthMode : true,
  254. height: '450px', width:'100%',enabledEdit: true,clickToEdit: false,
  255. onDblClickRow:function(rowdata, rowindex){
  256. if(flag){
  257. top.Dialog.alert("请先完成当前记录的编辑!");
  258. return;
  259. }
  260. editingRow=parseInt(rowindex.slice(1))-1001;
  261. g.beginEdit(rowindex);
  262. },
  263. onBeforeEdit: onBeforeEdit, onBeforeSubmitEdit: onBeforeSubmitEdit,onAfterSubmitEdit: onAfterSubmitEdit,
  264. toolbar: {
  265. items: [
  266. { text: '新增', click: addUser, iconClass: 'icon_add' },
  267. { line: true }
  268. ]
  269. }
  270. });
  271. }
  272. //查看
  273. function onView(rowidx){ }
  274. //删除
  275. function onDelete(rowidx){
  276. if(rowidx!=editingRow && flag==true){
  277. top.Dialog.alert("请先完成当前记录的编辑!");
  278. return;
  279. }
  280. if(rowidx != editingRow){
  281. top.Dialog.confirm("此删除操作将无法撤回,是否继续?",function(){
  282. //删除记录
  283. var row = g.getRow(rowidx)
  284. // alert(row.fd_objectid)
  285. //删除操作
  286. $.post($.pathname() + '/ws/equip/RespEquipmentService/delDetailByID',
  287. {"fd_objectid":row.fd_objectid},
  288. function(result){
  289. if (result.Msg.sucsess == true) {
  290. top.Dialog.alert("删除成功!");
  291. g.loadData();
  292. } else {
  293. top.Dialog.alert("删除失败!");
  294. }
  295. },"json");
  296. });
  297. } else if(isNew){
  298. top.Dialog.confirm("确定要删除该记录吗?",function(){
  299. isNewSave=false;
  300. isValida=false;
  301. endEdit(rowidx);
  302. //删除记录
  303. var row = g.getRow(rowidx)
  304. // alert(row.fd_objectid)
  305. //删除操作
  306. g.deleteRow(row);
  307. });
  308. }else{
  309. isNewSave=false;
  310. isValida=false;
  311. endEdit(rowidx);
  312. g.loadData();
  313. }
  314. }
  315. //编辑
  316. function beginEdit(rowid) { g.beginEdit(rowid); }
  317. //取消编辑
  318. function cancelEdit(rowid) { g.cancelEdit(rowid); }
  319. //结束编辑
  320. function endEdit(rowid) {
  321. // editingRow='';
  322. isNew=false;
  323. g.endEdit(rowid);
  324. }
  325. //新增
  326. function addUser(){
  327. if(flag){
  328. top.Dialog.alert("请先完成当前记录的编辑!");
  329. return;
  330. }
  331. isNew=true;
  332. editingRow=0;
  333. var row = g.getRow(0);
  334. var rowData={ };
  335. g.addEditRow(rowData, row, true);
  336. //在这里做新增处理
  337. }
  338. //将row JSON对象转化为bo对象
  339. function rowToBO(row) {
  340. // 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;
  341. // 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;
  342. 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;
  343. return params;
  344. }
  345. //删除后的提示
  346. function handleResult(result){
  347. if(result == 1){
  348. top.Dialog.alert("删除成功!",null,null,null,1);
  349. g.loadData();
  350. }else{
  351. top.Dialog.alert("删除失败!");
  352. }
  353. }
  354. //全部确认修改
  355. function endAllEdit(){
  356. g.endEdit();
  357. }
  358. //全部取消修改
  359. function cancelAllEdit() {
  360. g.cancelEdit();
  361. }
  362. //编辑前事件
  363. function onBeforeEdit(e) { }
  364. //编辑提交前事件
  365. function onBeforeSubmitEdit(e){
  366. if(isValida){
  367. if(e.newdata.equipment_name=="" || validateInput(e.newdata.equipment_name, "^[\" \"]+$")){
  368. top.Dialog.alert("装备名称列有输入值为空或全是空格!");
  369. return false;
  370. }
  371. if(e.newdata.equipment_name.length>15 ){
  372. top.Dialog.alert("装备名称不能超过15个字!");
  373. return false;
  374. }
  375. if(e.newdata.equipment_number==""){
  376. top.Dialog.alert("装备数量列有输入值为空!");
  377. return false;
  378. }
  379. if(!validateInput(e.newdata.equipment_number, "^[0-9]+$")){
  380. top.Dialog.alert("装备数量需要是正数数!");
  381. return false;
  382. }
  383. if(e.newdata.equipment_number.length>15){
  384. top.Dialog.alert("装备数量长度不能超过15!");
  385. return false;
  386. }
  387. }
  388. isValida=true;
  389. }
  390. //编辑后事件
  391. function onAfterSubmitEdit(e) {
  392. if(isNewSave){
  393. var fd_objectid = e.record.fd_objectid;
  394. var rowData = e.newdata;
  395. var row = JSON.stringify(rowData);
  396. row += ";"+demandid+";"+fd_objectid;
  397. // alert(row);
  398. //ajax方式提交数据到数据库
  399. // $.post($.pathname() + '/ws/duty/DutyRecordsService/saveDetail',row,function(data){
  400. // g.loadData();
  401. // },"json");
  402. $.ajax({
  403. url : $.pathname() + '/ws/equip/RespEquipmentService/saveDetailByID',
  404. type : 'post',
  405. timeout : 15000,
  406. data : row,
  407. dataType : 'text',
  408. success : function(result){
  409. top.Dialog.alert("保存成功!");
  410. isNew=false;
  411. },
  412. error : function(e){
  413. top.Dialog.alert("保存失败!");
  414. }
  415. });
  416. }
  417. isNewSave=true;
  418. }
  419. var token = 0;
  420. //保存方法
  421. function saveDuty(validaFormId,reported){
  422. var valid=$(validaFormId).validationEngine({returnIsValid: true});
  423. if(valid){
  424. var requireDescription = $("#REQUIREMENT_DESCRIPTION").val();
  425. if(g.rows.length==0 && requireDescription == ''){
  426. top.Dialog.alert("请填写需求描述或装备信息!");
  427. return ;
  428. }
  429. if(token>0){
  430. top.Dialog.alert("已经保存过!");
  431. return;
  432. }
  433. $("body").eq(0).showLoading();//遮罩
  434. token++;
  435. var rows = g.getData();
  436. var rowsjson=JSON.stringify(rows);
  437. var forms = $('#editForm').serialize();
  438. forms =forms +"&"+"fd_objectid="+demandid;
  439. $.ajax({
  440. url : $.pathname() + '/ws/equip/RespEquipmentService/updateDemand',
  441. type : 'post',
  442. timeout : 15000,
  443. data : forms,
  444. dataType : 'json',
  445. success : function(result){
  446. if(reported == 1){//只保存
  447. if (result.Msg.sucsess == true) {
  448. top.Dialog.alert("保存成功!");
  449. window.location.href="Eqallocateallot.jsp?pagenumber=";
  450. } else {
  451. top.Dialog.alert("保存失败!");
  452. }
  453. }else if(reported == 2){//保存并报审
  454. if (result.Msg.sucsess == true) {
  455. var isPass=2;//报审
  456. dialogDemo(isPass,result);
  457. // window.location.href="Eqallocateallot.jsp?pagenumber=";
  458. } else {
  459. top.Dialog.alert("保存失败!");
  460. }
  461. }
  462. },
  463. error : function(e){
  464. top.Dialog.alert("系统错误");
  465. }
  466. });
  467. }
  468. }
  469. function dialogDemo(isPass,result){
  470. /* var fdid = (window.location.href).split('=')[1];//获取记录id(1)
  471. var fd_id = fdid.split('&')[0];//获取记录id(2)*/
  472. var fd_id = demandid = (window.location.href).split('?')[1];//获取记录id;
  473. // var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  474. var CorpID = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  475. //var ifmHeight = $(top.document.body).find("#frmright").height();
  476. var diag = new top.Dialog();
  477. diag.Title = '报审';
  478. diag.URL = $.pathname() + '/page/business/em/response/team/TeamNextRole.jsp?fd_id='+fd_id+'&isPass=2&deptId='+CorpID; //修改对应的路径的编辑界面
  479. diag.OkButtonText = '提交';
  480. diag.OKEvent = function(){
  481. save(diag,fd_id,result);
  482. };
  483. diag.CancelEvent=function(){
  484. diag.close();
  485. window.location.href="Eqallocateallot.jsp?pagenumber=";
  486. };
  487. diag.Width = 500; //宽度
  488. // diag.Height = 240; //高度
  489. diag.ButtonAlign = 'center';
  490. diag.show();
  491. };
  492. function save(diag,fd_id,result){
  493. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  494. var realName_ID = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  495. /********** 弹框start **********/
  496. var valid = diag.innerFrame.contentWindow.$("#ideaForm").validationEngine({returnIsValid: true});//弹框页面的非空验证
  497. if(!valid){
  498. top.Dialog.alert("请检查红色输入框!");
  499. return;
  500. };
  501. var b = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").val();//弹框页面的下一节点人的id
  502. if(b=='' && b == undefined){
  503. top.Dialog.alert("请选择下一处理人!");
  504. return;
  505. }
  506. $("body").eq(0).showLoading();//遮罩
  507. var c = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").next().html();//弹框页面的下一节点人的NAME
  508. var d = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").next().next().val();//弹框页面的下一节点人的电话
  509. var e = diag.innerFrame.contentWindow.$("#msgRemind").attr("checked");//短信是否被勾选
  510. var f = diag.innerFrame.contentWindow.$("#appRemind").attr("checked");//app是否被勾选
  511. var isPass = diag.innerFrame.contentWindow.$(".aa[checked='checked']").val();//判断是否同意
  512. var g = '有新报审的装备需求,请您及时处理!';//短信内容
  513. var h = getDateTime();//系统时间
  514. // alert("ID="+b+"***NAME="+c+"***电话="+d+"***e="+e+"***f="+f)
  515. if(e=='checked'){//短信被勾选
  516. if(b == undefined){
  517. top.Dialog.alert("请选择短信接收人!");
  518. return;
  519. }
  520. var url0 = $.pathname() + '/ws/sendsms/SendSmsService/saveMessage';
  521. var params = {
  522. realName : realName,//发送人真实姓名
  523. smsRecTel : d,//接收电话
  524. smsTime : h,//系统时间
  525. smsContent : g,//短信内容
  526. smsSendId : realName_ID,//发送人Id
  527. smsPeople : b,//接收人员id?还是name?
  528. type:"短信发送"
  529. };
  530. $.ajax({//短信
  531. type : 'post',
  532. url : url0,
  533. data : params,
  534. async:false,
  535. dataType : 'json',
  536. success : function (data0){
  537. //addMsg(data0.list.split("|")[0],data0.list.split("|")[1],"新报审了一个队伍需求,请及时审核!");
  538. },
  539. error : function(e){
  540. $.messager.alert('系统提示信息', '访问服务失败!123', 'error');
  541. }
  542. });
  543. }
  544. if(f=='checked'){
  545. alert("应急app提醒!");
  546. }
  547. diag.innerFrame.contentWindow.top.Dialog.close();//关闭弹框
  548. /********** 弹框end **********/
  549. $.ajax({////修改装备需求表的IS_SEEN字段为【下一处理人ID,0】
  550. url : $.pathname() + '/ws/sendsms/SendSmsService/updateIs_Seen',
  551. data : { tableName : "ECM_EM_EQUIPMENT_DEMAND" , fdId : fd_id , nextPeopId : b , userId : realName_ID},
  552. type : 'post',
  553. dataType : 'json',
  554. //async:false,
  555. success : function (data){
  556. },error : function(e){
  557. top.Dialog.alert("系统提示信息!");
  558. }
  559. });
  560. var params = {
  561. classid : "382",
  562. FD_OBJECTID382 : fd_id,
  563. AUDIT_STATE_382 : "52"
  564. };
  565. $.ajax({
  566. url : $.pathname() + '/ws/crud/CRUDService/update/',
  567. type : 'post',
  568. timeout : 15000,
  569. data : params,
  570. async : false,
  571. dataType : 'json',
  572. success : function(data1) {
  573. var params378 = {
  574. classid:"378",
  575. PERSON_ID_378:b,
  576. PERSON_NAME_378:c,
  577. BUSINESS_ID_378:fd_id,
  578. STATUES_378:"52",
  579. DISPOSE_378:"0"
  580. };
  581. $.ajax({
  582. url : $.pathname() + '/ws/crud/CRUDService/create/',
  583. type : 'post',
  584. timeout : 15000,
  585. data : params378,
  586. async : false,
  587. dataType : 'json',
  588. success : function(data378) {
  589. closeProgress();
  590. top.Dialog.alert('报审成功!', null, null, null, -1);
  591. $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/em/response/equipment/Eqallocateallot.jsp?pagenumber=');
  592. },error : function(e) {
  593. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  594. }
  595. });
  596. },error : function(e) {
  597. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  598. }
  599. });
  600. /** 代办右上角红色圈里面数字的改变 **/
  601. var url = $.pathname() + '/ws/xianlutingyun/XianlutingyunService/WarningTask';
  602. var compId = top.com.sinosoft.lz.system.user.LoginInfo.getCompany_id();
  603. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  604. var roleid = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  605. var params = {
  606. // userId : user_id,//处理人ID(系统登录人)
  607. netx_id : b,//下一节点处理人ID
  608. isRole : "0",//
  609. // company_id : compId,//
  610. // role_id : roleid//
  611. };
  612. $.ajax({//代办处理
  613. url : url,
  614. data : params,
  615. type : 'post',
  616. dataType : 'text',
  617. timeout : 15000,
  618. // async : false,
  619. success : function(data){
  620. // top.Dialog.alert('发送成功!', null, null, null, -1);
  621. // top.Dialog.alert('成功!');
  622. },error : function (e){
  623. // top.Dialog.alert('系统错误!');
  624. }
  625. });
  626. };
  627. function saveAndReport(validaFormId){
  628. top.Dialog.confirm("是否要报审?",function(){//点击确定的回调函数
  629. reported=2;
  630. saveDuty(validaFormId,reported);
  631. },function(){//点击取消
  632. //alert("bbbbbb");
  633. });
  634. }
  635. function resetDuty(){
  636. window.location.href="equipment_edit.jsp?"+demandid;
  637. }
  638. function goback(){
  639. window.location.href="Eqallocateallot.jsp?pagenumber=";
  640. }
  641. function alert00(){
  642. $("#isAlertOrResp").text("预警编号:");
  643. $("#TASK_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 RELEASE_UNIT='"+CorpArea+"')"); //预警编号
  644. }
  645. function response00(){
  646. $("#isAlertOrResp").text("响应编号:");
  647. $("#TASK_NAME_ID").initYewuSelect("365","FD_OBJECTID","EARLY_WARNING_ID","is_del='0' and (IS_ALERT = '1' and IS_SEND='5' and EARLY_WARNING_PROPERTY!='51' and RELEASE_UNIT='"+CorpArea+"')"); //响应编号
  648. }
  649. </script>
  650. <style type="text/css">
  651. .class_color{
  652. background-color: rgb(237, 239, 253);
  653. }
  654. </style>
  655. </head>
  656. <body style="width: 1000px; margin:0 auto; margin-top:15px" align="center">
  657. <div class="box1" id="formContent" style="border: 1px solid #E4E4E4;background: #F8F8F8; " width="1000px" >
  658. <div style="height: 50px;background: #F8F8F8;" align="center">
  659. <a href="javascript:;"><img id="back" align="left" alt="返回" src="/nwyj/images/temp/back.png" title="返回" onclick="javascript:goback();" /></a>
  660. <font style="font-weight: bold;font-size: 20px;line-height: 45px;" ></font>
  661. </div>
  662. <br/>
  663. <div align="center"><font style="font-weight: bold;font-size: 30px;line-height: 45px;" color="red" id="" >修改应急装备需求</font></div>
  664. <br/>
  665. <div style="float:right">
  666. <input type="button" onclick="javascript:saveAndReport('#editForm');" value="保存并报审" />
  667. <input type="button" onclick="javascript:saveDuty('#editForm',reported);" value="保存" />
  668. <input type="button" onclick="javascript:resetDuty();" value="重置" />
  669. </div>
  670. <br/>
  671. <form id="editForm">
  672. <input name="REPORTING_DEPARTMENT" id="REPORTING_DEPARTMENT" type="hidden" >
  673. <input name="INFORMANT" id="INFORMANT" type="hidden" >
  674. <input name="REPORTING_TIME" id="REPORTING_TIME" type="hidden" >
  675. <input name="REPORTING_PHONE" id="REPORTING_PHONE" type="hidden" >
  676. <fieldset style="border-color:#999999;" id="fileTable" >
  677. <legend>基本信息:</legend>
  678. <table style="width:100%" border="0">
  679. <tr>
  680. <td width="15%" align="right" class="class_color"><span class="star">*</span><span id="isAlertOrResp">预警编号:</span></td>
  681. <td width="35%" align="left" colspan="3">
  682. <select editable=false name="TASK_NAME_ID" class="validate[required] selectWidth" id="TASK_NAME_ID" selAlign="" prompt="请选择" swidth="65%"></select>
  683. &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="alert" name="a_OR_r" checked="checked" onclick="alert00()"/><label for="alert" class="hand">预警编号</label>
  684. &nbsp;&nbsp;<input type="radio" id="response" name="a_OR_r" onclick="response00()"/><label for="response" class="hand">响应编号</label>
  685. </td>
  686. </tr>
  687. <tr>
  688. <td width="15%" align="right"class="class_color"><span class="star">*</span>需求名称:</td>
  689. <td width="35%" align="left"><input style="width:71.5%" type="text" name="TASK_NAME" id="TASK_NAME" maxlength="15" class="validate[required]" readonly="readonly"/></td>
  690. <td width="15%" align="right"class="class_color"><span class="star">*</span>申请单位:</td>
  691. <td width="35%" align="left">
  692. <input id="RECIPIENT_DEPARTMENT" name="RECIPIENT_DEPARTMENT" type="hidden"/>
  693. <input id="RECIPIENT_DEPARTMENT_391" type="text" readonly="readonly" style="width:91%"/>
  694. <!-- <div class="selectTree validate[required]" id="RECIPIENT_DEPARTMENT" name="RECIPIENT_DEPARTMENT" selWidth="200" boxHeight="260"></div> --></td>
  695. </tr>
  696. <tr>
  697. <td width="15%" align="right"class="class_color"><span class="star">*</span>申请单位联系人:</td>
  698. <td width="35%" align="left">
  699. <div class="suggestion" id="RECIPIENT" name="RECIPIENT" keepDefaultStyle="true" showList="true" inputWidth="280"></div>
  700. <input id="RECIPIENT_NAME" name="RECIPIENT_NAME" type="hidden" style="width:71.5%"/>
  701. <!-- <input id="RECIPIENT" name="RECIPIENT" type="hidden"></div> --></td>
  702. <td width="15%" align="right"class="class_color"><span class="star">*</span>申请联系人电话:</td>
  703. <td width="35%" align="left"><input style="width:91%" type="text" name="RECIPIENT_PHONE" id="RECIPIENT_PHONE" maxlength="11" class="validate[required,custom[onlyNumber]]"/></td>
  704. </tr>
  705. <tr>
  706. <td width="15%" align="right"class="class_color">备选人:</td>
  707. <td width="35%" align="left">
  708. <input id="RECIPIENT_NAME_2" name="RECIPIENT_NAME_2" type="hidden"/>
  709. <div class="suggestion" id="RECIPIENT_2" name="RECIPIENT_2" keepDefaultStyle="true" showList="true" inputWidth="280"></div>
  710. <!-- <select prompt="请选择" name="RECIPIENT" id="RECIPIENT" class="validate[required] selectWidth" swidth="91.3%""></select> -->
  711. <td width="15%" align="right"class="class_color">备选人电话:</td>
  712. <td width="35%" align="left"><input style="width:91%" type="text" name="RECIPIENT_PHONE_2" id="RECIPIENT_PHONE_2" maxlength="11" class="custom[onlyNumber]]"/></td>
  713. </tr>
  714. </tr>
  715. <td width="15%" align="right"class="class_color"><span class="star">*</span>申请使用时间:</td>
  716. <td width="35%" align="left"><input style="width:71.5%" type="text" readonly="readonly" name="APPLY_TO_USE_TIME" id="APPLY_TO_USE_TIME" class="date validate[required]" dateFmt="yyyy-MM-dd HH:mm:ss"/></td>
  717. <td width="15%" align="right"></td>
  718. <td width="35%" align="left"></td>
  719. </tr>
  720. <tr>
  721. <td width="10%" align="right" class="class_color"><span class="star">*</span>申请事由:</td>
  722. <td colspan="4"><textarea style="height:100px;width:96%" maxNum="300" name="USE_REASON" id="USE_REASON" class="validate[required,length[0,500]]"></textarea></td>
  723. </tr>
  724. <tr>
  725. <td width="10%" align="right" class="class_color">需求描述:</td>
  726. <td colspan="4"><textarea style="height:105px;width:97%" maxNum="1000" name="REQUIREMENT_DESCRIPTION" id="REQUIREMENT_DESCRIPTION" class=""></textarea></td>
  727. </tr>
  728. </table>
  729. </fieldset>
  730. </form>
  731. <fieldset style="border-color:#999999;" id="fileTable" >
  732. <legend>装备信息:</legend>
  733. <div class="padding_right5"><div id="maingrid"></div></div>
  734. </fieldset>
  735. <fieldset style="border-color:#999999;" >
  736. <legend>录入人信息:</legend>
  737. <table width="960px" class="tableStyle" align="center" id="fillForm">
  738. <tr>
  739. <td width="114px" align="right" class="class_color">单位:</td>
  740. <td width="280px"><div style="width:97%" name="" id="UNITE" /></td>
  741. <td width="114px" align="right" class="class_color">部门:</td>
  742. <td width="280px"><div name="" id="DEPT" /></td>
  743. </tr>
  744. <tr>
  745. <td width="114px" align="right" class="class_color">录入人:</td>
  746. <td width="280px"><div name="" id="TYPEIN_PEOPLE" /></td>
  747. <td width="114px" align="right" class="class_color">录入人联系方式:</td>
  748. <td width="280px"><div name="" id="TYPEIN_PEOPLE_PHONE_NUM" /></td>
  749. </tr>
  750. </table>
  751. </fieldset>
  752. </div>
  753. </body>
  754. </html>