123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- var table;
- var report_type;
- //增加报表列时表单验证
- function addType() {
- var valid = $("#addForm").validationEngine({
- returnIsValid : true,
- });
- if(valid==true){
- add();
- }else{
- if($("#COLUMN_NAME_529").val().trim()==""){
- top.Dialog.alert("字段描述不能为空");
- }else if($("#TABLE_COLUMN_529").val().trim()==""){
- top.Dialog.alert("备用字段不能为空");
- }else if($("#IS_COUNT_529").val()==""){
- top.Dialog.alert("统计类型不能为空");
- }
- }
- }
- function add(){
- //var formValue = $('#addForm').serialize();
- var type = $("#REPORT_TYPE_529").val();
- var head = $("#TABLE_HEAD_529").val();
- var column = $("#COLUMN_NAME_529").val();
- var table_column = $("#TABLE_COLUMN_529").val();
- var count = $("#IS_COUNT_529").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:"rc"
- },
- 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/am/report/dictionary/Show_Type.html?"+$("#REPORT_TYPE_529").val()+"?"+$("#REPORT_NAME_529").val()));
- }
-
- $(function(){
- var url =decodeURI(window.location.href);
- if(url.indexOf("?")>-1){
- var data = url.split("?");
- $("#REPORT_TYPE_529").val(data[1]);
- $("#REPORT_NAME_529").val(data[2]);
- /*$("#dept").val(data[3]);*/
- }
- // 初始化下拉框
- $.ajax({
- url:$.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getItems",
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- "report_type" : $("#REPORT_TYPE_529").val(),
- "type":"rc"
- },
- dataType : 'json',
- success : function(data) {
- table = data;
- },
- error : function(e) {
- $.messager.alert('查询失败!', '访问服务失败!', 'error');
- }
-
- });
- $("#TABLE_COLUMN_529").data("data",table);
- $("#TABLE_COLUMN_529").render();
- });
- //让下拉框不让改动
- window.onload = function (){
- $(".selectbox").attr("readonly","readonly");
- };
-
- function clear_msg(){
-
- top.Dialog.confirm("确定要重置?填写的信息将会被清除,请慎重选择|重置", function() {
- $("#TABLE_HEAD_529").val("");
- $("#COLUMN_NAME_529").val("");
- $("#TABLE_COLUMN_529").render();
- $("#IS_COUNT_529").render();
- });
- }
|