| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 | 
							- /**
 
-  * 人才认定申报管理初始化
 
-  */
 
- var IntegralInfo = {
 
-     id: "IntegralInfoTable", //表格id
 
-     checkAll: false,
 
-     seItem: null, //选中的条目
 
-     table: null,
 
-     layerIndex: -1
 
- };
 
- /**
 
-  * 初始化表格的列
 
-  */
 
- IntegralInfo.initColumn = function () {
 
-     var type = $("#usertype").val();
 
-     var isShow = true;
 
-     if (type == 2) {
 
-         isShow = false;
 
-     }
 
-     ;
 
-     return [
 
-         {field: 'selectItem', radio: true},
 
-         {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
 
-             formatter: function (value, row, index) {
 
-                 if (row.sex == 1) {
 
-                     return value + '<span style="color:#6495ED">【男】</span>';
 
-                 } else if (row.sex == 2) {
 
-                     return value + '<span style="color:#FF82AB">【女】</span>';
 
-                 } else {
 
-                     return value;
 
-                 }
 
-             }
 
-         },
 
-         {title: '所属单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px"},
 
-         {title: '证件类型', field: 'card_type', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
 
-             formatter: function (value, row, index) {
 
-                 switch (value) {
 
-                     case 1:
 
-                         return "身份证";
 
-                     case 2:
 
-                         return "港澳通行证";
 
-                     case 3:
 
-                         return "护照";
 
-                 }
 
-             }
 
-         },
 
-         {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
 
-         {title: '总积分', field: 'totalPoints', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
 
-         {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
 
-             formatter: function (value, row, index) {
 
-                 return "<span class='label label-success' onclick=\"IntegralInfo.showIntegralLog('" + row.card_type + "','" + row.card_number + "')\" >" +
 
-                         "<i class=\"fa fa-history\"></i> 积分记录" +
 
-                         "</span>";
 
-             }
 
-         }
 
-     ];
 
- };
 
- IntegralInfo.openIntegralLog = function () {
 
-     if (this.check()) {
 
-         IntegralInfo.showIntegralLog(IntegralInfo.seItem.card_type, IntegralInfo.seItem.card_number);
 
-     }
 
- }
 
- /**
 
-  * 显示积分记录
 
-  */
 
- IntegralInfo.showIntegralLog = function (card_type, card_number) {
 
-     layer.open({
 
-         type: 2,
 
-         title: "积分记录",
 
-         fixed: false,
 
-         content: '/admin/integralVerify/integralLog/cardType/' + card_type + '/cardNumber/' + card_number,
 
-         area: ['80%', '80%'],
 
-         fix: false, //不固定
 
-         maxmin: true
 
-     });
 
- }
 
- /**
 
-  * 检查是否选中
 
-  */
 
- IntegralInfo.check = function () {
 
-     var selected = $('#' + this.id).bootstrapTable('getSelections');
 
-     if (selected.length == 0) {
 
-         Feng.info("请先选中表格中的某一记录!");
 
-         return false;
 
-     } else {
 
-         IntegralInfo.seItem = selected[0];
 
-         return true;
 
-     }
 
- };
 
- /**
 
-  * 打开查看积分申报-初级审核详情
 
-  */
 
- IntegralInfo.openIntegralInfoDetail = function () {
 
-     if (this.check()) {
 
-         var index = layer.open({
 
-             type: 2,
 
-             title: '人才认定审核详情',
 
-             area: ['800px', '420px'], //宽高
 
-             fix: false, //不固定
 
-             maxmin: true,
 
-             content: '/admin/integralVerify/detail/id/' + IntegralInfo.seItem.id
 
-         });
 
-         layer.full(index);
 
-         IntegralInfo.layerIndex = index;
 
-     }
 
- };
 
- IntegralInfo.openCheckModal = function (type) {
 
-     if ((type == 2 && this.check()) || type == 1) {
 
-         var selected = $('#' + this.id).bootstrapTable('getSelections');
 
-         selected = selected.length > 0 ? selected[0] : [];
 
-         var subtitle = type == 2 ? "个人" : "企业";
 
-         var enterprise_id = selected.enterprise_id;
 
-         var card_type = selected.card_type;
 
-         var card_number = selected.card_number;
 
-         var ajax = new $ax("/admin/integralVerify/veto", function (data) {
 
-             if (data.code == 200) {
 
-                 layer.open({
 
-                     type: 1,
 
-                     id: "newVetoModalForm",
 
-                     title: '一票否决(' + subtitle + ")",
 
-                     area: ['800px', '350px'], //宽高
 
-                     fix: false, //不固定
 
-                     shade: 0,
 
-                     maxmin: true,
 
-                     content: IntegralInfo.createVetoFormModal(),
 
-                     btn: ['<i class="fa fa-save"></i>  提交', '<i class="fa fa-eraser"></i>  关闭'],
 
-                     btnAlign: 'c',
 
-                     zIndex: layer.zIndex,
 
-                     success: function (layero, index) {
 
-                         $("#vetoForm")[0].reset();
 
-                         $("#vetoType").html('<option value="' + type + '">' + subtitle + '</option>');
 
-                         var veto = data.veto;
 
-                         var list = "";
 
-                         if (type == 1) {
 
-                             for (var i in data.enterprises) {
 
-                                 list += '<option value="' + data.enterprises[i].id + '" ' + (typeof veto.enterprise_id != "undefined" && veto.enterprise_id == data.enterprises[i].id ? "selected" : "") + '>' + data.enterprises[i].name + '</option>';
 
-                             }
 
-                         } else {
 
-                             list += '<option>' + veto.name + '</option>';
 
-                         }
 
-                         $("#vetoObj").html(list);
 
-                         $("#vetoCheckState").val(veto.active == 1 || typeof veto.active == "undefined" ? 1 : 2);
 
-                         $("#vetoMsg").html(veto.description);
 
-                     },
 
-                     yes: function (index, layero) {
 
-                         IntegralInfo.submitVeto(index, type);
 
-                     }
 
-                 });
 
-             } else {
 
-                 Feng.error(data.msg);
 
-             }
 
-         }, function (data) {
 
-             Feng.error("校验失败!" + data.responseJSON.message + "!");
 
-         });
 
-         ajax.setData({type: type, card_type: card_type, card_number: card_number, enterprise_id: enterprise_id})
 
-         ajax.start();
 
-     }
 
- }
 
- var locked = false;
 
- /**
 
-  * 提交一票否决
 
-  */
 
- IntegralInfo.submitVeto = function (i, type) {
 
-     var checkState = $("#vetoCheckState").val();
 
-     var checkMsg = $("#vetoMsg").val();
 
-     var vetoObj = $("#vetoObj").val();
 
-     if (checkState == null || checkState == '') {
 
-         Feng.info("请选择否决状态");
 
-         return;
 
-     }
 
-     if (checkMsg == null || checkMsg == '') {
 
-         Feng.info("请填写意见");
 
-         return;
 
-     }
 
-     var card_type = "";
 
-     var card_number = "";
 
-     if (type == 2 && this.check()) {
 
-         card_type = IntegralInfo.seItem.card_type;
 
-         card_number = IntegralInfo.seItem.card_number;
 
-     }
 
-     if (type == 1 && !vetoObj) {
 
-         Feng.info("请选择企业");
 
-         return;
 
-     }
 
-     if (locked)
 
-         return;
 
-     locked = true;
 
-     var ajax = new $ax(Feng.ctxPath + "/admin/integralVerify/submitVeto", function (data) {
 
-         if (data.code == 200) {
 
-             Feng.success(data.msg);
 
-             window.parent.IntegralInfo.table.refresh();
 
-             layer.close(i);
 
-         } else {
 
-             Feng.error(data.msg);
 
-         }
 
-         locked = false;
 
-     }, function (data) {
 
-         Feng.error("提交失败!" + data.responseJSON.message + "!");
 
-         locked = false;
 
-     });
 
-     ajax.setData({"checkState": checkState, "checkMsg": checkMsg, type: type, card_type: card_type, card_number: card_number, enterprise_id: vetoObj});
 
-     ajax.start();
 
- }
 
- IntegralInfo.createVetoFormModal = function () {
 
-     return '<form id="vetoForm">\n' +
 
-             '  <div class="form-group" style="margin: 10px;">\n' +
 
-             '      <div class="row" style="margin-bottom: 10px;">\n' +
 
-             '         <label class="col-sm-2 control-label">类型</label>\n' +
 
-             '         <div class="col-sm-10">\n' +
 
-             '           <select id="vetoType" name="vetoType" class="form-control">\n' +
 
-             '           </select>\n' +
 
-             '         </div>\n' +
 
-             '       </div>\n' +
 
-             '      <div class="row" style="margin-bottom: 10px;">\n' +
 
-             '         <label class="col-sm-2 control-label">名称</label>\n' +
 
-             '         <div class="col-sm-10">\n' +
 
-             '           <select id="vetoObj" name="vetoObj" class="form-control">\n' +
 
-             '           </select>\n' +
 
-             '         </div>\n' +
 
-             '       </div>\n' +
 
-             '      <div class="row" style="margin-bottom: 10px;">\n' +
 
-             '         <label class="col-sm-2 control-label">状态</label>\n' +
 
-             '         <div class="col-sm-10">\n' +
 
-             '           <select id="vetoCheckState" name="vetoCheckState" class="form-control">\n' +
 
-             '               <option value="1">一票否决</option>\n' +
 
-             '               <option value="2">恢复</option>\n' +
 
-             '           </select>\n' +
 
-             '         </div>\n' +
 
-             '       </div>\n' +
 
-             '       <div class="row">\n' +
 
-             '          <label class="col-sm-2 control-label">意见</label>\n' +
 
-             '          <div class="col-sm-10">\n' +
 
-             '           <textarea id="vetoMsg" name="vetoMsg" class="form-control"></textarea>\n' +
 
-             '           </div>\n' +
 
-             '      </div>\n' +
 
-             '   </div>\n' +
 
-             '</form>';
 
- }
 
- /**
 
-  * 选择导出提交
 
-  */
 
- IntegralInfo.checkExport = function () {
 
-     var selected = $('#dataTable').bootstrapTable('getSelections');
 
-     if (!selected || selected.length < 1) {
 
-         Feng.info("请至少选择一行数据!");
 
-         return;
 
-     }
 
-     var ids = "";
 
-     for (var i = 0; i < selected.length; i++) {
 
-         ids = ids + selected[i].id + ",";
 
-     }
 
-     window.location.href = Feng.ctxPath + "/admin/integralVerify/prepareHczx?ids=" + ids;
 
- }
 
- //回调
 
- IntegralInfo.callBack = function (data) {
 
-     Feng.info(data.msg);
 
-     if (data.code == 200) {
 
-         $("#hczxModal").modal("hide");
 
-         IntegralInfo.table.refresh();
 
-     }
 
- }
 
- $(function () {
 
-     var defaultColunms = IntegralInfo.initColumn();
 
-     var table = new BSTable(IntegralInfo.id, "/admin/integralVerify/list/process/4", defaultColunms);
 
-     table.setPaginationType("server");
 
-     table.setSingleSelect(false);
 
-     table.setOnDblClickRow(function () {
 
-         //IntegralInfo.openIntegralInfoDetail();
 
-     });
 
-     var t = IntegralInfo.table = table.init();
 
-     IntegralInfo.init();
 
-     $('#checkAll').click(function () {
 
-         $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
 
-     })
 
-     $('#uncheckAll').click(function () {
 
-         $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
 
-     })
 
- });
 
 
  |