no message

main
暴炳林 2024-11-04 17:14:47 +08:00
parent cdb5e40e96
commit fbfb4802ad
13 changed files with 86 additions and 66 deletions

View File

@ -209,7 +209,7 @@ export default {
const xlsxParam = { raw: true }
const wb = XLSX.utils.table_to_book(document.querySelector('#educe-table'), xlsxParam)
// excel
let fileName = '拣货表单_' + new Date().getTime() + '.xlsx'
let fileName = '拣货表单数据_' + new Date().getTime() + '.xlsx'
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {

View File

@ -78,7 +78,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[ 50, 100, 200,500]"
:page-sizes="[ 50, 100, 200,500,10000]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
@ -92,6 +92,8 @@ import FileSaver from 'file-saver'
// eslint-disable-next-line no-unused-vars
import XLSX from 'xlsx'
export default {
// eslint-disable-next-line vue/multi-word-component-names
name:"拣货任务效率统计",
data() {
return {
pickerOptions: {
@ -239,7 +241,9 @@ export default {
pageSize: 50
,spanArr: [], //
pos: 0, //
//
pageNum: 1,
//
total: 3,
param: {
出库类型:'',
@ -329,35 +333,23 @@ export default {
this.queryUser();
},
down(){
this.exportToExcel();
this.downExcel();
},
// excelExcel
exportToExcel(){
/*const worksheet = XLSX.utils.json_to_sheet(this.tableData);
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
XLSX.writeFile(workbook, 'table_data.xlsx');*/
const XLSX = require('xlsx')
console.log('XLSX',XLSX,FileSaver)
// 使 this.$nextTick dom
this.$nextTick(function () {
// false true:
const xlsxParam = { raw: true }
const wb = XLSX.utils.table_to_book(document.querySelector('#educe-table'), xlsxParam)
// excel
let fileName = '拣货效率统计_' + new Date().getTime() + '.xlsx'
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {
//
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), fileName)
} catch (e) {
if (typeof console !== 'undefined') {
console.log(e, wbout)
}
}
return wbout
})
downExcel(){
//
this.tableloding=true;
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/JianHuoXiaoLv/download', {
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;
//
this.downloadFile(res.data,'拣货任务效率统计'+ '数据', 'xlsx')
});
},
KuS(){
//

View File

@ -924,8 +924,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/Jianhuojiemian/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -838,8 +838,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/Kucunhuizong/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -339,8 +339,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/dcx/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -595,8 +595,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/Pandianmingxi/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -564,8 +564,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/Rukuzhengli/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -585,8 +585,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/Xuliehaoqingdan/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -733,8 +733,8 @@ export default {
///Jianhuojiemian/downloadpost {responseType:'blob'}
//
this.$axios.post(this.$httpUrl + '/Zhengliqingdan/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageSize: this.total,
pageNum: 1,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;

View File

@ -8,9 +8,9 @@ import VueRouter from "vue-router";
import router from "@/router/router";
import store from "@/store/store";
Vue.prototype.$axios=axios;
//Vue.prototype.$httpUrl='http://127.0.0.1:8083';
Vue.prototype.$httpUrl='http://127.0.0.1:8083';
//Vue.prototype.$httpUrl='http://192.68.2.88:8081';
Vue.prototype.$httpUrl='http://10.1.112.23:8083';
// Vue.prototype.$httpUrl='http://10.1.112.23:8083';
Vue.config.productionTip = false;
Vue.use(VueRouter)
Vue.use(ElementUI,{size:'small'});

View File

@ -6,11 +6,13 @@ import com.yc.wms.bean.Xuliehao;
import com.yc.wms.service.Xuliehaoqingdan;
import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result;
import com.yc.wms.utils.FileUtil;
import com.yc.wms.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -30,6 +32,8 @@ public class JianHuoXiaoLvController {
@PersistenceContext
private EntityManager entityManager;
@Autowired
private NamedParameterJdbcTemplate jdbcTemplate;
@Autowired
private Xuliehaoqingdan xuliehaoqingdan;
private static /* 基础sql数据查询*/
@ -93,8 +97,15 @@ public class JianHuoXiaoLvController {
String sqlCount = "select count(t.id) as nums from (" + sqlFa+") t";
List<Integer> counts = entityManager.createNativeQuery(sqlCount).getResultList();
/* 查询所有数据*/
List<JhXl> jhXlList = entityManager.createNativeQuery(sqlFy, JhXl.class).getResultList();
Result result=Result.result(200,"操作成功",Long.parseLong(counts.get(0).toString()), jhXlList);
List<Map<String,Object>> maps = jdbcTemplate.queryForList(sqlFy, new HashMap<>());
for (int i = 0; i < maps.size(); i++) {
Map<String,Object> map=maps.get(i);
map.put("mergeData",new HashMap() {{
put("单据类型", new int[]{1, 1});
}});
}
// List<JhXl> jhXlList = entityManager.createNativeQuery(sqlFy, JhXl.class).getResultList();
Result result=Result.result(200,"操作成功",Long.parseLong(counts.get(0).toString()), maps);
return result;
}
@ -112,18 +123,35 @@ public class JianHuoXiaoLvController {
}
@PostMapping(value = "/download")
public void exportCompany(HttpServletResponse response, @RequestBody String json) throws Exception {
QueryPageUtil query =new QueryPageUtil();
JSONObject jsonObject= JSONUtil.parseObj(json);
query.setPageSize((int)jsonObject.get("pageSize"));
query.setPageNum((int)jsonObject.get("pageNum"));
JSONObject param= (JSONObject)jsonObject.get("param");
Xuliehao j = JSONUtil.toBean(param.toString(), Xuliehao.class);
xuliehaoqingdan.download( (List<Map<String,Object>>)xuliehaoqingdan.QueryJson(query,j).getData(), response);
download( (List<Map<String,Object>>)queryList(json).getData(), response);
}
public void download(List<Map<String, Object>> all, HttpServletResponse response) throws Exception {
List<Map<String, Object>> list = new ArrayList<>();
for (Map<String,Object> company : all) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("单据类型", company.get("单据类型"));
map.put("出库类型", company.get("出库类型"));
map.put("任务号", company.get("任务号"));
map.put("子任务号", company.get("子任务号"));
map.put("库区", company.get("库区"));
map.put("拣货行", company.get("拣货行"));
map.put("创建时间", company.get("创建时间"));
map.put("生成合单任务时间", company.get("生成合单任务时间"));
map.put("下发时间", company.get("下发时间"));
map.put("拣货时间", company.get("拣货时间"));
map.put("清点时间", company.get("清点时间"));
map.put("合单时间", company.get("合单时间"));
map.put("交单时间", company.get("交单时间"));
map.put("创建-下发时间", company.get("创建-下发时间"));
map.put("下发-拣货时间", company.get("下发-拣货时间"));
map.put("拣货-合单时间", company.get("拣货-合单时间"));
map.put("合单-交单时间", company.get("合单-交单时间"));
map.put("拣货-清点时间", company.get("拣货-清点时间"));
map.put("清点-合单时间", company.get("清点-合单时间"));
map.put("拣货-交单时间", company.get("拣货-交单时间"));
list.add(map);
}
FileUtil.downloadExcel(list, response);
}
}
@Data

View File

@ -235,7 +235,7 @@ public class RukuzhengliImpl implements com.yc.wms.service.Rukuzhengli {
map.put("预入库日期", company.get("DELIVERY_DATE"));
map.put("预入库操作人", company.get("RELATED_BILL5"));
map.put("备注", company.get("description"));
if(company.get("PROP_C1").equals("0")){
if(company.get("BE_QUALITY").equals("0")){
map.put("是否质检", "否");
}else{
map.put("是否质检", "是");

View File

@ -12,13 +12,13 @@ server:
spring:
datasource:
url: jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB
#url: jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwtest
# url: jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB
url: jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwtest
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
username: wmsdb
password: AmecDDbb32A
#username: WMSDB
#password: WmsYc@5688
# username: wmsdb
# password: AmecDDbb32A
username: WMSDB
password: WmsYc@5688
hikari:
connection-timeout: 60000