123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- $(function(){
- teamid = (window.location.href).split('?')[1];
-
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '261',
- objectID : teamid
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- unit=data.TEAM_COMP_ID_261;
- teamname=data.TEAM_NAME_261;
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- });
- var g;
- var teamid;
- var unit;
- var teamname;
- var sex={"list":[
- {value:"1",key:"男",suggest:""},
- {value:"0",key:"女",suggest:""}]};
- var specialty={"list":[
- {value:"1",key:"输电线路",suggest:""},
- {value:"2",key:"输电电缆",suggest:""},
- {value:"3",key:"一次变电",suggest:""},
- {value:"4",key:"二次变电",suggest:""},
- {value:"5",key:"配电线路",suggest:""},
- {value:"6",key:"配电电缆",suggest:""},
- {value:"7",key:"低压电房",suggest:""},
- {value:"8",key:"应急保电",suggest:""},
- {value:"9",key:"通信",suggest:""},
- {value:"10",key:"网络信息",suggest:""},
- {value:"11",key:"试验",suggest:""}]};
- var dwgw={"list":[
- {value:"1",key:"队长",suggest:""},
- {value:"2",key:"副队长",suggest:""},
- {value:"3",key:"队员",suggest:""},
- {value:"4",key:"安全员",suggest:""},
- {value:"5",key:"设计",suggest:""},
- {value:"6",key:"监理",suggest:""}]};
- var dydj={"list":[
- // {value:"132",key:"±800KV(直流)",suggest:""},
- // {value:"133",key:"±500KV(直流)",suggest:""},
- {value:"134",key:"500kV",suggest:""},
- {value:"135",key:"220kV",suggest:""},
- {value:"136",key:"110kV",suggest:""},
- {value:"137",key:"35kV",suggest:""},
- {value:"138",key:"10kV",suggest:""},
- {value:"139",key:"400V以下",suggest:""}]};
-
-
-
- function initGrid(data){
- //下拉框状态之后再加
- g = $("#maingrid").quiGrid({
- columns: [
-
- // { display: '单位名称', name: 'TEAM_UNIT_262', align: 'center', width: "150px",editor: { type: 'text'}},
- // { display: '队伍名称及编号', name: 'TEAM_NAME_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '人员编号', name: 'CODE_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '姓名', name: 'NAME_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '身份证号码', name: 'ID_NUMBER_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '出生年月', name: 'BIRTH_DATE_262', align: 'center', width: "150px",editor: { type: 'date',dateFmt:'yyyy-MM'}},
- { display: '性别', name: 'SEX_262', 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.SEX_262)
- return sex["list"][i]['key'];
- }
- return item.SEX_262;
- }
- },
- { display: '本工种工龄', name: 'WORK_TYPE_AGE_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '所在部门', name: 'DEPT_ID_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '职务岗位', name: 'DEPT_QUARTERS_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '技术职称', name: 'TECHNICAL_TITLE_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '技能等级', name: 'SKILL_LEVEL_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '专业', name: 'PROFESSIONAL_262', 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.PROFESSIONAL_262)
- return specialty["list"][i]['key'];
- }
- return item.PROFESSIONAL_262;
- }
- },
- { display: '电压等级', name: 'VOLTAGE_LEVEL_262', align: 'center', width: "150px",
- editor: { type: 'select',data:dydj,selWidth:150},render:function (item){
- for (var i = 0; i < dydj["list"].length; i++)
- {
- if (dydj["list"][i]['value'] == item.VOLTAGE_LEVEL_262)
- return dydj["list"][i]['key'];
- }
- return item.VOLTAGE_LEVEL_262;
- }
- },
- { display: '联系手机', name: 'TELEPHONE_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '抢险经历', name: 'RESCUE_EXP_262', align: 'center', width: "150px",editor: { type: 'text'}},
- { display: '队伍岗位', name: 'TEAM_QUARTERS_262', align: 'center', width: "150px",
- editor: { type: 'select',data:dwgw,selWidth:150},render:function (item){
- for (var i = 0; i < dwgw["list"].length; i++)
- {
- if (dwgw["list"][i]['value'] == item.TEAM_QUARTERS_262)
- return dwgw["list"][i]['key'];
- }
- return item.TEAM_QUARTERS_262;
- }
- },
- { display: '备注', name: 'REMARK_262', align: 'center', width: "150px",editor: { type: 'text'}}
- ],
- // url :$.pathname() + '/ws/ExcelTeamer/TeamerExcelToDBTableTool/getTeamerInExpertExcel',
- // params : {fileName:"D:\\apache-tomcat-6.0.36\\webapps\\nwyj\\upload\\.xls"},
- data:data,
- sortName : '',
- sortOrder : '',
- rownumbers:true,
- checkbox:true,
- // height: '100%',
- width:"100%",
- usePager : false,
- enabledEdit: true, //编辑用
- percentWidthMode:true,
- onAfterShowData:function(){
- setH();
- },
- //顶部图标按钮栏
- toolbar:{
- items:[
-
- {text: '批量保存', click: saveAll, iconClass: 'icon_add'},
- { line : true }
- ]
- }
- });
- //监听页面显示的下拉框
- $("select[name=rp]").bind("change",function(){
- $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
- });
- //下拉框高度自适应
- $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
- }
-
- function saveAll(){
- var PatternsDict=/^(\d{4})-(0\d{1}|1[0-2])-(0\d{1}|[12]\d{1}|3[01])$/;
- 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 fff =1;
- fff = fff+i;
- var NAME_262 = myobj[i].NAME_262;
- var SEX_262 = myobj[i].SEX_262;
- // var ID_NUMBER_262 = myobj[i].ID_NUMBER_262;
- var BIRTH_DATE_262 = myobj[i].BIRTH_DATE_262;
- var WORK_TYPE_AGE_262 = myobj[i].WORK_TYPE_AGE_262;
- var PROFESSIONAL_262 = myobj[i].PROFESSIONAL_262;
- var TELEPHONE_262 = myobj[i].TELEPHONE_262;
- var TEAM_QUARTERS_262 = myobj[i].TEAM_QUARTERS_262;
- var REMARK_262 = myobj[i].REMARK_262;
-
- if(NAME_262.length==0){
- top.Dialog.alert("第"+fff +"行姓名不能为空值,请补全!");
- return;
- }
- if(SEX_262.length==0){
- top.Dialog.alert("第"+fff +"行性别不能为空值,请补全!");
- return;
- }
-
- if(BIRTH_DATE_262.length==0){
- top.Dialog.alert("第"+fff +"行出生年月不能为空值,请补全!");
- return;
- }
- /*if(PatternsDict.test(BIRTH_DATE_262)){
-
- }else{
- top.Dialog.alert("第"+ fff + "行的出生年月不合法,请检查!");
- return;
- }*/
- if(WORK_TYPE_AGE_262.length==0){
- top.Dialog.alert("第"+fff +"行本工种工龄不能为空值,请补全!");
- return;
- }
- if(PROFESSIONAL_262.length==0){
- top.Dialog.alert("第"+fff +"行专业不能为空值,请补全!");
- return;
- }
- if(TELEPHONE_262.length==0){
- top.Dialog.alert("第"+fff +"行联系方式不能为空值,请补全!");
- return;
- }
- if(TEAM_QUARTERS_262.length==0){
- top.Dialog.alert("第"+fff +"行队伍岗位不能为空值,请补全!");
- return;
- }
-
- if(REMARK_262.length>300){
- top.Dialog.alert("第"+fff +"行备注长度超长,请检查!(300个汉字以内)");
- return;
- }
- }
-
-
- var url = $.pathname() + "/ws/ExcelTeamer/TeamerExcelToDBTableTool/teamerInToDb";
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var params = {
- classId : '262',
- teamId:teamid,
- unit:unit,
- teamName:teamname,
- userid : userId,
- json:json
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- $.messager.alert('保存成功');
- // window.location.href="team.jsp";
- window.history.back();
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- //下模板
- function xiazai(){
- window.open("/nwyj/excels/teamerduiwurenyuan.xls");
- }
- $.messager=top.Dialog;
-
-
- function setH(){
- var p_iframe = $(parent.document.body).find("#frmrightChild");
- if(p_iframe && p_iframe.length>0){
- p_iframe.css("height",$(window.document.body).height()+30);
- var left_h = $(parent.document.body).find("#layout1 .l-layout-left").height();
- var left_c = p_iframe.height();
- var height = left_h>left_c?left_h:left_c;
- $(parent.document.body).height(height);
- $(top.document.body).find("iframe").css("height",$(parent.document.body).height()+30);
- }else{
- if(parent==top){
- $(parent.document.body).find("iframe").css("height",$(window.document.body).height()+30);
- }
- if(parent!=top){
- $(parent.document.body).find("iframe").css("height",$(window.document.body).height()+30);
- $(top.document.body).find("iframe").css("height",$(parent.document.body).height()+30);
- }
- }
- }
|