From 7e17a4a7affec26462cdeb66087be4da9b3c6590 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期一, 09 十二月 2024 08:49:31 +0800
Subject: [PATCH] Generating...
---
src/main/webapp/static/js/report/workCountIn.js | 113 ++++++++++++++++++++++++++++++--------------------------
1 files changed, 61 insertions(+), 52 deletions(-)
diff --git a/src/main/webapp/static/js/report/workCountIn.js b/src/main/webapp/static/js/report/workCountIn.js
index f52174e..70912b6 100644
--- a/src/main/webapp/static/js/report/workCountIn.js
+++ b/src/main/webapp/static/js/report/workCountIn.js
@@ -1,16 +1,17 @@
var pageCurr;
+
function getCol() {
var cols = [
{field: 'oneday', align: 'center', title: '鍏ュ簱鏃ユ湡', width: 200}
- ,{field: 'matnr', align: 'center',title: '鍗曟嵁鍙�'}
- ,{field: 'maktx', align: 'center',title: '鐗╂枡鍙�'}
- ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
+ , {field: 'matnr', align: 'center', title: '鐗╂枡鍙�'}
+ , {field: 'maktx', align: 'center', title: '鐗╂枡鍚嶇О'}
+ , {field: 'anfme', align: 'center', title: '鏁伴噺'}
];
return cols;
}
-layui.use(['table','laydate', 'form'], function(){
+layui.use(['table', 'laydate', 'form'], function () {
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
@@ -22,7 +23,7 @@
tableIns = table.render({
elem: '#workIn',
headers: {token: localStorage.getItem('token')},
- url: baseUrl+'/report/viewWorkCountInList.action',
+ url: baseUrl + '/report/viewWorkCountInList.action',
page: true,
limit: 16,
limits: [16, 30, 50, 100, 200, 500],
@@ -45,12 +46,12 @@
response: {
statusCode: 200
},
- done: function(res, curr, count) {
+ done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
- pageCurr=curr;
+ pageCurr = curr;
limit();
}
});
@@ -58,7 +59,7 @@
// 鐩戝惉鎺掑簭浜嬩欢
table.on('sort(workIn)', function (obj) {
var searchData = {};
- $.each($('#search-box [name]').serializeArray(), function() {
+ $.each($('#search-box [name]').serializeArray(), function () {
searchData[this.name] = this.value;
});
searchData['orderByField'] = obj.field;
@@ -70,9 +71,9 @@
},
done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
- pageCurr=curr;
+ pageCurr = curr;
limit();
}
});
@@ -81,43 +82,51 @@
// 鐩戝惉澶村伐鍏锋爮浜嬩欢
table.on('toolbar(workIn)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id);
- switch(obj.event) {
+ switch (obj.event) {
case 'exportData':
- layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
- var titles=[];
- var fields=[];
+ layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function () {
+ var titles = [];
+ var fields = [];
obj.config.cols[0].map(function (col) {
if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
titles.push(col.title);
fields.push(col.field);
}
});
+ var param = '?';
var exportData = {};
- $.each($('#search-box [name]').serializeArray(), function() {
+ $.each($('#search-box [name]').serializeArray(), function () {
exportData[this.name] = this.value;
+ param += this.name + '=' + this.value + '&';
});
- var param = {
- fields: fields,
- exportData: exportData
- };
- $.ajax({
- url: baseUrl+"/report/viewWorkInExport.action",
- headers: {'token': localStorage.getItem('token')},
- data: JSON.stringify(param),
- dataType:'json',
- contentType:'application/json;charset=UTF-8',
- method: 'POST',
- success: function (res) {
- layer.closeAll();
- if (res.code === 200) {
- table.exportFile(titles,res.data,'xls');
- } else if (res.code === 403) {
- top.location.href = baseUrl+"/";
- } else {
- layer.msg(res.msg)
- }
- }
- });
+ window.location.href = baseUrl + "/report/download/countIn" + param;
+ layer.closeAll();
+ // var param = {
+ // fields: fields,
+ // exportData: exportData
+ // };
+ // $.ajax({
+ // url: baseUrl + "/report/download/in",
+ // headers: {'token': localStorage.getItem('token')},
+ // data: JSON.stringify(param),
+ // responseType: "blob",
+ // contentType: 'application/json;charset=UTF-8',
+ // method: 'POST',
+ // success: function (res) {
+ // layer.closeAll();
+ // if (res.code === 200) {
+ // var blob = new Blob([response], { type: 'application/vnd.ms-excel' });
+ // var link = document.createElement('a');
+ // link.href = URL.createObjectURL(blob);
+ // link.download = 'exported_file.xls'; // 璁剧疆涓嬭浇鏂囦欢鍚�
+ // link.click();
+ // } else if (res.code === 403) {
+ // top.location.href = baseUrl + "/";
+ // } else {
+ // layer.msg(res.msg)
+ // }
+ // }
+ // });
});
break;
}
@@ -136,19 +145,19 @@
});
layDate.render({
elem: '.layui-laydate-range'
- ,type: 'datetime'
- ,range: true
+ , type: 'datetime'
+ , range: true
});
});
// 鍏抽棴鍔ㄤ綔
-$(document).on('click','#data-detail-close', function () {
+$(document).on('click', '#data-detail-close', function () {
parent.layer.closeAll();
});
function tableReload(child) {
var searchData = {};
- $.each($('#search-box [name]').serializeArray(), function() {
+ $.each($('#search-box [name]').serializeArray(), function () {
searchData[this.name] = this.value;
});
(child ? parent.tableIns : tableIns).reload({
@@ -158,14 +167,14 @@
},
done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
- pageCurr=curr;
+ pageCurr = curr;
if (res.data.length === 0 && count !== 0) {
tableIns.reload({
where: searchData,
page: {
- curr: pageCurr-1
+ curr: pageCurr - 1
}
});
pageCurr -= 1;
@@ -179,9 +188,9 @@
for (var val in data) {
var find = el.find(":input[id='" + val + "']");
find.val(data[val]);
- if (showImg){
+ if (showImg) {
var next = find.next();
- if (next.get(0)){
+ if (next.get(0)) {
if (next.get(0).localName === "img") {
find.hide();
next.attr("src", data[val]);
@@ -201,13 +210,13 @@
function detailScreen(index) {
var detail = layer.getChildFrame('#data-detail', index);
- var height = detail.height()+60;
- if (height > ($(window).height()*0.9)) {
- height = ($(window).height()*0.9);
+ var height = detail.height() + 60;
+ if (height > ($(window).height() * 0.9)) {
+ height = ($(window).height() * 0.9);
}
layer.style(index, {
- top: (($(window).height()-height)/3)+"px",
- height: height+'px'
+ top: (($(window).height() - height) / 3) + "px",
+ height: height + 'px'
});
$(".layui-layer-shade").remove();
}
--
Gitblit v1.9.1