add : 半成品损溢

This commit is contained in:
2023-06-01 14:30:16 +08:00
parent a160d1cd5d
commit 035edb5c96
21 changed files with 696 additions and 117 deletions

View File

@@ -89,6 +89,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
}
@Override
@Transactional(rollbackFor = Exception.class)
public void create(JSONObject form) {
JSONArray rows = form.getJSONArray("tableData");
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
@@ -113,6 +114,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(JSONObject form) {
Assert.notNull(new Object[]{form, form.get("mol_id")}, "请求参数不能为空");
StIvtMoreorlessmstCp mst = form.toJavaObject(StIvtMoreorlessmstCp.class);
@@ -125,6 +127,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(Long[] ids) {
for (Long id : ids) {
StIvtMoreorlessmstCp dao = this.getOne(new QueryWrapper<StIvtMoreorlessmstCp>().eq("mol_id", id));

View File

@@ -49,5 +49,12 @@ public class StIvtStructivtYlController {
public ResponseEntity<Object> getStructIvt(StructIvtYLQuery query) {
return new ResponseEntity<>(structivtYlService.getStructIvt(query), HttpStatus.OK);
}
@PostMapping("/getSemiProductIvt")
@Log("查询可用的半成品库存")
@ApiOperation("查询可用的半成品库存")
public ResponseEntity<Object> getSemiProductIvt(StructIvtYLQuery query) {
return new ResponseEntity<>(structivtYlService.getSemiProductIvt(query), HttpStatus.OK);
}
}

View File

@@ -36,4 +36,7 @@ public interface IStIvtStructivtYlService extends IService<StIvtStructivtYl> {
* @return JSONObject
*/
Object getProductIvt(StructIvtYLQuery query, PageQuery page);
Object getSemiProductIvt(StructIvtYLQuery query);
}

View File

@@ -24,5 +24,7 @@ public interface StIvtStructivtYlMapper extends BaseMapper<StIvtStructivtYl> {
List<Map> getProductIvt(@Param("query") StructIvtYLQuery query, @Param("pageQuery") PageQuery pageQuery);
List<Map> getSemiProductIvt(@Param("query") StructIvtYLQuery query);
List<Map> getStructIvt(@Param("query") StructIvtYLQuery query);
}

View File

@@ -73,6 +73,42 @@
</where>
</select>
<select id="getSemiProductIvt" resultType="java.util.Map">
SELECT
ivt.*,
mu.unit_name AS qty_unit_name,
mb.material_code,
mb.material_name,
sa.sect_id,
sa.sect_code,
sa.sect_name,
sa.struct_id,
sa.struct_code,
sa.struct_name,
sa.storagevehicle_code,
class.class_name
FROM
st_ivt_structivt_bcp ivt
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
<where>
ivt.canuse_qty > 0
AND
sa.lock_type = '0'
<if test="query.material_search != null and query.material_search != ''">
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
</if>
<if test="query.sect_id != null and query.sect_id != ''">
and sa.sect_id = #{query.sect_id}
</if>
<if test="query.struct_id != null and query.struct_id != ''">
and sa.struct_id = #{query.struct_id}
</if>
</where>
</select>
<select id="getStructIvt" resultType="java.util.Map">
SELECT
ivt.*,

View File

@@ -47,4 +47,9 @@ public class StIvtStructivtYlServiceImpl extends ServiceImpl<StIvtStructivtYlMap
build.setTotalElements(page.getTotal());
return build;
}
@Override
public Object getSemiProductIvt(StructIvtYLQuery query) {
return this.baseMapper.getSemiProductIvt(query);
}
}

View File

@@ -1,9 +1,16 @@
package org.nl.wms.storage_manage.semimanage.controller.moveOrLess;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.rawmanage.service.moveOrLess.dto.MoreOrlessQuery;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessmstBcpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* <p>
@@ -14,8 +21,57 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2023-05-10
*/
@RestController
@RequestMapping("/stIvtMoreorlessmstBcp")
@RequestMapping("/api/stIvtMoreorlessmstBcp")
public class StIvtMoreorlessmstBcpController {
@Autowired
private IStIvtMoreorlessmstBcpService iStIvtMoreorlessmstBcpService;
@GetMapping
@Log("查询损溢单")
@ApiOperation("查询损溢单")
public ResponseEntity<Object> query(MoreOrlessQuery query, PageQuery page) {
return new ResponseEntity<>(iStIvtMoreorlessmstBcpService.pageQuery(query, page), HttpStatus.OK);
}
@PostMapping
@Log("创建损溢单")
@ApiOperation("创建损溢单")
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
iStIvtMoreorlessmstBcpService.create(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/getMlDtl")
@Log("查询损溢明细")
@ApiOperation("查询损溢明细")
public ResponseEntity<Object> getMlDtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(iStIvtMoreorlessmstBcpService.getMlDtl(whereJson), HttpStatus.OK);
}
@PostMapping("/update")
@Log("修改损溢单")
@ApiOperation("修改损溢单")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
iStIvtMoreorlessmstBcpService.update(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/delete")
@Log("删除入库单")
@ApiOperation("删除入库单")
public ResponseEntity<Object> delete(@RequestBody Long[] ids){
iStIvtMoreorlessmstBcpService.delete(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("完成单据")
@ApiOperation("完成单据")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
iStIvtMoreorlessmstBcpService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}

View File

@@ -1,7 +1,14 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.storage_manage.rawmanage.service.moveOrLess.dao.StIvtMoreorlessmstYl;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessdtlBcp;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessmstBcp;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -13,4 +20,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IStIvtMoreorlessdtlBcpService extends IService<StIvtMoreorlessdtlBcp> {
/**
* 主单据使用
* @param row
* @param mst
* @return
*/
double create(JSONArray row, StIvtMoreorlessmstBcp mst);
List<Map> getMlDtl(JSONObject form);
}

View File

@@ -1,7 +1,13 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessmstBcp;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.rawmanage.service.moveOrLess.dto.MoreOrlessQuery;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessmstBcp;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -13,4 +19,22 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IStIvtMoreorlessmstBcpService extends IService<StIvtMoreorlessmstBcp> {
Object pageQuery(MoreOrlessQuery query, PageQuery page);
void create(JSONObject jo);
List<Map> getMlDtl(JSONObject map);
void update(JSONObject map);
/**
* 删除
* @param ids
* {
* 主表id..
* }
*/
void delete(Long[] ids);
void confirm(JSONObject form);
}

View File

@@ -1,6 +1,8 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
@@ -24,6 +26,7 @@ public class StIvtMoreorlessdtlBcp implements Serializable {
/**
* 损溢单明细id
*/
@TableId
private String mol_dtl_id;
/**

View File

@@ -1,6 +1,8 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.io.Serializable;
@@ -25,6 +27,7 @@ public class StIvtMoreorlessmstBcp implements Serializable {
/**
* 损溢单标识
*/
@TableId
private String mol_id;
/**
@@ -80,7 +83,7 @@ public class StIvtMoreorlessmstBcp implements Serializable {
/**
* 创建时间
*/
private Date create_time;
private String create_time;
/**
* 审核人
@@ -95,7 +98,7 @@ public class StIvtMoreorlessmstBcp implements Serializable {
/**
* 审核时间
*/
private Date audit_time;
private String audit_time;
/**
* 确认人
@@ -110,7 +113,7 @@ public class StIvtMoreorlessmstBcp implements Serializable {
/**
* 确认时间
*/
private Date confirm_time;
private String confirm_time;
/**
* 备注

View File

@@ -1,8 +1,13 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessdtlBcp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* <p>
* 损溢单明细表 Mapper 接口
@@ -13,4 +18,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface StIvtMoreorlessdtlBcpMapper extends BaseMapper<StIvtMoreorlessdtlBcp> {
List<Map> getMlDtl(@Param("map") JSONObject map);
}

View File

@@ -1,8 +1,14 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper;
import org.apache.ibatis.annotations.Param;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.rawmanage.service.moveOrLess.dto.MoreOrlessQuery;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessmstBcp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* <p>
* 损溢单主表 Mapper 接口
@@ -13,4 +19,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface StIvtMoreorlessmstBcpMapper extends BaseMapper<StIvtMoreorlessmstBcp> {
List<Map> getMstDetail(@Param("query") MoreOrlessQuery query, @Param("pageQuery") PageQuery pageQuery);
}

View File

@@ -2,4 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper.StIvtMoreorlessdtlBcpMapper">
<select id="getMlDtl" resultType="java.util.Map">
SELECT
dtl.*,
mb.material_code,
mb.material_name
FROM
st_ivt_moreorlessdtl_bcp dtl
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
<where>
<if test="map.mol_id != null and map.mol_id != ''">
dtl.mol_id = #{map.mol_id}
</if>
</where>
</select>
</mapper>

View File

@@ -2,4 +2,58 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper.StIvtMoreorlessmstBcpMapper">
<select id="getMstDetail" resultType="java.util.Map">
SELECT
mst.*,
a.total_qty,
a.struct_name,
sa.struct_code,
sa.struct_id,
sa.sect_id,
sa.sect_name
FROM
st_ivt_moreorlessmst_bcp mst
LEFT JOIN (
SELECT
dtl.struct_name,
dtl.struct_id,
SUM( dtl.mol_qty ) AS total_qty,
dtl.mol_id
FROM
st_ivt_moreorlessdtl_bcp dtl
GROUP BY
dtl.struct_name,
dtl.mol_id,
dtl.struct_id
) a ON a.mol_id = mst.mol_id
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = a.struct_id
<where>
mst.is_delete = '0'
<if test="query.start_time != null">
and mst.create_time >= #{query.start_time}
</if>
<if test="query.end_time != null">
and #{query.end_time} >= mst.create_time
</if>
<if test="query.stor_id != null and query.stor_id != ''">
and mst.stor_id = #{query.stor_id}
</if>
<if test="query.status != null and query.status != ''">
and mst.status = #{query.status}
</if>
<if test="query.mol_inv_type != null and query.mol_inv_type != ''">
and mst.mol_inv_type = #{query.mol_inv_type}
</if>
<if test="query.mol_code != null and query.mol_code != ''">
and mst.mol_code = #{query.mol_code}
</if>
<if test="query.mol_type != null and query.mol_type != ''">
and mst.mol_type = #{query.mol_type}
</if>
order by mst.mol_code DESC
</where>
</select>
</mapper>

View File

@@ -1,11 +1,33 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess.impl;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessdtlBcp;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper.StIvtMoreorlessdtlBcpMapper;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessdtlBcpService;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.common.utils.IdUtil;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.semimanage.MLEnum;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessdtlBcpService;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessdtlBcp;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessmstBcp;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper.StIvtMoreorlessdtlBcpMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* <p>
* 损溢单明细表 服务实现类
@@ -17,4 +39,69 @@ import org.springframework.stereotype.Service;
@Service
public class StIvtMoreorlessdtlBcpServiceImpl extends ServiceImpl<StIvtMoreorlessdtlBcpMapper, StIvtMoreorlessdtlBcp> implements IStIvtMoreorlessdtlBcpService {
@Autowired
private IStIvtSectattrService sectattrService; // 库区服务
@Autowired
private IStIvtStructattrService structattrService; // 仓位服务
@Autowired
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService; // 载具服务
@Override
public List<Map> getMlDtl(JSONObject form) {
return this.baseMapper.getMlDtl(form);
}
@Override
public double create(JSONArray rows, StIvtMoreorlessmstBcp mst) {
double total_qty = 0;
if (rows.size() > 0 && ObjectUtil.isNotEmpty(mst)) {
// 先删除在插入
this.remove(new QueryWrapper<StIvtMoreorlessdtlBcp>().eq("mol_id", mst.getMol_id()));
for (int i = 0; i < rows.size(); i++) {
String mol_dtl_id = IdUtil.getStringId();
StIvtMoreorlessdtlBcp row = rows.getJSONObject(i).toJavaObject(StIvtMoreorlessdtlBcp.class);
row.setMol_dtl_id(mol_dtl_id);
row.setMol_id(mst.getMol_id());
row.setMol_code(mst.getMol_code());
row.setSeq_no(BigDecimal.valueOf(i + 1));
row.setPcsn(DateUtil.today());
// 获取库区信息
QueryWrapper<StIvtSectattr> sect_wrapper = new QueryWrapper<>();
sect_wrapper.eq("sect_id", row.getSect_id());
sect_wrapper.eq("is_used", true);
StIvtSectattr sectDao = sectattrService.getOne(sect_wrapper);
if (ObjectUtil.isEmpty(sectDao)) throw new BadRequestException("库区不存在或未启用!");
row.setSect_name(sectDao.getSect_name());
// 获取仓位信息
QueryWrapper<StIvtStructattr> struct_wrapper = new QueryWrapper<>();
struct_wrapper.eq("struct_id", row.getStruct_id());
struct_wrapper.eq("is_used", true);
StIvtStructattr structDao = structattrService.getOne(struct_wrapper);
if (ObjectUtil.isEmpty(structDao)) throw new BadRequestException("仓位不存在或未启用!");
row.setStruct_name(structDao.getStruct_name());
// 获取载具信息
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getStoragevehicle_code())
);
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
row.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
row.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
row.setStatus(MLEnum.DTL_STATUS.code("生成"));
this.save(row);
//锁定货位
structattrService.update(new UpdateWrapper<StIvtStructattr>().set("lock_type", IOSEnum.LOCK_TYPE.code("损溢锁")).set("inv_code",mst.getMol_code()).eq("struct_id", row.getStruct_id()));
}
}
return total_qty;
}
}

View File

@@ -1,10 +1,46 @@
package org.nl.wms.storage_manage.semimanage.service.moveOrLess.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.jsonwebtoken.lang.Assert;
import org.jetbrains.annotations.NotNull;
import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.storage_manage.CHECKEnum;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.rawmanage.service.moveOrLess.dto.MoreOrlessQuery;
import org.nl.wms.storage_manage.semimanage.MLEnum;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessdtlBcpService;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessmstBcpService;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessdtlBcp;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.StIvtMoreorlessmstBcp;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.dao.mapper.StIvtMoreorlessmstBcpMapper;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessmstBcpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.wms.storage_manage.semimanage.service.structIvt.IStIvtStructivtBcpService;
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -17,4 +53,233 @@ import org.springframework.stereotype.Service;
@Service
public class StIvtMoreorlessmstBcpServiceImpl extends ServiceImpl<StIvtMoreorlessmstBcpMapper, StIvtMoreorlessmstBcp> implements IStIvtMoreorlessmstBcpService {
@Autowired
private IStIvtMoreorlessdtlBcpService iStIvtMoreorlessdtlBcpService; // 半成品明细服务
@Autowired
private IStIvtBsrealstorattrService stIvtBsrealstorattrService; // 实物属性服务
@Autowired
private IStIvtStructivtBcpService iStIvtStructivtBcpService; // 半成品库存服务
@Autowired
private IStIvtStructattrService structattrService; // 仓位服务
@Override
public Object pageQuery(MoreOrlessQuery query, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
List<Map> mst_detail = this.baseMapper.getMstDetail(query, pageQuery);
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
build.setTotalElements(page.getTotal());
return build;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void create(JSONObject form) {
JSONArray rows = form.getJSONArray("tableData");
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
// 调用主表 插入/更新方法
StIvtMoreorlessmstBcp mlmstYl = packageMstForm(new StIvtMoreorlessmstBcp(), form);
this.save(mlmstYl);
//调用明细表 插入方法
iStIvtMoreorlessdtlBcpService.create(rows, mlmstYl);
if (form.containsKey("auto_confirm") && form.getString("auto_confirm").equals("1")) {
JSONObject mst = new JSONObject();
mst.put("mol_id", mlmstYl.getMol_id());
this.confirm(mst);
}
}
@Override
public List<Map> getMlDtl(JSONObject map) {
return iStIvtMoreorlessdtlBcpService.getMlDtl(map);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(JSONObject form) {
Assert.notNull(new Object[]{form, form.get("mol_id")}, "请求参数不能为空");
StIvtMoreorlessmstBcp mst = form.toJavaObject(StIvtMoreorlessmstBcp.class);
this.updateById(mst);
JSONArray rows = form.getJSONArray("tableData");
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
// 调用明细表 插入/更新方法
iStIvtMoreorlessdtlBcpService.create(rows, mst);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(Long[] ids) {
for (Long id : ids) {
StIvtMoreorlessmstBcp dao = this.getOne(new QueryWrapper<StIvtMoreorlessmstBcp>().eq("mol_id", id));
dao.setIs_delete(true);
this.updateById(dao);
// 解锁货位
StIvtMoreorlessdtlBcp dtlDao = iStIvtMoreorlessdtlBcpService.getOne(
new QueryWrapper<StIvtMoreorlessdtlBcp>().lambda()
.eq(StIvtMoreorlessdtlBcp::getMol_id, id),
false
);
structattrService.update(
new StIvtStructattr()
.setInv_code("")
.setInv_type("")
.setInv_id("")
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定")),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, dtlDao.getStruct_id())
);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirm(JSONObject whereJson) {
String mol_id = (String) whereJson.get("mol_id");
StIvtMoreorlessmstBcp mst = this.getOne(new QueryWrapper<StIvtMoreorlessmstBcp>().eq("mol_id", mol_id));
if (!mst.getStatus().equals(MLEnum.BILL_STATUS.code("生成"))) {
throw new BadRequestException("请选择单据状态为生成的损溢单!");
}
String mol_type = mst.getMol_type();
List<StIvtMoreorlessdtlBcp> dtl_list = iStIvtMoreorlessdtlBcpService.list(new QueryWrapper<StIvtMoreorlessdtlBcp>().eq("mol_id", mol_id));
//更新库存
if (mol_type.equals(MLEnum.MOL_TYPE.code(""))) {
dtl_list.forEach(dtl -> {
StIvtStructivtBcp ivt = iStIvtStructivtBcpService.getOne(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", dtl.getStruct_id()).eq("material_id", dtl.getMaterial_id()));
if (ObjectUtil.isEmpty(ivt)) {
throw new BadRequestException("未查询到相关库存!");
}
BigDecimal canuse_qty = ivt.getCanuse_qty();
BigDecimal mol_qty = dtl.getMol_qty();
ivt.setCanuse_qty(NumberUtil.sub(canuse_qty, mol_qty));
//如果库存变为0则删除记录
if (canuse_qty.compareTo(mol_qty) == 0 ) {
iStIvtStructivtBcpService.removeById(ivt.getStruct_id());
// 更新货位 -- 清除载具号
structattrService.update(
new StIvtStructattr()
.setStoragevehicle_code("")
.setInv_id("")
.setInv_type("")
.setInv_code(""),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, ivt.getStruct_id())
);
} else {
iStIvtStructivtBcpService.updateById(ivt);
}
});
} else {
dtl_list.forEach(dtl -> {
StIvtStructivtBcp ivt = iStIvtStructivtBcpService.getOne(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", dtl.getStruct_id()).eq("material_id", dtl.getMaterial_id()));
BigDecimal mol_qty = dtl.getMol_qty();
if (ObjectUtil.isEmpty(ivt)) {
StIvtStructattr struct_jo = structattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_id", dtl.getStruct_id()));
//新增一条库存记录
iStIvtStructivtBcpService.save(StIvtStructivtBcp.builder()
.struct_id(dtl.getStruct_id())
.struct_code(struct_jo.getStruct_code())
.struct_name(struct_jo.getStruct_name())
.material_id(dtl.getMaterial_id())
.quality_scode(dtl.getQuality_scode())
.pcsn(dtl.getPcsn())
.ivt_level(dtl.getIvt_level())
.is_active(dtl.getIs_active())
.canuse_qty(mol_qty)
.qty_unit_id(dtl.getQty_unit_id())
.instorage_time(DateUtil.now())
.stor_id(mst.getStor_id())
.workshop_id(mst.getProduct_area())
.is_pick(false)
.build()
);
// 更新仓位
struct_jo.setStoragevehicle_code(dtl.getStoragevehicle_code());
structattrService.updateById(struct_jo);
} else {
BigDecimal canuse_qty = ivt.getCanuse_qty();
ivt.setCanuse_qty(NumberUtil.add(canuse_qty, mol_qty));
iStIvtStructivtBcpService.updateById(ivt);
}
//更新明细状态
dtl.setStatus(MLEnum.DTL_STATUS.code("确认完成"));
iStIvtMoreorlessdtlBcpService.updateById(dtl);
});
}
dtl_list.stream().map(dtl -> dtl.getStruct_id())
.distinct()
.forEach(struct_id -> structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.set(StIvtStructattr::getInv_code, "")
.eq(StIvtStructattr::getStruct_id, struct_id))
);
//更新损溢单主表
mst.setStatus(MLEnum.BILL_STATUS.code("完成"));
mst.setConfirm_optid(SecurityUtils.getCurrentUserId());
mst.setConfirm_optname(SecurityUtils.getCurrentNickName());
mst.setConfirm_time(DateUtil.now());
this.updateById(mst);
}
@NotNull
private StIvtMoreorlessmstBcp packageMstForm(StIvtMoreorlessmstBcp mlmstYl, JSONObject whereJson) {
JSONArray rows = whereJson.getJSONArray("tableData");
// 新增
mlmstYl.setMol_id(IdUtil.getStringId());
mlmstYl.setMol_code(CodeUtil.getNewCode("MOL_CODE"));
if (StrUtil.isEmpty(whereJson.getString("buss_type"))) {
mlmstYl.setBuss_type(MLEnum.BILL_TYPE.code("普通损溢"));
mlmstYl.setMol_inv_type(MLEnum.BILL_TYPE.code("普通损溢"));
} else {
mlmstYl.setBuss_type(whereJson.getString("buss_type"));
mlmstYl.setMol_inv_type(whereJson.getString("buss_type"));
}
mlmstYl.setMol_type(whereJson.getString("mol_type"));
// 获取仓库信息
QueryWrapper<StIvtBsrealstorattr> wrapper = new QueryWrapper<>();
wrapper.eq("stor_id", whereJson.getString("stor_id"));
wrapper.eq("is_used", true);
StIvtBsrealstorattr bsrealDao = stIvtBsrealstorattrService.getOne(wrapper);
if (ObjectUtil.isEmpty(bsrealDao)) throw new BadRequestException("仓库不存在或未启用!");
mlmstYl.setStor_id(bsrealDao.getStor_id());
mlmstYl.setStor_name(bsrealDao.getStor_name());
mlmstYl.setDtl_num(BigDecimal.valueOf(rows.size()));
mlmstYl.setCreate_mode(CHECKEnum.CREATE_MODE.code("PC产生"));
mlmstYl.setStatus(CHECKEnum.BILL_STATUS.code("生成"));
mlmstYl.setCreate_id(SecurityUtils.getCurrentUserId());
mlmstYl.setCreate_name(SecurityUtils.getCurrentNickName());
mlmstYl.setCreate_time(DateUtil.now());
mlmstYl.setIs_delete(false);
// TODO 暂时写死
mlmstYl.setSysdeptid("111");
mlmstYl.setSyscompanyid("111");
mlmstYl.setRemark(whereJson.getString("remark"));
return mlmstYl;
}
}

View File

@@ -11,7 +11,7 @@
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
<span/>
</el-col>
<el-col :span="4">
<span>
@@ -39,7 +39,7 @@
>
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
@@ -79,12 +79,12 @@
<el-form-item label="货位" prop="struct_code">
<label slot="label">货&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位:</label>
<el-input v-model.trim="form.struct_code" style="width: 210px" disabled placeholder="选择货位">
<el-button v-show="crud.status.view <= 0" slot="append" icon="el-icon-plus" @click="queryStruct()" />
<el-button v-show="crud.status.view <= 0" slot="append" icon="el-icon-plus" @click="queryStruct()"/>
</el-input>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px"/>
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
@@ -113,7 +113,7 @@
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<slot name="left"/>
<!--<el-button
slot="left"
class="filter-item"
@@ -148,23 +148,24 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="storagevehicle_code" label="载具号" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.storagevehicle_code" class="input-with-select"/>
<span v-show="scope.row.edit">{{ scope.row.storagevehicle_code }}</span>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)"/>
</el-input>
<span v-show="scope.row.edit">{{ scope.row.material_code }}</span>
</template>
</el-table-column>
<el-table-column prop="material_name" label="物料名称" align="center" min-width="200" show-overflow-tooltip />
<el-table-column
v-if="!crud.status.view > 0"
prop="ivt_qty"
label="库存重量"
align="center"
:formatter="crud.formatNum3"
/>
<el-table-column prop="material_name" label="物料名称" align="center" min-width="200" show-overflow-tooltip/>
<el-table-column v-if="!crud.status.view > 0" prop="canuse_qty" label="库存重量" align="center"
:formatter="crud.formatNum3"/>
<el-table-column prop="mol_qty" width="220" label="损溢重量" align="center">
<template scope="scope">
<el-input-number
@@ -177,7 +178,7 @@
/>
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column prop="qty_unit_name" label="单位" align="center"/>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="190" fixed="right">
<template scope="scope">
<el-button
@@ -209,19 +210,19 @@
</el-table-column>
</el-table>
<MaterDtl :dialog-show.sync="materShow" @setMaterValue="tableChanged2" />
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="tableChanged" />
<MaterDtl :dialog-show.sync="materShow" @setMaterValue="tableChanged2"/>
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="tableChanged"/>
</el-dialog>
</template>
<script>
import crudOperation from '@crud/CRUD.operation'
import BucketDialog from '@/views/wms/storage_manage/rawproduct/rawproductmoreOrless/NewBucketDialog'
import BucketDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/NewBucketDialog'
import CRUD, { crud, form } from '@crud/crud'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudMoreOrless from '@/views/wms/storage_manage/rawproduct/rawproductmoreOrless/moreorless'
import crudMoreOrless from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/moreorless'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import StructDiv from '@/views/wms/storage_manage/rawproduct/rawproductmoreOrless/StructDiv'
import StructDiv from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/StructDiv'
const defaultForm = {
mol_id: '',
@@ -242,7 +243,7 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { crudOperation, MaterDtl, StructDiv, BucketDialog },
components: {crudOperation, MaterDtl, StructDiv, BucketDialog},
mixins: [crud(), form(defaultForm)],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_MOL_TYPE'],
props: {
@@ -268,13 +269,13 @@ export default {
storlist: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
{required: true, message: '仓库不能为空', trigger: 'blur'}
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
{required: true, message: '业务类型不能为空', trigger: 'blur'}
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
{required: true, message: '业务日期不能为空', trigger: 'blur'}
]
}
}
@@ -289,13 +290,13 @@ export default {
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'stor_type': '3' }).then(res => {
crudStorattr.getStor({'stor_type': '2'}).then(res => {
this.storlist = res.content
})
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudMoreOrless.getMlDtl({ 'mol_id': this.form.mol_id }).then(res => {
crudMoreOrless.getMlDtl({'mol_id': this.form.mol_id}).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
@@ -351,13 +352,13 @@ export default {
return false
}
if (this.crud.status.add > 0) {
crudMoreOrless.getStructIvt({ 'struct_id': this.form.struct_id }).then(res => {
crudMoreOrless.getStructIvt({'struct_id': this.form.struct_id}).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
}
if (this.crud.status.edit > 0) {
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
crudMoreOrless.queryMolDtl({'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id}).then(res => {
this.form.tableData = res
this.form.dtl_num = this.form.tableData.length
})
@@ -383,7 +384,7 @@ export default {
this.form.sect_id = row.sect_id
this.form.sect_name = row.sect_name
this.form.struct_name = row.struct_name
crudMoreOrless.getStructIvt({ 'struct_id': row.struct_id }).then(res => {
crudMoreOrless.getStructIvt({'struct_id': row.struct_id}).then(res => {
this.form.tableData = res
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]

View File

@@ -22,17 +22,18 @@
</el-col>
<el-col :span="6">
<el-input
v-model="query.search"
v-model="query.struct_code"
clearable
style="width: 200px"
size="mini"
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
/>
</el-col>
<el-col :span="6">
<rrOperation />
<rrOperation/>
</el-col>
</el-row>
<!--表格渲染-->
@@ -46,15 +47,15 @@
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="货位编码" />
<el-table-column prop="struct_name" label="货位名称" />
<el-table-column prop="sect_name" label="库区名称" />
<el-table-column prop="lock_type" :formatter="lockFormat" label="是否锁定" />
<el-table-column prop="storagevehicle_code" label="存储载具号" />
<el-table-column type="selection" width="55"/>
<el-table-column prop="struct_code" label="货位编码"/>
<el-table-column prop="struct_name" label="货位名称"/>
<el-table-column prop="sect_name" label="库区名称"/>
<el-table-column prop="lock_type" :formatter="lockFormat" label="是否锁定"/>
<el-table-column prop="storagevehicle_code" label="存储载具号"/>
</el-table>
<!--分页组件-->
<pagination />
<pagination/>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
@@ -64,7 +65,7 @@
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
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'
@@ -73,7 +74,7 @@ import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'StructDiv',
components: { crudOperation, rrOperation, pagination },
components: {crudOperation, rrOperation, pagination},
cruds() {
return CRUD({
title: '仓位',
@@ -81,8 +82,8 @@ export default {
url: 'api/structattr',
idField: 'struct_id',
sort: 'struct_id,desc',
query: { search: '', is_lock: '1', sect_id: '', stor_id: '' },
crudMethod: { ...crudStructattr }
query: {search: '', is_lock: '1', sect_id: '', stor_id: ''},
crudMethod: {...crudStructattr}
})
},
mixins: [presenter(), header()],
@@ -122,7 +123,7 @@ export default {
methods: {
open() {
this.crud.resetQuery(false)
crudSectattr.getSect({ 'is_materialstore': '1' }).then(res => {
crudSectattr.getSect({ 'stor_type': '2' }).then(res => {
this.sects = res.content
})
if (this.sect) {
@@ -192,22 +193,9 @@ export default {
return
}
// 溢单不允许选择已锁定或者有载具的货位
if (this.mol_type === '1') {
if (this.checkrow.lock_type !== '00') {
this.$message('溢单不允许选择已锁定的货位!')
return
}
}
// 损单不允许选择已锁定或者无载具的货位
if (this.mol_type === '0') {
if (this.checkrow.lock_type !== '00') {
this.$message('损单不允许选择已锁定的货位!')
return
}
if (this.checkrow.storagevehicle_code === '') {
this.$message('损单不允许选择无载具的货位!')
return
}
if (this.checkrow.lock_type !== '0') {
this.$message('不允许选择已锁定的货位!')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)

View File

@@ -11,12 +11,12 @@
label-width="80px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-form-item label="单据编号">
<el-input
v-model="query.struct_search"
v-model="query.mol_code"
size="mini"
clearable
placeholder="货位编码、名称"
placeholder="单据编号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
@@ -69,7 +69,7 @@
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
v-model="query.status"
clearable
size="mini"
placeholder="单据状态"
@@ -77,7 +77,7 @@
@change="crud.toQuery"
>
<el-option
v-for="item in dict.mol_bill_status"
v-for="item in dict.MOL_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -149,15 +149,15 @@
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="单据状态" />
<el-table-column label="备注" align="center" min-width="100" prop="remark" />
<el-table-column prop="create_mode" min-width="100" :formatter="create_modeFormat" label="生成方式" />
<el-table-column label="制单人" align="center" min-width="100" prop="input_optname" />
<el-table-column label="制单时间" align="center" prop="input_time" min-width="150" />
<el-table-column label="制单人" align="center" min-width="100" prop="create_name" />
<el-table-column label="制单时间" align="center" prop="create_time" min-width="150" />
<el-table-column label="确认人" align="center" prop="confirm_optname" min-width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" min-width="150" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<!-- <AddDialog @AddChanged="querytable" />-->
<AddDialog @AddChanged="querytable" />
</div>
</template>
@@ -168,29 +168,30 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
// import AddDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/AddDialog'
import AddDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/AddDialog'
import { mapGetters } from 'vuex'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudMoreOrless from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/moreorless'
export default {
name: 'MoreOrLess',
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
name: 'RawProductMl',
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
cruds() {
return CRUD({
title: '',
optShow: { add: true, reset: true},
optShow: { add: true, reset: true },
props: {
// 每页数据条数
size: 20
},
idField: 'mol_id',
url: '/api/instor/mol',
url: '/api/stIvtMoreorlessmstBcp',
crudMethod: { ...crudMoreOrless }
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['mol_bill_status', 'ST_CREATE_MODE', 'ST_MOL_TYPE'],
dicts: ['MOL_BILL_STATUS', 'ST_CREATE_MODE', 'ST_MOL_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
@@ -217,7 +218,7 @@ export default {
}
},
created() {
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({ 'stor_type': '2' }).then(res => {
this.storlist = res.content
})
},
@@ -266,7 +267,7 @@ export default {
}
},
stateFormat(row, column) {
return this.dict.label.mol_bill_status[row.status]
return this.dict.label.MOL_BILL_STATUS[row.status]
},
typeFormat(row, column) {
return this.dict.label.ST_MOL_TYPE[row.mol_type]

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/instor/mol',
url: '/api/stIvtMoreorlessmstBcp',
method: 'post',
data
})
@@ -10,50 +10,42 @@ export function add(data) {
export function del(ids) {
return request({
url: '/api/instor/mol',
method: 'delete',
url: '/api/stIvtMoreorlessmstBcp/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/instor/mol',
method: 'put',
url: '/api/stIvtMoreorlessmstBcp/update',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/instor/mol/getStructIvt',
method: 'get',
url: '/api/stIvtStructivtYl/getSemiProductIvt',
method: 'post',
params
})
}
export function queryMolDtl(params) {
export function getMlDtl(data) {
return request({
url: '/api/instor/mol/queryMolDtl',
method: 'get',
params
})
}
export function queryMolDetail(params) {
return request({
url: '/api/instor/mol/queryMolDetail',
method: 'get',
params
})
}
export function confirm(data) {
return request({
url: '/api/instor/mol/confirm',
url: '/api/stIvtMoreorlessmstBcp/getMlDtl',
method: 'post',
data
})
}
export default { add, edit, del, getStructIvt, queryMolDtl, queryMolDetail, confirm }
export function confirm(data) {
return request({
url: '/api/stIvtMoreorlessmstBcp/confirm',
method: 'post',
data
})
}
export default { add, edit, del, getStructIvt, getMlDtl, confirm }