a211e52a06f807b25dff5a8900c1acb403f7e396.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <%@page language="java" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>组织机构管理</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
  7. <%
  8. request.setCharacterEncoding("GBK");
  9. %>
  10. <!--框架必需start-->
  11. <%@include file="../.././../../include1.jsp"%>
  12. <!--引用资源文件,JS CSS-->
  13. <script type="text/javascript"
  14. src="<%=path%>/scripts/jquery/plugins/jquery.extension.util.js"></script>
  15. <script type="text/javascript"
  16. src="<%=path%>/scripts/freamwork/com/sinosoft/common/common.js"></script>
  17. <script type="text/javascript"
  18. src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/utils.js"></script>
  19. <script type="text/javascript"
  20. src="<%=path%>/scripts/freamwork/com/sinosoft/common/frameWork/frameWork.js"></script>
  21. <script type="text/javascript"
  22. src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
  23. <link
  24. href="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.css"
  25. rel="stylesheet" type="text/css" />
  26. <!--基本选项卡start-->
  27. <style type="text/css">
  28. .back{
  29. margin:10px 0px 10px 15px;
  30. }
  31. .confirm:hover{
  32. cursor:pointer;
  33. }
  34. .tool{
  35. font-size:14px;
  36. background:#679cbb;
  37. color:#ffffff;
  38. }
  39. .tool:hover{
  40. cursor:pointer;
  41. background:#5bba3c;
  42. }
  43. </style>
  44. </head>
  45. <body>
  46. <table style="width:100%">
  47. <tr>
  48. <td>
  49. <form id="fillForm" method="post" enctype="multipart/form-data" float="left">
  50. <input type="hidden" name="classid" value="211" required="true" />
  51. <input type="hidden" name="virtual_org_id" value="" required="true" />
  52. <input name="import" fileWidth="300" id="import" type="file"contenteditable="false" />
  53. </form>
  54. </td>
  55. <td>
  56. <input type="button" value="导入" onclick="submit()" style="float:right;" />
  57. <!-- <input type="button" value="更新用户id信息(在前)" onclick="updateUserId()" style="float:right;" /> -->
  58. <!-- <input type="button" value="更新单位id信息" onclick="updateOrgId()" style="float:right;" /> --><!-- 用于更新数据 -->
  59. </td>
  60. </tr>
  61. <tr>
  62. <td><span class="tool" onclick="moveUp()">【上移】</span><span class="tool" onclick="moveDown()">【下移】</span><span class="tool" onclick="deleteData()">【删除】</span><span class="tool" onclick="addData()">【增加】</span><span class="tool" onclick="reImport()">【重新导入】</span></td>
  63. <td><div style="float:right"><span class="tool" onclick="saveData()">【保存】</span><span class="tool" onclick="issueData()">【发布】</span><span class="tool" onclick="confirmAll()">【全部确认】</span></div></td>
  64. </tr>
  65. <tr>
  66. <td colspan="2">
  67. <div style="overflow:auto;height:750px" >
  68. <div class="padding_right5">
  69. <div id="maingrid"></div>
  70. </div>
  71. </div>
  72. </td>
  73. </tr>
  74. </table>
  75. </body>
  76. <script type="text/javascript">
  77. var regex = /^1(3[4-9]|5[012789]|8[23478]|4[7]|7[8])\d{8}$/;
  78. var g = null;
  79. var VIRTUAL_ORG_ID = null;
  80. var orginalData = null;
  81. var corp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  82. var made_man_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  83. var made_man = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  84. var made_man_phone = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  85. var deptList = null;
  86. var name = "";
  87. $(function(){
  88. var href = window.location.href;
  89. VIRTUAL_ORG_ID = href.split("?")[1];
  90. name = decodeURI(href.split("?")[2]);
  91. getOriginalData();
  92. $("input[name='virtual_org_id']").val(VIRTUAL_ORG_ID);
  93. $("input[name='virtual_org_id']").val();
  94. getDeptList();
  95. });
  96. function getOriginalData(){
  97. $.ajax({
  98. data:{"virtual_org_id":VIRTUAL_ORG_ID},
  99. type:"post",
  100. datatype:"json",
  101. url:"/nwyj/ws/LinkMan/LinkManService/getOriginalData/",
  102. success:function(data){
  103. orginalData = data;
  104. },
  105. error:function(){
  106. top.Dialog.alert("获取最近版本数据失败!");
  107. }
  108. });
  109. }
  110. function getDeptList(){
  111. $.ajax({
  112. data:{
  113. "corp_id":corp_id
  114. },
  115. type:'post',
  116. dataType:'json',
  117. url:"/nwyj/ws/LinkMan/LinkManService/getDeptList/",
  118. success:function(data){
  119. deptList = data;
  120. },error:function(){
  121. top.Dialog.alert("获取部门信息失败!");
  122. }
  123. })
  124. }
  125. //导入方法
  126. function submit() {
  127. var b = $("#import").val();
  128. if(b==""){
  129. top.Dialog.alert("请选择文件后再点击导入!");
  130. return;
  131. }
  132. /* var val= $("#import").val();
  133. var end = val.substring(val.indexOf(".")-22);
  134. if(end=="generator-carfadianche.xls"||end=="generator-carfadianche.xlsx"){ */
  135. addfn();
  136. /* }else{
  137. top.Dialog.alert("请导入正确的excel文件");
  138. return;
  139. } */
  140. };
  141. //导入excle
  142. function addfn() {
  143. var $form = $("#fillForm");
  144. fileToSave($form,'','');
  145. };
  146. //保存
  147. function fileToSave($form,listGrid,msg){
  148. //showProgressBar("正在提交中...");
  149. //表单异步提交处理
  150. $form.ajaxSubmit({
  151. url:$.pathname() + "/ws/ExcelLinkMan/LinkManExcelToDBTableTool/importLinkMan",
  152. //type : 'post',
  153. timeout : 15000,
  154. async: false,
  155. success: function(responseText, statusText, xhr, $form){
  156. encodeURI(responseText);
  157. //alert(responseText);
  158. responseText = eval('('+responseText+')');
  159. var length = responseText.rows.length;
  160. if(length>1000){
  161. top.Dialog.alert('导入的数据一次不能超过1000条,请分批次导入。');
  162. return;
  163. }
  164. var data = JSON.stringify(responseText);
  165. testData = JSON.parse(decodeURI(data));
  166. initGrid(testData);
  167. },
  168. error : function(e) {
  169. top.Dialog.alert('导入失败,请用正确的模板导入!', '访问服务失败!', 'error');
  170. }
  171. });
  172. }
  173. function initGrid(data){
  174. g = $("#maingrid").quiGrid({
  175. columns: [
  176. {
  177. display : '排序',
  178. name : 'SORT_NO_211',
  179. align : 'center',
  180. width : "80",
  181. editor: { type: 'text'},
  182. render:function(rowdata, rowindex, value, column){
  183. if(rowdata.msg=="0"&&rowdata.msg!="7"){
  184. var data = getData(rowdata);
  185. if(data.SORT_NO_211==null){
  186. data.SORT_NO_211="";
  187. }
  188. if(rowdata.SORT_NO_211==null){
  189. rowdata.SORT_NO_211="";
  190. }
  191. if(data.SORT_NO_211!=rowdata.SORT_NO_211){
  192. rowdata.MAN_REMARKS_211="修改";
  193. rowdata.operation="【确认】";
  194. rowdata.msg ="6";
  195. return "<div style='background-color:#ffff00;'>"+value+"</div>";
  196. }else{
  197. return value;
  198. }
  199. }else{
  200. return value;
  201. }
  202. }
  203. },{
  204. display : '应急角色',
  205. name : 'EMC_ROLE_211_SHOW',
  206. align : 'center',
  207. width : "90",
  208. editor: {
  209. type: 'select',
  210. boxWidth:'90',
  211. selWidth:'90',
  212. data:{
  213. "list":[
  214. {
  215. "key":"总指挥",
  216. "value":"总指挥"
  217. },
  218. {
  219. "key":"副总指挥",
  220. "value":"副总指挥"
  221. },
  222. {
  223. "key":"主任",
  224. "value":"主任"
  225. },
  226. {
  227. "key":"副主任",
  228. "value":"副主任"
  229. },
  230. {
  231. "key":"成员",
  232. "value":"成员"
  233. },
  234. {
  235. "key":"管理人员",
  236. "value":"管理人员"
  237. },
  238. ]
  239. }
  240. },
  241. render:function(rowdata, rowindex, value, column){
  242. if(rowdata.msg=="0"&&rowdata.msg!="7"){
  243. var data = getData(rowdata);
  244. if(data.EMC_ROLE_211_SHOW==null){
  245. data.EMC_ROLE_211_SHOW="";
  246. }
  247. if(rowdata.EMC_ROLE_211_SHOW==null){
  248. rowdata.EMC_ROLE_211_SHOW="";
  249. }
  250. if(data.EMC_ROLE_211_SHOW!=rowdata.EMC_ROLE_211_SHOW){
  251. rowdata.MAN_REMARKS_211="修改";
  252. rowdata.operation="【确认】";
  253. rowdata.msg ="6";
  254. return "<div style='background-color:#ffff00;'>"+value+"</div>";
  255. }else{
  256. return value;
  257. }
  258. }else{
  259. return value;
  260. }
  261. }
  262. },
  263. {
  264. display : '姓名',
  265. name : 'INLINK_NAME_211',
  266. align : 'center',
  267. width : "80",
  268. editor: { type: 'text'},
  269. },
  270. {
  271. display : '所属单位',
  272. name : 'PARENT_ORG_ID_211_SHOW',
  273. align : 'center',
  274. width : "125",
  275. editor: { type: 'text'},
  276. },
  277. {
  278. display : '所属部门',
  279. name : 'PARENT_DEPT_ID_211',
  280. align : 'center',
  281. width : "90",
  282. editor: {
  283. type: 'select',
  284. boxWidth:'90',
  285. selWidth:'90',
  286. data:deptList,
  287. },
  288. render:function(rowdata, rowindex, value, column){
  289. if(rowdata.msg=="0"&&rowdata.msg!="7"){
  290. var data = getData(rowdata);
  291. if(data.PARENT_DEPT_ID_211==null){
  292. data.PARENT_DEPT_ID_211="";
  293. }
  294. if(rowdata.PARENT_DEPT_ID_211==null){
  295. rowdata.PARENT_DEPT_ID_211="";
  296. }
  297. if(data.PARENT_DEPT_ID_211!=rowdata.PARENT_DEPT_ID_211){
  298. rowdata.MAN_REMARKS_211="修改";
  299. rowdata.operation="【确认】";
  300. rowdata.msg ="6";
  301. return "<div style='background-color:#ffff00;'>"+value+"</div>";
  302. }else{
  303. return value;
  304. }
  305. }else{
  306. return value;
  307. }
  308. }
  309. },
  310. {
  311. display : '手机',
  312. name : 'PHONE_211',
  313. align : 'center',
  314. width : "100" ,
  315. editor: { type: 'text'},
  316. render:function(rowdata, rowindex, value, column){
  317. if(rowdata.msg=="0"&&rowdata.msg!="7"){
  318. var data = getData(rowdata);
  319. if(data.PHONE_211==null){
  320. data.PHONE_211="";
  321. }
  322. if(rowdata.PHONE_211==null){
  323. rowdata.PHONE_211="";
  324. }
  325. if(data.PHONE_211!=rowdata.PHONE_211){
  326. rowdata.MAN_REMARKS_211="修改";
  327. rowdata.operation="【确认】";
  328. rowdata.msg ="6";
  329. return "<div style='background-color:#ffff00;'>"+value+"</div>";
  330. }else if(!regex.test(rowdata.PHONE_211)){
  331. rowdata.MAN_REMARKS_211="非移动手机号";
  332. rowdata.operation="【确认】";
  333. rowdata.msg ="6";
  334. return "<div style='background-color:#ffff00;'>"+value+"</div>";
  335. }else{
  336. return value;
  337. }
  338. }else{
  339. return value;
  340. }
  341. }
  342. },
  343. {
  344. display : '4A账号',
  345. name : 'INLINK_INDEX_211',
  346. align : 'center',
  347. width : "140",
  348. editor: { type: 'text'},
  349. render : function(rowdata, rowindex, value, column) {
  350. value = value.replace("%40","@");
  351. return value
  352. }
  353. },{
  354. display : '备注信息',
  355. name : 'MAN_REMARKS_211',
  356. align : 'center',
  357. width : "110",
  358. },{
  359. display :'操作',
  360. name :'operation',
  361. align : 'center',
  362. width : "80",
  363. render:function(rowdata, rowindex, value, column){
  364. if(value==undefined||value==""){
  365. return "";
  366. }else{
  367. return "<span class='confirm' onclick='confirm("+rowindex+")'>"+value+"</span>";
  368. }
  369. }
  370. }
  371. ],
  372. data:data,
  373. usePager : false,
  374. rownumbers:true,
  375. width:"100%",
  376. checkbox:true,
  377. multihead:true,
  378. enabledEdit: true, //编辑用
  379. rowAttrRender:rowRender,
  380. alternatingRow:false,
  381. excelMode:true
  382. })
  383. }
  384. //msg: 0正常 1账号为空 2新增 3人员不在本单位 4账号与姓名不匹配 5拟删除 6修改 7确认修改后的
  385. function rowRender(rowdata,id){
  386. var msg = rowdata.msg;
  387. if(msg=="0"||msg=="7"){//正常数据
  388. return "style = 'background-color:#ffffff;'";
  389. }else if(msg=="1"){//账号为空的数据
  390. rowdata.operation="【确认】";
  391. return "style='background-color:#ff0000;'" ;
  392. }else if(msg=="2"){//新增的数据
  393. rowdata.operation="【确认】";
  394. return "style='background-color:#ffff00;'" ;
  395. }else if(msg=="3"){//账号与姓名不匹配的数据
  396. rowdata.operation="【确认】";
  397. return "style='background-color:#ff0000;'" ;
  398. }else if(msg=="4"){//人员不在本单位的数据
  399. rowdata.operation="【确认】";
  400. return "style='background-color:#ff0000;'" ;
  401. }else if(msg=="5"){//拟删除的数据
  402. rowdata.operation="【确认】";
  403. return "style = 'background-color:#ffc000;'";
  404. }
  405. }
  406. function getData(rowdata){
  407. var rows = orginalData.rows;
  408. var data = null; //原始数据
  409. rowdata.INLINK_INDEX_211 = rowdata.INLINK_INDEX_211.replace("%40","@");
  410. for(var i=0;i<rows.length;i++){
  411. var loginName = rows[i].INLINK_INDEX_211;
  412. if(loginName==rowdata.INLINK_INDEX_211){
  413. data = rows[i];
  414. break;
  415. }
  416. }
  417. return data;
  418. }
  419. //msg: 0正常 1账号为空 2新增 3账号与姓名不匹配 4人员不在本单位 5拟删除 6修改
  420. function confirm(rowindex){
  421. var rowdata = g.getRow(rowindex);
  422. var login_name = rowdata.INLINK_INDEX_211.replace("%40","@");
  423. var corp_name = rowdata.PARENT_ORG_ID_211_SHOW;
  424. var real_name = rowdata.INLINK_NAME_211;
  425. var msg = rowdata.msg;
  426. if(msg=="1"||msg=="2"){//填写账号后需要确认单位和姓名 新增的账号也需要确认单位和姓名
  427. if(login_name==""){
  428. top.Dialog.alert("请填写账号!");
  429. return;
  430. }
  431. if(corp_name==""){
  432. top.Dialog.alert("请填写单位!");
  433. return;
  434. }
  435. var flag1 = confirmCorp(login_name,corp_name);
  436. if(!flag1){
  437. top.Dialog.alert(real_name+"不在"+corp_name+"中,请确认相关信息后填写!");
  438. return;
  439. }
  440. var flag2 = confirmName(login_name,corp_name);
  441. if(!flag1){
  442. top.Dialog.alert("账号与姓名不匹配,请确认相关信息后填写!");
  443. return;
  444. }
  445. if(flag1&&flag2){
  446. rowdata.MAN_REMARKS_211="";
  447. rowdata.msg ="7";
  448. rowdata.operation = "";
  449. }
  450. }else if(msg=="3"){//3账号与姓名不匹配
  451. var flag = confirmName(login_name,real_name);
  452. if(flag){
  453. rowdata.MAN_REMARKS_211="";
  454. rowdata.msg ="7";
  455. rowdata.operation = "";
  456. }else{
  457. top.Dialog.alert("账号与姓名不匹配,请确认相关信息后填写!");
  458. return;
  459. }
  460. }else if(msg=="4"){// 4人员不在本单位
  461. var flag = confirmCorp(login_name,real_name);
  462. if(flag){
  463. rowdata.MAN_REMARKS_211="";
  464. rowdata.msg ="7";
  465. rowdata.operation = "";
  466. }else{
  467. top.Dialog.alert(real_name+"不在"+corp_name+"中,请确认相关信息后填写!");
  468. return;
  469. }
  470. }else if(msg=="5"){//5拟删除
  471. rowdata.MAN_REMARKS_211="";
  472. g.deleteRow(rowindex);
  473. }else if(msg=="6"){//6修改
  474. rowdata.MAN_REMARKS_211="";
  475. rowdata.msg ="7";
  476. rowdata.operation = "";
  477. }
  478. g.loadData();
  479. }
  480. function moveUp(){
  481. var rows = g.getSelectedRows();
  482. var rowsLength = rows.length;
  483. if (rowsLength == 0) {
  484. top.Dialog.alert("请选中要移动的记录!");
  485. return;
  486. }
  487. if (rows.length > 1) {
  488. top.Dialog.alert("只能选择一条记录");
  489. return;
  490. }
  491. if (rows[0].__index == 0) {
  492. top.Dialog.alert("已经移动到顶端!");
  493. return;
  494. }
  495. var nowRow = rows[0];
  496. var index = nowRow.__index;
  497. var preRow = g.getRow(index-1);
  498. var data = g.getData();
  499. nowRow.SORT_NO = nowRow.SORT_NO-1;
  500. preRow.SORT_NO = preRow.SORT_NO+1;
  501. data[index-1]=nowRow;
  502. data[index]=preRow;
  503. var json = {"rows":data}
  504. initGrid(json);
  505. g.select(index-1);
  506. }
  507. function moveDown(){
  508. var data = g.getData();
  509. var rows = g.getSelectedRows();
  510. var rowsLength = rows.length;
  511. if (rowsLength == 0) {
  512. top.Dialog.alert("请选中要移动的记录!");
  513. return;
  514. }
  515. if (rows.length > 1) {
  516. top.Dialog.alert("只能选择一条记录");
  517. return;
  518. }
  519. if (rows[0].__index ==data.length-1) {
  520. top.Dialog.alert("已经移动到底端!");
  521. return;
  522. }
  523. var nowRow = rows[0];
  524. var index = nowRow.__index;
  525. var nextRow = g.getRow(index+1);
  526. nowRow.SORT_NO = nowRow.SORT_NO+1;
  527. nextRow.SORT_NO = nextRow.SORT_NO-1;
  528. data[index+1]=nowRow;
  529. data[index]=nextRow;
  530. var json = {"rows":data}
  531. initGrid(json);
  532. g.select(index+1);
  533. }
  534. function deleteData(){
  535. var row = g.getSelectedRow();
  536. var index = row.__index;
  537. top.Dialog.confirm("确定要删除"+row.INLINK_NAME_211+"吗?",function(){
  538. g.deleteRow(index);
  539. })
  540. }
  541. function addData(){
  542. var rows = g.getData();
  543. var newRow = {
  544. "SORT_NO_211":rows.length+1,
  545. "EMC_ROLE_211_SHOW":"",
  546. "INLINK_NAME_211":"",
  547. "PARENT_ORG_ID_211_SHOW":"",
  548. "PARENT_DEPT_ID_211":"",
  549. "PHONE_211":"",
  550. "INLINK_INDEX_211":"",
  551. "MAN_REMARKS_211":"新增",
  552. "operation":"【确认】",
  553. "msg":"2"
  554. };
  555. g.addRow(newRow);
  556. }
  557. function reImport(){
  558. location.reload();
  559. }
  560. function confirmAll(){
  561. var rows = g.getData();
  562. for(var i=0;i<rows.length;i++){
  563. confirm(i);
  564. }
  565. }
  566. function confirmCorp(login_name,corp_name){
  567. var flag = false;
  568. var params ={
  569. "login_name":login_name,
  570. "corp_name":corp_name
  571. }
  572. $.ajax({
  573. data:params,
  574. type:'post',
  575. dataType:'text',
  576. async:false,
  577. url:"/nwyj/ws/LinkMan/LinkManService/confirmCorp/",
  578. success:function(result){
  579. if(result=="true"){
  580. flag = true;
  581. }
  582. },
  583. error:function(){
  584. top.Dialog.alert("确认单位信息失败!");
  585. }
  586. });
  587. return flag;
  588. }
  589. function confirmName(login_name,real_name){
  590. var flag = false;
  591. var params ={
  592. "login_name":login_name,
  593. "real_name":real_name
  594. }
  595. $.ajax({
  596. data:params,
  597. type:'post',
  598. dataType:'text',
  599. async:false,
  600. url:"/nwyj/ws/LinkMan/LinkManService/confirmName/",
  601. success:function(result){
  602. if(result=="true"){
  603. flag = true;
  604. }
  605. },
  606. error:function(){
  607. top.Dialog.alert("确认姓名信息失败!");
  608. }
  609. });
  610. return flag;
  611. }
  612. function saveData(){
  613. var rows = g.getData();
  614. var json = JSON.stringify(rows);
  615. var params ={
  616. "json":json,
  617. "virtual_org_id":VIRTUAL_ORG_ID,
  618. "made_man_id":made_man_id,
  619. "made_man":made_man,
  620. "made_man_phone":made_man_phone,
  621. "name":name,
  622. "is_issue":"0"
  623. }
  624. $.ajax({
  625. data:params,
  626. type:'post',
  627. dataType:'text',
  628. url:"/nwyj/ws/LinkMan/LinkManService/saveData/",//保存和发布用的同一个后台
  629. success:function(result){
  630. if(result=="success"){
  631. top.Dialog.alert("保存成功!");
  632. }else{
  633. top.Dialog.alert("保存失败!");
  634. }
  635. },
  636. error:function(){
  637. top.Dialog.alert("保存失败!");
  638. }
  639. });
  640. }
  641. function issueData(){
  642. var rows = g.getData();
  643. var flag = true;
  644. for(var i=0;i<rows.length;i++){
  645. var rowdata = rows[i];
  646. if(rowdata.EMC_ROLE_211_SHOW==""||rowdata.EMC_ROLE_211_SHOW==undefined){
  647. top.Dialog.alert("请选择第"+(i+1)+"行的应急角色!");
  648. flag = false;
  649. break;
  650. }
  651. if(rowdata.INLINK_NAME_211==""||rowdata.INLINK_NAME_211==undefined){
  652. top.Dialog.alert("请填写第"+(i+1)+"行的姓名!");
  653. flag = false;
  654. break;
  655. }
  656. if(rowdata.PARENT_ORG_ID_211_SHOW==""||rowdata.PARENT_ORG_ID_211_SHOW==undefined){
  657. top.Dialog.alert("请填写第"+(i+1)+"行的所属单位!");
  658. flag = false;
  659. break;
  660. }
  661. if(rowdata.PARENT_DEPT_ID_211==""||rowdata.PARENT_DEPT_ID_211==undefined){
  662. top.Dialog.alert("请选择第"+(i+1)+"行的所属部门!");
  663. flag = false;
  664. break;
  665. }
  666. if(rowdata.PHONE_211==""||rowdata.PHONE_211==undefined){
  667. top.Dialog.alert("请选择第"+(i+1)+"行的手机号!");
  668. flag = false;
  669. break;
  670. }
  671. if(rowdata.INLINK_INDEX_211 ==""||rowdata.INLINK_INDEX_211 ==undefined){
  672. top.Dialog.alert("请选择第"+(i+1)+"行的4A账号!");
  673. flag = false;
  674. break;
  675. }
  676. }
  677. if(!flag){
  678. return;
  679. }
  680. var json = JSON.stringify(rows);
  681. var params ={
  682. "json":json,
  683. "virtual_org_id":VIRTUAL_ORG_ID,
  684. "made_man_id":made_man_id,
  685. "made_man":made_man,
  686. "made_man_phone":made_man_phone,
  687. "name":name,
  688. "is_issue":"1"
  689. }
  690. $.ajax({
  691. data:params,
  692. type:'post',
  693. dataType:'text',
  694. url:"/nwyj/ws/LinkMan/LinkManService/issueData/",
  695. success:function(result){
  696. if(result=="success"){
  697. top.Dialog.alert("发布成功!");
  698. }else{
  699. top.Dialog.alert("发布失败!");
  700. }
  701. },
  702. error:function(){
  703. top.Dialog.alert("发布失败!");
  704. }
  705. });
  706. }
  707. function updateUserId(){
  708. $.ajax({
  709. data:{"a":"0"},
  710. type:'post',
  711. dataType:'text',
  712. url:"/nwyj/ws/LinkMan/LinkManService/updateUserId/",
  713. success:function(result){
  714. },
  715. error:function(){
  716. top.Dialog.alert("更新数据失败!");
  717. }
  718. });
  719. }
  720. //用于更新数据
  721. function updateOrgId(){
  722. $.ajax({
  723. data:{"a":"0"},
  724. type:'post',
  725. dataType:'text',
  726. url:"/nwyj/ws/LinkMan/LinkManService/updateOrgId/",
  727. success:function(result){
  728. },
  729. error:function(){
  730. top.Dialog.alert("更新数据失败!");
  731. }
  732. });
  733. }
  734. </script>
  735. </html>