|
@@ -2,45 +2,47 @@
|
|
|
* 批次管理管理初始化
|
|
|
*/
|
|
|
var Batch = {
|
|
|
- id: "BatchTable", //表格id
|
|
|
- seItem: null, //选中的条目
|
|
|
+ id: "BatchTable", //表格id
|
|
|
+ seItem: null, //选中的条目
|
|
|
table: null,
|
|
|
layerIndex: -1
|
|
|
};
|
|
|
-
|
|
|
+Feng.ctxPath = "/admin";
|
|
|
/**
|
|
|
* 初始化表格的列
|
|
|
*/
|
|
|
Batch.initColumn = function () {
|
|
|
return [
|
|
|
{field: 'selectItem', radio: true},
|
|
|
- {title: '申报类别', field: 'type', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '人才类型', field: 'source', visible: true, align: 'center', valign: 'middle',
|
|
|
- formatter: function (value, row, index) {
|
|
|
- if(value == 1) {
|
|
|
- return "晋江市优秀人才";
|
|
|
- }if(value == 2) {
|
|
|
- return "晋江市集成电路优秀人才";
|
|
|
- }
|
|
|
+ {title: '申报类别', field: 'type', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '人才类型', field: 'source', visible: true, align: 'center', valign: 'middle',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == 1) {
|
|
|
+ return "晋江市优秀人才";
|
|
|
+ }
|
|
|
+ if (value == 2) {
|
|
|
+ return "晋江市集成电路优秀人才";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '申报批次', field: 'batch', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '申报开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '申报截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '提交截止时间', field: 'submitEndTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '公示开始时间', field: 'publicStartTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '公示截止时间', field: 'publicEndTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '平均工资', field: 'averageWage', visible: true, align: 'center', valign: 'middle'},
|
|
|
+ {title: '是否有效', field: 'active', visible: true, align: 'center', valign: 'middle',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == 1) {
|
|
|
+ return "<span style='color: green'>是</span>";
|
|
|
}
|
|
|
- },
|
|
|
- {title: '申报批次', field: 'batch', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '申报开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '申报截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '提交截止时间', field: 'submitEndTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '公示开始时间', field: 'publicStartTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '公示截止时间', field: 'publicEndTime', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '平均工资', field: 'averageWage', visible: true, align: 'center', valign: 'middle'},
|
|
|
- {title: '是否有效', field: 'active', visible: true, align: 'center', valign: 'middle',
|
|
|
- formatter: function (value, row, index) {
|
|
|
- if(value == 1) {
|
|
|
- return "<span style='color: green'>是</span>";
|
|
|
- }if(value == 2) {
|
|
|
- return "<span style='color: red'>否</span>";
|
|
|
- }
|
|
|
+ if (value == 2) {
|
|
|
+ return "<span style='color: red'>否</span>";
|
|
|
}
|
|
|
- },
|
|
|
- {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'}
|
|
|
|
|
|
];
|
|
|
};
|
|
@@ -50,10 +52,10 @@ Batch.initColumn = function () {
|
|
|
*/
|
|
|
Batch.check = function () {
|
|
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
|
|
- if(selected.length == 0){
|
|
|
+ if (selected.length == 0) {
|
|
|
Feng.info("请先选中表格中的某一记录!");
|
|
|
return false;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Batch.seItem = selected[0];
|
|
|
return true;
|
|
|
}
|
|
@@ -69,7 +71,7 @@ Batch.openAddBatch = function () {
|
|
|
area: ['800px', '420px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/batch/batch_add'
|
|
|
+ content: Feng.ctxPath + '/batch/add'
|
|
|
});
|
|
|
Batch.layerIndex = index;
|
|
|
};
|
|
@@ -85,7 +87,7 @@ Batch.openBatchDetail = function () {
|
|
|
area: ['800px', '420px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/batch/batch_update/' + Batch.seItem.id
|
|
|
+ content: Feng.ctxPath + '/batch/edit/id/' + Batch.seItem.id
|
|
|
});
|
|
|
Batch.layerIndex = index;
|
|
|
}
|
|
@@ -96,14 +98,14 @@ Batch.openBatchDetail = function () {
|
|
|
*/
|
|
|
Batch.delete = function () {
|
|
|
if (this.check()) {
|
|
|
- var operation = function(){
|
|
|
+ var operation = function () {
|
|
|
var ajax = new $ax(Feng.ctxPath + "/batch/delete", function (data) {
|
|
|
Feng.success("删除成功!");
|
|
|
Batch.table.refresh();
|
|
|
}, function (data) {
|
|
|
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
- ajax.set("batchId",Batch.seItem.id);
|
|
|
+ ajax.set("batchId", Batch.seItem.id);
|
|
|
ajax.start();
|
|
|
};
|
|
|
Feng.confirm("是否刪除该批次?", operation);
|
|
@@ -114,7 +116,7 @@ Batch.delete = function () {
|
|
|
* 查询表单提交参数对象
|
|
|
* @returns {{}}
|
|
|
*/
|
|
|
-Batch.formParams = function() {
|
|
|
+Batch.formParams = function () {
|
|
|
var queryData = {};
|
|
|
queryData['type'] = $("#type").val();
|
|
|
queryData['source'] = $("#source").val();
|
|
@@ -133,7 +135,7 @@ Batch.search = function () {
|
|
|
/**
|
|
|
* 重置
|
|
|
*/
|
|
|
-Batch.reset = function (){
|
|
|
+Batch.reset = function () {
|
|
|
$("#type").val("");
|
|
|
$("#active").val("");
|
|
|
$("#source").val("");
|
|
@@ -142,48 +144,48 @@ Batch.reset = function (){
|
|
|
/**
|
|
|
* 设置生效
|
|
|
*/
|
|
|
-Batch.setActive = function (){
|
|
|
+Batch.setActive = function () {
|
|
|
if (this.check()) {
|
|
|
- if(Batch.seItem.active==1){
|
|
|
+ if (Batch.seItem.active == 1) {
|
|
|
Feng.error("该批次已生效,无需再次操作");
|
|
|
- return ;
|
|
|
+ return;
|
|
|
}
|
|
|
- var operation = function(){
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/batch/setupActive", function (data) {
|
|
|
- if(data.code=="200"){
|
|
|
+ var operation = function () {
|
|
|
+ var ajax = new $ax(Feng.ctxPath + "/batch/setActive", function (data) {
|
|
|
+ if (data.code == "200") {
|
|
|
Feng.success(data.msg);
|
|
|
Batch.table.refresh();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Feng.error(data.msg);
|
|
|
}
|
|
|
}, function (data) {
|
|
|
Feng.error("设置生效失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
- ajax.set("batchId",Batch.seItem.id);
|
|
|
+ ajax.set("batchId", Batch.seItem.id);
|
|
|
ajax.start();
|
|
|
};
|
|
|
Feng.confirm("一旦设置生效,该类别其他批次将无效,确认生效吗?", operation);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-Batch.setNotActive = function(){
|
|
|
+Batch.setNotActive = function () {
|
|
|
if (this.check()) {
|
|
|
- if(Batch.seItem.active==2){
|
|
|
+ if (Batch.seItem.active == 2) {
|
|
|
Feng.error("该批次未生效,无需再次操作");
|
|
|
- return ;
|
|
|
+ return;
|
|
|
}
|
|
|
- var operation = function(){
|
|
|
+ var operation = function () {
|
|
|
var ajax = new $ax(Feng.ctxPath + "/batch/setNotActive", function (data) {
|
|
|
- if(data.code=="200"){
|
|
|
+ if (data.code == "200") {
|
|
|
Feng.success(data.msg);
|
|
|
Batch.table.refresh();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Feng.error(data.msg);
|
|
|
}
|
|
|
}, function (data) {
|
|
|
Feng.error("设置失效失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
- ajax.set("batchId",Batch.seItem.id);
|
|
|
+ ajax.set("batchId", Batch.seItem.id);
|
|
|
ajax.start();
|
|
|
};
|
|
|
Feng.confirm("确认设置失效吗?", operation);
|