123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481 |
- var prefix = "/datas/expertVerify";
- var unSelected = "#999";
- var selected = "#333";
- $(function () {
- $("#unitProvince").val('');
- //初始化 默认审核中
- //$('#status').val('2');
- load();
- //数据级别
- loadLevel();
- //所属行业子类
- // loadIndustry();
- //所属行业
- loadIndustryType();
- //数据类别
- loadType();
- //初始化联合审批部门
- load_direct_select();
- //省份
- loadProvince();
- //地市
- loadCity();
- loadAuditStage();
- //select 框切换
- $("#status").css("color", unSelected);
- $("#status").change(function () {
- var selItem = $(this).val();
- if (selItem == $(this).find('option:first').val()) {
- $(this).css("color", unSelected);
- } else {
- $(this).css("color", selected);
- }
- });
- });
- $('.dropdown-toggle').dropdown();
- var myColumns = [];
- myColumns.push({
- checkbox: true
- },
- {
- field: 'no',
- title: '序号',
- align: "center",
- width: 65,
- formatter: function (value, row, index) {
- //获取每页显示的数量
- var pageSize = $('#exampleTable').bootstrapTable('getOptions').pageSize;
- //获取当前是第几页
- var pageNumber = $('#exampleTable').bootstrapTable('getOptions').pageNumber;
- //返回序号,注意index是从0开始的,所以要加上1
- return pageSize * (pageNumber - 1) + index + 1;
- }
- })
- $.each(commonData,function (index,value){
- myColumns.push(value);
- })
- myColumns.push(
- {
- // 1:市级 2:省级
- field: 'auditStage',
- title: '审核阶段',
- titleTooltip: "审核阶段",
- formatter: function (item, index) {
- if (item == '1') {
- return '<span class="label label-primary">市级</span>';
- } else if (item == '2') {
- return '<span class="label label-success">省级</span>';
- }
- },
- width: 120,
- align: "center",
- },
- {
- // 0:正常 1:删除 2:已上报 3:通过审核 4:驳回
- field: 'dataStatus',
- title: '状态',
- titleTooltip: "状态",
- formatter: function (item, index) {
- if (item == '2') {
- return '<span class="label label-primary">审核中</span>';
- } else if (item == '3') {
- return '<span class="label label-success">通过审核</span>';
- } else if (item == '4') {
- return '<span class="label label-danger">驳回</span>';
- }
- },
- width: 120,
- align: "center",
- },
- {
- title: '操作',
- field: 'id',
- align: 'center',
- width: '200px',
- formatter: function (value, row, index) {
- var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="详情" onclick="edit(\''
- + row.id
- + '\')"><i class="fa fa-book"></i></a> ';
- var d = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
- + row.id
- + '\')"><i class="fa fa-remove"></i></a> ';
- var f = '<a class="btn btn-success btn-sm ' + s_verify_h + '" href="#" title="审核" mce_href="#" onclick="verify(\''
- + row.id
- + '\')"><i class="fa fa-envelope-o"></i></a> ';
- var g = '<a class="btn btn-success btn-sm ' + s_rebut_h + '" href="#" title="驳回" mce_href="#" onclick="rebut(\''
- + row.id
- + '\')"><i class="fa fa-reply"></i></a> ';
- var h = '<a class="btn btn-success btn-sm ' + s_expertOpinion_h + '" href="#" title="专家意见" mce_href="#" onclick="expertOpinion(\''
- + row.id
- + '\')"><i class="fa fa-edit"></i></a> ';
- if (row.dataStatus == '3' || row.dataStatus == '4' || row.dataStatus == '5' || row.dataStatus == '6') {
- return e + d;
- } else if (row.dataStatus == '2') {
- return e + f + g + d + h;
- }
- }
- });
- function load() {
- $('#exampleTable')
- .bootstrapTable(
- {
- method: 'get', // 服务器数据的请求方式 get or post
- url: prefix + "/list", // 服务器数据的加载地址
- // showRefresh : true,
- // showToggle : true,
- // showColumns : true,
- iconSize: 'outline',
- toolbar: '#exampleToolbar',
- striped: true, // 设置为true会有隔行变色效果
- dataType: "json", // 服务器返回的数据类型
- pagination: true, // 设置为true会在底部显示分页条
- // queryParamsType : "limit",
- // //设置为limit则会发送符合RESTFull格式的参数
- singleSelect: false, // 设置为true将禁止多选
- // contentType : "application/x-www-form-urlencoded",
- // //发送到服务器的数据编码类型
- pageSize: 10, // 如果设置了分页,每页数据条数
- pageNumber: 1, // 如果设置了分布,首页页码
- //search : true, // 是否显示搜索框
- showColumns: true, // 是否显示内容下拉框(选择显示的列)
- showRefresh: true,
- sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
- // exportOptions:{
- // ignoreColumn: [0,1], //忽略某一列的索引
- // fileName: '备案数据信息', //文件名称设置
- // worksheetName: 'sheet1', //表格工作区名称
- // tableName: '备案数据表',
- // excelstyles: ['background-color', 'color', 'font-size', 'font-weight'],
- // onMsoNumberFormat: DoOnMsoNumberFormat
- // },
- queryParams: function (params) {
- return {
- //说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
- limit: params.limit,
- offset: params.offset,
- dataName: $('#dataName').val(),
- reporterUnit: $('#reporterUnit').val(),
- dataIndustry: $('#dataIndustry').val(),
- industryTypeOne: $('#industryTypeOne').val(),
- dataStatus: $('#status').val(),
- dataLevel: $('#dataLevel').val(),
- auditStage: $('#auditStage').val(),
- unitCity: $('#unitCity').val(), //市区
- sendVerify: '2',//送审状态
- unitProvince: $('#unitProvince').val(),
- };
- },
- onLoadSuccess: function () {
- //鼠标悬停显示全部内容~
- $('.bootstrap-table tr td').each(function () {
- $(this).attr("title", $(this).text());
- $(this).css("cursor", 'pointer');
- });
- },
- columns: myColumns
- })
- /*table resize*/
- .colResizable({
- liveDrag: true,
- gripInnerHtml: "<div class='grip'></div>",
- draggingClass: "dragging",
- resizeMode: 'fit'
- });
- }
- function reLoad() {
- // $('#exampleTable').bootstrapTable('refresh');
- $('#exampleTable').bootstrapTable('destroy');
- load();
- }
- function add() {
- layer.open({
- type: 2,
- title: '数据导入',
- maxmin: true,
- shadeClose: false, // 点击遮罩关闭层
- area: ['800px', '500px'],
- content: prefix + '/batchAdd' // iframe的url
- });
- }
- function expertOpinion(id) {
- layer.open({
- type: 2,
- title: '专家意见',
- maxmin: true,
- shadeClose: false, // 点击遮罩关闭层
- area: ['800px', '500px'],
- content: prefix + '/expertOpinion/'+ id // iframe的url
- });
- }
- function edit(id) {
- layer.open({
- type: 2,
- title: '详情',
- maxmin: true,
- shadeClose: false, // 点击遮罩关闭层
- area: ['100%', '100%'],
- content: prefix + '/edit/' + id // iframe的url
- });
- }
- function remove(id) {
- layer.confirm('确定要删除选中的记录?', {
- btn: ['确定', '取消']
- }, function () {
- $.ajax({
- url: prefix + "/remove",
- type: "post",
- data: {
- 'id': id
- },
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- })
- }
- //重置查询条件
- function reset() {
- //重置
- $('.form-group').find('input,select').val("");
- //重置行业
- // $('#dataIndustry').val("--选择行业--");
- $("#dataIndustry").val("").trigger("chosen:updated");
- $("#industryTypeOne").val("").trigger("chosen:updated");
- $("#unitCity").val("").trigger("chosen:updated");
- $("#dataLevel").val("").trigger("chosen:updated");
- $("#auditStage").val("").trigger("chosen:updated");
- //置灰
- $("#status").css("color", unSelected);
- }
- function batchRemove() {
- var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
- if (rows.length == 0) {
- layer.msg("请选择要删除的数据");
- return;
- }
- layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
- btn: ['确定', '取消']
- // 按钮
- }, function () {
- var ids = new Array();
- // 遍历所有选择的行数据,取每条数据对应的ID
- $.each(rows, function (i, row) {
- ids[i] = row['id'];
- });
- $.ajax({
- type: 'POST',
- data: {
- "ids": ids
- },
- url: prefix + '/batchRemove',
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- }, function () {
- });
- }
- //审核通过
- function verify(id) {
- layer.confirm('确定要审核通过选中的备案申请?', {
- btn: ['确定', '取消']
- }, function () {
- $.ajax({
- url: prefix + "/verify",
- type: "post",
- data: {
- 'id': id
- },
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- })
- }
- //驳回
- function rebut(id) {
- layer.confirm('确定要驳回选中的备案申请?', {
- btn: ['确定', '取消']
- }, function () {
- $.ajax({
- url: prefix + "/rebut",
- type: "post",
- data: {
- 'id': id
- },
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- })
- }
- //批量审核通过
- function batchVerify() {
- var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
- if (rows.length == 0) {
- layer.msg("请选择要审核的备案数据");
- return;
- }
- layer.confirm("确认要审核通过选中的'" + rows.length + "'条备案数据吗?", {
- btn: ['确定', '取消']
- // 按钮
- }, function () {
- var ids = new Array();
- // 遍历所有选择的行数据,取每条数据对应的ID
- $.each(rows, function (i, row) {
- ids[i] = row['id'];
- });
- $.ajax({
- type: 'POST',
- data: {
- "ids": ids
- },
- url: prefix + '/batchVerify',
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- }, function () {
- });
- }
- //批量 驳回
- function batchRebut() {
- var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
- if (rows.length == 0) {
- layer.msg("请选择要驳回的备案数据");
- return;
- }
- layer.confirm("确认要驳回选中的'" + rows.length + "'条备案数据吗?", {
- btn: ['确定', '取消']
- // 按钮
- }, function () {
- var ids = new Array();
- // 遍历所有选择的行数据,取每条数据对应的ID
- $.each(rows, function (i, row) {
- ids[i] = row['id'];
- });
- $.ajax({
- type: 'POST',
- data: {
- "ids": ids
- },
- url: prefix + '/batchRebut',
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- }, function () {
- });
- }
- //选择导出
- function batchExports() {
- var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
- if (rows.length == 0) {
- layer.msg("请选择要导出的备案数据");
- return;
- }
- layer.confirm("确认要导出选中的'" + rows.length + "'条备案数据吗?", {
- btn: ['确定', '取消']
- // 按钮
- }, function () {
- var ids = new Array();
- // 遍历所有选择的行数据,取每条数据对应的ID
- $.each(rows, function (i, row) {
- ids[i] = row['id'];
- });
- layer.close(layer.index);
- location.href = prefix + "/batchExports?idValue=" + JSON.stringify(ids).replace('[', '%5B').replace(']', '%5D');
- }, function () {
- });
- }
- function nextVerify(deptId, name) {
- console.log("deptId:" + deptId)
- var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
- if (rows.length == 0) {
- layer.msg("请选择要联合审批的备案数据");
- return;
- }
- layer.confirm("确认要联合审批的'" + rows.length + "'条备案数据吗?", {
- btn: ['确定', '取消']
- // 按钮
- }, function () {
- var ids = new Array();
- // 遍历所有选择的行数据,取每条数据对应的ID
- $.each(rows, function (i, row) {
- ids[i] = row['id'];
- });
- $.ajax({
- type: 'POST',
- data: {
- "ids": ids
- },
- url: prefix + '/nextVerify/' + deptId,
- success: function (r) {
- if (r.code == 0) {
- layer.msg(r.msg);
- reLoad();
- } else {
- layer.msg(r.msg);
- }
- }
- });
- }, function () {
- });
- }
|