5ae8e4aaf05c16171b8e2b89cff722f6e4921e74.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. var corp_ids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();//登陆单位ID
  2. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
  3. $(function(){
  4. $(parent.document.body).find("iframe").height($(window.document.body).height()+60);
  5. $(top.document.body).find("iframe").height($(window.document.body).height()+60);
  6. //加载时添加
  7. // $("#PROFESSIONAL_262").initCanstSelect('BM_TEAMERTYPE');
  8. // $("#PROFESSIONAL_262").render();
  9. //
  10. // $("#VOLTAGE_LEVEL_262").initCanstSelect('BM_DYDJ');
  11. // $("#VOLTAGE_LEVEL_262").render();
  12. //
  13. // $("#TEAM_QUARTERS_262").initCanstSelect('BM_TEAMER_QUARTERS');
  14. // $("#TEAM_QUARTERS_262").render();
  15. //
  16. // $('#SEX_262').initCanstSelect('BM_Gender');
  17. if((window.location.href).indexOf('?')>-1){
  18. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  19. var params = {
  20. classid : '261',
  21. objectID : teamid3
  22. };
  23. $.ajax({
  24. url : url,
  25. type : 'post',
  26. timeout : 60000,
  27. data : params,
  28. dataType : 'json',
  29. success : function(data){
  30. $("#titlename").html(data.TEAM_NAME_261+"人员信息");
  31. },
  32. error : function(e){
  33. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  34. }
  35. });
  36. }
  37. /** 绑定更多的按钮点击事件 */
  38. // $more = $("#more"); // 更多按钮
  39. // $more.bind('click', function() {
  40. // more();
  41. // });
  42. $searchOne = $("#searchOne");//查询图标绑定查询事件
  43. $searchOne.bind('click', function() {
  44. searchHandler();
  45. });
  46. $("#back").hover(function(){
  47. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  48. },function(){
  49. $(this).attr("src","/nwyj/images/temp/back.png");
  50. });
  51. });
  52. var SD_XIANLU="";
  53. var SD_XIANLANG="";
  54. var BD_YICI="";
  55. var BD_ERCI="";
  56. var PD_XIANLU="";
  57. var PD_XIANLANG="";
  58. var PD_DIANFANG="";
  59. var PD_BAODIAN="";
  60. var TONGXING="";
  61. var WANGLUO="";
  62. var SHIYAN="";
  63. var g;
  64. //列表加载参数
  65. var teamid;//队伍id
  66. var TEAM_MEMBER_NUMBER = "";//队伍人数
  67. var condition;
  68. var loadParams;
  69. var teamid2;
  70. var teamid3 = "";
  71. var corpId;
  72. function initComplete(){
  73. teamid = (window.location.href).split('?')[1];//固定的队伍第一个id
  74. teamid2 = (window.location.href).split('?')[2];//0和新id
  75. if(teamid==""||teamid.length==0){
  76. top.Dialog.alert("请从队伍查看页面进入!");
  77. window.location.href="/nwyj/page/business/am/resource/team/team.jsp";
  78. }
  79. if(teamid2=="0"){
  80. teamid3 = teamid;
  81. }else{
  82. teamid3 = teamid2;
  83. }
  84. condition = " TEAM_ID='"+ teamid + "' AND IS_DEL='0' ";
  85. loadParams = {
  86. "listId" : '262',
  87. "condition" : condition,
  88. direction:'ASC',
  89. sort: 'SORT_NO'
  90. };
  91. //顶部图标按钮栏
  92. var roleCons = roleButtonArr();
  93. var toolBarOpt1 = {
  94. items:[
  95. {text: '新增', click: "addUnit", iconClass: 'add1_tem',id:"10000"},
  96. {text: '删除', click: "deleteUnit", iconClass: 'delete_tem',id:"10002"},
  97. {text: '修改', click: "updateUnit", iconClass: 'update_tem',id:"10001"},
  98. // {text: '详情', click: "onView", iconClass: 'view_tem',id:"10003"},
  99. {text: '导入', click: "showImportDialog", iconClass: 'import_tem',id:"10004"},
  100. {text: '导出', click: "exportTotalData", iconClass: 'export_tem',id:"10006"},
  101. {text: '发送短信', click:"sendMsg" , iconClass: 'sendmsg_tem',id:"10204"},
  102. {text: '发送邮件', click:"sendEmail" , iconClass: 'sendemail_tem',id:"10205"},
  103. {text: '上移', click:"moveUp" , iconClass: 'shangyi_tem',id:"10209"},
  104. {text: '下移', click:"moveDown" , iconClass: 'xiayi_tem',id:"10209"},
  105. {text: '置顶', click:'moveDownMax1(1)', iconClass : 'zhiding_tem', id:"10209", disabled : false}
  106. // {text: '历史维护', click:"historyUnit", iconClass: 'history_tem',id:"10201"},
  107. // {text: '汇总', click:"sumUnit" , iconClass: 'poll_tem',id:"10200"},
  108. ],
  109. roleCons:roleCons
  110. };
  111. /**
  112. * 树形列
  113. */
  114. var grid_option1 ={
  115. columns: [
  116. // { display: '单位名称', name: 'TEAM_UNIT_262_SHOW', align: 'center', width: "10%"},
  117. // { display: '队伍名称及编号', name: 'TEAM_NAME_262', align: 'center', width: "10%"},
  118. { display: '姓名', name: 'NAME_262', align: 'center', width: "10%",isPrimaryKey:true,
  119. // render : function(rowdata, value) {
  120. // return '<a href="javascript:void(0)" '
  121. // + 'onclick=jumpPage("'
  122. // + rowdata.FD_OBJECTID262
  123. // +'")>'+ rowdata.NAME_262 +'</a>';
  124. // }
  125. render : function(rowdata, rowindex, value, column) {
  126. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  127. }
  128. },
  129. { display: '人员编号', name: 'CODE_262', align: 'center', width: "10%"},
  130. { display: '身份证号码', name: 'ID_NUMBER_262', align: 'center', width: "10%"},
  131. // { display: '出生年月', name: 'BIRTH_DATE_262', align: 'center', width: "150px"},
  132. { display: '性别', name: 'SEX_262_SHOW', align: 'center', width: "10%"},
  133. // { display: '本工种工龄', name: 'WORK_TYPE_AGE_262', align: 'center', width: "150px"},
  134. { display: '所在部门', name: 'DEPT_ID_262', align: 'center', width: "10%"},
  135. { display: '职务岗位', name: 'DEPT_QUARTERS_262', align: 'center', width: "10%"},
  136. // { display: '技术职称', name: 'TECHNICAL_TITLE_262', align: 'center', width: "150px"},
  137. // { display: '技能等级', name: 'SKILL_LEVEL_262', align: 'center', width: "150px"},
  138. { display: '专业', name: 'PROFESSIONAL_262_SHOW', align: 'center', width: "10%"},
  139. { display: '电压等级', name: 'VOLTAGE_LEVEL_262_SHOW', align: 'center', width: "10%"},
  140. { display: '联系手机', name: 'TELEPHONE_262', align: 'center', width: "10%"},
  141. // { display: '抢险经历', name: 'RESCUE_EXP_262', align: 'center', width: "150px"},
  142. { display: '队伍岗位', name: 'TEAM_QUARTERS_262_SHOW', align: 'center', width: "10%"}
  143. ],
  144. rownumbers:true,
  145. checkbox:true,
  146. pageSize: 10,
  147. percentWidthMode:true
  148. };
  149. var options1={
  150. url :'/nwyj/ws/crud/CRUDService/queryQui',
  151. params:loadParams,
  152. height: '100%',
  153. width:"100%",
  154. gridOptions:grid_option1,
  155. singleRecodeOptions:{a:"aa"},
  156. paperOpration:{showInput:"true"},
  157. toolBarOptions:toolBarOpt1
  158. };
  159. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  160. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  161. var params = {
  162. classid : '261',
  163. objectID : teamid
  164. };
  165. $.ajax({
  166. url : url,
  167. type : 'post',
  168. timeout : 60000,
  169. data : params,
  170. async:false, //异步
  171. dataType : 'json',
  172. success : function(data){
  173. corpId=data.TEAM_COMP_ID_261;
  174. },
  175. error : function(e){
  176. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  177. }
  178. });
  179. }
  180. //查询
  181. function searchHandler(){
  182. var name = $('#NAME_262').val();//名字
  183. // var sex = $('#SEX_262').val();//性别
  184. // var dept = $('#DEPT_QUARTERS_262').val();//职务岗位
  185. // var title = $('#TECHNICAL_TITLE_262').val();//技术职称
  186. // var skill = $('#SKILL_LEVEL_262').val();//技能等级
  187. // var pro = $('#PROFESSIONAL_262').val();//专业
  188. // var vol = $('#VOLTAGE_LEVEL_262').val();//电压等级
  189. // var quarters = $('#TEAM_QUARTERS_262').val();//队伍岗位
  190. var condition = " TEAM_ID='"+ teamid +"' AND IS_DEL='0' ";
  191. if(name!=""&&name!="请输入应急队伍人员的姓名"){
  192. condition += " AND NAME LIKE '%" +name+"%'";
  193. }
  194. // if(sex!=""){
  195. // condition += " AND SEX='"+sex+"'";
  196. // }
  197. // if(dept!=""){
  198. // condition += " AND DEPT_QUARTERS = '" +dept+"'";
  199. // }
  200. // if(title!=""){
  201. // condition += " AND TECHNICAL_TITLE = '" +title+"'";
  202. // }
  203. // if(skill!=""){
  204. // condition += " AND SKILL_LEVEL = '" +skill+"'";
  205. // }
  206. // if(pro!=""){
  207. // condition += " AND PROFESSIONAL = '" +pro+"'";
  208. // }
  209. // if(vol!=""){
  210. // condition += " AND VOLTAGE_LEVEL = '" +vol+"'";
  211. // }
  212. // if(quarters!=""){
  213. // condition += " AND TEAM_QUARTERS = '" +quarters+"'";
  214. // }
  215. g.setOptions({//重置加载列表的参数
  216. params : {
  217. "listId" :'262' ,
  218. "condition" : condition,
  219. direction:'ASC',
  220. sort: 'SORT_NO'
  221. }
  222. });
  223. // g.setNewPage(1);
  224. g.rend();//刷新列表
  225. }
  226. //新增队伍人员
  227. function addUnit(){
  228. /*if(corp_ids != corpId){
  229. top.Dialog.alert("只有本单位人员才能录入数据!");
  230. return;
  231. }*/
  232. //获取队伍id
  233. // if(teamid2=="0"){
  234. // var teamid = (window.location.href).split('?')[1];
  235. // window.location.href="teamerupdate-in.jsp?xz?"+teamid;
  236. // }else{
  237. // var teamid = (window.location.href).split('?')[2];
  238. // window.location.href="teamerupdate-in.jsp?xz?"+teamid;
  239. // }
  240. window.location.href="teamerupdate-in.jsp?xz?"+teamid+"?"+teamid2;
  241. }
  242. //修改队伍人员信息
  243. function updateUnit(){
  244. //选中人员信息
  245. var rows = g.getSelectedRows();
  246. if(rows.length==0){
  247. top.Dialog.alert("请选择一条记录");
  248. return;
  249. }
  250. if(rows.length>1){
  251. top.Dialog.alert("只能选择一条记录");
  252. return;
  253. }
  254. var fd_id = rows[0].FD_OBJECTID262;
  255. var TYPEIN_PEOPLE = rows[0].TYPEIN_PEOPLE_262;
  256. if(getUser_id!=TYPEIN_PEOPLE){
  257. top.Dialog.alert("只能维护本人录入的数据!");
  258. return;
  259. }
  260. if(teamid2=="0"){
  261. var teamid = (window.location.href).split('?')[1];
  262. window.location.href="teamerupdate-in.jsp?xg?"+fd_id+"?"+teamid+"?"+teamid;
  263. }else{
  264. var teamid1 = (window.location.href).split('?')[1];
  265. var teamid = (window.location.href).split('?')[2];
  266. window.location.href="teamerupdate-in.jsp?xg?"+fd_id+"?"+teamid+"?"+teamid1;
  267. }
  268. }
  269. function initValue(){
  270. var fd_teamid;
  271. if(teamid2=="0"){
  272. fd_teamid = teamid;
  273. }else{
  274. fd_teamid = teamid2;
  275. }
  276. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  277. var params = {
  278. classid : '261',
  279. objectID : fd_teamid
  280. };
  281. $.ajax({
  282. url : url,
  283. type : 'post',
  284. timeout : 60000,
  285. data : params,
  286. dataType : 'json',
  287. success : function(data){
  288. TEAM_MEMBER_NUMBER = data.TEAM_MEMBER_NUMBER_261;//队伍人数
  289. SD_XIANLU = data.SD_XIANLU_261;//输电线路
  290. SD_XIANLANG = data.SD_XIANLANG_261;//输电线缆
  291. BD_YICI = data.BD_YICI_261;//变电一次
  292. BD_ERCI = data.BD_ERCI_261;//变电二次
  293. PD_XIANLU = data.PD_XIANLU_261;//信息通信
  294. PD_XIANLANG = data.PD_XIANLANG_261;//海缆
  295. PD_DIANFANG = data.PD_DIANFANG_261;//物资
  296. PD_BAODIAN = data.PD_BAODIAN_261;//消防
  297. TONGXING = data.TONGXING_261;//后勤保障
  298. /*WANGLUO = data.WANGLUO_261;//网络
  299. SHIYAN = data.SHIYAN_261;//试验
  300. */// alert(TEAM_MEMBER_NUMBER + "***" + SD_XIANLU + "***" + SD_XIANLANG + "***");
  301. },
  302. error : function(e){
  303. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  304. }
  305. });
  306. }
  307. var Zhuanye;
  308. //删除用队伍总人数
  309. function deleteall(a,b,c,d,e,f,m,h,n,j,k){
  310. Zhuanye = "TEAM_MEMBER_NUMBER='"+(Number(TEAM_MEMBER_NUMBER )-rowsLength)+"',SD_XIANLU='"+(Number(SD_XIANLU )-a)+"'," +
  311. "SD_XIANLANG='"+(Number(SD_XIANLANG )-b)+"',BD_YICI='"+(Number(BD_YICI )-c)+"',BD_ERCI='"+(Number(BD_ERCI )-d)+"'," +
  312. "PD_XIANLU='"+(Number(PD_XIANLU )-e)+"',PD_XIANLANG='"+(Number(PD_XIANLANG )-f)+"',PD_DIANFANG='"+(Number(PD_DIANFANG )-m)+"'," +
  313. "PD_BAODIAN='"+(Number(PD_BAODIAN )-h)+"',TONGXING='"+(Number(TONGXING )-n)+"',WANGLUO='"+(Number(WANGLUO )-j)+"',SHIYAN='"+(Number(SHIYAN )-k)+"'";
  314. $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/tremUpdate/", {
  315. //应急队伍各个类型人数:字段名 + 人数 例如:应急保电人数:PD_BAODIAN:1
  316. comp_id : Zhuanye,
  317. //将应急队伍ID作为公共变量在这里取就行。
  318. fd_id : teamid,//应急队伍ID
  319. }, function(result) {
  320. if (result.Msg.sucsess == true) {
  321. $.messager.alert("删除成功",null,null,null,-1);
  322. } else {
  323. top.Dialog.alert("删除失败");
  324. return;
  325. }
  326. }, "json");
  327. }
  328. var rowsLength;
  329. //删除
  330. function deleteUnit(){
  331. initValue();//点击删除之前取系统里队伍人员的歌类型的值
  332. var rows = g.getSelectedRows();
  333. rowsLength = rows.length;
  334. if (rowsLength == 0) {
  335. top.Dialog.alert("请选中要删除的记录!");
  336. return;
  337. }
  338. var a="0";var b="0";var c="0";var d="0";var e="0";var f="0";var m="0";var h="0";var n="0";var j="0";var k="0";
  339. var ids = "";
  340. for ( var i = 0; i < rowsLength; i++) {
  341. ids += rows[i].FD_OBJECTID262 + ",";
  342. var TYPEIN_PEOPLE = rows[0].TYPEIN_PEOPLE_262;
  343. if(getUser_id!=TYPEIN_PEOPLE){
  344. top.Dialog.alert("只能删除本人录入的数据!");
  345. return;
  346. }
  347. if(rows[i].PROFESSIONAL_262=="1"){
  348. a++;
  349. }else if(rows[i].PROFESSIONAL_262=="2"){
  350. b++;
  351. }else if(rows[i].PROFESSIONAL_262=="3"){
  352. c++;
  353. }else if(rows[i].PROFESSIONAL_262=="4"){
  354. d++;
  355. }else if(rows[i].PROFESSIONAL_262=="5"){
  356. e++;
  357. }else if(rows[i].PROFESSIONAL_262=="6"){
  358. f++;
  359. }else if(rows[i].PROFESSIONAL_262=="7"){
  360. m++;
  361. }else if(rows[i].PROFESSIONAL_262=="8"){
  362. h++;
  363. }else if(rows[i].PROFESSIONAL_262=="9"){
  364. n++;
  365. }else if(rows[i].PROFESSIONAL_262=="10"){
  366. j++;
  367. }else if(rows[i].PROFESSIONAL_262=="11"){
  368. k++;
  369. }
  370. }
  371. // alert("a+b+c+d+e+f+m+h+n+j+k:****"+a+b+c+d+e+f+m+h+n+j+k);
  372. top.Dialog.confirm("确定要删除吗?|删除", function() {
  373. // 删除记录
  374. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  375. "objectIDs" : ids,
  376. classid : 262
  377. }, function(result) {
  378. if (result.Msg.sucsess == true) {
  379. deleteall(a,b,c,d,e,f,m,h,n,j,k);//修改应急队伍总人数
  380. // $.messager.alert("删除成功",null,null,null,-1);
  381. initValue();//删除成功后再取一下队伍各类型人数
  382. // 刷新表格数据
  383. g.rend();
  384. } else {
  385. top.Dialog.alert("删除失败!");
  386. }
  387. }, "json");
  388. });
  389. }
  390. //点击查看
  391. function jumpPage(id){
  392. if(teamid2!="0"){
  393. window.location.href="teamerinfo-in.jsp?"+id+"?"+teamid2;
  394. }else{
  395. window.location.href="teamerinfo-in.jsp?"+id+"?0";
  396. }
  397. }
  398. //点击主键跳转详细信息页面
  399. this.openDetail = function(rowindex) {
  400. var row = g.getRow(rowindex);
  401. var fd_id = row.FD_OBJECTID262;
  402. if(teamid2!="0"){
  403. // window.location.href="teamerinfo-in.jsp?"+fd_id+"?"+teamid2;
  404. $.indexOpenNextWindow("/nwyj/page/business/am/resource/team/teamerinfo-in.jsp?"+fd_id+"?"+teamid2);
  405. }else{
  406. // window.location.href="teamerinfo-in.jsp?"+fd_id+"?0";
  407. $.indexOpenNextWindow("/nwyj/page/business/am/resource/team/teamerinfo-in.jsp?"+fd_id+"?0");
  408. }
  409. };
  410. function showPrimaryKey(obj,index){
  411. var fd_id = obj.FD_OBJECTID262;
  412. if(teamid2!="0"){
  413. // window.location.href="teamerinfo-in.jsp?"+fd_id+"?"+teamid2;
  414. $.indexOpenNextWindow("/nwyj/page/business/am/resource/team/teamerinfo-in.jsp?"+fd_id+"?"+teamid2);
  415. }else{
  416. // window.location.href="teamerinfo-in.jsp?"+fd_id+"?0";
  417. $.indexOpenNextWindow("/nwyj/page/business/am/resource/team/teamerinfo-in.jsp?"+fd_id+"?0");
  418. }
  419. }
  420. //详情
  421. function onView(){
  422. var rows = g.getSelectedRows();
  423. if(rows.length==0){
  424. top.Dialog.alert("请选择一条记录");
  425. return;
  426. }
  427. if(rows.length>1){
  428. top.Dialog.alert("只能选择一条记录");
  429. return;
  430. }
  431. var fd_id = rows[0].FD_OBJECTID262;
  432. if(teamid2=="0"){
  433. window.location.href="teamerinfo-in.jsp?"+fd_id+"?0";
  434. }else{
  435. window.location.href="teamerinfo-in.jsp?"+fd_id+"?"+teamid2;
  436. }
  437. }
  438. //导入
  439. function showImportDialog(){
  440. /*if(corp_ids != corpId){
  441. top.Dialog.alert("只有本单位人员才能录入数据!");
  442. return;
  443. }
  444. */
  445. window.location.href="teamer-import-inside.jsp?"+teamid;
  446. }
  447. //导出
  448. function exportTotalData(){
  449. var rows = g.getSelectedRows();
  450. var rowsLength = rows.length;
  451. if (rowsLength == 0) {
  452. top.Dialog.confirm("是否导出所有的应急队伍信息?|确定", function() {
  453. excelExport(262,loadParams,"应急队伍人员信息","IS_DEL,UPDATEDATE,FD_OBJECTID,CERTIFICATE,TEAM_SYSTEM,TEAM_ID,SORT_NO");});
  454. return;
  455. }
  456. var ids = "";
  457. for ( var i = 0; i < rowsLength; i++) {
  458. ids += "'"+rows[i].FD_OBJECTID262+"'" + ",";
  459. }
  460. var temp = ids.substring(0,ids.length-1);
  461. var condition = " IS_DEL='0' ";
  462. condition += " AND FD_OBJECTID IN (" + temp + ") " ;
  463. var sql = {
  464. "listId" :'262' ,
  465. "condition" : condition,
  466. direction:'ASC',
  467. sort: 'SORT_NO'
  468. };
  469. excelExport(262,sql,"应急队伍人员信息","IS_DEL,UPDATEDATE,FD_OBJECTID,CERTIFICATE,TEAM_SYSTEM,TEAM_ID,SORT_NO");
  470. }
  471. //发送短信
  472. function sendMsg(){
  473. var rows = g.getSelectedRows();
  474. var rowsLength = rows.length;
  475. if (rowsLength == 0) {
  476. top.Dialog.alert("请选中要发送的人员信息!");
  477. return;
  478. }
  479. var name = "";
  480. var iphone = "";
  481. for ( var i = 0; i < rowsLength; i++) {
  482. name += rows[i].NAME_262 + ";";
  483. iphone += rows[i].TELEPHONE_262 + ";";
  484. }
  485. addMsg(name,iphone);
  486. }
  487. //发送邮件
  488. function sendEmail(){
  489. window.location.href = "mailto:example@example.com";
  490. }
  491. //历史记录
  492. function historyUnit(){
  493. }
  494. //汇总
  495. function sumUnit(){
  496. }
  497. /***********************************移动*************************************/
  498. //上移
  499. function moveUp(){
  500. var rows = g.getSelectedRows();
  501. var rowsLength = rows.length;
  502. if (rowsLength == 0) {
  503. top.Dialog.alert("请选中要移动的记录!");
  504. return;
  505. }
  506. if (rows.length > 1) {
  507. top.Dialog.alert("只能选择一条记录");
  508. return;
  509. }
  510. if (rows[0].__index == 0) {
  511. top.Dialog.alert("已经移动到顶端!");
  512. return;
  513. }
  514. var up_id = g.getRow(rows[0].__index-1).FD_OBJECTID262;
  515. var fd_id = rows[0].FD_OBJECTID262;
  516. var up_sort = g.getRow(rows[0].__index-1).SORT_NO_262;
  517. var fd_sort = rows[0].SORT_NO_262;
  518. getMoveSort("EMC_AM_TEAM_PERSONNEL",up_id,fd_id,up_sort,fd_sort,g,rows[0].__index-1);
  519. }
  520. //下移
  521. function moveDown(){
  522. var rows = g.getSelectedRows();
  523. var rowsLength = rows.length;
  524. if (rowsLength == 0) {
  525. top.Dialog.alert("请选中要移动的记录!");
  526. return;
  527. }
  528. if (rows.length > 1) {
  529. top.Dialog.alert("只能选择一条记录");
  530. return;
  531. }
  532. if(rows[0].__index+1==g.getData().length){
  533. top.Dialog.alert("已经移动到底端!");
  534. return;
  535. }
  536. var up_id = g.getRow(rows[0].__index+1).FD_OBJECTID262;
  537. var fd_id = rows[0].FD_OBJECTID262;
  538. var up_sort = g.getRow(rows[0].__index+1).SORT_NO_262;
  539. var fd_sort = rows[0].SORT_NO_262;
  540. getMoveSort("EMC_AM_TEAM_PERSONNEL",up_id,fd_id,up_sort,fd_sort,g,rows[0].__index+1);
  541. }
  542. //置顶方法
  543. function moveDownMax1(max){
  544. var rows = g.getSelectedRows();
  545. var rowsLength = rows.length;
  546. if (rowsLength == 0) {
  547. top.Dialog.alert("请选中要移动的记录!");
  548. return;
  549. }
  550. if (rows.length > 1) {
  551. top.Dialog.alert("只能选择一条记录");
  552. return;
  553. }
  554. var fd_id = rows[0].FD_OBJECTID262;
  555. //选中人的虚拟机构ID需要根据改ID去查询当前ID下挂着的人最小的序号
  556. var xuniId = rows[0].TEAM_ID_262;
  557. moveDownMax("EMC_AM_TEAM_PERSONNEL","SORT_NO",max,xuniId,"TEAM_ID",fd_id,g);
  558. }
  559. function goBack(){
  560. window.location.href="team.jsp";
  561. // window.location.href="teaminfo.jsp?"+teamid+"?"+teamid2;
  562. }
  563. $.messager=top.Dialog;