add:库存查看
This commit is contained in:
@@ -18,7 +18,9 @@ package org.nl.common.utils;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.poi.excel.BigExcelWriter;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import org.apache.poi.xssf.streaming.SXSSFSheet;
|
||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
@@ -30,6 +32,7 @@ import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.MessageDigest;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -207,7 +210,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
public static void downloadExcel(List<Map<String, Object>> list, HttpServletResponse response) throws IOException {
|
||||
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
|
||||
File file = new File(tempPath);
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
|
||||
// 一次性写出内容,使用默认样式,强制输出标题
|
||||
writer.write(list, true);
|
||||
SXSSFSheet sheet = (SXSSFSheet)writer.getSheet();
|
||||
@@ -217,8 +220,9 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
writer.autoSizeColumnAll();
|
||||
//response为HttpServletResponse对象
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
||||
response.resetBuffer();
|
||||
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
||||
response.setHeader("Content-Disposition", "attachment;filename=file.xlsx");
|
||||
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("file.xlsx", "UTF-8"));
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// 终止后删除临时文件
|
||||
file.deleteOnExit();
|
||||
@@ -226,6 +230,22 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
//此处记得关闭输出Servlet流
|
||||
IoUtil.close(out);
|
||||
}
|
||||
public static void downloadExcel2(List<Map<String, Object>> list, HttpServletResponse response) throws IOException {
|
||||
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
|
||||
File file = new File(tempPath);
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
|
||||
writer.write(list, true);
|
||||
SXSSFSheet sheet = (SXSSFSheet)writer.getSheet();
|
||||
sheet.trackAllColumnsForAutoSizing();
|
||||
writer.autoSizeColumnAll();
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=file.xlsx");
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
file.deleteOnExit();
|
||||
writer.flush(out, true);
|
||||
IoUtil.close(out);
|
||||
|
||||
}
|
||||
|
||||
public static String getFileType(String type) {
|
||||
String documents = "txt doc pdf ppt pps xlsx xls docx";
|
||||
|
||||
@@ -107,6 +107,12 @@ public class DeviceManageController {
|
||||
if (CollectionUtils.isEmpty(item)){
|
||||
throw new BadRequestException(String.format(vehicleCode+"载具组盘信息不存在"));
|
||||
}
|
||||
for (MdPbVehicleMaterVo materVo : item) {
|
||||
if (materVo.getQty().intValue() == 0){
|
||||
throw new BadRequestException(String.format(vehicleCode+"组盘异常,确认是否出库后组盘"));
|
||||
}
|
||||
}
|
||||
|
||||
wmsToAcsService.toCommand(device_code,"1",vehicleInfo.getH());
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
and (struct.struct_code LIKE '%${query.search}%'
|
||||
or struct.struct_name LIKE '%${query.search}%')
|
||||
</if>
|
||||
<if test="query.start_time != null and query.start_time != ''">
|
||||
and struct_flow.update_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null and query.end_time != ''">
|
||||
and #{query.end_time} >= struct_flow.update_time
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -4,19 +4,24 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.ListOf;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.nl.wms.stor_manage.struct.service.dto.StructattrQuery;
|
||||
import org.nl.wms.system_manage.service.tableData.ColumnInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -34,6 +39,8 @@ public class StIvtStructattrController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
@Autowired
|
||||
private ColumnInfoService columnInfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("仓位查询")
|
||||
@@ -88,4 +95,16 @@ public class StIvtStructattrController {
|
||||
public ResponseEntity<Object> getStructIvt(StructattrQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(structattrService.getStructIvt(query,page), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/exportFile")
|
||||
public void exportFile(@RequestBody StructattrQuery query, HttpServletResponse response) {
|
||||
PageQuery page = new PageQuery();
|
||||
page.setPage(0);page.setSize(99999);
|
||||
TableDataInfo<Map> structIvt = structattrService.getStructIvt(query, page);
|
||||
List<Map> maps = structIvt.getContent();
|
||||
columnInfoService.exportFile("",maps,response,
|
||||
null,
|
||||
MapOf.linkOf("stor_code","仓库编码","struct_code","仓位","vehicle_code","载具编码",
|
||||
"material_code","物料编号","material_code","物料名称","pcsn","批号"
|
||||
,"forzen_qty","冻结数量","qty","库存数量","create_time","组盘入库时间"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.stor_manage.struct.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -52,7 +53,7 @@ public interface IStIvtStructattrService extends IService<StIvtStructattr> {
|
||||
|
||||
List<StructattrVechielDto> structVehicle(Map query);
|
||||
|
||||
Object getStructIvt(StructattrQuery query, PageQuery page);
|
||||
TableDataInfo<Map> getStructIvt(StructattrQuery query, PageQuery page);
|
||||
|
||||
List<StructAssignQty> getStructIvtAssign(List<String> materials, String stor_code);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
<if test="query.has_vehicle == true">
|
||||
and struct.vehicle_code is not null
|
||||
</if>
|
||||
|
||||
<if test="query.has == false">
|
||||
and struct.vehicle_code is null and struct.lock_type = '00'
|
||||
</if>
|
||||
@@ -121,7 +122,8 @@
|
||||
vm.unit_id,
|
||||
vm.parent_vehicle_code,
|
||||
material.material_code,
|
||||
material.material_name
|
||||
material.material_name,
|
||||
vm.create_time
|
||||
FROM
|
||||
st_ivt_structattr struct
|
||||
left join md_pb_vehicleMater vm on struct.vehicle_code = vm.vehicle_code
|
||||
@@ -137,6 +139,12 @@
|
||||
and (material.material_code LIKE '%${query.material}%'
|
||||
or material.material_name LIKE '%${query.material}%')
|
||||
</if>
|
||||
<if test="query.start_time != null and query.start_time != ''">
|
||||
and vm.create_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null and query.end_time != ''">
|
||||
and #{query.end_time} >= vm.create_time
|
||||
</if>
|
||||
<if test="query.pcsn != null and query.pcsn != ''">
|
||||
and vm.pcsn = #{query.pcsn}
|
||||
</if>
|
||||
|
||||
@@ -198,7 +198,7 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getStructIvt(StructattrQuery query, PageQuery pageQuery) {
|
||||
public TableDataInfo<Map> getStructIvt(StructattrQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("struct.create_time DESC");
|
||||
List<Map> mst_detail = this.baseMapper.getStructIvt(query, pageQuery);
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
package org.nl.wms.system_manage.service.tableData;
|
||||
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.wms.system_manage.service.tableData.dao.mapper.ColumnMapper;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.BindException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -59,13 +68,13 @@ public class ColumnInfoService {
|
||||
}
|
||||
List<Map<String, Object>> excel_lst = new ArrayList<>();
|
||||
Map t = data.get(0);
|
||||
if (tableName == null){
|
||||
throw new BindException("导出失败,未获取到表名");
|
||||
}
|
||||
Map<String,String> map = this.TableColumn(tableName);
|
||||
if (!CollectionUtils.isEmpty(passParam)){
|
||||
for (Object s : passParam) {
|
||||
map.remove(s);
|
||||
Map<String,String> map = new LinkedHashMap<>();
|
||||
if (!StringUtils.isEmpty(tableName)){
|
||||
map = this.TableColumn(tableName);
|
||||
if (!CollectionUtils.isEmpty(passParam)){
|
||||
for (Object s : passParam) {
|
||||
map.remove(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.putAll(customizMap);
|
||||
@@ -73,7 +82,7 @@ public class ColumnInfoService {
|
||||
throw new BindException("导出失败,表结构信息失败"+tableName);
|
||||
}
|
||||
for (Map item : data) {
|
||||
Map<String, Object> excelMap = new HashMap<>();
|
||||
Map<String, Object> excelMap = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
excelMap.put(entry.getValue(),item.get(entry.getKey()));
|
||||
}
|
||||
@@ -82,7 +91,7 @@ public class ColumnInfoService {
|
||||
if (CollectionUtils.isEmpty(excel_lst)){
|
||||
throw new BindException("导出失败,没有获取到导出参数"+data.size());
|
||||
}
|
||||
FileUtil.downloadExcel(excel_lst, response);
|
||||
FileUtil.downloadExcel(excel_lst,response);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -386,3 +386,15 @@ export function downloadFile(obj, name, suffix) {
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
}
|
||||
export function downloadFile2(data, name) {
|
||||
debugger
|
||||
let blob = new Blob([data],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8'});
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
let link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
link.setAttribute('download', name+'.xlsx');
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,63 +20,20 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变动日期" prop="analyseData">
|
||||
<el-date-picker
|
||||
v-model="query.datepick"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<!--表单组件-->
|
||||
<!-- <el-dialog-->
|
||||
<!-- :close-on-click-modal="false"-->
|
||||
<!-- :before-close="crud.cancelCU"-->
|
||||
<!-- :visible.sync="crud.status.cu > 0"-->
|
||||
<!-- :title="crud.status.title"-->
|
||||
<!-- width="500px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">-->
|
||||
<!-- <el-form-item label="仓位编码" prop="struct_code">-->
|
||||
<!-- <el-input v-model="form.struct_code" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型描述">-->
|
||||
<!-- <el-input v-model="form.description" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型KEY">-->
|
||||
<!-- <el-input v-model="form.model_key" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型注释">-->
|
||||
<!-- <el-input v-model="form.model_comment" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item v-if="crud.status.edit" label="版本号">-->
|
||||
<!-- <el-input disabled v-model="form.version" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型数据">-->
|
||||
<!-- <el-input v-model="form.model_editor_json" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型封面">-->
|
||||
<!-- <el-input v-model="form.thumbnail" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型类型">-->
|
||||
<!-- <el-input v-model="form.model_type" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="单据类型">-->
|
||||
<!-- <el-select v-model="form.form_type" placeholder="请选择" style="width: 370px;">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in formTypes"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="归属租户">-->
|
||||
<!-- <el-input v-model="form.tenant_id" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="text" @click="crud.cancelCU">取消</el-button>-->
|
||||
<!-- <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@@ -182,7 +139,15 @@ export default {
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
if (this.query.datepick){
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length>1){
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
}else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
@@ -65,63 +66,30 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="analyseData">
|
||||
<el-date-picker
|
||||
v-model="query.datepick"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-s-operation"
|
||||
@click="downloadMethod"
|
||||
>
|
||||
导出库存
|
||||
</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<!-- <el-dialog-->
|
||||
<!-- :close-on-click-modal="false"-->
|
||||
<!-- :before-close="crud.cancelCU"-->
|
||||
<!-- :visible.sync="crud.status.cu > 0"-->
|
||||
<!-- :title="crud.status.title"-->
|
||||
<!-- width="500px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">-->
|
||||
<!-- <el-form-item label="仓位编码" prop="struct_code">-->
|
||||
<!-- <el-input v-model="form.struct_code" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型描述">-->
|
||||
<!-- <el-input v-model="form.description" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型KEY">-->
|
||||
<!-- <el-input v-model="form.model_key" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型注释">-->
|
||||
<!-- <el-input v-model="form.model_comment" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item v-if="crud.status.edit" label="版本号">-->
|
||||
<!-- <el-input disabled v-model="form.version" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型数据">-->
|
||||
<!-- <el-input v-model="form.model_editor_json" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型封面">-->
|
||||
<!-- <el-input v-model="form.thumbnail" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型类型">-->
|
||||
<!-- <el-input v-model="form.model_type" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="单据类型">-->
|
||||
<!-- <el-select v-model="form.form_type" placeholder="请选择" style="width: 370px;">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in formTypes"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="归属租户">-->
|
||||
<!-- <el-input v-model="form.tenant_id" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="text" @click="crud.cancelCU">取消</el-button>-->
|
||||
<!-- <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@@ -135,7 +103,7 @@
|
||||
<el-table-column prop="material_code" label="物料编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_name" label="物料名称" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="parent_vehicle_code" label="父载具编码" width="150" show-tooltip-when-overflow />
|
||||
<!-- <el-table-column prop="parent_vehicle_code" label="父载具编码" width="150" show-tooltip-when-overflow />-->
|
||||
<el-table-column prop="pcsn" label="批次" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="qty" label="总库存" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="frozen_qty" label="冻结库存" show-tooltip-when-overflow />
|
||||
@@ -145,7 +113,7 @@
|
||||
<el-table-column prop="lock_type" label="库存锁定" show-tooltip-when-overflow>
|
||||
<template slot-scope="scope">{{ statusEnum.label.LOCK[scope.row.lock_type] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_time" label="修改时间" width="120" show-tooltip-when-overflow />
|
||||
<el-table-column prop="create_time" label="组盘入库时间" width="120" show-tooltip-when-overflow />
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="操作"-->
|
||||
<!-- fixed="right"-->
|
||||
@@ -170,6 +138,8 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import structattr from './structattr'
|
||||
import { downloadFile,downloadFile2 } from '@/utils/index'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
@@ -217,7 +187,39 @@ export default {
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query.datepick){
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length>1){
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
}else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
return true
|
||||
},
|
||||
downloadMethod() {
|
||||
if (this.query.datepick){
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length>1){
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
}else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
structattr.exportFile(this.query).then(res => {
|
||||
const url = window.URL.createObjectURL(new Blob([res]))
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
const fileName = new Date() + '-' + '库存' + '.xlsx'
|
||||
link.setAttribute('download', fileName)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
this.crud.notify('导出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,15 @@ export function confirmTask(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function exportFile(data) {
|
||||
return request({
|
||||
url: '/api/structattr/exportFile',
|
||||
method: 'post',
|
||||
renponseType: 'blob',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
@@ -111,5 +120,6 @@ export default {
|
||||
inDecision,
|
||||
cancelDecision,
|
||||
taskOpen,
|
||||
confirm
|
||||
confirm,
|
||||
exportFile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user