opt:1.入库接口推送需增加料框明细表,入库单据根据载具号自动合成一个单据;2.手持组盘按明细组盘,入库显示料框明细;
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ nladmin-system/.idea/
|
|||||||
nladmin-ui/node_modules/
|
nladmin-ui/node_modules/
|
||||||
nladmin-ui/.idea/misc.xml
|
nladmin-ui/.idea/misc.xml
|
||||||
nladmin-ui/.idea/
|
nladmin-ui/.idea/
|
||||||
|
nladmin-system/nlsso-server/target/
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.basedata_manage.controller;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -15,15 +16,22 @@ import org.nl.common.utils.SecurityUtils;
|
|||||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateDtlService;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlateDtl;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -44,6 +52,10 @@ public class GroupController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private final IMdPbGroupplateService iMdPbGroupplateService;
|
private final IMdPbGroupplateService iMdPbGroupplateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final IMdPbGroupplateDtlService iMdPbGroupplateDtlService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private final IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
private final IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||||
|
|
||||||
@@ -56,8 +68,9 @@ public class GroupController {
|
|||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增组盘组盘")
|
@Log("新增组盘组盘")
|
||||||
|
@Transactional
|
||||||
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
||||||
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty"),group.get("dtlList")},"请求参数不能为空");
|
||||||
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
||||||
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
||||||
{
|
{
|
||||||
@@ -74,7 +87,24 @@ public class GroupController {
|
|||||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||||
groupPlate.setCreate_time(DateUtil.now());
|
groupPlate.setCreate_time(DateUtil.now());
|
||||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||||
|
|
||||||
|
List<GroupPlateDtl> groupPlateDtlList = new ArrayList<>();
|
||||||
|
JSONArray dtlList = group.getJSONArray("dtlList");
|
||||||
|
BigDecimal qty = new BigDecimal("0");
|
||||||
|
for (int i = 0; i < dtlList.size(); i++) {
|
||||||
|
JSONObject row = dtlList.getJSONObject(i);
|
||||||
|
GroupPlateDtl groupPlateDtl = new GroupPlateDtl();
|
||||||
|
BeanUtils.copyProperties(groupPlate,groupPlateDtl);
|
||||||
|
groupPlateDtl.setGroupdtl_id(IdUtil.getStringId());
|
||||||
|
groupPlateDtl.setMater_frame(row.getString("mater_frame"));
|
||||||
|
groupPlateDtl.setQty(row.getBigDecimal("qty"));
|
||||||
|
groupPlateDtlList.add(groupPlateDtl);
|
||||||
|
|
||||||
|
qty = qty.add(row.getBigDecimal("qty"));
|
||||||
|
}
|
||||||
|
groupPlate.setQty(qty);
|
||||||
iMdPbGroupplateService.save(groupPlate);
|
iMdPbGroupplateService.save(groupPlate);
|
||||||
|
iMdPbGroupplateDtlService.saveBatch(groupPlateDtlList);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,4 +114,9 @@ public class GroupController {
|
|||||||
iMdPbGroupplateService.delete(ids);
|
iMdPbGroupplateService.delete(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getdtl/{id}")
|
||||||
|
public ResponseEntity<Object> getdtl(@PathVariable String id) {
|
||||||
|
return new ResponseEntity<>(iMdPbGroupplateService.getdtl(id), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class BigScreenController {
|
|||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> getData(@RequestBody JSONObject stors) {
|
public ResponseEntity<Object> getData(@RequestBody JSONObject stors) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add("GW");
|
list.add("FJ");
|
||||||
List<JSONObject> data = bigScreenService.getData(list);
|
List<JSONObject> data = bigScreenService.getData(list);
|
||||||
return new ResponseEntity<>(PdaResponse.requestParamOk(data.get(0)), HttpStatus.OK);
|
return new ResponseEntity<>(PdaResponse.requestParamOk(data.get(0)), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<JSONObject> getData(List<String> stors) {
|
public List<JSONObject> getData(List<String> stors) {
|
||||||
// String storCode = "GW";
|
// String storCode = "FJ";
|
||||||
List result = new ArrayList<>();
|
List result = new ArrayList<>();
|
||||||
if (CollectionUtils.isEmpty(stors)){
|
if (CollectionUtils.isEmpty(stors)){
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.ext_manage.dto.ErpGroupplateDto;
|
||||||
import org.nl.wms.ext_manage.service.ErpToWmsService;
|
import org.nl.wms.ext_manage.service.ErpToWmsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* ERP调用WMS 控制层
|
* ERP调用WMS 控制层
|
||||||
@@ -35,8 +38,8 @@ public class ErpToWmsController {
|
|||||||
@PostMapping("/groupinfo")
|
@PostMapping("/groupinfo")
|
||||||
@Log("下发组盘信息")
|
@Log("下发组盘信息")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> sendGroupplate(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> sendGroupplate(@RequestBody List<ErpGroupplateDto> dto) {
|
||||||
return new ResponseEntity<>(erpToWmsService.sendGroupplate(whereJson),HttpStatus.OK);
|
return new ResponseEntity<>(erpToWmsService.sendGroupplate(dto),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/usematerinfo")
|
@PostMapping("/usematerinfo")
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.nl.wms.ext_manage.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ErpGroupplateDto {
|
||||||
|
private String order_code;
|
||||||
|
private String order_type;
|
||||||
|
private String pallet_sn;
|
||||||
|
private String mater_frame;
|
||||||
|
private String mater_code;
|
||||||
|
private String mater_name;
|
||||||
|
private String unit_code;
|
||||||
|
private BigDecimal qty;
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package org.nl.wms.ext_manage.service;
|
package org.nl.wms.ext_manage.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.wms.ext_manage.dto.ErpGroupplateDto;
|
||||||
import org.nl.wms.ext_manage.service.util.ErpResponse;
|
import org.nl.wms.ext_manage.service.util.ErpResponse;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* ERP调用WMS 服务类
|
* ERP调用WMS 服务类
|
||||||
@@ -32,7 +35,7 @@ public interface ErpToWmsService {
|
|||||||
* }
|
* }
|
||||||
* @return ErpResponse
|
* @return ErpResponse
|
||||||
*/
|
*/
|
||||||
ErpResponse sendGroupplate(JSONObject whereJson);
|
ErpResponse sendGroupplate(List<ErpGroupplateDto> dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发用料信息
|
* 下发用料信息
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.ext_manage.service.impl;
|
package org.nl.wms.ext_manage.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -12,19 +13,25 @@ import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
|||||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||||
|
import org.nl.wms.ext_manage.dto.ErpGroupplateDto;
|
||||||
import org.nl.wms.ext_manage.service.ErpToWmsService;
|
import org.nl.wms.ext_manage.service.ErpToWmsService;
|
||||||
import org.nl.wms.ext_manage.service.util.ErpResponse;
|
import org.nl.wms.ext_manage.service.util.ErpResponse;
|
||||||
import org.nl.wms.pm_manage.service.IPmFormDataService;
|
import org.nl.wms.pm_manage.service.IPmFormDataService;
|
||||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateDtlService;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlateDtl;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateDtlMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +57,9 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMdPbGroupplateDtlService iMdPbGroupplateDtlService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料基础数据服务
|
* 物料基础数据服务
|
||||||
*/
|
*/
|
||||||
@@ -63,8 +73,9 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
|||||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public ErpResponse sendGroupplate(JSONObject whereJson) {
|
public ErpResponse sendGroupplate(List<ErpGroupplateDto> dto) {
|
||||||
//todo 需要测试,JSONObject whereJson改成 json数组
|
//todo 需要测试,JSONObject whereJson改成 json数组
|
||||||
/**
|
/**
|
||||||
* {
|
* {
|
||||||
@@ -78,80 +89,171 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
|||||||
* "qty": "120.00"
|
* "qty": "120.00"
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
log.info("sendGroupplate下发组盘接口输入参数为:-------------------" + whereJson.toString());
|
log.info("sendGroupplate下发组盘接口输入参数为:-------------------" + JSONObject.toJSONString(dto));
|
||||||
// 查询仓库
|
// 查询仓库
|
||||||
BsrealStorattr storDao = iBsrealStorattrService.findByCode("GW");
|
BsrealStorattr storDao = iBsrealStorattrService.findByCode("FJ");
|
||||||
if (storDao == null) {
|
if (storDao == null) {
|
||||||
throw new BadRequestException("仓库不存在");
|
throw new BadRequestException("仓库不存在");
|
||||||
}
|
}
|
||||||
// 组织明细
|
|
||||||
List<JSONObject> dataList = whereJson.getJSONArray("data").toJavaList(JSONObject.class);
|
|
||||||
// 查询所有物料
|
// 查询所有物料
|
||||||
List<MdMeMaterialbase> materDaoList = iMdMeMaterialbaseService.list(
|
List<MdMeMaterialbase> materDaoList = iMdMeMaterialbaseService.list(
|
||||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||||
.in(MdMeMaterialbase::getMaterial_code, dataList.stream()
|
.in(MdMeMaterialbase::getMaterial_code, dto.stream()
|
||||||
.map(row -> row.getString("mater_code"))
|
.map(ErpGroupplateDto::getMater_code)
|
||||||
.collect(Collectors.toList())
|
.collect(Collectors.toList())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(CollectionUtil.isEmpty(materDaoList)){
|
||||||
|
throw new BadRequestException("物料编码不存在");
|
||||||
|
}
|
||||||
// 查询所有计量单位
|
// 查询所有计量单位
|
||||||
List<MdPbMeasureunit> unitDaoList = iMdPbMeasureunitService.list(
|
List<MdPbMeasureunit> unitDaoList = iMdPbMeasureunitService.list(
|
||||||
new QueryWrapper<MdPbMeasureunit>().lambda()
|
new QueryWrapper<MdPbMeasureunit>().lambda()
|
||||||
.in(MdPbMeasureunit::getUnit_code, dataList.stream()
|
.in(MdPbMeasureunit::getUnit_name, dto.stream()
|
||||||
.map(row -> row.getString("unit_code"))
|
.map(ErpGroupplateDto::getUnit_code)
|
||||||
.collect(Collectors.toList()))
|
.collect(Collectors.toList()))
|
||||||
);
|
);
|
||||||
|
|
||||||
// 明细集合
|
// 明细集合
|
||||||
List<PmFormData> dtlArr = new ArrayList<>();
|
List<PmFormData> dtlArr = new ArrayList<>();
|
||||||
// 明细集合
|
// 明细集合
|
||||||
List<GroupPlate> plates = new ArrayList<>();
|
List<GroupPlate> plates = new ArrayList<>();
|
||||||
for (JSONObject json : dataList) {
|
List<GroupPlateDtl> plateDtls = new ArrayList<>();
|
||||||
|
|
||||||
|
//将list通过托盘号进行分组
|
||||||
|
Map<String, List<ErpGroupplateDto>> dtoByPallet = dto.stream().collect(Collectors.groupingBy(ErpGroupplateDto::getPallet_sn));
|
||||||
|
dtoByPallet.forEach((key,value)->{
|
||||||
|
|
||||||
PmFormData jsonDtl = new PmFormData();
|
PmFormData jsonDtl = new PmFormData();
|
||||||
MdMeMaterialbase materDao = materDaoList.stream()
|
MdMeMaterialbase materDao = materDaoList.stream()
|
||||||
.filter(row -> row.getMaterial_code().equals(json.getString("mater_code")))
|
.filter(row -> row.getMaterial_code().equals(value.get(0).getMater_code()))
|
||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
jsonDtl.setId(IdUtil.getStringId());
|
jsonDtl.setId(IdUtil.getStringId());
|
||||||
jsonDtl.setCode(json.getString("order_code"));
|
|
||||||
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
|
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
|
||||||
jsonDtl.setStor_id(storDao.getStor_id());
|
jsonDtl.setStor_id(storDao.getStor_id());
|
||||||
jsonDtl.setStor_name(storDao.getStor_name());
|
jsonDtl.setStor_name(storDao.getStor_name());
|
||||||
jsonDtl.setForm_type("0001");
|
jsonDtl.setForm_type("0001");
|
||||||
jsonDtl.setSource_form_date(DateUtil.today());
|
jsonDtl.setSource_form_date(DateUtil.today());
|
||||||
jsonDtl.setMaterial_code(json.getString("mater_code"));
|
jsonDtl.setMaterial_code(value.get(0).getMater_code());
|
||||||
jsonDtl.setMaterial_id(materDao.getMaterial_id());
|
jsonDtl.setMaterial_id(materDao.getMaterial_id());
|
||||||
jsonDtl.setQty(BigDecimal.valueOf(json.getDoubleValue("qty")));
|
|
||||||
jsonDtl.setPlan_qty(BigDecimal.valueOf(json.getDoubleValue("qty")));
|
|
||||||
MdPbMeasureunit unitDao = unitDaoList.stream()
|
MdPbMeasureunit unitDao = unitDaoList.stream()
|
||||||
.filter(row -> row.getUnit_code().equals(json.getString("unit_code")))
|
.filter(row -> row.getUnit_name().equals(value.get(0).getUnit_code()))
|
||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
jsonDtl.setUnit_id(unitDao.getMeasure_unit_id());
|
jsonDtl.setUnit_id(unitDao.getMeasure_unit_id());
|
||||||
jsonDtl.setUnit_name(unitDao.getUnit_name());
|
jsonDtl.setUnit_name(unitDao.getUnit_name());
|
||||||
jsonDtl.setVehicle_code(json.getString("pallet_sn"));
|
jsonDtl.setVehicle_code(value.get(0).getPallet_sn());
|
||||||
jsonDtl.setVehicle_code2(json.getString("mater_frame"));
|
jsonDtl.setVehicle_code2(value.get(0).getMater_frame());
|
||||||
jsonDtl.setCreate_name("ERP");
|
jsonDtl.setCreate_name("ERP");
|
||||||
jsonDtl.setCreate_time(DateUtil.now());
|
jsonDtl.setCreate_time(DateUtil.now());
|
||||||
|
|
||||||
|
//单据编号使用合单号
|
||||||
|
jsonDtl.setCode("H-"+value.get(0).getOrder_code());
|
||||||
|
jsonDtl.setNew_merge_flag("1");
|
||||||
|
|
||||||
|
StringBuilder mergeCodes = new StringBuilder();
|
||||||
|
BigDecimal qty = new BigDecimal("0");
|
||||||
|
for(ErpGroupplateDto groupplateDto:value){
|
||||||
|
|
||||||
|
PmFormData jsonDtl2 = new PmFormData();
|
||||||
|
MdMeMaterialbase materDaoDtl = materDaoList.stream()
|
||||||
|
.filter(row -> row.getMaterial_code().equals(groupplateDto.getMater_code()))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
jsonDtl2.setId(IdUtil.getStringId());
|
||||||
|
jsonDtl2.setStatus(IOSEnum.BILL_STATUS.code("生成"));
|
||||||
|
jsonDtl2.setStor_id(storDao.getStor_id());
|
||||||
|
jsonDtl2.setStor_name(storDao.getStor_name());
|
||||||
|
jsonDtl2.setForm_type("0001");
|
||||||
|
jsonDtl2.setSource_form_date(DateUtil.today());
|
||||||
|
jsonDtl2.setMaterial_code(groupplateDto.getMater_code());
|
||||||
|
jsonDtl2.setMaterial_id(materDaoDtl.getMaterial_id());
|
||||||
|
jsonDtl2.setQty(groupplateDto.getQty());
|
||||||
|
jsonDtl2.setPlan_qty(groupplateDto.getQty());
|
||||||
|
MdPbMeasureunit unitDaoDtl = unitDaoList.stream()
|
||||||
|
.filter(row -> row.getUnit_name().equals(groupplateDto.getUnit_code()))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
jsonDtl2.setUnit_id(unitDaoDtl.getMeasure_unit_id());
|
||||||
|
jsonDtl2.setUnit_name(unitDaoDtl.getUnit_name());
|
||||||
|
jsonDtl2.setVehicle_code(groupplateDto.getPallet_sn());
|
||||||
|
jsonDtl2.setVehicle_code2(groupplateDto.getMater_frame());
|
||||||
|
jsonDtl2.setCreate_name("ERP");
|
||||||
|
jsonDtl2.setCreate_time(DateUtil.now());
|
||||||
|
|
||||||
|
jsonDtl2.setCode(groupplateDto.getOrder_code());
|
||||||
|
jsonDtl2.setNew_merge_flag("0");
|
||||||
|
jsonDtl2.setIs_merge("1");
|
||||||
|
dtlArr.add(jsonDtl2);
|
||||||
|
|
||||||
|
mergeCodes.append(groupplateDto.getOrder_code()).append(",");
|
||||||
|
qty = qty.add(groupplateDto.getQty());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mergeCodes.length()>0){
|
||||||
|
mergeCodes.deleteCharAt(mergeCodes.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
jsonDtl.setMerge_codes(mergeCodes.toString());
|
||||||
|
jsonDtl.setQty(qty);
|
||||||
|
jsonDtl.setPlan_qty(qty);
|
||||||
|
|
||||||
dtlArr.add(jsonDtl);
|
dtlArr.add(jsonDtl);
|
||||||
|
|
||||||
GroupPlate plate = new GroupPlate();
|
GroupPlate plate = new GroupPlate();
|
||||||
plate.setGroup_id(IdUtil.getStringId());
|
plate.setGroup_id(IdUtil.getStringId());
|
||||||
plate.setStoragevehicle_code(json.getString("pallet_sn"));
|
|
||||||
|
for(ErpGroupplateDto groupplateDto:value) {
|
||||||
|
|
||||||
|
MdMeMaterialbase materDaoDtl = materDaoList.stream()
|
||||||
|
.filter(row -> row.getMaterial_code().equals(groupplateDto.getMater_code()))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
|
||||||
|
MdPbMeasureunit unitDaoDtl = unitDaoList.stream()
|
||||||
|
.filter(row -> row.getUnit_name().equals(groupplateDto.getUnit_code()))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
|
||||||
|
GroupPlateDtl plate2 = new GroupPlateDtl();
|
||||||
|
plate2.setGroup_id(plate.getGroup_id());
|
||||||
|
plate2.setGroupdtl_id(IdUtil.getStringId());
|
||||||
|
plate2.setStoragevehicle_code(groupplateDto.getPallet_sn());
|
||||||
|
plate2.setMaterial_id(materDaoDtl.getMaterial_id());
|
||||||
|
plate2.setQty_unit_id(unitDaoDtl.getMeasure_unit_id());
|
||||||
|
plate2.setQty_unit_name(unitDaoDtl.getUnit_name());
|
||||||
|
plate2.setQty(groupplateDto.getQty());
|
||||||
|
plate2.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
|
||||||
|
plate2.setExt_code(jsonDtl.getCode());
|
||||||
|
plate2.setExt_type("0001");
|
||||||
|
plate2.setExt_id(jsonDtl.getId());
|
||||||
|
plate2.setMater_frame(groupplateDto.getMater_frame());
|
||||||
|
plate2.setCreate_name("ERP");
|
||||||
|
plate2.setCreate_time(DateUtil.now());
|
||||||
|
plate2.setCreate_id("ERP");
|
||||||
|
plateDtls.add(plate2);
|
||||||
|
}
|
||||||
|
plate.setStoragevehicle_code(value.get(0).getPallet_sn());
|
||||||
plate.setMaterial_id(materDao.getMaterial_id());
|
plate.setMaterial_id(materDao.getMaterial_id());
|
||||||
plate.setQty_unit_id(unitDao.getMeasure_unit_id());
|
plate.setQty_unit_id(unitDao.getMeasure_unit_id());
|
||||||
plate.setQty_unit_name(unitDao.getUnit_name());
|
plate.setQty_unit_name(unitDao.getUnit_name());
|
||||||
plate.setQty(BigDecimal.valueOf(json.getDoubleValue("qty")));
|
plate.setQty(qty);
|
||||||
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
|
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
|
||||||
plate.setExt_code(json.getString("order_code"));
|
plate.setExt_code("H-"+value.get(0).getOrder_code());
|
||||||
plate.setExt_type("0001");
|
plate.setExt_type("0001");
|
||||||
plate.setExt_id(jsonDtl.getId());
|
plate.setExt_id(jsonDtl.getId());
|
||||||
plate.setCreate_name("ERP");
|
plate.setCreate_name("ERP");
|
||||||
plate.setCreate_time(DateUtil.now());
|
plate.setCreate_time(DateUtil.now());
|
||||||
|
plate.setCreate_id("ERP");
|
||||||
|
|
||||||
|
|
||||||
plates.add(plate);
|
plates.add(plate);
|
||||||
}
|
});
|
||||||
//保存组盘记录到单据表
|
//保存组盘记录到单据表
|
||||||
iPmFormDataService.saveBatch(dtlArr);
|
iPmFormDataService.saveBatch(dtlArr);
|
||||||
//保存组盘记录到组盘表
|
//保存组盘记录到组盘表
|
||||||
iMdPbGroupplateService.saveBatch(plates);
|
iMdPbGroupplateService.saveBatch(plates);
|
||||||
|
|
||||||
|
//保存组盘明细
|
||||||
|
iMdPbGroupplateDtlService.saveBatch(plateDtls);
|
||||||
|
|
||||||
|
|
||||||
log.info("sendGroupplate下发组盘接口输出参数为:-------------------" + ErpResponse.requestOk().toString());
|
log.info("sendGroupplate下发组盘接口输出参数为:-------------------" + ErpResponse.requestOk().toString());
|
||||||
return ErpResponse.requestOk();
|
return ErpResponse.requestOk();
|
||||||
}
|
}
|
||||||
@@ -174,7 +276,7 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
|
|||||||
*/
|
*/
|
||||||
log.info("usematerinfo接口输入参数为:-------------------" + whereJson.toString());
|
log.info("usematerinfo接口输入参数为:-------------------" + whereJson.toString());
|
||||||
// 查询仓库
|
// 查询仓库
|
||||||
BsrealStorattr storDao = iBsrealStorattrService.findByCode("GW");
|
BsrealStorattr storDao = iBsrealStorattrService.findByCode("FJ");
|
||||||
if (storDao == null) {
|
if (storDao == null) {
|
||||||
throw new BadRequestException("仓库不存在");
|
throw new BadRequestException("仓库不存在");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.nl.wms.warehouse_manage.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlateDtl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组盘明细
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhengxuming
|
||||||
|
* @since 2025年8月21日10:39:19
|
||||||
|
*/
|
||||||
|
public interface IMdPbGroupplateDtlService extends IService<GroupPlateDtl> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlateDtl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -48,4 +50,7 @@ public interface IMdPbGroupplateService extends IService<GroupPlate> {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
void updateIvt(List<JSONObject> updateIvtList);
|
void updateIvt(List<JSONObject> updateIvtList);
|
||||||
|
|
||||||
|
|
||||||
|
List<GroupPlateDtl> getdtl(String group_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.nl.wms.warehouse_manage.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateDtlService;
|
||||||
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlateDtl;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateDtlMapper;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateMapper;
|
||||||
|
import org.nl.wms.warehouse_manage.service.util.UpdateIvtUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组盘记录表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2025-05-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MdPbGroupplateServiceDtlImpl extends ServiceImpl<MdPbGroupplateDtlMapper, GroupPlateDtl> implements IMdPbGroupplateDtlService {
|
||||||
|
}
|
||||||
@@ -1,21 +1,32 @@
|
|||||||
package org.nl.wms.warehouse_manage.service.impl;
|
package org.nl.wms.warehouse_manage.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||||
|
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||||
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateDtlService;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlateDtl;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateMapper;
|
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateMapper;
|
||||||
import org.nl.wms.warehouse_manage.service.util.UpdateIvtUtils;
|
import org.nl.wms.warehouse_manage.service.util.UpdateIvtUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -33,6 +44,12 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UpdateIvtUtils updateIvtUtils;
|
private UpdateIvtUtils updateIvtUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新库存工具类
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IMdPbGroupplateDtlService iMdPbGroupplateDtlService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||||
@@ -42,6 +59,16 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void delete(Set<String> ids) {
|
public void delete(Set<String> ids) {
|
||||||
|
//通过ids 查询到子表的ids
|
||||||
|
List<GroupPlateDtl> groupPlateDtlList = iMdPbGroupplateDtlService.list(new LambdaQueryWrapper<>(GroupPlateDtl.class)
|
||||||
|
.in(GroupPlateDtl::getGroup_id, ids));
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(groupPlateDtlList)) {
|
||||||
|
//删除子表
|
||||||
|
Set<String> dtlIds = groupPlateDtlList.stream().map(GroupPlateDtl::getGroupdtl_id).collect(Collectors.toSet());
|
||||||
|
iMdPbGroupplateDtlService.removeByIds(dtlIds);
|
||||||
|
}
|
||||||
|
|
||||||
this.baseMapper.deleteBatchIds(ids);
|
this.baseMapper.deleteBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,4 +92,15 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
|||||||
updateIvtUtils.updateIvt(json);
|
updateIvtUtils.updateIvt(json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GroupPlateDtl> getdtl(String group_id) {
|
||||||
|
if (StringUtils.isEmpty(group_id)) {
|
||||||
|
throw new BadRequestException("请求参数不能为空");
|
||||||
|
}
|
||||||
|
List<GroupPlateDtl> dtlList = iMdPbGroupplateDtlService.list(new LambdaQueryWrapper<>(GroupPlateDtl.class)
|
||||||
|
.eq(GroupPlateDtl::getGroup_id, group_id));
|
||||||
|
|
||||||
|
return dtlList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
|
|
||||||
JSONObject form = new JSONObject();
|
JSONObject form = new JSONObject();
|
||||||
// 查询仓库
|
// 查询仓库
|
||||||
BsrealStorattr storDao = iBsrealStorattrService.findByCode("GW");
|
BsrealStorattr storDao = iBsrealStorattrService.findByCode("FJ");
|
||||||
form.put("stor_id",storDao.getStor_id());
|
form.put("stor_id",storDao.getStor_id());
|
||||||
form.put("bill_type",IOSEnum.BILL_TYPE.code("生产入库"));
|
form.put("bill_type",IOSEnum.BILL_TYPE.code("生产入库"));
|
||||||
form.put("biz_date",DateUtil.now());
|
form.put("biz_date",DateUtil.now());
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wms_fujia}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:2306}/${DB_NAME:fujia}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
|
|||||||
50635
nladmin-ui/package-lock.json
generated
Normal file
50635
nladmin-ui/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
170
nladmin-ui/src/views/wms/basedata/group/ViewDialog.vue
Normal file
170
nladmin-ui/src/views/wms/basedata/group/ViewDialog.vue
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<!--suppress ALL -->
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
append-to-body
|
||||||
|
title="组盘详情"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
fullscreen
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||||
|
:inline="true"
|
||||||
|
:model="form"
|
||||||
|
size="mini"
|
||||||
|
label-width="100px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||||
|
<el-input v-model="form.storagevehicle_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料编码" prop="material_code">
|
||||||
|
<el-input v-model="form.material_code" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料名称" prop="material_name">
|
||||||
|
<el-input v-model="form.material_name" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次" prop="pcsn">
|
||||||
|
<el-input v-model="form.pcsn" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-input v-model="dict.label.GROUP_STATUS[form.status]" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="组盘数量" prop="qty">
|
||||||
|
<el-input v-model="form.qty" disabled clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" disabled clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="组盘人" prop="create_name">
|
||||||
|
<el-input v-model="form.create_name" disabled clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="组盘时间" prop="create_time">
|
||||||
|
<el-input v-model="form.create_time" disabled clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="crud-opts2">
|
||||||
|
<span class="role-span2">单据明细</span>
|
||||||
|
</div>
|
||||||
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="tableDtl"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="300"
|
||||||
|
size="mini"
|
||||||
|
border
|
||||||
|
:highlight-current-row="true"
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
>
|
||||||
|
<el-table-column prop="mater_frame" label="料框号" min-width="140" />
|
||||||
|
<el-table-column prop="qty" label="料框数量" />
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { crud } from '@crud/crud'
|
||||||
|
import crudFormData from './group'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ViewDialog',
|
||||||
|
mixins: [crud()],
|
||||||
|
dicts: ['base_data', 'ST_INV_IN_TYPE', 'io_bill_status', 'IS_OR_NOT', 'GROUP_STATUS'],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
rowmst: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
tableDtl: [],
|
||||||
|
form: {},
|
||||||
|
formStatus: [
|
||||||
|
{
|
||||||
|
value: '10',
|
||||||
|
label: '生成'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '20',
|
||||||
|
label: '执行中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '99',
|
||||||
|
label: '完成'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rowmst: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.form = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
|
||||||
|
},
|
||||||
|
setForm(row) {
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.form = row
|
||||||
|
this.queryTableDtl(row.group_id)
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.dialogVisible = false
|
||||||
|
},
|
||||||
|
status_Format(row, column) {
|
||||||
|
return this.dict.label.io_bill_status[row.status]
|
||||||
|
},
|
||||||
|
merge_Format(row, column) {
|
||||||
|
return this.dict.label.IS_OR_NOT[row.is_merge]
|
||||||
|
},
|
||||||
|
queryTableDtl(group_id) {
|
||||||
|
crudFormData.getdtl(group_id).then(res => {
|
||||||
|
this.tableDtl = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crud-opts2 .el-dialog__title2 {
|
||||||
|
line-height: 24px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crud-opts2 .role-span2 {
|
||||||
|
padding: 0px 0px 20px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 10px 0px 0px 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -24,4 +24,11 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del }
|
export function getdtl(id) {
|
||||||
|
return request({
|
||||||
|
url: 'api/group/getdtl/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, getdtl }
|
||||||
|
|||||||
@@ -2,62 +2,62 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!--工具栏-->
|
<!--工具栏-->
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
物料查询:
|
物料查询:
|
||||||
<el-input
|
<el-input
|
||||||
v-model="query.material_code"
|
v-model="query.material_code"
|
||||||
clearable
|
clearable
|
||||||
style="width: 150px"
|
style="width: 150px"
|
||||||
size="mini"
|
size="mini"
|
||||||
placeholder="物料编码、名称"
|
placeholder="物料编码、名称"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@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-col>
|
</el-select>
|
||||||
<el-col :span="4">
|
</el-col>
|
||||||
批次查询:
|
<el-col :span="4">
|
||||||
<el-input
|
<rrOperation />
|
||||||
v-model="query.pcsn"
|
</el-col>
|
||||||
clearable
|
</el-row>
|
||||||
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'-->
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
<crudOperation :permission="permission" />
|
<crudOperation :permission="permission" />
|
||||||
<!--新增表格-->
|
<!--新增表格-->
|
||||||
@@ -71,19 +71,19 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="物料编码" prop="material_code" >
|
<el-form-item label="物料编码" prop="material_code">
|
||||||
<el-input v-model="form.material_code" @focus="getMaterial" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @focus="getMaterial" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="物料名称" prop="material_name">
|
<el-form-item label="物料名称" prop="material_name">
|
||||||
<el-input disabled v-model="form.material_name" style="width: 200px;" />
|
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="规格" prop="material_spec">
|
<el-form-item label="规格" prop="material_spec">
|
||||||
<label slot="label">规 格</label>
|
<label slot="label">规 格</label>
|
||||||
<el-input disabled v-model="form.material_spec" style="width: 200px;" />
|
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="物料数量" prop="qty">
|
<el-form-item label="物料数量" prop="qty">
|
||||||
<el-input-number v-model="form.qty" style="width: 200px;" />
|
<el-input v-model="form.qty" disabled style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -134,11 +134,41 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-button type="primary" @click="insertEvent">添加料框</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-if="form.dtlList && form.dtlList.length" style="margin-top: 10px;">
|
||||||
|
<el-col :span="8"><div class="dtl-header-center"><strong>料框号</strong></div></el-col>
|
||||||
|
<el-col :span="8"><div class="dtl-header-center"><strong>数量</strong></div></el-col>
|
||||||
|
<el-col :span="8"><div style="padding-left: 220px;"><strong>操作</strong></div></el-col>
|
||||||
|
</el-row>
|
||||||
|
<div v-for="(item, index) in form.dtlList" :key="index" style="margin-top: 6px;">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label=" " label-width="110px">
|
||||||
|
<el-input v-model="item.mater_frame" size="mini" placeholder="请输入料框号" style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label=" " label-width="110px">
|
||||||
|
<el-input-number v-model="item.qty" size="mini" :min="0" :step="1" :precision="3" controls-position="right" style="width: 200px;" @change="onQtyChange" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label=" " label-width="110px" class="op-field">
|
||||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeDtl(index)">删除</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
<el-button type="text" @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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table
|
<el-table
|
||||||
@@ -149,7 +179,14 @@
|
|||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
>
|
>
|
||||||
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')" />
|
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="toView(scope.row)">{{
|
||||||
|
scope.row.storagevehicle_code
|
||||||
|
}}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_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="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||||
@@ -179,6 +216,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--放引用的组件-->
|
<!--放引用的组件-->
|
||||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
|
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
|
||||||
|
<ViewDialog ref="viewDialog" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -190,6 +228,7 @@ import udOperation from '@crud/UD.operation'
|
|||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
||||||
|
import ViewDialog from '@/views/wms/basedata/group/ViewDialog.vue'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
group_id: null,
|
group_id: null,
|
||||||
@@ -207,11 +246,12 @@ const defaultForm = {
|
|||||||
create_name: null,
|
create_name: null,
|
||||||
create_time: null,
|
create_time: null,
|
||||||
ext_code: null,
|
ext_code: null,
|
||||||
ext_type: null
|
ext_type: null,
|
||||||
|
dtlList: []
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'Group',
|
name: 'Group',
|
||||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
|
components: { ViewDialog, pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
||||||
// 数据字典
|
// 数据字典
|
||||||
@@ -233,6 +273,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
permission: {},
|
permission: {},
|
||||||
materialDialog: false,
|
materialDialog: false,
|
||||||
|
dtlShow: false,
|
||||||
|
opendtlParam: null,
|
||||||
classes: [],
|
classes: [],
|
||||||
rules: {
|
rules: {
|
||||||
}
|
}
|
||||||
@@ -243,6 +285,42 @@ export default {
|
|||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
// 提交前清洗 dtlList,仅保留填写完整的行
|
||||||
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
|
if (this.form && Array.isArray(this.form.dtlList)) {
|
||||||
|
const cleanList = this.form.dtlList
|
||||||
|
.filter(item => item && item.mater_frame && item.mater_frame.toString().trim() !== '' && Number(item.qty) >= 0)
|
||||||
|
.map(item => ({
|
||||||
|
mater_frame: item.mater_frame.toString().trim(),
|
||||||
|
qty: item.qty
|
||||||
|
}))
|
||||||
|
// 检查料框号重复
|
||||||
|
const seen = new Set()
|
||||||
|
const dups = []
|
||||||
|
cleanList.forEach(it => {
|
||||||
|
const key = it.mater_frame
|
||||||
|
if (seen.has(key)) {
|
||||||
|
dups.push(key)
|
||||||
|
} else {
|
||||||
|
seen.add(key)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (dups.length > 0) {
|
||||||
|
const uniq = Array.from(new Set(dups))
|
||||||
|
this.$message.error(`存在重复的料框号:${uniq.join(', ')}`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 数量为0禁止提交
|
||||||
|
const zeroQty = cleanList.filter(it => Number(it.qty) === 0)
|
||||||
|
if (zeroQty.length > 0) {
|
||||||
|
this.$message.error('存在数量为0的料框,不能提交')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.form.dtlList = cleanList
|
||||||
|
this.recalcTotalQty()
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
formattStatus(row) {
|
formattStatus(row) {
|
||||||
return this.dict.label.GROUP_STATUS[row.status]
|
return this.dict.label.GROUP_STATUS[row.status]
|
||||||
},
|
},
|
||||||
@@ -259,6 +337,39 @@ export default {
|
|||||||
this.form.material_id = row.material_id
|
this.form.material_id = row.material_id
|
||||||
this.form.material_code = row.material_code
|
this.form.material_code = row.material_code
|
||||||
this.form.material_spec = row.material_spec
|
this.form.material_spec = row.material_spec
|
||||||
|
},
|
||||||
|
async insertEvent(row) {
|
||||||
|
if (!this.form.dtlList) {
|
||||||
|
this.$set(this.form, 'dtlList', [])
|
||||||
|
}
|
||||||
|
this.form.dtlList.push({ mater_frame: null, qty: null })
|
||||||
|
this.recalcTotalQty()
|
||||||
|
},
|
||||||
|
removeDtl(index) {
|
||||||
|
if (this.form && Array.isArray(this.form.dtlList)) {
|
||||||
|
this.form.dtlList.splice(index, 1)
|
||||||
|
}
|
||||||
|
this.recalcTotalQty()
|
||||||
|
},
|
||||||
|
onQtyChange() {
|
||||||
|
this.recalcTotalQty()
|
||||||
|
},
|
||||||
|
recalcTotalQty() {
|
||||||
|
if (!this.form || !Array.isArray(this.form.dtlList)) {
|
||||||
|
this.form.qty = null
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const sum = this.form.dtlList.reduce((acc, cur) => {
|
||||||
|
const val = Number(cur && cur.qty)
|
||||||
|
if (!isNaN(val) && val >= 0) return acc + val
|
||||||
|
return acc
|
||||||
|
}, 0)
|
||||||
|
this.form.qty = Number(sum.toFixed(3))
|
||||||
|
},
|
||||||
|
toView(row) {
|
||||||
|
if (row !== null) {
|
||||||
|
this.$refs.viewDialog.setForm(row)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -266,4 +377,23 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
.centered-field >>> .el-form-item__content {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.centered-field >>> .el-input__inner,
|
||||||
|
.centered-field >>> .el-input-number .el-input__inner {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dtl-header-center {
|
||||||
|
padding-left: 110px;
|
||||||
|
width: 300px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.op-field >>> .el-form-item__content {
|
||||||
|
padding-left: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user