text: $(function () {
      $("#jqGrid").jqGrid({
          url: baseURL + 'eval/colleagueevalbaseitem/list',
          datatype: "json",
          colModel: [			
  			{ label: '序号', name: 'id', index: 'id', width: 50, key: true,hidden:true },
  			{ label: '名称', name: 'name', index: 'name', width: 80 }, 			
  			{ label: '占比', name: 'percentage', index: 'percentage', width: 80 ,
                  formatter: function (value, options, row) {
                      return '<strong>' + value + '%</strong>';
                  }}
          ],
  		viewrecords: true,
          height: 385,
          rowNum: 10,
  		rowList : [10,30,50],
          rownumbers: true, 
          rownumWidth: 25, 
          autowidth:true,
          multiselect: true,
          pager: "#jqGridPager",
          jsonReader : {
              root: "page.list",
              page: "page.currPage",
              total: "page.totalPage",
              records: "page.totalCount"
          },
          prmNames : {
              page:"page", 
              rows:"limit", 
              order: "order"
          },
          gridComplete:function(){
          	//隐藏grid底部滚动条
          	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
          }
      });
  });
  
  var vm = new Vue({
  	el:'#rrapp',
  	data:{
  		showList: true,
  		title: null,
  		colleagueEvalBaseItem: {}
  	},
  	methods: {
  		query: function () {
  			vm.reload();
  		},
  		add: function(){
  			vm.showList = false;
  			vm.title = "新增";
  			vm.colleagueEvalBaseItem = {};
  		},
  		update: function (event) {
  			var id = getSelectedRow();
  			if(id == null){
  				return ;
  			}
  			vm.showList = false;
              vm.title = "修改";
              
              vm.getInfo(id)
  		},
  		saveOrUpdate: function (event) {
  		    $('#btnSaveOrUpdate').button('loading').delay(1000).queue(function() {
                  var url = vm.colleagueEvalBaseItem.id == null ? "eval/colleagueevalbaseitem/save" : "eval/colleagueevalbaseitem/update";
                  $.ajax({
                      type: "POST",
                      url: baseURL + url,
                      contentType: "application/json",
                      data: JSON.stringify(vm.colleagueEvalBaseItem),
                      success: function(r){
                          if(r.code === 0){
                               layer.msg("操作成功", {icon: 1});
                               vm.reload();
                               $('#btnSaveOrUpdate').button('reset');
                               $('#btnSaveOrUpdate').dequeue();
                          }else{
                              layer.alert(r.msg);
                              $('#btnSaveOrUpdate').button('reset');
                              $('#btnSaveOrUpdate').dequeue();
                          }
                      }
                  });
  			});
  		},
  		del: function (event) {
  			var ids = getSelectedRows();
  			if(ids == null){
  				return ;
  			}
  			var lock = false;
              layer.confirm('确定要删除选中的记录？', {
                  btn: ['确定','取消'] //按钮
              }, function(){
                 if(!lock) {
                      lock = true;
  		            $.ajax({
                          type: "POST",
                          url: baseURL + "eval/colleagueevalbaseitem/delete",
                          contentType: "application/json",
                          data: JSON.stringify(ids),
                          success: function(r){
                              if(r.code == 0){
                                  layer.msg("操作成功", {icon: 1});
                                  $("#jqGrid").trigger("reloadGrid");
                              }else{
                                  layer.alert(r.msg);
                              }
                          }
  				    });
  			    }
               }, function(){
               });
  		},
  		getInfo: function(id){
  			$.get(baseURL + "eval/colleagueevalbaseitem/info/"+id, function(r){
                  vm.colleagueEvalBaseItem = r.colleagueEvalBaseItem;
              });
  		},
  		reload: function (event) {
  			vm.showList = true;
  			var page = $("#jqGrid").jqGrid('getGridParam','page');
  			$("#jqGrid").jqGrid('setGridParam',{ 
                  page:page
              }).trigger("reloadGrid");
  		}
  	}
  });