Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -15,4 +15,6 @@ public interface InboundEasSyncService {
|
|||||||
void syncOtherOutBill(BillChangeDto billChangeDto);
|
void syncOtherOutBill(BillChangeDto billChangeDto);
|
||||||
|
|
||||||
void syncSaleOutBill(BillChangeDto billChangeDto);
|
void syncSaleOutBill(BillChangeDto billChangeDto);
|
||||||
|
|
||||||
|
void syncReturnInBill(BillChangeDto billChangeDto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,16 @@ package org.nl.wms.ext_manage.purchase.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.wms.ext_manage.purchase.service.EasToWmsService;
|
import org.nl.wms.ext_manage.purchase.service.EasToWmsService;
|
||||||
import org.nl.wms.ext_manage.purchase.service.InboundEasSyncService;
|
import org.nl.wms.ext_manage.purchase.service.InboundEasSyncService;
|
||||||
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.dao.mapper.PurchasemstMapper;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -16,39 +21,36 @@ public class EasToWmsServiceImpl implements EasToWmsService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private InboundEasSyncService inboundEasSyncService;
|
private InboundEasSyncService inboundEasSyncService;
|
||||||
|
@Autowired
|
||||||
|
private PurchaseService purchaseService;
|
||||||
|
@Autowired
|
||||||
|
private PurchasemstMapper purchasemstMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject billChangeHandler(BillChangeDto billChangeDto) {
|
public JSONObject billChangeHandler(BillChangeDto billChangeDto) {
|
||||||
if (StrUtil.isEmptyIfStr(billChangeDto.getBillid())){
|
if (StrUtil.isEmptyIfStr(billChangeDto.getBillid())){
|
||||||
throw new BadRequestException("EAS同步失败:billid为空");
|
throw new BadRequestException("EAS同步失败:billid为空");
|
||||||
}
|
}
|
||||||
JSONObject result = new JSONObject();
|
String billId = billChangeDto.getBillid();
|
||||||
switch (billChangeDto.getOrderType()){
|
//更新单据
|
||||||
case "103":
|
final Purchasemst one = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
//采购入库单
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
inboundEasSyncService.syncPurchaseBill(billChangeDto);
|
if (one!=null && one.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
break;
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
case "107":
|
|
||||||
//调拨入库单
|
|
||||||
inboundEasSyncService.syncTransferBill(billChangeDto);
|
|
||||||
break;
|
|
||||||
case "109":
|
|
||||||
//其他入库单
|
|
||||||
inboundEasSyncService.syncOtherBill(billChangeDto);
|
|
||||||
break;
|
|
||||||
case "106":
|
|
||||||
//调拨出库单
|
|
||||||
inboundEasSyncService.syncTransferOutBill(billChangeDto);
|
|
||||||
break;
|
|
||||||
case "108":
|
|
||||||
//其他出库单
|
|
||||||
inboundEasSyncService.syncOtherOutBill(billChangeDto);
|
|
||||||
break;
|
|
||||||
case "102":
|
|
||||||
//销售出库单
|
|
||||||
inboundEasSyncService.syncSaleOutBill(billChangeDto);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
|
||||||
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
|
Purchasemst purchasemst = new Purchasemst();
|
||||||
|
purchasemst.setBill_id(billChangeDto.getBillid());
|
||||||
|
purchasemst.setStatus(billChangeDto.getStatus());
|
||||||
|
purchasemst.setOrder_no(billChangeDto.getOrderNo());
|
||||||
|
purchasemst.setOrder_type(billChangeDto.getOrderType());
|
||||||
|
purchasemst.setRed(billChangeDto.getRed());
|
||||||
|
purchasemst.setCreate_time(billChangeDto.getNoticeTime());
|
||||||
|
purchasemst.setBill_status(PurchaseBillStatus.W_SYNC.getCode());
|
||||||
|
purchaseService.save(purchasemst);
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
result.put("respCode", 0);
|
result.put("respCode", 0);
|
||||||
result.put("respMsg", "单据变更通知成功");
|
result.put("respMsg", "单据变更通知成功");
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -89,4 +89,13 @@ public class InboundEasQueryService {
|
|||||||
public List<Purchasedtl> queryDtlListBySaleOut(String billId) {
|
public List<Purchasedtl> queryDtlListBySaleOut(String billId) {
|
||||||
return easPurchasedtlMapper.selectSaleOutByBillId(billId);
|
return easPurchasedtlMapper.selectSaleOutByBillId(billId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Purchasemst queryMstByReturnIn(String billId) {
|
||||||
|
List<Purchasemst> list = easPurchasemstMapper.selectReturnInByBillId(billId);
|
||||||
|
return list != null && !list.isEmpty() ? list.get(0) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Purchasedtl> queryDtlListByReturnIn(String billId) {
|
||||||
|
return easPurchasedtlMapper.selectReturnInByBillId(billId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//更新单据
|
//更新单据
|
||||||
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, billId));
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
throw new BadRequestException("EAS采购单同步失败:当前单据在WMS系统中已经执行 " + billId);
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
}
|
}
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -67,8 +67,9 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//增加单据
|
//增加单据
|
||||||
Purchasemst easMst = easQueryService.queryMst(billId);
|
Purchasemst easMst = easQueryService.queryMst(billId);
|
||||||
if (easMst == null) {
|
if (easMst == null) {
|
||||||
throw new BadRequestException("EAS采购单同步失败:EAS系统中未找到单据: " + billId);
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
}
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
//判断是否因为填错仓库号保证中鼎一致
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
@@ -113,7 +114,7 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
log.info("EAS单据同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//删除单据
|
//删除单据
|
||||||
@@ -136,8 +137,8 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//更新单据
|
//更新单据
|
||||||
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, billId));
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
throw new BadRequestException("EAS采购单同步失败:当前单据在WMS系统中已经执行 " + billId);
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
}
|
}
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -152,8 +153,9 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//增加单据
|
//增加单据
|
||||||
Purchasemst easMst = easQueryService.queryMstByTransfer(billId);
|
Purchasemst easMst = easQueryService.queryMstByTransfer(billId);
|
||||||
if (easMst == null) {
|
if (easMst == null) {
|
||||||
throw new BadRequestException("EAS采购单同步失败:EAS系统中未找到单据: " + billId);
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
}
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
//判断是否因为填错仓库号保证中鼎一致
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
@@ -198,7 +200,7 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
log.info("EAS单据同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//删除单据
|
//删除单据
|
||||||
@@ -221,8 +223,8 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//更新单据
|
//更新单据
|
||||||
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, billId));
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
throw new BadRequestException("EAS采购单同步失败:当前单据在WMS系统中已经执行 " + billId);
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
}
|
}
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -237,8 +239,9 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//增加单据
|
//增加单据
|
||||||
Purchasemst easMst = easQueryService.queryMstByOther(billId);
|
Purchasemst easMst = easQueryService.queryMstByOther(billId);
|
||||||
if (easMst == null) {
|
if (easMst == null) {
|
||||||
throw new BadRequestException("EAS采购单同步失败:EAS系统中未找到单据: " + billId);
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
}
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
//判断是否因为填错仓库号保证中鼎一致
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
@@ -283,7 +286,7 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
log.info("EAS单据同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//删除单据
|
//删除单据
|
||||||
@@ -306,8 +309,8 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//更新单据
|
//更新单据
|
||||||
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, billId));
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
throw new BadRequestException("EAS采购单同步失败:当前单据在WMS系统中已经执行 " + billId);
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
}
|
}
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -322,8 +325,9 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//增加单据
|
//增加单据
|
||||||
Purchasemst easMst = easQueryService.queryMstByTransferOut(billId);
|
Purchasemst easMst = easQueryService.queryMstByTransferOut(billId);
|
||||||
if (easMst == null) {
|
if (easMst == null) {
|
||||||
throw new BadRequestException("EAS采购单同步失败:EAS系统中未找到单据: " + billId);
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
}
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
//判断是否因为填错仓库号保证中鼎一致
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
@@ -368,7 +372,7 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
log.info("EAS单据同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//删除单据
|
//删除单据
|
||||||
@@ -391,8 +395,8 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//更新单据
|
//更新单据
|
||||||
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, billId));
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
throw new BadRequestException("EAS采购单同步失败:当前单据在WMS系统中已经执行 " + billId);
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
}
|
}
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -407,8 +411,9 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//增加单据
|
//增加单据
|
||||||
Purchasemst easMst = easQueryService.queryMstByOtherOut(billId);
|
Purchasemst easMst = easQueryService.queryMstByOtherOut(billId);
|
||||||
if (easMst == null) {
|
if (easMst == null) {
|
||||||
throw new BadRequestException("EAS采购单同步失败:EAS系统中未找到单据: " + billId);
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
}
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
//判断是否因为填错仓库号保证中鼎一致
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
@@ -453,7 +458,7 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
log.info("EAS单据同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//删除单据
|
//删除单据
|
||||||
@@ -476,8 +481,8 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//更新单据
|
//更新单据
|
||||||
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, billId));
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
throw new BadRequestException("EAS采购单同步失败:当前单据在WMS系统中已经执行 " + billId);
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
}
|
}
|
||||||
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
List ZD_STOR_SET;
|
List ZD_STOR_SET;
|
||||||
@@ -492,8 +497,9 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
//增加单据
|
//增加单据
|
||||||
Purchasemst easMst = easQueryService.queryMstBySaleOut(billId);
|
Purchasemst easMst = easQueryService.queryMstBySaleOut(billId);
|
||||||
if (easMst == null) {
|
if (easMst == null) {
|
||||||
throw new BadRequestException("EAS采购单同步失败:EAS系统中未找到单据: " + billId);
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
}
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
//判断是否因为填错仓库号保证中鼎一致
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
@@ -507,6 +513,92 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
|
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
|
||||||
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
|
//更新单据
|
||||||
|
Boolean allZD = true;
|
||||||
|
for (Purchasedtl dtl : easDtlList) {
|
||||||
|
if (ZD_STOR_SET.contains(dtl.getHouse_code())){
|
||||||
|
//中鼎立库
|
||||||
|
dtl.setInstock_qty(dtl.getQty());
|
||||||
|
easMst.setForwardZD(1);
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.EXECUTING.getCode());
|
||||||
|
}else {
|
||||||
|
allZD = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Objects.equals(1, easMst.getForwardZD())){
|
||||||
|
if (allZD){
|
||||||
|
//如果全部都是中鼎的则由中鼎回传EAS
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||||
|
}
|
||||||
|
//转发中鼎
|
||||||
|
try {
|
||||||
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
easMst.setForwardZD(2);
|
||||||
|
} catch (Exception e) {
|
||||||
|
easMst.setForwardZD(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
|
purchasemstMapper.insert(easMst);
|
||||||
|
log.info("EAS单据同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
//删除单据
|
||||||
|
LambdaQueryWrapper<Purchasemst> eq = new LambdaQueryWrapper<Purchasemst>()
|
||||||
|
.eq(Purchasemst::getBill_id, billId);
|
||||||
|
Purchasemst mst = purchasemstMapper.selectOne(eq);
|
||||||
|
if (mst.getForwardZD() == 2){
|
||||||
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
}
|
||||||
|
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
|
purchasemstMapper.deleteById(mst.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncReturnInBill(BillChangeDto billChangeDto) {
|
||||||
|
String billId = billChangeDto.getBillid();
|
||||||
|
Integer status = billChangeDto.getStatus();//1:已提交;2:更新;3:删除;
|
||||||
|
//更新单据
|
||||||
|
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
|
.eq(Purchasemst::getBill_id, billId));
|
||||||
|
if (purchasemst!=null && purchasemst.getBill_status().equals(PurchaseBillStatus.EXECUTING.getCode())){
|
||||||
|
throw new BadRequestException("EAS单据同步失败:当前单据在WMS系统中已经执行 " + billId);
|
||||||
|
}
|
||||||
|
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
|
||||||
|
List ZD_STOR_SET;
|
||||||
|
if (zdStorParam!=null){
|
||||||
|
ZD_STOR_SET = JSONObject.parseObject(zdStorParam.getValue(), List.class);
|
||||||
|
} else {
|
||||||
|
ZD_STOR_SET = new ArrayList<>();
|
||||||
|
}
|
||||||
|
switch (status){
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
//增加单据
|
||||||
|
Purchasemst easMst = easQueryService.queryMstByReturnIn(billId);
|
||||||
|
if (easMst == null) {
|
||||||
|
throw new BadRequestException("EAS单据同步失败:EAS系统中未找到单据: " + billId);
|
||||||
|
}
|
||||||
|
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||||
|
//判断是否因为填错仓库号保证中鼎一致
|
||||||
|
List<Purchasedtl> purchasedtlList = purchasedtlMapper.selectList(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
|
List<Purchasedtl> easDtlList = easQueryService.queryDtlListByReturnIn(billId);
|
||||||
|
boolean hasZDEas = easDtlList.stream().anyMatch((item) -> ZD_STOR_SET.contains(item.getHouse_code()));
|
||||||
|
if (!purchasedtlList.isEmpty() &&!hasZDEas){ //不包含立库则判断是否是填错仓库单据
|
||||||
|
boolean hasZD = purchasedtlList.stream().anyMatch((item) -> ZD_STOR_SET.contains(item.getHouse_code()));
|
||||||
|
if (hasZD){//原来单据包含中鼎立库
|
||||||
|
billChangeDto.setStatus(3);//删除中鼎异常单据
|
||||||
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
|
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, billId));
|
.eq(Purchasedtl::getBill_id, billId));
|
||||||
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
|
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
|
||||||
|
|||||||
@@ -21,4 +21,6 @@ public interface EasPurchasedtlMapper extends BaseMapper<Purchasedtl> {
|
|||||||
List<Purchasedtl> selectTransferOutByBillId(String billId);
|
List<Purchasedtl> selectTransferOutByBillId(String billId);
|
||||||
|
|
||||||
List<Purchasedtl> selectSaleOutByBillId(String billId);
|
List<Purchasedtl> selectSaleOutByBillId(String billId);
|
||||||
|
|
||||||
|
List<Purchasedtl> selectReturnInByBillId(String billId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
FROM EAS_NOBLE.V_UC_DBCK01
|
FROM EAS_NOBLE.V_UC_DBCK01
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectSaleOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
|
<select id="selectSaleOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
entryid,
|
entryid,
|
||||||
billid,
|
billid,
|
||||||
@@ -134,5 +134,24 @@
|
|||||||
FROM EAS_NOBLE.V_UC_XSCK05
|
FROM EAS_NOBLE.V_UC_XSCK05
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectReturnInByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
entryid,
|
||||||
|
billid,
|
||||||
|
itemNo,
|
||||||
|
categoryCode,
|
||||||
|
categoryName,
|
||||||
|
skuCode,
|
||||||
|
skuName,
|
||||||
|
model,
|
||||||
|
batchNo,
|
||||||
|
houseCode,
|
||||||
|
qty,
|
||||||
|
unitCode,
|
||||||
|
unit,
|
||||||
|
trackNo
|
||||||
|
FROM EAS_NOBLE.V_UC_SCLL07
|
||||||
|
WHERE billid = #{bill_id}
|
||||||
|
</select>
|
||||||
|
<!-- 记得添加映射-->
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -23,4 +23,6 @@ public interface EasPurchasemstMapper extends BaseMapper<Purchasemst> {
|
|||||||
List<Purchasemst> selectTransferOutByBillId(String billId);
|
List<Purchasemst> selectTransferOutByBillId(String billId);
|
||||||
|
|
||||||
List<Purchasemst> selectSaleOutByBillId(String billId);
|
List<Purchasemst> selectSaleOutByBillId(String billId);
|
||||||
|
|
||||||
|
List<Purchasemst> selectReturnInByBillId(String billId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
FROM EAS_NOBLE.V_UC_DBCK01
|
FROM EAS_NOBLE.V_UC_DBCK01
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectSaleOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
|
<select id="selectSaleOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst" resultMap="BaseResultMap">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
orderNo,
|
orderNo,
|
||||||
orderType,
|
orderType,
|
||||||
@@ -108,5 +108,18 @@
|
|||||||
FROM EAS_NOBLE.V_UC_XSCK05
|
FROM EAS_NOBLE.V_UC_XSCK05
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectReturnInByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst" resultMap="BaseResultMap">
|
||||||
|
SELECT DISTINCT
|
||||||
|
orderNo,
|
||||||
|
orderType,
|
||||||
|
creator,
|
||||||
|
createTime,
|
||||||
|
modifyDate,
|
||||||
|
status,
|
||||||
|
billid,
|
||||||
|
red
|
||||||
|
FROM EAS_NOBLE.V_UC_SCLL07
|
||||||
|
WHERE billid = #{bill_id}
|
||||||
|
</select>
|
||||||
|
<!-- 记得添加映射-->
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
|||||||
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
||||||
import org.nl.wms.ext_manage.service.dto.ZDInventory;
|
import org.nl.wms.ext_manage.service.dto.ZDInventory;
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandDto;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandDto;
|
||||||
import org.nl.wms.pm_manage.pmreturn.service.dao.PmReturn;
|
|
||||||
import org.nl.wms.pm_manage.pmreturn.service.dto.PmReturnDto;
|
import org.nl.wms.pm_manage.pmreturn.service.dto.PmReturnDto;
|
||||||
import org.nl.wms.system_manage.enums.SysParamConstant;
|
import org.nl.wms.system_manage.enums.SysParamConstant;
|
||||||
import org.nl.wms.system_manage.service.param.dao.Param;
|
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||||
@@ -103,7 +102,7 @@ public class WmsToZDWmdServiceImpl implements WmsToZDWmdService {
|
|||||||
public ResponseEntity syncPurchaseReceiving(BillChangeDto billChangeDto) {
|
public ResponseEntity syncPurchaseReceiving(BillChangeDto billChangeDto) {
|
||||||
final String param = JSON.toJSONString(billChangeDto);
|
final String param = JSON.toJSONString(billChangeDto);
|
||||||
log.info("syncPurchaseReceiving采购入库单下发输入参数:-------------------" + param);
|
log.info("syncPurchaseReceiving采购入库单下发输入参数:-------------------" + param);
|
||||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode(SysParamConstant.ZD_URL_REQUISITION).getValue();
|
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode(SysParamConstant.ZD_URL_IOORDER).getValue();
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(param)
|
.body(param)
|
||||||
|
|||||||
@@ -247,12 +247,15 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
List<AddInvParam> addInvParams = new ArrayList<>();
|
List<AddInvParam> addInvParams = new ArrayList<>();
|
||||||
for (UsualInboundDto.UsualInboundDtlDto item : usualInboundDto.getDetailList()) {
|
for (UsualInboundDto.UsualInboundDtlDto item : usualInboundDto.getDetailList()) {
|
||||||
//判断当前物料是否在库内
|
//判断当前物料是否在库内
|
||||||
List<GroupPlate> inStockGps = iMdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
// List<GroupPlate> inStockGps = iMdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
||||||
.eq(GroupPlate::getMaterial_code, item.getSku_code())
|
// .eq(GroupPlate::getMaterial_code, item.getSku_code())
|
||||||
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
|
// .eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
|
||||||
.likeRight(GroupPlate::getStoragevehicle_code, "VTP"));
|
// .likeRight(GroupPlate::getStoragevehicle_code, "VTP"));
|
||||||
if (!inStockGps.isEmpty()){
|
List<StructattrVechielDto> structattrVechielDtos = iStructattrService.collectVechicle(
|
||||||
GroupPlate groupPlate = inStockGps.get(0);
|
MapOf.of("sect_code", usualInboundDto.getSect_code(), "material_code", item.getSku_code()));
|
||||||
|
|
||||||
|
if (!structattrVechielDtos.isEmpty()){
|
||||||
|
StructattrVechielDto groupPlate = structattrVechielDtos.get(0);
|
||||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
||||||
.eq(Structattr::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
.eq(Structattr::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||||
.eq(Structattr::getSect_code, usualInboundDto.getSect_code())
|
.eq(Structattr::getSect_code, usualInboundDto.getSect_code())
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ import org.nl.common.logging.annotation.Log;
|
|||||||
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
||||||
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
||||||
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
||||||
import org.nl.wms.pm_manage.purchase.service.dto.PurchaseDto;
|
import org.nl.wms.pm_manage.purchase.service.dto.PurchaseDto;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;import org.nl.common.base.ResponseData;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -79,7 +81,11 @@ public class PurchaseController {
|
|||||||
@PostMapping("/pushZD")
|
@PostMapping("/pushZD")
|
||||||
@Log("出入库单推中鼎")
|
@Log("出入库单推中鼎")
|
||||||
public ResponseEntity pushZD(@RequestBody BillChangeDto billChangeDto){
|
public ResponseEntity pushZD(@RequestBody BillChangeDto billChangeDto){
|
||||||
return wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
purchaseService.lambdaUpdate()
|
||||||
|
.set(Purchasemst::getBill_status, PurchaseBillStatus.COMPLETED.getCode())
|
||||||
|
.eq(Purchasemst::getBill_id, billChangeDto.getBillid());
|
||||||
|
return ResponseData.build();
|
||||||
}
|
}
|
||||||
@PostMapping("/outPush")
|
@PostMapping("/outPush")
|
||||||
@Log("下推出库单")
|
@Log("下推出库单")
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
AND m.create_time >= #{params.createTime[0]}
|
AND m.create_time >= #{params.createTime[0]}
|
||||||
AND m.create_time <= #{params.createTime[1]}
|
AND m.create_time <= #{params.createTime[1]}
|
||||||
</if>
|
</if>
|
||||||
|
AND m.bill_status != '10'
|
||||||
</where>
|
</where>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
m.id,
|
m.id,
|
||||||
@@ -92,7 +93,6 @@
|
|||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
AND m.order_no = #{param.orderNo}
|
AND m.order_no = #{param.orderNo}
|
||||||
AND d.item_no = #{param.itemNo}
|
AND d.item_no = #{param.itemNo}
|
||||||
AND m.status = 0
|
|
||||||
ORDER BY m.create_time DESC, d.item_no ASC
|
ORDER BY m.create_time DESC, d.item_no ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ public enum PurchaseBillStatus {
|
|||||||
EXECUTING("1", "执行中"),
|
EXECUTING("1", "执行中"),
|
||||||
COMPLETED("2", "已完成"),
|
COMPLETED("2", "已完成"),
|
||||||
AUDIT_SUCCESS("3", "审核成功"),
|
AUDIT_SUCCESS("3", "审核成功"),
|
||||||
|
W_SYNC("10", "待同步"),
|
||||||
AUDIT_FAIL("4", "审核失败");
|
AUDIT_FAIL("4", "审核失败");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.core;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.wms.ext_manage.purchase.service.InboundEasSyncService;
|
||||||
|
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 倒冲领料定时回传,每次回传五条
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SyncBillAutoTask {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InboundEasSyncService inboundEasSyncService;
|
||||||
|
@Autowired
|
||||||
|
private PurchaseService purchaseService;
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
public void run() {
|
||||||
|
log.info("========>同步EAS单据任务");
|
||||||
|
List<Purchasemst> list = purchaseService.list(new LambdaQueryWrapper<Purchasemst>()
|
||||||
|
.eq(Purchasemst::getBill_status, PurchaseBillStatus.W_SYNC.getCode()));
|
||||||
|
for (Purchasemst purchasemst : list) {
|
||||||
|
try {
|
||||||
|
BillChangeDto billChangeDto = new BillChangeDto();
|
||||||
|
billChangeDto.setStatus(purchasemst.getStatus());
|
||||||
|
billChangeDto.setRed(purchasemst.getRed());
|
||||||
|
billChangeDto.setOrderNo(purchasemst.getOrder_no());
|
||||||
|
billChangeDto.setOrderType(purchasemst.getOrder_type());
|
||||||
|
billChangeDto.setNoticeTime(purchasemst.getCreate_time());
|
||||||
|
billChangeDto.setBillid(purchasemst.getBill_id());
|
||||||
|
switch (billChangeDto.getOrderType()){
|
||||||
|
case "103":
|
||||||
|
//采购入库单
|
||||||
|
inboundEasSyncService.syncPurchaseBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
case "107":
|
||||||
|
//调拨入库单
|
||||||
|
inboundEasSyncService.syncTransferBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
case "109":
|
||||||
|
//其他入库单
|
||||||
|
inboundEasSyncService.syncOtherBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
case "106":
|
||||||
|
//调拨出库单
|
||||||
|
inboundEasSyncService.syncTransferOutBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
case "108":
|
||||||
|
//其他出库单
|
||||||
|
inboundEasSyncService.syncOtherOutBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
case "102":
|
||||||
|
//销售出库单
|
||||||
|
inboundEasSyncService.syncSaleOutBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
case "104":
|
||||||
|
//退料入库单
|
||||||
|
inboundEasSyncService.syncReturnInBill(billChangeDto);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("同步EAS单据定时任务错误{}",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("========>同步EAS单据任务结束:{}", JSON.toJSONString(list));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import org.apache.commons.lang.time.DateFormatUtils;
|
import org.apache.commons.lang.time.DateFormatUtils;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.wms.ext_manage.purchase.service.dto.EasAuditRequestDto;
|
import org.nl.wms.ext_manage.purchase.service.dto.EasAuditRequestDto;
|
||||||
import org.nl.wms.ext_manage.util.ErpUtil;
|
import org.nl.wms.ext_manage.util.ErpUtil;
|
||||||
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
||||||
@@ -46,11 +47,17 @@ public class DealPurchaseRecBillCallback implements CallbackStrategy {
|
|||||||
final String orderCode = param.getSource_bill_code();
|
final String orderCode = param.getSource_bill_code();
|
||||||
Purchasemst purchasemst = purchaseService.getOne(new LambdaQueryWrapper<Purchasemst>()
|
Purchasemst purchasemst = purchaseService.getOne(new LambdaQueryWrapper<Purchasemst>()
|
||||||
.eq(Purchasemst::getBill_id, orderCode));
|
.eq(Purchasemst::getBill_id, orderCode));
|
||||||
|
if (PurchaseBillStatus.COMPLETED.getCode().equals(purchasemst.getBill_status())){
|
||||||
|
throw new BadRequestException("重复入库!");
|
||||||
|
}
|
||||||
List<EasAuditRequestDto.EasAuditEntryDto> entryList = new ArrayList<>();
|
List<EasAuditRequestDto.EasAuditEntryDto> entryList = new ArrayList<>();
|
||||||
Purchasedtl purchasedtl = purchasedtlService.getOne(new LambdaQueryWrapper<Purchasedtl>()
|
Purchasedtl purchasedtl = purchasedtlService.getOne(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, orderCode)
|
.eq(Purchasedtl::getBill_id, orderCode)
|
||||||
.eq(Purchasedtl::getItem_no, param.getSource_billdtl_id()));
|
.eq(Purchasedtl::getItem_no, param.getSource_billdtl_id()));
|
||||||
purchasedtl.setInstock_qty(param.getPlan_qty().add(purchasedtl.getInstock_qty()));
|
purchasedtl.setInstock_qty(param.getPlan_qty().add(purchasedtl.getInstock_qty()));
|
||||||
|
if (purchasedtl.getInstock_qty().compareTo(purchasedtl.getQty())>0){//超过单据数量
|
||||||
|
throw new BadRequestException("入库数量超出单据数量,物料:" + purchasedtl.getSku_code());
|
||||||
|
}
|
||||||
purchasedtlService.updateById(purchasedtl);
|
purchasedtlService.updateById(purchasedtl);
|
||||||
List<Purchasedtl> list = purchasedtlService.list(new LambdaQueryWrapper<Purchasedtl>()
|
List<Purchasedtl> list = purchasedtlService.list(new LambdaQueryWrapper<Purchasedtl>()
|
||||||
.eq(Purchasedtl::getBill_id, orderCode));
|
.eq(Purchasedtl::getBill_id, orderCode));
|
||||||
|
|||||||
@@ -600,7 +600,7 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
crudStoragevehicleinfo.getVehicle(code).then(res => {
|
crudStoragevehicleinfo.getVehicle(code).then(res => {
|
||||||
this.form.vehicle_code = res.value
|
this.form.vehicle_code = res.data.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
icon="el-icon-info"
|
icon="el-icon-info"
|
||||||
icon-color="red"
|
icon-color="red"
|
||||||
title="是否重新转发中鼎?"
|
title="是否重新转发中鼎?"
|
||||||
@confirm="toForwardZD(scope.row)"
|
@confirm="() => toForwardZD(scope.row)"
|
||||||
>
|
>
|
||||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
@@ -243,6 +243,9 @@ export default {
|
|||||||
orderType: row.order_type,
|
orderType: row.order_type,
|
||||||
red: row.red,
|
red: row.red,
|
||||||
status: row.status
|
status: row.status
|
||||||
|
}).then(res => {
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
})
|
})
|
||||||
}, toView(index, row) {
|
}, toView(index, row) {
|
||||||
this.mstrow = row
|
this.mstrow = row
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<rrOperation />
|
<rrOperation />
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<crudOperation :permission="permission">
|
<crudOperation :permission="permission">
|
||||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
@@ -51,12 +51,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
<el-table-column label="出库数量" align="center" prop="instock_qty" width="80" />
|
||||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||||
<template v-else-if="scope.row.forwardZD == '1'">
|
<template v-else-if="scope.row.forwardZD == '1'">
|
||||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="()=>toForwardZD(scope.row)">
|
||||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudPurchase, {outPush} from '@/views/wms/pm_manage/allocationOut/purchase'
|
import crudPurchase, { outPush } from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
@@ -89,7 +89,7 @@ import udOperation from '@crud/UD.operation'
|
|||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||||
import {push} from "@/views/wms/pm_manage/demand/demand";
|
import { push } from '@/views/wms/pm_manage/demand/demand'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AllocationOut',
|
name: 'AllocationOut',
|
||||||
@@ -144,7 +144,7 @@ export default {
|
|||||||
'2': '完成',
|
'2': '完成',
|
||||||
'3': '审核成功',
|
'3': '审核成功',
|
||||||
'4': '审核失败'
|
'4': '审核失败'
|
||||||
};
|
}
|
||||||
return map[bill_status] || bill_status
|
return map[bill_status] || bill_status
|
||||||
},
|
},
|
||||||
auditStatusFormat(row) {
|
auditStatusFormat(row) {
|
||||||
@@ -191,13 +191,16 @@ export default {
|
|||||||
const s = String(d.getSeconds()).padStart(2, '0')
|
const s = String(d.getSeconds()).padStart(2, '0')
|
||||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||||
},
|
},
|
||||||
toForwardZD() {
|
toForwardZD(row) {
|
||||||
crudPurchase.pushZD({
|
crudPurchase.pushZD({
|
||||||
billid: row.bill_id,
|
billid: row.bill_id,
|
||||||
orderNo: row.order_no,
|
orderNo: row.order_no,
|
||||||
orderType: row.order_type,
|
orderType: row.order_type,
|
||||||
red: row.red,
|
red: row.red,
|
||||||
status: row.status
|
status: row.status
|
||||||
|
}).then(res => {
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toView(index, row) {
|
toView(index, row) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<rrOperation :crud="crud" />
|
<rrOperation :crud="crud" />
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<crudOperation :permission="permission" >
|
<crudOperation :permission="permission">
|
||||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
||||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-house" size="mini" :disabled="isBatchAllocateDisabled()" @click="openBatchAllocateDialog">批量分配</el-button>
|
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-house" size="mini" :disabled="isBatchAllocateDisabled()" @click="openBatchAllocateDialog">批量分配</el-button>
|
||||||
@@ -86,7 +86,8 @@
|
|||||||
|
|
||||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" @selection-change="handleSelectionChange">
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="id" label="ID" width="220" show-overflow-tooltip />
|
<el-table-column prop="workOrder" label="工单编号" min-width="140" show-overflow-tooltip />
|
||||||
|
<!-- <el-table-column prop="id" label="ID" width="220" show-overflow-tooltip />-->
|
||||||
<el-table-column prop="creator" label="操作人" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="creator" label="操作人" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="createTime" label="需求日期" min-width="160" show-overflow-tooltip />
|
<el-table-column prop="createTime" label="需求日期" min-width="160" show-overflow-tooltip />
|
||||||
<el-table-column prop="priority" label="优先级" width="80" />
|
<el-table-column prop="priority" label="优先级" width="80" />
|
||||||
@@ -95,7 +96,6 @@
|
|||||||
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusLabel(scope.row.status) }}</el-tag>
|
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="workOrder" label="工单编号" min-width="140" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="skuCode" label="物料编码" min-width="140" show-overflow-tooltip />
|
<el-table-column prop="skuCode" label="物料编码" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column prop="skuName" label="物料名称" min-width="180" show-overflow-tooltip />
|
<el-table-column prop="skuName" label="物料名称" min-width="180" show-overflow-tooltip />
|
||||||
<el-table-column prop="qty" label="数量" width="100" />
|
<el-table-column prop="qty" label="数量" width="100" />
|
||||||
@@ -127,7 +127,7 @@ import crudOperation from '@crud/CRUD.operation.vue'
|
|||||||
import udOperation from '@crud/UD.operation.vue'
|
import udOperation from '@crud/UD.operation.vue'
|
||||||
import rrOperation from '@crud/RR.operation.vue'
|
import rrOperation from '@crud/RR.operation.vue'
|
||||||
import pagination from '@crud/Pagination.vue'
|
import pagination from '@crud/Pagination.vue'
|
||||||
import crudPurchase from "@/views/wms/pm_manage/allocationOut/purchase";
|
import crudPurchase from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||||
|
|
||||||
const createDefaultForm = () => ({ id: null, creator: '', createTime: '', priority: 0, status: 0, workOrder: '', skuCode: '', skuName: '', qty: undefined, unit: '', targetArea: '', productionLine: '', sn: '' })
|
const createDefaultForm = () => ({ id: null, creator: '', createTime: '', priority: 0, status: 0, workOrder: '', skuCode: '', skuName: '', qty: undefined, unit: '', targetArea: '', productionLine: '', sn: '' })
|
||||||
|
|
||||||
@@ -140,7 +140,11 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
permission: {},
|
permission: {
|
||||||
|
add: ['purchasemst:add'],
|
||||||
|
edit: ['purchasemst:edit'],
|
||||||
|
del: ['purchasemst:del']
|
||||||
|
},
|
||||||
statusOptions: [
|
statusOptions: [
|
||||||
{ value: '0', label: '生成' },
|
{ value: '0', label: '生成' },
|
||||||
{ value: '01', label: '分配' },
|
{ value: '01', label: '分配' },
|
||||||
@@ -337,7 +341,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
push(this.multipleSelection).then(res => {
|
push(this.multipleSelection).then(res => {
|
||||||
if (res.code === 400) {
|
if (res.code === 400) {
|
||||||
this.$message.error('下推失败'+res.message)
|
this.$message.error('下推失败' + res.message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$message.success('下推成功')
|
this.$message.success('下推成功')
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||||
<template v-else-if="scope.row.forwardZD == '1'">
|
<template v-else-if="scope.row.forwardZD == '1'">
|
||||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="() => toForwardZD(scope.row)">
|
||||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
@@ -174,13 +174,16 @@ export default {
|
|||||||
const s = String(d.getSeconds()).padStart(2, '0')
|
const s = String(d.getSeconds()).padStart(2, '0')
|
||||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||||
},
|
},
|
||||||
toForwardZD() {
|
toForwardZD(row) {
|
||||||
crudPurchase.pushZD({
|
crudPurchase.pushZD({
|
||||||
billid: row.bill_id,
|
billid: row.bill_id,
|
||||||
orderNo: row.order_no,
|
orderNo: row.order_no,
|
||||||
orderType: row.order_type,
|
orderType: row.order_type,
|
||||||
red: row.red,
|
red: row.red,
|
||||||
status: row.status
|
status: row.status
|
||||||
|
}).then(res => {
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toView(index, row) {
|
toView(index, row) {
|
||||||
|
|||||||
@@ -51,12 +51,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
<el-table-column label="出库数量" align="center" prop="instock_qty" width="80" />
|
||||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||||
<template v-else-if="scope.row.forwardZD == '1'">
|
<template v-else-if="scope.row.forwardZD == '1'">
|
||||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="() => toForwardZD(scope.row)">
|
||||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
@@ -144,7 +144,7 @@ export default {
|
|||||||
'2': '完成',
|
'2': '完成',
|
||||||
'3': '审核成功',
|
'3': '审核成功',
|
||||||
'4': '审核失败'
|
'4': '审核失败'
|
||||||
};
|
}
|
||||||
return map[bill_status] || bill_status
|
return map[bill_status] || bill_status
|
||||||
},
|
},
|
||||||
auditStatusFormat(row) {
|
auditStatusFormat(row) {
|
||||||
@@ -163,13 +163,16 @@ export default {
|
|||||||
const s = String(d.getSeconds()).padStart(2, '0')
|
const s = String(d.getSeconds()).padStart(2, '0')
|
||||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||||
},
|
},
|
||||||
toForwardZD() {
|
toForwardZD(row) {
|
||||||
crudPurchase.pushZD({
|
crudPurchase.pushZD({
|
||||||
billid: row.bill_id,
|
billid: row.bill_id,
|
||||||
orderNo: row.order_no,
|
orderNo: row.order_no,
|
||||||
orderType: row.order_type,
|
orderType: row.order_type,
|
||||||
red: row.red,
|
red: row.red,
|
||||||
status: row.status
|
status: row.status
|
||||||
|
}).then(res => {
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toView(index, row) {
|
toView(index, row) {
|
||||||
|
|||||||
@@ -50,8 +50,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-switch
|
<el-switch
|
||||||
slot="right"
|
slot="right"
|
||||||
v-has-user="['admin']"
|
|
||||||
v-model="forwardAllZD"
|
v-model="forwardAllZD"
|
||||||
|
v-has-user="['admin']"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#dcdfe6"
|
inactive-color="#dcdfe6"
|
||||||
active-text="开启转发中鼎"
|
active-text="开启转发中鼎"
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
icon="el-icon-info"
|
icon="el-icon-info"
|
||||||
icon-color="red"
|
icon-color="red"
|
||||||
title="是否重新转发中鼎?"
|
title="是否重新转发中鼎?"
|
||||||
@confirm="toForwardZD(scope.row)"
|
@confirm="() => toForwardZD(scope.row)"
|
||||||
>
|
>
|
||||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
|
|||||||
338
nladmin-ui/src/views/wms/pm_manage/returnIn/index.vue
Normal file
338
nladmin-ui/src/views/wms/pm_manage/returnIn/index.vue
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||||
|
<el-form-item label="模糊查询">
|
||||||
|
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单据编号">
|
||||||
|
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单号">
|
||||||
|
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商">
|
||||||
|
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单据状态">
|
||||||
|
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
|
||||||
|
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-printer"
|
||||||
|
size="mini"
|
||||||
|
:disabled="audit_flag"
|
||||||
|
@click="printBill"
|
||||||
|
>打印
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||||
|
<el-table-column prop="bill_status" label="单据状态" width="90">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="statusTagType(scope.row.bill_status)" size="mini">{{ billStatusFormat(scope.row) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||||
|
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||||
|
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||||
|
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||||
|
<template v-else-if="scope.row.forwardZD == '1'">
|
||||||
|
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="() => toForwardZD(scope.row)">
|
||||||
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
<p v-else>成功</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
|
||||||
|
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
|
||||||
|
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<AddDialog @AddChanged="querytable" />
|
||||||
|
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
title="打印预览"
|
||||||
|
:visible.sync="printPreviewVisible"
|
||||||
|
width="700px"
|
||||||
|
@close="closePrintPreview"
|
||||||
|
>
|
||||||
|
<iframe ref="printIframe" src="about:blank" style="width: 100%; height: 500px; border: 1px solid #ddd;" />
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="info" @click="printPreviewVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="doPrint">打印</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudPurchase from '@/views/wms/pm_manage/otherIn/purchase'
|
||||||
|
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||||
|
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||||
|
import QRCode from 'qrcode'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ReturnIn',
|
||||||
|
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '其他入库单',
|
||||||
|
optShow: { add: true, reset: true },
|
||||||
|
idField: 'id',
|
||||||
|
url: '/api/purchasemst/104',
|
||||||
|
crudMethod: { ...crudPurchase },
|
||||||
|
queryOnPresenterCreated: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
add: ['purchasemst:add'],
|
||||||
|
edit: ['purchasemst:edit'],
|
||||||
|
del: ['purchasemst:del']
|
||||||
|
},
|
||||||
|
viewShow: false,
|
||||||
|
mstrow: {},
|
||||||
|
currentRow: null,
|
||||||
|
audit_flag: true,
|
||||||
|
printPreviewVisible: false,
|
||||||
|
billStatusOptions: [
|
||||||
|
{ value: '0', label: '已创建' },
|
||||||
|
{ value: '1', label: '执行中' },
|
||||||
|
{ value: '2', label: '已完成' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
canUd(row) {
|
||||||
|
return row.bill_status !== '0'
|
||||||
|
},
|
||||||
|
billStatusFormat(row) {
|
||||||
|
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
|
||||||
|
return map[row.bill_status] || row.bill_status
|
||||||
|
},
|
||||||
|
auditStatusFormat(row) {
|
||||||
|
const map = { '0': '未审核', '1': '已审核' }
|
||||||
|
return map[row.status] || row.status || '-'
|
||||||
|
},
|
||||||
|
statusTagType(status) {
|
||||||
|
const map = { '0': 'warning', '1': 'primary', '2': 'success' }
|
||||||
|
return map[String(status)] || ''
|
||||||
|
},
|
||||||
|
formatDate(val) {
|
||||||
|
if (!val) return ''
|
||||||
|
if (typeof val === 'string') return val
|
||||||
|
const d = new Date(val)
|
||||||
|
const y = d.getFullYear()
|
||||||
|
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(d.getDate()).padStart(2, '0')
|
||||||
|
const h = String(d.getHours()).padStart(2, '0')
|
||||||
|
const min = String(d.getMinutes()).padStart(2, '0')
|
||||||
|
const s = String(d.getSeconds()).padStart(2, '0')
|
||||||
|
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||||
|
},
|
||||||
|
toForwardZD(row) {
|
||||||
|
crudPurchase.pushZD({
|
||||||
|
billid: row.bill_id,
|
||||||
|
orderNo: row.order_no,
|
||||||
|
orderType: row.order_type,
|
||||||
|
red: row.red,
|
||||||
|
status: row.status
|
||||||
|
}).then(res => {
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toView(index, row) {
|
||||||
|
this.mstrow = row
|
||||||
|
this.viewShow = true
|
||||||
|
},
|
||||||
|
handleSelectionChange(val, row) {
|
||||||
|
console.log(val.length)
|
||||||
|
if (val.length == 0) {
|
||||||
|
this.audit_flag = true
|
||||||
|
} else {
|
||||||
|
this.audit_flag = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCurrentChange(currentRow) {
|
||||||
|
if (currentRow === null) {
|
||||||
|
this.currentRow = {}
|
||||||
|
} else {
|
||||||
|
this.currentRow = currentRow
|
||||||
|
}
|
||||||
|
this.audit_flag = this.crud.selections.length === 0
|
||||||
|
},
|
||||||
|
querytable() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
issueReturnBill() {
|
||||||
|
const selections = this.crud.selections
|
||||||
|
if (!selections || selections.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const ids = selections.map(s => s.id)
|
||||||
|
const billIds = selections.map(s => s.bill_id).join('、')
|
||||||
|
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
crudPurchase.issueReturnBill(ids).then(() => {
|
||||||
|
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
printBill() {
|
||||||
|
const selections = this.crud.selections
|
||||||
|
if (!selections || selections.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const billIds = selections.map(s => s.order_no).join('、')
|
||||||
|
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.fetchDetailsAndPrint(selections)
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
fetchDetailsAndPrint(selections) {
|
||||||
|
const promises = selections.map(bill => {
|
||||||
|
return crudPurchase.get(bill.id).then(res => {
|
||||||
|
const dtlList = (res && res.data && res.data.tableData) || []
|
||||||
|
return dtlList.map(dtl => ({
|
||||||
|
...dtl,
|
||||||
|
order_no: bill.order_no,
|
||||||
|
bill_id: bill.bill_id
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Promise.all(promises).then(results => {
|
||||||
|
const allDtls = results.reduce((acc, cur) => acc.concat(cur), [])
|
||||||
|
if (allDtls.length === 0) {
|
||||||
|
this.crud.notify('未查询到明细数据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.printPreviewVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.renderPrintContent(allDtls)
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.notify('查询明细失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async renderPrintContent(dtlList) {
|
||||||
|
const iframe = this.$refs.printIframe
|
||||||
|
if (!iframe) return
|
||||||
|
const doc = iframe.contentDocument || (iframe.contentWindow && iframe.contentWindow.document)
|
||||||
|
if (!doc) {
|
||||||
|
setTimeout(() => this.renderPrintContent(dtlList), 100)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let html = '<!DOCTYPE html><html><head><meta charset="utf-8"><style>'
|
||||||
|
html += '*{margin:0;padding:0;box-sizing:border-box}'
|
||||||
|
html += 'body{font-family:"Microsoft YaHei",Arial,sans-serif;padding:10px}'
|
||||||
|
html += '.label{page-break-after:always;padding:10px;text-align:center;}'
|
||||||
|
html += '.label:last-child{page-break-after:auto}'
|
||||||
|
html += 'h3{text-align:center;font-size:13px;margin-bottom:3px}'
|
||||||
|
html += 'table{width:463px;border-collapse:collapse;margin:0 auto;height:224px}'
|
||||||
|
html += 'td{padding:3px 5px;border:2px solid #333;font-size:17px}'
|
||||||
|
html += '.lbl{width:25%;text-align:right;background:#f9f9f9}'
|
||||||
|
html += '.val{width:45%;text-align:left}'
|
||||||
|
html += '.qr{width:30%;text-align:center;vertical-align:middle}'
|
||||||
|
html += '@media print{@page{size:auto;margin:5mm}}'
|
||||||
|
html += '</style></head><body>'
|
||||||
|
for (const dtl of dtlList) {
|
||||||
|
const orderNo = dtl.order_no || ''
|
||||||
|
const itemNo = dtl.item_no || ''
|
||||||
|
const skuCode = dtl.sku_code || ''
|
||||||
|
const house_code = dtl.house_code || ''
|
||||||
|
const skuName = dtl.sku_name || ''
|
||||||
|
const qty = dtl.qty || ''
|
||||||
|
const qrText = orderNo + '#' + itemNo + '#' + skuCode + '#' + skuName + '##' + qty + '#'
|
||||||
|
const imgSrc = await QRCode.toDataURL(qrText, {
|
||||||
|
width: 300
|
||||||
|
})
|
||||||
|
html += '<div class="label">'
|
||||||
|
html += '<h3>上海诺力</h3>'
|
||||||
|
html += '<table>'
|
||||||
|
html += '<tr><td class="lbl">单据号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="6"><img src="' + imgSrc + '" width="150" height="150" /></td></tr>'
|
||||||
|
html += '<tr><td class="lbl">行号</td><td class="val">' + itemNo + '</td></tr>'
|
||||||
|
html += '<tr><td class="lbl">物料编码</td><td class="val">' + skuCode + '</td></tr>'
|
||||||
|
html += '<tr><td class="lbl">物料名称</td><td class="val">' + skuName + '</td></tr>'
|
||||||
|
html += '<tr><td class="lbl">数量</td><td class="val">' + qty + '</td></tr>'
|
||||||
|
html += '<tr><td class="lbl">仓库</td><td class="val">' + house_code + '</td></tr>'
|
||||||
|
html += '</table></div>'
|
||||||
|
}
|
||||||
|
html += '</body></html>'
|
||||||
|
doc.open()
|
||||||
|
doc.write(html)
|
||||||
|
doc.close()
|
||||||
|
},
|
||||||
|
doPrint() {
|
||||||
|
const iframe = this.$refs.printIframe
|
||||||
|
if (!iframe) return
|
||||||
|
iframe.contentWindow.focus()
|
||||||
|
iframe.contentWindow.print()
|
||||||
|
},
|
||||||
|
closePrintPreview() {
|
||||||
|
this.printPreviewVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
57
nladmin-ui/src/views/wms/pm_manage/returnIn/purchase.js
Normal file
57
nladmin-ui/src/views/wms/pm_manage/returnIn/purchase.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function get(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst/109/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function issueReturnBill(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst/issueReturnBill',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function print(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst/print',
|
||||||
|
method: 'post',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function pushZD(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/purchasemst/pushZD',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||||
@@ -51,12 +51,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
<el-table-column label="出库数量" align="center" prop="instock_qty" width="80" />
|
||||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||||
<template v-else-if="scope.row.forwardZD == '1'">
|
<template v-else-if="scope.row.forwardZD == '1'">
|
||||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="() => toForwardZD(scope.row)">
|
||||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
@@ -163,13 +163,16 @@ export default {
|
|||||||
const s = String(d.getSeconds()).padStart(2, '0')
|
const s = String(d.getSeconds()).padStart(2, '0')
|
||||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||||
},
|
},
|
||||||
toForwardZD() {
|
toForwardZD(row) {
|
||||||
crudPurchase.pushZD({
|
crudPurchase.pushZD({
|
||||||
billid: row.bill_id,
|
billid: row.bill_id,
|
||||||
orderNo: row.order_no,
|
orderNo: row.order_no,
|
||||||
orderType: row.order_type,
|
orderType: row.order_type,
|
||||||
red: row.red,
|
red: row.red,
|
||||||
status: row.status
|
status: row.status
|
||||||
|
}).then(res => {
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toView(index, row) {
|
toView(index, row) {
|
||||||
|
|||||||
@@ -191,7 +191,8 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
<!-- <el-table-column :selectable="checkboxT" type="selection" width="55" />-->
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||||
|
|||||||
Reference in New Issue
Block a user