123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- /**
- * 硕博人才生活补贴申报管理初始化
- */
- var LivingAllowanceInfo = {
- id: "LivingAllowanceInfoTable", //表格id
- seItem: null, //选中的条目
- table: null,
- layerIndex: -1
- };
- /**
- * 初始化表格的列
- */
- LivingAllowanceInfo.initColumn = function () {
- return [
- {field: 'selectItem', radio: true},
- {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: '80px'},
- {
- title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
- formatter: function (value, row, index) {
- return row.sex == 1 ? value + '<span style="color:#6495ED">【男】</span>' : value + '<span style="color:#FF82AB">【女】</span>';
- }
- },
- // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px",
- // formatter : function (value,row,index){
- // return value == 1?"晋江市现代产业体系人才":"集成电路优秀人才";
- // }
- // },
- {
- title: '人才标签',
- field: 'talentTypeName',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '证件号码',
- field: 'idCard',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "150px"
- },
- {
- title: '企业名称',
- field: 'enterpriseName',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '最高学历',
- field: 'highEducation',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '毕业学校',
- field: 'graduateSchool',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '手机号码',
- field: 'phone',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '本单位入职时间',
- field: 'entryTime',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '首次来晋工作时间',
- field: 'firstInJJTime',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '申请次数',
- field: 'applyCount',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '审核状态',
- field: 'checkStateName',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- {
- title: '公示状态',
- field: 'isPublicName',
- visible: true,
- align: 'center',
- valign: 'middle',
- 'class': 'uitd_showTip',
- width: "100px"
- },
- ];
- };
- /**
- * 检查是否选中
- */
- LivingAllowanceInfo.check = function () {
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if (selected.length == 0) {
- Feng.info("请先选中表格中的某一记录!");
- return false;
- } else {
- LivingAllowanceInfo.seItem = selected[0];
- return true;
- }
- };
- /**
- * 点击添加硕博人才生活补贴申报
- */
- LivingAllowanceInfo.openAddLivingAllowanceInfo = function () {
- var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsAdd", function (data) {
- if (data.code == 200) {
- var index = layer.open({
- type: 2,
- title: '添加人才生活补贴申报',
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_add?year=' + data.obj,
- btn: ['<i class="fa fa-eye"></i> 保存未提交', '<i class="fa fa-check layui-bg-green"></i> 提交审核', '<i class="fa fa-eraser"></i> 取消'],
- btnAlign: 'c',
- btn1: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.LivingAllowanceInfoInfoDlg.addSubmit();
- }, btn2: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.LivingAllowanceInfoInfoDlg.submitToCheck();
- return false;
- },
- success: function (layero, index) {
- layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
- },
- end: function () {
- layer.closeAll('tips');
- }
- });
- layer.full(index);
- LivingAllowanceInfo.layerIndex = index;
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("type", CONFIG.project_master_living_allowance);
- ajax.start();
- };
- /**
- * 打开查看硕博人才生活补贴申报详情
- */
- LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
- if (this.check()) {
- var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsEditOrSubmit", function (data) {
- if (data.code == 200) {
- var index = layer.open({
- type: 2,
- title: '硕博人才生活补贴修改',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/update",
- btn: ['<i class="fa fa-eye"></i> 保存未提交', '<i class="fa fa-check layui-bg-green"></i> 提交审核', '<i class="fa fa-eraser"></i> 取消'],
- btnAlign: 'c',
- btn1: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.LivingAllowanceInfoInfoDlg.addSubmit();
- }, btn2: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.LivingAllowanceInfoInfoDlg.submitToCheck();
- return false;
- },
- success: function (layero, index) {
- layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
- },
- end: function () {
- layer.closeAll('tips');
- }
- });
- layer.full(index);
- LivingAllowanceInfo.layerIndex = index;
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("type", CONFIG.project_master_living_allowance);
- ajax.set("year", LivingAllowanceInfo.seItem.year);
- ajax.start();
- }
- };
- /**
- * 打开查看窗口
- */
- LivingAllowanceInfo.openLivingAllowanceInfoSelect = function () {
- if (this.check()) {
- var index = layer.open({
- type: 2,
- title: '硕博人才生活补贴详情',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/select",
- btn: ['<i class="fa fa-eraser"></i> 取消'],
- btnAlign: 'c',
- });
- layer.full(index);
- LivingAllowanceInfo.layerIndex = index;
- }
- }
- /**
- * 删除硕博人才生活补贴申报
- */
- LivingAllowanceInfo.delete = function () {
- if (this.check()) {
- if (LivingAllowanceInfo.seItem.checkState != 0) {
- Feng.error("该申报已提交审核,无法删除");
- return;
- }
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/api/livingAllowanceInfo/delete", function (data) {
- Feng.success("删除成功!");
- LivingAllowanceInfo.table.refresh();
- }, function (data) {
- Feng.error("删除失败!" + data.responseJSON.message + "!");
- });
- ajax.set("livingAllowanceInfoId", LivingAllowanceInfo.seItem.id);
- ajax.start();
- }
- Feng.confirm("删除后无法恢复,确认删除吗?", operation);
- }
- };
- /**
- * 查询硕博人才生活补贴申报列表
- */
- LivingAllowanceInfo.search = function () {
- var queryData = {};
- queryData['name'] = $("#name").val();
- queryData['idCard'] = $("#idCard").val();
- LivingAllowanceInfo.table.refresh({query: queryData});
- };
- $(function () {
- var defaultColunms = LivingAllowanceInfo.initColumn();
- var table = new BSTable(LivingAllowanceInfo.id, "/api/livingAllowanceInfo/list", defaultColunms);
- table.setOnDblClickRow(function () {
- LivingAllowanceInfo.openLivingAllowanceInfoSelect();
- });
- table.setPaginationType("server");
- LivingAllowanceInfo.table = table.init();
- });
|