add:增加组盘,出入库兼容混乱情况,数据库组盘表需要MD5字段需要修改
This commit is contained in:
@@ -31,7 +31,7 @@ public enum QueryTEnum {
|
||||
}
|
||||
}),
|
||||
ORLK((q, k, o) -> {
|
||||
q.and(query -> {
|
||||
q.nested(query -> {
|
||||
QueryWrapper queryWrapper = (QueryWrapper) query;
|
||||
for (int i = 0; i < k.length; i++) {
|
||||
queryWrapper.like(k[i], o);
|
||||
@@ -68,7 +68,15 @@ public enum QueryTEnum {
|
||||
} else {
|
||||
q.eq(k[0], v);
|
||||
}
|
||||
});
|
||||
}),
|
||||
NULL_OR_HAS((queryWrapper, k, v) -> {
|
||||
if (v.equals("1")){
|
||||
queryWrapper.isNull(k[0]);
|
||||
}else {
|
||||
queryWrapper.isNotNull(k[0]);
|
||||
}
|
||||
}),
|
||||
;
|
||||
|
||||
private org.nl.common.domain.interfaces.LConsumer<QueryWrapper<T>, String[], Object> doP;
|
||||
|
||||
@@ -79,4 +87,4 @@ public enum QueryTEnum {
|
||||
public static void build(QueryTEnum type, QueryWrapper q, String[] k, Object v) {
|
||||
type.getDoP().accept(q, k, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,5 +43,11 @@ public class CodeUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static String codeView(String ruleCode) {
|
||||
final String[] code = {""};
|
||||
ISysCodeRuleService service = SpringContextHolder.getBean(ISysCodeRuleService.class);
|
||||
RedissonUtils.lock(() -> code[0] = service.codeDemo(MapOf.of("flag","0","code",ruleCode)), ruleCode, 1);
|
||||
return code[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,11 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String codeDemo(Map form) {
|
||||
String code = (String) form.get("code");
|
||||
String id = codeRuleMapper.selectOne(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, code)).getId();
|
||||
SysCodeRule sysCodeRule = codeRuleMapper.selectOne(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, code));
|
||||
if (sysCodeRule==null){
|
||||
throw new BadRequestException("为配置编码规格"+code);
|
||||
}
|
||||
String id = sysCodeRule.getId();
|
||||
// 如果flag = 1就执行更新数据库的操作
|
||||
String flag = (String) form.get("flag");
|
||||
List<SysCodeRuleDetail> ruleDetails = codeRuleDetailMapper.selectList(new LambdaQueryWrapper<SysCodeRuleDetail>()
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -11,6 +12,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
@@ -19,12 +21,16 @@ import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -54,26 +60,33 @@ public class GroupController {
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增组盘组盘")
|
||||
@Log("新增组盘")
|
||||
@Transactional
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
||||
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
||||
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
||||
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
||||
Assert.noNullElements(new Object[]{group, group.get("tableData"), group.get("storagevehicle_code")}, "请求参数不能为空");
|
||||
String storagevehicleCode = group.getString("storagevehicle_code");
|
||||
{
|
||||
iMdPbStoragevehicleinfoService.getByCode(storagevehicleCode);
|
||||
int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getStoragevehicle_code, storagevehicleCode)
|
||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
if (has>0){
|
||||
if (has > 0) {
|
||||
throw new BadRequestException("当前载具组盘信息已存在");
|
||||
}
|
||||
}
|
||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||
groupPlate.setCreate_time(DateUtil.now());
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
iMdPbGroupplateService.save(groupPlate);
|
||||
JSONArray rows = group.getJSONArray("tableData");
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
GroupPlate groupPlate = row.toJavaObject(GroupPlate.class);
|
||||
groupPlate.setStoragevehicle_code(storagevehicleCode);
|
||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||
groupPlate.setCreate_time(DateUtil.now());
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
iMdPbGroupplateService.save(groupPlate);
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -83,4 +96,17 @@ public class GroupController {
|
||||
iMdPbGroupplateService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/getAllGroupInfo")
|
||||
@Log("通过载具号获取全部组盘信息")
|
||||
public ResponseEntity<Object> getAllGroupInfo(@RequestBody JSONArray rows) {
|
||||
List<String> vehicle_list = rows.stream()
|
||||
.map(obj -> (HashMap<String, String>) obj)
|
||||
.map(json -> json.get("storagevehicle_code"))
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
HashMap param = MapOf.of("status", IOSEnum.GROUP_PLATE_STATUS.code("组盘"), "vehicleCode", vehicle_list.get(0));
|
||||
List<JSONObject> list = iMdPbGroupplateService.getVehicleMaterial(param);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ 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.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
@@ -62,4 +64,11 @@ public class StorageVehicleInfoController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getVehicle/{code}")
|
||||
@Log("获取起始载具号")
|
||||
public ResponseEntity<Object> getVehicle(@PathVariable String code) {
|
||||
return new ResponseEntity<>(MapOf.of("value", CodeUtil.codeView(code)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrQuery;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -37,7 +38,7 @@ public class StructattrController {
|
||||
|
||||
@GetMapping
|
||||
@Log("查询仓位")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
public ResponseEntity<Object> query(StructattrQuery whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(structattrService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -28,7 +29,7 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
IPage<Structattr> queryAll(Map whereJson, PageQuery page);
|
||||
IPage<Structattr> queryAll(StructattrQuery whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.wms.basedata_manage.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
|
||||
/* *
|
||||
*物料查询对象
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class StructattrQuery extends BaseQuery<Structattr> {
|
||||
private String search;
|
||||
private String stor_id;
|
||||
private String sect_id;
|
||||
private String lock_type;
|
||||
private String layer_num;
|
||||
private String is_used;
|
||||
private String is_have;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("search", QParam.builder().k(new String[]{"struct_code","struct_name"}).type(QueryTEnum.ORLK).build());
|
||||
super.doP.put("is_have", QParam.builder().k(new String[]{"storagevehicle_code"}).type(QueryTEnum.NULL_OR_HAS).build());
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import org.nl.wms.basedata_manage.service.dao.mapper.StructattrMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrQuery;
|
||||
import org.nl.wms.decision_manage.service.sectStrategy.IStSectStrategyService;
|
||||
import org.nl.wms.decision_manage.service.sectStrategy.dao.StSectStrategy;
|
||||
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
|
||||
@@ -54,6 +55,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -85,30 +87,10 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
private IStIvtStructivtflowService stIvtStructivtflowService;
|
||||
|
||||
@Override
|
||||
public IPage<Structattr> queryAll(Map whereJson, PageQuery page) {
|
||||
|
||||
String search = (String) whereJson.get("search");
|
||||
String stor_id = (String) whereJson.get("stor_id");
|
||||
String sect_id = (String) whereJson.get("sect_id");
|
||||
String lock_type = (String) whereJson.get("lock_type");
|
||||
String layer_num = (String) whereJson.get("layer_num");
|
||||
String is_used = (String) whereJson.get("is_used");
|
||||
String is_have = (String) whereJson.get("is_have");
|
||||
|
||||
return structattrMapper.selectPage(new Page<>(page.getPage() + 1 ,page.getSize()), new LambdaQueryWrapper<Structattr>()
|
||||
.like(StrUtil.isNotEmpty(search),Structattr::getStruct_code, search)
|
||||
.like(StrUtil.isNotEmpty(search),Structattr::getStruct_name, search)
|
||||
.eq(StrUtil.isNotEmpty(stor_id),Structattr::getStor_id, stor_id)
|
||||
.eq(StrUtil.isNotEmpty(sect_id),Structattr::getSect_id, sect_id)
|
||||
.eq(StrUtil.isNotEmpty(lock_type),Structattr::getLock_type, lock_type)
|
||||
.eq(StrUtil.isNotEmpty(layer_num),Structattr::getLayer_num, layer_num)
|
||||
.eq(StrUtil.isNotEmpty(is_used),Structattr::getIs_used, is_used)
|
||||
.eq(Structattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.isNull("1".equals(is_have),Structattr::getStoragevehicle_code)
|
||||
.isNotNull("2".equals(is_have),Structattr::getStoragevehicle_code)
|
||||
.orderByAsc(Structattr::getStruct_code)
|
||||
);
|
||||
|
||||
public IPage<Structattr> queryAll(StructattrQuery whereJson, PageQuery page) {
|
||||
page.setSort("struct_code,asc");
|
||||
Page<Structattr> structPage = this.page(page.build(), whereJson.build());
|
||||
return structPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -430,7 +412,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
this.update(wrapper);
|
||||
List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>()
|
||||
.eq("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||
.lt("status", IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
.eq("status", IOSEnum.GROUP_PLATE_STATUS.code("入库")));
|
||||
List<StIvtStructivtflow> records = new ArrayList<>();
|
||||
//更新冻结数量
|
||||
Structattr structattr = this.getByCode(changeDto.getStructCode());
|
||||
|
||||
@@ -83,7 +83,7 @@ public class RawAssistIStorController {
|
||||
|
||||
@PostMapping("/unDivStruct")
|
||||
@Log("取消分配货位")
|
||||
public ResponseEntity<Object> unDivStruct(@RequestBody Map whereJson) {
|
||||
public ResponseEntity<Object> unDivStruct(@RequestBody JSONObject whereJson) {
|
||||
iRawAssistIStorService.unDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.warehouse_management.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
|
||||
@@ -48,4 +49,8 @@ public interface IMdPbGroupplateService extends IService<GroupPlate> {
|
||||
* }
|
||||
*/
|
||||
void updateIvt(List<JSONObject> updateIvtList);
|
||||
|
||||
|
||||
List<JSONObject> getVehicleMaterial(@Param("params") Map whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface IRawAssistIStorService extends IService<IOStorInv> {
|
||||
|
||||
|
||||
|
||||
void unDivStruct(Map whereJson);
|
||||
void unDivStruct(JSONObject whereJson);
|
||||
|
||||
void divPoint(Map whereJson);
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dis.task_id
|
||||
LEFT JOIN md_pb_groupplate ext ON ext.storagevehicle_code = dis.storagevehicle_code
|
||||
and dis.material_id = ext.material_id and ext.pcsn=dis.pcsn
|
||||
where
|
||||
1=1
|
||||
<if test="params.iostorinvdtl_id != null">
|
||||
|
||||
@@ -65,4 +65,10 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
updateIvtUtils.updateIvt(json);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getVehicleMaterial(Map whereJson) {
|
||||
List<JSONObject> vehicleMaterial = this.baseMapper.getVehicleMaterial(whereJson);
|
||||
return vehicleMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
@@ -328,12 +329,15 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
Assert.noNullElements(new Object[]{param.getString("stor_code"),param.getString("sect_code")},"参数异常");
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) param.get("tableMater");
|
||||
JSONObject mst = JSONObject.parseObject(JSON.toJSONString(param));
|
||||
HashMap<String, String> map = rows.get(0);
|
||||
JSONObject map = param.getJSONObject("dis_row");
|
||||
String iostorinvId = map.getString("iostorinv_id");
|
||||
String storagevehicleCode = map.getString("storagevehicle_code");
|
||||
//判断该分配明细是否已经分配货位
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,map.get("iostorinvdis_id"))
|
||||
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id, iostorinvId)
|
||||
.eq(IOStorInvDis::getStoragevehicle_code, storagevehicleCode)
|
||||
.isNull(IOStorInvDis::getStruct_code));
|
||||
if (ioStorInvDis ==null){
|
||||
if (CollectionUtils.isEmpty(disList)) {
|
||||
throw new BadRequestException("当前明细已经分配过库位");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
@@ -361,22 +365,16 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
struct_code = struct.getStruct_code();
|
||||
struct_name = struct.getStruct_name();
|
||||
} else {
|
||||
Structattr structattr = iStructattrService.findById(map.get("struct_id"));
|
||||
Structattr structattr = iStructattrService.findById(map.getString("struct_id"));
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = mdPbStoragevehicleinfoMapper.selectOne(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
);
|
||||
//判断仓位的长高宽是否能放下载具
|
||||
// if (structattr.getWidth() < 0 &&
|
||||
// structattr.getHeight() < 0 &&
|
||||
// structattr.getZdepth() < 0) {
|
||||
// throw new BadRequestException("载具不符合,请检查!");
|
||||
// }
|
||||
sect_id = map.get("sect_id");
|
||||
sect_code = map.get("sect_code");
|
||||
sect_name = map.get("sect_name");
|
||||
struct_id = map.get("struct_id");
|
||||
struct_code = map.get("struct_code");
|
||||
struct_name = map.get("struct_name");
|
||||
sect_id = map.getString("sect_id");
|
||||
sect_code = map.getString("sect_code");
|
||||
sect_name = map.getString("sect_name");
|
||||
struct_id = map.getString("struct_id");
|
||||
struct_code = map.getString("struct_code");
|
||||
struct_name = map.getString("struct_name");
|
||||
}
|
||||
JSONObject dis_map = new JSONObject();
|
||||
dis_map.put("sect_id", sect_id);
|
||||
@@ -386,7 +384,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
dis_map.put("struct_code", struct_code);
|
||||
dis_map.put("struct_name", struct_name);
|
||||
//锁定货位
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(map.get("iostorinv_id"));
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(map.getString("iostorinv_id"));
|
||||
JSONObject lock_map = new JSONObject();
|
||||
lock_map.put("struct_code", struct_code);
|
||||
lock_map.put("inv_id", ioStorInv.getIostorinv_id());
|
||||
@@ -407,22 +405,26 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
.set(IOStorInvDis::getStruct_id,dis_map.getString("struct_id"))
|
||||
.set(IOStorInvDis::getStruct_code,dis_map.getString("struct_code"))
|
||||
.set(IOStorInvDis::getStruct_name,dis_map.getString("struct_name"))
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,map.get("iostorinvdis_id"))
|
||||
.eq(IOStorInvDis::getIostorinv_id, iostorinvId)
|
||||
.eq(IOStorInvDis::getStoragevehicle_code, storagevehicleCode)
|
||||
);
|
||||
//维护单据明细表里 分配数量
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("iostorinvdtl_id",map.get("iostorinvdtl_id"));
|
||||
jsonObject.put("bill_status",IOSEnum.BILL_STATUS.code("分配完"));
|
||||
jsonObject.put("assign_qty",map.get("plan_qty"));
|
||||
jsonObject.put("unassign_qty","0");
|
||||
ioStorInvDtlMapper.updateById(jsonObject.toJavaObject(IOStorInvDtl.class));
|
||||
//根据单据标识判断分配明细是否都已经分配完成
|
||||
//维护单据明细表里分配数量
|
||||
List<String> dtlCollect = disList.stream().map(IOStorInvDis::getIostorinvdtl_id).collect(Collectors.toList());
|
||||
List<IOStorInvDtl> dtls = ioStorInvDtlMapper.selectList(new LambdaQueryWrapper<IOStorInvDtl>().in(IOStorInvDtl::getIostorinvdtl_id, dtlCollect));
|
||||
for (IOStorInvDtl dtl : dtls) {
|
||||
int disQtySum = disList.stream().filter(dis -> dis.getIostorinvdtl_id().equals(dtl.getIostorinvdtl_id())).mapToInt(value -> value.getPlan_qty().intValue()).sum();
|
||||
dtl.setAssign_qty(dtl.getAssign_qty().add(BigDecimal.valueOf(disQtySum)));
|
||||
dtl.setUnassign_qty(dtl.getPlan_qty().subtract(dtl.getAssign_qty()));
|
||||
dtl.setBill_status(dtl.getUnassign_qty().compareTo(BigDecimal.valueOf(0)) > 0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("分配完"));
|
||||
ioStorInvDtlMapper.updateById(dtl);
|
||||
}
|
||||
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||
.and(wrapper -> wrapper.isNull(IOStorInvDis::getStruct_code).or().eq(IOStorInvDis::getStruct_code, "")));
|
||||
// 根据分配货位情况 更新主表单据状态
|
||||
IOStorInv ios = new IOStorInv();
|
||||
ios.setIostorinv_id(map.get("iostorinv_id"));
|
||||
ios.setIostorinv_id(map.getString("iostorinv_id"));
|
||||
ios.setUpdate_optid(currentUserId);
|
||||
ios.setUpdate_optname(nickName);
|
||||
ios.setUpdate_time(now);
|
||||
@@ -461,14 +463,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void unDivStruct(Map whereJson) {
|
||||
public void unDivStruct(JSONObject whereJson) {
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableMater");
|
||||
HashMap<String, String> jo = rows.get(0);
|
||||
JSONObject jo = whereJson.getJSONObject("dis_row");
|
||||
|
||||
//解锁原货位点位
|
||||
JSONObject unlock_map = new JSONObject();
|
||||
@@ -476,39 +476,51 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
unlock_map.put("inv_type", null);
|
||||
unlock_map.put("inv_id", null);
|
||||
unlock_map.put("inv_code", null);
|
||||
iStructattrService.updateStatusByCode("2",unlock_map);
|
||||
iStructattrService.updateStatusByCode("2", unlock_map);
|
||||
|
||||
// 修改分配明细表
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(),new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getSect_id,null)
|
||||
.set(IOStorInvDis::getSect_code,null)
|
||||
.set(IOStorInvDis::getSect_name,null)
|
||||
.set(IOStorInvDis::getStruct_id,null)
|
||||
.set(IOStorInvDis::getStruct_code,null)
|
||||
.set(IOStorInvDis::getStruct_name,null)
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,jo.get("iostorinvdis_id"))
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(), new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getSect_id, null)
|
||||
.set(IOStorInvDis::getSect_code, null)
|
||||
.set(IOStorInvDis::getSect_name, null)
|
||||
.set(IOStorInvDis::getStruct_id, null)
|
||||
.set(IOStorInvDis::getStruct_code, null)
|
||||
.set(IOStorInvDis::getStruct_name, null)
|
||||
.eq(IOStorInvDis::getIostorinv_id, jo.get("iostorinv_id"))
|
||||
.eq(IOStorInvDis::getStoragevehicle_code, jo.get("storagevehicle_code"))
|
||||
);
|
||||
|
||||
//维护单据明细表里 分配数量
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("iostorinvdtl_id",jo.get("iostorinvdtl_id"));
|
||||
jsonObject.put("bill_status",IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonObject.put("assign_qty","0");
|
||||
jsonObject.put("unassign_qty",jo.get("plan_qty"));
|
||||
ioStorInvDtlMapper.updateById(jsonObject.toJavaObject(IOStorInvDtl.class));
|
||||
//更新组盘表状态
|
||||
mdPbGroupplateService.update(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
.eq(GroupPlate::getStoragevehicle_code, jo.get("storagevehicle_code"))
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库")));
|
||||
|
||||
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<IOStorInvDis>().eq(IOStorInvDis::getIostorinv_id, jo.get("iostorinv_id"))
|
||||
.eq(IOStorInvDis::getStoragevehicle_code, jo.get("storagevehicle_code")));
|
||||
//维护单据明细表里分配数量
|
||||
List<String> dtlCollect = disList.stream().map(IOStorInvDis::getIostorinvdtl_id).collect(Collectors.toList());
|
||||
List<IOStorInvDtl> dtls = ioStorInvDtlMapper.selectList(new LambdaQueryWrapper<IOStorInvDtl>().in(IOStorInvDtl::getIostorinvdtl_id, dtlCollect));
|
||||
for (IOStorInvDtl dtl : dtls) {
|
||||
int disQtySum = disList.stream().filter(dis -> dis.getIostorinvdtl_id().equals(dtl.getIostorinvdtl_id())).mapToInt(value -> value.getPlan_qty().intValue()).sum();
|
||||
dtl.setAssign_qty(dtl.getAssign_qty().subtract(BigDecimal.valueOf(disQtySum)));
|
||||
dtl.setUnassign_qty(dtl.getPlan_qty().subtract(dtl.getAssign_qty()));
|
||||
dtl.setBill_status(dtl.getUnassign_qty().compareTo(dtl.getPlan_qty()) == 0 ? IOSEnum.BILL_STATUS.code("生成") : IOSEnum.BILL_STATUS.code("分配中"));
|
||||
ioStorInvDtlMapper.updateById(dtl);
|
||||
}
|
||||
|
||||
//根据单据标识判断分配明细是否都已经分配完成
|
||||
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id,jo.get("iostorinv_id"))
|
||||
.and(wrapper -> wrapper.isNotNull(IOStorInvDis::getStruct_code).or().ne(IOStorInvDis::getStruct_code,"")));
|
||||
.eq(IOStorInvDis::getIostorinv_id, jo.get("iostorinv_id"))
|
||||
.and(wrapper -> wrapper.isNotNull(IOStorInvDis::getStruct_code).or().ne(IOStorInvDis::getStruct_code, "")));
|
||||
|
||||
// 根据分配货位情况 更新主表单据状态
|
||||
IOStorInv ios = new IOStorInv();
|
||||
ios.setIostorinv_id(jo.get("iostorinv_id"));
|
||||
ios.setIostorinv_id(jo.getString("iostorinv_id"));
|
||||
ios.setUpdate_optid(currentUserId);
|
||||
ios.setUpdate_optname(nickName);
|
||||
ios.setUpdate_time(now);
|
||||
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("生成"));
|
||||
ios.setBill_status(disCount > 0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("生成"));
|
||||
ioStorInvMapper.updateById(ios);
|
||||
}
|
||||
|
||||
@@ -520,24 +532,20 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
HashMap<String, String> map = rows.get(0);
|
||||
|
||||
//判断是否已经分配好货位
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,map.get("iostorinvdis_id"))
|
||||
.and(wrapper -> wrapper.isNotNull(IOStorInvDis::getStruct_code).or().ne(IOStorInvDis::getStruct_code,"")));
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)){
|
||||
List<IOStorInvDis> ioStorInvDis = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||
.eq(IOStorInvDis::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
.and(wrapper -> wrapper.isNotNull(IOStorInvDis::getStruct_code).or().ne(IOStorInvDis::getStruct_code, "")));
|
||||
if (CollectionUtils.isEmpty(ioStorInvDis)) {
|
||||
throw new BadRequestException("该明细还没分配货位,请先分配货位");
|
||||
}
|
||||
|
||||
//创建任务
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "STInTask");
|
||||
task_form.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("point_code1", point_code);
|
||||
task_form.put("point_code2", ioStorInvDis.getStruct_code());
|
||||
task_form.put("point_code2", ioStorInvDis.get(0).getStruct_code());
|
||||
task_form.put("vehicle_code", map.get("storagevehicle_code"));
|
||||
// GroupPlate groupPlate = mdPbGroupplateMapper.selectOne(new LambdaQueryWrapper<>(GroupPlate.class)
|
||||
// .eq(GroupPlate::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
// );
|
||||
// task_form.put("group_id", groupPlate.getGroup_id());
|
||||
StInTask stInTask = SpringContextHolder.getBean("STInTask");
|
||||
|
||||
String task_id = stInTask.create(task_form);
|
||||
@@ -549,7 +557,15 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
dis.setTask_id(task_id);
|
||||
dis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
dis.setPoint_code(point_code);
|
||||
ioStorInvDisMapper.updateById(dis);
|
||||
//更新详情数据
|
||||
ioStorInvDisMapper.update(dis, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("生成"))
|
||||
.set(IOStorInvDis::getTask_id, task_id)
|
||||
.set(IOStorInvDis::getIs_issued, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
.set(IOStorInvDis::getPoint_code, point_code)
|
||||
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||
.eq(IOStorInvDis::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成")));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -636,74 +652,64 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void taskFinish(SchBaseTask task) {
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getTask_id,task.getTask_id())
|
||||
List<IOStorInvDis> ioStorInvDis = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
||||
);
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)){
|
||||
if (CollectionUtils.isEmpty(ioStorInvDis)) {
|
||||
throw new BadRequestException("未找到任务对应的分配明细");
|
||||
}
|
||||
|
||||
// 完成当前分配明细
|
||||
ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.set(IOStorInvDis::getReal_qty,ioStorInvDis.getPlan_qty())
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,ioStorInvDis.getIostorinvdis_id())
|
||||
);
|
||||
|
||||
String iostorinvId = ioStorInvDis.get(0).getIostorinv_id();
|
||||
String storagevehicleCode = ioStorInvDis.get(0).getStoragevehicle_code();
|
||||
String structCode = ioStorInvDis.get(0).getStruct_code();
|
||||
//解锁库位
|
||||
JSONObject finish_map = new JSONObject();
|
||||
finish_map.put("struct_code",ioStorInvDis.getStruct_code());
|
||||
finish_map.put("storagevehicle_code",ioStorInvDis.getStoragevehicle_code());
|
||||
finish_map.put("struct_code", structCode);
|
||||
finish_map.put("storagevehicle_code", storagevehicleCode);
|
||||
finish_map.put("inv_type", null);
|
||||
finish_map.put("inv_id", null);
|
||||
finish_map.put("inv_code", null);
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
//库存变动
|
||||
iStructattrService.updateStatusByCode("1", finish_map);
|
||||
//库存变动
|
||||
StructattrChangeDto changeDto = StructattrChangeDto.builder()
|
||||
.inv(ioStorInvDis.getIostorinv_id())
|
||||
.storagevehicleCode(ioStorInvDis.getStoragevehicle_code())
|
||||
.structCode(ioStorInvDis.getStruct_code()).taskType(task.getConfig_code()).inBound(true).build();
|
||||
.inv(iostorinvId)
|
||||
.storagevehicleCode(storagevehicleCode)
|
||||
.structCode(structCode).taskType(task.getConfig_code()).inBound(true).build();
|
||||
iStructattrService.changeStruct(changeDto);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
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("未找到明细");
|
||||
// 完成当前分配明细
|
||||
Map<String, BigDecimal> dtlMap = new HashMap<>();
|
||||
for (IOStorInvDis item : ioStorInvDis) {
|
||||
ioStorInvDisMapper.update(item, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.set(IOStorInvDis::getReal_qty, item.getPlan_qty())
|
||||
.eq(IOStorInvDis::getIostorinvdis_id, item.getIostorinvdis_id()));
|
||||
dtlMap.put(item.getIostorinvdtl_id(), item.getPlan_qty());
|
||||
}
|
||||
// 如果分配明细全部完成则更新明细表状态
|
||||
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("完成"))
|
||||
//更新明细
|
||||
for (String dtl_id : dtlMap.keySet()) {
|
||||
IOStorInvDtl invDtl = new IOStorInvDtl();
|
||||
invDtl.setIostorinvdtl_id(dtl_id);
|
||||
invDtl.setReal_qty(dtlMap.get(dtl_id));
|
||||
invDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(invDtl);
|
||||
}
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id, iostorinvId)
|
||||
.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, iostorinvId)
|
||||
);
|
||||
|
||||
// 如果明细全部完成则更新主表状态
|
||||
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())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
288
nladmin-ui/src/views/wms/basedata/group/AddDialog.vue
Normal file
288
nladmin-ui/src/views/wms/basedata/group/AddDialog.vue
Normal file
@@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||
<label slot="label">载具编码:</label>
|
||||
<el-input v-model="form.storagevehicle_code" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="源单据号" prop="ext_code">
|
||||
<label slot="label">源单据号:</label>
|
||||
<el-input v-model="form.ext_code" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="源单类型" prop="ext_type">
|
||||
<el-select
|
||||
v-model="form.ext_type"
|
||||
clearable
|
||||
placeholder="源单类型"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_IN_TYPE"
|
||||
:key="item.value"
|
||||
:disabled="item.value === '0003'"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="insertEvent()"
|
||||
>
|
||||
添加物料
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip width="180" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="260" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="260" prop="material_spec" label="物料规格" />
|
||||
<el-table-column show-overflow-tooltip width="180" prop="pcsn" label="批次号">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.pcsn" style="width: 150px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="180" prop="qty" label="数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.qty" style="width: 150px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="180" prop="qty" label="计量单位名称">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.qty_unit_name"
|
||||
style="width: 100px"
|
||||
placeholder=""
|
||||
@change="unitChange(scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableEnum.md_pb_measureunit"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value+'@'+item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="150" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<MaterialDialog :dialog-show.sync="dtlShow" :is-single.sync="isSingle" @materialChoose="materialChoose" />
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
ext_code: '',
|
||||
storagevehicle_code: '',
|
||||
stor_id: '',
|
||||
status: '10',
|
||||
ext_type: '0',
|
||||
remark: '',
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterialDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_INV_IN_TYPE'],
|
||||
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
isSingle: false,
|
||||
bill_btn: false,
|
||||
mater_btn: false,
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
rules: {
|
||||
storagevehicle_code: [
|
||||
{ required: true, message: '载具不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudBsrealstorattr.getStor().then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
async insertdtl() {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.form.tableData.push({ quality_scode: '01', is_active: '1', ivt_level: '01', qty: '0' })
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
const pcsn = rows[index].pcsn
|
||||
let len = rows.length
|
||||
while (len--) {
|
||||
const obj = rows[len]
|
||||
if (pcsn === obj.pcsn) {
|
||||
const index = rows.indexOf(obj)
|
||||
if (index > -1) { // 移除找到的指定元素
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].qty)
|
||||
rows.splice(index, 1)
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
unitChange(row) {
|
||||
const split = row.qty_unit_name.split('@')
|
||||
row.qty_unit_id = split[0]
|
||||
row.qty_unit_name = split[1]
|
||||
},
|
||||
materialChoose(row) {
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
row.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
debugger
|
||||
if (row.material_code === item.material_code && row.pcsn === item.pcsn) {
|
||||
debugger
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
},
|
||||
async insertEvent(row) {
|
||||
this.dtlShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function getAllGroupInfo(data) {
|
||||
return request({
|
||||
url: 'api/group/getAllGroupInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getAllGroupInfo }
|
||||
|
||||
@@ -2,62 +2,62 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
物料查询:
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
批次查询:
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
载具编码:
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="载具编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
组盘状态:
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.GROUP_STATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
物料查询:
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
批次查询:
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
载具编码:
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="载具编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
组盘状态:
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.GROUP_STATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--新增表格-->
|
||||
@@ -179,6 +179,8 @@
|
||||
</div>
|
||||
<!--放引用的组件-->
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -190,6 +192,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
||||
import AddDialog from '@/views/wms/basedata/group/AddDialog'
|
||||
|
||||
const defaultForm = {
|
||||
group_id: null,
|
||||
@@ -211,7 +214,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Group',
|
||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation, AddDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
||||
// 数据字典
|
||||
@@ -243,6 +246,9 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.GROUP_STATUS[row.status]
|
||||
},
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
<el-select
|
||||
v-model="query.storagevehicle_type"
|
||||
clearable
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
class="filter-item"
|
||||
style="width: 180px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
@@ -26,13 +28,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模糊搜索">
|
||||
|
||||
<el-form-item label="载具号">
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="载具号、载具名称"
|
||||
style="width: 200px;"
|
||||
placeholder="载具号"
|
||||
style="width: 110px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
@@ -42,8 +45,114 @@
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
@click="printView"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="载具物料信息"
|
||||
width="540px"
|
||||
@close="materiValueCancel()"
|
||||
>
|
||||
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="materialForm.vehicle_code" disabled style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="materialForm.material_code" clearable style="width: 370px"
|
||||
@clear="materialForm.material_id='',materialForm.material_code='',materialForm.material_name='',materialForm.material_spec=''">
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryMater"/>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批 次" prop="pcsn">
|
||||
<el-input v-model="materialForm.pcsn" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料数量" prop="qty">
|
||||
<el-input v-model="materialForm.qty" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="冻结数量" prop="frozen_qty">
|
||||
<el-input v-model="materialForm.frozen_qty" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程实例" prop="proc_inst_id">
|
||||
<el-input v-model="materialForm.proc_inst_id" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="materiValueCancel()">取消</el-button>
|
||||
<el-button type="primary" @click="materiValueSubmit()">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="pointMVisible"
|
||||
title="载具信息"
|
||||
width="540px"
|
||||
@close="materiValueCancel()"
|
||||
>
|
||||
<el-form ref="form" :model="updateForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="载具编号" prop="vehicle_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="updateForm.vehicle_code" clearable/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量(g)" prop="vehicle_weight">
|
||||
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="materiValueCancel()">取消</el-button>
|
||||
<el-button type="primary" @click="pointMateriSubmit()">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:before-close="crud.cancelCU"
|
||||
:close-on-click-modal="false"
|
||||
title="打印配置"
|
||||
:visible.sync="printVisible"
|
||||
width="450px"
|
||||
>
|
||||
<el-form ref="form" :model="printForm" size="mini" label-width="150px">
|
||||
<el-form-item label="纸张高度(mm)" prop="pageh">
|
||||
<el-input v-model="printForm.pageh" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="纸张宽度(mm)" prop="pagew">
|
||||
<el-input v-model="printForm.pagew" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距top(mm)" prop="pagetop">
|
||||
<el-input v-model="printForm.pagetop" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距right(mm)" prop="pageright">
|
||||
<el-input v-model="printForm.pageright" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距down(mm)" prop="pagedown">
|
||||
<el-input v-model="printForm.pagedown" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距left(mm)" prop="pageleft">
|
||||
<el-input v-model="printForm.pageleft" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<br>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="printClose">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="print">打印</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:before-close="crud.cancelCU"
|
||||
:close-on-click-modal="false"
|
||||
@@ -55,26 +164,38 @@
|
||||
<el-form-item label="载具类型" prop="storagevehicle_type">
|
||||
<el-select
|
||||
v-model="form.storagevehicle_type"
|
||||
class="filter-item"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
:disabled="crud.status.edit > 0"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
@change="getVehicle"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:value="item.para1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
<br>
|
||||
<el-form-item label="起始载具号" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 250px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具名称" prop="storagevehicle_name">
|
||||
<el-input v-model="form.storagevehicle_name" style="width: 200px;" />
|
||||
<el-form-item label="载具数量" prop="num">
|
||||
<el-input-number v-model="form.num" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量" prop="weigth">
|
||||
<el-input-number v-model="form.weigth" :precision="1" style="width: 200px;" />
|
||||
<el-form-item label="高度(mm)" prop="h">
|
||||
<el-input-number v-model="form.h" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度(mm)" prop="w">
|
||||
<el-input-number v-model="form.w" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="深度(mm)" prop="l">
|
||||
<el-input-number v-model="form.l" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量(g)" prop="weight">
|
||||
<el-input-number v-model="form.weight" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
@@ -83,7 +204,8 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">生成</el-button>
|
||||
<el-button type="primary" @click="addAndprint">生成并打印</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -131,50 +253,53 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<!-- 分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materialShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="materType"
|
||||
@setMaterValue="setMaterValue"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStoragevehicleinfo from '@/views/wms/basedata/storagevehicleinfo/storagevehicleinfo'
|
||||
import crudStoragevehicleinfo from './storagevehicleinfo'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
import MaterDtl from '@/views/wms/basedata/material/MaterialDialog'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
storagevehicle_id: null,
|
||||
storagevehicle_code: null,
|
||||
storagevehicle_name: null,
|
||||
vehicle_code: null,
|
||||
vehicle_name: null,
|
||||
one_code: null,
|
||||
two_code: null,
|
||||
rfid_code: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_name: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
is_used: '1',
|
||||
storagevehicle_type: null,
|
||||
weigth: null,
|
||||
vehicle_width: null,
|
||||
vehicle_long: null,
|
||||
vehicle_height: null,
|
||||
overstruct_type: null,
|
||||
occupystruct_qty: null,
|
||||
ext_id: null,
|
||||
qty: null,
|
||||
pcsn: null
|
||||
w: null,
|
||||
l: null,
|
||||
h: null,
|
||||
weight: null,
|
||||
overstruct_type: '0',
|
||||
occupystruct_qty: '1',
|
||||
ext_json: null,
|
||||
num: '1'
|
||||
}
|
||||
export default {
|
||||
name: 'Storagevehicleinfo',
|
||||
dicts: ['storagevehicle_type', 'is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['storagevehicle_type', "VEHICLE_OVER_TYPE"],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -203,31 +328,42 @@ export default {
|
||||
}
|
||||
}
|
||||
return {
|
||||
printVisible: false,
|
||||
updateForm: {},
|
||||
printForm: {
|
||||
pageh: '40mm',
|
||||
pagew: '60mm',
|
||||
pagetop: '4.3mm',
|
||||
pagedown: '50mm',
|
||||
pageright: '30mm',
|
||||
pageleft: '8mm'
|
||||
},
|
||||
pointMVisible: false,
|
||||
materType: '01',
|
||||
materialShow: false,
|
||||
dialogVisible: false,
|
||||
materialForm: {},
|
||||
resultCodeArr: [],
|
||||
permission: {},
|
||||
classes1: [],
|
||||
rules: {
|
||||
vehicle_code: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
storagevehicle_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
vehicle_type: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
overstruct_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
{required: true, message: '不能为空', trigger: 'blur'},
|
||||
{validator: numberOne}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -237,39 +373,155 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
onCloseDialog() {
|
||||
this.form = defaultForm
|
||||
},
|
||||
queryMater() {
|
||||
this.materialShow = true
|
||||
},
|
||||
setMaterValue(row) {
|
||||
this.$set(this.materialForm, 'material_code', row.material_code)
|
||||
this.$set(this.materialForm, 'material_id', row.material_id)
|
||||
this.$set(this.materialForm, 'material_code', row.material_code)
|
||||
},
|
||||
materiValueCancel() {
|
||||
this.updateForm = {}
|
||||
this.pointMVisible = false
|
||||
this.dialogVisible = false
|
||||
},
|
||||
materiValueSubmit() {
|
||||
crudStoragevehicleinfo.updateVehicleMaterial(this.materialForm).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.materiValueCancel()
|
||||
})
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.storagevehicle_code + ', 是否继续?', '提示', {
|
||||
let msg = '此操作将停用载具,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用载具,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudStoragevehicleinfo.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
crudStoragevehicleinfo.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
formattType(row) {
|
||||
return this.dict.label.storagevehicle_type[row.storagevehicle_type]
|
||||
},
|
||||
printView() {
|
||||
this.printForm = {
|
||||
pageh: '40mm',
|
||||
pagew: '60mm',
|
||||
pagetop: '4.3mm',
|
||||
pagedown: '50mm',
|
||||
pageright: '30mm',
|
||||
pageleft: '8mm'
|
||||
}
|
||||
this.printVisible = true
|
||||
},
|
||||
printClose() {
|
||||
this.printVisible = false
|
||||
this.printForm = {
|
||||
pageh: '40mm',
|
||||
pagew: '60mm',
|
||||
pagetop: '4.3mm',
|
||||
pagedown: '50mm',
|
||||
pageright: '30mm',
|
||||
pageleft: '8mm'
|
||||
}
|
||||
},
|
||||
print() {
|
||||
this.printVisible = false
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (!_selectData || _selectData.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
console.log(_selectData.length)
|
||||
console.log(this.printForm)
|
||||
for (let i = 0; i < _selectData.length; i++) {
|
||||
const code = _selectData[i].vehicle_code
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, this.printForm.pagew, this.printForm.pageh, '1')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '50mm', '30mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE(this.printForm.pagetop, this.printForm.pageleft, this.printForm.pagedown, this.printForm.pageright, '128Auto', code)
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
},
|
||||
toView(row) {
|
||||
this.dialogVisible = true
|
||||
crudStoragevehicleinfo.getMaterialByVehicle(row).then(res => {
|
||||
this.materialForm = res
|
||||
})
|
||||
},
|
||||
updateweight(row) {
|
||||
this.pointMVisible = true
|
||||
this.updateForm = row
|
||||
},
|
||||
pointMateriSubmit() {
|
||||
console.log(this.updateForm)
|
||||
crudStoragevehicleinfo.edit(this.updateForm).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
this.updateForm = {}
|
||||
this.pointMVisible = false
|
||||
this.crud.refresh()
|
||||
},
|
||||
addAndprint() {
|
||||
const data = this.form
|
||||
if (!this.form.storagevehicle_type) {
|
||||
this.crud.notify('载具类型不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!this.form.num) {
|
||||
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
crudStoragevehicleinfo.add(data).then(res => {
|
||||
res.forEach((item) => {
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '60mm', '40mm', '1')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '50mm', '30mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE('4.3mm', '8mm', '50mm', '30mm', '128Auto', item)
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
})
|
||||
this.crud.status.add = CRUD.STATUS.NORMAL
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
getVehicle(code) {
|
||||
if (!code) {
|
||||
this.crud.notify('请选择载具类型', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.form.vehicle_code = ''
|
||||
return false
|
||||
}
|
||||
crudStoragevehicleinfo.getVehicle(code).then(res => {
|
||||
this.form.vehicle_code = res.value
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="total_qty">
|
||||
<label slot="label">总 数 量:</label>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
@@ -131,7 +131,7 @@
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="pcsn" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||||
@@ -313,7 +313,7 @@ export default {
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
if (row.pcsn === item.pcsn) {
|
||||
if (row.pcsn === item.pcsn && row.material_id === item.material_id && row.storagevehicle_code === item.storagevehicle_code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -77,12 +77,12 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||||
import group, { getAllGroupInfo } from '@/views/wms/basedata/group/group.js'
|
||||
|
||||
const start = new Date()
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: { crudOperation, rrOperation, pagination, DateRangePicker },
|
||||
components: { crudOperation, rrOperation, pagination, DateRangePicker, group },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '用户',
|
||||
@@ -149,10 +149,10 @@ export default {
|
||||
console.log('获取的rows:')
|
||||
console.log(this.rows)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
// crudRawAssist.queryBoxMater(this.rows).then(res => {
|
||||
// this.rows = res
|
||||
// this.$emit('tableChanged', this.rows)
|
||||
// })
|
||||
group.getAllGroupInfo(this.rows).then(res => {
|
||||
this.rows = res.content
|
||||
this.$emit('tableChanged', this.rows)
|
||||
})
|
||||
// this.form = this.$options.data().form
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,20 @@
|
||||
label="数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="assign_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="分配数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="unassign_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="未分配数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" align="center" />
|
||||
@@ -155,10 +169,13 @@
|
||||
:data="form.tableMater"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
highlight-current-row
|
||||
@row-click="clcikDisRow"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
@@ -166,7 +183,7 @@
|
||||
show-overflow-tooltip
|
||||
prop="plan_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="数量"
|
||||
label="重量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
|
||||
@@ -191,7 +208,6 @@ import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
import StructDiv from '@/views/wms/pub/StructDialog'
|
||||
import crudRawAssist, { allDivStruct } from '@/views/wms/st/inbill/rawassist'
|
||||
import crudPoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import { getPointList } from '../../sch/point/schBasePoint'
|
||||
|
||||
export default {
|
||||
name: 'DivDialog',
|
||||
@@ -237,6 +253,7 @@ export default {
|
||||
sect_val: null,
|
||||
form: {
|
||||
dtl_row: null,
|
||||
dis_row: null,
|
||||
storage_qty: '',
|
||||
point_code: null,
|
||||
checked: true,
|
||||
@@ -259,7 +276,10 @@ export default {
|
||||
crudSectattr.getSectCode({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
crudPoint.getPointList().then(res => {
|
||||
|
||||
const area_type = 'RKQ'
|
||||
|
||||
crudPoint.getPointList({ 'region_code': area_type }).then(res => {
|
||||
this.pointlist = res
|
||||
})
|
||||
},
|
||||
@@ -281,11 +301,15 @@ export default {
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.dtl_row = res[row.index]
|
||||
this.form.dis_row = null
|
||||
})
|
||||
crudRawAssist.getDisDtl(row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
},
|
||||
clcikDisRow(row, column, event) {
|
||||
this.form.dis_row = row
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
@@ -312,7 +336,6 @@ export default {
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
this.sectProp = val
|
||||
debugger
|
||||
if (val.length === 1) {
|
||||
this.stor_code = val[0]
|
||||
this.sect_code = ''
|
||||
@@ -337,8 +360,6 @@ export default {
|
||||
this.form.tableMater[i].sect_name = row.sect_name
|
||||
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
|
||||
}
|
||||
this.form.sect_code = this.sect_code
|
||||
this.form.stor_code = this.stor_code
|
||||
crudRawAssist.divStruct(this.form).then(res => {
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
@@ -370,9 +391,12 @@ export default {
|
||||
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (!this.form.dis_row) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
if (this.form.checked) {
|
||||
debugger
|
||||
if (!this.sect_code) {
|
||||
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
@@ -387,6 +411,7 @@ export default {
|
||||
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.divBtn = false
|
||||
this.form.dis_row = null
|
||||
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}).finally(() => {
|
||||
@@ -405,9 +430,8 @@ export default {
|
||||
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const flag = this.form.tableMater.some(mater => !mater.struct_code)
|
||||
if (flag) {
|
||||
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
if (!this.form.dis_row) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
@@ -417,6 +441,7 @@ export default {
|
||||
})
|
||||
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.form.dis_row = null
|
||||
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -69,8 +69,8 @@
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="total_qty">
|
||||
<label slot="label">总 数 量:</label>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
@@ -111,7 +111,7 @@
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="pcsn" label="批次号" width="150" align="center" />
|
||||
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" width="150" align="center" />-->
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
||||
@@ -139,7 +139,7 @@
|
||||
<el-table-column prop="pcsn" label="批次号" align="center" width="150" />
|
||||
<!-- <el-table-column prop="sap_pcsn" label="SAP批次号" align="center" />-->
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="point_code" label="起始位置" align="center" />
|
||||
<el-table-column prop="struct_code" label="目的位置" align="center" />
|
||||
<el-table-column prop="task_code" label="任务号" align="center" />
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
|
||||
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" label="生成方式" />
|
||||
<el-table-column label="明细数" align="center" prop="detail_count" />
|
||||
<el-table-column label="总数量" align="center" prop="total_qty">
|
||||
<el-table-column label="总重量" align="center" prop="total_qty">
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="total_qty">
|
||||
<label slot="label">总 数 量:</label>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
@@ -110,14 +110,14 @@
|
||||
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addFormDtl()"
|
||||
>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addFormDtl()"
|
||||
>
|
||||
添加单据
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -126,7 +126,7 @@
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addMaterDtl()"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
添加物料
|
||||
</el-button>
|
||||
@@ -157,19 +157,13 @@
|
||||
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="plan_qty" label="出库数量" width="150" align="center">
|
||||
<el-table-column prop="plan_qty" label="出库重量" width="150" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
||||
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" />
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.INANDOUT_BILL_TYPE[scope.row.source_bill_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="scope.row.remark" size="mini" />
|
||||
@@ -186,6 +180,7 @@
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
|
||||
<FormDialog :dialog-show.sync="formShow" @setFormValue="setFormValue" />
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -194,6 +189,7 @@ import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/st/outbill/AddDtl'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
|
||||
|
||||
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
@@ -222,7 +218,7 @@ export default {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_INV_OUT_TYPE', 'INANDOUT_BILL_TYPE'],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_INV_OUT_TYPE'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@@ -322,18 +318,6 @@ export default {
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
addMaterDtl(index, row) {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.form.stor_id === '') {
|
||||
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.storId = this.form.stor_id
|
||||
this.dtlShow = true
|
||||
},
|
||||
addFormDtl(index, row) {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
@@ -346,6 +330,18 @@ export default {
|
||||
this.storId = this.form.stor_id
|
||||
this.formShow = true
|
||||
},
|
||||
queryDtl(index, row) {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.form.stor_id === '') {
|
||||
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.storId = this.form.stor_id
|
||||
this.dtlShow = true
|
||||
},
|
||||
tableChanged(rows) {
|
||||
rows.forEach((item) => {
|
||||
// 添加plan_qty
|
||||
@@ -396,7 +392,7 @@ export default {
|
||||
this.nowrow.plan_qty = data.qty
|
||||
this.nowrow.qty = data.qty
|
||||
this.nowrow.source_bill_code = data.code
|
||||
this.nowrow.source_billdtl_id = data.id
|
||||
this.nowrow.source_bill_id = data.id
|
||||
this.nowrow.source_bill_type = data.form_type
|
||||
this.nowrow.edit = false
|
||||
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||
|
||||
@@ -76,9 +76,9 @@
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
||||
<el-table-column prop="qty_unit_name" label="数量单位" :min-width="flexWidth('qty_unit_name',crud.data,'数量单位')" />
|
||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
|
||||
Reference in New Issue
Block a user