add:盘点管理
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
attr.sect_code AS turnout_sect_code,
|
||||
attr.sect_id,
|
||||
attr.struct_id,
|
||||
attr.struct_name,
|
||||
attr.struct_code AS turnout_struct_code
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
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.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
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-29
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/check")
|
||||
@Slf4j
|
||||
public class CheckController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询盘点单")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtCheckmstService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增盘点单")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改盘点单")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除盘点单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iStIvtCheckmstService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getDtl")
|
||||
@Log("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtCheckmstService.getDtl(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveCheck")
|
||||
@Log("保存盘点")
|
||||
public ResponseEntity<Object> saveCheck(@RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.saveCheck(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("确认盘点")
|
||||
public ResponseEntity<Object> confirm(@RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.confirm(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,6 +17,11 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String IS_DELETE_YES = "1";
|
||||
|
||||
/**
|
||||
* 创建方式
|
||||
*/
|
||||
public final static String CREATE_TYPE = "1";
|
||||
|
||||
/**
|
||||
* 更新库存状态:加可用(插入数据)
|
||||
*/
|
||||
|
||||
@@ -35,12 +35,21 @@ public enum IOSEnum {
|
||||
// 移库单明细状态
|
||||
MOVE_DTL_STATUS(MapOf.of("生成", "10", "执行中", "20", "完成", "99")),
|
||||
|
||||
// 损益单据类型
|
||||
MORE_MST_TYPE(MapOf.of("手工损益", "1001", "盘点损益", "1002")),
|
||||
|
||||
// 损益单状态
|
||||
MORE_MST_STATUS(MapOf.of("生成", "10", "审核", "20", "完成", "99")),
|
||||
|
||||
// 损益类型
|
||||
MORE_TYPE(MapOf.of("损", "1", "溢", "2")),
|
||||
|
||||
// 盘点单主表状态
|
||||
CHECK_MST_STATUS(MapOf.of("生成", "10", "盘点中", "20", "完成", "99")),
|
||||
|
||||
// 盘点明细状态
|
||||
CHECK_DTL_STATUS(MapOf.of("生成", "10", "盘点中", "20", "已盘点", "30", "完成", "99")),
|
||||
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
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.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单明细表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface IStIvtCheckdtlService extends IService<StIvtCheckdtl> {
|
||||
|
||||
/**
|
||||
* 新增明细
|
||||
* @param dto 新增修改实体dto
|
||||
*/
|
||||
void createCheckDtl(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson {
|
||||
* check_id:主表标识
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 创建损益单据
|
||||
* @param list 明细实体类集合
|
||||
*/
|
||||
void createMore(List<StIvtCheckdtl> list, String check_id);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
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.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单主表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface IStIvtCheckmstService extends IService<StIvtCheckmst> {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<StIvtCheckmst> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增盘点单
|
||||
* @param dto 新增修改实体dto
|
||||
*/
|
||||
void create(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 修改盘点单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
void update(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 删除盘点单
|
||||
* @param ids 标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson {
|
||||
* check_id: 主表标识
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 到村盘点单
|
||||
* @param dto 新增修改dto实体类
|
||||
*/
|
||||
void saveCheck(CheckInsertDto dto);
|
||||
|
||||
/**
|
||||
* 确认盘点
|
||||
* @param dto 新增修改dto实体类
|
||||
*/
|
||||
void confirm(CheckInsertDto dto);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public interface IStIvtMoreorlessmstService extends IService<StIvtMoreorlessmst>
|
||||
* 新增损益单
|
||||
* @param dto:新增修改dto实体类
|
||||
*/
|
||||
void create(MoreOrLessInsertDto dto);
|
||||
String create(MoreOrLessInsertDto dto);
|
||||
|
||||
/**
|
||||
* 修改损益单
|
||||
|
||||
@@ -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-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_checkdtl")
|
||||
public class StIvtCheckdtl implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 盘点单明细id
|
||||
*/
|
||||
@TableId(value = "checkdtl_id")
|
||||
private String checkdtl_id;
|
||||
|
||||
/**
|
||||
* 盘点单标识
|
||||
*/
|
||||
private String check_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private BigDecimal seq_no;
|
||||
|
||||
/**
|
||||
* 盘点库区
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 盘点货位
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 盘点站台
|
||||
*/
|
||||
private String checkpoint_code;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private BigDecimal base_qty;
|
||||
|
||||
/**
|
||||
* 基本计量单位
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否已下发
|
||||
*/
|
||||
private String is_down;
|
||||
|
||||
/**
|
||||
* 盘点数量
|
||||
*/
|
||||
private BigDecimal fac_qty;
|
||||
|
||||
/**
|
||||
* 盘点结果
|
||||
*/
|
||||
private String check_result;
|
||||
|
||||
/**
|
||||
* 盘点人
|
||||
*/
|
||||
private String check_optid;
|
||||
|
||||
/**
|
||||
* 盘点人姓名
|
||||
*/
|
||||
private String check_optname;
|
||||
|
||||
/**
|
||||
* 盘点时间
|
||||
*/
|
||||
private String check_time;
|
||||
|
||||
/**
|
||||
* 明细备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -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-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_checkmst")
|
||||
public class StIvtCheckmst implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 盘点单标识
|
||||
*/
|
||||
@TableId(value = "check_id")
|
||||
private String check_id;
|
||||
|
||||
/**
|
||||
* 盘点单号
|
||||
*/
|
||||
private String check_code;
|
||||
|
||||
/**
|
||||
* 盘点单类型
|
||||
*/
|
||||
private String check_type;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private BigDecimal dtl_num;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
private String input_optid;
|
||||
|
||||
/**
|
||||
* 制单人姓名
|
||||
*/
|
||||
private String input_optname;
|
||||
|
||||
/**
|
||||
* 制单时间
|
||||
*/
|
||||
private String input_time;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String audit_optid;
|
||||
|
||||
/**
|
||||
* 审核人姓名
|
||||
*/
|
||||
private String audit_optname;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private String audit_time;
|
||||
|
||||
/**
|
||||
* 确认人
|
||||
*/
|
||||
private String confirm_optid;
|
||||
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
private String confirm_optname;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 是否已上传
|
||||
*/
|
||||
private String is_upload;
|
||||
|
||||
|
||||
}
|
||||
@@ -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.StIvtCheckdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface StIvtCheckdtlMapper extends BaseMapper<StIvtCheckdtl> {
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
* @param whereJson {
|
||||
* check_id 主表标识
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getDtl(@Param("param") Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.StIvtCheckdtlMapper">
|
||||
|
||||
<select id="getDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dtl.*,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
sect.sect_name,
|
||||
attr.struct_name
|
||||
FROM
|
||||
st_ivt_checkdtl dtl
|
||||
LEFT JOIN st_ivt_checkmst ios ON ios.check_id = dtl.check_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
LEFT JOIN st_ivt_sectattr sect ON sect.sect_code = dtl.sect_code
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_code = dtl.struct_code
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.check_id != null and param.check_id != ''">
|
||||
AND
|
||||
ios.check_id = #{param.check_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckmst;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
public interface StIvtCheckmstMapper extends BaseMapper<StIvtCheckmst> {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.StIvtCheckmstMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,75 @@
|
||||
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/29
|
||||
*/
|
||||
@Data
|
||||
public class CheckInsertDto {
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
*/
|
||||
private String check_id;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String check_type;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private BigDecimal dtl_num;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 明细数据:
|
||||
* {
|
||||
* sect_code 库区
|
||||
* struct_code 货位
|
||||
* storagevehicle_code 载具编码
|
||||
* material_id 物料id
|
||||
* material_code 物料编码
|
||||
* pcsn 批次
|
||||
* base_qty 库存数量
|
||||
* fac_qty 盘点数量
|
||||
* qty_unit_id 计量单位标识
|
||||
* qty_unit_name 计量单位名称
|
||||
* status 状态
|
||||
* remark 备注
|
||||
* }
|
||||
*/
|
||||
private List<JSONObject> tableData;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
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.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoreorlessmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtCheckdtlMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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-29
|
||||
*/
|
||||
@Service
|
||||
public class StIvtCheckdtlServiceImpl extends ServiceImpl<StIvtCheckdtlMapper, StIvtCheckdtl> implements IStIvtCheckdtlService {
|
||||
|
||||
/**
|
||||
* 盘点单主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
/**
|
||||
* 损益单主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoreorlessmstService iStIvtMoreorlessmstService;
|
||||
|
||||
@Override
|
||||
public void createCheckDtl(CheckInsertDto dto) {
|
||||
// 批量新增集合
|
||||
List<StIvtCheckdtl> dtlDaoList = new ArrayList<>();
|
||||
for (int i = 0; i < dto.getTableData().size(); i++) {
|
||||
JSONObject json = dto.getTableData().get(i);
|
||||
StIvtCheckdtl dao = new StIvtCheckdtl();
|
||||
dao.setCheckdtl_id(IdUtil.getStringId());
|
||||
dao.setCheck_id(dto.getCheck_id());
|
||||
dao.setSeq_no(BigDecimal.valueOf(i+1));
|
||||
dao.setSect_code(json.getString("sect_code"));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setStoragevehicle_code(json.getString("storagevehicle_code"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setBase_qty(json.getBigDecimal("base_qty"));
|
||||
dao.setFac_qty(json.getBigDecimal("fac_qty"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setQty_unit_name(json.getString("qty_unit_name"));
|
||||
dao.setStatus(json.getString("status"));
|
||||
dao.setRemark(json.getString("remark"));
|
||||
dtlDaoList.add(dao);
|
||||
}
|
||||
this.saveBatch(dtlDaoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getDtl(Map whereJson) {
|
||||
return this.baseMapper.getDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMore(List<StIvtCheckdtl> dtlDaoList, String check_id) {
|
||||
StIvtCheckmst mstDao = iStIvtCheckmstService.getById(check_id);
|
||||
for (StIvtCheckdtl dao : dtlDaoList) {
|
||||
// 组织创建损益单据主数据
|
||||
MoreOrLessInsertDto moreDto = new MoreOrLessInsertDto();
|
||||
moreDto.setMol_inv_type(IOSEnum.MORE_MST_TYPE.code("盘点损益"));
|
||||
// 根据库存数量以及盘点数量来判断损益类型
|
||||
double base_qty = dao.getBase_qty().doubleValue();
|
||||
double fac_qty = dao.getFac_qty().doubleValue();
|
||||
double mol_qty;
|
||||
if (base_qty == fac_qty) {
|
||||
continue;
|
||||
} else if (base_qty > fac_qty) {
|
||||
moreDto.setMol_type(IOSEnum.MORE_TYPE.code("损"));
|
||||
mol_qty = NumberUtil.sub(base_qty, fac_qty);
|
||||
} else {
|
||||
moreDto.setMol_type(IOSEnum.MORE_TYPE.code("溢"));
|
||||
mol_qty = NumberUtil.sub(fac_qty, base_qty);
|
||||
}
|
||||
moreDto.setBiz_date(DateUtil.today());
|
||||
moreDto.setDtl_num(BigDecimal.valueOf(1));
|
||||
moreDto.setStor_id(mstDao.getStor_id());
|
||||
moreDto.setRemark("由明细标识【"+dao.getCheck_optid()+"】创建");
|
||||
moreDto.setTotal_qty(BigDecimal.valueOf(mol_qty));
|
||||
moreDto.setCreate_mode(IOSConstant.CREATE_TYPE);
|
||||
moreDto.setStatus(IOSEnum.MORE_MST_STATUS.code("生成"));
|
||||
|
||||
// 创建损益单明细数据
|
||||
List<JSONObject> tableData = new ArrayList<>();
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("material_id", dao.getMaterial_id());
|
||||
jsonDtl.put("pcsn", dao.getPcsn());
|
||||
jsonDtl.put("ivt_qty", base_qty);
|
||||
jsonDtl.put("mol_qty", mol_qty);
|
||||
jsonDtl.put("qty_unit_id", dao.getQty_unit_id());
|
||||
jsonDtl.put("qty_unit_name", dao.getQty_unit_name());
|
||||
jsonDtl.put("storagevehicle_code", dao.getStoragevehicle_code());
|
||||
jsonDtl.put("sect_code", dao.getSect_code());
|
||||
jsonDtl.put("struct_code", dao.getStruct_code());
|
||||
jsonDtl.put("status", IOSEnum.MORE_MST_STATUS.code("生成"));
|
||||
jsonDtl.put("remark", "由明细标识【"+dao.getCheck_optid()+"】创建");
|
||||
jsonDtl.put("source_bill_code", mstDao.getCheck_code());
|
||||
tableData.add(jsonDtl);
|
||||
moreDto.setTableData(tableData);
|
||||
//调用创建
|
||||
String mol_id = iStIvtMoreorlessmstService.create(moreDto);
|
||||
// 调用强制确认
|
||||
iStIvtMoreorlessmstService.confirm(iStIvtMoreorlessmstService.getById(mol_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtCheckmstMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
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 Liuxy
|
||||
* @since 2025-05-29
|
||||
*/
|
||||
@Service
|
||||
public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, StIvtCheckmst> implements IStIvtCheckmstService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtCheckdtlService iStIvtCheckdtlService;
|
||||
|
||||
@Override
|
||||
public IPage<StIvtCheckmst> queryAll(Map whereJson, PageQuery page) {
|
||||
String check_code = MapUtil.getStr(whereJson, "check_code");
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
String check_type = MapUtil.getStr(whereJson, "check_type");
|
||||
String create_mode = MapUtil.getStr(whereJson, "create_mode");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
// 查询条件
|
||||
LambdaQueryWrapper<StIvtCheckmst> queryWrapper = new QueryWrapper<StIvtCheckmst>().lambda();
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(check_code), StIvtCheckmst::getCheck_code, check_code);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(stor_id), StIvtCheckmst::getStor_id, stor_id);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(check_type), StIvtCheckmst::getCheck_type, check_type);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(status), StIvtCheckmst::getStatus, status);
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(create_mode), StIvtCheckmst::getCreate_mode, create_mode);
|
||||
queryWrapper.ge(ObjectUtil.isNotEmpty(begin_time), StIvtCheckmst::getInput_time, begin_time);
|
||||
queryWrapper.lt(ObjectUtil.isNotEmpty(end_time), StIvtCheckmst::getInput_time, end_time);
|
||||
queryWrapper.eq(StIvtCheckmst::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
queryWrapper.orderByDesc(StIvtCheckmst::getInput_time);
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
queryWrapper
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(CheckInsertDto dto) {
|
||||
// 主表
|
||||
StIvtCheckmst mstDao = new StIvtCheckmst();
|
||||
mstDao.setCheck_id(IdUtil.getStringId());
|
||||
mstDao.setCheck_code(CodeUtil.getNewCode("CHECK_BILL_CODE"));
|
||||
mstDao.setCheck_type(dto.getCheck_type());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setStor_name(dto.getStor_name());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
mstDao.setCreate_mode(dto.getCreate_mode());
|
||||
mstDao.setStatus(dto.getStatus());
|
||||
mstDao.setRemark(dto.getRemark());
|
||||
mstDao.setInput_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setInput_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setInput_time(DateUtil.now());
|
||||
this.save(mstDao);
|
||||
// 明细
|
||||
dto.setCheck_id(mstDao.getCheck_id());
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(CheckInsertDto dto) {
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStor_id(dto.getStor_id());
|
||||
mstDao.setCheck_type(dto.getCheck_type());
|
||||
mstDao.setDtl_num(dto.getDtl_num());
|
||||
this.updateById(mstDao);
|
||||
// 删除老明细
|
||||
iStIvtCheckdtlService.remove(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, mstDao.getCheck_id())
|
||||
);
|
||||
// 新增明细
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Set<String> ids) {
|
||||
this.update(
|
||||
new UpdateWrapper<StIvtCheckmst>().lambda()
|
||||
.in(StIvtCheckmst::getCheck_id,ids)
|
||||
.set(StIvtCheckmst::getIs_delete, IOSConstant.IS_DELETE_YES)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getDtl(Map whereJson) {
|
||||
return iStIvtCheckdtlService.getDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveCheck(CheckInsertDto dto) {
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("盘点中"));
|
||||
this.updateById(mstDao);
|
||||
// 更新明细
|
||||
iStIvtCheckdtlService.remove(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, mstDao.getCheck_id())
|
||||
);
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
iStIvtCheckdtlService.update(
|
||||
new UpdateWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.set(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("盘点中"))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirm(CheckInsertDto dto) {
|
||||
// 更新主表
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("完成"));
|
||||
mstDao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setConfirm_time(DateUtil.now());
|
||||
this.updateById(mstDao);
|
||||
// 更新明细
|
||||
iStIvtCheckdtlService.update(
|
||||
new UpdateWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.set(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
);
|
||||
// 创建损益单
|
||||
iStIvtCheckdtlService.createMore(iStIvtCheckdtlService.list(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id,mstDao.getCheck_id())
|
||||
),mstDao.getCheck_id());
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class StIvtMoreorlessmstServiceImpl extends ServiceImpl<StIvtMoreorlessms
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(MoreOrLessInsertDto dto) {
|
||||
public String create(MoreOrLessInsertDto dto) {
|
||||
// 主表
|
||||
StIvtMoreorlessmst mstDao = new StIvtMoreorlessmst();
|
||||
mstDao.setMol_id(IdUtil.getStringId());
|
||||
@@ -79,6 +79,7 @@ public class StIvtMoreorlessmstServiceImpl extends ServiceImpl<StIvtMoreorlessms
|
||||
// 明细
|
||||
dto.setMol_id(mstDao.getMol_id());
|
||||
iStIvtMoreorlessdtlService.createMoreDtl(dto);
|
||||
return mstDao.getMol_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
297
wms/nladmin-ui/src/views/wms/st/checkbill/AddDialog.vue
Normal file
297
wms/nladmin-ui/src/views/wms/st/checkbill/AddDialog.vue
Normal file
@@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点单新增"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
@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-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<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"
|
||||
@change="storChange"
|
||||
>
|
||||
<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="check_type">
|
||||
<el-select
|
||||
v-model="form.check_type"
|
||||
clearable
|
||||
placeholder="业务类型"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.CHECK_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<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="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>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点明细</span>
|
||||
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
添加盘点物料
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" align="center" :min-width="flexWidth('index',crud.data,'序号')" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('status',crud.data,'状态')" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" :min-width="flexWidth('sect_name',crud.data,'盘点库区')" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" :min-width="flexWidth('struct_name',crud.data,'盘点货位')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<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="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="base_qty" label="库存数量" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('base_qty',crud.data,'库存数量')" />
|
||||
<el-table-column prop="fac_qty" label="盘点数量" v-if="crud.status.view > 0" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('fac_qty',crud.data,'盘点数量')" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" :min-width="flexWidth('input_time',crud.data,'创建日期')" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :sect-prop="defaultList" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/st/checkbill/AddDtl'
|
||||
import check from '@/views/wms/st/checkbill/check'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
check_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
status: '10',
|
||||
dtl_num: '0',
|
||||
check_type: '',
|
||||
remark: '',
|
||||
create_mode: '1',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { AddDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['CHECK_BILL_STATUS', 'ST_INV_TYPE_CK', 'CHECK_DTL_STATUS'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
flagnow: false,
|
||||
nowrow: {},
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
defaultList: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
],
|
||||
check_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
check.getDtl({ 'check_id': this.form.check_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)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
check.getDtl({ 'check_id': this.form.check_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)
|
||||
}
|
||||
})
|
||||
},
|
||||
bill_statusFormat(row) {
|
||||
return this.dict.label.CHECK_DTL_STATUS[row.status]
|
||||
},
|
||||
storChange(row) {
|
||||
this.storlist.forEach((item) => {
|
||||
if (item.stor_id === row) {
|
||||
this.form.stor_code = item.stor_code
|
||||
this.form.stor_name = item.stor_name
|
||||
}
|
||||
})
|
||||
},
|
||||
async queryDtl() {
|
||||
if (this.form.check_type === '') {
|
||||
this.crud.notify('请选择盘点单类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.defaultList = []
|
||||
this.defaultList.push(this.form.stor_id)
|
||||
this.dtlShow = true
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
rows.forEach((item) => {
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if ((this.form.tableData[i].struct_code === item.struct_code) && (this.form.tableData[i].material_code === item.material_code)) {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
item.edit = false
|
||||
item.status = '10'
|
||||
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
|
||||
}
|
||||
} else {
|
||||
item.edit = false
|
||||
item.status = '10'
|
||||
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
|
||||
}
|
||||
})
|
||||
for (const value of tablemap.values()) {
|
||||
this.form.tableData.push(value)
|
||||
}
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = {}
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
</style>
|
||||
230
wms/nladmin-ui/src/views/wms/st/checkbill/AddDtl.vue
Normal file
230
wms/nladmin-ui/src/views/wms/st/checkbill/AddDtl.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<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'}"
|
||||
>
|
||||
<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="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
|
||||
}
|
||||
this.rows.forEach((item) => {
|
||||
item.struct_code = item.turnout_struct_code
|
||||
item.sect_code = item.turnout_sect_code
|
||||
item.sect_name = item.turnout_sect_name
|
||||
item.base_qty = item.qty
|
||||
})
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
343
wms/nladmin-ui/src/views/wms/st/checkbill/CheckDialog.vue
Normal file
343
wms/nladmin-ui/src/views/wms/st/checkbill/CheckDialog.vue
Normal file
@@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点单盘点"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:visible.sync="dialogVisible"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form1" :inline="true" :model="form1" :rules="rules" size="mini" label-width="80px">
|
||||
<el-input v-show="false" v-model="form1.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form1.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="check_code">
|
||||
<el-input v-model.trim="form1.check_code" placeholder="单据号" clearable disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="check_type">
|
||||
<el-select
|
||||
v-model="form1.check_type"
|
||||
placeholder="业务类型"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<el-select
|
||||
v-model="form1.stor_id"
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<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="status">
|
||||
<el-select
|
||||
v-model="form1.status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.CHECK_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<el-input v-model.trim="form1.dtl_num" style="width: 200px" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model.trim="form1.remark" :disabled="true" style="width: 480px;" clearable :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form1.tableData"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" align="center" :min-width="flexWidth('index',crud.data,'序号')" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" :min-width="flexWidth('sect_name',crud.data,'盘点库区')" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" :min-width="flexWidth('struct_name',crud.data,'盘点货位')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<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="base_qty" label="库存数量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('base_qty',crud.data,'库存数量')" />
|
||||
<el-table-column prop="fac_qty" label="盘点数量" align="center" :min-width="flexWidth('fac_qty',crud.data,'盘点数量')">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :precision="3" :min="0" />
|
||||
<span v-show="isShow(scope.$index, scope.row,4)">{{ scope.row.fac_qty }}</span>
|
||||
</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 prop="status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('status',crud.data,'状态')"/>
|
||||
<el-table-column align="center" label="操作" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-if="false" :disabled="isCanDel(scope.$index, scope.row,1)" 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" :disabled="isCanDel(scope.$index, scope.row,2)" 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" :disabled="isCanDel(scope.$index, scope.row,2)" 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>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveCheck">保存</el-button>
|
||||
<!-- <el-button type="primary" @click="submitCheck">确认</el-button>-->
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import check from '@/views/wms/st/checkbill/check'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
export default {
|
||||
name: 'CheckDialog',
|
||||
components: {},
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
dicts: ['CHECK_BILL_STATUS', 'ST_INV_TYPE_CK', 'CHECK_DTL_STATUS', 'check_result'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
add_flag: true,
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
form1: {
|
||||
check_id: '',
|
||||
check_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
status: '10',
|
||||
dtl_num: '0',
|
||||
check_type: '',
|
||||
remark: '',
|
||||
create_mode: '',
|
||||
tableData: []
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
check.getDtl({ 'check_id': this.form1.check_id }).then(res => {
|
||||
this.form1.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form1.tableData.length; i++) {
|
||||
const row = this.form1.tableData[i]
|
||||
row.edit = false
|
||||
if (row.status > '20') {
|
||||
row.edit = true
|
||||
}
|
||||
this.$set(this.form1.tableData, i, row)
|
||||
}
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.nowrow = current
|
||||
const num = parseFloat(current.base_qty)
|
||||
if (num > 0) {
|
||||
this.add_flag = false
|
||||
} else {
|
||||
this.add_flag = true
|
||||
}
|
||||
} else {
|
||||
this.nowrow = null
|
||||
this.add_flag = true
|
||||
}
|
||||
},
|
||||
isCanDel(index, row, type) {
|
||||
const num = parseFloat(row.base_qty)
|
||||
if (type === 1) {
|
||||
if (row.status > '20' || num > 0) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
if (row.status > '20') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
isShow(index, row, type) {
|
||||
const num = parseFloat(row.base_qty)
|
||||
if (type === 1) {
|
||||
if (row.status > '20') {
|
||||
return false
|
||||
} else {
|
||||
if (num > 0) {
|
||||
return false
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type === 2) {
|
||||
if (row.status > '20') {
|
||||
return false
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
} else if (type === 3) {
|
||||
if (row.status > '20') {
|
||||
return true
|
||||
} else {
|
||||
if (num > 0) {
|
||||
return true
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type === 4) {
|
||||
if (row.status > '20') {
|
||||
return true
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form1 = row
|
||||
},
|
||||
bill_statusFormat(row, column) {
|
||||
return this.dict.label.CHECK_DTL_STATUS[row.status]
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (!row.edit) {
|
||||
const num = parseFloat(row.base_qty)
|
||||
const fac_qty = parseFloat(row.fac_qty)
|
||||
if (num <= 0 && fac_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
|
||||
}
|
||||
}
|
||||
row.edit = !row.edit
|
||||
this.form1.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = null
|
||||
this.form1.detail_count = this.form1.tableData.length
|
||||
},
|
||||
saveCheck() {
|
||||
if (this.form1.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form1.tableData.length; i++) {
|
||||
if (!this.form1.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
if (this.form1.tableData[i].fac_qty === '' || this.form1.tableData[i].fac_qty === 0) {
|
||||
this.crud.notify('盘点数量不能为0序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
check.saveCheck(this.form1).then(res => {
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
</style>
|
||||
56
wms/nladmin-ui/src/views/wms/st/checkbill/check.js
Normal file
56
wms/nladmin-ui/src/views/wms/st/checkbill/check.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/check',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/check/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/check',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDtl(params) {
|
||||
return request({
|
||||
url: '/api/check/getDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getStructIvt(params) {
|
||||
return request({
|
||||
url: '/api/check/getStructIvt',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/check/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function saveCheck(data) {
|
||||
return request({
|
||||
url: '/api/check/saveCheck',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getDtl, getStructIvt, confirm, saveCheck }
|
||||
345
wms/nladmin-ui/src/views/wms/st/checkbill/index.vue
Normal file
345
wms/nladmin-ui/src/views/wms/st/checkbill/index.vue
Normal file
@@ -0,0 +1,345 @@
|
||||
<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.check_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.create_mode"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="生成方式"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_CREATE_MODE"
|
||||
: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.CHECK_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="query.check_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
: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="success"
|
||||
:disabled="check_flag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="checkOpen"
|
||||
>
|
||||
盘点
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
:disabled="confirm_flag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="submitCheck"
|
||||
>
|
||||
确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:max-height="590"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
:highlight-current-row="true"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column
|
||||
v-permission="['admin','check:del','check:edit']"
|
||||
label="操作"
|
||||
width="160"
|
||||
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="check_code" label="单据编码" :min-width="flexWidth('check_code',crud.data,'单据编码')">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.check_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="stateFormat" prop="status" label="单据状态" :min-width="flexWidth('status',crud.data,'单据状态')" />
|
||||
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
|
||||
<el-table-column prop="check_type" :formatter="bill_typeFormat" label="业务类型" :min-width="flexWidth('check_type',crud.data,'业务类型')" />
|
||||
<el-table-column prop="is_nok" :formatter="is_nokFormat" label="盘点状态" :min-width="flexWidth('is_nok',crud.data,'盘点状态')" />
|
||||
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" :min-width="flexWidth('create_mode',crud.data,'生成方式')" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_num" :min-width="flexWidth('dtl_num',crud.data,'明细数')" />
|
||||
<el-table-column prop="input_optname" label="创建人" :min-width="flexWidth('input_optname',crud.data,'创建人')" />
|
||||
<el-table-column prop="input_time" label="创建日期" :min-width="flexWidth('input_time',crud.data,'创建日期')" />
|
||||
<el-table-column prop="confirm_optname" label="确认人" :min-width="flexWidth('confirm_optname',crud.data,'确认人')" />
|
||||
<el-table-column prop="confirm_time" label="确认日期" :min-width="flexWidth('confirm_time',crud.data,'确认日期')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<CheckDialog ref="child" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import check from '@/views/wms/st/checkbill/check'
|
||||
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 AddDialog from '@/views/wms/st/checkbill/AddDialog'
|
||||
import CheckDialog from '@/views/wms/st/checkbill/CheckDialog'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
export default {
|
||||
name: 'Check',
|
||||
components: { CheckDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户',
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},
|
||||
idField: 'check_id', url: 'api/check', crudMethod: { ...check },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['CHECK_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_TYPE_CK'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'check:add'],
|
||||
edit: ['admin', 'check:edit'],
|
||||
del: ['admin', 'check:del']
|
||||
},
|
||||
check_flag: true,
|
||||
downdtl_flag: true,
|
||||
confirm_flag: true,
|
||||
currentRow: null,
|
||||
storlist: []
|
||||
}
|
||||
},
|
||||
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: {
|
||||
canUd(row) {
|
||||
return row.status !== '10'
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.buss_type = ''
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
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
|
||||
this.downdtl_flag = false
|
||||
if (current.status === '10' || current.status === '20') {
|
||||
this.check_flag = false
|
||||
} else {
|
||||
this.check_flag = true
|
||||
}
|
||||
if (current.status === '20') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.CHECK_BILL_STATUS[row.status]
|
||||
},
|
||||
bill_typeFormat(row) {
|
||||
return this.dict.label.ST_INV_TYPE_CK[row.check_type]
|
||||
},
|
||||
create_modeFormat(row) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
is_nokFormat(row) {
|
||||
if (row.is_nok === '1') {
|
||||
return '异常'
|
||||
} else {
|
||||
return '正常'
|
||||
}
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current === null) {
|
||||
this.confirm_flag = true
|
||||
this.check_flag = true
|
||||
this.downdtl_flag = true
|
||||
this.currentRow = null
|
||||
}
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.bill_status !== '99'
|
||||
},
|
||||
checkOpen() {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.child.setForm(this.currentRow)
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.child2.setForm(this.currentRow)
|
||||
}
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
submitCheck() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
check.confirm(this.currentRow).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user