fix:入库 add:出入库记录
This commit is contained in:
@@ -1,14 +1,25 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -33,12 +44,39 @@ public class GroupController {
|
||||
@Resource
|
||||
private final IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbGroupplateService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增组盘组盘")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
||||
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
||||
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
||||
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
||||
{
|
||||
iMdPbStoragevehicleinfoService.getByCode(storagevehicleCode);
|
||||
int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
if (has>0){
|
||||
throw new BadRequestException("当前载具组盘信息已存在");
|
||||
}
|
||||
}
|
||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||
groupPlate.setCreate_time(DateUtil.now());
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
iMdPbGroupplateService.save(groupPlate);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除组盘")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
|
||||
@@ -64,6 +64,11 @@ public class SectattrController {
|
||||
public ResponseEntity<Object> querySect(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iSectattrService.getSect(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/getSectCode")
|
||||
@Log("查询库区下拉框")
|
||||
public ResponseEntity<Object> querySectCode(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iSectattrService.getSectCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改库区状态")
|
||||
|
||||
@@ -59,6 +59,7 @@ public interface ISectattrService extends IService<Sectattr> {
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
JSONObject getSect(Map whereJson);
|
||||
JSONObject getSectCode(Map whereJson);
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -120,4 +121,10 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
* 入库规则
|
||||
*/
|
||||
List<Structattr> inBoundSectDiv(StrategyStructParam param);
|
||||
|
||||
/**
|
||||
* 生成库存变动记录表,更新载具冻结数量
|
||||
* @param changeDto
|
||||
*/
|
||||
void changeStruct(StructattrChangeDto changeDto);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public class StrategyStructParam {
|
||||
* 仓位编码
|
||||
*/
|
||||
private String stor_code;
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.nl.wms.basedata_manage.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StructattrChangeDto {
|
||||
String inv;
|
||||
String structCode;
|
||||
String storagevehicleCode;
|
||||
Boolean inBound;
|
||||
String taskType;
|
||||
}
|
||||
@@ -152,7 +152,6 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
@Override
|
||||
public JSONObject getSect(Map whereJson) {
|
||||
JSONArray new_ja = new JSONArray();
|
||||
|
||||
String is_materialstore = (String) whereJson.get("is_materialstore");
|
||||
String is_virtualstore = (String) whereJson.get("is_virtualstore");
|
||||
String is_semi_finished = (String) whereJson.get("is_semi_finished");
|
||||
@@ -209,6 +208,65 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getSectCode(Map whereJson) {
|
||||
JSONArray new_ja = new JSONArray();
|
||||
String is_materialstore = (String) whereJson.get("is_materialstore");
|
||||
String is_virtualstore = (String) whereJson.get("is_virtualstore");
|
||||
String is_semi_finished = (String) whereJson.get("is_semi_finished");
|
||||
String is_productstore = (String) whereJson.get("is_productstore");
|
||||
String is_attachment = (String) whereJson.get("is_attachment");
|
||||
String is_reversed = (String) whereJson.get("is_reversed");
|
||||
String sect_type_attr = (String) whereJson.get("sect_type_attr");
|
||||
String stor_id = (String) whereJson.get("stor_id");
|
||||
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.select(BsrealStorattr::getStor_id, BsrealStorattr::getStor_code, BsrealStorattr::getStor_name)
|
||||
.eq(StrUtil.isNotEmpty(is_materialstore),BsrealStorattr::getIs_materialstore,is_materialstore)
|
||||
.eq(StrUtil.isNotEmpty(is_virtualstore),BsrealStorattr::getIs_virtualstore,is_virtualstore)
|
||||
.eq(StrUtil.isNotEmpty(is_semi_finished),BsrealStorattr::getIs_materialstore,is_semi_finished)
|
||||
.eq(StrUtil.isNotEmpty(is_productstore),BsrealStorattr::getIs_materialstore,is_productstore)
|
||||
.eq(StrUtil.isNotEmpty(is_attachment),BsrealStorattr::getIs_materialstore,is_attachment)
|
||||
.eq(StrUtil.isNotEmpty(is_reversed),BsrealStorattr::getIs_materialstore,is_reversed)
|
||||
.eq(StrUtil.isNotEmpty(stor_id),BsrealStorattr::getStor_id,stor_id)
|
||||
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(BsrealStorattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是")
|
||||
);
|
||||
|
||||
List<BsrealStorattr> bsrealStorattrList = iBsrealStorattrService.list(queryWrapper);
|
||||
|
||||
for (int i = 0; i < bsrealStorattrList.size(); i++) {
|
||||
BsrealStorattr stor_jo = bsrealStorattrList.get(i);
|
||||
JSONObject stor_cas = new JSONObject();
|
||||
stor_cas.put("value", stor_jo.getStor_code());
|
||||
stor_cas.put("label", stor_jo.getStor_name());
|
||||
|
||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.select(Sectattr::getSect_id,Sectattr::getSect_code,Sectattr::getSect_name)
|
||||
.eq(StrUtil.isNotEmpty(stor_jo.getStor_id()),Sectattr::getStor_code,stor_jo.getStor_code())
|
||||
.eq(StrUtil.isNotEmpty(sect_type_attr),Sectattr::getSect_type_attr,sect_type_attr)
|
||||
.eq(Sectattr::getIs_delete,BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(Sectattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
);
|
||||
|
||||
if (!sectattrList.isEmpty()) {
|
||||
JSONArray sect_ja = new JSONArray();
|
||||
for (int j = 0; j < sectattrList.size(); j++) {
|
||||
Sectattr sect_jo = sectattrList.get(j);
|
||||
JSONObject sect_cas = new JSONObject();
|
||||
sect_cas.put("value", sect_jo.getSect_code());
|
||||
sect_cas.put("label", sect_jo.getSect_name());
|
||||
sect_ja.add(sect_cas);
|
||||
}
|
||||
stor_cas.put("children", sect_ja);
|
||||
}
|
||||
new_ja.add(stor_cas);
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("content", new_ja);
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(JSONObject json) {
|
||||
|
||||
@@ -31,11 +31,16 @@ import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.StructattrMapper;
|
||||
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.decision_manage.service.sectStrategy.IStSectStrategyService;
|
||||
import org.nl.wms.decision_manage.service.sectStrategy.dao.StSectStrategy;
|
||||
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.warehouse_management.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -73,6 +78,12 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
@Autowired
|
||||
private IStSectStrategyService iStSectStrategyService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService stIvtStructivtflowService;
|
||||
|
||||
@Override
|
||||
public IPage<Structattr> queryAll(Map whereJson, PageQuery page) {
|
||||
|
||||
@@ -403,4 +414,60 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeStruct(StructattrChangeDto changeDto) {
|
||||
String now = DateUtil.now();
|
||||
UpdateWrapper<Structattr> wrapper = new UpdateWrapper<Structattr>()
|
||||
.set("update_time", now)
|
||||
.set("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||
.eq("struct_code", changeDto.getStructCode());
|
||||
//如果是整出
|
||||
if (!changeDto.getInBound()) {
|
||||
wrapper.set("storagevehicle_code", null);
|
||||
}
|
||||
this.update(wrapper);
|
||||
List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>()
|
||||
.eq("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||
.lt("status", IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
List<StIvtStructivtflow> records = new ArrayList<>();
|
||||
//更新冻结数量
|
||||
Structattr structattr = this.getByCode(changeDto.getStructCode());
|
||||
for (GroupPlate vehicleMater : groupPlates) {
|
||||
String vehicleCode = vehicleMater.getStoragevehicle_code();
|
||||
BigDecimal subtract = vehicleMater.getQty().subtract(vehicleMater.getFrozen_qty());
|
||||
//100-出50 = 50
|
||||
//如果出库是手持库出确认则不在这边变动组盘信息
|
||||
if (!changeDto.getInBound()){
|
||||
UpdateWrapper<GroupPlate> update = new UpdateWrapper<GroupPlate>()
|
||||
.set("frozen_qty", 0)
|
||||
.set("qty", subtract)
|
||||
.set("update_time", now)
|
||||
.set("status", IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
.eq("group_id", vehicleMater.getGroup_id());
|
||||
iMdPbGroupplateService.update(update);
|
||||
}
|
||||
StIvtStructivtflow record = new StIvtStructivtflow();
|
||||
record.setId(IdUtil.getStringId());
|
||||
record.setUpdate_time(now);
|
||||
record.setVehicle_code(vehicleCode);
|
||||
record.setMaterial_id(vehicleMater.getMaterial_id());
|
||||
record.setPcsn(vehicleMater.getPcsn());
|
||||
record.setQty(vehicleMater.getQty());
|
||||
record.setChange_qty(subtract);
|
||||
record.setTask_type(changeDto.getTaskType());
|
||||
record.setFrozen_qty(vehicleMater.getFrozen_qty());
|
||||
record.setSource_form_id(changeDto.getInv());
|
||||
record.setUnit_id(vehicleMater.getQty_unit_id());
|
||||
record.setStruct_code(changeDto.getStructCode());
|
||||
record.setStor_code(structattr.getStor_code());
|
||||
record.setSect_code(structattr.getSect_code());
|
||||
record.setGrowth(changeDto.getInBound());
|
||||
records.add(record);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(records)){
|
||||
stIvtStructivtflowService.saveBatch(records);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class AlleyAveRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
public List<Structattr> handler(List<Structattr> list, JSONObject param) {
|
||||
// 判断仓位是否为空
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new BadRequestException("均衡策略结果:载具号:" + param.getString("vehicle_code") + "当前分配策略无可用货位");
|
||||
throw new BadRequestException("均衡策略结果:载具号:" + param.getString("storagevehicle_code") + "当前分配策略无可用货位");
|
||||
}
|
||||
long startTime1 = System.currentTimeMillis();
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.warehouse_management.record.controller;
|
||||
|
||||
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.warehouse_management.record.service.dto.StructIvtFlowQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/stIvtStructivtflow")
|
||||
public class StIvtStructivtflowController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService stIvtStructivtflowService;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(StructIvtFlowQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(stIvtStructivtflowService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.warehouse_management.record.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_management.record.service.dto.StructIvtFlowQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
public interface IStIvtStructivtflowService extends IService<StIvtStructivtflow> {
|
||||
|
||||
Object pageQuery(StructIvtFlowQuery query, PageQuery page);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.nl.wms.warehouse_management.record.service.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.common.domain.handler.FastjsonSortTypeHandler;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "st_ivt_structivtflow", autoResultMap = true)
|
||||
public class StIvtStructivtflow implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录标识
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 总库存
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 变动库存
|
||||
*/
|
||||
private BigDecimal change_qty;
|
||||
|
||||
/**
|
||||
* 冻结库存
|
||||
*/
|
||||
private BigDecimal frozen_qty;
|
||||
|
||||
/**
|
||||
* 载具物料参数
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonSortTypeHandler.class)
|
||||
private JSONObject vehicle_form_data;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String source_form_type;
|
||||
|
||||
/**
|
||||
* 单据表名
|
||||
*/
|
||||
private String source_form_id;
|
||||
|
||||
/**
|
||||
* 变动类型1入库0出库
|
||||
*/
|
||||
private String task_type;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 库存增加
|
||||
*/
|
||||
private Boolean growth;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.warehouse_management.record.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_management.record.service.dto.StructIvtFlowQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
public interface StIvtStructivtflowMapper extends BaseMapper<StIvtStructivtflow> {
|
||||
|
||||
List<Map> getPageQuery(@Param("query") StructIvtFlowQuery query, PageQuery pageQuery);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.warehouse_management.record.service.dao.mapper.StIvtStructivtflowMapper">
|
||||
<select id="getPageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
struct_flow.*,
|
||||
struct.struct_name,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
unit.unit_name
|
||||
FROM
|
||||
st_ivt_structivtflow struct_flow
|
||||
left join st_ivt_structattr struct on struct.struct_code = struct_flow.struct_code
|
||||
left join md_me_materialbase material on struct_flow.material_id = material.material_id
|
||||
left join md_pb_measureunit unit on struct_flow.unit_id = unit.measure_unit_id
|
||||
<where>
|
||||
<if test="query.search != null and query.search != ''">
|
||||
and (struct.struct_code LIKE '%${query.search}%'
|
||||
or struct.struct_name LIKE '%${query.search}%')
|
||||
</if>
|
||||
<if test="query.material_code != null and query.material_code != ''">
|
||||
and material.material_code LIKE '%${query.material_code}%'
|
||||
</if>
|
||||
<if test="query.vehicle_code != null and query.vehicle_code != ''">
|
||||
and struct_flow.vehicle_code LIKE '%${query.vehicle_code}%'
|
||||
</if>
|
||||
<if test="query.pcsn != null and query.pcsn != ''">
|
||||
and struct_flow.pcsn = '${query.pcsn}'
|
||||
</if>
|
||||
<if test="query.start_time != null and query.start_time != ''">
|
||||
and struct_flow.update_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null and query.end_time != ''">
|
||||
and #{query.end_time} >= struct_flow.update_time
|
||||
</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.nl.wms.warehouse_management.record.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.warehouse_management.record.service.dao.StIvtStructivtflow;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class StructIvtFlowQuery extends BaseQuery<StIvtStructivtflow> {
|
||||
|
||||
private String search;
|
||||
private String material_code;
|
||||
private String vehicle_code;
|
||||
private String pcsn;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.warehouse_management.record.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.warehouse_management.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_management.record.service.dao.mapper.StIvtStructivtflowMapper;
|
||||
import org.nl.wms.warehouse_management.record.service.dto.StructIvtFlowQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
@Service
|
||||
public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflowMapper, StIvtStructivtflow> implements IStIvtStructivtflowService {
|
||||
|
||||
@Override
|
||||
public Object pageQuery(StructIvtFlowQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getPageQuery(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
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.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
@@ -349,6 +350,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
if (ObjectUtil.isNotEmpty(checked) && checked) {
|
||||
param.put("qty", map.get("plan_qty"));
|
||||
param.put("material_code", map.get("material_code"));
|
||||
param.put("storagevehicle_code", map.get("storagevehicle_code"));
|
||||
param.put("pcsn", map.get("pcsn"));
|
||||
param.put("ioType", StatusEnum.STRATEGY_TYPE.code("入库"));
|
||||
Structattr struct = getStructattr(param);
|
||||
@@ -445,6 +447,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
.ioType(param.getString("ioType"))
|
||||
.sect_code(param.getString("sect_code"))
|
||||
.stor_code(param.getString("stor_code"))
|
||||
.storagevehicle_code(param.getString("storagevehicle_code"))
|
||||
.material_code(param.getString("material_code"))
|
||||
.qty(new BigDecimal(param.getString("qty")))
|
||||
.pcsn(param.getString("pcsn"))
|
||||
@@ -658,19 +661,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
finish_map.put("inv_id", null);
|
||||
finish_map.put("inv_code", null);
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
|
||||
//修改库存
|
||||
// List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
// JSONObject jsonIvt = new JSONObject();
|
||||
// jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
||||
// jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
// jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||
// jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||
// jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||
// jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
// jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
// updateIvtList.add(jsonIvt);
|
||||
// iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
//库存变动
|
||||
StructattrChangeDto changeDto = StructattrChangeDto.builder()
|
||||
.inv(ioStorInvDis.getIostorinv_id())
|
||||
.storagevehicleCode(ioStorInvDis.getStoragevehicle_code())
|
||||
.structCode(ioStorInvDis.getStruct_code()).taskType(task.getConfig_code()).inBound(true).build();
|
||||
iStructattrService.changeStruct(changeDto);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
||||
|
||||
@@ -9,10 +9,10 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:P@ssw0rd.}
|
||||
# 初始连接数
|
||||
initial-size: 15
|
||||
# 最小连接数
|
||||
|
||||
@@ -2,45 +2,46 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料查询">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
物料查询:
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
批次查询:
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码">
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
载具编码:
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="载具编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
组盘状态:
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
@@ -52,13 +53,93 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--新增表格-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1200px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code" >
|
||||
<el-input v-model="form.material_code" @focus="getMaterial" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input disabled v-model="form.material_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格" prop="material_spec">
|
||||
<label slot="label">规 格</label>
|
||||
<el-input disabled v-model="form.material_spec" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||
<label slot="label">载具编码</label>
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料批号" prop="pcsn">
|
||||
<el-input v-model="form.pcsn" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料数量" prop="qty">
|
||||
<el-input-number v-model="form.qty" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位" prop="qty_unit_name">
|
||||
<el-select
|
||||
v-model="form.qty_unit_name"
|
||||
style="width: 100px"
|
||||
placeholder=""
|
||||
@change="unitChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableEnum.md_pb_measureunit"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value+'@'+item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="源单号" prop="ext_code">
|
||||
<el-input v-model="form.ext_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="源单类型" prop="ext_type">
|
||||
<el-input v-model="form.ext_type" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -96,6 +177,8 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<!--放引用的组件-->
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -106,11 +189,14 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
||||
|
||||
const defaultForm = {
|
||||
group_id: null,
|
||||
storagevehicle_code: null,
|
||||
material_id: null,
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
pcsn: null,
|
||||
qty_unit_id: null,
|
||||
qty_unit_name: null,
|
||||
@@ -125,8 +211,9 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Group',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
||||
// 数据字典
|
||||
dicts: ['is_used', 'GROUP_STATUS'],
|
||||
cruds() {
|
||||
@@ -134,7 +221,7 @@ export default {
|
||||
title: '组盘记录',
|
||||
url: 'api/group',
|
||||
optShow: {
|
||||
add: false,
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
idField: 'group_id',
|
||||
@@ -145,6 +232,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
materialDialog: false,
|
||||
classes: [],
|
||||
rules: {
|
||||
}
|
||||
@@ -157,6 +245,20 @@ export default {
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.GROUP_STATUS[row.status]
|
||||
},
|
||||
getMaterial() {
|
||||
this.materialDialog = true
|
||||
},
|
||||
unitChange(row) {
|
||||
const split = row.split('@')
|
||||
this.form.qty_unit_id = split[0]
|
||||
this.form.qty_unit_name = split[1]
|
||||
},
|
||||
materialChoose(row) {
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_spec = row.material_spec
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
153
nladmin-ui/src/views/wms/basedata/material/MaterialDialog.vue
Normal file
153
nladmin-ui/src/views/wms/basedata/material/MaterialDialog.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="物料选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" width="140" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip/>
|
||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||
<el-table-column prop="unit_name" label="计量单位" />
|
||||
<el-table-column prop="product_series_name" label="系列" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'MaterialDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({ title: '物料选择', url: 'api/Materia', optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('materialChoose', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选物料')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('materialChoose', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -32,6 +32,15 @@ export function getSect(params) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getSectCode(params) {
|
||||
return request({
|
||||
url: 'api/sectattr/getSectCode',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/sectattr/changeActive',
|
||||
@@ -40,4 +49,4 @@ export function changeActive(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getSect, changeActive }
|
||||
export default { add, edit, del, getSect, getSectCode,changeActive }
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
: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="pcsn" 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="物料名称" />
|
||||
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||
crudSectattr.getSectCode({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
crudPoint.getPointList().then(res => {
|
||||
@@ -312,6 +312,7 @@ export default {
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
this.sectProp = val
|
||||
debugger
|
||||
if (val.length === 1) {
|
||||
this.stor_code = val[0]
|
||||
this.sect_code = ''
|
||||
@@ -336,6 +337,8 @@ export default {
|
||||
this.form.tableMater[i].sect_name = row.sect_name
|
||||
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
|
||||
}
|
||||
this.form.sect_code = this.sect_code
|
||||
this.form.stor_code = this.stor_code
|
||||
crudRawAssist.divStruct(this.form).then(res => {
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
@@ -369,6 +372,7 @@ export default {
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
if (this.form.checked) {
|
||||
debugger
|
||||
if (!this.sect_code) {
|
||||
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/stIvtStructivtflow',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/stIvtStructivtflow',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/stIvtStructivtflow',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export default {add, edit, del}
|
||||
178
nladmin-ui/src/views/wms/statement/record/index.vue
Normal file
178
nladmin-ui/src/views/wms/statement/record/index.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="仓位信息">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入仓位信息"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码">
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入载具编码"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
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"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column prop="stor_code" label="仓库" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="struct_code" label="仓位编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_code" label="物料编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_name" label="物料名称" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="growth" label="是否增加库存" width="150" show-tooltip-when-overflow>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.growth }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pcsn" label="批次" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="qty" label="总库存" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="frozen_qty" label="冻结库存" show-tooltip-when-overflow />
|
||||
<el-table-column prop="change_qty" label="变动库存" show-tooltip-when-overflow />
|
||||
<el-table-column prop="unit_name" label="单位" show-tooltip-when-overflow />
|
||||
<el-table-column prop="vehicle_form_data" label="物料扩展信息" width="300" show-tooltip-when-overflow />
|
||||
<el-table-column prop="source_form_type" label="单据编号" show-tooltip-when-overflow />
|
||||
<el-table-column prop="source_form_id" label="单据表名" min-width="120" show-tooltip-when-overflow />
|
||||
<el-table-column prop="task_type" show-overflow-tooltip show-tooltip-when-overflow label="变动类型" />
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{ statusEnum.label.TASK_TYPE[scope.row.task_type] }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="update_time" label="修改时间" width="120" show-tooltip-when-overflow />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import curdStructIvtFlow from './curdStructIvtFlow'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
struct_code: null,
|
||||
material_id: null,
|
||||
pcsn: null,
|
||||
qty: true,
|
||||
frozen_qty: null,
|
||||
vehicle_form_data: null,
|
||||
source_form_type: null,
|
||||
source_form_id: null,
|
||||
task_type: null,
|
||||
unit_id: null,
|
||||
update_time: null,
|
||||
growth: null,
|
||||
vehicle_code: null
|
||||
}
|
||||
export default {
|
||||
dicts: [],
|
||||
name: 'StructIvtFlow',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
statusEnums: ['TASK_TYPE'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库存变动记录',
|
||||
url: 'api/stIvtStructivtflow',
|
||||
optShow: {
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...curdStructIvtFlow }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query.datepick) {
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length > 1) {
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
} else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user