123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- var table;
- var report_type;
- //增加报表列时表单验证
- function addType() {
- var valid = $("#addForm").validationEngine({
- returnIsValid : true,
- });
- if(valid==true){
- add();
- }else{
- if($("#COLUMN_NAME_329").val().trim()==""){
- top.Dialog.alert("字段描述不能为空");
- }else if($("#TABLE_COLUMN_329").val().trim()==""){
- top.Dialog.alert("备用字段不能为空");
- }else if($("#IS_COUNT_329").val()==""){
- top.Dialog.alert("统计类型不能为空");
- }
- }
- }
- function add(){
- //var formValue = $('#addForm').serialize();
- 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('操作失败');
- }
- });
- }
- 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()));
- }
- var selectData = {"list":[
- {"value":"0","key":"该字段既统计又要输入数字"},
- {"value":"1","key":"该字段不统计但要输入数字"},
- {"value":"2","key":"该字段既不统计又不要输入数字"},
- {"value":"3","key":"该字段需要日期统计"}]};
- $(function(){
- $("#IS_COUNT_329").data("data",selectData);
- $("#IS_COUNT_329").render();
- var url =decodeURI(window.location.href);
- if(url.indexOf("?")>-1){
- var data = url.split("?");
- $("#REPORT_TYPE_329").val(data[1]);
- $("#REPORT_NAME_329").val(data[2]);
- if(data[1]=="7"){
- $("#TABLE_HEAD_329").removeClass("validate[required,length[0,10]]");
- $("#TABLE_HEAD_329").addClass("validate[length[0,10]]");
- $("#span").html("");
- }
- }
- // 初始化下拉框
- $.ajax({
- url:$.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getItems",
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- "report_type" : $("#REPORT_TYPE_329").val(),
- "type":"yj"
- },
- dataType : 'json',
- success : function(data) {
- table = data;
- },
- error : function(e) {
- $.messager.alert('查询失败!', '访问服务失败!', 'error');
- }
-
- });
- $("#TABLE_COLUMN_329").data("data",table);
- $("#TABLE_COLUMN_329").render();
- });
- //让下拉框不让改动
- window.onload = function (){
- $(".selectbox").attr("readonly","readonly");
- };
-
- function clear_msg(){
-
- top.Dialog.confirm("确定要重置?填写的信息将会被清除,请慎重选择|重置", function() {
- $("#TABLE_HEAD_329").val("");
- $("#COLUMN_NAME_329").val("");
- $("#TABLE_COLUMN_329").render();
- $("#IS_COUNT_329").render();
- });
- }
|