add:入库混料
This commit is contained in:
@@ -0,0 +1,73 @@
|
|||||||
|
package org.nl.wms.pdm_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.pdm_management.service.IMdPdmPackagingService;
|
||||||
|
import org.nl.wms.pdm_management.service.dao.MdPdmPackaging;
|
||||||
|
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 外包材收货记录 控制层
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/api/packaging")
|
||||||
|
@Slf4j
|
||||||
|
public class PackagingController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private final IMdPdmPackagingService iMdPdmPackagingService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("外包材收货分页查询")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||||
|
whereJson.put("is_transfer", IOSConstant.ZERO);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(iMdPdmPackagingService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryTransfer")
|
||||||
|
@Log("外包材转运分页查询")
|
||||||
|
public ResponseEntity<Object> queryTransfer(@RequestParam Map whereJson, PageQuery page) {
|
||||||
|
whereJson.put("is_transfer", IOSConstant.ONE);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(iMdPdmPackagingService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增外包材收货记录")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody MdPdmPackaging dto) {
|
||||||
|
iMdPdmPackagingService.create(dto);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改外包材收货记录")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody MdPdmPackaging dto) {
|
||||||
|
iMdPdmPackagingService.update(dto);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Log("删除外包材收货记录")
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
iMdPdmPackagingService.delete(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package org.nl.wms.pdm_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.pdm_management.service.dao.MdPdmPackaging;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 外包材收货记录表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
public interface IMdPdmPackagingService extends IService<MdPdmPackaging> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包材收货分页查询
|
||||||
|
*
|
||||||
|
* @param whereJson : {查询参数}
|
||||||
|
* @param page : 分页对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
IPage<JSONObject> queryAll(Map whereJson, PageQuery page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增外包材收货记录
|
||||||
|
*
|
||||||
|
* @param dto 外包材收货记录实体类
|
||||||
|
*/
|
||||||
|
void create(MdPdmPackaging dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改外包材收货记录
|
||||||
|
*
|
||||||
|
* @param dto 外包材收货记录实体类
|
||||||
|
*/
|
||||||
|
void update(MdPdmPackaging dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除外包材收货记录
|
||||||
|
*
|
||||||
|
* @param ids 标识集合
|
||||||
|
*/
|
||||||
|
void delete(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认转运
|
||||||
|
*
|
||||||
|
* @param dto 外包材收货记录实体类
|
||||||
|
*/
|
||||||
|
void confirmTransfer(MdPdmPackaging dto);
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package org.nl.wms.pdm_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-11-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("md_pdm_packaging")
|
||||||
|
public class MdPdmPackaging implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货标识id
|
||||||
|
*/
|
||||||
|
@TableId(value = "packing_id")
|
||||||
|
private String packing_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private BigDecimal qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货人
|
||||||
|
*/
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货人名称
|
||||||
|
*/
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货时间
|
||||||
|
*/
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转运点位
|
||||||
|
*/
|
||||||
|
private String point_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否转运
|
||||||
|
*/
|
||||||
|
private String is_transfer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.nl.wms.pdm_management.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.nl.wms.pdm_management.service.dao.MdPdmPackaging;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 外包材收货记录表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
public interface MdPdmPackagingMapper extends BaseMapper<MdPdmPackaging> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param page 分页条件
|
||||||
|
* @param whereJson 查询条件
|
||||||
|
* @return IPage<StIvtMoveinv>
|
||||||
|
*/
|
||||||
|
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?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.pdm_management.service.dao.mapper.MdPdmPackagingMapper">
|
||||||
|
|
||||||
|
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
pack.*,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
mater.material_spec,
|
||||||
|
mater.material_model
|
||||||
|
FROM
|
||||||
|
md_pdm_packaging pack
|
||||||
|
INNER JOIN md_me_materialbase mater ON mater.material_id = pack.material_id
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="param.material_code != null and param.material_code != ''">
|
||||||
|
AND
|
||||||
|
(mater.material_code LIKE #{param.material_code} or
|
||||||
|
mater.material_name LIKE #{param.material_code} )
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.create_name != null and param.create_name != ''">
|
||||||
|
AND
|
||||||
|
pack.create_name LIKE #{param.create_name}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.is_transfer != null and param.is_transfer != ''">
|
||||||
|
AND
|
||||||
|
pack.is_transfer = #{param.is_transfer}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.pcsn != null and param.pcsn != ''">
|
||||||
|
AND
|
||||||
|
pack.pcsn LIKE #{param.pcsn}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY pack.create_time Desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package org.nl.wms.pdm_management.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
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.IdUtil;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.pdm_management.service.IMdPdmPackagingService;
|
||||||
|
import org.nl.wms.pdm_management.service.dao.MdPdmPackaging;
|
||||||
|
import org.nl.wms.pdm_management.service.dao.mapper.MdPdmPackagingMapper;
|
||||||
|
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 外包材收货记录表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MdPdmPackagingServiceImpl extends ServiceImpl<MdPdmPackagingMapper, MdPdmPackaging> implements IMdPdmPackagingService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IMdPdmPackagingService iMdPdmPackagingService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||||
|
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||||
|
whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void create(MdPdmPackaging dto) {
|
||||||
|
if (ObjectUtil.isNotEmpty(dto.getPoint_code())) {
|
||||||
|
// 外包材转运操作
|
||||||
|
iMdPdmPackagingService.confirmTransfer(dto);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询此物料此批次是否有收过货的
|
||||||
|
MdPdmPackaging packDao = this.baseMapper.selectOne(
|
||||||
|
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||||
|
.eq(MdPdmPackaging::getMaterial_id, dto.getMaterial_id())
|
||||||
|
.eq(MdPdmPackaging::getPcsn, dto.getPcsn())
|
||||||
|
.eq(MdPdmPackaging::getIs_transfer, IOSConstant.ZERO)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(packDao)) {
|
||||||
|
// 数量叠加
|
||||||
|
packDao.setQty(NumberUtil.add(packDao.getQty(), dto.getQty()));
|
||||||
|
packDao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
packDao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
packDao.setCreate_time(DateUtil.now());
|
||||||
|
this.updateById(packDao);
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
dto.setPacking_id(IdUtil.getStringId());
|
||||||
|
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
dto.setCreate_time(DateUtil.now());
|
||||||
|
this.save(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void update(MdPdmPackaging dto) {
|
||||||
|
this.updateById(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void delete(Set<String> ids) {
|
||||||
|
this.baseMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void confirmTransfer(MdPdmPackaging dto) {
|
||||||
|
MdPdmPackaging mdPdmPackaging = this.baseMapper.selectOne(
|
||||||
|
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||||
|
.eq(MdPdmPackaging::getMaterial_id, dto.getMaterial_id())
|
||||||
|
.eq(MdPdmPackaging::getPcsn, dto.getPcsn())
|
||||||
|
);
|
||||||
|
|
||||||
|
mdPdmPackaging.setIs_transfer(IOSConstant.ONE);
|
||||||
|
mdPdmPackaging.setPoint_code(dto.getPoint_code());
|
||||||
|
mdPdmPackaging.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
mdPdmPackaging.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
mdPdmPackaging.setCreate_time(DateUtil.now());
|
||||||
|
this.updateById(mdPdmPackaging);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -112,4 +112,10 @@ public class RawAssistIStorController {
|
|||||||
public ResponseEntity<Object> getInBillTaskDtl(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> getInBillTaskDtl(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(iRawAssistIStorService.getInBillTaskDtl(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(iRawAssistIStorService.getInBillTaskDtl(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getVehicleGroup")
|
||||||
|
@Log("根据托盘查询此托盘下的所有已经组盘的记录")
|
||||||
|
public ResponseEntity<Object> getVehicleGroup(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(iRawAssistIStorService.getVehicleGroup(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public interface IRawAssistIStorService extends IService<IOStorInv> {
|
|||||||
void unDivStruct(Map whereJson);
|
void unDivStruct(Map whereJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置站带你
|
* 设置站点
|
||||||
*
|
*
|
||||||
* @param whereJson {
|
* @param whereJson {
|
||||||
* <p>
|
* <p>
|
||||||
@@ -151,4 +151,13 @@ public interface IRawAssistIStorService extends IService<IOStorInv> {
|
|||||||
List<IOStorInvDisDto> getInBillTaskDtl(Map whereJson);
|
List<IOStorInvDisDto> getInBillTaskDtl(Map whereJson);
|
||||||
|
|
||||||
String insertPdaDtl(JSONObject whereJson);
|
String insertPdaDtl(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据托盘查询此托盘下的所有已经组盘的记录
|
||||||
|
* @param whereJson {
|
||||||
|
* rows: []
|
||||||
|
* }
|
||||||
|
* @return List<JSONObject>
|
||||||
|
*/
|
||||||
|
List<JSONObject> getVehicleGroup(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,4 +27,6 @@ public interface IOStorInvMapper extends BaseMapper<IOStorInv> {
|
|||||||
|
|
||||||
IPage<IOStorInv> queryOutBillPage (IPage<IOStorInv> page,@Param("params") Map whereJson);
|
IPage<IOStorInv> queryOutBillPage (IPage<IOStorInv> page,@Param("params") Map whereJson);
|
||||||
|
|
||||||
|
List<JSONObject> getVehicleGroup ( List<String> collect);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,4 +183,32 @@
|
|||||||
</where>
|
</where>
|
||||||
ORDER BY ios.iostorinv_id Desc
|
ORDER BY ios.iostorinv_id Desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getVehicleGroup" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
gp.*,
|
||||||
|
gp.qty AS plan_qty,
|
||||||
|
gp.vehicle_code AS storagevehicle_code,
|
||||||
|
mtl.material_id,
|
||||||
|
mtl.material_code,
|
||||||
|
mtl.material_name,
|
||||||
|
mtl.material_spec,
|
||||||
|
supp.supp_name
|
||||||
|
FROM
|
||||||
|
md_pb_groupplate gp
|
||||||
|
LEFT JOIN md_me_materialbase mtl ON gp.material_id = mtl.material_id
|
||||||
|
LEFT JOIN md_cs_supplierbase supp ON supp.supp_code = gp.supp_code
|
||||||
|
|
||||||
|
<where>
|
||||||
|
gp.status = '1'
|
||||||
|
<if test="collect != null and collect != ''">
|
||||||
|
AND gp.vehicle_code IN
|
||||||
|
<foreach collection="collect" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY gp.create_time DESC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Liuxy
|
* @author Liuxy
|
||||||
@@ -413,7 +415,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
strategyDaoList.add(strategyDao);
|
strategyDaoList.add(strategyDao);
|
||||||
|
|
||||||
jo_form.put("sect_code", sectDao.getSect_code());
|
jo_form.put("sect_code", sectDao.getSect_code());
|
||||||
jo_form.put("stor_code",storDao.getStor_code());
|
jo_form.put("stor_code", storDao.getStor_code());
|
||||||
jo_form.put("storagevehicle_code", map.get("storagevehicle_code"));
|
jo_form.put("storagevehicle_code", map.get("storagevehicle_code"));
|
||||||
jo_form.put("strategyMaters", strategyDaoList);
|
jo_form.put("strategyMaters", strategyDaoList);
|
||||||
// 调用自动分配
|
// 调用自动分配
|
||||||
@@ -465,16 +467,34 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
.set(IOStorInvDis::getStruct_id, dis_map.getString("struct_id"))
|
.set(IOStorInvDis::getStruct_id, dis_map.getString("struct_id"))
|
||||||
.set(IOStorInvDis::getStruct_code, dis_map.getString("struct_code"))
|
.set(IOStorInvDis::getStruct_code, dis_map.getString("struct_code"))
|
||||||
.set(IOStorInvDis::getStruct_name, dis_map.getString("struct_name"))
|
.set(IOStorInvDis::getStruct_name, dis_map.getString("struct_name"))
|
||||||
.eq(IOStorInvDis::getIostorinvdis_id, map.get("iostorinvdis_id"))
|
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||||
|
.eq(IOStorInvDis::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||||
|
);
|
||||||
|
|
||||||
|
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(
|
||||||
|
new QueryWrapper<IOStorInvDis>().lambda()
|
||||||
|
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||||
|
.eq(IOStorInvDis::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||||
|
);
|
||||||
|
List<IOStorInvDtl> dtlList = ioStorInvDtlMapper.selectList(
|
||||||
|
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||||
|
.eq(IOStorInvDtl::getIostorinv_id, disList.get(0).getIostorinv_id())
|
||||||
|
.in(IOStorInvDtl::getPcsn, disList.stream()
|
||||||
|
.map(IOStorInvDis::getPcsn)
|
||||||
|
.collect(Collectors.toList()))
|
||||||
);
|
);
|
||||||
|
|
||||||
//维护单据明细表里 分配数量
|
//维护单据明细表里 分配数量
|
||||||
JSONObject jsonObject = new JSONObject();
|
dtlList.forEach(row -> {
|
||||||
jsonObject.put("iostorinvdtl_id", map.get("iostorinvdtl_id"));
|
IOStorInvDis dis = disList.stream()
|
||||||
jsonObject.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
.filter(item -> item.getPcsn().equals(row.getPcsn()))
|
||||||
jsonObject.put("assign_qty", map.get("plan_qty"));
|
.findFirst().orElse(null);
|
||||||
jsonObject.put("unassign_qty", "0");
|
|
||||||
ioStorInvDtlMapper.updateById(jsonObject.toJavaObject(IOStorInvDtl.class));
|
row.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
|
||||||
|
row.setAssign_qty(dis.getPlan_qty());
|
||||||
|
row.setUnassign_qty(BigDecimal.ZERO);
|
||||||
|
ioStorInvDtlMapper.updateById(row);
|
||||||
|
});
|
||||||
|
|
||||||
//根据单据标识判断分配明细是否都已经分配完成
|
//根据单据标识判断分配明细是否都已经分配完成
|
||||||
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||||
@@ -518,16 +538,34 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
.set(IOStorInvDis::getStruct_id, null)
|
.set(IOStorInvDis::getStruct_id, null)
|
||||||
.set(IOStorInvDis::getStruct_code, null)
|
.set(IOStorInvDis::getStruct_code, null)
|
||||||
.set(IOStorInvDis::getStruct_name, null)
|
.set(IOStorInvDis::getStruct_name, null)
|
||||||
.eq(IOStorInvDis::getIostorinvdis_id, jo.get("iostorinvdis_id"))
|
.eq(IOStorInvDis::getIostorinv_id, jo.get("iostorinv_id"))
|
||||||
|
.eq(IOStorInvDis::getStoragevehicle_code, jo.get("storagevehicle_code"))
|
||||||
|
);
|
||||||
|
|
||||||
|
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(
|
||||||
|
new QueryWrapper<IOStorInvDis>().lambda()
|
||||||
|
.eq(IOStorInvDis::getIostorinv_id, jo.get("iostorinv_id"))
|
||||||
|
.eq(IOStorInvDis::getStoragevehicle_code, jo.get("storagevehicle_code"))
|
||||||
|
);
|
||||||
|
List<IOStorInvDtl> dtlList = ioStorInvDtlMapper.selectList(
|
||||||
|
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||||
|
.eq(IOStorInvDtl::getIostorinv_id, disList.get(0).getIostorinv_id())
|
||||||
|
.in(IOStorInvDtl::getPcsn, disList.stream()
|
||||||
|
.map(IOStorInvDis::getPcsn)
|
||||||
|
.collect(Collectors.toList()))
|
||||||
);
|
);
|
||||||
|
|
||||||
//维护单据明细表里 分配数量
|
//维护单据明细表里 分配数量
|
||||||
JSONObject jsonObject = new JSONObject();
|
dtlList.forEach(row -> {
|
||||||
jsonObject.put("iostorinvdtl_id", jo.get("iostorinvdtl_id"));
|
IOStorInvDis dis = disList.stream()
|
||||||
jsonObject.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
.filter(item -> item.getPcsn().equals(row.getPcsn()))
|
||||||
jsonObject.put("assign_qty", "0");
|
.findFirst().orElse(null);
|
||||||
jsonObject.put("unassign_qty", jo.get("plan_qty"));
|
|
||||||
ioStorInvDtlMapper.updateById(jsonObject.toJavaObject(IOStorInvDtl.class));
|
row.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||||
|
row.setAssign_qty(BigDecimal.ZERO);
|
||||||
|
row.setUnassign_qty(dis.getPlan_qty());
|
||||||
|
ioStorInvDtlMapper.updateById(row);
|
||||||
|
});
|
||||||
|
|
||||||
//根据单据标识判断分配明细是否都已经分配完成
|
//根据单据标识判断分配明细是否都已经分配完成
|
||||||
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||||
@@ -574,13 +612,19 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
String task_id = task.create(task_form);
|
String task_id = task.create(task_form);
|
||||||
|
|
||||||
//分配明细表更新任务相关数据
|
//分配明细表更新任务相关数据
|
||||||
IOStorInvDis dis = new IOStorInvDis();
|
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(
|
||||||
dis.setIostorinvdis_id(map.get("iostorinvdis_id"));
|
new QueryWrapper<IOStorInvDis>().lambda()
|
||||||
dis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("生成"));
|
.eq(IOStorInvDis::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||||
dis.setTask_id(task_id);
|
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||||
dis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("是"));
|
);
|
||||||
dis.setPoint_code(point_code);
|
|
||||||
ioStorInvDisMapper.updateById(dis);
|
disList.forEach(row -> {
|
||||||
|
row.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("生成"));
|
||||||
|
row.setTask_id(task_id);
|
||||||
|
row.setIs_issued(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||||
|
row.setPoint_code(point_code);
|
||||||
|
ioStorInvDisMapper.updateById(row);
|
||||||
|
});
|
||||||
return task_id;
|
return task_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -679,87 +723,90 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(
|
||||||
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
new QueryWrapper<IOStorInvDis>().lambda()
|
||||||
|
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
||||||
);
|
);
|
||||||
if (ObjectUtil.isEmpty(ioStorInvDis)) {
|
|
||||||
|
if (ObjectUtil.isEmpty(disList)) {
|
||||||
throw new BadRequestException("未找到任务对应的分配明细");
|
throw new BadRequestException("未找到任务对应的分配明细");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 完成当前分配明细
|
for (IOStorInvDis ioStorInvDis : disList) {
|
||||||
ioStorInvDisMapper.update(ioStorInvDis, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
// 完成当前分配明细
|
||||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
ioStorInvDisMapper.update(ioStorInvDis, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||||
.set(IOStorInvDis::getReal_qty, ioStorInvDis.getPlan_qty())
|
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||||
.eq(IOStorInvDis::getIostorinvdis_id, ioStorInvDis.getIostorinvdis_id())
|
.set(IOStorInvDis::getReal_qty, ioStorInvDis.getPlan_qty())
|
||||||
);
|
.eq(IOStorInvDis::getIostorinvdis_id, ioStorInvDis.getIostorinvdis_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
//修改库存
|
||||||
|
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||||
|
JSONObject jsonIvt = new JSONObject();
|
||||||
|
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
||||||
|
jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||||
|
jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||||
|
jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||||
|
jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||||
|
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||||
|
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||||
|
updateIvtList.add(jsonIvt);
|
||||||
|
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||||
|
|
||||||
|
//更新组盘记录表
|
||||||
|
groupPlateMapper.update(new GroupPlate(), new LambdaUpdateWrapper<>(GroupPlate.class)
|
||||||
|
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||||
|
.eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
|
||||||
|
.eq(GroupPlate::getVehicle_code, ioStorInvDis.getStoragevehicle_code())
|
||||||
|
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
|
||||||
|
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||||
|
);
|
||||||
|
// 查询该明细下是否还有未完成的分配明细
|
||||||
|
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||||
|
.eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id())
|
||||||
|
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 明细
|
||||||
|
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||||
|
if (ObjectUtil.isEmpty(ioStorInvDtl)) {
|
||||||
|
throw new BadRequestException("未找到明细");
|
||||||
|
}
|
||||||
|
// 如果分配明细全部完成则更新明细表状态
|
||||||
|
if (countDis == 0) {
|
||||||
|
// 更新明细表状态
|
||||||
|
ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty());
|
||||||
|
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||||
|
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||||
|
|
||||||
|
// 查看明细是否全部完成
|
||||||
|
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||||
|
.eq(IOStorInvDtl::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
|
||||||
|
.ne(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 如果明细全部完成则更新主表状态
|
||||||
|
if (countDtl == 0) {
|
||||||
|
//更新主表状态
|
||||||
|
ioStorInvMapper.update(new IOStorInv(), new LambdaUpdateWrapper<>(IOStorInv.class)
|
||||||
|
.set(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||||
|
.set(IOStorInv::getConfirm_optid, currentUserId)
|
||||||
|
.set(IOStorInv::getConfirm_optname, nickName)
|
||||||
|
.set(IOStorInv::getConfirm_time, now)
|
||||||
|
.eq(IOStorInv::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//解锁库位
|
//解锁库位
|
||||||
JSONObject finish_map = new JSONObject();
|
JSONObject finish_map = new JSONObject();
|
||||||
finish_map.put("struct_code", ioStorInvDis.getStruct_code());
|
finish_map.put("struct_code", disList.get(0).getStruct_code());
|
||||||
finish_map.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
finish_map.put("storagevehicle_code", disList.get(0).getStoragevehicle_code());
|
||||||
finish_map.put("inv_type", null);
|
finish_map.put("inv_type", null);
|
||||||
finish_map.put("inv_id", null);
|
finish_map.put("inv_id", null);
|
||||||
finish_map.put("inv_code", null);
|
finish_map.put("inv_code", null);
|
||||||
iStructattrService.updateStatusByCode("1", finish_map);
|
iStructattrService.updateStatusByCode("1", finish_map);
|
||||||
|
|
||||||
//修改库存
|
|
||||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
|
||||||
JSONObject jsonIvt = new JSONObject();
|
|
||||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
|
||||||
jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
|
||||||
jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
|
||||||
jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
|
||||||
jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
|
||||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
|
||||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
|
||||||
updateIvtList.add(jsonIvt);
|
|
||||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
|
||||||
|
|
||||||
//更新组盘记录表
|
|
||||||
groupPlateMapper.update(new GroupPlate(), new LambdaUpdateWrapper<>(GroupPlate.class)
|
|
||||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
|
||||||
.eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
|
|
||||||
.eq(GroupPlate::getVehicle_code, ioStorInvDis.getStoragevehicle_code())
|
|
||||||
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
|
|
||||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
|
||||||
);
|
|
||||||
|
|
||||||
// 查询该明细下是否还有未完成的分配明细
|
|
||||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
|
||||||
.eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id())
|
|
||||||
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
|
||||||
);
|
|
||||||
|
|
||||||
// 明细
|
|
||||||
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
|
||||||
if (ObjectUtil.isEmpty(ioStorInvDtl)) {
|
|
||||||
throw new BadRequestException("未找到明细");
|
|
||||||
}
|
|
||||||
// 如果分配明细全部完成则更新明细表状态
|
|
||||||
if (countDis == 0) {
|
|
||||||
// 更新明细表状态
|
|
||||||
ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty());
|
|
||||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
|
||||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
|
||||||
|
|
||||||
// 查看明细是否全部完成
|
|
||||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
|
||||||
.eq(IOStorInvDtl::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
|
|
||||||
.ne(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
|
||||||
);
|
|
||||||
|
|
||||||
// 如果明细全部完成则更新主表状态
|
|
||||||
if (countDtl == 0) {
|
|
||||||
//更新主表状态
|
|
||||||
ioStorInvMapper.update(new IOStorInv(), new LambdaUpdateWrapper<>(IOStorInv.class)
|
|
||||||
.set(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
|
||||||
.set(IOStorInv::getConfirm_optid, currentUserId)
|
|
||||||
.set(IOStorInv::getConfirm_optname, nickName)
|
|
||||||
.set(IOStorInv::getConfirm_time, now)
|
|
||||||
.eq(IOStorInv::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -851,7 +898,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
io_mst.put("syscompanyid", deptId + "");
|
io_mst.put("syscompanyid", deptId + "");
|
||||||
for (int i = 0; i < rows.size(); i++) {
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
HashMap<String, Object> row = rows.get(i);
|
HashMap<String, Object> row = rows.get(i);
|
||||||
Object qty = ObjectUtil.isEmpty(whereJson.getBigDecimal("material_qty")) ? row.get("qty") :whereJson.getBigDecimal("material_qty");
|
Object qty = ObjectUtil.isEmpty(whereJson.getBigDecimal("material_qty")) ? row.get("qty") : whereJson.getBigDecimal("material_qty");
|
||||||
|
|
||||||
JSONObject ioStorInvDtl = new JSONObject();
|
JSONObject ioStorInvDtl = new JSONObject();
|
||||||
ioStorInvDtl.putAll(row);
|
ioStorInvDtl.putAll(row);
|
||||||
@@ -901,4 +948,18 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
ioStorInvMapper.insert(io_mst.toJavaObject(IOStorInv.class));
|
ioStorInvMapper.insert(io_mst.toJavaObject(IOStorInv.class));
|
||||||
return iostorinv_id;
|
return iostorinv_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<JSONObject> getVehicleGroup(JSONObject whereJson) {
|
||||||
|
if (ObjectUtil.isEmpty(whereJson.getJSONArray("rows"))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<JSONObject> rows = whereJson.getJSONArray("rows").toJavaList(JSONObject.class);
|
||||||
|
List<String> vehicleList = rows.stream()
|
||||||
|
.map(row -> row.getString("vehicle_code"))
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
return ioStorInvMapper.getVehicleGroup(vehicleList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
216
wms/nladmin-ui/src/views/wms/pdm_manage/packaging/index.vue
Normal file
216
wms/nladmin-ui/src/views/wms/pdm_manage/packaging/index.vue
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
<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.material_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="物料编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.pcsn"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="批次"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<rrOperation />
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:before-close="crud.cancelCU"
|
||||||
|
:visible.sync="crud.status.cu > 0"
|
||||||
|
:title="crud.status.title"
|
||||||
|
width="1200px"
|
||||||
|
>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料编码" prop="material_code">
|
||||||
|
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @change="queryMater" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料名称" prop="material_name">
|
||||||
|
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料规格" prop="material_spec">
|
||||||
|
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料批号" prop="pcsn">
|
||||||
|
<el-input v-model="form.pcsn" style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料重量" prop="qty">
|
||||||
|
<el-input-number v-model="form.qty" :precision="2" :controls="false" :min="1" style="width: 200px" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<label slot="label">备 注:</label>
|
||||||
|
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
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="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="material_spec" label="物料规格" :min-width="flexWidth('material_spec',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="100" />
|
||||||
|
<el-table-column prop="create_name" label="收货人" :min-width="flexWidth('create_name',crud.data,'收货人')" />
|
||||||
|
<el-table-column prop="create_time" label="收货时间" :min-width="flexWidth('create_time',crud.data,'收货时间')" />
|
||||||
|
<el-table-column
|
||||||
|
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||||
|
label="操作"
|
||||||
|
width="150px"
|
||||||
|
lign="center"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudPackaging from '@/views/wms/pdm_manage/packaging/packaging'
|
||||||
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudGroup from '@/views/wms/basedata/group/group'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
packing_id: null,
|
||||||
|
material_id: null,
|
||||||
|
pcsn: null,
|
||||||
|
qty: null,
|
||||||
|
is_transfer: null,
|
||||||
|
remark: null,
|
||||||
|
create_id: null,
|
||||||
|
create_name: null,
|
||||||
|
create_time: null,
|
||||||
|
material_spec: null,
|
||||||
|
material_code: null,
|
||||||
|
material_name: null
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Packaging',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
// 数据字典
|
||||||
|
dicts: [],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '外包材收货',
|
||||||
|
url: 'api/packaging',
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
},
|
||||||
|
idField: 'packing_id',
|
||||||
|
sort: 'packing_id,desc',
|
||||||
|
crudMethod: { ...crudPackaging }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {},
|
||||||
|
rules: {
|
||||||
|
material_code: [
|
||||||
|
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
pcsn: [
|
||||||
|
{ required: true, message: '批次不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
qty: [
|
||||||
|
{ required: true, message: '收货重量不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
queryMater(value) {
|
||||||
|
crudGroup.queryMater({ 'material_code': value }).then(row => {
|
||||||
|
this.form.material_spec = row.material_spec
|
||||||
|
this.form.material_name = row.material_name
|
||||||
|
this.form.material_id = row.material_id
|
||||||
|
}).catch(() => {
|
||||||
|
this.form.material_spec = ''
|
||||||
|
this.form.material_name = ''
|
||||||
|
this.form.material_code = ''
|
||||||
|
this.form.material_id = ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/packaging',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/packaging/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/packaging',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmTransfer(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/packaging/confirmTransfer',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, confirmTransfer }
|
||||||
142
wms/nladmin-ui/src/views/wms/pdm_manage/transfer/AddDtl.vue
Normal file
142
wms/nladmin-ui/src/views/wms/pdm_manage/transfer/AddDtl.vue
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="库存选择"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
destroy-on-close
|
||||||
|
width="1000px"
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="物料查询">
|
||||||
|
<el-input
|
||||||
|
v-model="query.material_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="物料编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.pcsn"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="批次"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
border
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
@current-change="clickChange"
|
||||||
|
>
|
||||||
|
<el-table-column label="选择" width="55">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="material_code" label="物料编码" :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="material_spec" label="物料规格" :min-width="flexWidth('material_spec',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="100" />
|
||||||
|
<el-table-column prop="create_name" label="收货人" :min-width="flexWidth('create_name',crud.data,'收货人')" />
|
||||||
|
<el-table-column prop="create_time" label="收货时间" :min-width="flexWidth('create_time',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 crudPackaging from '@/views/wms/pdm_manage/packaging/packaging'
|
||||||
|
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'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AddDtl',
|
||||||
|
components: { crudOperation, rrOperation, pagination },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '新增转运物料',
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
reset: true,
|
||||||
|
download: false
|
||||||
|
},
|
||||||
|
url: 'api/packaging',
|
||||||
|
idField: 'packing_id',
|
||||||
|
sort: 'packing_id,desc'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableRadio: null,
|
||||||
|
dialogVisible: false,
|
||||||
|
sect: {},
|
||||||
|
rows: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.tableRadio = null
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
},
|
||||||
|
clickChange(item) {
|
||||||
|
this.tableRadio = item
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if (!this.tableRadio) {
|
||||||
|
this.$message('请先勾选仓位')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
|
this.tableRadio = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
242
wms/nladmin-ui/src/views/wms/pdm_manage/transfer/index.vue
Normal file
242
wms/nladmin-ui/src/views/wms/pdm_manage/transfer/index.vue
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
<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.material_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="物料编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.pcsn"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="批次"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<rrOperation />
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:before-close="crud.cancelCU"
|
||||||
|
:visible.sync="crud.status.cu > 0"
|
||||||
|
:title="crud.status.title"
|
||||||
|
width="1200px"
|
||||||
|
>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料编码" prop="material_code">
|
||||||
|
<el-input v-model="form.material_code" disabled style="width: 200px;">
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="queryIvt()" />
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料名称" prop="material_name">
|
||||||
|
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料规格" prop="material_spec">
|
||||||
|
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料批号" prop="pcsn">
|
||||||
|
<el-input v-model="form.pcsn" disabled style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="转运重量" prop="qty">
|
||||||
|
<el-input-number v-model="form.qty" disabled :precision="2" :controls="false" :min="1" style="width: 200px" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="转运点位" prop="point_code">
|
||||||
|
<el-select
|
||||||
|
v-model="form.point_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="全部"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointList"
|
||||||
|
:key="item.point_code"
|
||||||
|
:label="item.point_name"
|
||||||
|
:value="item.point_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
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="point_code" label="点位编码" :min-width="flexWidth('point_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="material_spec" label="物料规格" :min-width="flexWidth('material_spec',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="100" />
|
||||||
|
<el-table-column prop="create_name" label="转运人" :min-width="flexWidth('create_name',crud.data,'转运人')" />
|
||||||
|
<el-table-column prop="create_time" label="转运时间" :min-width="flexWidth('create_time',crud.data,'转运时间')" />
|
||||||
|
<el-table-column
|
||||||
|
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||||
|
label="操作"
|
||||||
|
width="150px"
|
||||||
|
lign="center"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<AddDtl :dialog-show.sync="AddDtlShow" @tableChanged="tableChanged" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudPackaging from '@/views/wms/pdm_manage/packaging/packaging'
|
||||||
|
import AddDtl from '@/views/wms/pdm_manage/transfer/AddDtl'
|
||||||
|
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||||
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
packing_id: null,
|
||||||
|
material_id: null,
|
||||||
|
pcsn: null,
|
||||||
|
qty: null,
|
||||||
|
is_transfer: null,
|
||||||
|
remark: null,
|
||||||
|
create_id: null,
|
||||||
|
create_name: null,
|
||||||
|
create_time: null,
|
||||||
|
material_spec: null,
|
||||||
|
material_code: null,
|
||||||
|
point_code: null,
|
||||||
|
material_name: null
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Transfer',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation, AddDtl },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
// 数据字典
|
||||||
|
dicts: [],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '外包材转运',
|
||||||
|
url: 'api/packaging/queryTransfer',
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
},
|
||||||
|
idField: 'create_time',
|
||||||
|
sort: 'create_time,desc',
|
||||||
|
crudMethod: { ...crudPackaging }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {},
|
||||||
|
pointList: [],
|
||||||
|
AddDtlShow: false,
|
||||||
|
rules: {
|
||||||
|
material_code: [
|
||||||
|
{ required: true, message: '转运物料不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
pcsn: [
|
||||||
|
{ required: true, message: '转运批次不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
qty: [
|
||||||
|
{ required: true, message: '转运重量不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
point_code: [
|
||||||
|
{ required: true, message: '转运点位不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudSchBasePoint.getPointList({ 'region_code': 'WBCZC01' }).then(res => {
|
||||||
|
this.pointList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
queryIvt() {
|
||||||
|
this.AddDtlShow = true
|
||||||
|
},
|
||||||
|
tableChanged(row) {
|
||||||
|
this.form.material_id = row.material_id
|
||||||
|
this.form.material_code = row.material_code
|
||||||
|
this.form.material_name = row.material_name
|
||||||
|
this.form.material_spec = row.material_spec
|
||||||
|
this.form.pcsn = row.pcsn
|
||||||
|
this.form.qty = row.qty
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -292,11 +292,11 @@ export default {
|
|||||||
this.form.detail_count = this.form.tableData.length
|
this.form.detail_count = this.form.tableData.length
|
||||||
},
|
},
|
||||||
deleteRow(index, rows) {
|
deleteRow(index, rows) {
|
||||||
const pcsn = rows[index].pcsn
|
const vehicle_code = rows[index].vehicle_code
|
||||||
let len = rows.length
|
let len = rows.length
|
||||||
while (len--) {
|
while (len--) {
|
||||||
const obj = rows[len]
|
const obj = rows[len]
|
||||||
if (pcsn === obj.pcsn) {
|
if (vehicle_code === obj.vehicle_code) {
|
||||||
const index = rows.indexOf(obj)
|
const index = rows.indexOf(obj)
|
||||||
if (index > -1) { // 移除找到的指定元素
|
if (index > -1) { // 移除找到的指定元素
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||||
@@ -307,20 +307,23 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
tableChanged(rows) {
|
tableChanged(rows) {
|
||||||
// 对新增的行进行校验不能存在相同物料批次
|
// 根据载具编码查询载具下的所有组盘信息
|
||||||
rows.forEach((item) => {
|
crudRawAssist.getVehicleGroup({ 'rows': rows }).then(res => {
|
||||||
let same_mater = true
|
rows = res
|
||||||
this.form.tableData.forEach((row) => {
|
rows.forEach((item) => {
|
||||||
if (row.pcsn === item.pcsn) {
|
let same_mater = true
|
||||||
same_mater = false
|
this.form.tableData.forEach((row) => {
|
||||||
|
if (row.pcsn === item.pcsn) {
|
||||||
|
same_mater = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (same_mater) {
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||||
|
this.form.tableData.splice(-1, 0, item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (same_mater) {
|
this.form.detail_count = this.form.tableData.length
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
|
||||||
this.form.tableData.splice(-1, 0, item)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
this.form.detail_count = this.form.tableData.length
|
|
||||||
},
|
},
|
||||||
async insertEvent(row) {
|
async insertEvent(row) {
|
||||||
if (this.form.bill_type === '') {
|
if (this.form.bill_type === '') {
|
||||||
|
|||||||
@@ -93,5 +93,15 @@ export function getInBillTaskDtl(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getVehicleGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/in/rawAssist/getVehicleGroup',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default { add, edit, del, getIODtl, commit,
|
export default { add, edit, del, getIODtl, commit,
|
||||||
deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, confirm, getInBillTaskDtl }
|
deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, confirm, getInBillTaskDtl,
|
||||||
|
getVehicleGroup
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user