123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771 |
- /**
- * 功能:
- *
- *
- * @author LJP
- * @date 2015/11/03
- */
- // 获取用户部门
- var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- // 获取公司
- var comp_id = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- // 获取用户Id
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- // 获取用户角色
- var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- // 取得用户真实名字
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- /** 定义变量* */
- var _this = this;
- _this.listGrid = null;// 数据列表
- _this.searchPanel = null; // 查询面板
- $queryForm = null;// 查询区域表单
- $searchButt = null;// 查询按钮
- $more = null; // 更多
- _this.loadParams = null;// 列表加载参数
- _this.gridData = "";
- var nowDate = getDateTime();
- var flagggg = true;//判断是否有错
- levelData = {
- "list" : [ {
- "value" : "0",
- "key" : "在岗值班"
- }, {
- "value" : "1",
- "key" : "电话值班"
- }, {
- "value" : "2",
- "key" : "应急指挥中心值班"
- } ]
- };
- // 表头1
- var mycolumns1 = [
- {
- display : '开始时间',
- name : 'START_TIME_234',
- align : 'center',
- width : "12%",
- editor : {
- type : 'date',
- dateFmt : "yyyy-MM-dd"
- },
- render : function(rowdata, rowindex, value, column){
- if(/*compareTime(nowDate,rowdata.START_TIME_234)
- || */compareTime(rowdata.START_TIME_234,rowdata.END_TIME_234) && !checkName(value,"sj")){
- //flagggg = false;
- value = "<span class='errorData'>"+value+"</span>";
- }
- return value;
- }
- },
- {
- display : '结束时间',
- name : 'END_TIME_234',
- align : 'center',
- width : "12%",
- //showTitle : true,
- editor : {
- type : 'date',
- dateFmt : "yyyy-MM-dd"
- },
- render : function(rowdata, rowindex, value, column){
- if(compareTime(rowdata.START_TIME_234,rowdata.END_TIME_234) && !checkName(value,"sj")){
- //flagggg = false;
- value = "<div class='errorData'>"+value+"</div>";
- }
-
- return value;
- }
- },
- {
- display : '值班领导',
- name : 'LEADER_NAME_234',
- align : 'center',
- width : "10%",
- isSort : true,
- editor : {
- type : 'text',
- maxlength : 5,
- tip : '不超过5个字的中文'
- },
- render : function(rowdata, rowindex, value, column){
- if(!checkName(value,"rm")){
- //flagggg = false;
- value = "<div class='errorData'>"+value+"</div>";
- }
-
- return value;
- }
- },
- {
- display : '领导电话',
- name : 'LEADER_TEL_234',
- align : 'center',
- width : "10%",
- // showTitle : true,
- editor : {
- type : 'text',
- inputMode : "numberOnly",
- maxlength : 13,
- tip : '不超过13个数字'
- },
- render : function(rowdata, rowindex, value, column){
- if(!checkName(value,"dh")){
- //flagggg = false;
- value = "<div class='errorData'>"+value+"</div>";
- }
-
- return value;
- }
- },
- {
- display : '值班人员',
- name : 'NAME_234',
- align : 'center',
- width : "10%",
- // showTitle : true,
- editor : {
- type : 'text',
- maxlength : 5,
- tip : '不超过5个字的中文'
- },
- render : function(rowdata, rowindex, value, column){
- if(!checkName(value,"rm")){
- //flagggg = false;
- value = "<div class='errorData'>"+value+"</div>";
- }
-
- return value;
- }
- },
- {
- display : '联系电话',
- name : 'TELEPHONE_234',
- align : 'center',
- width : "10%",
- editor : {
- type : 'text',
- inputMode : "numberOnly",
- maxlength : 13,
- tip : '不超过13个数字'
- },
- render : function(rowdata, rowindex, value, column){
- if(!checkName(value,"dh")){
- //flagggg = false;
- value = "<div class='errorData'>"+value+"</div>";
- }
-
- return value;
- }
- },
- {
- display : '值班方式',
- name : 'DUTY_WAY_234',
- align : 'center',
- width : "10%",
- editor : {
- type : 'select',
- data : levelData,
- selWidth : 100
- },
- render : function(rowdata, rowindex, value, column) {
- var thisvalue = value;
- for (var i = 0; i < levelData["list"].length; i++) {
- if (levelData["list"][i]['value'] == value)
- thisvalue = levelData["list"][i]['key'];
- }
- if(!checkName(thisvalue,"zbfs")){
- thisvalue = "<div class='errorData'>"+thisvalue+"</div>";
- }
-
- return thisvalue;
- }
- },
- {
- display : '操作',
- align : 'center',
- width : "15%",
- isSort : false,
- render : function(rowdata, rowindex, value) {
- var h = "";
- if (!rowdata._editing) {
- h += "<a onclick='beginEdit(" + rowindex + ")'><span class='icon_edit'>修改</span></a> ";
- h += "<a onclick='onDelete(" + rowindex + ")'><span class='icon_delete'>删除</span></a> ";
- } else {
- h += "<a onclick='endEdit(" + rowindex + ")'><span class='icon_ok'>提交</span></a> ";
- h += "<a onclick='onDelete(" + rowindex + ")'><span class='icon_delete'>删除</span></a> ";
- h += "<a onclick='cancelEdit(" + rowindex + ")'><span class='icon_no'>取消</span></a> ";
- }
- return h;
- }
- } ];
- // 表头2
- //var mycolumns2 = $.extend([], mycolumns1);
- //mycolumns2.splice(0, 0, {
- // display : '单位',
- // name : 'DEPTNAME',
- // align : 'center',
- // width : "15%",
- // showTitle : true
- //});
- //// 表头3
- //var mycolumns3 = $.extend([], mycolumns1, []);
- //mycolumns3.splice(0, 0, {
- // display : '日期',
- // name : 'GROUPDATE',
- // align : 'center',
- // width : "15%",
- // showTitle : true
- //});
- //mycolumns3.splice(mycolumns3.length-1,0,{
- // display : '单位',
- // name : 'DEPTNAME',
- // align : 'center',
- // width : "15%",
- // showTitle : true
- //});
- /** 私有方法* */
- // 导入方法
- /*function submitInfo() {
- var val = $("#import_report").val();
- var end = val.substring(val.indexOf(".") + 1);
- if (end == "xls" || end == "xlsx") {
- addfn();
- } else {
- top.Dialog.alert("请导入正确的excel文件");
- return;
- }
- };
- function fileToSave($form) {
- // showProgressBar("正在提交中...");
- // 表单异步提交处理
- $form
- .ajaxSubmit({
- url : $.pathname()
- + "/ws/importGpsUser/BaoGongDianTaskService/importBaoGongDiantask1?report_type=3",
- type : 'post',
- success : function(responseText, statusText, xhr, $form) {
- responseText = eval('(' + responseText + ')');
- _this.gridData = responseText;
- var data = JSON.stringify(_this.gridData);
- // alert(encodeURI(encodeURI(_this.gridData)));
- _this.listGrid.setOptions({
- "data" : JSON.parse(decodeURI(data))
- });
- _this.listGrid.resetHeight();
- _this.listGrid.loadData();
- $("#onviewtype").hide();
- setThisHeight();
- },
- error : function(e) {
- $.messager.alert('导入值班信息失败!');
- }
- });
- }
- // 导入excle
- function addfn() {
- var $form = $("#editForm");
- fileToSave($form);
- };*/
- // 切换查看方式
- function changeviewtype(type,self) {
- $(".viewop").removeClass("viewcurrent");
- $(self).addClass("viewcurrent");
- var _params = {
- task_id : fd_id,
- dept : dept_id,
- type : type
- };
- changegrid(type, _params);
- }
- // 导入后保存
- // 新增
- function save() {
- _this.listGrid.endEdit();
- /*if(!flagggg){
- top.Dialog.alert("请修改表格中红色的错误数据后,再尝试保存!");
- return;
- }*/
- var urls = $.pathname()
- + "/ws/importGpsUser/BaoGongDianTaskService/saveGridData";
- var row = _this.listGrid.getData();
- if (row == "") {
- top.Dialog.alert("表格中无任何数据,请重新导入!");
- return;
- }
- /*for (var int = 0; int < row.length; int++) {
- if(compareTime(nowDate,row[int].START_TIME_234)
- || compareTime(row[int].START_TIME_234,row[int].END_TIME_234)){
- top.Dialog.alert("请修改表格中红色的错误数据后,再尝试保存!");
- return;
- }
- }*/
-
- if($(".errorData").text()!=""){
- top.Dialog.alert("请修改表格中红色的错误数据后,再尝试保存!");
- return;
- }
- var json = JSON.stringify(row);
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 15000,
- data : {
- json : json,
- // user_id:user_id,
- comp_id : dept_id,
- report_type : '3',
- real_name : realName,
- task_id : fd_id,
- user_id:user_id
- },
- dataType : 'json',
- success : function(data) {
- changeDutyStateForTask();
- },
- error : function(e) {
- $.messager.alert('保存失败!', '访问服务失败!', 'error');
- }
- });
- }
- function changeDutyStateForTask() {
- var url = $.pathname() + '/ws/crud/CRUDService/update/';
- var params = {
- classid : "234",
- FD_OBJECTID610 : fd_id,
- HAS_DUTY_610 : "1"
- };
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'json',
- success : function(data) {
- if (data.Msg.sucsess == true) {
- top.Dialog.alert("保存成功");
- $("#onviewtype").show();
- } else {
- top.Dialog.alert("保存失败");
- }
- },
- error : function(e) {
- $.messager.alert('保存失败!', '访问服务失败!', 'error');
- }
- });
- }
- function changegrid(type, _params) {
- $.ajax({
- url : $.pathname()
- + '/ws/importGpsUser/BaoGongDianTaskService/quiTaskDutyByType',
- type : 'post',
- data : _params,
- dataType : 'json',
- asncy:false,
- success : function(data) {
- // var griddata = data.griddata;
- // var groupdata = data.groupdata;
- //alert(JSON.stringify(data));
- intgrid(type, data);
- },
- error : function(e) {
- $.messager.alert('查询值班详细失败!', 'error');
- }
- }).done(function(){
- //alert($(window.document.body).height()+","+$(parent.document.body).height()+","+$(parent.parent.document.body).height());
- //var pheight = $(parent.document.body).height()>$(window.document.body).height()?$(parent.document.body).height():$(window.document.body).height();
- setThisHeight();
- //alert($(window.document.body).height()+","+$(parent.document.body).height()+","+$(parent.parent.document.body).height());
-
- });
- }
- function intgrid(type, griddata) {
- if (type == 1) {
- /* if(_this.listGrid !=null&&_this.listGrid.options.groupColumnName!="") {
- _this.listGrid.setOptions({
- groupColumnName:"LEADER_234",
- groupColumnDisplay: "值班领导",
- groupRender: ""
- });
- }*/
- _this.listGrid = $("#dataGrid").quiGrid({// 只看本单位
- columns : mycolumns1,
- // url : $.pathname() +
- // '/ws/importGpsUser/BaoGongDianTaskService/quiTaskDutyByType',
- // params :params,
- data : griddata,
- sortOrder : 'desc', // 排序方式
- rownumbers : true,
- checkbox : false,
- width : '100%',
- //height:"100%",
- usePager : false,
- percentWidthMode : true,
- enabledEdit : true,
- asncy:false,
- clickToEdit : false,
- onDblClickRow : function(rowdata, rowindex) {
- _this.listGrid.beginEdit(rowindex);
- },
- onBeforeEdit : onBeforeEdit,
- onBeforeSubmitEdit : onBeforeSubmitEdit,
- onAfterSubmitEdit : onAfterSubmitEdit,
- percentWidthMode : true,
- sortName : 'UPDATEDATE_234',
- groupColumnName:"LEADER_234",
- groupColumnDisplay: "值班领导",
- groupRender: function(groupValue, groupData, groupColumnDisplay){
- return "<font color=red>值班领导:"+groupValue+"【共" + groupData.length + "条记录】</font>";
- }
- });
- } else if (type == 2) {
-
- _this.listGrid = $("#dataGrid").quiGrid({// 按单位分组
- columns : mycolumns2,
- // url : $.pathname() +
- // '/ws/importGpsUser/BaoGongDianTaskService/quiTaskDutyByType',
- // params :params,
- data : griddata,
- sortOrder : 'desc', // 排序方式
- //rownumbers : true,
- checkbox : false,
- width : '100%',
- usePager : false,
- asncy:false,
- pageSize : 10,
- percentWidthMode : true,
- enabledEdit : true,
- clickToEdit : false,
- onDblClickRow : function(rowdata, rowindex) {
- _this.listGrid.beginEdit(rowindex);
- },
- onBeforeEdit : onBeforeEdit,
- onBeforeSubmitEdit : onBeforeSubmitEdit,
- onAfterSubmitEdit : onAfterSubmitEdit,
- percentWidthMode : true,
- sortName : 'UPDATEDATE_234',
- groupColumnName : "DEPTNAME",
- groupColumnDisplay: '单位',
- groupRender: function(groupValue, groupData, groupColumnDisplay){
- return "<font color=red>"+groupValue+"【共" + groupData.length + "条记录】</font>";
- }
-
- });
- } else if (type == 3) {
- _this.listGrid = $("#dataGrid").quiGrid({// 按日期分组
- columns : mycolumns3,
- // url : $.pathname() +
- // '/ws/importGpsUser/BaoGongDianTaskService/quiTaskDutyByType',
- // params :params,
- data : griddata,
- sortOrder : 'desc', // 排序方式
- //rownumbers : true,
- checkbox : false,
- width : '100%',
- usePager : false,
- asncy:false,
- pageSize : 10,
- percentWidthMode : true,
- enabledEdit : true,
- clickToEdit : false,
- onDblClickRow : function(rowdata, rowindex) {
- _this.listGrid.beginEdit(rowindex);
- },
- onBeforeEdit : onBeforeEdit,
- onBeforeSubmitEdit : onBeforeSubmitEdit,
- onAfterSubmitEdit : onAfterSubmitEdit,
- percentWidthMode : true,
- // sortName : 'GROUPDATE',
- groupColumnName : "GROUPDATE",
- groupColumnDisplay: '日期',
- groupRender: function(groupValue, groupData, groupColumnDisplay){
- return "<font color=red>"+groupValue+"【共" + groupData.length + "条记录】</font>";
- }
- });
- }
- setThisHeight();
- }
- function setThisHeight(){
-
- $("#formContent").height($(".box_middleright").height());
- $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- $(top.document.body).find("iframe").height($(parent.document.body).height());
-
- }
- // 删除
- /*
- * function onDelete(rowidx){ top.Dialog.confirm("确定要删除该记录吗?",function(){ //删除记录
- * var row = _this.listGrid.getRow(rowidx);
- * alert(JSON.stringify(row.FD_OBJECTID_234));
- * $.post("/qui/userdbAction.do?method=deleteUser", {"ids":row.userId},
- * function(result){ handleResult(result); },"json"); //刷新表格
- * _this.listGrid.loadData(); }); }
- */
- // 批量删除
- function onDelete(rowidx) {
- _this.listGrid.select(rowidx);
- var rows = _this.listGrid.getSelectedRows(rowidx);
- var rowsLength = rows.length;
- if (rowsLength == 0) {// 请选中要删除的记录!
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for (var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID234 + ",";
- }
- if(ids=="undefined,"){
- _this.listGrid.deleteSelectedRow();
- _this.listGrid.loadData();
-
- }else{
-
- var url = $.pathname() + "/ws/crud/CRUDService/delete/";
- var params = {
- objectIDs : ids,
- classid : 234
- };
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.request.del(url, params, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- // 刷新表格数据
- // _this.listGrid.loadData();
- // _this.listGrid.rend();
- changegrid("1", _this.loadParams);
- } else {
- top.Dialog.alert("删除失败!");
- }
- });
- });
- }
- }
- // 删除
- /*
- * function onDelete(rowidx) { top.Dialog.confirm("确定要删除吗?|删除", function() {
- * isValida = false; flag = false; endEdit(rowidx); //删除记录 var row =
- * _this.listGrid.getRow(rowidx); //删除操作 var url = $.pathname() +
- * "/ws/crud/CRUDService/delete/"; var params = { objectIDs :
- * row.FD_OBJECTID_234, classid : 234, }; $.request.del(url, params,
- * function(result) { if (result.Msg.sucsess == true) {
- * top.Dialog.alert("删除成功!"); // 刷新表格数据 _this.listGrid.rend(); } else {
- * top.Dialog.alert("删除失败!"); } }); _this.listGrid.deleteRow(row); });
- * }
- */
- // 编辑
- function beginEdit(rowid) {
- _this.listGrid.beginEdit(rowid);
- }
- // 取消编辑
- function cancelEdit(rowid) {
- _this.listGrid.cancelEdit(rowid);
- }
- // 结束编辑
- function endEdit(rowid) {
- // _this.listGrid.endEdit(rowid);
- // alert(JSON.stringify(_this.listGrid.getRow(rowid)));
- /* var row = _this.listGrid.getRow(rowid);
- var nowDate = getNowDate();
- if(row.START_TIME_234 < nowDate){//如果开始时间小于当前时间
- top.Dialog.alert("开始时间不能小于当前时间!"); //_this.listGrid.endEdit(rowid);
- return false;
- }else if(row.START_TIME_234 > row.END_TIME_234){//如果开始时间大于结束时间
- top.Dialog.alert("开始时间不能大于结束时间!");
- return false;
- }*/
-
- _this.listGrid.endEdit(rowid);
- }
- function rowToBO(row) {
- var params = row.FD_OBJECTID_234 + '&' + row.START_TIME_234 + '&'
- + row.END_TIME_234 + '&' + row.LEADER_234 + '&'
- + row.LEADER_TEL_234+ '&' + row.LEADER_DUTY_MODE_234 + '&' + row.WATCH_MAN_234 + '&'
- + row.WATCH_TEL_234 + '&' + row.DUTY_MODE_234;
- return params;
- }
- // 删除后的提示
- function handleResult(result) {
- if (result == 1) {
- top.Dialog.alert("删除成功!", null, null, null, 1);
- _this.listGrid.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }
- // 全部确认修改
- function endAllEdit() {
- _this.listGrid.endEdit();
- }
- // 全部取消修改
- function cancelAllEdit() {
- _this.listGrid.cancelEdit();
- }
- // 编辑前事件
- function onBeforeEdit(e) {
- var str = "编辑前事件,可阻止某些行或列进行编辑。列名:" + e.column.name + ";行号:" + e.rowindex
- + ";编辑前的值:" + e.value + "\n";
- // if(e.record.id=="121"){
- // top.Dialog.alert("此行不可编辑",null,null,null,2);
- // return false;
- // }
- }
- //获得当前系统时间:年月日时分
- function getDateTime(){
- var s="";
- var d = allGetServerTime();
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- //var se = d.getSeconds();
- s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m);//+":"+(se<10 ? "0" +se : se);
- return s;
- }
- // 编辑提交前事件
- function onBeforeSubmitEdit(e) {// ====================================================================================================================================
- var nowDate = getDateTime();
- /*if (compareTime(nowDate,e.newdata.START_TIME_234)) {// 如果开始时间小于当前时间
- top.Dialog.alert("开始时间不能小于当前时间!");
- return false;
- }*/
- // 做验证判断
- // alert(JSON.stringify(e));//先看传过来的参数是什么
- // alert(JSON.stringify(e.record);
- // alert(JSON.stringify(e.record.START_TIME_234));
- // alert(e.record.START_TIME_234);
-
- if (compareTime(e.newdata.START_TIME_234,e.newdata.END_TIME_234)) {
- top.Dialog.alert("开始时间不能大于结束时间!");
- return false;
- }
- if (e.newdata.START_TIME_234 == "") {
- top.Dialog.alert("开始时间不能为空!");
- return false;
- }
- if (e.newdata.END_TIME_234 == "") {
- top.Dialog.alert("结束时间不能为空!");
- return false;
- }
- if (e.newdata.LEADER_234 == "") {
- top.Dialog.alert("值班领导列不能为空!");
- return false;
- }
- if (e.newdata.LEADER_TEL_234 == "") {
- top.Dialog.alert("领导电话列不能为空!");
- return false;
- }
- if (e.newdata.LEADER_DUTY_MODE_234 == "") {
- top.Dialog.alert("值班类型列不能为空!");
- return false;
- }
- if (e.newdata.WATCH_MAN_234 == "") {
- top.Dialog.alert("值班人员列不能为空!");
- return false;
- }
- if (e.newdata.WATCH_TEL_234 == "") {
- top.Dialog.alert("值班人电话列不能为空!");
- return false;
- }
- if (e.newdata.DUTY_MODE_234 == "") {
- top.Dialog.alert("值班类型列不能为空!");
- return false;
- }
- }
- // 编辑后事件
- function onAfterSubmitEdit(e) {// ======================================================================================================================================
- // 在这里一律作修改处理
- var rowData = e.newdata;
- rowData.FD_OBJECTID_234 = e.record.FD_OBJECTID234;
- // ajax方式提交数据到数据库
- var _url = $.pathname()
- + '/ws/importGpsUser/BaoGongDianTaskService/saveGpsDuty';
- $.ajax({
- url : _url,
- type : 'post',
- async : false,
- data : rowToBO(rowData),
- dataType : 'text',
- success : function(data) {
- top.Dialog.alert("保存用户成功");
- _this.listGrid.loadData();
- },
- error : function(e) {
- $.messager.alert('保存失败!', '访问服务失败!', 'error');
- }
- });
- // var row =certInfoGrid.getRow(e.rowindex);
- // $.post("/material/certInfo/saveCertInfo.do?",rowToBO(row),function(){},"json");
- }
- $(function() {
- $queryForm = $("#queryForm");
- // 列表加载参数
- _this.loadParams = {
- task_id:fd_id,
- type:1,
-
- dept:dept_id
- };
- //$("#import_gpsUser").live("click", submitInfo);
- $("#save").live("click", save);
- changegrid("1", _this.loadParams);
- });
- function compareTime(time1,time2){
- return time1>time2;
- }
- //检查数据格式是否正确
- function checkName(data,type){
- var flag = true;
- var c = "";
- if(type=="rm"){//人名
- checkRex = /^[\u4e00-\u9fa5]{1,5}$/;
- }else if(type=="dh"){//电话
- //checkRex = /^1{1}[0,9]{10}$/;
- checkRex = /^(\+\d{2,3}\-)?\d{11}$/;
- }else if(type=="sj"){//时间
- checkRex = /^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))\\s{1}[0-5]{1}[0-9]{1}\\:[0-5]{1}[0-9]{1}$/;
- }
- if(type=="zbfs"){//值班方式
- if(data=='在岗值班' || data=='电话值班' || data=='应急指挥中心值班'){
- flag = true;
- }else{
- flag = false;
- }
- }else if(!checkRex.test(data)){
- flag = false;
- }
-
- return flag;
- }
|