| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- var dataDictionaryTable;
- function searchList() {
- var dName = document.getElementById("dName"); //标准名称
- // var isValid = document.getElementById("isValid"); // 是否有效
- var jsonObject = {"dName":""};
- if (dName.value) {
- jsonObject.dName = encodeURI(dName.value);
- }
- if(dataDictionaryTable == undefined){
- $(function() {
- dataDictionaryTable = $("#dataDictionaryTable").ligerGrid({
- columns : [
- {
- display : '标准项名称',
- name : 'dname',
- align : 'center',
- width : 220
- },{
- display : '摘要',
- name : 'remark',
- width : 220,
- align : 'center'
- },{
- display : '类型',
- name : 'type',
- width : 180,
- align : 'center',
- render : function(rowdata, rowindex, value) {return getTypeText(value);}
- }, {
- display : '更新时间',
- name : 'update_date',
- width : 120,
- align : 'center'
- }, {
- display : '操作',
- name : 'projtypename',
- width : 120,
- align : 'center',
- isSort: false,
- render : function(rowdata, rowindex, value) {
- var h = "";
- h += "<a href='javascript:getDataDictionaryDetail("+ rowdata.universalid + ")'>查看</a> ";
- if(rowdata.type == 'U' || rowdata.type == 'S'){
- h += "<a href='javascript:editDataDictionary("+ rowdata.universalid + ")'>修改</a> ";
- }
- return h;
- }
- }],
- pageSize : 20,
- url : 'contractDataDictionaryAction.do?task=getDataDictionaryList&time='+ new Date().getTime(),
- width : "99.8%",
- height : "99%",
- parms :jsonObject,
- pageParmName : 'curPage',
- pagesizeParmName : 'pageSize',
- onError:function(err){
- alert("获取数据失败,请刷新页面后重试!");
- }
- });
- });
- }else{
- dataDictionaryTable.set("parms",jsonObject);
- dataDictionaryTable.loadData();
- }
- }
- var childDataDictionaryTable;
- function searchChildList() {
- var jsonObject = {"parentId":parentId};
- if(childDataDictionaryTable == undefined){
- childDataDictionaryTable = $("#childDataDictionaryTable").ligerGrid({
- columns : [
- {
- display : '标准项名称',
- name : 'dname',
- align : 'center',
- width : 220
- },{
- display : '设定值',
- name : 'dvalue',
- width : 180,
- align : 'center'
- },{
- display : '排序号',
- name : 'dorder',
- width : 100,
- align : 'center',
- type: 'int'
- },{
- display : '是否默认',
- name : 'is_default',
- width : 80,
- align : 'center',
- type:'int',
- render: function (item){
- if (parseInt(item.is_default) == 0) return '否';
- return '是';
- }
- },{
- display : '是否有效',
- name : 'is_valid',
- width : 80,
- align : 'center',
- type:'int',
- render : function(rowdata, rowindex, value) {
- var h = "";
- if(value == 0){
- h += "<font style='color:#ff0000'>否</font> ";
- }else{
- h += "是";
- }
- return h;
- }
- }
- ],
- url : 'contractDataDictionaryAction.do?task=getDataDictionaryList&time=' + new Date().getTime(),
- width : "99.8%",
- height : "99%",
- parms :jsonObject,
- enabledEdit: true,
- clickToEdit: false,
- pageParmName : 'curPage',
- usePager:false,
- pagesizeParmName : 'pageSize',
- onError:function(err){
- alert("获取数据失败,请刷新页面后重试!");
- }
- });
- }else{
- childDataDictionaryTable.set("parms", jsonObject);
- childDataDictionaryTable.loadData();
- }
- }
- function getTypeText(type){
- if(type == "U"){
- return "普通";
- }else if(type == "S"){
- return "系统";
- }else if(type == "C"){
- return "内置";
- }else{
- return "未知";
- }
- }
- function editDataDictionary(dataDictionaryId) {
- var uri = "contractDataDictionaryAction.do?task=editDataDictionary&dataDictionaryId=" + dataDictionaryId;
- addTab(uri, "编辑标准", uri, true);
- }
- function getDataDictionaryDetail(dataDictionaryId) {
- var uri = "contractDataDictionaryAction.do?task=getDataDictionaryDetail&dataDictionaryId=" + dataDictionaryId;
- addTab(uri, "查看标准", uri, true);
- }
- function initDataDictionary(){
- $.ajax({
- type:"POST",
- url:"contractDataDictionaryAction.do?task=cloneTmsDataDictionary",
- timeout:10000,
- cache:false,
- dataType:"json",
- beforeSend:function(){
- if(initDialog){
- initDialog.close();
- }
- showWaittingDialog("正在初始化,请稍后……");
- },
- success:function(data){
- if(data.success){
- if(dataDictionaryTable){
- dataDictionaryTable.loadData();
- }
- $.ligerDialog.success("初始化完成!");
- }else{
- showAjaxError(null, data.error);
- }
- },
- error:showAjaxError,
- complete:closeWaittingDialog
- });
- }
- function refreshCache(){
- $.ajax({
- type:"POST",
- url:"contractDataDictionaryAction.do?task=refreshCache",
- timeout:10000,
- cache:false,
- dataType:"json",
- beforeSend:function(){
- if(initDialog){
- initDialog.close();
- }
- showWaittingDialog("正在刷新,请稍后……");
- },
- success:function(data){
- if(data.success){
- $.ligerDialog.success("刷新完成!");
- }else{
- showAjaxError(null, data.error);
- }
- },
- error:showAjaxError,
- complete:closeWaittingDialog
- });
- }
|