123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var g;
- var specialty={"list":[
- {value:"1",key:"输电",suggest:"输电|shudian|sd"},
- {value:"2",key:"变电(一次)",suggest:"变电(一次)|biandianyici|bdyc"},
- {value:"3",key:"变电(二次)",suggest:"变电(二次)|biandianerci|bdec"},
- {value:"4",key:"通信",suggest:"通信|tongxi|tx"},
- {value:"5",key:"配电(中压)",suggest:"配电(中压)|peidianzhongya|pdzy"},
- {value:"6",key:"配电(低压)",suggest:"配电(低压)|peidiandiya|pddy"},
- {value:"7",key:"土建",suggest:"土建|tujian|tj"},
- {value:"8",key:"机械",suggest:"机械|jixie|jx"},
- {value:"9",key:"水工",suggest:"水工|shuigong|sg"},
- {value:"10",key:"后勤",suggest:"后勤|houqin|hq"},
- {value:"11",key:"医疗",suggest:"医疗|yiliao|yl"},
- {value:"12",key:"其他",suggest:"其他|qita|qt"}]};
- var changeType={"list":[
- {value:"1",key:"新建",suggest:""},
- {value:"2",key:"更新",suggest:""}]};
- var sex={"list":[
- {value:"1",key:"男",suggest:""},
- {value:"0",key:"女",suggest:""}]};
- var staff={"list":[
- {value:"0",key:"是",suggest:""},
- {value:"1",key:"否",suggest:""}]};
- var zhicheng={"list":[
- {value:"1",key:"高级工程师",suggest:""},
- {value:"2",key:"中级工程师",suggest:""},
- {value:"3",key:"初级工程师",suggest:""}]};
- var zhiwu={"list":[
- {value:"1",key:"主任",suggest:""},
- {value:"2",key:"副主任",suggest:""},
- {value:"3",key:"科长",suggest:""},
- {value:"4",key:"副科长",suggest:""}]};
- var xieli={"list":[
- {value:"1",key:"大专",suggest:""},
- {value:"2",key:"本科",suggest:""},
- {value:"3",key:"硕士",suggest:""},
- {value:"4",key:"博士",suggest:""}]};
-
-
- var data;
-
- function initComplete(){
- var data1 = $("#expert").val();
- data = JSON.parse(decodeURI(data1));
-
- g = $("#maingrid").quiGrid({
- columns: [
- { display: '序号', name: 'EXPERT_ID_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
- { display: '姓名', name: 'EXPERT_NAME_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
- { display: '性别', name: 'EXPERT_SEX_260', align: 'center', width: "150px",
- editor: { type: 'select',data:sex,selWidth:150 },render:function (item){
- for (var i = 0; i < sex["list"].length; i++)
- {
- if (sex["list"][i]['value'] == item.EXPERT_SEX_260)
- return sex["list"][i]['key'];
- }
- return item.EXPERT_SEX_260;
- }
- },
- { display: '出生年月', name: 'EXPERT_BIRTHDAY_260', align: 'center', width: "150px" ,editor: { type: 'date',dateFmt:'yyyy-MM-dd'}},
- { display: '座机', name: 'EXPERT_TEL_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
- { display: '手机', name: 'EXPERT_CAL_260', align: 'center' , width: "150px" ,editor: { type: 'text'}},
- { display: 'Email', name: 'EXPERT_EMAIL_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
- { display: '学历', name: 'EDUCATION_260', align: 'center', width: "150px" ,
- editor: { type: 'select',data:xieli,selWidth:150 },render:function (item){
- for (var i = 0; i < xieli["list"].length; i++)
- {
- if (xieli["list"][i]['value'] == item.EDUCATION_260)
- return xieli["list"][i]['key'];
- }
- return item.EDUCATION_260;
- }
- },
- { display: '所属区域', name: 'EXPERT_AREA_260', align: 'center' , width: "150px" ,editor: { type: 'text'}},
- // { display: '是否南网员工', name: 'IS_SNSTAFF_260', align: 'center', width: "150px" ,
- // editor: { type: 'select',data:staff,selWidth:150 },render:function (item){
- // for (var i = 0; i < staff["list"].length; i++)
- // {
- // if (staff["list"][i]['value'] == item.IS_SNSTAFF_260)
- // return staff["list"][i]['key'];
- // }
- // return item.IS_SNSTAFF_260;
- // }
- // },
- { display: '参加工作时间', name: 'WORK_TIME_260', align: 'center', width: "150px" ,editor: { type: 'date',dateFmt:'yyyy-MM-dd'}},
- { display: '职称', name: 'EXPERT_TYPE_260', align: 'center', width: "150px",
- editor: { type: 'select',data:zhicheng,selWidth:150 },render:function (item){
- for (var i = 0; i < zhicheng["list"].length; i++)
- {
- if (zhicheng["list"][i]['value'] == item.EXPERT_TYPE_260)
- return zhicheng["list"][i]['key'];
- }
- return item.EXPERT_TYPE_260;
- }
- },
- { display: '职务', name: 'EXPERT_POST_260', align: 'center', width: "150px",
- editor: { type: 'select',data:zhiwu,selWidth:150 },render:function (item){
- for (var i = 0; i < zhiwu["list"].length; i++)
- {
- if (zhiwu["list"][i]['value'] == item.EXPERT_POST_260)
- return zhiwu["list"][i]['key'];
- }
- return item.EXPERT_POST_260;
- }
- },
- { display: '住址', name: 'EXPERT_ADDRESS_260', align: 'center', width: "150px" ,editor: { type: 'text'}},
- { display: '住址邮编', name: 'EXPERT_POSTALCODE_260', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '专业特长', name: 'EXPERT_SPECIALTY_260', align: 'center', width: "150px" ,
- editor: { type: 'select',data:specialty,selWidth:150 },render:function (item){
- for (var i = 0; i < specialty["list"].length; i++)
- {
- if (specialty["list"][i]['value'] == item.EXPERT_SPECIALTY_260)
- return specialty["list"][i]['key'];
- }
- return item.EXPERT_SPECIALTY_260;
- }
- },
- { display: '应急处置经验', name: 'EXPERT_EXP_260', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '变更说明', name: 'CHANGE_DESCRIPTION_260', align: 'center', width: "150px",editor: { type: 'text'}},
- // { display: '变更类型', name: 'CHANGE_TYPE_260', align: 'center', width: "150px",
- // editor: { type: 'select',data:changeType,selWidth:150 },render:function (item){
- // for (var i = 0; i < changeType["list"].length; i++)
- // {
- // if (changeType["list"][i]['value'] == item.CHANGE_TYPE_260)
- // return changeType["list"][i]['key'];
- // }
- // return item.CHANGE_TYPE_260;
- // }
- // },
- { display: '认定时间', name: 'IDENTIFICATION_TIME_260', align: 'center', width: "150px",editor: { type: 'date',dateFmt:'yyyy-MM-dd'}},
- { display: '工作简历', name: 'EXPERT_RESUME_260', align: 'center', width: "150px",editor: { type: 'text'}}
- ],
- data:data,
- sortName : '',
- sortOrder : '',
- rownumbers:true,
- checkbox:true,
- height: '100%',
- width:"100%",
- pageSize: 10,
- enabledEdit: true, //编辑用
- // onBeforeSubmitEdit: onBeforeSubmitEdit,
- percentWidthMode:true,
- //顶部图标按钮栏
- toolbar:{
- items:[
-
- {text: '批量保存', click: saveAll, iconClass: 'icon_add'},
- { line : true },
- {text: '窗口', click: chuangkou, iconClass: 'icon_add'},
- { line : true }
- ]
- }
- });
-
-
- }
-
-
-
- function saveAll(){
-
- var rows=g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要导入的信息!");
- return;
- }
- var json=JSON.stringify(rows);
-
- var myobj=eval(json);
- for(var i=0;i<myobj.length;i++){
- var EXPERT_ID_260 = myobj[i].EXPERT_ID_260;
- var EXPERT_NAME_260 = myobj[i].EXPERT_NAME_260;
- var EXPERT_SEX_260 = myobj[i].EXPERT_SEX_260;
- var EXPERT_BIRTHDAY_260 = myobj[i].EXPERT_BIRTHDAY_260;
- var EXPERT_CAL_260 = myobj[i].EXPERT_CAL_260;
- // var EXPERT_AREA_260 = myobj[i].EXPERT_AREA_260;
- var WORK_TIME_260 = myobj[i].WORK_TIME_260;
- // var EXPERT_ADDRESS_260 = myobj[i].EXPERT_ADDRESS_260;
- var EXPERT_SPECIALTY_260 = myobj[i].EXPERT_SPECIALTY_260;
- var IDENTIFICATION_TIME_260 = myobj[i].IDENTIFICATION_TIME_260;
-
- if(EXPERT_ID_260==null||EXPERT_ID_260==""){
- top.Dialog.alert("序号这一列中有为空值的请补全!");
- return;
- }
- if(EXPERT_NAME_260==null||EXPERT_NAME_260==""){
- top.Dialog.alert("姓名这一列中有为空值的请补全!");
- return;
- }
- if(EXPERT_SEX_260==null||EXPERT_SEX_260==""){
- top.Dialog.alert("性别这一列中有为空值的请补全!");
- return;
- }
- if(EXPERT_BIRTHDAY_260==null||EXPERT_BIRTHDAY_260==""){
- top.Dialog.alert("出生年月这一列中有为空值的请补全!");
- return;
- }
- if(EXPERT_CAL_260==null||EXPERT_CAL_260==""){
- top.Dialog.alert("手机这一列中有为空值的请补全!!");
- return;
- }
- // if(EXPERT_AREA_260==null||EXPERT_AREA_260==""){
- // top.Dialog.alert("所属区域这一列中有为空值的请补全!");
- // return;
- // }
- if(WORK_TIME_260==null||WORK_TIME_260==""){
- top.Dialog.alert("参加工作时间这一列中有为空值的请补全!");
- return;
- }
- // if(EXPERT_ADDRESS_260==null||EXPERT_ADDRESS_260==""){
- // top.Dialog.alert("地址这一列中有为空值的请补全!");
- // return;
- // }
- if(EXPERT_SPECIALTY_260==null||EXPERT_SPECIALTY_260==""){
- top.Dialog.alert("专业这一列中有为空值的请补全!");
- return;
- }
- if(IDENTIFICATION_TIME_260==null||IDENTIFICATION_TIME_260==""){
- top.Dialog.alert("认证时间这一列中有为空值的请补全!");
- return;
- }
- if(EXPERT_BIRTHDAY_260 > WORK_TIME_260){
- $.messager.alert('生日不能比参加工作时间晚');
- return ;
- }
- if(WORK_TIME_260 > IDENTIFICATION_TIME_260){
- $.messager.alert('参加工作时间不能比认证时间晚');
- return ;
- }
- }
-
- var url = $.pathname()
- + "/ws/ExcelExpert/ReadExcelToDBTableTool/expertToDb2";
- var params = {
- classId : '260',
- deptId:deptId,
- json:json
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- $.messager.alert('保存成功', null, null);
- var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- function chuangkou(){
- var diag = new top.Dialog();
- diag.Title = "应急组织";
- diag.URL = $.pathname() +"/page/business/am/public/MsgNotes/YJMsgNotesPersion.jsp?expert";
- diag.Width = 1260;
- diag.Height = 600;
- diag.Top = "80%";
- diag.Left = "50%";
- diag.ShowButtonRow=true;
- diag.ButtonAlign = 'center';
- diag.OkButtonText="确 定";
- diag.OKEvent = function(){
- diag.innerFrame.contentWindow.addTeamInfo();
-
- initComplete();
- };
- diag.show();
-
- }
-
- //返回
- function goBack() {
- var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- }
- $.messager = top.Dialog;
|