diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java index 88431cd5..9cec974d 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java @@ -273,6 +273,7 @@ public class MesConstants { public static final String MES_SALE_ORDER_CLASSFICATION_ERP= "1"; //ERP同步销售订单 public static final String MES_SALE_ORDER_CLASSFICATION_VIRTUAL= "2"; //虚拟销售订单 + public static final String MES_SALE_ORDER_CLASSFICATION_MES= "3"; //MES创建 /** * 绑定标识(1待绑定 2绑定中 3绑定完成) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java index 24c27d76..1e0de3b8 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java @@ -376,6 +376,19 @@ public class Seq { // 采购申请单任务编号的记录标识 public static final String mesPurchaseApplyCode = "PA"; + + + + + // 销售订单记录序列类型 + public static final String mesSaleOrderSeqType = "MESSALEORDER"; + + // 销售订单记录接口序列数 + private static AtomicInteger mesSaleOrderSeq = new AtomicInteger(1); + + // 销售订单记录标识 + public static final String mesSaleOrderSeqCode = "XSDD"; + /** * 获取通用序列号 * @@ -521,4 +534,31 @@ public class Seq { return result; } + /** + * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串 + * + * @return 序列值 + */ + public static String getNewId(String type,String code) { + AtomicInteger atomicInt = commSeq; + if (productOutstockSeqType.equals(type)) { + atomicInt = productOutstockSeq; + } + return getNewId(atomicInt, 4, code); + } + + /** + * 通用接口序列号 前缀+yyMMdd + length长度循环递增字符串 + * + * @param atomicInt 序列数 + * @param length 数值长度 + * @return 序列值 + */ + public static String getNewId(AtomicInteger atomicInt, int length, String code) { + String result = code; + result += DateUtils.dateTime(); + result += getSeq(atomicInt, length); + return result; + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java index 48f9c125..31e0d393 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesImportController.java @@ -7,9 +7,11 @@ import com.hw.common.log.annotation.Log; import com.hw.common.log.enums.BusinessType; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.domain.MesPurchaseRequisitionTemplate; +import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.service.IMesBasePalletInfoService; import com.hw.mes.service.IMesImportService; import com.hw.mes.service.IMesPurchaseApplyService; +import com.hw.mes.service.IMesSaleOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -34,6 +36,9 @@ public class MesImportController extends BaseController { @Autowired private IMesPurchaseApplyService mesPurchaseApplyService; + @Autowired + private IMesSaleOrderService mesSaleOrderService; + /** * 采购申请单excel导入 @@ -97,4 +102,20 @@ public class MesImportController extends BaseController { return success(message); } + + + + /** + * 销售订单excel导入 + */ + @Log(title = "销售订单", businessType = BusinessType.IMPORT) + @PostMapping(("/importSaleOrderData")) + public AjaxResult importSaleOrderData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil<>(MesSaleOrder.class); + List mesSaleOrderList = util.importExcel(file.getInputStream()); + System.out.println(mesSaleOrderList.toString()); + return success(mesSaleOrderService.importSaleOrderData(mesSaleOrderList)); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java index b5ac4f0c..394c914b 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java @@ -76,7 +76,7 @@ public class MesSaleOrder extends BaseEntity { /** * 物料编码;对应FMaterialId.FNumber */ - @Excel(name = "物料编码;对应FMaterialId.FNumber") + @Excel(name = "物料编码") private String materialCode; /** @@ -94,7 +94,7 @@ public class MesSaleOrder extends BaseEntity { /** * 订单计划数量;对应FQty */ - @Excel(name = "订单计划数量;对应FQty") + @Excel(name = "订单计划数量") private BigDecimal orderAmount; /** @@ -174,6 +174,8 @@ public class MesSaleOrder extends BaseEntity { @Excel(name = "是否标识:1-是;0-否") private String isFlag; + private String tondBase; + /** * 规格型号 */ @@ -205,6 +207,7 @@ public class MesSaleOrder extends BaseEntity { private String overtimeFlag; + @Excel(name = "项目名称") private String projectName;//项目名称 @@ -424,6 +427,14 @@ public class MesSaleOrder extends BaseEntity { return isFlag; } + public String getTondBase() { + return tondBase; + } + + public void setTondBase(String tondBase) { + this.tondBase = tondBase; + } + public String getMaterialSpec() { return materialSpec; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java index d0f8d542..a55c1b8d 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java @@ -126,4 +126,11 @@ public interface IMesSaleOrderService * 销售订单交货超时统计 */ public void saleOrderOverTimeAlarm(); + + /** + * 导入销售订单 + * @param mesSaleOrderList + * @return + */ + public int importSaleOrderData(List mesSaleOrderList); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java index c6b2767b..12e1ac99 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java @@ -13,6 +13,7 @@ import com.hw.common.core.constant.SystemConstants; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; +import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo; @@ -21,6 +22,7 @@ import com.hw.mes.api.domain.MesSaleOrderRelate; import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; import com.hw.mes.domain.MesMaterialBom; +import com.hw.mes.domain.MesProjectInfo; import com.hw.mes.domain.MesSaleOrderMaterial; import com.hw.mes.mapper.*; import com.hw.system.api.RemoteSysCommonService; @@ -59,6 +61,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { @Autowired private MesSaleOrderMaterialMapper mesSaleOrderMaterialMapper; + @Autowired + private MesProjectInfoMapper mesProjectInfoMapper; + @Resource private RemoteSysCommonService remoteSysCommonService; @@ -390,4 +395,53 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { sysPointRouter.setCreateTime(currentDate); return sysPointRouter; } + + + /** + * 导入销售订单 + * @param mesSaleOrderList + * @return + */ + @Override + public int importSaleOrderData(List mesSaleOrderList) { + Date currentDate = new Date(); + String nickName = SecurityUtils.getLoginUser().getNickname(); + for (MesSaleOrder mesSaleOrder : mesSaleOrderList) { + String materialCode = mesSaleOrder.getMaterialCode(); + if(StringUtils.isEmpty(materialCode)){ + throw new ServiceException("物料编码不能为空"); + } + BigDecimal orderAmount = mesSaleOrder.getOrderAmount(); + if(orderAmount==null || orderAmount.compareTo(BigDecimal.ZERO)<=0){ + throw new ServiceException("订单数量需大于0"); + } + + MesBaseMaterialInfo mesBaseMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode); + String projectName = mesSaleOrder.getProjectName(); + if(StringUtils.isNotEmpty(projectName)){ + MesProjectInfo queryProjectInfo = new MesProjectInfo(); + queryProjectInfo.setProjectName(projectName); + List mesProjectInfoList = mesProjectInfoMapper.selectMesProjectInfoList(queryProjectInfo); + if(mesProjectInfoList!=null && !mesProjectInfoList.isEmpty()){ + MesProjectInfo mesProjectInfo = mesProjectInfoList.get(0); + mesSaleOrder.setTondBase(String.valueOf(mesProjectInfo.getErpId())); + } + } + + String saleOrderCode = Seq.getNewId(Seq.mesSaleOrderSeqType,Seq.mesSaleOrderSeqCode); + + mesSaleOrder.setSaleorderCode(saleOrderCode); + mesSaleOrder.setMaterialId(mesBaseMaterialInfo.getErpId()); + mesSaleOrder.setCreateTime(currentDate); +// mesSaleOrder.setErpModifyDate(currentDate); + mesSaleOrder.setCreateBy(nickName); + mesSaleOrder.setSaleOrderClassfication(MesConstants.MES_SALE_ORDER_CLASSFICATION_MES); + + mesSaleOrderMapper.insertMesSaleOrder(mesSaleOrder); + + } + + return 1; + } + } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml index 2422a63c..1c45efaf 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml @@ -31,6 +31,7 @@ + @@ -139,6 +140,7 @@ end_date, complete_date, is_flag, + tond_base, remark, create_by, create_time, @@ -169,6 +171,7 @@ #{endDate}, #{completeDate}, #{isFlag}, + #{tondBase}, #{remark}, #{createBy}, #{createTime}, @@ -256,7 +259,7 @@ mso.sale_order_classfication, mpi.project_name from mes_sale_order mso left join mes_base_material_info mbmi on - ((mso.material_id = mbmi.erp_id and mso.sale_order_classfication='1') or (mso.material_id = mbmi.material_id and mso.sale_order_classfication='2')) + ((mso.material_id = mbmi.erp_id and (mso.sale_order_classfication='1' or mso.sale_order_classfication='3')) or (mso.material_id = mbmi.material_id and mso.sale_order_classfication='2')) left join mes_project_info mpi on mso.tond_base=mpi.erp_id and mso.saleorder_code like concat('%', #{saleorderCode}, @@ -281,7 +284,7 @@ and mso.plan_delivery_date is not null and mso.plan_delivery_date >= now() - order by mso.erp_modify_date desc + order by mso.create_time desc diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java index 992c2d8d..b943a943 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsStockTotalController.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.WmsConstants; import com.hw.wms.domain.WmsBaseWarehouse; +import com.hw.wms.domain.vo.WmsStockTotalExportVo; import com.hw.wms.domain.vo.WmsStockTotalTransferVo; import com.hw.wms.domain.vo.WmsStockTransferVo; import com.hw.wms.service.IWmsBaseWarehouseService; @@ -73,9 +74,9 @@ public class WmsStockTotalController extends BaseController @PostMapping("/export") public void export(HttpServletResponse response, WmsStockTotal wmsStockTotal) { - List list = wmsStockTotalService.selectWmsStockTotalList(wmsStockTotal); - ExcelUtil util = new ExcelUtil(WmsStockTotal.class); - util.exportExcel(response, list, "原材料/成品库存数据"); + List list = wmsStockTotalService.selectWmsStockTotalExportList(wmsStockTotal); + ExcelUtil util = new ExcelUtil(WmsStockTotalExportVo.class); + util.exportExcel(response, list, "库存数据"); } /** diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsStockTotalExportVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsStockTotalExportVo.java new file mode 100644 index 00000000..d6dbe764 --- /dev/null +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsStockTotalExportVo.java @@ -0,0 +1,201 @@ +package com.hw.wms.domain.vo; + +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * 原材料库存导出对象 wms_stock_total + * + * @author xins + * @date 2025-01-14 + */ +public class WmsStockTotalExportVo extends BaseEntity { + private static final long serialVersionUID = 1L; + + + /** + * 物料编号 + */ + @Excel(name = "物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 规格型号 + */ + @Excel(name = "规格型号") + private String materialSpec; + + /** + * 仓库名称 + */ + @Excel(name = "仓库名称") + private String warehouseName; + + + /** + * 总数量;仓库存放的总数量 + */ + @Excel(name = "库存量(主单位)") + private BigDecimal totalAmount; + + + @Excel(name = "库存主单位") + private String unitName; + + @Excel(name = "可用量(主单位)") + private BigDecimal availableAmount; + + + @Excel(name = "库存状态") + private String stockStatus = "可用"; + + @Excel(name = "货主类型") + private String ownerType = "业务组织"; + + @Excel(name = "货主编码") + private String ownerCode = "100"; + + @Excel(name = "货主名称") + private String ownerName="江苏京源环保股份有限公司"; + + @Excel(name = "保管者类型") + private String preserverType = "业务组织"; + + @Excel(name = "保管者编码") + private String preserverCode="100"; + + @Excel(name = "保管者名称") + private String preserverName="江苏京源环保股份有限公司"; + + @Excel(name = "库存组织") + private String stockOrg="江苏京源环保股份有限公司"; + + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public BigDecimal getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public BigDecimal getAvailableAmount() { + return availableAmount == null ? totalAmount : availableAmount; + } + + public void setAvailableAmount(BigDecimal availableAmount) { + this.availableAmount = availableAmount; + } + + public String getStockStatus() { + return stockStatus; + } + + public void setStockStatus(String stockStatus) { + this.stockStatus = stockStatus; + } + + public String getOwnerType() { + return ownerType; + } + + public void setOwnerType(String ownerType) { + this.ownerType = ownerType; + } + + public String getOwnerCode() { + return ownerCode; + } + + public void setOwnerCode(String ownerCode) { + this.ownerCode = ownerCode; + } + + public String getOwnerName() { + return ownerName; + } + + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } + + public String getPreserverType() { + return preserverType; + } + + public void setPreserverType(String preserverType) { + this.preserverType = preserverType; + } + + public String getPreserverCode() { + return preserverCode; + } + + public void setPreserverCode(String preserverCode) { + this.preserverCode = preserverCode; + } + + public String getPreserverName() { + return preserverName; + } + + public void setPreserverName(String preserverName) { + this.preserverName = preserverName; + } + + public String getStockOrg() { + return stockOrg; + } + + public void setStockOrg(String stockOrg) { + this.stockOrg = stockOrg; + } +} diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java index 6abba66d..0fc88e66 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsStockTotalMapper.java @@ -3,6 +3,7 @@ package com.hw.wms.mapper; import java.util.List; import com.hw.wms.domain.WmsStockTotal; +import com.hw.wms.domain.vo.WmsStockTotalExportVo; /** * 原材料库存Mapper接口 @@ -109,4 +110,12 @@ public interface WmsStockTotalMapper { */ public List selectStockTotalListGroupByMaterial(WmsStockTotal wmsStockTotal); + + /** + * 根据物料查询总库存信息 + * @param wmsStockTotal + * @return + */ + public List selectWmsStockTotalExportList(WmsStockTotal wmsStockTotal); + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java index 5a37076e..03e90000 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsStockTotalService.java @@ -1,14 +1,12 @@ package com.hw.wms.service; -import java.math.BigDecimal; import java.util.List; -import java.util.Map; import com.alibaba.fastjson2.JSONObject; import com.hw.wms.domain.WmsStockTotal; +import com.hw.wms.domain.vo.WmsStockTotalExportVo; import com.hw.wms.domain.vo.WmsStockTotalTransferVo; import com.hw.wms.domain.vo.WmsStockTransferVo; -import org.springframework.transaction.annotation.Transactional; /** * 原材料库存Service接口 @@ -119,4 +117,12 @@ public interface IWmsStockTotalService * @param wmsStockTotalTransferVo */ public int transferProductStockTotal(WmsStockTotalTransferVo wmsStockTotalTransferVo); + + /** + * 查询原材料库存列表4导出 + * + * @param wmsStockTotal 原材料库存 + * @return 原材料库存 + */ + public List selectWmsStockTotalExportList(WmsStockTotal wmsStockTotal); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java index 6777cc92..2becccee 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java @@ -15,15 +15,12 @@ import com.hw.common.core.utils.StringUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.domain.MesBaseBarcodeInfo; -import com.hw.mes.api.domain.MesBaseMaterialInfo; -import com.hw.mes.api.domain.MesBaseStationInfo; import com.hw.mes.api.domain.MesSaleOrderRelate; import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; import com.hw.wms.config.WmsConfig; -import com.hw.wms.domain.WmsBaseLocation; -import com.hw.wms.domain.WmsProductStock; -import com.hw.wms.domain.WmsRawStock; +import com.hw.wms.domain.*; +import com.hw.wms.domain.vo.WmsStockTotalExportVo; import com.hw.wms.domain.vo.WmsStockTotalTransferVo; import com.hw.wms.domain.vo.WmsStockTransferVo; import com.hw.wms.mapper.WmsBaseLocationMapper; @@ -32,7 +29,6 @@ import com.hw.wms.mapper.WmsRawStockMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.wms.mapper.WmsStockTotalMapper; -import com.hw.wms.domain.WmsStockTotal; import com.hw.wms.service.IWmsStockTotalService; import org.springframework.transaction.annotation.Transactional; @@ -518,4 +514,16 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService { } + + /** + * 查询原材料库存列表4导出 + * + * @param wmsStockTotal 原材料库存 + * @return 原材料库存 + */ + @Override + public List selectWmsStockTotalExportList(WmsStockTotal wmsStockTotal) { + return wmsStockTotalMapper.selectWmsStockTotalExportList(wmsStockTotal); + } + } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml index 0d530d30..b2bee723 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml @@ -60,6 +60,20 @@ + + + + + + + + + + + + + + select wst.stock_total_id, wst.warehouse_id, @@ -378,4 +392,23 @@ + + + + + + + + + diff --git a/hw-ui/src/views/mes/saleOrder/index.vue b/hw-ui/src/views/mes/saleOrder/index.vue index 61297ca6..5bf60d69 100644 --- a/hw-ui/src/views/mes/saleOrder/index.vue +++ b/hw-ui/src/views/mes/saleOrder/index.vue @@ -139,7 +139,17 @@ - + + 销售订单导入 + + + + + + + + + + +
将文件拖到此处,或点击上传
+
+ 仅允许导入xls、xlsx格式文件。 +
+
+ +
+ @@ -421,6 +461,7 @@ import { listSaleOrder, getSaleOrder, delSaleOrder, addSaleOrder, updateSaleOrde import saleOrderRelates from "@/views/mes/saleOrder/saleOrderRelates.vue"; import orderBinds from "@/views/mes/saleOrder/orderBinds.vue"; import {runJob} from "@/api/monitor/job"; +import {getToken} from "@/utils/auth"; export default { name: "SaleOrder", @@ -526,6 +567,21 @@ export default { orderBindDialogVisible: false, orderBindsData: {}, + + upload: { + // 是否显示弹出层(用户导入) + open: false, + // 弹出层标题(用户导入) + title: "", + // 是否禁用上传 + isUploading: false, + // 是否更新已经存在的用户数据 + updateSupport: 0, + // 设置上传的请求头部 + headers: {Authorization: "Bearer " + getToken()}, + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/mes/import/importSaleOrderData" + }, }; }, created() { @@ -699,7 +755,37 @@ export default { this.download('mes/saleOrder/exportSaleOrderMaterials', { ...this.queryParams }, `物料情况使用_${new Date().getTime()}.xlsx`) - } + }, + + + + + + /** 导入按钮操作 */ + handleImport() { + this.upload.title = "提资单导入"; + this.upload.open = true; + this.submitLoading = false; + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert("
" + response.msg + "
", "导入结果", {dangerouslyUseHTMLString: true}); + this.getList(); + this.submitLoading = false; + }, + // 提交上传文件 + submitFileForm() { + this.submitLoading = true; + this.$refs.upload.submit(); + }, + } }; diff --git a/hw-ui/src/views/wms/info/stocktotal/index.vue b/hw-ui/src/views/wms/info/stocktotal/index.vue index d4c8af9f..54bb905e 100644 --- a/hw-ui/src/views/wms/info/stocktotal/index.vue +++ b/hw-ui/src/views/wms/info/stocktotal/index.vue @@ -106,6 +106,19 @@ + + + 导出 + + +