add:需求单增加批量操作,强制回传功能
This commit is contained in:
@@ -127,4 +127,12 @@ public class ResponseData<T> implements Serializable {
|
|||||||
rspData.setRespCode(1);
|
rspData.setRespCode(1);
|
||||||
return new ResponseEntity(rspData, org.springframework.http.HttpStatus.OK);
|
return new ResponseEntity(rspData, org.springframework.http.HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
public static ResponseEntity buildMsg(String msg) {
|
||||||
|
ResponseData rspData = new ResponseData<>();
|
||||||
|
rspData.setCode(HttpStatus.OK.value());
|
||||||
|
rspData.setMessage(msg);
|
||||||
|
rspData.setRespMsg(msg);
|
||||||
|
rspData.setRespCode(0);
|
||||||
|
return new ResponseEntity(rspData, org.springframework.http.HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.nl.common.base.ResponseData;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
||||||
|
import org.nl.wms.pm_manage.demand.service.dto.BatchAllocateParam;
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.DemandInventryDto;
|
import org.nl.wms.pm_manage.demand.service.dto.DemandInventryDto;
|
||||||
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.demand.service.dto.PmDemandParam;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
||||||
@@ -18,6 +19,7 @@ import javax.annotation.Resource;
|
|||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/pmDemand")
|
@RequestMapping("/api/pmDemand")
|
||||||
@@ -70,6 +72,14 @@ public class PmDemandController {
|
|||||||
return ResponseData.build();
|
return ResponseData.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/batchAllocate")
|
||||||
|
@Log("批量分配仓库")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResponseEntity<Object> batchAllocate(@RequestBody BatchAllocateParam param) {
|
||||||
|
pmDemandService.batchAllocateInventory(param.getIds(), param.getInventoryDis());
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/push")
|
@PostMapping("/push")
|
||||||
@Log("需求单下发")
|
@Log("需求单下发")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -77,4 +87,12 @@ public class PmDemandController {
|
|||||||
pmDemandService.pushDemand(pmDemandDtos);
|
pmDemandService.pushDemand(pmDemandDtos);
|
||||||
return ResponseData.build();
|
return ResponseData.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/issueReturnBill")
|
||||||
|
@Log("强制回传EAS")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResponseEntity<Object> issueReturnBill(@RequestBody Set<String> ids) {
|
||||||
|
pmDemandService.issueReturnBill(ids);
|
||||||
|
return ResponseData.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
|||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public interface IPmDemandService extends IService<PmDemand> {
|
public interface IPmDemandService extends IService<PmDemand> {
|
||||||
|
|
||||||
@@ -36,6 +37,13 @@ public interface IPmDemandService extends IService<PmDemand> {
|
|||||||
*/
|
*/
|
||||||
void allocateInventory(String id, String inventoryDis);
|
void allocateInventory(String id, String inventoryDis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量分配仓库
|
||||||
|
* @param ids 需求单ID列表
|
||||||
|
* @param inventoryDis 分配仓库JSON
|
||||||
|
*/
|
||||||
|
void batchAllocateInventory(List<String> ids, String inventoryDis);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送需求单
|
* 推送需求单
|
||||||
* 1.需求单分配出库仓库
|
* 1.需求单分配出库仓库
|
||||||
@@ -45,4 +53,5 @@ public interface IPmDemandService extends IService<PmDemand> {
|
|||||||
* @param pmDemandDto
|
* @param pmDemandDto
|
||||||
*/
|
*/
|
||||||
void pushDemand(List<PmDemandDto> pmDemandDto);
|
void pushDemand(List<PmDemandDto> pmDemandDto);
|
||||||
|
void issueReturnBill(Set<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.nl.wms.pm_manage.demand.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BatchAllocateParam implements Serializable {
|
||||||
|
|
||||||
|
private List<String> ids;
|
||||||
|
|
||||||
|
private String inventoryDis;
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package org.nl.wms.pm_manage.demand.service.impl;
|
package org.nl.wms.pm_manage.demand.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
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 com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -11,11 +14,13 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||||
import org.nl.wms.ext_manage.enums.EXTConstant;
|
import org.nl.wms.ext_manage.enums.EXTConstant;
|
||||||
|
import org.nl.wms.ext_manage.purchase.service.dto.EasAuditRequestDto;
|
||||||
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.IPmDemandService;
|
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
||||||
@@ -26,25 +31,31 @@ import org.nl.wms.pm_manage.demand.service.dto.PmDemandDto;
|
|||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandParam;
|
||||||
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
import org.nl.wms.pm_manage.demand.service.dto.PmDemandQuery;
|
||||||
import org.nl.wms.pm_manage.demand.service.enums.DemandStatus;
|
import org.nl.wms.pm_manage.demand.service.enums.DemandStatus;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl;
|
||||||
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
import org.nl.wms.system_manage.service.param.ISysParamService;
|
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||||
import org.nl.wms.system_manage.service.param.dao.Param;
|
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.IOutBillService;
|
import org.nl.wms.warehouse_manage.inAndOut.service.IOutBillService;
|
||||||
|
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||||
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
||||||
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
||||||
import org.nl.wms.warehouse_manage.inventory.core.param.impl.InFinishParam;
|
import org.nl.wms.warehouse_manage.inventory.core.param.impl.InFinishParam;
|
||||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
||||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
||||||
|
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
||||||
|
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -63,9 +74,15 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysParamService iSysParamService;
|
private ISysParamService iSysParamService;
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseRegionService iSchBaseRegionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStructattrService iStructattrService;
|
private IStructattrService iStructattrService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPmStockReturnService iPmStockReturnService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PmDemandDto> queryPage(PmDemandQuery query, PageQuery pageQuery) {
|
public Page<PmDemandDto> queryPage(PmDemandQuery query, PageQuery pageQuery) {
|
||||||
trimStringFields(query);
|
trimStringFields(query);
|
||||||
@@ -156,6 +173,26 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
this.updateById(demand);
|
this.updateById(demand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchAllocateInventory(List<String> ids, String inventoryDis) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)) {
|
||||||
|
throw new BadRequestException("请选择需求单");
|
||||||
|
}
|
||||||
|
List<PmDemand> demands = this.listByIds(ids);
|
||||||
|
if (CollectionUtils.isEmpty(demands)) {
|
||||||
|
throw new BadRequestException("需求单不存在");
|
||||||
|
}
|
||||||
|
for (PmDemand demand : demands) {
|
||||||
|
if (!"0".equals(demand.getStatus())) {
|
||||||
|
throw new BadRequestException("仅支持对生成状态的需求单进行批量分配");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.update(new LambdaUpdateWrapper<PmDemand>()
|
||||||
|
.set(PmDemand::getInventory_dis, inventoryDis)
|
||||||
|
.set(PmDemand::getStatus, DemandStatus.DIS.getValue())
|
||||||
|
.in(PmDemand::getId, ids));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DemandInventryDto> queryInventory(String skuCode) {
|
public List<DemandInventryDto> queryInventory(String skuCode) {
|
||||||
List<DemandInventryDto> resultList = new ArrayList<>();
|
List<DemandInventryDto> resultList = new ArrayList<>();
|
||||||
@@ -211,9 +248,17 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
}
|
}
|
||||||
Map<Boolean, List<PmDemandDto>> partitioned = pmDemandDtos.stream()
|
Map<Boolean, List<PmDemandDto>> partitioned = pmDemandDtos.stream()
|
||||||
.collect(Collectors.partitioningBy(a -> ZD_STOR_SET
|
.collect(Collectors.partitioningBy(a -> ZD_STOR_SET
|
||||||
.contains(JSONObject.parseObject(a.getInventoryDis()).getString("horseCode"))));
|
.contains(a.getInventoryDis())));
|
||||||
List<PmDemandDto> zdDemands = partitioned.get(true);
|
List<PmDemandDto> zdDemands = partitioned.get(true);
|
||||||
List<PmDemandDto> otherDemands = partitioned.get(false);
|
List<PmDemandDto> otherDemands = partitioned.get(false);
|
||||||
|
if (!CollectionUtils.isEmpty(otherDemands)) {
|
||||||
|
JSONObject billParam = convertDemandsToBillParam(otherDemands);
|
||||||
|
iOutBillService.saveBill(billParam);
|
||||||
|
this.update(new LambdaUpdateWrapper<PmDemand>()
|
||||||
|
.set(PmDemand::getStatus,DemandStatus.SEND.getValue())
|
||||||
|
.in(PmDemand::getId,otherDemands.stream()
|
||||||
|
.map(PmDemandDto::getId).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
if (!CollectionUtils.isEmpty(zdDemands)) {
|
if (!CollectionUtils.isEmpty(zdDemands)) {
|
||||||
wmsToZDWmdService.syncDemandOrder(zdDemands);
|
wmsToZDWmdService.syncDemandOrder(zdDemands);
|
||||||
//直接增加对应库存并做库存记录
|
//直接增加对应库存并做库存记录
|
||||||
@@ -242,16 +287,12 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
}
|
}
|
||||||
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||||
iStInventoryService.changeInventory(InventoryChangeType.IN_FINISH, inFinishParams);
|
iStInventoryService.changeInventory(InventoryChangeType.IN_FINISH, inFinishParams);
|
||||||
|
this.update(new LambdaUpdateWrapper<PmDemand>()
|
||||||
|
.set(PmDemand::getStatus,DemandStatus.FINISH.getValue())
|
||||||
|
.in(PmDemand::getId,zdDemands.stream()
|
||||||
|
.map(PmDemandDto::getId).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(otherDemands)) {
|
|
||||||
JSONObject billParam = convertDemandsToBillParam(otherDemands);
|
|
||||||
iOutBillService.saveBill(billParam);
|
|
||||||
}
|
|
||||||
this.update(new LambdaUpdateWrapper<PmDemand>()
|
|
||||||
.set(PmDemand::getStatus,DemandStatus.SEND.getValue())
|
|
||||||
.in(PmDemand::getId,pmDemandDtos.stream()
|
|
||||||
.map(PmDemandDto::getId).collect(Collectors.toList())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject convertDemandsToBillParam(List<PmDemandDto> demands) {
|
private JSONObject convertDemandsToBillParam(List<PmDemandDto> demands) {
|
||||||
@@ -260,10 +301,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
PmDemandDto firstDemand = demands.get(0);
|
PmDemandDto firstDemand = demands.get(0);
|
||||||
JSONObject inventoryDis = JSONObject.parseObject(firstDemand.getInventoryDis());
|
|
||||||
|
|
||||||
JSONObject billParam = new JSONObject();
|
JSONObject billParam = new JSONObject();
|
||||||
billParam.put("stor_code", inventoryDis.getString("horseCode"));
|
billParam.put("stor_code", firstDemand.getInventoryDis());
|
||||||
billParam.put("biz_date", DateUtil.today());
|
billParam.put("biz_date", DateUtil.today());
|
||||||
billParam.put("bill_type", IOSEnum.BILL_TYPE.code("库存调拨"));
|
billParam.put("bill_type", IOSEnum.BILL_TYPE.code("库存调拨"));
|
||||||
billParam.put("remark", "需求单下推生成");
|
billParam.put("remark", "需求单下推生成");
|
||||||
@@ -294,6 +334,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
detailRow.put("callback_strategy", "DealLLDBBillPmDeamndCallBack");
|
detailRow.put("callback_strategy", "DealLLDBBillPmDeamndCallBack");
|
||||||
detailRow.put("source_bill_type", "需求单");
|
detailRow.put("source_bill_type", "需求单");
|
||||||
detailRow.put("source_billdtl_id", demand.getId());
|
detailRow.put("source_billdtl_id", demand.getId());
|
||||||
|
detailRow.put("source_bill_table", "pm_demand");
|
||||||
detailRow.put("remark", "关联工单:" + demand.getWorkOrder());
|
detailRow.put("remark", "关联工单:" + demand.getWorkOrder());
|
||||||
detailRow.put("load_port", demand.getTargetArea());
|
detailRow.put("load_port", demand.getTargetArea());
|
||||||
tableData.add(detailRow);
|
tableData.add(detailRow);
|
||||||
@@ -301,4 +342,50 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|||||||
billParam.put("tableData", tableData);
|
billParam.put("tableData", tableData);
|
||||||
return billParam;
|
return billParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void issueReturnBill(Set<String> ids) {
|
||||||
|
final List<PmDemand> pmDemands = this.listByIds(ids);
|
||||||
|
if (ObjectUtil.isEmpty(pmDemands)) {
|
||||||
|
throw new BadRequestException("未找到选中的单据");
|
||||||
|
}
|
||||||
|
JSONObject callbackData = new JSONObject();
|
||||||
|
callbackData.put("method", "DealLLDBBill");
|
||||||
|
callbackData.put("type", "WMS");
|
||||||
|
final String uuidBill = UUID.randomUUID().toString();
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.put("issueStorageOrgUnitNo", "01.09.14"); // 业务状态,可根据实际业务逻辑设置
|
||||||
|
data.put("bizTypeNo", "331"); // 业务日期
|
||||||
|
data.put("receiptStorageOrgUnitNo", "01.09.14"); // 创建人编号,从当前登录用户获取
|
||||||
|
data.put("billNo", uuidBill); // 使用工单编号作为MES单号
|
||||||
|
// 组装明细列表
|
||||||
|
JSONArray entrys = new JSONArray();
|
||||||
|
for (PmDemand pmDemand : pmDemands) {
|
||||||
|
final SchBaseRegion region = iSchBaseRegionService.getOne(new LambdaQueryWrapper<SchBaseRegion>()
|
||||||
|
.eq(SchBaseRegion::getRegion_code, pmDemand.getProduction_line())
|
||||||
|
.select(SchBaseRegion::getPoint_type_explain));
|
||||||
|
if (region==null){
|
||||||
|
throw new BadRequestException("当前产线未配置对应仓库编码getPoint_type_explain");
|
||||||
|
}
|
||||||
|
cn.hutool.json.JSONObject entry = new cn.hutool.json.JSONObject();
|
||||||
|
entry.put("unitNo", "PCS"); // 序号
|
||||||
|
entry.put("qty", pmDemand.getQty()); // 数量
|
||||||
|
entry.put("materialNo", pmDemand.getSku_code()); // 来源单据标识
|
||||||
|
entry.put("issueWarehouseNo", pmDemand.getInventory_dis());
|
||||||
|
entry.put("receiptWarehouseNo", region.getPoint_type_explain());
|
||||||
|
entrys.add(entry);
|
||||||
|
}
|
||||||
|
data.put("entrys", entrys);
|
||||||
|
callbackData.put("data", data);
|
||||||
|
PmStockReturn stockReturn = new PmStockReturn();
|
||||||
|
stockReturn.setRequest_Id(uuidBill);
|
||||||
|
stockReturn.setRequest_type(IOSEnum.BILL_TYPE.code("库存调拨"));
|
||||||
|
stockReturn.setStatus(StockReturnStatusEnum.TODO.getCode()); // 0-处理中
|
||||||
|
stockReturn.setCreate_time(DateUtil.now());
|
||||||
|
stockReturn.setRequest_data(callbackData.toString());
|
||||||
|
iPmStockReturnService.save(stockReturn);
|
||||||
|
this.update(new LambdaUpdateWrapper<PmDemand>()
|
||||||
|
.set(PmDemand::getStatus,DemandStatus.FINISH.getValue())
|
||||||
|
.in(PmDemand::getId,ids));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.nl.wms.warehouse_manage.inAndOut.service.dto.OutBillManualDivReq;
|
|||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.OutBillOneCancelReq;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dto.OutBillOneCancelReq;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -81,14 +82,16 @@ public class OutBillController {
|
|||||||
@PostMapping("/allDiv")
|
@PostMapping("/allDiv")
|
||||||
@Log("出库单全部分配")
|
@Log("出库单全部分配")
|
||||||
public ResponseEntity<Object> allDiv(@RequestBody OutBillDivReq req) {
|
public ResponseEntity<Object> allDiv(@RequestBody OutBillDivReq req) {
|
||||||
iOutBillService.doDiv(req, false);
|
Assert.notNull(req.getSect_code(),"分配失败,全部分配请选出库库区");
|
||||||
return ResponseData.build();
|
Map<String, String> StringMap = iOutBillService.doDiv(req, false);
|
||||||
|
return ResponseData.buildMsg(StringMap.toString());
|
||||||
}
|
}
|
||||||
@PostMapping("/autoDiv")
|
@PostMapping("/autoDiv")
|
||||||
@Log("出库单自动分配")
|
@Log("出库单自动分配")
|
||||||
public ResponseEntity<Object> autoDiv(@RequestBody OutBillDivReq req) {
|
public ResponseEntity<Object> autoDiv(@RequestBody OutBillDivReq req) {
|
||||||
iOutBillService.doDiv(req, true);
|
Assert.notNull(req.getSect_code(),"分配失败,全部分配请选出库库区");
|
||||||
return ResponseData.build();
|
Map<String, String> StringMap = iOutBillService.doDiv(req, true);
|
||||||
|
return ResponseData.buildMsg(StringMap.toString());
|
||||||
}
|
}
|
||||||
@PostMapping("/manualDiv")
|
@PostMapping("/manualDiv")
|
||||||
@Log("出库单手动分配")
|
@Log("出库单手动分配")
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public interface IOutBillService extends IService<IOStorInv> {
|
|||||||
*/
|
*/
|
||||||
List<IOStorInvDisDto> getOutBillDis(Map whereJson);
|
List<IOStorInvDisDto> getOutBillDis(Map whereJson);
|
||||||
|
|
||||||
void doDiv(OutBillDivReq req, boolean singleDtl);
|
Map<String,String> doDiv(OutBillDivReq req, boolean singleDtl);
|
||||||
void doCancel(String iostorinvId, String iostorinvdtlId);
|
void doCancel(String iostorinvId, String iostorinvdtlId);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -347,7 +347,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void doDiv(OutBillDivReq req, boolean singleDtl) {
|
public Map<String,String> doDiv(OutBillDivReq req, boolean singleDtl) {
|
||||||
|
Map<String,String> result = new HashMap<>();
|
||||||
List<String> flatWarehouse = getFlatWarehouseCodes();
|
List<String> flatWarehouse = getFlatWarehouseCodes();
|
||||||
String iostorinvId = req.getIostorinv_id();
|
String iostorinvId = req.getIostorinv_id();
|
||||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinvId);
|
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinvId);
|
||||||
@@ -373,7 +374,13 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
.strategyMaters(list);
|
.strategyMaters(list);
|
||||||
if (singleDtl) {builder.inv_code(ioStorInv.getBill_code());}
|
if (singleDtl) {builder.inv_code(ioStorInv.getBill_code());}
|
||||||
//库存分配
|
//库存分配
|
||||||
List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv(builder.build());
|
List<StrategyStructMaterialVO> structMaterials;
|
||||||
|
try {
|
||||||
|
structMaterials = iStructattrService.outBoundSectDiv(builder.build());
|
||||||
|
}catch (Exception ex){
|
||||||
|
result.put("物料"+dtl.getMaterial_code(),ex.getMessage());
|
||||||
|
break;
|
||||||
|
}
|
||||||
int seqNo = 1;
|
int seqNo = 1;
|
||||||
BigDecimal allocationCanuseQty = BigDecimal.ZERO;
|
BigDecimal allocationCanuseQty = BigDecimal.ZERO;
|
||||||
List<IOStorInvDis> disSet = new ArrayList<>();
|
List<IOStorInvDis> disSet = new ArrayList<>();
|
||||||
@@ -438,6 +445,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
}
|
}
|
||||||
//更新主单子状态
|
//更新主单子状态
|
||||||
this.updateBillStatus(iostorinvId);
|
this.updateBillStatus(iostorinvId);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -809,33 +817,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
throw new BadRequestException("未找到明细");
|
throw new BadRequestException("未找到明细");
|
||||||
}
|
}
|
||||||
final IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDtl.getIostorinv_id());
|
final IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDtl.getIostorinv_id());
|
||||||
if (ioStorInv.getBill_type().equals(IOSEnum.BILL_TYPE.code("库存调拨"))){
|
//非标处理,到线边库的线边库要加库存
|
||||||
List<AddInvParam> addInvParams = new ArrayList<>();
|
|
||||||
for (IOStorInvDis invDis : disList) {
|
|
||||||
if (invDis.getTask_id() == null && !StringUtils.isEmpty(invDis.getPoint_code())){
|
|
||||||
//出库点所属区域
|
|
||||||
String sectCode = iSchBasePointService.getPointRegionMapperSect(invDis.getPoint_code());
|
|
||||||
if (sectCode ==null){
|
|
||||||
throw new BadRequestException("明细完成失败,当前点位未配置所属库区");
|
|
||||||
}
|
|
||||||
//更新库存,查询托盘
|
|
||||||
final Structattr targetAttr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
|
||||||
.eq(Structattr::getSect_code, sectCode));
|
|
||||||
if (targetAttr ==null ||StringUtils.isEmpty(targetAttr.getStoragevehicle_code())){
|
|
||||||
throw new BadRequestException("明细完成失败,当前调拨目标区域不存在"+invDis.getPoint_code());
|
|
||||||
}
|
|
||||||
AddInvParam addParam = new AddInvParam();
|
|
||||||
addParam.setPcsn(invDis.getPcsn());
|
|
||||||
addParam.setMaterialCode(invDis.getMaterial_code());
|
|
||||||
addParam.setStoragevehicleCode(targetAttr.getStoragevehicle_code());
|
|
||||||
addParam.setUnitName(invDis.getQty_unit_name());
|
|
||||||
addParam.setUnitId(invDis.getQty_unit_id());
|
|
||||||
addParam.setQty(invDis.getPlan_qty());
|
|
||||||
addInvParams.add(addParam);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
|
||||||
}
|
|
||||||
// 如果分配明细全部完成则更新明细表状态
|
// 如果分配明细全部完成则更新明细表状态
|
||||||
if (countDis == 0){
|
if (countDis == 0){
|
||||||
// 更新明细表状态
|
// 更新明细表状态
|
||||||
|
|||||||
@@ -65,9 +65,6 @@ public class StInventoryServiceImpl implements IStInventoryService {
|
|||||||
if (!StringUtils.isEmpty(invParam.getPcsn())){
|
if (!StringUtils.isEmpty(invParam.getPcsn())){
|
||||||
query.eq(GroupPlate::getPcsn,invParam.getPcsn());
|
query.eq(GroupPlate::getPcsn,invParam.getPcsn());
|
||||||
}
|
}
|
||||||
if (invParam.getStoragevehicleCode().startsWith("VTP")){
|
|
||||||
query.last("limit 1");
|
|
||||||
}
|
|
||||||
GroupPlate groupPlate = iMdPbGroupplateService.getOne(query);
|
GroupPlate groupPlate = iMdPbGroupplateService.getOne(query);
|
||||||
if (groupPlate == null){
|
if (groupPlate == null){
|
||||||
GroupPlate groupDao = GroupPlate.builder()
|
GroupPlate groupDao = GroupPlate.builder()
|
||||||
@@ -165,12 +162,16 @@ public class StInventoryServiceImpl implements IStInventoryService {
|
|||||||
queryWrapper.eq(GroupPlate::getPcsn, outFinishParam.getPcsn());
|
queryWrapper.eq(GroupPlate::getPcsn, outFinishParam.getPcsn());
|
||||||
}
|
}
|
||||||
GroupPlate groupPlate = iMdPbGroupplateService.getOne(queryWrapper);
|
GroupPlate groupPlate = iMdPbGroupplateService.getOne(queryWrapper);
|
||||||
groupPlate.setFrozen_qty(BigDecimal.ZERO.min(groupPlate.getFrozen_qty().subtract(outFinishParam.getChangeQty())));
|
if (groupPlate.getQty().subtract(outFinishParam.getChangeQty()).intValue() <= 0){
|
||||||
groupPlate.setQty(groupPlate.getQty().subtract(outFinishParam.getChangeQty()));
|
iMdPbGroupplateService.removeById(groupPlate.getGroup_id());
|
||||||
groupPlate.setUpdate_id(SecurityUtils.getCurrentUserId());
|
}else {
|
||||||
groupPlate.setUpdate_name(SecurityUtils.getCurrentNickName());
|
groupPlate.setFrozen_qty(BigDecimal.ZERO.min(groupPlate.getFrozen_qty().subtract(outFinishParam.getChangeQty())));
|
||||||
groupPlate.setUpdate_time(DateUtil.now());
|
groupPlate.setQty(groupPlate.getQty().subtract(outFinishParam.getChangeQty()));
|
||||||
iMdPbGroupplateService.updateById(groupPlate);
|
groupPlate.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
groupPlate.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
groupPlate.setUpdate_time(DateUtil.now());
|
||||||
|
iMdPbGroupplateService.updateById(groupPlate);
|
||||||
|
}
|
||||||
StIvtStructivtflow stIvtStructivtflow = new StIvtStructivtflow();
|
StIvtStructivtflow stIvtStructivtflow = new StIvtStructivtflow();
|
||||||
stIvtStructivtflow.setId(IdUtil.getStringId());
|
stIvtStructivtflow.setId(IdUtil.getStringId());
|
||||||
stIvtStructivtflow.setUpdate_time(DateUtil.now());
|
stIvtStructivtflow.setUpdate_time(DateUtil.now());
|
||||||
|
|||||||
@@ -4,8 +4,13 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.MapOf;
|
import org.nl.common.utils.MapOf;
|
||||||
|
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||||
|
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||||
import org.nl.wms.ext_manage.api.MesApi;
|
import org.nl.wms.ext_manage.api.MesApi;
|
||||||
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
||||||
import org.nl.wms.pm_manage.demand.service.dao.PmDemand;
|
import org.nl.wms.pm_manage.demand.service.dao.PmDemand;
|
||||||
@@ -13,19 +18,26 @@ import org.nl.wms.pm_manage.demand.service.enums.DemandStatus;
|
|||||||
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDtl;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDtl;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||||
|
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||||
|
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
||||||
|
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
||||||
|
import org.nl.wms.warehouse_manage.inventory.core.param.impl.InFinishParam;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.strategy.core.CallbackStrategy;
|
import org.nl.wms.warehouse_manage.stockReturn.strategy.core.CallbackStrategy;
|
||||||
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
||||||
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderDao;
|
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderDao;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -33,6 +45,7 @@ import java.util.List;
|
|||||||
* 需求单库存调拨回传
|
* 需求单库存调拨回传
|
||||||
*/
|
*/
|
||||||
@Service(value = "DealLLDBBillPmDeamndCallBack")
|
@Service(value = "DealLLDBBillPmDeamndCallBack")
|
||||||
|
@Slf4j
|
||||||
public class DealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
public class DealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -44,6 +57,10 @@ public class DealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISchBaseRegionService iSchBaseRegionService;
|
private ISchBaseRegionService iSchBaseRegionService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IStructattrService iStructattrService;
|
||||||
|
@Autowired
|
||||||
|
private IStInventoryService iStInventoryService;
|
||||||
|
@Autowired
|
||||||
private MesApi mesApi;
|
private MesApi mesApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,15 +70,40 @@ public class DealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
|||||||
if (one == null){
|
if (one == null){
|
||||||
throw new BadRequestException("需求单不存在");
|
throw new BadRequestException("需求单不存在");
|
||||||
}
|
}
|
||||||
if (one.getStatus().equals(DemandStatus.FINISH.getValue())){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final SchBaseRegion region = iSchBaseRegionService.getOne(new LambdaQueryWrapper<SchBaseRegion>()
|
final SchBaseRegion region = iSchBaseRegionService.getOne(new LambdaQueryWrapper<SchBaseRegion>()
|
||||||
.eq(SchBaseRegion::getRegion_code, one.getProduction_line())
|
.eq(SchBaseRegion::getRegion_code, one.getProduction_line())
|
||||||
.select(SchBaseRegion::getPoint_type_explain));
|
.select(SchBaseRegion::getPoint_type_explain));
|
||||||
if (region==null){
|
if (region==null){
|
||||||
throw new BadRequestException("当前产线未配置对应仓库编码getPoint_type_explain");
|
throw new BadRequestException("当前产线未配置对应仓库编码getPoint_type_explain");
|
||||||
}
|
}
|
||||||
|
//更新库存,查询托盘
|
||||||
|
final Structattr targetAttr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
||||||
|
.eq(Structattr::getSect_code, region.getPoint_type_explain()));
|
||||||
|
if (targetAttr ==null ||StringUtils.isEmpty(targetAttr.getStoragevehicle_code())){
|
||||||
|
throw new BadRequestException("调拨失败,当前调拨目标区域缺少仓库熟悉"+targetAttr.getStruct_code());
|
||||||
|
}
|
||||||
|
List<AddInvParam> addInvParams = new ArrayList<>();
|
||||||
|
AddInvParam addParam = new AddInvParam();
|
||||||
|
addParam.setPcsn(StringUtils.isEmpty(param.getPcsn())?"1":param.getPcsn());
|
||||||
|
addParam.setMaterialCode(param.getMaterial_code());
|
||||||
|
addParam.setStoragevehicleCode(targetAttr.getStoragevehicle_code());
|
||||||
|
addParam.setStructCode(targetAttr.getStruct_code());
|
||||||
|
addParam.setSectCode(targetAttr.getSect_code());
|
||||||
|
addParam.setStorCode(targetAttr.getStor_code());
|
||||||
|
addParam.setUnitName(param.getQty_unit_name());
|
||||||
|
addParam.setUnitId(param.getQty_unit_id());
|
||||||
|
addParam.setQty(param.getAssign_qty());
|
||||||
|
addInvParams.add(addParam);
|
||||||
|
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||||
|
final List<InFinishParam> inFinishParams = new ArrayList<>();
|
||||||
|
InFinishParam inFinishParam = new InFinishParam();
|
||||||
|
BeanUtils.copyProperties(addParam,inFinishParam);
|
||||||
|
inFinishParam.setRemark("需求单库存调拨");
|
||||||
|
inFinishParams.add(inFinishParam);
|
||||||
|
iStInventoryService.changeInventory(InventoryChangeType.IN_FINISH, inFinishParams);
|
||||||
|
if (one.getStatus().equals(DemandStatus.FINISH.getValue())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
one.setAssign_qty(param.getAssign_qty());
|
one.setAssign_qty(param.getAssign_qty());
|
||||||
if (one.getAssign_qty().intValue()>=one.getQty().intValue()){
|
if (one.getAssign_qty().intValue()>=one.getQty().intValue()){
|
||||||
one.setStatus(DemandStatus.FINISH.getValue());
|
one.setStatus(DemandStatus.FINISH.getValue());
|
||||||
@@ -74,7 +116,7 @@ public class DealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
|||||||
data.put("issueStorageOrgUnitNo", "01.09.14"); // 业务状态,可根据实际业务逻辑设置
|
data.put("issueStorageOrgUnitNo", "01.09.14"); // 业务状态,可根据实际业务逻辑设置
|
||||||
data.put("bizTypeNo", "331"); // 业务日期
|
data.put("bizTypeNo", "331"); // 业务日期
|
||||||
data.put("receiptStorageOrgUnitNo", "01.09.14"); // 创建人编号,从当前登录用户获取
|
data.put("receiptStorageOrgUnitNo", "01.09.14"); // 创建人编号,从当前登录用户获取
|
||||||
data.put("billNo", param.getIostorinv_id()); // 使用工单编号作为MES单号
|
data.put("billNo", param.getIostorinvdtl_id()+"#"+param.getSeq_no()); // 使用工单编号作为MES单号
|
||||||
// 组装明细列表
|
// 组装明细列表
|
||||||
JSONArray entrys = new JSONArray();
|
JSONArray entrys = new JSONArray();
|
||||||
final List<IOStorInvDisDto> disSet = ioStorInvDisMapper.queryOutBillDisDtl(MapOf.of("iostorinvdtl_id", param.getIostorinvdtl_id()));
|
final List<IOStorInvDisDto> disSet = ioStorInvDisMapper.queryOutBillDisDtl(MapOf.of("iostorinvdtl_id", param.getIostorinvdtl_id()));
|
||||||
@@ -96,15 +138,20 @@ public class DealLLDBBillPmDeamndCallBack implements CallbackStrategy {
|
|||||||
stockReturn.setCreate_time(now);
|
stockReturn.setCreate_time(now);
|
||||||
stockReturn.setRequest_data(callbackData.toString());
|
stockReturn.setRequest_data(callbackData.toString());
|
||||||
//回传MES
|
//回传MES
|
||||||
mesApi.pmDemandCallback(Arrays.asList(new MesApi.PmDemandCall(
|
try {
|
||||||
one.getId()
|
mesApi.pmDemandCallback(Arrays.asList(new MesApi.PmDemandCall(
|
||||||
,one.getId()
|
one.getId()
|
||||||
,now,one.getTarget_area()
|
,one.getId()
|
||||||
,1
|
,now,one.getTarget_area()
|
||||||
,disSet.get(0).getStoragevehicle_code(),
|
,1
|
||||||
param.getAssign_qty().toString())));
|
,disSet.get(0).getStoragevehicle_code(),
|
||||||
|
param.getAssign_qty().toString())));
|
||||||
|
}catch (Exception ex){
|
||||||
|
log.error("DealLLDBBillPmDeamndCallBack#pmDemandCallback error:{}",ex.getMessage());
|
||||||
|
}
|
||||||
iPmStockReturnService.save(stockReturn);
|
iPmStockReturnService.save(stockReturn);
|
||||||
}
|
}
|
||||||
this.iPmDemandService.updateById(one);
|
this.iPmDemandService.updateById(one);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
:disabled="audit_flag"
|
:disabled="audit_flag"
|
||||||
@click="issueReturnBill"
|
@click="issueReturnBill"
|
||||||
>下发回传单
|
>强制回传EAS
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
@@ -123,7 +123,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
<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 show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" 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="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" />
|
||||||
@@ -222,6 +226,10 @@ export default {
|
|||||||
billStatusFormat(row) {
|
billStatusFormat(row) {
|
||||||
return ({ '0': '已创建', '1': '执行中', '2': '已完成' })[row.bill_status] || row.bill_status
|
return ({ '0': '已创建', '1': '执行中', '2': '已完成' })[row.bill_status] || row.bill_status
|
||||||
},
|
},
|
||||||
|
statusTagType(status) {
|
||||||
|
const map = { '0': 'warning', '1': 'primary', '2': 'success' }
|
||||||
|
return map[String(status)] || ''
|
||||||
|
},
|
||||||
formatDate(val) {
|
formatDate(val) {
|
||||||
if (!val) return ''
|
if (!val) return ''
|
||||||
if (typeof val === 'string') return val
|
if (typeof val === 'string') return val
|
||||||
|
|||||||
@@ -39,7 +39,13 @@ export function allocate(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function batchAllocate(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/pmDemand/batchAllocate',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
export function push(data) {
|
export function push(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/pmDemand/push',
|
url: 'api/pmDemand/push',
|
||||||
@@ -47,5 +53,11 @@ export function push(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function issueReturnBill(data) {
|
||||||
export default { add, edit, del, queryInventory, allocate, push }
|
return request({
|
||||||
|
url: '/api/pmDemand/issueReturnBill',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, queryInventory, batchAllocate, allocate, push, issueReturnBill }
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
</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" 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>
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="900px">
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="900px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px" label-suffix=":" style="border: 1px solid #cfe0df;margin-top: 10px;padding: 10px;">
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px" label-suffix=":" style="border: 1px solid #cfe0df;margin-top: 10px;padding: 10px;">
|
||||||
@@ -57,11 +59,6 @@
|
|||||||
<el-table-column prop="houseName" label="仓库名称" min-width="140" show-overflow-tooltip />
|
<el-table-column prop="houseName" label="仓库名称" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column prop="skuCode" label="物料编码" min-width="130" show-overflow-tooltip />
|
<el-table-column prop="skuCode" label="物料编码" min-width="130" show-overflow-tooltip />
|
||||||
<el-table-column prop="qty" label="库存数量" width="110" />
|
<el-table-column prop="qty" label="库存数量" width="110" />
|
||||||
<!-- <el-table-column label="分配数量" width="160">-->
|
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <el-input-number v-model="scope.row.allocQty" :min="0" :max="scope.row.qty" :precision="4" size="mini" style="width:130px;" :disabled="!scope.row._selected" />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" @click="closeAllocateDialog">取消</el-button>
|
<el-button size="mini" @click="closeAllocateDialog">取消</el-button>
|
||||||
@@ -69,6 +66,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 批量分配仓库对话框 -->
|
||||||
|
<el-dialog :visible.sync="batchAllocateVisible" title="批量分配仓库" width="500px" :close-on-click-modal="false" @close="closeBatchAllocateDialog">
|
||||||
|
<div style="margin-bottom:10px;color:#606266;font-size:13px;">
|
||||||
|
已选择 <strong style="color:#E6A23C;">{{ multipleSelection.length }}</strong> 条需求单
|
||||||
|
</div>
|
||||||
|
<el-form label-width="80px" size="small">
|
||||||
|
<el-form-item label="仓库">
|
||||||
|
<el-checkbox-group v-model="batchAllocateHouses">
|
||||||
|
<el-checkbox v-for="item in warehouseOptions" :key="item.code" :label="item.code">{{ item.code }} {{ item.name }}</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button size="mini" @click="closeBatchAllocateDialog">取消</el-button>
|
||||||
|
<el-button size="mini" type="primary" :loading="batchAllocateSaving" @click="saveBatchAllocate">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<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="id" label="ID" width="220" show-overflow-tooltip />
|
||||||
@@ -88,6 +103,7 @@
|
|||||||
<el-table-column prop="unit" label="单位" width="80" />
|
<el-table-column prop="unit" label="单位" width="80" />
|
||||||
<el-table-column prop="targetArea" label="目标库存地点" min-width="140" show-overflow-tooltip />
|
<el-table-column prop="targetArea" label="目标库存地点" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column prop="targetHouseCode" label="目标库" min-width="140" show-overflow-tooltip />
|
<el-table-column prop="targetHouseCode" label="目标库" min-width="140" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="inventoryDis" label="分配仓库" width="110" />
|
||||||
<el-table-column prop="carrierType" label="托盘类型" min-width="140" show-overflow-tooltip />
|
<el-table-column prop="carrierType" label="托盘类型" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column prop="productionLine" label="产线" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="productionLine" label="产线" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="sn" label="车辆序列号" min-width="140" show-overflow-tooltip />
|
<el-table-column prop="sn" label="车辆序列号" min-width="140" show-overflow-tooltip />
|
||||||
@@ -105,12 +121,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudDemand, { queryInventory, allocate, push } from './demand'
|
import crudDemand, { queryInventory, allocate, batchAllocate, push } from './demand'
|
||||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
import crudOperation from '@crud/CRUD.operation.vue'
|
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";
|
||||||
|
|
||||||
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: '' })
|
||||||
|
|
||||||
@@ -134,6 +151,15 @@ export default {
|
|||||||
{ value: '80', label: '完成' },
|
{ value: '80', label: '完成' },
|
||||||
{ value: '90', label: '取消' }
|
{ value: '90', label: '取消' }
|
||||||
],
|
],
|
||||||
|
batchAllocateVisible: false,
|
||||||
|
batchAllocateSaving: false,
|
||||||
|
batchAllocateHouses: [],
|
||||||
|
warehouseOptions: [
|
||||||
|
{ code: '6.011.01', name: '五期大件库' },
|
||||||
|
{ code: '6.011', name: '五期装配原材料平库' },
|
||||||
|
{ code: '6.002', name: '中鼎立库' }
|
||||||
|
],
|
||||||
|
audit_flag: true,
|
||||||
allocateVisible: false,
|
allocateVisible: false,
|
||||||
inventoryLoading: false,
|
inventoryLoading: false,
|
||||||
allocateSaving: false,
|
allocateSaving: false,
|
||||||
@@ -167,8 +193,9 @@ export default {
|
|||||||
},
|
},
|
||||||
isPushDisabled() {
|
isPushDisabled() {
|
||||||
// 没有选中、选中多行、或选中的行状态不是 '0' 时禁用
|
// 没有选中、选中多行、或选中的行状态不是 '0' 时禁用
|
||||||
if (this.multipleSelection.length !== 1) return true
|
if (this.multipleSelection.length === 0) return true
|
||||||
return this.multipleSelection[0].status !== '01'
|
// 所有选中的行 status 都必须为 '01'
|
||||||
|
return this.multipleSelection.some(item => item.status !== '01')
|
||||||
},
|
},
|
||||||
statusLabel(status) {
|
statusLabel(status) {
|
||||||
const target = this.statusOptions.find(item => String(item.value) === String(status))
|
const target = this.statusOptions.find(item => String(item.value) === String(status))
|
||||||
@@ -178,8 +205,34 @@ export default {
|
|||||||
const map = { 0: '', '01': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
const map = { 0: '', '01': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
||||||
return map[String(status)] || ''
|
return map[String(status)] || ''
|
||||||
},
|
},
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(val, row) {
|
||||||
this.multipleSelection = selection
|
this.multipleSelection = val
|
||||||
|
if (val.length === 0 && (val[0].status === '10' || val[0].status === '20')) {
|
||||||
|
this.audit_flag = true
|
||||||
|
} else {
|
||||||
|
this.audit_flag = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
issueReturnBill() {
|
||||||
|
const selections = this.multipleSelection
|
||||||
|
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(() => {
|
||||||
|
crudDemand.issueReturnBill(ids).then(() => {
|
||||||
|
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
openAllocateDialog(row) {
|
openAllocateDialog(row) {
|
||||||
this.currentDemand = { ...row }
|
this.currentDemand = { ...row }
|
||||||
@@ -255,16 +308,7 @@ export default {
|
|||||||
this.$message.warning('请至少勾选一条库存记录')
|
this.$message.warning('请至少勾选一条库存记录')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const invalidRow = this.selectedInventory.find(item => !item.allocQty || item.allocQty <= 0)
|
const inventoryDis = this.selectedInventory[0].houseCode
|
||||||
if (invalidRow) {
|
|
||||||
this.$message.warning(`仓库 ${invalidRow.houseCode} 的分配数量必须大于0`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const inventoryDisList = this.selectedInventory.map(item => ({
|
|
||||||
horseCode: item.houseCode,
|
|
||||||
qty: item.allocQty
|
|
||||||
}))
|
|
||||||
const inventoryDis = inventoryDisList.length === 1 ? JSON.stringify(inventoryDisList[0]) : JSON.stringify(inventoryDisList)
|
|
||||||
this.allocateSaving = true
|
this.allocateSaving = true
|
||||||
allocate({ id: this.currentDemand.id, inventoryDis }).then(() => {
|
allocate({ id: this.currentDemand.id, inventoryDis }).then(() => {
|
||||||
this.$message.success('库存分配成功')
|
this.$message.success('库存分配成功')
|
||||||
@@ -291,13 +335,47 @@ export default {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
push(this.multipleSelection).then(() => {
|
push(this.multipleSelection).then(res => {
|
||||||
|
if (res.code === 400) {
|
||||||
|
this.$message.error('下推失败'+res.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$message.success('下推成功')
|
this.$message.success('下推成功')
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message.error('下推失败')
|
this.$message.error('下推失败')
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
isBatchAllocateDisabled() {
|
||||||
|
if (!this.multipleSelection.length) return true
|
||||||
|
return this.multipleSelection.some(item => String(item.status) !== '0')
|
||||||
|
},
|
||||||
|
openBatchAllocateDialog() {
|
||||||
|
this.batchAllocateHouses = []
|
||||||
|
this.batchAllocateVisible = true
|
||||||
|
},
|
||||||
|
closeBatchAllocateDialog() {
|
||||||
|
this.batchAllocateVisible = false
|
||||||
|
this.batchAllocateHouses = []
|
||||||
|
},
|
||||||
|
saveBatchAllocate() {
|
||||||
|
if (!this.batchAllocateHouses.length) {
|
||||||
|
this.$message.warning('请至少选择一个仓库')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const ids = this.multipleSelection.map(item => item.id)
|
||||||
|
const inventoryDis = this.batchAllocateHouses.join(',')
|
||||||
|
this.batchAllocateSaving = true
|
||||||
|
batchAllocate({ ids, inventoryDis }).then(() => {
|
||||||
|
this.$message.success('批量分配成功')
|
||||||
|
this.closeBatchAllocateDialog()
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.error('批量分配失败')
|
||||||
|
}).finally(() => {
|
||||||
|
this.batchAllocateSaving = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</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">下发回传单</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
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@@ -53,7 +53,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
<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 show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" 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="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" />
|
||||||
@@ -154,6 +158,10 @@ export default {
|
|||||||
const map = { '0': '未审核', '1': '已审核' }
|
const map = { '0': '未审核', '1': '已审核' }
|
||||||
return map[row.status] || row.status || '-'
|
return map[row.status] || row.status || '-'
|
||||||
},
|
},
|
||||||
|
statusTagType(status) {
|
||||||
|
const map = { '0': 'warning', '1': 'primary', '2': 'success' }
|
||||||
|
return map[String(status)] || ''
|
||||||
|
},
|
||||||
formatDate(val) {
|
formatDate(val) {
|
||||||
if (!val) return ''
|
if (!val) return ''
|
||||||
if (typeof val === 'string') return val
|
if (typeof val === 'string') return val
|
||||||
|
|||||||
@@ -59,6 +59,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="serialNo" width="90" label="序号" />
|
<el-table-column show-overflow-tooltip prop="serialNo" width="90" label="序号" />
|
||||||
<el-table-column prop="status" width="100" label="状态" :formatter="statusFormat" />
|
<el-table-column prop="status" width="100" label="状态" :formatter="statusFormat" />
|
||||||
|
<el-table-column prop="status" label="单据状态" width="90">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusFormat(scope.row.status) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="skuCode" width="140" label="物料编码" />
|
<el-table-column show-overflow-tooltip prop="skuCode" width="140" label="物料编码" />
|
||||||
<el-table-column show-overflow-tooltip prop="skuName" min-width="180" label="物料名称" />
|
<el-table-column show-overflow-tooltip prop="skuName" min-width="180" label="物料名称" />
|
||||||
<el-table-column prop="qty" width="100" label="数量" align="right" />
|
<el-table-column prop="qty" width="100" label="数量" align="right" />
|
||||||
@@ -281,6 +286,10 @@ export default {
|
|||||||
statusFormat(row) {
|
statusFormat(row) {
|
||||||
return this.statusLabel(row.status)
|
return this.statusLabel(row.status)
|
||||||
},
|
},
|
||||||
|
statusTagType(status) {
|
||||||
|
const map = { '0': '', '1': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
||||||
|
return map[String(status)] || ''
|
||||||
|
},
|
||||||
deliveryMethodLabel(deliveryMethod) {
|
deliveryMethodLabel(deliveryMethod) {
|
||||||
const target = this.deliveryMethodOptions.find(item => Number(item.value) === Number(deliveryMethod))
|
const target = this.deliveryMethodOptions.find(item => Number(item.value) === Number(deliveryMethod))
|
||||||
return target ? target.label : deliveryMethod
|
return target ? target.label : deliveryMethod
|
||||||
@@ -344,15 +353,15 @@ export default {
|
|||||||
},
|
},
|
||||||
handleBatchPush() {
|
handleBatchPush() {
|
||||||
if (!this.multipleSelection.length) {
|
if (!this.multipleSelection.length) {
|
||||||
this.$message.warning('请先勾选要下推的需求单')
|
this.$message.warning('请先勾选要下推的退料单')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const invalidRows = this.multipleSelection.filter(item => String(item.status) !== '10')
|
const invalidRows = this.multipleSelection.filter(item => String(item.status) !== '10')
|
||||||
if (invalidRows.length) {
|
if (invalidRows.length) {
|
||||||
this.$message.warning('仅支持批量下推状态为“分配”的需求单')
|
this.$message.warning('仅支持批量下推状态为“分配”退料单')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$confirm(`确认批量下推已勾选的 ${this.multipleSelection.length} 条需求单吗?`, '提示', {
|
this.$confirm(`确认批量下推已勾选的 ${this.multipleSelection.length} 条退料单吗?`, '提示', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
:disabled="audit_flag"
|
:disabled="audit_flag"
|
||||||
@click="issueReturnBill"
|
@click="issueReturnBill"
|
||||||
>下发回传单
|
>强制回传EAS
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
@@ -72,7 +72,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
<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 show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" 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="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" />
|
||||||
@@ -199,6 +203,10 @@ export default {
|
|||||||
this.forwardAllZD = false
|
this.forwardAllZD = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
statusTagType(status) {
|
||||||
|
const map = { '0': 'warning', '1': 'primary', '2': 'success' }
|
||||||
|
return map[String(status)] || ''
|
||||||
|
},
|
||||||
onForwardAllZDToggle(val) {
|
onForwardAllZDToggle(val) {
|
||||||
crudPurchase.setForwardZDStatus(val ? '1' : '0').then(() => {
|
crudPurchase.setForwardZDStatus(val ? '1' : '0').then(() => {
|
||||||
this.crud.notify(val ? '已开启所有单据转发中鼎' : '已关闭所有单据转发中鼎')
|
this.crud.notify(val ? '已开启所有单据转发中鼎' : '已关闭所有单据转发中鼎')
|
||||||
|
|||||||
@@ -76,8 +76,8 @@
|
|||||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'数量')" />
|
||||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
<el-table-column prop="qty_unit_name" label="数量单位" :min-width="flexWidth('qty_unit_name',crud.data,'数量单位')" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
<label slot="label">明 细 数:</label>
|
<label slot="label">明 细 数:</label>
|
||||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总重量" prop="total_qty">
|
<el-form-item label="总数量" prop="total_qty">
|
||||||
<label slot="label">总 重 量:</label>
|
<label slot="label">总 重 量:</label>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.total_qty"
|
v-model="form.total_qty"
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
prop="plan_qty"
|
prop="plan_qty"
|
||||||
:formatter="crud.formatNum3"
|
:formatter="crud.formatNum3"
|
||||||
label="重量"
|
label="数量"
|
||||||
align="center"
|
align="center"
|
||||||
/>
|
/>
|
||||||
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
|
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<label slot="label">明 细 数:</label>
|
<label slot="label">明 细 数:</label>
|
||||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总重量" prop="total_qty">
|
<el-form-item label="总数量" prop="total_qty">
|
||||||
<label slot="label">总 重 量:</label>
|
<label slot="label">总 重 量:</label>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.total_qty"
|
v-model="form.total_qty"
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
<el-table-column prop="pcsn" label="批次号" width="150" align="center" />
|
<el-table-column prop="pcsn" label="批次号" width="150" align="center" />
|
||||||
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" width="150" align="center" />-->
|
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" width="150" align="center" />-->
|
||||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
||||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<el-table-column prop="pcsn" label="批次号" align="center" width="150" />
|
<el-table-column prop="pcsn" label="批次号" align="center" width="150" />
|
||||||
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" align="center" />-->
|
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" align="center" />-->
|
||||||
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
|
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
|
||||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||||
<el-table-column prop="point_code" label="起始位置" align="center" />
|
<el-table-column prop="point_code" label="起始位置" align="center" />
|
||||||
<el-table-column prop="struct_code" label="目的位置" align="center" />
|
<el-table-column prop="struct_code" label="目的位置" align="center" />
|
||||||
<el-table-column prop="task_code" label="任务号" align="center" />
|
<el-table-column prop="task_code" label="任务号" align="center" />
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ export default {
|
|||||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.change_qty)
|
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.change_qty)
|
||||||
} else {
|
} else {
|
||||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.change_qty)
|
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.change_qty)
|
||||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
// 如果待分配数量等于0则 明细重量 - 已分配重量
|
||||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<label slot="label">明 细 数:</label>
|
<label slot="label">明 细 数:</label>
|
||||||
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
|
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总重量" prop="total_qty">
|
<el-form-item label="总数量" prop="total_qty">
|
||||||
<label slot="label">总 重 量:</label>
|
<label slot="label">总 重 量:</label>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.total_qty"
|
v-model="form.total_qty"
|
||||||
|
|||||||
@@ -78,9 +78,9 @@
|
|||||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'数量')" />
|
||||||
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
||||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
<el-table-column prop="qty_unit_name" label="数量单位" :min-width="flexWidth('qty_unit_name',crud.data,'数量单位')" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
|
|||||||
@@ -167,7 +167,7 @@
|
|||||||
<el-table-column :formatter="billTypeFormat" prop="mol_inv_type" label="单据类型" :min-width="flexWidth('mol_inv_type',crud.data,'单据类型')" />
|
<el-table-column :formatter="billTypeFormat" prop="mol_inv_type" label="单据类型" :min-width="flexWidth('mol_inv_type',crud.data,'单据类型')" />
|
||||||
<el-table-column :formatter="typeFormat" prop="mol_type" label="损溢类型" :min-width="flexWidth('mol_type',crud.data,'损溢类型')" />
|
<el-table-column :formatter="typeFormat" prop="mol_type" label="损溢类型" :min-width="flexWidth('mol_type',crud.data,'损溢类型')" />
|
||||||
<el-table-column label="明细数" align="center" prop="dtl_num" :min-width="flexWidth('dtl_num',crud.data,'明细数')" />
|
<el-table-column label="明细数" align="center" prop="dtl_num" :min-width="flexWidth('dtl_num',crud.data,'明细数')" />
|
||||||
<el-table-column label="损益重量" align="center" prop="total_qty" :min-width="flexWidth('total_qty',crud.data,'损益重量')" >
|
<el-table-column label="损益数量" align="center" prop="total_qty" :min-width="flexWidth('total_qty',crud.data,'损益重量')" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ fun(scope.row.total_qty) }}
|
{{ fun(scope.row.total_qty) }}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
<label slot="label">明 细 数:</label>
|
<label slot="label">明 细 数:</label>
|
||||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总重量" prop="total_qty">
|
<el-form-item label="总数量" prop="total_qty">
|
||||||
<label slot="label">总 重 量:</label>
|
<label slot="label">总 重 量:</label>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.total_qty"
|
v-model="form.total_qty"
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||||
<el-table-column prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
<el-table-column prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('qty',crud.data,'重量')" />
|
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('qty',crud.data,'数量')" />
|
||||||
<el-table-column prop="qty_unit_name" label="单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
|
<el-table-column prop="qty_unit_name" label="单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
|
||||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||||
<el-table-column prop="turnout_sect_name" label="移出库区" :min-width="flexWidth('turnout_sect_name',crud.data,'移出库区')" />
|
<el-table-column prop="turnout_sect_name" label="移出库区" :min-width="flexWidth('turnout_sect_name',crud.data,'移出库区')" />
|
||||||
|
|||||||
@@ -79,8 +79,8 @@
|
|||||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'数量')" />
|
||||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
<el-table-column prop="qty_unit_name" label="数量单位" :min-width="flexWidth('qty_unit_name',crud.data,'数量单位')" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
<label slot="label">明 细 数:</label>
|
<label slot="label">明 细 数:</label>
|
||||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总重量" prop="total_qty">
|
<el-form-item label="总数量" prop="total_qty">
|
||||||
<label slot="label">总 重 量:</label>
|
<label slot="label">总 重 量:</label>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.total_qty"
|
v-model="form.total_qty"
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
|
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="plan_qty" label="出库重量" width="150" align="center">
|
<el-table-column prop="plan_qty" label="出库数量" width="150" align="center">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
||||||
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
|
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
|
||||||
|
|||||||
@@ -76,9 +76,9 @@
|
|||||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'数量')" />
|
||||||
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
||||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
<el-table-column prop="qty_unit_name" label="数量单位" :min-width="flexWidth('qty_unit_name',crud.data,'数量单位')" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
|
|||||||
@@ -130,9 +130,9 @@
|
|||||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编码" align="center" />
|
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编码" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="source_load_port" label="指定上料口" align="center" />
|
<el-table-column show-overflow-tooltip prop="source_load_port" label="指定上料口" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" width="140px" />
|
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" width="140px" />
|
||||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" align="center" />
|
<el-table-column show-overflow-tooltip prop="plan_qty" label="数量" :formatter="crud.formatNum3" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="assign_qty" label="已分配重量" :formatter="crud.formatNum3" align="center" />
|
<el-table-column show-overflow-tooltip prop="assign_qty" label="已分配数量" :formatter="crud.formatNum3" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="unassign_qty" label="未分配重量" :formatter="crud.formatNum3" align="center" />
|
<el-table-column show-overflow-tooltip prop="unassign_qty" label="未分配数量" :formatter="crud.formatNum3" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="crud-opts2">
|
<div class="crud-opts2">
|
||||||
@@ -207,7 +207,7 @@
|
|||||||
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||||
<el-table-column prop="pcsn" label="批次号" width="150px" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
<el-table-column prop="pcsn" label="批次号" width="150px" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||||
<el-table-column show-overflow-tooltip prop="qty" label="物料总数" :formatter="crud.formatNum3" align="center" />
|
<el-table-column show-overflow-tooltip prop="qty" label="物料总数" :formatter="crud.formatNum3" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" width="120px" :min-width="flexWidth('plan_qty',crud.data,'出库重量')">
|
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量" :formatter="crud.formatNum3" align="center" width="120px" :min-width="flexWidth('plan_qty',crud.data,'出库数量')">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-input-number v-show="mstrow.bill_type === '1011'" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 90px" />
|
<el-input-number v-show="mstrow.bill_type === '1011'" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 90px" />
|
||||||
<span v-show="mstrow.bill_type !== '1011'">{{ parseFloat(scope.row.plan_qty).toFixed(3) }}</span>
|
<span v-show="mstrow.bill_type !== '1011'">{{ parseFloat(scope.row.plan_qty).toFixed(3) }}</span>
|
||||||
@@ -440,8 +440,8 @@ export default {
|
|||||||
allDiv() {
|
allDiv() {
|
||||||
this.loadingAlldiv = true
|
this.loadingAlldiv = true
|
||||||
checkoutbill.allDiv(this.mstrow).then(res => {
|
checkoutbill.allDiv(this.mstrow).then(res => {
|
||||||
if(res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('操作成功' + res.message, CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
this.queryTableDtl()
|
this.queryTableDtl()
|
||||||
this.loadingAlldiv = false
|
this.loadingAlldiv = false
|
||||||
}
|
}
|
||||||
@@ -454,8 +454,11 @@ export default {
|
|||||||
if (this.currentRow.iostorinvdtl_id !== null) {
|
if (this.currentRow.iostorinvdtl_id !== null) {
|
||||||
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
|
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
|
||||||
checkoutbill.allDivOne(this.mstrow).then(res => {
|
checkoutbill.allDivOne(this.mstrow).then(res => {
|
||||||
this.queryTableDtl()
|
if (res.code === 200) {
|
||||||
this.loadingAutodiv = false
|
this.crud.notify('操作成功' + res.message, CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
this.queryTableDtl()
|
||||||
|
this.loadingAlldiv = false
|
||||||
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loadingAutodiv = false
|
this.loadingAutodiv = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ export default {
|
|||||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.change_qty)
|
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.change_qty)
|
||||||
} else {
|
} else {
|
||||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.change_qty)
|
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.change_qty)
|
||||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
// 如果待分配数量等于0则 明细重量 - 已分配重量
|
||||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<label slot="label">明 细 数:</label>
|
<label slot="label">明 细 数:</label>
|
||||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总重量" prop="total_qty">
|
<el-form-item label="总数量" prop="total_qty">
|
||||||
<label slot="label">总 重 量:</label>
|
<label slot="label">总 重 量:</label>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.total_qty"
|
v-model="form.total_qty"
|
||||||
@@ -129,9 +129,9 @@
|
|||||||
<el-table-column min-width="140" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
<el-table-column min-width="140" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
<el-table-column prop="pcsn" label="批次号" width="150px" align="center" show-overflow-tooltip />
|
<el-table-column prop="pcsn" label="批次号" width="150px" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||||
<el-table-column prop="assign_qty" :formatter="crud.formatNum3" label="已分配重量" align="center" width="100px" />
|
<el-table-column prop="assign_qty" :formatter="crud.formatNum3" label="已分配数量" align="center" width="100px" />
|
||||||
<el-table-column prop="unassign_qty" :formatter="crud.formatNum3" label="未分配重量" align="center" width="100px" />
|
<el-table-column prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量" align="center" width="100px" />
|
||||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
||||||
<el-table-column prop="source_load_port" label="指定上料口" align="center" width="130px" />
|
<el-table-column prop="source_load_port" label="指定上料口" align="center" width="130px" />
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||||
<el-table-column prop="pcsn" label="批次号" align="center" show-overflow-tooltip />
|
<el-table-column prop="pcsn" label="批次号" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||||
<el-table-column prop="struct_code" label="仓位" align="center" show-overflow-tooltip />
|
<el-table-column prop="struct_code" label="仓位" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="sect_name" label="区域" align="center" show-overflow-tooltip />
|
<el-table-column prop="sect_name" label="区域" align="center" show-overflow-tooltip />
|
||||||
<!-- <el-table-column show-overflow-tooltip prop="instorage_time" width="150px" label="入库时间" align="center" />-->
|
<!-- <el-table-column show-overflow-tooltip prop="instorage_time" width="150px" label="入库时间" align="center" />-->
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
|
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
|
||||||
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
|
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
|
||||||
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
|
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
|
||||||
<el-table-column show-overflow-tooltip label="计划重量" align="center" prop="total_qty" width="100" :formatter="crud.formatNum3" />
|
<el-table-column show-overflow-tooltip label="计划数量" align="center" prop="total_qty" width="100" :formatter="crud.formatNum3" />
|
||||||
<!-- <el-table-column show-overflow-tooltip label="实际重量" align="center" prop="plan_qty" width="100" :formatter="crud.formatNum3" />-->
|
<!-- <el-table-column show-overflow-tooltip label="实际重量" align="center" prop="plan_qty" width="100" :formatter="crud.formatNum3" />-->
|
||||||
<el-table-column show-overflow-tooltip label="是否回传" align="center" prop="is_upload" width="80" :formatter="formatIsUpload" />
|
<el-table-column show-overflow-tooltip label="是否回传" align="center" prop="is_upload" width="80" :formatter="formatIsUpload" />
|
||||||
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
|
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
|
||||||
@@ -250,8 +250,8 @@ import AddDialog from '@/views/wms/st/outbill/AddDialog'
|
|||||||
import DivDialog from '@/views/wms/st/outbill/DivDialog'
|
import DivDialog from '@/views/wms/st/outbill/DivDialog'
|
||||||
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
|
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
|
||||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||||
import crudPurchase from "@/views/wms/pm_manage/otherIn/purchase";
|
import crudPurchase from '@/views/wms/pm_manage/otherIn/purchase'
|
||||||
import QRCode from "qrcode";
|
import QRCode from 'qrcode'
|
||||||
|
|
||||||
const start = new Date()
|
const start = new Date()
|
||||||
|
|
||||||
@@ -454,8 +454,7 @@ export default {
|
|||||||
html += '<tr><td class="lbl">行号</td><td class="val">' + itemNo + '</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">' + skuCode + '</td></tr>'
|
||||||
html += '<tr><td class="lbl">物料名称</td><td class="val">' + skuName + '</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">' + assQty + '</td></tr>'
|
||||||
html += '<tr><td class="lbl">实出库数量</td><td class="val">' + assQty + '</td></tr>'
|
|
||||||
html += '<tr><td class="lbl">用料位置</td><td class="val">' + house_code + '</td></tr>'
|
html += '<tr><td class="lbl">用料位置</td><td class="val">' + house_code + '</td></tr>'
|
||||||
html += '</table></div>'
|
html += '</table></div>'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user