Merge remote-tracking branch 'origin/master_1' into master_1
This commit is contained in:
@@ -43,7 +43,7 @@ public enum IOSEnum {
|
|||||||
//出库单据类型
|
//出库单据类型
|
||||||
OUT_TYPE(MapOf.of("发货出库", "1001", "改切出库", "1003", "调拨出库", "1004", "拆箱出库", "1005",
|
OUT_TYPE(MapOf.of("发货出库", "1001", "改切出库", "1003", "调拨出库", "1004", "拆箱出库", "1005",
|
||||||
"返检出库", "1006", "超期报废", "1007", "退货报废", "1008", "质量问题报废", "1010", "其他报废", "1002",
|
"返检出库", "1006", "超期报废", "1007", "退货报废", "1008", "质量问题报废", "1010", "其他报废", "1002",
|
||||||
"手工出库", "1009"
|
"手工出库", "1009","管控出库", "1099"
|
||||||
)),
|
)),
|
||||||
|
|
||||||
//移库单据类型
|
//移库单据类型
|
||||||
|
|||||||
@@ -947,7 +947,9 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
|||||||
/*
|
/*
|
||||||
* 如果为返检出库或者改切出库删除对应的包装关系
|
* 如果为返检出库或者改切出库删除对应的包装关系
|
||||||
*/
|
*/
|
||||||
if (mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("返检出库")) || mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("改切出库"))) {
|
if (mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("返检出库")) || mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("改切出库"))
|
||||||
|
|| mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("管控出库"))
|
||||||
|
) {
|
||||||
|
|
||||||
// 查询库区
|
// 查询库区
|
||||||
String sect_in = disDaoList.stream()
|
String sect_in = disDaoList.stream()
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ public class StructivtController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/control")
|
||||||
|
@Log("查询管控库存")
|
||||||
|
//@PreAuthorize("@el.check('structivt:list')")
|
||||||
|
public ResponseEntity<Object> queryCntrol(@RequestParam Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
||||||
|
return new ResponseEntity<>(structivtService.queryCntrol(whereJson, page, product_area, ivt_flag), HttpStatus.OK);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增库存管理")
|
@Log("新增库存管理")
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ public interface StructivtService {
|
|||||||
*/
|
*/
|
||||||
Map<String, Object> queryAll(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag);
|
Map<String, Object> queryAll(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> queryCntrol(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有数据不分页
|
* 查询所有数据不分页
|
||||||
*
|
*
|
||||||
@@ -85,4 +94,5 @@ public interface StructivtService {
|
|||||||
void save(JSONObject whereJson);
|
void save(JSONObject whereJson);
|
||||||
|
|
||||||
void importExcel(MultipartFile file, HttpServletRequest request);
|
void importExcel(MultipartFile file, HttpServletRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,80 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryCntrol(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
||||||
|
String material = MapUtil.getStr(whereJson, "material");
|
||||||
|
String struct = MapUtil.getStr(whereJson, "struct");
|
||||||
|
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||||
|
String sect_id = MapUtil.getStr(whereJson, "sect_id");
|
||||||
|
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||||
|
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||||
|
String package_box_sn = MapUtil.getStr(whereJson, "package_box_sn");
|
||||||
|
String sale_order_name = MapUtil.getStr(whereJson, "sale_order_name");
|
||||||
|
String ivt_status = MapUtil.getStr(whereJson, "ivt_status");
|
||||||
|
String is_virtual = MapUtil.getStr(whereJson, "is_virtual");
|
||||||
|
String sub_type = MapUtil.getStr(whereJson, "sub_type");
|
||||||
|
String quality_scode = MapUtil.getStr(whereJson, "quality_scode");
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "11");
|
||||||
|
map.put("stor_id", stor_id);
|
||||||
|
map.put("sect_id", sect_id);
|
||||||
|
map.put("ivt_status", ivt_status);
|
||||||
|
map.put("is_virtual", is_virtual);
|
||||||
|
map.put("sub_type", sub_type);
|
||||||
|
map.put("quality_scode", quality_scode);
|
||||||
|
if (StrUtil.isNotEmpty(material)) {
|
||||||
|
map.put("material", "%" + material + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(struct)) {
|
||||||
|
map.put("struct", "%" + struct + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(pcsn)) {
|
||||||
|
map.put("pcsn", "%" + pcsn + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(sap_pcsn)) {
|
||||||
|
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(package_box_sn)) {
|
||||||
|
map.put("package_box_sn", "%" + package_box_sn + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(sale_order_name)) {
|
||||||
|
map.put("sale_order_name", "%" + sale_order_name + "%");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(product_area)) {
|
||||||
|
String areas = "(";
|
||||||
|
for (int i = 0; i < product_area.length; i++) {
|
||||||
|
if (i != product_area.length - 1) {
|
||||||
|
areas += "'" + product_area[i] + "',";
|
||||||
|
} else {
|
||||||
|
areas += "'" + product_area[i] + "')";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.put("areas", areas);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotNull(ivt_flag)) {
|
||||||
|
StringJoiner joiner = new StringJoiner(",", "(", ")");
|
||||||
|
for (String type : ivt_flag) {
|
||||||
|
joiner.add("'" + type + "'");
|
||||||
|
}
|
||||||
|
map.put("rein_flag", joiner.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取人员对应的仓库
|
||||||
|
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||||
|
String in_stor_id = userStorService.getInStor();
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(in_stor_id)) {
|
||||||
|
map.put("in_stor_id", in_stor_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jsonObject = WQL.getWO("QST_STRUCTIVT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "a.instorage_time desc,a.package_box_sn");
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StructivtDto> queryAll(Map whereJson) {
|
public List<StructivtDto> queryAll(Map whereJson) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt");
|
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt");
|
||||||
|
|||||||
@@ -209,6 +209,166 @@
|
|||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
IF 输入.flag = "11"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
a.*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
ivt.*,
|
||||||
|
sub.sap_pcsn,
|
||||||
|
sub.package_box_sn,
|
||||||
|
sub.quanlity_in_box,
|
||||||
|
sub.sale_order_name,
|
||||||
|
sub.box_weight,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS paper_type,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then plan.FRP_material end AS paper_code,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
|
||||||
|
CASE
|
||||||
|
WHEN SUBSTRING( sub.container_name, 1, 2 ) = 'BB' THEN
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '150' AND DATEDIFF( NOW(), sub.date_of_production ) <= '180' THEN '2'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <= '180' THEN '1'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '180' THEN '3'
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN SUBSTRING( sub.container_name, 1, 2 ) <> 'BB' THEN
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '60' AND DATEDIFF( NOW(), sub.date_of_production ) <= '90' THEN '2'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <= '90' THEN '1'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3'
|
||||||
|
END
|
||||||
|
END AS sub_type,
|
||||||
|
DATEDIFF( NOW(), dis.confirm_time ) AS stock_age,
|
||||||
|
DATEDIFF( NOW(), sub.date_of_production ) AS produce_age,
|
||||||
|
sub.joint_type,
|
||||||
|
dis.confirm_time
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
StructIvt.*,
|
||||||
|
attr.sect_id,
|
||||||
|
attr.sect_code,
|
||||||
|
attr.sect_name,
|
||||||
|
attr.stor_name,
|
||||||
|
attr.storagevehicle_code,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
unit.unit_name,
|
||||||
|
region.region_name
|
||||||
|
FROM
|
||||||
|
ST_IVT_StructIvt StructIvt
|
||||||
|
inner JOIN st_ivt_structattr attr ON StructIvt.struct_id = attr.struct_id
|
||||||
|
inner JOIN st_ivt_sectattr sect ON sect.sect_id = attr.sect_id
|
||||||
|
inner JOIN md_me_materialbase mater ON mater.material_id = StructIvt.material_id
|
||||||
|
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = StructIvt.qty_unit_id
|
||||||
|
LEFT JOIN SCH_BASE_Region region ON region.region_id = StructIvt.region_id
|
||||||
|
WHERE
|
||||||
|
attr.lock_type = '88'
|
||||||
|
and attr.stor_id in 输入.in_stor_id
|
||||||
|
OPTION 输入.struct <> ""
|
||||||
|
(
|
||||||
|
StructIvt.struct_code like 输入.struct or
|
||||||
|
StructIvt.struct_name like 输入.struct
|
||||||
|
)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.material <> ""
|
||||||
|
(
|
||||||
|
mater.material_code like 输入.material or
|
||||||
|
mater.material_name like 输入.material
|
||||||
|
)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.pcsn <> ""
|
||||||
|
StructIvt.pcsn like 输入.pcsn
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.quality_scode <> ""
|
||||||
|
StructIvt.quality_scode = 输入.quality_scode
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.is_virtual = "0"
|
||||||
|
sect.sect_type_attr <> '09'
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.is_virtual = "1"
|
||||||
|
sect.sect_type_attr = '09'
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.stor_id <> ""
|
||||||
|
attr.stor_id = 输入.stor_id
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.sect_id <> ""
|
||||||
|
attr.sect_id = 输入.sect_id
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.ivt_status = "canuse_qty"
|
||||||
|
StructIvt.canuse_qty > 0
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.ivt_status = "warehousing_qty"
|
||||||
|
StructIvt.warehousing_qty > 0
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.ivt_status = "frozen_qty"
|
||||||
|
StructIvt.frozen_qty > 0
|
||||||
|
ENDOPTION
|
||||||
|
) ivt
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt.pcsn AND ivt.storagevehicle_code = sub.package_box_sn
|
||||||
|
LEFT JOIN (SELECT
|
||||||
|
container_name,
|
||||||
|
MAX(paper_tube_or_FRP) AS paper_tube_or_FRP,
|
||||||
|
MAX(paper_tube_material) AS paper_tube_material,
|
||||||
|
MAX(paper_tube_description) AS paper_tube_description,
|
||||||
|
MAX(paper_tube_model) AS paper_tube_model,
|
||||||
|
MAX(FRP_material) AS FRP_material,
|
||||||
|
MAX(FRP_description) AS FRP_description,
|
||||||
|
MAX(FRP_model) AS FRP_model
|
||||||
|
FROM
|
||||||
|
pdm_bi_slittingproductionplan plan1
|
||||||
|
WHERE
|
||||||
|
plan1.is_delete = '0'
|
||||||
|
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
(
|
||||||
|
CASE
|
||||||
|
WHEN MAX(mst.bill_type) = '0001' THEN MIN( mst.confirm_time )
|
||||||
|
ELSE MAX( mst.confirm_time )
|
||||||
|
END
|
||||||
|
) AS confirm_time,
|
||||||
|
dis.pcsn
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdis dis
|
||||||
|
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||||
|
WHERE
|
||||||
|
mst.io_type = '0'
|
||||||
|
AND mst.bill_type IN ('0001','0006','0007')
|
||||||
|
AND mst.is_delete = '0'
|
||||||
|
GROUP BY
|
||||||
|
dis.pcsn
|
||||||
|
) dis ON dis.pcsn = ivt.pcsn
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
OPTION 输入.areas <> ""
|
||||||
|
(LEFT(sub.container_name,2) IN 输入.areas OR SUBSTRING(sub.container_name,2,2) IN 输入.areas)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.sap_pcsn <> ""
|
||||||
|
sub.sap_pcsn like 输入.sap_pcsn
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.package_box_sn <> ""
|
||||||
|
sub.package_box_sn like 输入.package_box_sn
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.sale_order_name <> ""
|
||||||
|
sub.sale_order_name like 输入.sale_order_name
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.rein_flag <> ""
|
||||||
|
IFNULL(sub.sub_type,'') in 输入.rein_flag
|
||||||
|
ENDOPTION
|
||||||
|
) a
|
||||||
|
WHERE 1=1
|
||||||
|
OPTION 输入.sub_type <> ""
|
||||||
|
a.sub_type = 输入.sub_type
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
IF 输入.flag = "2"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.nl.wms.control.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.wms.control.service.IStIvtControlmstService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控主表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/control")
|
||||||
|
public class StIvtControlmstController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtControlmstService iStIvtControlmstService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("分页查询")
|
||||||
|
public ResponseEntity<Object> queryAll(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(iStIvtControlmstService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryDtl")
|
||||||
|
@Log("查询明细")
|
||||||
|
public ResponseEntity<Object> queryAll(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(iStIvtControlmstService.queryDtl(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addSubmit")
|
||||||
|
@Log("新增管控单")
|
||||||
|
public ResponseEntity<Object> addSubmit(@RequestBody JSONObject whereJson) {
|
||||||
|
iStIvtControlmstService.addSubmit(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.nl.wms.control.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.control.service.dao.StIvtControldtl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控明细表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
public interface IStIvtControldtlService extends IService<StIvtControldtl> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增明细
|
||||||
|
* @param <T> 参数
|
||||||
|
*/
|
||||||
|
<T extends JSONObject>void instDtl(T whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package org.nl.wms.control.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.control.service.dao.StIvtControlmst;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控主表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
public interface IStIvtControlmstService extends IService<StIvtControlmst> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param whereJson 查询条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
Object queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param whereJson {
|
||||||
|
* bill_type: 0-1-2
|
||||||
|
* biz_date: 日期
|
||||||
|
* control_code:
|
||||||
|
* detail_count: 明细数
|
||||||
|
* remark: 备注
|
||||||
|
* stor_id: 仓库id
|
||||||
|
* total_qty: 总数量
|
||||||
|
* open_type: 0-锁定 1-解控 2-出库
|
||||||
|
* tableData: [
|
||||||
|
* box_no: 木箱号
|
||||||
|
* canuse_qty: 库存数
|
||||||
|
* material_id: 物料标识
|
||||||
|
* pcsn: 批次
|
||||||
|
* sap_pcsn: sap批次
|
||||||
|
* struct_id: 仓位编码
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void addSubmit(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询明细
|
||||||
|
* @param whereJson 主表dao
|
||||||
|
* @return List明细
|
||||||
|
*/
|
||||||
|
List<JSONObject> queryDtl(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package org.nl.wms.control.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控明细表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("st_ivt_controldtl")
|
||||||
|
public class StIvtControldtl implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管控明细标识
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String controldtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管控标识
|
||||||
|
*/
|
||||||
|
private String control_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细序号
|
||||||
|
*/
|
||||||
|
private BigDecimal seq_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 木箱号
|
||||||
|
*/
|
||||||
|
private String box_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量
|
||||||
|
*/
|
||||||
|
private BigDecimal qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位标识
|
||||||
|
*/
|
||||||
|
private String struct_id;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package org.nl.wms.control.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控主表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("st_ivt_controlmst")
|
||||||
|
public class StIvtControlmst implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管控标识
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String control_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据编号
|
||||||
|
*/
|
||||||
|
private String control_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务日期
|
||||||
|
*/
|
||||||
|
private String biz_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库标识
|
||||||
|
*/
|
||||||
|
private String stor_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总重量
|
||||||
|
*/
|
||||||
|
private BigDecimal total_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细数
|
||||||
|
*/
|
||||||
|
private BigDecimal detail_count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管控类型
|
||||||
|
*/
|
||||||
|
private String bill_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单人
|
||||||
|
*/
|
||||||
|
private String input_optid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单人姓名
|
||||||
|
*/
|
||||||
|
private String input_optname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单时间
|
||||||
|
*/
|
||||||
|
private String input_time;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.nl.wms.control.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.control.service.dao.StIvtControldtl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控明细表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
public interface StIvtControldtlMapper extends BaseMapper<StIvtControldtl> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询明细
|
||||||
|
* @param query 查询参数
|
||||||
|
* @return List<JSONObject>明细集合
|
||||||
|
*/
|
||||||
|
List<JSONObject> queryDtl(@Param("query") JSONObject query);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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.control.service.dao.mapper.StIvtControldtlMapper">
|
||||||
|
|
||||||
|
<select id="queryDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
dtl.*,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
sub.sap_pcsn,
|
||||||
|
attr.struct_code
|
||||||
|
FROM
|
||||||
|
st_ivt_controldtl dtl
|
||||||
|
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dtl.pcsn AND sub.package_box_sn = dtl.box_no
|
||||||
|
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = dtl.struct_id
|
||||||
|
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
|
||||||
|
<if test="query.control_id != null and query.control_id != ''">
|
||||||
|
and dtl.control_id = #{query.control_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.nl.wms.control.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.nl.wms.control.service.dao.StIvtControlmst;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控主表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
public interface StIvtControlmstMapper extends BaseMapper<StIvtControlmst> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param query: 查询条件
|
||||||
|
* @param pageQuery: 分页工具
|
||||||
|
* @return List<Map>
|
||||||
|
*/
|
||||||
|
List<Map> queryAll(@Param("query") Map query, @Param("pageQuery") Pageable pageQuery);
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?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.control.service.dao.mapper.StIvtControlmstMapper">
|
||||||
|
|
||||||
|
<select id="queryAll" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
mst.*,
|
||||||
|
attr.stor_code,
|
||||||
|
attr.stor_name
|
||||||
|
FROM
|
||||||
|
st_ivt_controlmst mst
|
||||||
|
INNER JOIN (
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
control_id
|
||||||
|
FROM
|
||||||
|
st_ivt_controldtl dtl
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
<if test="query.box_no != null and query.box_no != ''">
|
||||||
|
and box_no = #{query.box_no}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.pcsn != null and query.pcsn != ''">
|
||||||
|
and pcsn = #{query.pcsn}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
GROUP BY control_id
|
||||||
|
) dtl ON dtl.control_id = mst.control_id
|
||||||
|
LEFT JOIN st_ivt_bsrealstorattr attr ON attr.stor_id = mst.stor_id
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
|
||||||
|
<if test="query.control_code != null and query.control_code != ''">
|
||||||
|
and mst.control_code LIKE '%${query.control_code}%'
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.stor_id != null and query.stor_id != ''">
|
||||||
|
and mst.stor_id = #{query.stor_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.begin_time != null and query.begin_time != ''">
|
||||||
|
and mst.input_time > #{query.begin_time}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.end_time != null and query.end_time != ''">
|
||||||
|
and #{query.end_time} > mst.input_time
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.bill_type != null and query.bill_type != ''">
|
||||||
|
and mst.bill_type = #{query.bill_type}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.nl.wms.control.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.control.service.IStIvtControldtlService;
|
||||||
|
import org.nl.wms.control.service.dao.StIvtControldtl;
|
||||||
|
import org.nl.wms.control.service.dao.mapper.StIvtControldtlMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控明细表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtControldtlServiceImpl extends ServiceImpl<StIvtControldtlMapper, StIvtControldtl> implements IStIvtControldtlService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T extends JSONObject> void instDtl(T whereJson) {
|
||||||
|
String control_id = whereJson.getString("control_id");
|
||||||
|
List<JSONObject> tableDataList = whereJson.getJSONArray("tableData").toJavaList(JSONObject.class);
|
||||||
|
|
||||||
|
List<StIvtControldtl> paramList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < tableDataList.size(); i++) {
|
||||||
|
JSONObject json = tableDataList.get(i);
|
||||||
|
StIvtControldtl dtlDao = StIvtControldtl.builder()
|
||||||
|
.controldtl_id(IdUtil.getStringId())
|
||||||
|
.control_id(control_id)
|
||||||
|
.seq_no(BigDecimal.valueOf(i + 1))
|
||||||
|
.material_id(json.getString("material_id"))
|
||||||
|
.pcsn(json.getString("pcsn"))
|
||||||
|
.box_no(json.getString("box_no"))
|
||||||
|
.qty(json.getBigDecimal("canuse_qty"))
|
||||||
|
.struct_id(json.getString("struct_id"))
|
||||||
|
.build();
|
||||||
|
paramList.add(dtlDao);
|
||||||
|
}
|
||||||
|
this.saveBatch(paramList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
package org.nl.wms.control.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvOutService;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.utils.CodeUtil;
|
||||||
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wms.control.service.IStIvtControldtlService;
|
||||||
|
import org.nl.wms.control.service.IStIvtControlmstService;
|
||||||
|
import org.nl.wms.control.service.dao.StIvtControlmst;
|
||||||
|
import org.nl.wms.control.service.dao.mapper.StIvtControldtlMapper;
|
||||||
|
import org.nl.wms.control.service.dao.mapper.StIvtControlmstMapper;
|
||||||
|
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 库存管控主表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author author
|
||||||
|
* @since 2025-04-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtControlmstServiceImpl extends ServiceImpl<StIvtControlmstMapper, StIvtControlmst> implements IStIvtControlmstService {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 明细服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IStIvtControldtlService iStIvtControldtlService;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 明细mapper
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private StIvtControldtlMapper stIvtControldtlMapper;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 出库服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private CheckOutBillService checkOutBillService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二期出出库服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvOutService iStIvtIostorinvOutService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object queryAll(Map query, Pageable pageQuery) {
|
||||||
|
Page<Object> page = PageHelper.startPage(pageQuery.getPageNumber() + 1, pageQuery.getPageSize());
|
||||||
|
page.setOrderBy("input_time DESC");
|
||||||
|
List<Map> mst_detail = this.baseMapper.queryAll(query, pageQuery);
|
||||||
|
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||||
|
build.setTotalElements(page.getTotal());
|
||||||
|
return build;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void addSubmit(JSONObject whereJson) {
|
||||||
|
// 新增主表
|
||||||
|
StIvtControlmst mstDao = StIvtControlmst.builder()
|
||||||
|
.control_id(IdUtil.getStringId())
|
||||||
|
.control_code(CodeUtil.getNewCode("CONTORL_CODE"))
|
||||||
|
.biz_date(whereJson.getString("biz_date").substring(0, 10))
|
||||||
|
.stor_id(whereJson.getString("stor_id"))
|
||||||
|
.total_qty(whereJson.getBigDecimal("total_qty"))
|
||||||
|
.detail_count(BigDecimal.valueOf(whereJson.getJSONArray("tableData").size()))
|
||||||
|
.bill_type(whereJson.getString("bill_type"))
|
||||||
|
.remark(whereJson.getString("remark"))
|
||||||
|
.input_optid(SecurityUtils.getCurrentUserId())
|
||||||
|
.input_optname(SecurityUtils.getCurrentNickName())
|
||||||
|
.input_time(DateUtil.now())
|
||||||
|
.build();
|
||||||
|
this.save(mstDao);
|
||||||
|
|
||||||
|
// 新增明细
|
||||||
|
whereJson.put("control_id",mstDao.getControl_id());
|
||||||
|
iStIvtControldtlService.instDtl(whereJson);
|
||||||
|
|
||||||
|
// 锁定仓位库存
|
||||||
|
List<JSONObject> tableDataList = whereJson.getJSONArray("tableData").toJavaList(JSONObject.class);
|
||||||
|
lockStruct(whereJson.getString("open_type"),tableDataList);
|
||||||
|
|
||||||
|
// 如果是出库则生成出库单据
|
||||||
|
if (whereJson.getString("open_type").equals("2")) {
|
||||||
|
whereJson.put("source_code",mstDao.getControl_code());
|
||||||
|
createIos(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<JSONObject> queryDtl(JSONObject whereJson) {
|
||||||
|
return stIvtControldtlMapper.queryDtl(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 锁定仓位库存
|
||||||
|
* @param open_type 类型
|
||||||
|
* @param tableDataList 仓库库存集合
|
||||||
|
*/
|
||||||
|
private void lockStruct(String open_type, List<JSONObject> tableDataList) {
|
||||||
|
String struct_id_in = tableDataList.stream()
|
||||||
|
.map(row -> row.getString("struct_id"))
|
||||||
|
.collect(Collectors.joining("','"));
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("lock_type", open_type.equals("0") ? "88" : "1");
|
||||||
|
param.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||||
|
param.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||||
|
param.put("update_time",DateUtil.now() );
|
||||||
|
|
||||||
|
WQLObject.getWQLObject("st_ivt_structattr")
|
||||||
|
.update(param,"struct_id IN ('"+struct_id_in+"')");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建出库单据并分配
|
||||||
|
* @param whereJson 、
|
||||||
|
*/
|
||||||
|
private void createIos(JSONObject whereJson) {
|
||||||
|
JSONArray dtlAttr = whereJson.getJSONArray("tableData");
|
||||||
|
// 组织数据
|
||||||
|
JSONObject jsonOutMst = new JSONObject();
|
||||||
|
jsonOutMst.put("stor_id", whereJson.getString("stor_id"));
|
||||||
|
jsonOutMst.put("stor_code", whereJson.getString("stor_code"));
|
||||||
|
jsonOutMst.put("stor_name", whereJson.getString("stor_name"));
|
||||||
|
jsonOutMst.put("detail_count", dtlAttr.size());
|
||||||
|
jsonOutMst.put("bill_status", "10");
|
||||||
|
jsonOutMst.put("create_mode", "03");
|
||||||
|
jsonOutMst.put("biz_date", DateUtil.now());
|
||||||
|
jsonOutMst.put("io_type", "1");
|
||||||
|
jsonOutMst.put("buss_type", "1099");
|
||||||
|
jsonOutMst.put("bill_type", "1099");
|
||||||
|
jsonOutMst.put("source_name", "质量管控单:"+whereJson.getString("source_code"));
|
||||||
|
|
||||||
|
JSONArray tableData = new JSONArray();
|
||||||
|
for (int i = 0; i < dtlAttr.size(); i++) {
|
||||||
|
JSONObject json = dtlAttr.getJSONObject(i);
|
||||||
|
|
||||||
|
JSONObject jsonDtl = new JSONObject();
|
||||||
|
jsonDtl.put("pcsn", json.getString("pcsn"));
|
||||||
|
jsonDtl.put("box_no", json.getString("box_no"));
|
||||||
|
jsonDtl.put("material_id", json.getString("material_id"));
|
||||||
|
jsonDtl.put("qty_unit_id", json.getLongValue("qty_unit_id"));
|
||||||
|
jsonDtl.put("qty_unit_name", json.getString("qty_unit_name"));
|
||||||
|
jsonDtl.put("plan_qty", json.getDoubleValue("plan_qty"));
|
||||||
|
tableData.add(jsonDtl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用出库新增并分配
|
||||||
|
jsonOutMst.put("tableData", tableData);
|
||||||
|
String iostorinv_id = checkOutBillService.insertDtl(jsonOutMst);
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("iostorinv_id", iostorinv_id);
|
||||||
|
// 分配
|
||||||
|
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||||
|
jsonObject.put("div_type", "1");
|
||||||
|
iStIvtIostorinvOutService.allDiv(jsonObject);
|
||||||
|
} else {
|
||||||
|
checkOutBillService.allDiv(jsonObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,9 +14,11 @@ import com.alibaba.excel.write.metadata.WriteSheet;
|
|||||||
import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -25,6 +27,8 @@ import org.nl.modules.wql.WQL;
|
|||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.modules.wql.util.WqlUtil;
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
|
import org.nl.system.service.dept.ISysUserDeptService;
|
||||||
|
import org.nl.system.service.dept.dao.SysUserDept;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||||
@@ -72,6 +76,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
private final HandMoveStorAcsTask moveStorAcsTask;
|
private final HandMoveStorAcsTask moveStorAcsTask;
|
||||||
private final InAndOutReturnService inAndOutReturnService;
|
private final InAndOutReturnService inAndOutReturnService;
|
||||||
private final RedissonClient redissonClient;
|
private final RedissonClient redissonClient;
|
||||||
|
private final ISysUserDeptService iSysUserDeptService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) {
|
public Map<String, Object> pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) {
|
||||||
@@ -232,6 +238,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||||
map.put("stor_id", MapUtil.getStr(whereJson, "stor_id"));
|
map.put("stor_id", MapUtil.getStr(whereJson, "stor_id"));
|
||||||
|
map.put("lock_type", MapUtil.getStr(whereJson, "lock_type"));
|
||||||
map.put("canuse_qty", "0");
|
map.put("canuse_qty", "0");
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||||
@@ -823,6 +830,32 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONArray getOutBillDtl(Map whereJson) {
|
public JSONArray getOutBillDtl(Map whereJson) {
|
||||||
|
// 判断此人员是否有权限
|
||||||
|
JSONObject mst = WQLObject.getWQLObject("st_ivt_iostorinv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'")
|
||||||
|
.uniqueResult(0);
|
||||||
|
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
List<SysUserDept> deptList = iSysUserDeptService.list(
|
||||||
|
new QueryWrapper<SysUserDept>().lambda()
|
||||||
|
.eq(SysUserDept::getUser_id, currentUserId)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (mst.getString("bill_type").equals(IOSEnum.OUT_TYPE.code("管控出库"))) {
|
||||||
|
boolean flag = deptList.stream()
|
||||||
|
.anyMatch(row -> row.getDept_id().toString().equals("9"));
|
||||||
|
|
||||||
|
if (!flag) {
|
||||||
|
throw new BadRequestException("当前为【管控出库】您当前没有分配权限!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
boolean flag = deptList.stream()
|
||||||
|
.anyMatch(row -> row.getDept_id().toString().equals("9"));
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
throw new BadRequestException("您当前没有分配权限!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
whereJson.put("flag", "2");
|
whereJson.put("flag", "2");
|
||||||
JSONArray jo = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
JSONArray jo = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||||
.addParamMap((HashMap) whereJson)
|
.addParamMap((HashMap) whereJson)
|
||||||
@@ -4944,7 +4977,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if ("1003".equals(out_jo.getString("bill_type")) || "1006".equals(out_jo.getString("bill_type"))) {
|
if ("1003".equals(out_jo.getString("bill_type")) || "1006".equals(out_jo.getString("bill_type"))
|
||||||
|
|| "1099".equals(out_jo.getString("bill_type"))
|
||||||
|
) {
|
||||||
//如果为返检出库或者改切出库删除对应的包装关系
|
//如果为返检出库或者改切出库删除对应的包装关系
|
||||||
JSONArray dis_rows = new JSONArray();
|
JSONArray dis_rows = new JSONArray();
|
||||||
if (jo_mst.getString("is_overdue").equals("1")) {
|
if (jo_mst.getString("is_overdue").equals("1")) {
|
||||||
@@ -5559,7 +5594,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
mst_wql.insert(jo_mst);
|
mst_wql.insert(jo_mst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("1003".equals(out_jo.getString("bill_type")) || "1006".equals(out_jo.getString("bill_type"))) {
|
if ("1003".equals(out_jo.getString("bill_type")) || "1006".equals(out_jo.getString("bill_type"))
|
||||||
|
|| "1099".equals(out_jo.getString("bill_type"))
|
||||||
|
) {
|
||||||
//如果为返检出库或者改切出库删除对应的包装关系
|
//如果为返检出库或者改切出库删除对应的包装关系
|
||||||
JSONArray dis_rows = new JSONArray();
|
JSONArray dis_rows = new JSONArray();
|
||||||
if (jo_mst.getString("is_overdue").equals("1")) {
|
if (jo_mst.getString("is_overdue").equals("1")) {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
输入.thickness_request TYPEAS s_string
|
输入.thickness_request TYPEAS s_string
|
||||||
输入.width_standard TYPEAS s_string
|
输入.width_standard TYPEAS s_string
|
||||||
输入.task_group_id TYPEAS s_string
|
输入.task_group_id TYPEAS s_string
|
||||||
|
输入.lock_type TYPEAS s_string
|
||||||
输入.in_stor_id TYPEAS f_string
|
输入.in_stor_id TYPEAS f_string
|
||||||
输入.struct_codes TYPEAS f_string
|
输入.struct_codes TYPEAS f_string
|
||||||
输入.storIds TYPEAS f_string
|
输入.storIds TYPEAS f_string
|
||||||
@@ -960,6 +961,10 @@
|
|||||||
attr.struct_code like 输入.struct_code
|
attr.struct_code like 输入.struct_code
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.lock_type <> ""
|
||||||
|
attr.lock_type = 输入.lock_type
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 返检出库:回传mes
|
// 返检出库:回传mes
|
||||||
if (StrUtil.equals(bill_type, "1006")) {
|
if (StrUtil.equals(bill_type, "1006") || StrUtil.equals(bill_type, "1099")) {
|
||||||
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
||||||
// 判断是否有未完成的任务
|
// 判断是否有未完成的任务
|
||||||
ifUnTask(disArr.toJavaList(JSONObject.class));
|
ifUnTask(disArr.toJavaList(JSONObject.class));
|
||||||
@@ -1546,7 +1546,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 返检出库:回传mes
|
// 返检出库:回传mes
|
||||||
if (StrUtil.equals(bill_type, "1006")) {
|
if (StrUtil.equals(bill_type, "1006") || StrUtil.equals(bill_type, "1099")) {
|
||||||
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
||||||
// 判断是否有未完成的任务
|
// 判断是否有未完成的任务
|
||||||
ifUnTask(disArr.toJavaList(JSONObject.class));
|
ifUnTask(disArr.toJavaList(JSONObject.class));
|
||||||
|
|||||||
438
lms/nladmin-ui/src/views/wms/control/ivt/index.vue
Normal file
438
lms/nladmin-ui/src/views/wms/control/ivt/index.vue
Normal file
@@ -0,0 +1,438 @@
|
|||||||
|
<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="90px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属库区">
|
||||||
|
<el-cascader
|
||||||
|
placeholder="所属库区"
|
||||||
|
:options="sects"
|
||||||
|
:props="{ checkStrictly: true }"
|
||||||
|
clearable
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;"
|
||||||
|
@change="sectQueryChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓位搜索">
|
||||||
|
<el-input
|
||||||
|
v-model="query.struct"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="仓位编码或名称"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料搜索">
|
||||||
|
<el-input
|
||||||
|
v-model="query.material"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="物料编码、名称或规格"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="木箱码">
|
||||||
|
<el-input
|
||||||
|
v-model="query.package_box_sn"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="木箱码"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="子卷号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.pcsn"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="子卷号"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="sap批次">
|
||||||
|
<el-input
|
||||||
|
v-model="query.sap_pcsn"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="sap批次"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="销售订单">
|
||||||
|
<el-input
|
||||||
|
v-model="query.sale_order_name"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
placeholder="销售订单"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库存状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.ivt_status"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="全部"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in ivtStatusList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产区域">
|
||||||
|
<el-select
|
||||||
|
v-model="query.product_area"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
size="mini"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.product_area"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是否虚拟">
|
||||||
|
<el-select
|
||||||
|
v-model="query.is_virtual"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.IS_OR_NOT"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="子卷状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.sub_type"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.SUB_TYPE"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库存类型">
|
||||||
|
<el-select
|
||||||
|
v-model="query.ivt_flag"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
size="mini"
|
||||||
|
style="width: 200px;"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in ivtTypeList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否退货">
|
||||||
|
<el-select
|
||||||
|
v-model="query.quality_scode"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
style="width: 200px;"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in ivtQualityList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation :crud="crud" />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<!--<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
:loading="showDtlLoading"
|
||||||
|
@click="downdtl"
|
||||||
|
>
|
||||||
|
导出Excel
|
||||||
|
</el-button>-->
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
size="mini"
|
||||||
|
style="width: 100%;"
|
||||||
|
@selection-change="crud.selectionChangeHandler"
|
||||||
|
>
|
||||||
|
<!-- <el-table-column type="selection" width="55" />-->
|
||||||
|
<el-table-column
|
||||||
|
prop="struct_code"
|
||||||
|
label="仓位编码"
|
||||||
|
:min-width="flexWidth('struct_code',crud.data,'仓位编码')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="struct_name"
|
||||||
|
label="仓位名称"
|
||||||
|
:min-width="flexWidth('struct_name',crud.data,'仓位名称')"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
|
||||||
|
<el-table-column prop="sect_name" label="库区" :min-width="flexWidth('sect_name',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="package_box_sn"
|
||||||
|
label="木箱码"
|
||||||
|
:min-width="flexWidth('package_box_sn',crud.data,'木箱码')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="quanlity_in_box"
|
||||||
|
label="子卷数"
|
||||||
|
:min-width="flexWidth('quanlity_in_box',crud.data,'子卷数')"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="pcsn" label="子卷号" :min-width="flexWidth('pcsn',crud.data,'子卷号')" />
|
||||||
|
<el-table-column prop="sap_pcsn" label="sap批次" :min-width="flexWidth('sap_pcsn',crud.data,'sap批次')" />
|
||||||
|
<el-table-column prop="sale_order_name" label="销售订单" :min-width="flexWidth('sale_order_name',crud.data,'销售订单')" />
|
||||||
|
<el-table-column prop="box_weight" label="毛重" :formatter="rounding2" />
|
||||||
|
<el-table-column prop="canuse_qty" label="可用数" :formatter="rounding" />
|
||||||
|
<el-table-column prop="frozen_qty" label="冻结数" :formatter="rounding" />
|
||||||
|
<el-table-column prop="ivt_qty" label="库存数" :formatter="rounding" />
|
||||||
|
<el-table-column prop="warehousing_qty" label="待入数" :formatter="rounding" />
|
||||||
|
<el-table-column prop="unit_name" label="计量单位" />
|
||||||
|
<el-table-column prop="confirm_time" label="入库时间" min-width="150" />
|
||||||
|
<el-table-column prop="stock_age" label="库龄" min-width="150" />
|
||||||
|
<el-table-column prop="joint_type" label="接头数" min-width="150" />
|
||||||
|
<el-table-column prop="sub_type" label="子卷状态" min-width="150" :formatter="formatSubType" />
|
||||||
|
<el-table-column prop="produce_age" label="生产时长(天)" min-width="120" />
|
||||||
|
<el-table-column prop="paper_type" label="品质类型" min-width="150" />
|
||||||
|
<el-table-column prop="paper_code" label="管件编码" min-width="150" />
|
||||||
|
<el-table-column prop="paper_name" label="管件描述" min-width="250" />
|
||||||
|
<!-- <el-table-column prop="remark" label="超期原因" min-width="250">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.remark"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="全部"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in remarkList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="120" fixed="right">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click.native.prevent="save(scope.row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>-->
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<UploadDialog :dialog-show.sync="viewShow" @tableChanged="querytable" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudStructivt from '@/views/wms/basedata/st/ivt/structivt'
|
||||||
|
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||||
|
import UploadDialog from '@/views/wms/basedata/st/ivt/UploadDialog'
|
||||||
|
import { download } from '@/api/data'
|
||||||
|
import { downloadFile } from '@/utils'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ControlIvt',
|
||||||
|
dicts: ['ST_QUALITY_SCODE', 'product_area', 'IS_OR_NOT', 'SUB_TYPE'],
|
||||||
|
components: { pagination, crudOperation, rrOperation, UploadDialog },
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '库存管理', url: 'api/structivt/control', idField: 'stockrecord_id', sort: 'stockrecord_id,desc',
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
showDtlLoading: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
},
|
||||||
|
crudMethod: { ...crudStructivt }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sects: [],
|
||||||
|
viewShow: false,
|
||||||
|
ivtStatusList: [
|
||||||
|
{ 'value': 'canuse_qty', 'label': '可用数' },
|
||||||
|
{ 'value': 'warehousing_qty', 'label': '待入数' },
|
||||||
|
{ 'value': 'frozen_qty', 'label': '冻结数' }
|
||||||
|
],
|
||||||
|
ivtTypeList: [
|
||||||
|
{ 'value': ' ', 'label': '生产' },
|
||||||
|
{ 'value': '2', 'label': '改切' },
|
||||||
|
{ 'value': '1', 'label': '返检' }
|
||||||
|
],
|
||||||
|
ivtQualityList: [
|
||||||
|
{ 'value': '01', 'label': '否' },
|
||||||
|
{ 'value': '02', 'label': '是' }
|
||||||
|
],
|
||||||
|
remarkList: [
|
||||||
|
{ 'value': '1', 'label': '客户原因' },
|
||||||
|
{ 'value': '2', 'label': '生产质量原因' },
|
||||||
|
{ 'value': '3', 'label': '市场原因' }
|
||||||
|
],
|
||||||
|
permission: {},
|
||||||
|
rules: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudUserStor.getSect({ 'stor_id': '' }).then(res => {
|
||||||
|
this.sects = res.content
|
||||||
|
})
|
||||||
|
this.crud.query.ivt_status = 'canuse_qty'
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 取两位小数点
|
||||||
|
rounding(row, column) {
|
||||||
|
return parseFloat(row[column.property]).toFixed(2)
|
||||||
|
},
|
||||||
|
rounding2(row, column) {
|
||||||
|
if (row.box_weight !== '') {
|
||||||
|
return parseFloat(row[column.property]).toFixed(2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatSubType(row) {
|
||||||
|
return this.dict.label.SUB_TYPE[row.sub_type]
|
||||||
|
},
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
hand(value) {
|
||||||
|
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()
|
||||||
|
},
|
||||||
|
querytable() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
downdtl() {
|
||||||
|
if (this.currentRow !== null) {
|
||||||
|
this.showDtlLoading = true
|
||||||
|
download('/api/structivt/download', this.crud.query).then(result => {
|
||||||
|
downloadFile(result, '成品库存', 'xlsx')
|
||||||
|
this.showDtlLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.showDtlLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Import() {
|
||||||
|
this.viewShow = true
|
||||||
|
},
|
||||||
|
save(row) {
|
||||||
|
crudStructivt.save(row).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
320
lms/nladmin-ui/src/views/wms/control/ivtcontrol/AddDialog.vue
Normal file
320
lms/nladmin-ui/src/views/wms/control/ivtcontrol/AddDialog.vue
Normal file
@@ -0,0 +1,320 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="库存管控"
|
||||||
|
append-to-body
|
||||||
|
fullscreen
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@open="open"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-row :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" type="primary" @click="submit">保存</el-button>
|
||||||
|
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</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="form.control_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="bill_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.bill_type"
|
||||||
|
disabled
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="业务类型"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.CONTORL_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="form.detail_count" 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="biz_date">
|
||||||
|
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<label slot="label">备 注:</label>
|
||||||
|
<el-input v-model="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 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"
|
||||||
|
style="width: 100%;"
|
||||||
|
border
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center" />
|
||||||
|
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="box_no" label="箱号" align="center" min-width="250px" show-overflow-tooltip />
|
||||||
|
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" width="150px" align="center" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="sap批次号" width="140px" align="center" />
|
||||||
|
<el-table-column prop="plan_qty" label="重量" width="150" align="center">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
||||||
|
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位号" width="140px" align="center" />
|
||||||
|
<el-table-column align="center" label="操作" width="120" fixed="right">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" :lock-type="lockType" @tableChanged="tableChanged" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud, form } from '@crud/crud'
|
||||||
|
import AddDtl from '@/views/wms/st/outbill/AddDtl'
|
||||||
|
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||||
|
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||||
|
import crudControl from '@/views/wms/control/ivtcontrol/control'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
control_code: '',
|
||||||
|
stor_id: '',
|
||||||
|
stor_code: '',
|
||||||
|
stor_name: '',
|
||||||
|
total_qty: '0',
|
||||||
|
detail_count: '0',
|
||||||
|
bill_type: '',
|
||||||
|
remark: '',
|
||||||
|
biz_date: new Date(),
|
||||||
|
tableData: []
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'AddDialog',
|
||||||
|
components: { AddDtl, crudControl },
|
||||||
|
mixins: [crud(), form(defaultForm)],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
openType: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
billType: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
lockType: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['CONTORL_TYPE'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
dtlShow: false,
|
||||||
|
storlist: [],
|
||||||
|
storId: null,
|
||||||
|
rules: {
|
||||||
|
stor_id: [
|
||||||
|
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
bill_type: [
|
||||||
|
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
biz_date: [
|
||||||
|
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.form.bill_type = this.billType
|
||||||
|
crudUserStor.getUserStor().then(res => {
|
||||||
|
this.storlist = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.form.stor_code = ''
|
||||||
|
this.form.stor_id = ''
|
||||||
|
this.form.total_qty = '0'
|
||||||
|
this.form.detail_count = '0'
|
||||||
|
this.form.bill_type = ''
|
||||||
|
this.form.remark = ''
|
||||||
|
this.form.tableData = []
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
|
if (this.form.tableData.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
queryDtl(index, row) {
|
||||||
|
if (this.form.stor_id === '') {
|
||||||
|
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.storId = this.form.stor_id
|
||||||
|
this.dtlShow = true
|
||||||
|
},
|
||||||
|
tableChanged(rows) {
|
||||||
|
const data = {
|
||||||
|
'data': rows
|
||||||
|
}
|
||||||
|
checkoutbill.queryBox(data).then(res => {
|
||||||
|
res.forEach((item) => {
|
||||||
|
debugger
|
||||||
|
if (this.form.tableData.length !== 0) {
|
||||||
|
this.flagnow = false
|
||||||
|
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||||
|
if (this.form.tableData[i].box_no === item.box_no && this.form.tableData[i].pcsn === item.pcsn) {
|
||||||
|
this.flagnow = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.flagnow) {
|
||||||
|
item.edit = true
|
||||||
|
this.form.tableData.splice(-1, 0, item)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
item.edit = true
|
||||||
|
this.form.tableData.splice(-1, 0, item)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.form.detail_count = this.form.tableData.length
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteRow(index, rows) {
|
||||||
|
const box_no = rows[index].box_no
|
||||||
|
let len = rows.length
|
||||||
|
while (len--) {
|
||||||
|
const obj = rows[len]
|
||||||
|
if (box_no === obj.box_no) {
|
||||||
|
const index = rows.indexOf(obj)
|
||||||
|
if (index > -1) { // 移除找到的指定元素
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||||
|
rows.splice(index, 1)
|
||||||
|
this.form.detail_count = this.form.tableData.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
// 0-新增管控 1-新增解控 2-新增出库
|
||||||
|
if (this.form.tableData.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.form.open_type = this.openType
|
||||||
|
crudControl.addSubmit(this.form).then(res => {
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
169
lms/nladmin-ui/src/views/wms/control/ivtcontrol/ViewDialog.vue
Normal file
169
lms/nladmin-ui/src/views/wms/control/ivtcontrol/ViewDialog.vue
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="库存管控详情"
|
||||||
|
append-to-body
|
||||||
|
fullscreen
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@open="open"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="20" style="border: 1px solid white">
|
||||||
|
<span />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>
|
||||||
|
</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="form.control_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库" prop="stor_name">
|
||||||
|
<el-input v-model="form.stor_name" placeholder="仓库名称" style="width: 210px" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="管控类型" prop="bill_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.bill_type"
|
||||||
|
disabled
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="业务类型"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.CONTORL_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="form.detail_count" 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="biz_date">
|
||||||
|
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<label slot="label">备 注:</label>
|
||||||
|
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div class="crud-opts2">
|
||||||
|
<span class="role-span">管控明细</span>
|
||||||
|
<span class="crud-opts-right2"/>
|
||||||
|
</div>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="tableDataDtl"
|
||||||
|
style="width: 100%;"
|
||||||
|
border
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center" />
|
||||||
|
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="box_no" label="箱号" align="center" min-width="250px" show-overflow-tooltip />
|
||||||
|
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" width="150px" align="center" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="sap批次号" width="140px" align="center" />
|
||||||
|
<el-table-column prop="qty" label="重量" width="150" align="center">
|
||||||
|
<template scope="scope">
|
||||||
|
<span>{{ scope.row.qty }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位号" width="140px" align="center" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud, form } from '@crud/crud'
|
||||||
|
import crudControl from '@/views/wms/control/ivtcontrol/control'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AddDialog',
|
||||||
|
components: {},
|
||||||
|
mixins: [crud()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
mstRow: {
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
type: Array
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['CONTORL_TYPE'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
dtlShow: false,
|
||||||
|
form: null,
|
||||||
|
tableDataDtl: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mstRow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.form = newValue
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.tableDataDtl = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.tableDataDtl = []
|
||||||
|
this.$emit('update:dialogShow', 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;
|
||||||
|
}
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
43
lms/nladmin-ui/src/views/wms/control/ivtcontrol/control.js
Normal file
43
lms/nladmin-ui/src/views/wms/control/ivtcontrol/control.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/control',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/control',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/control',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addSubmit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/control/addSubmit',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryDtl(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/control/queryDtl',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, addSubmit, queryDtl }
|
||||||
277
lms/nladmin-ui/src/views/wms/control/ivtcontrol/index.vue
Normal file
277
lms/nladmin-ui/src/views/wms/control/ivtcontrol/index.vue
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
<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.control_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="创建时间" prop="createTime">
|
||||||
|
<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.bill_type"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="管控类型"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.CONTORL_TYPE"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="木箱号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.box_no"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="木箱号"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="子卷号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.pcsn"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="子卷号"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="addDialog('0')"
|
||||||
|
>
|
||||||
|
新增管控
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="untieDialog('1')"
|
||||||
|
>
|
||||||
|
库存解绑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="outDialog('2')"
|
||||||
|
>
|
||||||
|
管控出库
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
size="mini"
|
||||||
|
:data="crud.data"
|
||||||
|
highlight-current-row
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column prop="control_code" label="单据号" :min-width="flexWidth('control_code',crud.data,'单据号')" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.control_code }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
|
||||||
|
<el-table-column prop="bill_type" label="管控类型" :min-width="flexWidth('bill_type',crud.data,'管控类型')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.CONTORL_TYPE[scope.row.bill_type] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="biz_date" label="业务日期" :min-width="flexWidth('biz_date',crud.data,'业务日期')" />
|
||||||
|
<el-table-column prop="detail_count" label="明细数" :min-width="flexWidth('detail_count',crud.data,'明细数')" />
|
||||||
|
<el-table-column prop="total_qty" label="总重量" :formatter="crud.formatNum3" :min-width="flexWidth('total_qty',crud.data,'总重量')" />
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',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>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<AddDialog :dialog-show.sync="addDialogShow" :open-type="open_type" :lock-type="lock_type" :bill-type="bill_type" />
|
||||||
|
<ViewDialog :dialog-show.sync="viewDialogShow" :mst-row="mstRow" :table-data="tableDataDtl" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudControl from '@/views/wms/control/ivtcontrol/control'
|
||||||
|
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 crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||||
|
import AddDialog from '@/views/wms/control/ivtcontrol/AddDialog'
|
||||||
|
import ViewDialog from '@/views/wms/control/ivtcontrol/ViewDialog'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ControlMst',
|
||||||
|
components: { crudOperation, rrOperation, udOperation, pagination, crudUserStor, AddDialog, ViewDialog },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '库存管控',
|
||||||
|
optShow: { add: false, reset: true },
|
||||||
|
idField: 'control_id',
|
||||||
|
url: '/api/control',
|
||||||
|
crudMethod: { ...crudControl }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
// 数据字典
|
||||||
|
dicts: ['CONTORL_TYPE'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'inbill:add'],
|
||||||
|
edit: ['admin', 'inbill:edit'],
|
||||||
|
del: ['admin', 'inbill:del']
|
||||||
|
},
|
||||||
|
storlist: [],
|
||||||
|
tableDataDtl: [],
|
||||||
|
open_type: null,
|
||||||
|
lock_type: null,
|
||||||
|
bill_type: null,
|
||||||
|
mstRow: null,
|
||||||
|
addDialogShow: false,
|
||||||
|
viewDialogShow: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
const that = this
|
||||||
|
window.onresize = function temp() {
|
||||||
|
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudUserStor.getUserStor().then(res => {
|
||||||
|
this.storlist = res
|
||||||
|
})
|
||||||
|
this.initQuery()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/* 搜索框创建时间默认最近一周*/
|
||||||
|
initQuery() {
|
||||||
|
const end = new Date()
|
||||||
|
const start = new Date()
|
||||||
|
const endYear = end.getFullYear()
|
||||||
|
var endMonth = end.getMonth() + 1
|
||||||
|
if (end.getMonth() + 1 < 10) {
|
||||||
|
endMonth = '0' + endMonth.toString()
|
||||||
|
}
|
||||||
|
var endDay = end.getDate()
|
||||||
|
if (end.getDate() < 10) {
|
||||||
|
endDay = '0' + endDay.toString()
|
||||||
|
}
|
||||||
|
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||||
|
const startYear = start.getFullYear()
|
||||||
|
var startMonth = start.getMonth() + 1
|
||||||
|
if (start.getMonth() + 1 < 10) {
|
||||||
|
startMonth = '0' + startMonth.toString()
|
||||||
|
}
|
||||||
|
var startDay = start.getDate()
|
||||||
|
if (start.getDate() < 10) {
|
||||||
|
startDay = '0' + startDay.toString()
|
||||||
|
}
|
||||||
|
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
|
||||||
|
this.$set(this.query, 'createTime', [startDate, endDate])
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
addDialog(type) {
|
||||||
|
this.open_type = type
|
||||||
|
this.addDialogShow = true
|
||||||
|
this.lock_type = '1'
|
||||||
|
this.bill_type = '0'
|
||||||
|
},
|
||||||
|
untieDialog(type) {
|
||||||
|
this.open_type = type
|
||||||
|
this.addDialogShow = true
|
||||||
|
this.lock_type = '88'
|
||||||
|
this.bill_type = '1'
|
||||||
|
},
|
||||||
|
outDialog(type) {
|
||||||
|
this.open_type = type
|
||||||
|
this.addDialogShow = true
|
||||||
|
this.lock_type = '88'
|
||||||
|
this.bill_type = '2'
|
||||||
|
},
|
||||||
|
toView(index, row) {
|
||||||
|
this.mstRow = row
|
||||||
|
this.viewDialogShow = true
|
||||||
|
crudControl.queryDtl({ 'control_id': row.control_id }).then(res => {
|
||||||
|
this.tableDataDtl = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -153,6 +153,9 @@ export default {
|
|||||||
},
|
},
|
||||||
storId: {
|
storId: {
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
lockType: {
|
||||||
|
type: String
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -179,6 +182,7 @@ export default {
|
|||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
this.crud.query.mater_type = this.opendtlParam
|
this.crud.query.mater_type = this.opendtlParam
|
||||||
this.crud.query.stor_id = this.storId
|
this.crud.query.stor_id = this.storId
|
||||||
|
this.crud.query.lock_type = this.lockType
|
||||||
if (this.openShow) {
|
if (this.openShow) {
|
||||||
this.openShow = false
|
this.openShow = false
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user