add: 出库强制确认

This commit is contained in:
2023-05-26 15:56:06 +08:00
parent ce340a9951
commit 5dc0a51695
17 changed files with 625 additions and 104 deletions

View File

@@ -6,6 +6,7 @@ import java.util.Date;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/** /**
* <p> * <p>
@@ -17,6 +18,7 @@ import lombok.EqualsAndHashCode;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("md_pb_storagevehicleext") @TableName("md_pb_storagevehicleext")
public class MdPbStoragevehicleext implements Serializable { public class MdPbStoragevehicleext implements Serializable {

View File

@@ -72,10 +72,10 @@ public class SectattrController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@GetMapping("/getSect") @PostMapping("/getSect")
@Log("查询库区下拉框") @Log("查询库区下拉框")
@ApiOperation("查询库区下拉框") @ApiOperation("查询库区下拉框")
public ResponseEntity<Object> querySect(@RequestBody(required = false) JSONObject query) { public ResponseEntity<Object> querySect(@RequestBody JSONObject query) {
List<Map> list = isectattrService.getSect(query); List<Map> list = isectattrService.getSect(query);
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
} }

View File

@@ -9,6 +9,7 @@ import java.util.Date;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/** /**
* <p> * <p>
@@ -19,6 +20,7 @@ import lombok.EqualsAndHashCode;
* @since 2023-05-11 * @since 2023-05-11
*/ */
@Data @Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("sch_base_task") @TableName("sch_base_task")
public class SchBaseTask implements Serializable { public class SchBaseTask implements Serializable {

View File

@@ -78,5 +78,29 @@ public class IStivtlostorivnCpOutController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/allCancel")
@Log("全部取消")
@ApiOperation("全部取消")
public ResponseEntity<Object> allCancel(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpOutService.allCancel(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/setPoint")
@Log("设置站点")
@ApiOperation("设置站点")
public ResponseEntity<Object> setPoint(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpOutService.setPoint(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("强制确认")
@ApiOperation("强制确认")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson){
iStIvtIostorinvCpOutService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

View File

@@ -94,4 +94,32 @@ public interface IStIvtIostorinvCpOutService extends IService<StIvtIostorinvCp>
* } * }
*/ */
void allDivIvt(JSONObject whereJson); void allDivIvt(JSONObject whereJson);
/**
* 全部取消
* @param whereJson
* {
* iostorinv_id : 主表标识,
* iostorinvdtl_id : 明细标识,
* }
*/
void allCancel(JSONObject whereJson);
/**
* 设置站点
* @param whereJson
* {
* iostorinvdis_id : 分配标识
* }
*/
void setPoint(JSONObject whereJson);
/**
* 强制确认
* @param whereJson
* {
* iostorinv_id : 主表标识
* }
*/
void confirm(JSONObject whereJson);
} }

View File

@@ -104,7 +104,6 @@ public class StIvtIostorinvdisCp implements Serializable {
/** /**
* 执行状态 * 执行状态
*/ */
@Deprecated
private String work_status; private String work_status;
/** /**

View File

@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.productmanage.service.iostorInv.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -11,6 +12,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.nl.common.TableDataInfo; import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.publish.BussEventMulticaster;
import org.nl.common.publish.event.PointEvent;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
@@ -18,18 +21,24 @@ import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService; import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService; import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService; import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr; import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr; import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
import org.nl.wms.scheduler_manage.service.point.ISchBasePointService; import org.nl.wms.scheduler_manage.service.point.ISchBasePointService;
import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService; import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
import org.nl.wms.storage_manage.IOSEnum; import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpOutService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpOutService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdtlCpService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
@@ -47,6 +56,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer;
/** /**
* <p> * <p>
@@ -185,11 +195,29 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
StIvtIostorinvCp mstDao = this.getById(whereJson.getString("iostorinv_id")); StIvtIostorinvCp mstDao = this.getById(whereJson.getString("iostorinv_id"));
// 1.查找出所有需要分配的明细 // 1.查找出所有需要分配的明细
List<StIvtIostorinvdtlCp> dtlDaoList = iostorinvdtlCpService.list(
new QueryWrapper<StIvtIostorinvdtlCp>().lambda() List<StIvtIostorinvdtlCp> dtlDaoList = new ArrayList<>();
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
.orderByAsc(StIvtIostorinvdtlCp::getSeq_no) if (whereJson.getBoolean("type")) {
); dtlDaoList = iostorinvdtlCpService.list(
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
.lt(StIvtIostorinvdtlCp::getBill_status, IOSEnum.BILL_STATUS.code("分配完"))
.orderByAsc(StIvtIostorinvdtlCp::getSeq_no)
);
} else {
dtlDaoList = iostorinvdtlCpService.list(
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
.lt(StIvtIostorinvdtlCp::getBill_status, IOSEnum.BILL_STATUS.code("分配完"))
.orderByAsc(StIvtIostorinvdtlCp::getSeq_no)
);
if (ObjectUtil.isNotEmpty(mstDao))
mstDao = this.getById(dtlDaoList.get(0).getIostorinv_id());
}
if (ObjectUtil.isEmpty(mstDao))
throw new BadRequestException("没有可分配的库存!");
// 2.找库存 // 2.找库存
for (StIvtIostorinvdtlCp dtlDao : dtlDaoList) { for (StIvtIostorinvdtlCp dtlDao : dtlDaoList) {
@@ -200,7 +228,11 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
param.put("sect_id", whereJson.getString("sect_id")); param.put("sect_id", whereJson.getString("sect_id"));
param.put("material_id", dtlDao.getMaterial_id()); param.put("material_id", dtlDao.getMaterial_id());
param.put("sale_id", dtlDao.getSource_billdtl_id()); param.put("sale_id", dtlDao.getSource_billdtl_id());
param.put("rule_type", RuleUtil.PRODUCTION_OUT_1); if (ObjectUtil.isEmpty(dtlDao.getSource_billdtl_id())) {
param.put("rule_type", RuleUtil.PRODUCTION_OUT_2);
} else {
param.put("rule_type", RuleUtil.PRODUCTION_OUT_1);
}
List<StIvtStructivtCp> ivtList = new ArrayList<>(); // 需要更新库存、仓位、插入分配明细的集合 List<StIvtStructivtCp> ivtList = new ArrayList<>(); // 需要更新库存、仓位、插入分配明细的集合
@@ -229,7 +261,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
iostorinvdtlCpService.updateById(dtlDao); iostorinvdtlCpService.updateById(dtlDao);
// 5.更新库存冻结数 、 锁定仓位 // 5.更新库存冻结数 、 锁定仓位
updateIvt(ivtList,mstDao); updateIvtDiv(ivtList,mstDao);
// 6.更新主表 // 6.更新主表
updateMst(mstDao.getIostorinv_id()); updateMst(mstDao.getIostorinv_id());
@@ -237,6 +269,197 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void allCancel(JSONObject whereJson) {
/*
* 1.查找出所有需要取消分配的明细
* 2.删除生成状态中的任务
* 3.更新库存
* 4.更新仓位
* 5.删除分配明细
* 6.更新明细
* 7.更新主表
*
*/
// 1.找出所有分配
List<StIvtIostorinvdisCp> disDaoList = new ArrayList<>();
if (whereJson.getBoolean("type")) {
disDaoList = iostorinvdisCpService.list(
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
.orderByAsc(StIvtIostorinvdisCp::getSeq_no)
);
} else {
disDaoList = iostorinvdisCpService.list(
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
.orderByAsc(StIvtIostorinvdisCp::getSeq_no)
);
}
if (ObjectUtil.isEmpty(disDaoList))
throw new BadRequestException("没有可取消的分配!");
// 判断是否有已经有正在执行中的任务
boolean is_create_task = disDaoList.stream()
.anyMatch(row -> Integer.parseInt(row.getWork_status()) > Integer.parseInt(IOSEnum.WORK_STATUS.code("生成")));
if (is_create_task) throw new BadRequestException("任务已执行或已完成,不可取消!");
// 2.更新库存,删除任务
for (StIvtIostorinvdisCp disDao : disDaoList) {
// 更新库存、更新仓位
updateIvtUnDiv(disDao,ChangeIvtUtil.SUBFROZEN_ADDIVT_QTY);
// 删除任务
iSchBaseTaskService.update(
new SchBaseTask()
.setIs_delete(true),
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getTask_id, disDao.getTask_id())
);
// 3.删除分配
iostorinvdisCpService.removeById(disDao.getIostorinvdis_id());
}
// 4.更新明细
if (!whereJson.getBoolean("type")) {
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getById(whereJson.getString("iostorinvdtl_id"));
dtlDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
dtlDao.setAssign_qty(BigDecimal.valueOf(0));
dtlDao.setUnassign_qty(dtlDao.getReal_qty());
iostorinvdtlCpService.updateById(dtlDao);
// 5.更新主表
updateMst(dtlDao.getIostorinv_id());
} else {
List<StIvtIostorinvdtlCp> dtlDaoList = iostorinvdtlCpService.list(
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
);
for (StIvtIostorinvdtlCp dtlDao : dtlDaoList) {
dtlDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
dtlDao.setAssign_qty(BigDecimal.valueOf(0));
dtlDao.setUnassign_qty(dtlDao.getReal_qty());
iostorinvdtlCpService.updateById(dtlDao);
}
// 5.更新主表
updateMst(whereJson.getString("iostorinv_id"));
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void setPoint(JSONObject whereJson) {
/*
* 1.生成任务
* 2.更新分配状态
*/
// 1.校验是否设置过起点
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
if (ObjectUtil.isNotEmpty(disDao.getPoint_id())) throw new BadRequestException("此明细已生成任务!");
// 2.下发任务
SchBasePoint pointDao = iSchBasePointService.getOne(
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
);
PointEvent event = PointEvent.builder()
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
.point_code1(disDao.getStruct_code())
.point_code2(pointDao.getPoint_code())
.callback((Consumer<String>) disDao::setTask_id)
.build();
BussEventMulticaster.Publish(event);
// 3.更新分配表
iostorinvdisCpService.updateById(
disDao.setPoint_id(pointDao.getPoint_id())
.setPoint_code(pointDao.getPoint_code())
.setPoint_name(pointDao.getPoint_name())
.setWork_status(IOSEnum.WORK_STATUS.code("生成"))
);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirm(JSONObject whereJson) {
// 1.更新主表为完成
StIvtIostorinvCp mstDao = this.getById(whereJson.getString("iostorinv_id"));
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
mstDao.setConfirm_id(SecurityUtils.getCurrentUserId());
mstDao.setConfirm_name(SecurityUtils.getCurrentNickName());
mstDao.setConfirm_time(DateUtil.now());
this.updateById(mstDao);
// 2.判断所有明细是否为分配完
List<StIvtIostorinvdtlCp> dtlDaoList = iostorinvdtlCpService.list(
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
);
boolean is_dis = dtlDaoList.stream()
.anyMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")));
if (!is_dis) throw new BadRequestException("请先分配单据!");
// 3.更新明细表为完成
iostorinvdtlCpService.update(
new StIvtIostorinvdtlCp()
.setBill_status(IOSEnum.BILL_STATUS.code("完成")),
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
);
// 4.更新任务为完成、更新库存、解锁点位
List<StIvtIostorinvdisCp> disDaoList = iostorinvdisCpService.list(
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
);
for (StIvtIostorinvdisCp dao : disDaoList) {
// 1更新任务为完成
SchBaseTask taskDao = iSchBaseTaskService.getById(dao.getTask_id());
if (ObjectUtil.isNotEmpty(taskDao)) {
// 更新有任务分配
if (!StrUtil.equals(taskDao.getTask_id(), TaskStatusEnum.FINISHED.getCode())) {
taskDao.setTask_status(TaskStatusEnum.FINISHED.getCode());
iSchBaseTaskService.updateById(taskDao);
}
}
// 2更新库存
StIvtIostorinvdtlCp dtlDao = dtlDaoList.stream()
.filter(row -> row.getIostorinvdtl_id().equals(dao.getIostorinvdtl_id()))
.findAny().get();
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(dao,ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY,dtlDao.getSource_billdtl_id()));
// 3解锁终点
unLockNext(dao.getStruct_id());
// 4) 更新载具扩展属性
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id(""),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,dao.getStoragevehicle_code())
);
}
}
@NotNull @NotNull
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) { private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
JSONArray rows = whereJson.getJSONArray("tableData"); JSONArray rows = whereJson.getJSONArray("tableData");
@@ -329,8 +552,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
this.updateById(mstDao); this.updateById(mstDao);
} }
private void updateIvt(List<StIvtStructivtCp> ivtList,StIvtIostorinvCp mstDao) { private void updateIvtDiv(List<StIvtStructivtCp> ivtList,StIvtIostorinvCp mstDao) {
/* /*
入库分配
更新库存冻结数 更新库存冻结数
*/ */
for (StIvtStructivtCp ivtDao : ivtList) { for (StIvtStructivtCp ivtDao : ivtList) {
@@ -359,4 +583,64 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
} }
} }
private void updateIvtUnDiv(StIvtIostorinvdisCp dao, String type) {
/*
出库取消
更新库存冻结数
*/
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getById(dao.getIostorinvdtl_id());
// 更新库存
JSONObject param = new JSONObject();
param.put("struct_id", dao.getStruct_id());
param.put("material_id", dao.getMaterial_id());
param.put("pcsn", dao.getPcsn());
param.put("ivt_level", dao.getIvt_level());
param.put("quality_scode", dao.getQuality_scode());
param.put("change_qty", dao.getReal_qty());
param.put("sale_id", dtlDao.getSource_billdtl_id());
param.put("change_type", type);
iStIvtStructivtCpService.UpdateIvt(param);
// 解锁仓位
iStIvtStructattrService.update(
new StIvtStructattr()
.setLock_type("1") // TODO 暂时写死
.setInv_id("")
.setInv_type("")
.setInv_code(""),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, dao.getStruct_id())
);
}
public JSONObject ivtDataParam(StIvtIostorinvdisCp disDao,String change_type,String sale_id) {
JSONObject ivtParam = new JSONObject();
ivtParam.put("struct_id", disDao.getStruct_id());
ivtParam.put("material_id", disDao.getMaterial_id());
ivtParam.put("pcsn", disDao.getPcsn());
ivtParam.put("quality_scode", disDao.getQuality_scode());
ivtParam.put("ivt_level", disDao.getIvt_level());
ivtParam.put("change_qty", disDao.getReal_qty());
ivtParam.put("change_type", change_type);
ivtParam.put("sale_id", sale_id);
return ivtParam;
}
public void unLockNext(String struct_id) {
StIvtStructattr attrDao = iStIvtStructattrService.getById(struct_id);
if (ObjectUtil.isEmpty(attrDao)) throw new BadRequestException("仓位不存在!");
attrDao.setInv_code("");
attrDao.setInv_type("");
attrDao.setInv_id("");
attrDao.setStoragevehicle_code("");
attrDao.setLock_type("1");
iStIvtStructattrService.updateById(attrDao);
}
} }

View File

@@ -431,12 +431,12 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
); );
// 3.更新任务 // 3.更新任务
// iSchBaseTaskService.update( iSchBaseTaskService.update(
// new SchBaseTask().setIs_delete(true), new SchBaseTask().setIs_delete(true),
// new QueryWrapper<SchBaseTask>().lambda() new QueryWrapper<SchBaseTask>().lambda()
// .eq(SchBaseTask::getTask_id, disDao.getTask_id()) .eq(SchBaseTask::getTask_id, disDao.getTask_id())
// .lt(SchBaseTask::getTask_status, TaskStatusEnum.ISSUE.getCode()) .lt(SchBaseTask::getTask_status, TaskStatusEnum.ISSUE.getCode())
// ); );
// 解锁货位 // 解锁货位
iStIvtStructattrService.update( iStIvtStructattrService.update(
@@ -459,6 +459,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
.setSect_code("").setSect_name("") .setSect_code("").setSect_name("")
.setPoint_id("").setPoint_code("") .setPoint_id("").setPoint_code("")
.setPoint_name("") .setPoint_name("")
.setWork_status(IOSEnum.WORK_STATUS.code("生成"))
); );
// 5.更新明细 // 5.更新明细
@@ -503,8 +504,8 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
PointEvent event = PointEvent.builder() PointEvent event = PointEvent.builder()
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode()) .type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
.point_code1(disDao.getStruct_code()) .point_code2(disDao.getStruct_code())
.point_code2(pointDao.getPoint_code()) .point_code1(pointDao.getPoint_code())
.callback((Consumer<String>) disDao::setTask_id) .callback((Consumer<String>) disDao::setTask_id)
.build(); .build();
BussEventMulticaster.Publish(event); BussEventMulticaster.Publish(event);
@@ -514,6 +515,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
disDao.setPoint_id(pointDao.getPoint_id()) disDao.setPoint_id(pointDao.getPoint_id())
.setPoint_code(pointDao.getPoint_code()) .setPoint_code(pointDao.getPoint_code())
.setPoint_name(pointDao.getPoint_name()) .setPoint_name(pointDao.getPoint_name())
.setWork_status(IOSEnum.WORK_STATUS.code("生成"))
); );
} }

View File

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
/** /**
* <p> * <p>
@@ -64,6 +65,14 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
// 加冻结、减可用 // 加冻结、减可用
addFrozenSubQty(json); addFrozenSubQty(json);
break; break;
case ChangeIvtUtil.SUBFROZEN_ADDIVT_QTY:
// 减冻结、加可用
subFrozenAddQty(json);
break;
case ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY:
// 减冻结、减库存
subFrozenSubQty(json);
break;
default: default:
throw new BadRequestException("变动类型异常!"); throw new BadRequestException("变动类型异常!");
} }
@@ -191,12 +200,22 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
*/ */
private void addFrozenSubQty(JSONObject json) { private void addFrozenSubQty(JSONObject json) {
// 找到对应库存 // 找到对应库存
StIvtStructivtCp ivtDao = this.getOne( StIvtStructivtCp ivtDao = new StIvtStructivtCp();
new QueryWrapper<StIvtStructivtCp>().lambda() if (ObjectUtil.isEmpty(json.getString("sale_id"))) {
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id")) ivtDao = this.getOne(
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id")) new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getSale_id,json.getString("sale_id")) .eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
); .eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getPcsn, json.getString("pcsn"))
);
} else {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getSale_id,json.getString("sale_id"))
);
}
if (ObjectUtil.isEmpty(ivtDao)) throw new BadRequestException("库存异常,请检查!"); if (ObjectUtil.isEmpty(ivtDao)) throw new BadRequestException("库存异常,请检查!");
@@ -212,6 +231,84 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
this.updateById(ivtDao); this.updateById(ivtDao);
} }
/*
减冻结、加可用
*/
private void subFrozenAddQty(JSONObject json) {
// 找到对应库存
StIvtStructivtCp ivtDao = new StIvtStructivtCp();
if (ObjectUtil.isEmpty(json.getString("sale_id"))) {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getPcsn, json.getString("pcsn"))
);
} else {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getSale_id,json.getString("sale_id"))
);
}
if (ObjectUtil.isEmpty(ivtDao)) throw new BadRequestException("库存异常,请检查!");
// 冻结数
double frozen_qty = NumberUtil.sub(ivtDao.getFrozen_qty().doubleValue(), json.getDoubleValue("change_qty"));
// 可用数
double canuse_qty = NumberUtil.add(ivtDao.getCanuse_qty().doubleValue(), json.getDoubleValue("change_qty"));
if (frozen_qty < 0) throw new BadRequestException("库存异常,请检查!");
ivtDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
ivtDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
this.updateById(ivtDao);
}
/*
减冻结、减库存
*/
private void subFrozenSubQty(JSONObject json) {
// 找到对应库存
StIvtStructivtCp ivtDao = new StIvtStructivtCp();
if (ObjectUtil.isEmpty(json.getString("sale_id"))) {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getPcsn, json.getString("pcsn"))
);
} else {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getSale_id,json.getString("sale_id"))
);
}
if (ObjectUtil.isEmpty(ivtDao)) throw new BadRequestException("库存异常,请检查!");
// 冻结数
double frozen_qty = NumberUtil.sub(ivtDao.getFrozen_qty().doubleValue(), json.getDoubleValue("change_qty"));
// 库存数
double ivt_qty = NumberUtil.sub(ivtDao.getIvt_qty().doubleValue(), json.getDoubleValue("change_qty"));
if (frozen_qty < 0) throw new BadRequestException("库存异常,请检查!");
if (frozen_qty == 0 && ivtDao.getCanuse_qty().doubleValue() == 0 && ivt_qty == 0 && ivtDao.getWarehousing_qty().doubleValue() == 0) {
// 删除
this.removeById(ivtDao.getStockrecord_id());
} else {
ivtDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
ivtDao.setIvt_qty(BigDecimal.valueOf(ivt_qty));
this.updateById(ivtDao);
}
}
/* /*
校验数据 校验数据
*/ */

View File

@@ -22,5 +22,15 @@ public class ChangeIvtUtil {
*/ */
public static final String ADDFROZEN_SUBIVT_QTY = "4"; public static final String ADDFROZEN_SUBIVT_QTY = "4";
/*
* 减冻结、加可用
*/
public static final String SUBFROZEN_ADDIVT_QTY = "5";
/*
* 减冻结、减库存
*/
public static final String SUBFROZEN_SUBIVT_QTY = "6";
} }

View File

@@ -14,5 +14,11 @@ public class RuleUtil {
*/ */
public static final String PRODUCTION_OUT_1 = "out_1"; public static final String PRODUCTION_OUT_1 = "out_1";
/*
* 出库分配:
* 根据 仓库、库区、物料找库存
*/
public static final String PRODUCTION_OUT_2 = "out_2";
} }

View File

@@ -77,6 +77,11 @@ public class DivRuleCpServiceImpl implements DivRuleCpService {
throw new BadRequestException("销售单不能为空"); throw new BadRequestException("销售单不能为空");
ivtDao = iStIvtStructivtCpService.queryIvtOutOne(whereJson); ivtDao = iStIvtStructivtCpService.queryIvtOutOne(whereJson);
break; break;
case RuleUtil.PRODUCTION_OUT_2 :
if (ObjectUtil.isEmpty(whereJson.getString("material_id")))
throw new BadRequestException("物料不能为空");
ivtDao = iStIvtStructivtCpService.queryIvtOutOne(whereJson);
break;
} }
return ivtDao; return ivtDao;

View File

@@ -27,7 +27,7 @@ export function edit(data) {
export function getSect(data) { export function getSect(data) {
return request({ return request({
url: 'api/sectattr/getSect', url: 'api/sectattr/getSect',
method: 'get', method: 'post',
data data
}) })
} }

View File

@@ -148,7 +148,7 @@
style="width: 200px;" style="width: 200px;"
> >
<el-option <el-option
v-for="item in this.pointList" v-for="item in pointList"
:key="item.point_code" :key="item.point_code"
:label="item.point_name" :label="item.point_name"
:value="item.point_code" :value="item.point_code"
@@ -167,9 +167,9 @@
type="warning" type="warning"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
@click="allSetPoint" @click="setPoint"
> >
一键设置 设置站点
</el-button> </el-button>
</span> </span>
</div> </div>
@@ -304,7 +304,7 @@ export default {
}) })
const area_type = 'A1_RK01' const area_type = 'A1_RK01'
crudPoint.getPoint({ 'area_type': area_type }).then(res => { crudPoint.getPoint({ 'area_type': area_type }).then(res => {
this.pointlist = res this.pointList = res
}) })
}, },
close() { close() {
@@ -350,9 +350,11 @@ export default {
} }
}, },
handleDtlCurrentChange(current) { handleDtlCurrentChange(current) {
this.currentRow = current
this.queryTableDdis(current) this.queryTableDdis(current)
}, },
handleDisCurrentChange(current) { handleDisCurrentChange(current) {
this.currentDis = current
}, },
queryTableDtl() { queryTableDtl() {
productOut.getIosInvDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => { productOut.getIosInvDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
@@ -367,13 +369,13 @@ export default {
}) })
}, },
allDivIvt() { allDivIvt() {
if (this.mstrow.sect_id === '') { if (this.mstrow.sect_id === undefined) {
this.crud.notify('请选择库区!', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify('请选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
return false return false
} }
this.loadingAlldiv = true this.loadingAlldiv = true
productOut.allDivIvt({ 'iostorinv_id': this.mstrow.iostorinv_id, 'sect_id': this.mstrow.sect_id, 'stor_id': this.mstrow.stor_id }).then(res => { productOut.allDivIvt({ 'iostorinv_id': this.mstrow.iostorinv_id, 'sect_id': this.mstrow.sect_id, 'stor_id': this.mstrow.stor_id, 'type': true }).then(res => {
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.queryTableDtl() this.queryTableDtl()
this.loadingAlldiv = false this.loadingAlldiv = false
@@ -382,30 +384,61 @@ export default {
}) })
}, },
oneDiv() { oneDiv() {
this.loadingAutodiv = true if (this.mstrow.sect_id === undefined) {
if (this.currentRow.iostorinvdtl_id !== null) { this.crud.notify('请选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id return false
productOut.allDivOne(this.mstrow).then(res => {
this.queryTableDtl()
this.loadingAutodiv = false
}).catch(() => {
this.loadingAutodiv = false
})
} }
if (this.currentRow.iostorinvdtl_id === undefined) {
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.loadingAlldiv = true
productOut.allDivIvt({ 'iostorinvdtl_id': this.currentRow.iostorinvdtl_id, 'sect_id': this.mstrow.sect_id, 'stor_id': this.mstrow.stor_id, 'type': false }).then(res => {
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.queryTableDtl()
this.loadingAlldiv = false
}).catch(() => {
this.loadingAlldiv = false
})
}, },
allCancel() { allCancel() {
productOut.allCancel(this.mstrow).then(res => { productOut.allCancel( { 'iostorinv_id': this.mstrow.iostorinv_id, 'type': true }).then(res => {
this.crud.notify('取消成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.queryTableDtl() this.queryTableDtl()
this.tabledis = []
}) })
}, },
oneCancel() { oneCancel() {
if (this.currentRow.iostorinvdtl_id !== null) { if (this.currentRow.iostorinvdtl_id === undefined) {
productOut.allCancel(this.currentRow).then(res => { this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
this.queryTableDtl() return false
})
} }
productOut.allCancel( { 'iostorinvdtl_id': this.currentRow.iostorinvdtl_id, 'type': false }).then(res => {
this.crud.notify('取消成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.queryTableDtl()
this.tabledis = []
})
}, },
setPoint() {
if (this.form2.point_code === '') {
this.crud.notify('请选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.currentDis.iostorinvdis_id === undefined) {
this.crud.notify('请选择分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
productOut.setPoint({ 'iostorinvdis_id': this.currentDis.iostorinvdis_id, 'point_code': this.form2.point_code }).then(res => {
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.queryTableDtl()
this.tabledis = []
})
},
cellStyle({ row, column, rowIndex, columnIndex }) { cellStyle({ row, column, rowIndex, columnIndex }) {
const assign_qty = parseFloat(row.assign_qty) const assign_qty = parseFloat(row.assign_qty)
const plan_qty = parseFloat(row.plan_qty) const plan_qty = parseFloat(row.plan_qty)

View File

@@ -2,7 +2,7 @@
<template> <template>
<el-dialog <el-dialog
append-to-body append-to-body
title="出库详情" title="出库详情"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
destroy-on-close destroy-on-close
fullscreen fullscreen
@@ -14,7 +14,7 @@
<label slot="label">&nbsp;&nbsp;&nbsp;:</label> <label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" /> <el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item> </el-form-item>
<el-form-item label="生产车间"> <el-form-item label="仓 库">
<el-select <el-select
v-model="form.product_code" v-model="form.product_code"
clearable clearable
@@ -32,18 +32,19 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="业务类型" prop="bill_type"> <el-form-item label="业务类型">
<el-select <el-select
v-model="form.bill_type" v-model="form.bill_type"
clearable clearable
filterable filterable
size="mini" size="mini"
:disabled="true"
placeholder="业务类型" placeholder="业务类型"
class="filter-item" class="filter-item"
disabled @change="crud.toQuery"
> >
<el-option <el-option
v-for="item in dict.bill_type" v-for="item in dict.ST_INV_OUT_TYPE"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@@ -60,7 +61,7 @@
disabled disabled
> >
<el-option <el-option
v-for="item in dict.io_bill_status" v-for="item in dict.IO_BILL_STATUS"
:key="item.id" :key="item.id"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@@ -91,7 +92,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span2">库明细</span> <span class="role-span2">库明细</span>
</div> </div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"> <el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染--> <!--表格渲染-->
@@ -107,14 +108,11 @@
@current-change="handleDtlCurrentChange" @current-change="handleDtlCurrentChange"
> >
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" /> <el-table-column min-width="120" 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 min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column prop="pcsn" label="订单号" width="150px" align="center" show-overflow-tooltip /> <el-table-column prop="pcsn" label="订单号" 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="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="qty_unit_name" label="单位" align="center" /> <el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" /> <el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table> </el-table>
@@ -138,11 +136,12 @@
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" /> <el-table-column min-width="120" 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 min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column prop="pcsn" label="订单号" align="center" show-overflow-tooltip /> <el-table-column prop="pcsn" label="订单号" align="center" width="150" />
<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="point_code1" label="起始位置" align="center" />
<el-table-column prop="region_code" label="区域" align="center" show-overflow-tooltip /> <el-table-column prop="point_code2" label="目的位置" align="center" />
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" /> <el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="task_type_name" label="任务类型" align="center" width="150px" />
</el-table> </el-table>
</el-card> </el-card>
</el-dialog> </el-dialog>
@@ -151,14 +150,13 @@
<script> <script>
import { crud } from '@crud/crud' import { crud } from '@crud/crud'
import productOut from '@/views/wms/storage_manage/product/productOut/productout' import crudProductOut from '@/views/wms/storage_manage/product/productOut/productout'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
export default { export default {
name: 'ViewDialog', name: 'ViewDialog',
components: { }, components: { },
mixins: [crud()], mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'bill_type', 'product_area'], dicts: ['ST_INV_OUT_TYPE', 'product_area', 'IO_BILL_STATUS'],
props: { props: {
dialogShow: { dialogShow: {
type: Boolean, type: Boolean,
@@ -173,6 +171,7 @@ export default {
dialogVisible: false, dialogVisible: false,
tableDtl: [], tableDtl: [],
tabledis: [], tabledis: [],
billtypelist: [],
storlist: [], storlist: [],
currentdtl: null, currentdtl: null,
currentDis: {}, currentDis: {},
@@ -191,11 +190,6 @@ export default {
} }
} }
}, },
created() {
crudProductIn.queryStor().then(res => {
this.storlist = res
})
},
methods: { methods: {
open() { open() {
this.queryTableDtl() this.queryTableDtl()
@@ -206,10 +200,10 @@ export default {
this.currentdtl = null this.currentdtl = null
this.tableDtl = [] this.tableDtl = []
this.tabledis = [] this.tabledis = []
this.$emit('AddChanged') this.$emit('TaskChanged')
}, },
bill_statusFormat(row) { stateFormat(row, column) {
return this.dict.label.io_bill_status[row.bill_status] return this.dict.label.IO_BILL_STATUS[row.bill_status]
}, },
taskdtl_typeFormat(row) { taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type] return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
@@ -241,13 +235,13 @@ export default {
this.currentDis = current this.currentDis = current
}, },
queryTableDtl() { queryTableDtl() {
productOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => { crudProductOut.getIosInvDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res this.tableDtl = res
}) })
}, },
queryTableDdis() { queryTableDdis() {
if (this.currentdtl !== null) { if (this.currentdtl !== null) {
productOut.getOutBillDis({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => { crudProductOut.getIosInvDis({ "iostorinvdtl_id": this.currentdtl.iostorinvdtl_id }).then(res => {
this.tabledis = res this.tabledis = res
}).catch(() => { }).catch(() => {
this.tabledis = [] this.tabledis = []

View File

@@ -1,4 +1,3 @@
<!--suppress ALL -->
<template> <template>
<div class="app-container"> <div class="app-container">
<!--工具栏--> <!--工具栏-->
@@ -128,6 +127,32 @@
@select="handleSelectionChange" @select="handleSelectionChange"
@select-all="onSelectAll" @select-all="onSelectAll"
> >
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="单据类型" :formatter="bill_typeFormat" />
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" min-width="120"/>
<!-- <el-table-column prop="" label="生产车间" width="130" show-overflow-tooltip />-->
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column label="总重量" align="center" prop="total_qty">
<template slot-scope="scope">
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<el-table-column label="明细数" align="center" prop="detail_count" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建人" align="center" prop="create_name" />
<el-table-column label="创建时间" align="center" prop="create_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_name" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="分配人" align="center" prop="dis_name" width="140px" />
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_name" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
@@ -138,27 +163,6 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="80" prop="bill_status" label="单据状态" />
<!-- <el-table-column show-overflow-tooltip prop="product_code" label="生产车间" width="80" />-->
<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 label="明细数" align="center" prop="detail_count" width="60" />
<el-table-column show-overflow-tooltip label="总重量" align="center" prop="total_qty" width="100" />
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="create_name" />
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="create_time" width="140" />
<el-table-column show-overflow-tooltip label="修改人" align="center" prop="create_name" />
<el-table-column show-overflow-tooltip label="修改时间" align="center" prop="update_time" width="140" />
<el-table-column show-overflow-tooltip label="分配人" align="center" prop="dis_name" />
<el-table-column show-overflow-tooltip label="分配时间" align="center" prop="dis_time" width="140" />
<el-table-column show-overflow-tooltip label="确认人" align="center" prop="confirm_name" />
<el-table-column show-overflow-tooltip label="确认时间" align="center" prop="confirm_time" width="140" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
@@ -179,7 +183,7 @@ import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/storage_manage/product/productOut/AddDialog' import AddDialog from '@/views/wms/storage_manage/product/productOut/AddDialog'
import DivDialog from '@/views/wms/storage_manage/product/productOut/DivDialog' import DivDialog from '@/views/wms/storage_manage/product/productOut/DivDialog'
import ViewDialog from '@//views/wms/storage_manage/product/productOut/ViewDialog' import ViewDialog from '@//views/wms/storage_manage/product/productOut/ViewDialog'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin' import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
export default { export default {
name: 'ProductOut', name: 'ProductOut',
@@ -230,15 +234,19 @@ export default {
} }
}, },
created() { created() {
crudProductIn.queryStor().then(res => { crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
this.storlist = res this.storlist = res.content
}) })
}, },
methods: { methods: {
fun(val) {
return Number(val).toFixed(3)
},
canUd(row) { canUd(row) {
return row.bill_status !== '10' return row.bill_status !== '10'
}, },
toView(index, row) { toView(row) {
debugger
this.mstrow = row this.mstrow = row
this.viewShow = true this.viewShow = true
}, },
@@ -293,9 +301,9 @@ export default {
return row.bill_status !== '99' return row.bill_status !== '99'
}, },
divOpen() { divOpen() {
productOut.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => { productOut.getIosInvDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res this.openParam = res
this.storId = this.currentRow.product_code this.storId = this.currentRow.stor_id
this.divShow = true this.divShow = true
this.mstrow = this.currentRow this.mstrow = this.currentRow
}) })

View File

@@ -48,11 +48,38 @@ export function allDivIvt(data) {
}) })
} }
export function allCancel(data) {
return request({
url: 'api/productOut/allCancel',
method: 'post',
data
})
}
export function setPoint(data) {
return request({
url: 'api/productOut/setPoint',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: 'api/productOut/confirm',
method: 'post',
data
})
}
export default { export default {
add, add,
edit, edit,
del, del,
getIosInvDtl, getIosInvDtl,
getIosInvDis, getIosInvDis,
allDivIvt allDivIvt,
allCancel,
setPoint,
confirm
} }