opt:更新
This commit is contained in:
@@ -46,13 +46,11 @@ public class SecurityUtils {
|
||||
* @return 系统用户名称
|
||||
*/
|
||||
public static String getCurrentNickName() {
|
||||
// CurrentUser user = getCurrentUser();
|
||||
// if (user!=null){
|
||||
// return user.getPresonName();
|
||||
// }
|
||||
// return null;
|
||||
//tofix postMan测试,完成后改回
|
||||
return "admin";
|
||||
CurrentUser user = getCurrentUser();
|
||||
if (user!=null){
|
||||
return user.getPresonName();
|
||||
}
|
||||
return "default";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,9 +59,7 @@ public class SecurityUtils {
|
||||
* @return 系统用户Id
|
||||
*/
|
||||
public static String getCurrentUserId() {
|
||||
//return getCurrentUser().getId();
|
||||
//tofix postMan测试,完成后改回
|
||||
return "1";
|
||||
return getCurrentUser().getId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +68,7 @@ public class SecurityUtils {
|
||||
*/
|
||||
@Deprecated
|
||||
public static Long getDeptId() {
|
||||
// return getCurrentUser().getUser().getDept().getId();
|
||||
//return getCurrentUser().getUser().getDept().getId();
|
||||
return 1L;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,23 @@ public class StructattrVechielDto extends GroupPlate {
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_name;
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_id;
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_code;
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_name;
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
|
||||
@@ -87,5 +87,5 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
List<MdPbStoragevehicleextDto> queryAvailableInv(@Param("params") Map whereJson);
|
||||
List<JSONObject> queryAvailableInv(@Param("params") Map whereJson);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
ORDER BY ext.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryAvailableInv" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
||||
<select id="queryAvailableInv" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.group_id as storagevehicleext_id,
|
||||
ext.storagevehicle_code,
|
||||
@@ -277,7 +277,10 @@
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
attr.lock_type = '0'
|
||||
AND attr.is_used = "1"
|
||||
AND ext.status = '02'
|
||||
and ext.frozen_qty = 0
|
||||
<if test="params.stor_id != null and params.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id = #{params.stor_id}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
||||
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonDtl.setStor_id(storDao.getStor_id());
|
||||
jsonDtl.setStor_name(storDao.getStor_name());
|
||||
jsonDtl.setForm_type(json.getString("order_type"));
|
||||
jsonDtl.setForm_type("0001");
|
||||
jsonDtl.setSource_form_date(DateUtil.today());
|
||||
jsonDtl.setMaterial_code(json.getString("mater_code"));
|
||||
jsonDtl.setMaterial_id(materDao.getMaterial_id());
|
||||
@@ -140,7 +140,8 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
||||
plate.setQty(BigDecimal.valueOf(json.getDoubleValue("qty")));
|
||||
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
|
||||
plate.setExt_code(json.getString("order_code"));
|
||||
plate.setExt_type(json.getString("order_type"));
|
||||
plate.setExt_type("0001");
|
||||
plate.setExt_id(jsonDtl.getId());
|
||||
plate.setCreate_name("ERP");
|
||||
plate.setCreate_time(DateUtil.now());
|
||||
plates.add(plate);
|
||||
@@ -204,7 +205,7 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
||||
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonDtl.setStor_id(storDao.getStor_id());
|
||||
jsonDtl.setStor_name(storDao.getStor_name());
|
||||
jsonDtl.setForm_type(json.getString("order_type"));
|
||||
jsonDtl.setForm_type("1001");
|
||||
jsonDtl.setSource_form_date(DateUtil.today());
|
||||
jsonDtl.setMaterial_code(json.getString("mater_code"));
|
||||
jsonDtl.setMaterial_id(materDao.getMaterial_id());
|
||||
|
||||
@@ -156,7 +156,7 @@ public class PmFormData implements Serializable {
|
||||
/**
|
||||
* 是否完结
|
||||
*/
|
||||
private Integer is_finish;
|
||||
private String is_finish;
|
||||
|
||||
/**
|
||||
* 是否合单
|
||||
|
||||
@@ -125,6 +125,9 @@
|
||||
<if test="query.form_type != null and query.form_type != ''">
|
||||
and form_type = #{query.form_type}
|
||||
</if>
|
||||
<if test="query.is_finish != null and query.is_finish != ''">
|
||||
and is_finish = #{query.is_finish}
|
||||
</if>
|
||||
<if test="query.pcsn != null and query.pcsn != ''">
|
||||
and pcsn = #{query.pcsn}
|
||||
</if>
|
||||
|
||||
@@ -22,6 +22,7 @@ public class FormDataQuery extends BaseQuery<PmFormData> {
|
||||
private String pcsn;
|
||||
private String parent_id;
|
||||
private String material_code;
|
||||
private String is_finish;
|
||||
private String[] status;
|
||||
private String start_time;
|
||||
private String end_time;
|
||||
|
||||
@@ -116,7 +116,7 @@ public interface IOutBillService extends IService<IOStorInv> {
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
List<MdPbStoragevehicleextDto> queryAvailableInv(Map whereJson);
|
||||
List<JSONObject> queryAvailableInv(Map whereJson);
|
||||
|
||||
/**
|
||||
* 出库单手动分配
|
||||
|
||||
@@ -113,4 +113,9 @@ public class GroupPlate implements Serializable {
|
||||
* 来源单据类型
|
||||
*/
|
||||
private String ext_type;
|
||||
|
||||
/**
|
||||
* 来源单据id
|
||||
*/
|
||||
private String ext_id;
|
||||
}
|
||||
|
||||
@@ -54,20 +54,22 @@
|
||||
gp.material_id,
|
||||
gp.qty_unit_id,
|
||||
gp.qty_unit_name,
|
||||
gp.qty,
|
||||
gp.qty as plan_qty,
|
||||
gp.frozen_qty,
|
||||
gp.remark,
|
||||
gp.STATUS,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.material_code,
|
||||
gp.ext_code,
|
||||
gp.ext_type
|
||||
gp.ext_code as source_bill_code,
|
||||
gp.ext_type as source_bill_type,
|
||||
gp.ext_id as source_billdtl_id
|
||||
FROM
|
||||
md_pb_groupplate gp
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = gp.material_id
|
||||
<where>
|
||||
gp.status = '01' and frozen_qty = 0
|
||||
and gp.ext_type = '0001'
|
||||
<if test="params.material_code != null">
|
||||
AND
|
||||
gp.material_code LIKE CONCAT('%', #{params.material_code}, '%')
|
||||
@@ -120,7 +122,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getIODtl" resultType="org.nl.wms.warehouse_manage.service.dto.IOStorInvDtlDto">
|
||||
SELECT DISTINCT
|
||||
SELECT
|
||||
dtl.*,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
|
||||
@@ -3,13 +3,18 @@ package org.nl.wms.warehouse_manage.service.dto;
|
||||
import lombok.Data;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/20
|
||||
*/
|
||||
@Data
|
||||
public class GroupPlateDto extends GroupPlate{
|
||||
|
||||
/**
|
||||
* 组盘数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@@ -21,4 +26,19 @@ public class GroupPlateDto extends GroupPlate{
|
||||
* 物料名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String source_bill_code;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String source_bill_type;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String source_billdtl_id;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,18 @@ import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.pm_manage.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.service.dao.mapper.PmFormDataMapper;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
@@ -72,7 +77,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
@Resource
|
||||
private ISectattrService iSectattrService;
|
||||
/**
|
||||
* 载具扩展属性mapper
|
||||
*/
|
||||
@@ -84,6 +90,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
*/
|
||||
@Resource
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
@Resource
|
||||
private IPmFormDataService iPmFormDataService;
|
||||
|
||||
@Resource
|
||||
private IBsrealStorattrService iBsrealStorattrService;
|
||||
@@ -91,6 +99,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
@Resource
|
||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||
|
||||
@Resource
|
||||
private PmFormDataMapper pmFormDataMapper;
|
||||
|
||||
@Resource
|
||||
private SchBasePointMapper schBasePointMapper;
|
||||
@@ -223,6 +233,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDtl.put("iostorinv_id", iostorinv_id);
|
||||
ioStorInvDtl.put("seq_no", (i + 1) + "");
|
||||
ioStorInvDtl.put("material_id", row.get("material_id"));
|
||||
ioStorInvDtl.put("material_code", row.get("material_code"));
|
||||
ioStorInvDtl.put("Pcsn", row.get("pcsn"));
|
||||
ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
ioStorInvDtl.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
@@ -251,6 +262,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
//暂时只软删除出入库单主表
|
||||
ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class));
|
||||
//先删除该单据下的所有明细
|
||||
ioStorInvDtlMapper.delete(new LambdaQueryWrapper<>(IOStorInvDtl.class).eq(IOStorInvDtl::getIostorinv_id,id));
|
||||
|
||||
ioStorInvDisMapper.delete(new LambdaQueryWrapper<>(IOStorInvDis.class).eq(IOStorInvDis::getIostorinv_id,id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,9 +366,11 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
String sectCode = whereJson.getString("sect_code");
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
|
||||
Sectattr sect = iSectattrService.findById(whereJson.getString("sect_code"));
|
||||
if (ObjectUtil.isEmpty(sect)) {
|
||||
throw new BadRequestException("分配库区不能为空!");
|
||||
}
|
||||
//查询主表信息
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
|
||||
if (ObjectUtil.isEmpty(ioStorInv)) {
|
||||
@@ -362,7 +379,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
//查询生成和未分配完的明细
|
||||
JSONObject queryDtl = new JSONObject();
|
||||
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
||||
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配中"));
|
||||
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
queryDtl.put("iostorinv_id", iostorinv_id);
|
||||
List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl);
|
||||
@@ -375,21 +392,16 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
BigDecimal unassign_qty = dtl.getUnassign_qty();
|
||||
String pcsn = dtl.getPcsn();
|
||||
String material_id = dtl.getMaterial_id();
|
||||
String material_code = dtl.getMaterial_code();
|
||||
// 根据物料和批次号查询库存可用
|
||||
List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv(
|
||||
StrategyStructParam.builder()
|
||||
.qty(unassign_qty)
|
||||
.pcsn(pcsn)
|
||||
.material_code(material_code)
|
||||
.material_id(material_id)
|
||||
.stor_code(ioStorInv.getStor_code())
|
||||
.sect_code(sectCode)
|
||||
.sect_code(sect.getSect_code())
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
List<MdPbStoragevehicleextDto> outAllocationList = mdPbStoragevehicleextMapper.queryOutAllocation(pcsn,material_id);
|
||||
|
||||
int seq_no = 1;
|
||||
BigDecimal allocation_canuse_qty=BigDecimal.ZERO;
|
||||
for (StrategyStructMaterialVO outAllocation : structMaterials) {
|
||||
@@ -542,7 +554,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
String sectCode = whereJson.getString("sect_code");
|
||||
Sectattr sect = iSectattrService.findById(whereJson.getString("sect_code"));
|
||||
if (ObjectUtil.isEmpty(sect)) {
|
||||
throw new BadRequestException("分配库区不能为空!");
|
||||
}
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
//查询主表信息
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
|
||||
@@ -552,7 +567,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
//查询生成和未分配完的明细
|
||||
JSONObject queryDtl = new JSONObject();
|
||||
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
||||
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配中"));
|
||||
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
queryDtl.put("iostorinv_id", iostorinv_id);
|
||||
queryDtl.put("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"));
|
||||
@@ -564,15 +579,15 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
IOStorInvDtlDto dtl = dtls.get(i);
|
||||
BigDecimal unassign_qty = dtl.getUnassign_qty();
|
||||
String pcsn = dtl.getPcsn();
|
||||
String material_code = dtl.getMaterial_code();
|
||||
String material_id = dtl.getMaterial_id();
|
||||
//调用分配规则获取分配的库位:如果库存不足则直接报错
|
||||
List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv(
|
||||
StrategyStructParam.builder()
|
||||
.qty(unassign_qty)
|
||||
.pcsn(pcsn)
|
||||
.material_code(material_code)
|
||||
.material_id(material_id)
|
||||
.stor_code(ioStorInv.getStor_code())
|
||||
.sect_code(sectCode)
|
||||
.sect_code(sect.getSect_code())
|
||||
.build()
|
||||
);
|
||||
int seq_no = 1;
|
||||
@@ -584,12 +599,11 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setIostorinv_id(dtl.getIostorinv_id());
|
||||
ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id());
|
||||
ioStorInvDis.setSeq_no((seq_no++)+"");
|
||||
ioStorInvDis.setSect_id(outAllocation.getSect_id());
|
||||
ioStorInvDis.setPcsn(outAllocation.getPcsn());
|
||||
ioStorInvDis.setMaterial_id(outAllocation.getMaterial_id());
|
||||
ioStorInvDis.setMaterial_code(outAllocation.getMaterial_code());
|
||||
ioStorInvDis.setSect_name(outAllocation.getSect_name());
|
||||
ioStorInvDis.setSect_code(outAllocation.getSect_code());
|
||||
ioStorInvDis.setSect_id(outAllocation.getSect_id());
|
||||
ioStorInvDis.setSect_name(sect.getSect_name());
|
||||
ioStorInvDis.setSect_code(sect.getSect_code());
|
||||
ioStorInvDis.setStruct_id(outAllocation.getStruct_id());
|
||||
ioStorInvDis.setStruct_name(outAllocation.getStruct_name());
|
||||
ioStorInvDis.setStruct_code(outAllocation.getStruct_code());
|
||||
@@ -725,7 +739,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdPbStoragevehicleextDto> queryAvailableInv(Map whereJson) {
|
||||
public List<JSONObject> queryAvailableInv(Map whereJson) {
|
||||
return mdPbStoragevehicleextMapper.queryAvailableInv(whereJson);
|
||||
}
|
||||
|
||||
@@ -750,7 +764,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
//查询生成和未分配完的明细
|
||||
JSONObject queryDtl = new JSONObject();
|
||||
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
||||
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配中"));
|
||||
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
queryDtl.put("iostorinv_id", iostorinv_id);
|
||||
queryDtl.put("iostorinvdtl_id", row.getString("iostorinvdtl_id"));
|
||||
@@ -760,12 +774,15 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
}
|
||||
|
||||
for (IOStorInvDtlDto dtl:dtls){
|
||||
double unassign_qty = dtl.getUnassign_qty().doubleValue();
|
||||
BigDecimal unassign_qty = dtl.getUnassign_qty();
|
||||
if (unassign_qty.equals(BigDecimal.ZERO)){
|
||||
throw new BadRequestException("已全部分配完,未分配数量为0");
|
||||
}
|
||||
//分配数量
|
||||
double allocation_canuse_qty = 0;
|
||||
BigDecimal allocation_canuse_qty = BigDecimal.ZERO;
|
||||
for (int i = 0; i < rows.size(); i++){
|
||||
JSONObject ivt = rows.getJSONObject(i);
|
||||
double canuse_qty = ivt.getDoubleValue("canuse_qty");
|
||||
BigDecimal qty = ivt.getBigDecimal("qty");
|
||||
//分配明细
|
||||
IOStorInvDis ioStorInvDis = new IOStorInvDis();
|
||||
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
|
||||
@@ -773,7 +790,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id());
|
||||
ioStorInvDis.setSeq_no((i+1)+"");
|
||||
ioStorInvDis.setSect_id(ivt.getString("sect_id"));
|
||||
ioStorInvDis.setPcsn(ivt.getString("pcsn"));
|
||||
ioStorInvDis.setMaterial_code(dtl.getMaterial_code());
|
||||
ioStorInvDis.setMaterial_id(dtl.getMaterial_id());
|
||||
ioStorInvDis.setSect_name(ivt.getString("sect_name"));
|
||||
ioStorInvDis.setSect_code(ivt.getString("sect_code"));
|
||||
@@ -786,26 +803,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name());
|
||||
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||
|
||||
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出
|
||||
// double canuse_qty = outAllocation.getCanuse_qty().doubleValue();
|
||||
// if (unassign_qty-canuse_qty>=0){
|
||||
// ioStorInvDis.setPlan_qty(BigDecimal.valueOf(canuse_qty));
|
||||
// }else {
|
||||
// ioStorInvDis.setPlan_qty(BigDecimal.valueOf(unassign_qty));
|
||||
// }
|
||||
// unassign_qty = unassign_qty-canuse_qty;
|
||||
// if (unassign_qty<0){
|
||||
// unassign_qty=0;
|
||||
// }
|
||||
if (unassign_qty <= 0){
|
||||
throw new BadRequestException("已全部分配完,未分配数量为0");
|
||||
unassign_qty = unassign_qty.subtract(qty);
|
||||
if (unassign_qty.compareTo(BigDecimal.ZERO) <0){
|
||||
unassign_qty = BigDecimal.ZERO;
|
||||
}
|
||||
unassign_qty = unassign_qty-canuse_qty;
|
||||
if (unassign_qty<0){
|
||||
unassign_qty=0;
|
||||
}
|
||||
allocation_canuse_qty = allocation_canuse_qty + canuse_qty;
|
||||
ioStorInvDis.setPlan_qty(BigDecimal.valueOf(canuse_qty));
|
||||
allocation_canuse_qty = allocation_canuse_qty.add(qty);
|
||||
ioStorInvDis.setPlan_qty(qty);
|
||||
|
||||
//锁定货位
|
||||
JSONObject lock_map = new JSONObject();
|
||||
@@ -834,10 +837,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
}
|
||||
|
||||
//更新详情
|
||||
dtl.setBill_status(unassign_qty==0 ? IOSEnum.BILL_STATUS.code("分配完"): IOSEnum.BILL_STATUS.code("分配中"));
|
||||
double assign_qty = allocation_canuse_qty + dtl.getAssign_qty().doubleValue();
|
||||
dtl.setUnassign_qty(BigDecimal.valueOf(unassign_qty));
|
||||
dtl.setAssign_qty(BigDecimal.valueOf(assign_qty));
|
||||
dtl.setBill_status((unassign_qty.compareTo(BigDecimal.ZERO) ==0) ? IOSEnum.BILL_STATUS.code("分配完"): IOSEnum.BILL_STATUS.code("分配中"));
|
||||
dtl.setUnassign_qty(unassign_qty);
|
||||
dtl.setAssign_qty(allocation_canuse_qty.add(dtl.getAssign_qty()));
|
||||
ioStorInvDtlMapper.updateById(dtl);
|
||||
}
|
||||
|
||||
@@ -1163,6 +1165,23 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
// 更新明细表状态
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
//判断是否有源单据,更新源单据
|
||||
if(ObjectUtil.isNotEmpty(ioStorInvDtl.getSource_billdtl_id())){
|
||||
PmFormData form = iPmFormDataService.getById(ioStorInvDtl.getSource_billdtl_id());
|
||||
form.setStatus(IOSEnum.BILL_STATUS.code("完成"));
|
||||
form.setIs_finish("1");
|
||||
form.setAssign_qty(form.getQty());
|
||||
iPmFormDataService.updateById(form);
|
||||
//更新被合单单据
|
||||
if(ObjectUtil.isNotEmpty(form.getMerge_codes())){
|
||||
String[] codes = form.getMerge_codes().split(",");
|
||||
pmFormDataMapper.update(null,new LambdaUpdateWrapper<>(PmFormData.class)
|
||||
.set(PmFormData::getStatus,IOSEnum.BILL_STATUS.code("完成"))
|
||||
.set(PmFormData::getIs_finish,"1")
|
||||
.in(PmFormData::getCode,codes)
|
||||
);
|
||||
}
|
||||
}
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
|
||||
@@ -29,6 +29,8 @@ import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.pm_manage.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
@@ -46,6 +48,7 @@ import org.nl.wms.warehouse_manage.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dto.GroupPlateDto;
|
||||
import org.nl.wms.warehouse_manage.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_manage.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -89,6 +92,9 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
@Resource
|
||||
private MdPbGroupplateServiceImpl mdPbGroupplateService;
|
||||
|
||||
@Resource
|
||||
private IPmFormDataService iPmFormDataService;
|
||||
|
||||
@Override
|
||||
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
@@ -182,16 +188,16 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
ioStorInvDtl.put("seq_no",(i + 1)+"");
|
||||
ioStorInvDtl.put("material_id",row.get("material_id"));
|
||||
ioStorInvDtl.put("material_code",row.get("material_code"));
|
||||
ioStorInvDtl.put("Pcsn",row.get("pcsn"));
|
||||
ioStorInvDtl.put("bill_status",IOSEnum.BILL_STATUS.code("生成"));
|
||||
ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id"));
|
||||
ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name"));
|
||||
ioStorInvDtl.put("source_bill_type",row.get("ext_type"));
|
||||
ioStorInvDtl.put("source_bill_code",row.get("ext_code"));
|
||||
ioStorInvDtl.put("source_bill_type",row.get("source_bill_type"));
|
||||
ioStorInvDtl.put("source_bill_code",row.get("source_bill_code"));
|
||||
ioStorInvDtl.put("source_billdtl_id",row.get("source_billdtl_id"));
|
||||
ioStorInvDtl.put("assign_qty","0");
|
||||
ioStorInvDtl.put("unassign_qty",row.get("qty"));
|
||||
ioStorInvDtl.put("plan_qty",row.get("qty"));
|
||||
Double qty = new Double(String.valueOf(row.get("qty")));
|
||||
ioStorInvDtl.put("unassign_qty",row.get("plan_qty"));
|
||||
ioStorInvDtl.put("plan_qty",row.get("plan_qty"));
|
||||
Double qty = new Double(String.valueOf(row.get("plan_qty")));
|
||||
total_qty = total_qty.add(new BigDecimal(qty));
|
||||
|
||||
//判断该载具编号是否已经存在库内
|
||||
@@ -208,13 +214,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
dis.put("seq_no", 1);
|
||||
dis.put("material_id", row.get("material_id"));
|
||||
dis.put("material_code", row.get("material_code"));
|
||||
dis.put("pcsn", row.get("pcsn"));
|
||||
dis.put("storagevehicle_code", row.get("storagevehicle_code"));
|
||||
dis.put("work_status", IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||
dis.put("is_issued", BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
dis.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
dis.put("qty_unit_name", row.get("qty_unit_name"));
|
||||
dis.put("plan_qty", row.get("qty"));
|
||||
dis.put("plan_qty", row.get("plan_qty"));
|
||||
ioStorInvDisMapper.insert(dis.toJavaObject(IOStorInvDis.class));
|
||||
}
|
||||
io_mst.put("total_qty", total_qty);
|
||||
@@ -239,6 +244,11 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
|
||||
//暂时只软删除出入库单主表
|
||||
ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class));
|
||||
|
||||
//先删除该单据下的所有明细
|
||||
ioStorInvDtlMapper.delete(new LambdaQueryWrapper<>(IOStorInvDtl.class).eq(IOStorInvDtl::getIostorinv_id,id));
|
||||
|
||||
ioStorInvDisMapper.delete(new LambdaQueryWrapper<>(IOStorInvDis.class).eq(IOStorInvDis::getIostorinv_id,id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,13 +297,16 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
ioStorInvDtl.put("iostorinv_id",iostorinv_id);
|
||||
ioStorInvDtl.put("seq_no",(i + 1)+"");
|
||||
ioStorInvDtl.put("material_id",row.get("material_id"));
|
||||
ioStorInvDtl.put("Pcsn",row.get("pcsn"));
|
||||
ioStorInvDtl.put("material_code",row.get("material_code"));
|
||||
ioStorInvDtl.put("bill_status",IOSEnum.BILL_STATUS.code("生成"));
|
||||
ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id"));
|
||||
ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name"));
|
||||
ioStorInvDtl.put("source_bill_type",row.get("source_bill_type"));
|
||||
ioStorInvDtl.put("source_bill_code",row.get("source_bill_code"));
|
||||
ioStorInvDtl.put("source_billdtl_id",row.get("source_billdtl_id"));
|
||||
ioStorInvDtl.put("assign_qty",0);
|
||||
ioStorInvDtl.put("plan_qty",row.get("plan_qty"));
|
||||
ioStorInvDtl.put("unassign_qty",row.get("qty"));
|
||||
ioStorInvDtl.put("unassign_qty",row.get("plan_qty"));
|
||||
|
||||
//判断该载具编号是否已经存在库内
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code")));
|
||||
@@ -309,7 +322,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
dis.put("iostorinvdtl_id", ioStorInvDtl.getString("iostorinvdtl_id"));
|
||||
dis.put("seq_no", 1);
|
||||
dis.put("material_id", row.get("material_id"));
|
||||
dis.put("pcsn", row.get("pcsn"));
|
||||
dis.put("material_code", row.get("material_code"));
|
||||
dis.put("storagevehicle_code", row.get("storagevehicle_code"));
|
||||
dis.put("work_status", IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||
dis.put("is_issued", BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
@@ -653,12 +666,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
// 明细
|
||||
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInvDtl)){
|
||||
throw new BadRequestException("未找到明细");
|
||||
throw new BadRequestException("未找到入库单明细记录");
|
||||
}
|
||||
// 明细
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDis.getIostorinv_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInv)){
|
||||
throw new BadRequestException("未找到明细");
|
||||
throw new BadRequestException("未找到入库单");
|
||||
}
|
||||
// 完成当前分配明细
|
||||
ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
@@ -693,6 +706,14 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty());
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
//判断是否有源单据,更新源单据
|
||||
if(ObjectUtil.isNotEmpty(ioStorInvDtl.getSource_billdtl_id())){
|
||||
PmFormData form = iPmFormDataService.getById(ioStorInvDtl.getSource_billdtl_id());
|
||||
form.setStatus(IOSEnum.BILL_STATUS.code("完成"));
|
||||
form.setIs_finish("1");
|
||||
form.setAssign_qty(form.getQty());
|
||||
iPmFormDataService.updateById(form);
|
||||
}
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
|
||||
@@ -99,9 +99,6 @@ public class UpdateIvtUtils {
|
||||
if (ObjectUtil.isEmpty(where.getString("material_id"))) {
|
||||
throw new BadRequestException("物料标识不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(where.getString("pcsn"))) {
|
||||
throw new BadRequestException("批次不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(where.getString("qty_unit_id"))) {
|
||||
throw new BadRequestException("计量单位标识不能为空!");
|
||||
}
|
||||
@@ -164,7 +161,7 @@ public class UpdateIvtUtils {
|
||||
}
|
||||
// 加冻结数
|
||||
double frozen_qty = NumberUtil.add(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
//extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
@@ -219,7 +216,7 @@ public class UpdateIvtUtils {
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
||||
.eq(GroupPlate::getPcsn, where.getString("pcsn")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
||||
@@ -232,7 +229,6 @@ public class UpdateIvtUtils {
|
||||
// 加可用
|
||||
// double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setFrozen_qty(BigDecimal.ZERO);
|
||||
extDao.setQty(BigDecimal.valueOf(qty));
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
|
||||
@@ -69,16 +69,6 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入批次"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据日期" prop="analyseData">
|
||||
<el-date-picker
|
||||
v-model="query.datepick"
|
||||
@@ -89,50 +79,11 @@
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <template v-for="(col,index) in cols" v-if="hideShowDialog">-->
|
||||
<!-- <el-form-item label="col.lable">-->
|
||||
<!-- <label slot="label">{{ col.lable }}:</label>-->
|
||||
<!-- <el-input v-model="query.form_query[col.value]" :value="col.value" clearable style="width: 210px" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </template>-->
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-s-operation"
|
||||
>
|
||||
全部展开
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-upload2"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- >-->
|
||||
<!-- 导入-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- icon="el-icon-view"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="hideShow"-->
|
||||
<!-- >-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
icon="el-icon-view"
|
||||
size="mini"
|
||||
@click="hideShow"
|
||||
/>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="820px">
|
||||
@@ -241,34 +192,10 @@
|
||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="unit_name" label="单位" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="source_form_date" label="源单日期" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
|
||||
<template slot-scope="scope">
|
||||
<template v-for="item in formStatus">
|
||||
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip :formatter="status_Format" width="120" />
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Classstandard:edit','Classstandard:del']"
|
||||
label="操作"
|
||||
width="120px"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
style="display: inline"
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="scope.row.is_modify === '0'"
|
||||
:disabled-dle="scope.row.is_modify === '0'"
|
||||
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -281,14 +208,11 @@
|
||||
import crudFormData from './formData'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
import udOperation from '@crud/UD.operation.vue'
|
||||
import rrOperation from '@crud/RR.operation.vue'
|
||||
import pagination from '@crud/Pagination.vue'
|
||||
// import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import ViewDialog from './ViewDialog.vue'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
// import UploadDialog from './UploadDialog'
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
code: null,
|
||||
@@ -314,7 +238,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'FormData',
|
||||
dicts: ['base_data', 'ST_INV_IN_TYPE', 'INANDOUT_BILL_TYPE', 'io_bill_status'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, ViewDialog, MaterDialog },
|
||||
components: { pagination, crudOperation, rrOperation, ViewDialog, MaterDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -324,7 +248,7 @@ export default {
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudFormData },
|
||||
optShow: {
|
||||
add: true,
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
@@ -390,17 +314,6 @@ export default {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
// if (this.fromTypes.length > 0) {
|
||||
// // formstruc.getHeader(this.query.form_type).then(res => {
|
||||
// // this.cols = res
|
||||
// // res.forEach(a => {
|
||||
// // this.form.form_data[a.value, '']
|
||||
// // this.$set(this.query, 'form_query', {})
|
||||
// // })
|
||||
// // })
|
||||
// // return true
|
||||
// }
|
||||
// return false
|
||||
},
|
||||
bill_typeFormat(row, column) {
|
||||
return this.dict.label.INANDOUT_BILL_TYPE[row.form_type]
|
||||
@@ -416,21 +329,9 @@ export default {
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.unit_id = row.base_unit_id
|
||||
},
|
||||
// getFromTypes() {
|
||||
// crudFormData.getParentFormTypes().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
|
||||
// this.fromTypes = res
|
||||
// if (this.fromTypes.length > 0) {
|
||||
// this.$set(this.query, 'form_type', this.fromTypes[0].value)
|
||||
// this.crud.toQuery()
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// hideShow() {
|
||||
// if (this.hideShowDialog) {
|
||||
// // this.$set(this.query, 'form_query', {})
|
||||
// }
|
||||
// this.hideShowDialog = !this.hideShowDialog
|
||||
// },
|
||||
status_Format(row, column) {
|
||||
return this.dict.label.io_bill_status[row.status]
|
||||
},
|
||||
toView(row) {
|
||||
if (row !== null) {
|
||||
this.$refs.viewDialog.setForm(row)
|
||||
|
||||
@@ -171,14 +171,15 @@ export default {
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
form_type: '1001'
|
||||
form_type: '1001',
|
||||
is_finish: '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rows : [],
|
||||
rows: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,15 +130,15 @@
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="ext_code" label="源单号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="ext_type" label="源单类型" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" fixed="right">
|
||||
<el-table-column type="index" label="序号" min-width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip min-width="150" prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip min-width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip min-width="150" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="170" prop="plan_qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip min-width="170" prop="qty_unit_name" label="计量单位名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="150" prop="source_bill_code" label="源单号" />
|
||||
<el-table-column show-overflow-tooltip min-width="150" prop="source_bill_type" label="源单类型" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" min-width="120" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
@@ -157,7 +157,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/st/inbill/AddDtl'
|
||||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||||
@@ -234,12 +233,8 @@ export default {
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 获取入库单明细
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
|
||||
debugger
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToAdd]() {
|
||||
@@ -251,11 +246,6 @@ export default {
|
||||
this.mater_btn = true
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="plan_qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
|
||||
<el-table-column prop="ext_code" label="来源单号" :min-width="flexWidth('ext_code',crud.data,'来源单号')" />
|
||||
<el-table-column prop="ext_type" label="来源单据类型" :min-width="flexWidth('ext_type',crud.data,'来源单据类型')" />
|
||||
<el-table-column prop="source_bill_code" label="来源单号" :min-width="flexWidth('source_bill_code',crud.data,'来源单号')" />
|
||||
<el-table-column prop="source_bill_type" label="来源单据类型" :min-width="flexWidth('source_bill_type',crud.data,'来源单据类型')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
show-overflow-tooltip
|
||||
prop="plan_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="重量"
|
||||
label="数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
|
||||
|
||||
@@ -141,13 +141,13 @@
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="190" align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="50" align="center" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="190" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
|
||||
<el-table-column prop="plan_qty" label="数量" width="150" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="plan_qty" label="数量" min-width="150" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" min-width="150" align="center" />
|
||||
<el-table-column prop="source_bill_code" label="用料清单号" :min-width="flexWidth('source_bill_code',crud.data,'用料清单号')" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" fixed="right">
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" min-width="120" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
</template>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<span class="role-span">出库明细</span>
|
||||
<div class="crud-opts-form">
|
||||
<el-form ref="form" :inline="true" :model="form" size="mini">
|
||||
<el-form-item label="库区" prop="gender2">
|
||||
<el-form-item label="分配库区" prop="gender2">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
:options="sects"
|
||||
@@ -220,11 +220,6 @@
|
||||
<el-table-column show-overflow-tooltip prop="insert_time" width="150px" label="入库时间" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" width="150px" label="任务号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_code" width="150px" label="出库点" align="center" />
|
||||
<el-table-column align="center" label="操作" width="120" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<StructIvt :dialog-show.sync="structshow" :stor-id="storId" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl2" />
|
||||
@@ -365,11 +360,6 @@ export default {
|
||||
return true
|
||||
}
|
||||
},
|
||||
deleteRow(row) {
|
||||
checkoutbill.oneCancel(row).then(res => {
|
||||
this.queryTableDtl()
|
||||
})
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="可出重量" align="center" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
@@ -187,15 +187,15 @@ export default {
|
||||
}
|
||||
row.edit = !row.edit
|
||||
if (row.edit) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.qty)
|
||||
} else {
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.qty)
|
||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||
} else {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.qty)
|
||||
}
|
||||
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
||||
|
||||
Reference in New Issue
Block a user