123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- var table ;
- var selectData = {"list":[
- {"value":"0","key":"该字段既统计又要输入数字"},
- {"value":"1","key":"该字段不统计但要输入数字"},
- {"value":"2","key":"该字段既不统计又不要输入数字"},
- {"value":"3","key":"该字段需要日期统计"}]};
- function initComplete(){
- $("#IS_COUNT_329").data("data",selectData);
- $("#IS_COUNT_329").render();
- var url = decodeURI(window.location.href);
- // 初始化下拉框
- if(url.indexOf("?")>-1){
- var data = url.split("?");
- var title = data[1];
- var desc = data[2];
- var name = data[3];
- var count = data[4];
- var report_type = data[5];
- var report_name = data[6];
- if(title==null||title=="null"){
- title = "";
- }
-
- if(desc==null||desc=="null"){
- desc = "";
- }
- $("#REPORT_TYPE_329").val(report_type);
- $("#TABLE_HEAD_329").val(title);
- $("#COLUMN_NAME_329").val(desc);
- $("#IS_COUNT_329").setValue(count);
- $("#TABLE_COLUMN_329").val(name);
- $("#REPORT_NAME_329").val(report_name);
- }
- }
- //返回主页面
- function goback(){
- window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/Show_Type.html?"+$("#REPORT_TYPE_329").val()+"?"+$("#REPORT_NAME_329").val()));
- }
- //下拉框不能修改
- window.onload = function (){
- $(".selectbox").attr("readonly","readonly");
- };
- //重置
- function clear_msg(){
- top.Dialog.confirm("确定要重置?填写的信息将会被还原,请慎重选择|重置", function() {
- initComplete();
- });
- }
- function alterType() {
- var valid = $("#editForm").validationEngine({
- returnIsValid : true,
- });
- if(valid==true){
- edit();
- }else{
- if($("#COLUMN_NAME_329").val().trim()==""){
- top.Dialog.alert("字段描述不能为空");
- }else if($("#IS_COUNT_329").val().trim()==""){
- top.Dialog.alert("统计类型不能为空");
- }
- }
- }
- function edit(){
- var type = $("#REPORT_TYPE_329").val();
- var head = $("#TABLE_HEAD_329").val();
- var column = $("#COLUMN_NAME_329").val();
- var table_column = $("#TABLE_COLUMN_329").val();
- var count = $("#IS_COUNT_329").val();
- var url = $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/addDictionary";
- $.ajax({
- url : url,
- type : 'post',
- data :{
- report_type:type,
- table_column:table_column,
- column_name:column,
- is_count:count,
- table_head:head,
- type:'yj'
- },
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- top.Dialog.alert("保存成功",null,null,null,1);
- goback();
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }
- //IE屏蔽退格键
- document.onkeydown =function (e) {
- var code,type;
- if (!e){ var e = window.event;}
- if (e.keyCode){ code = e.keyCode;}
- else if (e.which){ code = e.which;}
- type = event.srcElement.type;
- if ((code == 8)
- && ((type == "text" && type == "textarea" ) || event.srcElement.readOnly == true)) {
- event.keyCode = 0;
- event.returnValue = false;
- }
- return true;
- };
|