add:损益管理
This commit is contained in:
@@ -160,6 +160,7 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
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)
|
||||
@@ -169,6 +170,7 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
.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("是")
|
||||
);
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package org.nl.wms.warehouse_management.controller;
|
||||
|
||||
|
||||
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.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoreorlessmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损益 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/moreorLess")
|
||||
@Slf4j
|
||||
public class MoreOrlessController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtMoreorlessmstService iStIvtMoreorlessmstService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询损益单")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtMoreorlessmstService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增损益单")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MoreOrLessInsertDto dto) {
|
||||
iStIvtMoreorlessmstService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改损益单")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MoreOrLessInsertDto dto) {
|
||||
iStIvtMoreorlessmstService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除损益单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iStIvtMoreorlessmstService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryMolDtl")
|
||||
@Log("查询损益单明细")
|
||||
public ResponseEntity<Object> queryMolDtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtMoreorlessmstService.queryMolDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody StIvtMoreorlessmst dao) {
|
||||
iStIvtMoreorlessmstService.confirm(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,17 @@ package org.nl.wms.warehouse_management.enums;
|
||||
public class IOSConstant {
|
||||
|
||||
/**
|
||||
* 更新库存状态:加可用
|
||||
* 是否删除 否
|
||||
*/
|
||||
public final static String IS_DELETE_NO = "0";
|
||||
|
||||
/**
|
||||
* 是否删除 是
|
||||
*/
|
||||
public final static String IS_DELETE_YES = "1";
|
||||
|
||||
/**
|
||||
* 更新库存状态:加可用(插入数据)
|
||||
*/
|
||||
public final static String UPDATE_IVT_TYPE_ADD_CANUSE = "1";
|
||||
|
||||
@@ -27,6 +37,16 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String UPDATE_IVT_TYPE_SUB_FROZEN_ADD_CANUSE = "4";
|
||||
|
||||
/**
|
||||
* 更新库存状态:加可用(加库存)
|
||||
*/
|
||||
public final static String UPDATE_IVT_TYPE_ADD_CANUSE_IVT = "5";
|
||||
|
||||
/**
|
||||
* 更新库存状态:减可用(减库存)
|
||||
*/
|
||||
public final static String UPDATE_IVT_TYPE_SUB_CANUSE_IVT = "6";
|
||||
|
||||
/**
|
||||
* 移库任务类编码
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,12 @@ public enum IOSEnum {
|
||||
// 移库单明细状态
|
||||
MOVE_DTL_STATUS(MapOf.of("生成", "10", "执行中", "20", "完成", "99")),
|
||||
|
||||
// 损益单状态
|
||||
MORE_MST_STATUS(MapOf.of("生成", "10", "审核", "20", "完成", "99")),
|
||||
|
||||
// 损益类型
|
||||
MORE_TYPE(MapOf.of("损", "1", "溢", "2")),
|
||||
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.warehouse_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessdtl;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface IStIvtMoreorlessdtlService extends IService<StIvtMoreorlessdtl> {
|
||||
|
||||
/**
|
||||
* 创建明细
|
||||
* @param dto 新增修改实体类
|
||||
*/
|
||||
void createMoreDtl(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 查询明细
|
||||
* @param whereJson {
|
||||
* mol_id:标识id
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryMolDtl(Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.warehouse_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface IStIvtMoreorlessmstService extends IService<StIvtMoreorlessmst> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<JSONObject> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增损益单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
void create(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 修改损益单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
void update(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 删除损益单
|
||||
* @param ids id集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 查询损益单明细
|
||||
* @param whereJson {
|
||||
* mol_id: 标识id
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryMolDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
* @param dao 主表实体类
|
||||
*/
|
||||
void confirm(StIvtMoreorlessmst dao);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_moreorlessdtl")
|
||||
public class StIvtMoreorlessdtl implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 损溢单明细id
|
||||
*/
|
||||
@TableId(value = "mol_dtl_id")
|
||||
private String mol_dtl_id;
|
||||
|
||||
/**
|
||||
* 损溢单标识
|
||||
*/
|
||||
private String mol_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private BigDecimal seq_no;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 损溢数量
|
||||
*/
|
||||
private BigDecimal mol_qty;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 来源单编号
|
||||
*/
|
||||
private String source_bill_code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_moreorlessmst")
|
||||
public class StIvtMoreorlessmst implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 损溢单标识
|
||||
*/
|
||||
@TableId(value = "mol_id")
|
||||
private String mol_id;
|
||||
|
||||
/**
|
||||
* 损溢单号
|
||||
*/
|
||||
private String mol_code;
|
||||
|
||||
/**
|
||||
* 损溢单类型
|
||||
*/
|
||||
private String mol_inv_type;
|
||||
|
||||
/**
|
||||
* 损溢类型
|
||||
*/
|
||||
private String mol_type;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private BigDecimal dtl_num;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
private BigDecimal total_qty;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
private String input_optid;
|
||||
|
||||
/**
|
||||
* 制单人姓名
|
||||
*/
|
||||
private String input_optname;
|
||||
|
||||
/**
|
||||
* 制单时间
|
||||
*/
|
||||
private String input_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 确认人
|
||||
*/
|
||||
private String confirm_optid;
|
||||
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
private String confirm_optname;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface StIvtMoreorlessdtlMapper extends BaseMapper<StIvtMoreorlessdtl> {
|
||||
|
||||
/**
|
||||
* 查询明细
|
||||
* @param whereJson {
|
||||
* mol_id 标识id
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryMolDtl(@Param("param") Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.service.dao.mapper.StIvtMoreorlessdtlMapper">
|
||||
|
||||
<select id="queryMolDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dtl.mol_dtl_id,
|
||||
dtl.sect_code,
|
||||
dtl.struct_code,
|
||||
dtl.storagevehicle_code,
|
||||
dtl.material_id,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
dtl.pcsn,
|
||||
dtl.qty_unit_id,
|
||||
dtl.qty_unit_name,
|
||||
dtl.mol_qty,
|
||||
dtl.status,
|
||||
dtl.source_bill_code,
|
||||
ext.canuse_qty AS ivt_qty
|
||||
FROM
|
||||
st_ivt_moreorlessdtl dtl
|
||||
LEFT JOIN st_ivt_moreorlessmst ios ON ios.mol_id = dtl.mol_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
INNER JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = dtl.storagevehicle_code
|
||||
AND ext.material_id = dtl.material_id AND dtl.pcsn = ext.pcsn
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.mol_id != null and param.mol_id != ''">
|
||||
AND
|
||||
ios.mol_id = #{param.mol_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessmst;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
public interface StIvtMoreorlessmstMapper extends BaseMapper<StIvtMoreorlessmst> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page,@Param("param") Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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.service.dao.mapper.StIvtMoreorlessmstMapper">
|
||||
|
||||
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ios.*
|
||||
FROM
|
||||
st_ivt_moreorlessmst ios
|
||||
LEFT JOIN st_ivt_moreorlessdtl dtl ON ios.mol_id = dtl.mol_id
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.mol_code != null and param.mol_code != ''">
|
||||
AND
|
||||
ios.mol_code LIKE #{param.mol_code}
|
||||
</if>
|
||||
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
ios.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
dtl.struct_code LIKE #{param.struct_code}
|
||||
</if>
|
||||
|
||||
<if test="param.mol_type != null and param.mol_type != ''">
|
||||
AND
|
||||
ios.mol_type = #{param.mol_type}
|
||||
</if>
|
||||
|
||||
<if test="param.mol_inv_type != null and param.mol_inv_type != ''">
|
||||
AND
|
||||
ios.mol_inv_type = #{param.mol_inv_type}
|
||||
</if>
|
||||
|
||||
<if test="param.status != null and param.status != ''">
|
||||
AND
|
||||
ios.status = #{param.status}
|
||||
</if>
|
||||
|
||||
<if test="param.begin_time != null and param.begin_time != ''">
|
||||
AND
|
||||
ios.input_time >= #{param.begin_time}
|
||||
</if>
|
||||
<if test="param.end_time != null and param.end_time != ''">
|
||||
AND
|
||||
#{param.end_time} >= ios.input_time
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ios.input_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.nl.wms.warehouse_management.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 损益新增修改dto实体类
|
||||
* @author Liuxy
|
||||
* 2025/5/28
|
||||
*/
|
||||
@Data
|
||||
public class MoreOrLessInsertDto {
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
*/
|
||||
private String mol_id;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String mol_inv_type;
|
||||
|
||||
/**
|
||||
* 损益类型
|
||||
*/
|
||||
private String mol_type;
|
||||
|
||||
/**
|
||||
* 业务日期
|
||||
*/
|
||||
private String biz_date;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private BigDecimal dtl_num;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
private BigDecimal total_qty;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 明细数据:
|
||||
* {
|
||||
* material_code 物料编码
|
||||
* material_id 物料id
|
||||
* material_name 物料名称
|
||||
* pcsn 批次
|
||||
* ivt_qty 库存数量
|
||||
* mol_qty 损益数量
|
||||
* qty_unit_id 计量单位标识
|
||||
* qty_unit_name 计量单位名称
|
||||
* storagevehicle_code 载具编码
|
||||
* sect_code 库区
|
||||
* struct_code 仓位
|
||||
* status 执行状态
|
||||
* remark 备注
|
||||
* source_bill_code 源单据编码(盘点业务使用)
|
||||
* }
|
||||
*/
|
||||
private List<JSONObject> tableData;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoreorlessdtlService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtMoreorlessdtlMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单明细表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class StIvtMoreorlessdtlServiceImpl extends ServiceImpl<StIvtMoreorlessdtlMapper, StIvtMoreorlessdtl> implements IStIvtMoreorlessdtlService {
|
||||
|
||||
@Override
|
||||
public void createMoreDtl(MoreOrLessInsertDto dto) {
|
||||
// 批量新增明细集合
|
||||
List<StIvtMoreorlessdtl> dtlDaoList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dto.getTableData().size(); i++) {
|
||||
JSONObject json = dto.getTableData().get(i);
|
||||
StIvtMoreorlessdtl dao = new StIvtMoreorlessdtl();
|
||||
dao.setMol_dtl_id(IdUtil.getStringId());
|
||||
dao.setMol_id(dto.getMol_id());
|
||||
dao.setSeq_no(BigDecimal.valueOf(i+1));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setSect_code(json.getString("sect_code"));
|
||||
dao.setStoragevehicle_code(json.getString("storagevehicle_code"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setQty_unit_name(json.getString("qty_unit_name"));
|
||||
dao.setMol_qty(json.getBigDecimal("mol_qty"));
|
||||
dao.setStatus(IOSEnum.MORE_MST_STATUS.code("生成"));
|
||||
dao.setSource_bill_code(json.getString("source_bill_code"));
|
||||
dtlDaoList.add(dao);
|
||||
}
|
||||
this.saveBatch(dtlDaoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryMolDtl(Map whereJson) {
|
||||
return this.baseMapper.queryMolDtl(whereJson);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoreorlessdtlService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoreorlessmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtMoreorlessmstMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
import org.nl.wms.warehouse_management.service.util.UpdateIvtUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 损溢单主表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuixy
|
||||
* @since 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class StIvtMoreorlessmstServiceImpl extends ServiceImpl<StIvtMoreorlessmstMapper, StIvtMoreorlessmst> implements IStIvtMoreorlessmstService {
|
||||
|
||||
/**
|
||||
* 损益明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoreorlessdtlService iStIvtMoreorlessdtlService;
|
||||
|
||||
/**
|
||||
* 变更库存工具类
|
||||
*/
|
||||
@Autowired
|
||||
private UpdateIvtUtils updateIvtUtils;
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(MoreOrLessInsertDto dto) {
|
||||
// 主表
|
||||
StIvtMoreorlessmst mstDao = new StIvtMoreorlessmst();
|
||||
mstDao.setMol_id(IdUtil.getStringId());
|
||||
mstDao.setMol_code(CodeUtil.getNewCode("MORE_BILL_CODE"));
|
||||
mstDao.setMol_type(dto.getMol_type());
|
||||
mstDao.setMol_inv_type(dto.getMol_inv_type());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
mstDao.setTotal_qty(dto.getTotal_qty());
|
||||
mstDao.setCreate_mode(dto.getCreate_mode());
|
||||
mstDao.setInput_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setInput_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setInput_time(DateUtil.now());
|
||||
mstDao.setStatus(dto.getStatus());
|
||||
this.save(mstDao);
|
||||
|
||||
// 明细
|
||||
dto.setMol_id(mstDao.getMol_id());
|
||||
iStIvtMoreorlessdtlService.createMoreDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(MoreOrLessInsertDto dto) {
|
||||
StIvtMoreorlessmst mstDao = this.getById(dto.getMol_id());
|
||||
mstDao.setMol_type(dto.getMol_type());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
mstDao.setTotal_qty(dto.getTotal_qty());
|
||||
mstDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setUpdate_time(DateUtil.now());
|
||||
this.updateById(mstDao);
|
||||
|
||||
// 删除老的所有明细
|
||||
iStIvtMoreorlessdtlService.remove(
|
||||
new QueryWrapper<StIvtMoreorlessdtl>().lambda()
|
||||
.eq(StIvtMoreorlessdtl::getMol_id, mstDao.getMol_id())
|
||||
);
|
||||
// 新增明细
|
||||
iStIvtMoreorlessdtlService.createMoreDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
this.update(
|
||||
new UpdateWrapper<StIvtMoreorlessmst>().lambda()
|
||||
.in(StIvtMoreorlessmst::getMol_id,ids)
|
||||
.set(StIvtMoreorlessmst::getIs_delete, IOSConstant.IS_DELETE_YES)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryMolDtl(Map whereJson) {
|
||||
return iStIvtMoreorlessdtlService.queryMolDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirm(StIvtMoreorlessmst dao) {
|
||||
// 更新主表
|
||||
dao.setStatus(IOSEnum.MORE_MST_STATUS.code("完成"));
|
||||
dao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
dao.setConfirm_time(DateUtil.now());
|
||||
this.updateById(dao);
|
||||
// 查询所有明细
|
||||
List<StIvtMoreorlessdtl> dtlDaoList = iStIvtMoreorlessdtlService.list(
|
||||
new QueryWrapper<StIvtMoreorlessdtl>().lambda()
|
||||
.eq(StIvtMoreorlessdtl::getMol_id, dao.getMol_id())
|
||||
);
|
||||
// 更新库存
|
||||
for (StIvtMoreorlessdtl dto : dtlDaoList) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("type", dao.getMol_type().equals(IOSEnum.MORE_TYPE.code("损"))
|
||||
? IOSConstant.UPDATE_IVT_TYPE_SUB_CANUSE_IVT : IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE_IVT);
|
||||
json.put("storagevehicle_code",dto.getStoragevehicle_code());
|
||||
json.put("material_id",dto.getMaterial_id());
|
||||
json.put("pcsn",dto.getPcsn());
|
||||
json.put("qty_unit_id",dto.getQty_unit_id());
|
||||
json.put("qty_unit_name",dto.getQty_unit_name());
|
||||
json.put("change_qty",dto.getMol_qty());
|
||||
json.put("remark","由损益单据【"+dao.getMol_code()+"】变更库存数量【"+dto.getMol_qty()+"】");
|
||||
updateIvtUtils.updateIvt(json);
|
||||
}
|
||||
// 更新明细为完成
|
||||
iStIvtMoreorlessdtlService.update(
|
||||
new UpdateWrapper<StIvtMoreorlessdtl>().lambda()
|
||||
.eq(StIvtMoreorlessdtl::getMol_id, dao.getMol_id())
|
||||
.set(StIvtMoreorlessdtl::getStatus, IOSEnum.MORE_MST_STATUS.code("完成"))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class UpdateIvtUtils {
|
||||
/**
|
||||
* 更新库存
|
||||
* @param where: {
|
||||
* type: 1-加可用,2-加冻结减可用,3-减冻结
|
||||
* type: 1-加可用(插入数据),2-加冻结减可用,3-减冻结,4-减冻结加可用,5-加可用(加库存),6-减可用(减库存)
|
||||
* storagevehicle_code: 载具编码
|
||||
* material_id: 物料标识
|
||||
* pcsn: 批次
|
||||
@@ -51,7 +51,7 @@ public class UpdateIvtUtils {
|
||||
switch (type) {
|
||||
case IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE :
|
||||
// 加可用
|
||||
updateAddCanuseIvt(where);
|
||||
updateAddCanuseInsertIvt(where);
|
||||
break;
|
||||
case IOSConstant.UPDATE_IVT_TYPE_ADD_FROZEN :
|
||||
// 加冻结减可用
|
||||
@@ -65,6 +65,14 @@ public class UpdateIvtUtils {
|
||||
// 减冻结加可用
|
||||
updateSubFrozenAddIvt(where);
|
||||
break;
|
||||
case IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE_IVT :
|
||||
// 加可用(加库存)
|
||||
updateAddCanuseIvt(where);
|
||||
break;
|
||||
case IOSConstant.UPDATE_IVT_TYPE_SUB_CANUSE_IVT :
|
||||
// 减可用(减库存)
|
||||
updateSubCanuseIvt(where);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -100,10 +108,10 @@ public class UpdateIvtUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 加可用
|
||||
* 加可用(插入数据)
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateAddCanuseIvt(JSONObject where) {
|
||||
private void updateAddCanuseInsertIvt(JSONObject where) {
|
||||
// 判断当前载具是否有物料
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
@@ -122,6 +130,7 @@ public class UpdateIvtUtils {
|
||||
extParamDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extParamDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extParamDao.setUpdate_time(DateUtil.now());
|
||||
extParamDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.save(extParamDao);
|
||||
}
|
||||
|
||||
@@ -223,4 +232,55 @@ public class UpdateIvtUtils {
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加可用(加库存)
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateAddCanuseIvt(JSONObject where) {
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】不存在相关物料批次库存,请检查数据!");
|
||||
}
|
||||
|
||||
double canuse_qty = NumberUtil.add(extDao.getCanuse_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
}
|
||||
|
||||
/**
|
||||
* 减可用(减库存)
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateSubCanuseIvt(JSONObject where) {
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】不存在相关物料批次库存,请检查数据!");
|
||||
}
|
||||
|
||||
double canuse_qty = NumberUtil.sub(extDao.getCanuse_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
if (canuse_qty < 0) {
|
||||
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【"+extDao.getCanuse_qty()+"】当前变动数为【"+where.getDoubleValue("change_qty")+"】");
|
||||
}
|
||||
extDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
435
wms/nladmin-ui/src/views/wms/st/moreorlessbill/AddDialog.vue
Normal file
435
wms/nladmin-ui/src/views/wms/st/moreorlessbill/AddDialog.vue
Normal file
@@ -0,0 +1,435 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
fullscreen
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="损溢类型" prop="mol_type">
|
||||
<el-select
|
||||
v-model="form.mol_type"
|
||||
style="width: 210px"
|
||||
clearable
|
||||
class="filter-item"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="typeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_MOL_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model.trim="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
v-if="crud.status.cu > 0"
|
||||
:disabled="form.stor_id === ''"
|
||||
@click="queryStruct()"
|
||||
>
|
||||
选择货位库存
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="struct_code" label="仓位编码" align="center" :min-width="flexWidth('struct_code',crud.data,'仓位编码')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" align="center" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" >
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.storagevehicle_code" size="mini" />
|
||||
<span v-show="scope.row.edit">{{ scope.row.storagevehicle_code }}</span>
|
||||
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.storagevehicle_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" align="center" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次号" align="center" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||
<el-table-column prop="ivt_qty" label="库存重量" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('ivt_qty',crud.data,'库存重量')" />
|
||||
<el-table-column prop="mol_qty" width="220" label="损溢重量" align="center" :min-width="flexWidth('mol_qty',crud.data,'损溢重量')" >
|
||||
<template scope="scope">
|
||||
<el-input-number v-model="scope.row.mol_qty" :disabled="scope.row.edit" :precision="3" :controls="false" :min="0" style="width: 120px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="190" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||
/>
|
||||
<el-button
|
||||
v-show="!scope.row.edit"
|
||||
type="primary"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show="scope.row.edit"
|
||||
type="success"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-check"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
>完成
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<StructDiv ref="child" :sect-prop="defaultList" :dialog-show.sync="structShow" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import crudMoreOrless from '@/views/wms/st/moreorlessbill/moreorless'
|
||||
import StructDiv from '@/views/wms/st/moreorlessbill/StructDiv'
|
||||
|
||||
const defaultForm = {
|
||||
mol_id: '',
|
||||
mol_code: '',
|
||||
mol_type: '',
|
||||
mol_inv_type: '1001',
|
||||
stor_id: '',
|
||||
status: '10',
|
||||
total_qty: '0',
|
||||
dtl_num: '0',
|
||||
remark: '',
|
||||
struct_id: '',
|
||||
create_mode: '1',
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { crudOperation, StructDiv },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['io_bill_status', 'ST_MOL_TYPE'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
structShow: false,
|
||||
materType: '',
|
||||
mater_btn: true,
|
||||
storlist: [],
|
||||
defaultList: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
],
|
||||
mol_type: [
|
||||
{ required: true, message: '损益类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
bill_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
biz_date: [
|
||||
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 获取入库单明细
|
||||
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.isadd = false
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
this.mater_btn = true
|
||||
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (!this.form.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
const vehicle_code = this.form.tableData[i].storagevehicle_code
|
||||
const same = this.form.tableData.some(mater => mater.storagevehicle_code !== vehicle_code)
|
||||
if (same) {
|
||||
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
billTypeChange(val) {
|
||||
this.form.tableData = []
|
||||
this.form.total_qty = 0
|
||||
this.form.dtl_num = 0
|
||||
},
|
||||
resetTable() {
|
||||
if (!this.form.struct_id) {
|
||||
this.crud.notify('请先选择货物!')
|
||||
return false
|
||||
}
|
||||
if (this.crud.status.add > 0) {
|
||||
crudMoreOrless.getStructIvt({ 'struct_id': this.form.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
})
|
||||
}
|
||||
if (this.crud.status.edit > 0) {
|
||||
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
})
|
||||
}
|
||||
},
|
||||
tableChanged(row) {
|
||||
var dtl = {}
|
||||
dtl.sect_code = row.turnout_sect_code
|
||||
dtl.struct_code = row.turnout_struct_code
|
||||
dtl.storagevehicle_code = row.storagevehicle_code
|
||||
dtl.material_id = row.material_id
|
||||
dtl.material_code = row.material_code
|
||||
dtl.material_name = row.material_name
|
||||
dtl.pcsn = row.pcsn
|
||||
dtl.qty_unit_id = row.qty_unit_id
|
||||
dtl.qty_unit_name = row.qty_unit_name
|
||||
dtl.ivt_qty = row.qty
|
||||
dtl.qty = row.qty
|
||||
dtl.status = '10'
|
||||
dtl.edit = false
|
||||
dtl.mol_qty = 0
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
var tableDatum = this.form.tableData[i]
|
||||
if (tableDatum.struct_code === dtl.struct_code && tableDatum.material_id === dtl.material_id && tableDatum.pcsn === dtl.pcsn) {
|
||||
} else {
|
||||
this.form.tableData.push(dtl)
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.form.tableData.push(dtl)
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
}
|
||||
},
|
||||
|
||||
async queryMater(index, row) {
|
||||
this.materShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
async queryStruct() {
|
||||
if (!this.form.stor_id) {
|
||||
this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.defaultList = []
|
||||
this.defaultList.push(this.form.stor_id)
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(this.form.mol_type)
|
||||
},
|
||||
async insertdtl() {
|
||||
this.form.tableData.push({ quality_scode: '02', ivt_qty: 0, mol_qty: 0, is_active: '1', ivt_level: '01', edit: false, is_add: true })
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
typeChange(val) {
|
||||
if (val === '1') {
|
||||
this.mater_btn = false
|
||||
} else {
|
||||
this.mater_btn = true
|
||||
}
|
||||
this.form.tableData = []
|
||||
this.form.struct_id = ''
|
||||
this.form.struct_code = ''
|
||||
this.form.sect_id = ''
|
||||
this.form.sect_name = ''
|
||||
this.form.struct_name = ''
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
if (!row.edit) {
|
||||
if (parseFloat(row.mol_qty) <= 0) {
|
||||
this.crud.notify('不允许损溢数量为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.material_id) {
|
||||
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.storagevehicle_code) {
|
||||
this.crud.notify('载具号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.pcsn) {
|
||||
this.crud.notify('批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (this.form.mol_type === '1' && (parseFloat(row.ivt_qty) < parseFloat(row.mol_qty))) {
|
||||
this.crud.notify('不允许损数量大于库存数量!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 修改行的编辑状态
|
||||
row.edit = !row.edit
|
||||
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
if (row.edit) {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = this.form.total_qty + item.mol_qty
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].mol_qty)
|
||||
rows.splice(index, 1)
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
231
wms/nladmin-ui/src/views/wms/st/moreorlessbill/StructDiv.vue
Normal file
231
wms/nladmin-ui/src/views/wms/st/moreorlessbill/StructDiv.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<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-cascader
|
||||
v-model="defaultList"
|
||||
placeholder="库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位编码">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="货位号模糊查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@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%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="turnout_sect_name" label="库区名称" :min-width="flexWidth('turnout_sect_name',crud.data,'库区名称')" />
|
||||
<el-table-column prop="turnout_struct_code" label="货位编码" :min-width="flexWidth('turnout_struct_code',crud.data,'货位编码')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<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, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'StructDiv',
|
||||
components: { crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库存物料',
|
||||
optShow: {},
|
||||
url: 'api/moveStor/getCanuseIvt',
|
||||
idField: 'struct_id',
|
||||
sort: 'storagevehicleext_id,desc'
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['d_lock_type'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
sectProp: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
defaultList: [],
|
||||
dialogVisible: false,
|
||||
sect: {},
|
||||
mol_type: '',
|
||||
checkrow: {},
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
sectProp: {
|
||||
handler(newValue, oldValue) {
|
||||
this.defaultList = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.crud.resetQuery(false)
|
||||
crudSectattr.getSect({ 'stor_id': this.defaultList[0] }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
if (this.sect) {
|
||||
this.query.sect = this.sect
|
||||
if (this.sect.length === 1) {
|
||||
this.query.stor_id = this.sect[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (this.sect.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (this.sect.length === 2) {
|
||||
this.query.stor_id = this.sect[0]
|
||||
this.query.sect_id = this.sect[1]
|
||||
}
|
||||
}
|
||||
this.query.is_used = '1'
|
||||
this.query.is_delete = '0'
|
||||
this.query.stor_id = this.defaultList[0]
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.checkrow = row
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
* @param msg
|
||||
*/
|
||||
getMsg(msg) {
|
||||
this.mol_type = msg
|
||||
},
|
||||
lockFormat(row, column) {
|
||||
return this.dict.label.d_lock_type[row.lock_type]
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.sects = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选仓位')
|
||||
return
|
||||
}
|
||||
if (this.checkrow.frozen_qty !== 0) {
|
||||
this.$message('请选择冻结数量为0的库存')
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.checkrow)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
327
wms/nladmin-ui/src/views/wms/st/moreorlessbill/index.vue
Normal file
327
wms/nladmin-ui/src/views/wms/st/moreorlessbill/index.vue
Normal file
@@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input
|
||||
v-model="query.mol_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="单据编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位编码">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="货位编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="损溢类型">
|
||||
<el-select
|
||||
v-model="query.mol_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="损溢类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_MOL_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据类型">
|
||||
<el-select
|
||||
v-model="query.mol_inv_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.MOL_INV_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.MOL_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
:disabled="confirm_flag"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="confirm"
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:max-height="590"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="115"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="mol_code" label="损溢单号" :min-width="flexWidth('mol_code',crud.data,'损溢单号')">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.mol_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="billTypeFormat" prop="mol_inv_type" label="单据类型" :min-width="flexWidth('mol_inv_type',crud.data,'单据类型')" />
|
||||
<el-table-column :formatter="typeFormat" prop="mol_type" label="损溢类型" :min-width="flexWidth('mol_type',crud.data,'损溢类型')" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_num" :min-width="flexWidth('dtl_num',crud.data,'明细数')" />
|
||||
<el-table-column label="损益重量" align="center" prop="total_qty" :min-width="flexWidth('total_qty',crud.data,'损益重量')" >
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="stateFormat" prop="status" label="单据状态" :min-width="flexWidth('status',crud.data,'单据状态')" />
|
||||
<el-table-column prop="create_mode" :formatter="create_modeFormat" label="生成方式" :min-width="flexWidth('create_mode',crud.data,'生成方式')" />
|
||||
<el-table-column label="制单人" align="center" prop="input_optname" :min-width="flexWidth('input_optname',crud.data,'制单人')" />
|
||||
<el-table-column label="制单时间" align="center" prop="input_time" :min-width="flexWidth('input_time',crud.data,'制单时间')" />
|
||||
<el-table-column label="确认人" align="center" prop="confirm_optname" :min-width="flexWidth('confirm_optname',crud.data,'确认人')" />
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" :min-width="flexWidth('confirm_time',crud.data,'确认时间')" />
|
||||
<el-table-column label="备注" align="center" prop="remark" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudMoreOrless from '@/views/wms/st/moreorlessbill/moreorless'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/st/moreorlessbill/AddDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
export default {
|
||||
name: 'MoreOrLess',
|
||||
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
optShow: { add: true, reset: true },
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},
|
||||
idField: 'mol_id',
|
||||
url: '/api/moreorLess',
|
||||
crudMethod: { ...crudMoreOrless }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['MOL_BILL_STATUS', 'ST_CREATE_MODE', 'ST_MOL_TYPE', 'MOL_INV_TYPE'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
confirm_flag: true,
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
statuslist: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user'
|
||||
])
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
canUd(row) {
|
||||
return row.status !== '10'
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
} else {
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
buttonChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
if (current.bill_status !== '99') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
this.confirm_flag = true
|
||||
}
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.MOL_BILL_STATUS[row.status]
|
||||
},
|
||||
typeFormat(row, column) {
|
||||
return this.dict.label.ST_MOL_TYPE[row.mol_type]
|
||||
},
|
||||
billTypeFormat(row, column) {
|
||||
return this.dict.label.MOL_INV_TYPE[row.mol_inv_type]
|
||||
},
|
||||
create_modeFormat(row, column) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.status !== '99'
|
||||
},
|
||||
confirm() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudMoreOrless.confirm(this.currentRow).then(res => {
|
||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.refresh()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
43
wms/nladmin-ui/src/views/wms/st/moreorlessbill/moreorless.js
Normal file
43
wms/nladmin-ui/src/views/wms/st/moreorlessbill/moreorless.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/moreorLess',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/moreorLess',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/moreorLess',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryMolDtl(params) {
|
||||
return request({
|
||||
url: '/api/moreorLess/queryMolDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/moreorLess/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryMolDtl, confirm }
|
||||
@@ -206,7 +206,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
||||
<AddDtl :dialog-show.sync="dtlShow" :sect-list="sectList" :stor-id="storId" @tableChanged="tableChanged" />
|
||||
<StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" @tableChanged="structChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -220,9 +220,9 @@ import crudUserStor from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
stor_id: '1582991156504039424',
|
||||
stor_code: 'AC01',
|
||||
stor_name: '兰州仓库',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
block_num: null,
|
||||
bill_status: '10',
|
||||
total_qty: '0',
|
||||
@@ -255,6 +255,7 @@ export default {
|
||||
storId: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
sectList: [],
|
||||
invtypelist: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
@@ -323,7 +324,9 @@ export default {
|
||||
if (!this.form.stor_id) {
|
||||
return this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
this.sectList = []
|
||||
this.storId = this.form.stor_id
|
||||
this.sectList.push(this.storId)
|
||||
this.dtlShow = true
|
||||
},
|
||||
async queryStruct(index, row) {
|
||||
|
||||
@@ -96,7 +96,6 @@
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import movestor from '@/views/wms/st/movebill/movestor'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
@@ -129,6 +128,9 @@ export default {
|
||||
},
|
||||
storId: {
|
||||
type: String
|
||||
},
|
||||
sectList: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
dicts: ['ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable'],
|
||||
@@ -138,7 +140,7 @@ export default {
|
||||
opendtlParam: '',
|
||||
sects: [],
|
||||
rows: [],
|
||||
defaultList: ['1582991156504039424', '1582991348217286656']
|
||||
defaultList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -151,6 +153,11 @@ export default {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
},
|
||||
sectList: {
|
||||
handler(newValue, oldValue) {
|
||||
this.defaultList === newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user