123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- /**
- * 海峡计划专家评分管理初始化
- */
- var ChannelplanExpert = {
- id: "ChannelplanExpertTable", //表格id
- seItem: null, //选中的条目
- table: null,
- layerIndex: -1
- };
- /**
- * 初始化表格的列
- */
- ChannelplanExpert.initColumn = function () {
- return [
- {field: 'selectItem', radio: true},
- {title: '唯一标识', field: 'id', visible: false , align: 'center', valign: 'middle'},
- {title: '流程', field: 'step', visible: true, align: 'center', valign: 'middle',
- formatter: function (value,row,index) {
- if(value==1){
- return "函审"
- }else if(value==2){
- return "现场评审"
- }
- }},
- {title: '专家', field: 'expertId', visible: true, align: 'center', valign: 'middle'},
- {title: '分数', field: 'score', visible: true, align: 'center', valign: 'middle'},
- {title: '推荐类型', field: 'recommendType', visible: true, align: 'center', valign: 'middle'},
- {title: '函审时间',field: 'createTime',visible: true, align: 'center', valign: 'middle'}
- ];
- };
- /**
- * 检查是否选中
- */
- ChannelplanExpert.check = function () {
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if(selected.length == 0){
- Feng.info("请先选中表格中的某一记录!");
- return false;
- }else{
- ChannelplanExpert.seItem = selected[0];
- return true;
- }
- };
- /**
- * 点击添加海峡计划专家评分
- */
- ChannelplanExpert.openAddChannelplanExpert = function () {
- var index = layer.open({
- type: 2,
- title: '添加海峡计划专家评分',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/channelplanExpert/channelplanExpert_add?process=2'
- });
- this.layerIndex = index;
- };
- /**
- * 打开查看海峡计划专家评分详情
- */
- ChannelplanExpert.openChannelplanExpertDetail = function () {
- if (this.check()) {
- var index = layer.open({
- type: 2,
- title: '海峡计划专家评分详情',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/channelplanExpert/channelplanExpert_update/' + ChannelplanExpert.seItem.id
- });
- this.layerIndex = index;
- }
- };
- /**
- * 删除海峡计划专家评分
- */
- ChannelplanExpert.delete = function () {
- if (this.check()) {
- var ajax = new $ax(Feng.ctxPath + "/channelplanExpert/delete", function (data) {
- Feng.success("删除成功!");
- ChannelplanExpert.table.refresh();
- }, function (data) {
- Feng.error("删除失败!" + data.responseJSON.message + "!");
- });
- ajax.set("channelplanExpertId",this.seItem.id);
- ajax.start();
- }
- };
- /**
- * 查询海峡计划专家评分列表
- */
- ChannelplanExpert.search = function () {
- var queryData = {};
- queryData['condition'] = $("#condition").val();
- ChannelplanExpert.table.refresh({query: queryData});
- };
- /**
- * 函审通过操作
- */
- ChannelplanExpert.secPass = function () {
- var score=$("#secScore").val();
- var type=$("#secType").val();
- var secMsg=$("#secMsg").val();
- $.ajax({
- url : Feng.ctxPath + "/channelplanExpert/secPass?score="+score+"&type="+type+"&secMsg="+secMsg,
- type : 'GET',
- dataType : 'json',
- success : function(data) {
- ChannelplanExpert.close();
- },
- error : function(msg) {
- console.log(0);
- }
- });
- };
- /**
- * 函审失败操作
- */
- ChannelplanExpert.secFail = function () {
- var score=$("#secScore").val();
- var type=$("#secType").val();
- var secMsg=$("#secMsg").val();
- $.ajax({
- url : Feng.ctxPath + "/channelplanExpert/secPass?score="+score+"&type="+type+"&secMsg="+secMsg,
- type : 'GET',
- dataType : 'json',
- success : function(data) {
- ChannelplanExpert.close();
- },
- error : function(msg) {
- console.log(0);
- }
- });
- };
- /**
- * 求算平均分
- */
- ChannelplanExpert.calScore = function(step){
- $.ajax({
- url : Feng.ctxPath + "/channelplanExpert/calScore?step="+step,
- type : 'GET',
- dataType : 'json',
- success : function(data) {
- $("#secScore").val(data);
- },
- error : function(msg) {
- console.log(0);
- }
- });
- }
- /**
- * 获取Type与Msg
- */
- ChannelplanExpert.searchTM = function(){
- $.ajax({
- url : Feng.ctxPath + "/channelplanExpert/returnTM",
- type : 'GET',
- dataType : 'json',
- success : function(data) {
- data=JSON.parse(data);
- $("#secMsg").val(data.secMsg);
- $("#secType").val(data.secType);
- },
- error : function(msg) {
- console.error(msg);
- }
- });
- }
- /**
- * 关闭窗口
- */
- ChannelplanExpert.close = function(){
- parent.layer.close(window.parent.layer.getFrameIndex(window.name));
- }
- $(function () {
- var defaultColunms = ChannelplanExpert.initColumn();
- var table = new BSTable(ChannelplanExpert.id, "/channelplanExpert/list?step=1", defaultColunms);
- table.setPaginationType("client");
- ChannelplanExpert.table = table.init();
- //获取推荐类别
- Feng.addAjaxSelect({
- "id": "secType",
- "displayCode": "code",
- "displayName": "name",
- "type": "GET",
- "url": Feng.ctxPath + "/dict/findChildDictByCode?code=un_declareSort"
- });
- $("select").each(function () {
- $(this).val($(this).attr("selectVal"));
- });
- ChannelplanExpert.searchTM();
- ChannelplanExpert.calScore(1);
- });
|