8771ed756e3bdb96055542eb59681bb3fcaeeebb.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. var g;
  3. var specialty={"list":[
  4. {value:"1",key:"输电",suggest:"输电|shudian|sd"},
  5. {value:"2",key:"变电(一次)",suggest:"变电(一次)|biandianyici|bdyc"},
  6. {value:"3",key:"变电(二次)",suggest:"变电(二次)|biandianerci|bdec"},
  7. {value:"4",key:"通信",suggest:"通信|tongxi|tx"},
  8. {value:"5",key:"配电(中压)",suggest:"配电(中压)|peidianzhongya|pdzy"},
  9. {value:"6",key:"配电(低压)",suggest:"配电(低压)|peidiandiya|pddy"},
  10. {value:"7",key:"土建",suggest:"土建|tujian|tj"},
  11. {value:"8",key:"机械",suggest:"机械|jixie|jx"},
  12. {value:"9",key:"水工",suggest:"水工|shuigong|sg"},
  13. {value:"10",key:"后勤",suggest:"后勤|houqin|hq"},
  14. {value:"11",key:"医疗",suggest:"医疗|yiliao|yl"},
  15. {value:"12",key:"其他",suggest:"其他|qita|qt"}]};
  16. var changeType={"list":[
  17. {value:"1",key:"新建",suggest:""},
  18. {value:"2",key:"更新",suggest:""}]};
  19. var sex={"list":[
  20. {value:"1",key:"男",suggest:""},
  21. {value:"0",key:"女",suggest:""}]};
  22. var staff={"list":[
  23. {value:"0",key:"是",suggest:""},
  24. {value:"1",key:"否",suggest:""}]};
  25. var zhicheng={"list":[
  26. {value:"1",key:"高级工程师",suggest:""},
  27. {value:"2",key:"中级工程师",suggest:""},
  28. {value:"3",key:"初级工程师",suggest:""}]};
  29. var zhiwu={"list":[
  30. {value:"1",key:"主任",suggest:""},
  31. {value:"2",key:"副主任",suggest:""},
  32. {value:"3",key:"科长",suggest:""},
  33. {value:"4",key:"副科长",suggest:""}]};
  34. var xieli={"list":[
  35. {value:"1",key:"大专",suggest:""},
  36. {value:"2",key:"本科",suggest:""},
  37. {value:"3",key:"硕士",suggest:""},
  38. {value:"4",key:"博士",suggest:""}]};
  39. var data;
  40. function initComplete(){
  41. var data1 = $("#expert").val();
  42. data = JSON.parse(decodeURI(data1));
  43. g = $("#maingrid").quiGrid({
  44. columns: [
  45. { display: '序号', name: 'EXPERT_ID_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
  46. { display: '姓名', name: 'EXPERT_NAME_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
  47. { display: '性别', name: 'EXPERT_SEX_260', align: 'center', width: "150px",
  48. editor: { type: 'select',data:sex,selWidth:150 },render:function (item){
  49. for (var i = 0; i < sex["list"].length; i++)
  50. {
  51. if (sex["list"][i]['value'] == item.EXPERT_SEX_260)
  52. return sex["list"][i]['key'];
  53. }
  54. return item.EXPERT_SEX_260;
  55. }
  56. },
  57. { display: '出生年月', name: 'EXPERT_BIRTHDAY_260', align: 'center', width: "150px" ,editor: { type: 'date',dateFmt:'yyyy-MM-dd'}},
  58. { display: '座机', name: 'EXPERT_TEL_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
  59. { display: '手机', name: 'EXPERT_CAL_260', align: 'center' , width: "150px" ,editor: { type: 'text'}},
  60. { display: 'Email', name: 'EXPERT_EMAIL_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
  61. { display: '学历', name: 'EDUCATION_260', align: 'center', width: "150px" ,
  62. editor: { type: 'select',data:xieli,selWidth:150 },render:function (item){
  63. for (var i = 0; i < xieli["list"].length; i++)
  64. {
  65. if (xieli["list"][i]['value'] == item.EDUCATION_260)
  66. return xieli["list"][i]['key'];
  67. }
  68. return item.EDUCATION_260;
  69. }
  70. },
  71. { display: '所属区域', name: 'EXPERT_AREA_260', align: 'center' , width: "150px" ,editor: { type: 'text'}},
  72. // { display: '是否南网员工', name: 'IS_SNSTAFF_260', align: 'center', width: "150px" ,
  73. // editor: { type: 'select',data:staff,selWidth:150 },render:function (item){
  74. // for (var i = 0; i < staff["list"].length; i++)
  75. // {
  76. // if (staff["list"][i]['value'] == item.IS_SNSTAFF_260)
  77. // return staff["list"][i]['key'];
  78. // }
  79. // return item.IS_SNSTAFF_260;
  80. // }
  81. // },
  82. { display: '参加工作时间', name: 'WORK_TIME_260', align: 'center', width: "150px" ,editor: { type: 'date',dateFmt:'yyyy-MM-dd'}},
  83. { display: '职称', name: 'EXPERT_TYPE_260', align: 'center', width: "150px",
  84. editor: { type: 'select',data:zhicheng,selWidth:150 },render:function (item){
  85. for (var i = 0; i < zhicheng["list"].length; i++)
  86. {
  87. if (zhicheng["list"][i]['value'] == item.EXPERT_TYPE_260)
  88. return zhicheng["list"][i]['key'];
  89. }
  90. return item.EXPERT_TYPE_260;
  91. }
  92. },
  93. { display: '职务', name: 'EXPERT_POST_260', align: 'center', width: "150px",
  94. editor: { type: 'select',data:zhiwu,selWidth:150 },render:function (item){
  95. for (var i = 0; i < zhiwu["list"].length; i++)
  96. {
  97. if (zhiwu["list"][i]['value'] == item.EXPERT_POST_260)
  98. return zhiwu["list"][i]['key'];
  99. }
  100. return item.EXPERT_POST_260;
  101. }
  102. },
  103. { display: '住址', name: 'EXPERT_ADDRESS_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
  104. { display: '住址邮编', name: 'EXPERT_POSTALCODE_260', align: 'center', width: "150px",editor: { type: 'text'}},
  105. { display: '专业特长', name: 'EXPERT_SPECIALTY_260', align: 'center', width: "150px" ,
  106. editor: { type: 'select',data:specialty,selWidth:150 },render:function (item){
  107. for (var i = 0; i < specialty["list"].length; i++)
  108. {
  109. if (specialty["list"][i]['value'] == item.EXPERT_SPECIALTY_260)
  110. return specialty["list"][i]['key'];
  111. }
  112. return item.EXPERT_SPECIALTY_260;
  113. }
  114. },
  115. { display: '应急处置经验', name: 'EXPERT_EXP_260', align: 'center', width: "150px",editor: { type: 'text'}},
  116. { display: '变更说明', name: 'CHANGE_DESCRIPTION_260', align: 'center', width: "150px",editor: { type: 'text'}},
  117. // { display: '变更类型', name: 'CHANGE_TYPE_260', align: 'center', width: "150px",
  118. // editor: { type: 'select',data:changeType,selWidth:150 },render:function (item){
  119. // for (var i = 0; i < changeType["list"].length; i++)
  120. // {
  121. // if (changeType["list"][i]['value'] == item.CHANGE_TYPE_260)
  122. // return changeType["list"][i]['key'];
  123. // }
  124. // return item.CHANGE_TYPE_260;
  125. // }
  126. // },
  127. { display: '认定时间', name: 'IDENTIFICATION_TIME_260', align: 'center', width: "150px",editor: { type: 'date',dateFmt:'yyyy-MM-dd'}},
  128. { display: '工作简历', name: 'EXPERT_RESUME_260', align: 'center', width: "150px",editor: { type: 'text'}}
  129. ],
  130. data:data,
  131. sortName : '',
  132. sortOrder : '',
  133. rownumbers:true,
  134. checkbox:true,
  135. height: '100%',
  136. width:"100%",
  137. pageSize: 10,
  138. enabledEdit: true, //编辑用
  139. // onBeforeSubmitEdit: onBeforeSubmitEdit,
  140. percentWidthMode:true,
  141. //顶部图标按钮栏
  142. toolbar:{
  143. items:[
  144. {text: '批量保存', click: saveAll, iconClass: 'icon_add'},
  145. { line : true },
  146. {text: '窗口', click: chuangkou, iconClass: 'icon_add'},
  147. { line : true }
  148. ]
  149. }
  150. });
  151. }
  152. function saveAll(){
  153. var rows=g.getSelectedRows();
  154. var rowsLength = rows.length;
  155. if (rowsLength == 0) {
  156. top.Dialog.alert("请选中要导入的信息!");
  157. return;
  158. }
  159. var json=JSON.stringify(rows);
  160. var myobj=eval(json);
  161. for(var i=0;i<myobj.length;i++){
  162. var EXPERT_ID_260 = myobj[i].EXPERT_ID_260;
  163. var EXPERT_NAME_260 = myobj[i].EXPERT_NAME_260;
  164. var EXPERT_SEX_260 = myobj[i].EXPERT_SEX_260;
  165. var EXPERT_BIRTHDAY_260 = myobj[i].EXPERT_BIRTHDAY_260;
  166. var EXPERT_CAL_260 = myobj[i].EXPERT_CAL_260;
  167. // var EXPERT_AREA_260 = myobj[i].EXPERT_AREA_260;
  168. var WORK_TIME_260 = myobj[i].WORK_TIME_260;
  169. // var EXPERT_ADDRESS_260 = myobj[i].EXPERT_ADDRESS_260;
  170. var EXPERT_SPECIALTY_260 = myobj[i].EXPERT_SPECIALTY_260;
  171. var IDENTIFICATION_TIME_260 = myobj[i].IDENTIFICATION_TIME_260;
  172. if(EXPERT_ID_260==null||EXPERT_ID_260==""){
  173. top.Dialog.alert("序号这一列中有为空值的请补全!");
  174. return;
  175. }
  176. if(EXPERT_NAME_260==null||EXPERT_NAME_260==""){
  177. top.Dialog.alert("姓名这一列中有为空值的请补全!");
  178. return;
  179. }
  180. if(EXPERT_SEX_260==null||EXPERT_SEX_260==""){
  181. top.Dialog.alert("性别这一列中有为空值的请补全!");
  182. return;
  183. }
  184. if(EXPERT_BIRTHDAY_260==null||EXPERT_BIRTHDAY_260==""){
  185. top.Dialog.alert("出生年月这一列中有为空值的请补全!");
  186. return;
  187. }
  188. if(EXPERT_CAL_260==null||EXPERT_CAL_260==""){
  189. top.Dialog.alert("手机这一列中有为空值的请补全!!");
  190. return;
  191. }
  192. // if(EXPERT_AREA_260==null||EXPERT_AREA_260==""){
  193. // top.Dialog.alert("所属区域这一列中有为空值的请补全!");
  194. // return;
  195. // }
  196. if(WORK_TIME_260==null||WORK_TIME_260==""){
  197. top.Dialog.alert("参加工作时间这一列中有为空值的请补全!");
  198. return;
  199. }
  200. // if(EXPERT_ADDRESS_260==null||EXPERT_ADDRESS_260==""){
  201. // top.Dialog.alert("地址这一列中有为空值的请补全!");
  202. // return;
  203. // }
  204. if(EXPERT_SPECIALTY_260==null||EXPERT_SPECIALTY_260==""){
  205. top.Dialog.alert("专业这一列中有为空值的请补全!");
  206. return;
  207. }
  208. if(IDENTIFICATION_TIME_260==null||IDENTIFICATION_TIME_260==""){
  209. top.Dialog.alert("认证时间这一列中有为空值的请补全!");
  210. return;
  211. }
  212. if(EXPERT_BIRTHDAY_260 > WORK_TIME_260){
  213. $.messager.alert('生日不能比参加工作时间晚');
  214. return ;
  215. }
  216. if(WORK_TIME_260 > IDENTIFICATION_TIME_260){
  217. $.messager.alert('参加工作时间不能比认证时间晚');
  218. return ;
  219. }
  220. }
  221. var url = $.pathname()
  222. + "/ws/ExcelExpert/ReadExcelToDBTableTool/expertToDb2";
  223. var params = {
  224. classId : '260',
  225. deptId:deptId,
  226. json:json
  227. };
  228. $.ajax({
  229. url : url,
  230. type : 'post',
  231. timeout : 15000,
  232. data : params,
  233. dataType : 'json',
  234. success : function(data) {
  235. $.messager.alert('保存成功', null, null);
  236. var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
  237. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  238. },
  239. error : function(e) {
  240. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  241. }
  242. });
  243. }
  244. function chuangkou(){
  245. var diag = new top.Dialog();
  246. diag.Title = "应急组织";
  247. diag.URL = $.pathname() +"/page/business/am/public/MsgNotes/YJMsgNotesPersion.jsp?expert";
  248. diag.Width = 1260;
  249. diag.Height = 600;
  250. diag.Top = "80%";
  251. diag.Left = "50%";
  252. diag.ShowButtonRow=true;
  253. diag.ButtonAlign = 'center';
  254. diag.OkButtonText="确 定";
  255. diag.OKEvent = function(){
  256. diag.innerFrame.contentWindow.addTeamInfo();
  257. initComplete();
  258. };
  259. diag.show();
  260. }
  261. //返回
  262. function goBack() {
  263. var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
  264. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  265. }
  266. $.messager = top.Dialog;