add:新增半成品虚拟入库

This commit is contained in:
2023-10-12 17:37:55 +08:00
parent c67cd18b63
commit f07be22524
15 changed files with 562 additions and 568 deletions

View File

@@ -22,7 +22,7 @@ public enum IOSEnum {
//仓库编码
STOR_CODE(MapOf.of("原材料仓", "1528627964823080960", "半成品仓库", "15286279952695336962","成品库", "1528627995269533696","海柔半成品","15286279952695336963")),
//库区编码
SECT_CODE(MapOf.of("成品库区", "1528631043496742912", "半成品库区", "1528631044482404352")),
SECT_CODE(MapOf.of("成品库区", "1528631043496742912", "半成品库区", "1528631044482404352","半成品虚拟库区","1707219721935523840")),
//托盘超限类型
VEHICLE_OVER_TYPE(MapOf.of("标准", "00", "横向超", "01","纵向超","02")),
//单据类型

View File

@@ -67,6 +67,13 @@ public class StIvtIostorinvBcpController {
return new ResponseEntity<>(stIvtIostorinvBcpService.queryDtl(query,page), HttpStatus.OK);
}
@GetMapping("/getVirtual")
@Log("查询入库单据")
//("查询入库单据")
public ResponseEntity<Object> getVirtual(BcpIostorInvQuery query, PageQuery page) {
return new ResponseEntity<>(stIvtIostorinvBcpService.getVirtual(query,page), HttpStatus.OK);
}
@PostMapping("/create")
@Log("新增入库单")
//("新增入库单")
@@ -125,6 +132,12 @@ public class StIvtIostorinvBcpController {
return new ResponseEntity<>(stIvtIostorinvBcpService.getIoDtl(whereJson.toJavaObject(BcpIostorInvQuery.class)), HttpStatus.OK);
}
@PostMapping("/getIODtlVirtual")
@Log("查询入库分配明细")
//("查询入库分配明细")
public ResponseEntity<Object> getIODtlVirtual(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(stIvtIostorinvBcpService.getIODtlVirtual(whereJson.toJavaObject(BcpIostorInvQuery.class)), HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("完成单据")
@@ -134,6 +147,14 @@ public class StIvtIostorinvBcpController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirmVirtual")
@Log("完成单据")
//("完成单据")
public ResponseEntity<Object> confirmVirtual(@RequestBody JSONObject whereJson) {
stIvtIostorinvBcpService.confirmVirtual(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirmTask")
@Log("下发任务")
//("下发任务")

View File

@@ -63,4 +63,11 @@ public interface IStIvtIostorinvBcpService extends IService<StIvtIostorinvBcp> {
List<Map> getPdaAll(JSONObject form);
void download(BcpIostorInvQuery query, PageQuery page, HttpServletResponse response) throws IOException;
Object getVirtual(BcpIostorInvQuery query, PageQuery page);
List<Map> getIODtlVirtual(BcpIostorInvQuery query);
String confirmVirtual(JSONObject form);
}

View File

@@ -23,4 +23,7 @@ public interface StIvtIostorinvBcpMapper extends BaseMapper<StIvtIostorinvBcp> {
List<Map> getIostorinv(@Param("query") BcpIostorInvQuery query);
List<Map> getPdaAll(JSONObject form);
List<Map> getIODtlVirtual(@Param("query") BcpIostorInvQuery query);
}

View File

@@ -16,6 +16,51 @@
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
<where>
dtl.is_delete = false
and dtl.point_code != '0'
<if test="query.stor_id != null and query.stor_id != ''">
and dtl.stor_id = #{query.stor_id}
</if>
<if test="query.iostorinv_id != null and query.iostorinv_id != ''">
and dtl.iostorinv_id = #{query.iostorinv_id}
</if>
<if test="query.bill_code != null and query.bill_code != ''">
and dtl.bill_code like #{query.bill_code}
</if>
<if test="query.bill_type != null and query.bill_type != ''">
and dtl.bill_type like #{query.bill_type}
</if>
<if test="query.bill_status != null and query.bill_status != ''">
and dtl.bill_status = #{query.bill_status}
</if>
<if test="query.io_type != null and query.io_type != ''">
and dtl.io_type = #{query.io_type}
</if>
<if test="query.start_time != null and query.start_time != ''">
and dtl.create_time >= #{query.start_time}
</if>
<if test="query.end_time != null and query.end_time != ''">
and #{query.end_time} >= dtl.create_time
</if>
</where>
order by dtl.create_time desc
</select>
<select id="getIODtlVirtual" resultType="java.util.Map">
SELECT
dtl.*,
mater.material_code,
mater.material_name,
mater.material_spec,
task.task_code,
task.task_status,
ROUND(dtl.plan_qty / dtl.unit_weight,3 ) AS qty
FROM
st_ivt_iostorinv_bcp dtl
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
<where>
dtl.is_delete = false
and dtl.point_code = '0'
<if test="query.stor_id != null and query.stor_id != ''">
and dtl.stor_id = #{query.stor_id}
</if>

View File

@@ -155,10 +155,14 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
this.save(mst);
//锁定起点
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_code, mst.getStruct_code())
.set(StIvtStructattr::getInv_code,mst.getBill_code())
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁")));
StIvtStructattr attrDao = structattrService.getById(mst.getStruct_id());
if (!attrDao.getSect_id().equals(IOSEnum.SECT_CODE.code("半成品虚拟库区"))) {
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_code, mst.getStruct_code())
.set(StIvtStructattr::getInv_code,mst.getBill_code())
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁")));
}
// 判断是否自动下发
if (ObjectUtil.isNotEmpty(form.getString("auto_send"))) {
@@ -202,19 +206,62 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
this.updateById(mst);
StIvtStructivtBcp ivtDao = structivtBcpService.getById(mst.getStruct_id());
//删除库存
structivtBcpService.remove(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", mst.getStruct_id()));
// 判断库区是否是虚拟区
if (mst.getSect_id().equals(IOSEnum.SECT_CODE.code("半成品虚拟库区"))) {
StIvtStructivtBcp ivtDao = structivtBcpService.getOne(
new QueryWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getStruct_id, mst.getStruct_id())
.eq(StIvtStructivtBcp::getMaterial_id, mst.getMaterial_id())
);
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
param.put("change_qty", ivtDao.getCanuse_qty());
param.put("result_qty", 0);
param.put("bill_code",mst.getBill_code());
param.put("inv_id",mst.getIostorinv_id());
param.put("bill_type_scode",mst.getBill_type());
iStIvtStructivtflowService.insetIvtChange(param);
BigDecimal subQty = NumberUtil.sub(ivtDao.getCanuse_qty(), mst.getPlan_qty());
if (subQty.doubleValue() > 0) {
// 更新库存
structivtBcpService.update(
new UpdateWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getMaterial_id, mst.getMaterial_id())
.eq(StIvtStructivtBcp::getStruct_id, mst.getStruct_id())
.set(StIvtStructivtBcp::getCanuse_qty, subQty)
);
} else {
// 删除库存
structivtBcpService.remove(
new QueryWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getStruct_id, mst.getStruct_id())
.eq(StIvtStructivtBcp::getMaterial_id, mst.getMaterial_id())
);
}
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
param.put("change_qty", mst.getPlan_qty());
param.put("result_qty", subQty.doubleValue() > 0 ? subQty : 0);
param.put("bill_code",mst.getBill_code());
param.put("inv_id",mst.getIostorinv_id());
param.put("bill_type_scode",mst.getBill_type());
iStIvtStructivtflowService.insetIvtChange(param);
} else {
StIvtStructivtBcp ivtDao = structivtBcpService.getOne(
new QueryWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getStruct_id, mst.getStruct_id())
.eq(StIvtStructivtBcp::getMaterial_id, mst.getMaterial_id())
);
//删除库存
structivtBcpService.remove(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", mst.getStruct_id()));
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
param.put("change_qty", ivtDao.getCanuse_qty());
param.put("result_qty", 0);
param.put("bill_code",mst.getBill_code());
param.put("inv_id",mst.getIostorinv_id());
param.put("bill_type_scode",mst.getBill_type());
iStIvtStructivtflowService.insetIvtChange(param);
/*structivtflowService.recordStructivtFlow(
StIvtStructivtflowDto.builder()
@@ -226,29 +273,29 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
.build()
);*/
//维护载具
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_code, mst.getStruct_code())
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.set(StIvtStructattr::getInv_code,"")
.set(StIvtStructattr::getStoragevehicle_code, ""));
//维护载具
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_code, mst.getStruct_code())
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.set(StIvtStructattr::getInv_code,"")
.set(StIvtStructattr::getStoragevehicle_code, ""));
// 更新任务为完成
iSchBaseTaskService.update(
new UpdateWrapper<SchBaseTask>().lambda()
.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(SchBaseTask::getTask_id, mst.getTask_id())
);
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,mst.getStoragevehicle_code())
);
// 更新任务为完成
iSchBaseTaskService.update(
new UpdateWrapper<SchBaseTask>().lambda()
.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(SchBaseTask::getTask_id, mst.getTask_id())
);
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,mst.getStoragevehicle_code())
);
}
return null;
}
@@ -461,6 +508,10 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
checkParam(mst);
if (mst.getSect_id().equals(IOSEnum.SECT_CODE.code("半成品虚拟库区"))) {
throw new BadRequestException("此货位是虚拟货位,请强制完成单据!");
}
PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_OUT)
.acs_task_type("7")

View File

@@ -144,6 +144,19 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
mst.setStor_code(stor.getStor_code());
mst.setStor_name(stor.getStor_name());
}
仓位数据:
{
StIvtStructattr attrDao = structattrService.getById(JSONObject.parseObject(JSON.toJSONString(item)).getString("struct_id"));
if (ObjectUtil.isNotEmpty(attrDao)) {
mst.setStruct_id(attrDao.getStruct_id());
mst.setStruct_code(attrDao.getStruct_code());
mst.setStruct_name(attrDao.getStruct_name());
mst.setSect_id(attrDao.getSect_id());
mst.setSect_name(attrDao.getSect_name());
mst.setSect_code(attrDao.getSect_code());
}
}
packageRow(mst, JSONObject.parseObject(JSON.toJSONString(item)));
mst.setCreate_id(SecurityUtils.getCurrentUserId());
mst.setCreate_name(SecurityUtils.getCurrentNickName());
@@ -174,27 +187,30 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
mst.setBase_bill_code(row.getString("base_bill_code"));
mst.setQty_unit_name(row.getString("base_unit_name"));
mst.setUnit_weight(row.getBigDecimal("unit_weight"));
// 载具信息
{
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getString("storagevehicle_code"))
);
if (!mst.getPoint_code().equals("0")) {
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getString("storagevehicle_code"))
);
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
mst.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
mst.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
mst.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
mst.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
// 更新载具对应物料关系、数量
MdPbStoragevehicleext vehicleExtDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, row.getString("storagevehicle_code"))
);
if (ObjectUtil.isNotEmpty(vehicleExtDao)) {
vehicleExtDao.setWeight(mst.getPlan_qty());
vehicleExtDao.setMaterial_id(mst.getMaterial_id());
iMdPbStoragevehicleextService.updateById(vehicleExtDao);
// 更新载具对应物料关系、数量
MdPbStoragevehicleext vehicleExtDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, row.getString("storagevehicle_code"))
);
if (ObjectUtil.isNotEmpty(vehicleExtDao)) {
vehicleExtDao.setWeight(mst.getPlan_qty());
vehicleExtDao.setMaterial_id(mst.getMaterial_id());
iMdPbStoragevehicleextService.updateById(vehicleExtDao);
}
}
}
}
@@ -464,6 +480,93 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
FileUtil.downloadExcel(list, response);
}
@Override
public Object getVirtual(BcpIostorInvQuery query, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
TableDataInfo build = TableDataInfo.build(this.getIODtlVirtual(query));
build.setTotalElements(page.getTotal());
return build;
}
@Override
public List<Map> getIODtlVirtual(BcpIostorInvQuery query) {
return this.baseMapper.getIODtlVirtual(query);
}
@Override
@Transactional
public String confirmVirtual(JSONObject form) {
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
if (StringUtils.isEmpty(mst.getStruct_code())) {
throw new BadRequestException("当前入库单还未分配仓位!");
}
mst.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
mst.setUpdate_time(DateUtil.now());
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
this.updateById(mst);
// 查看此仓位此物料的库存是否存在
StIvtStructivtBcp ivtDaoNow = structivtBcpService.getOne(
new QueryWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getMaterial_id, mst.getMaterial_id())
.eq(StIvtStructivtBcp::getStruct_id, mst.getStruct_id())
);
if (ObjectUtil.isEmpty(ivtDaoNow)) {
//新增库存
StIvtStructivtBcp ivtDao = StIvtStructivtBcp.builder()
.struct_id(mst.getStruct_id())
.struct_code(mst.getStruct_code())
.struct_name(mst.getStruct_name())
.material_id(mst.getMaterial_id())
.quality_scode(mst.getQuality_scode())
.pcsn(mst.getPcsn())
.ivt_level(mst.getIvt_level())
.is_active(mst.getIs_active())
.qty_unit_id("2")
.instorage_time(DateUtil.now())
.stor_id(mst.getStor_id())
.canuse_qty(mst.getPlan_qty())
.workshop_id(mst.getWorkshop_id())
.unit_weight(mst.getUnit_weight())
.bill_type(mst.getBill_type())
.build();
structivtBcpService.save(ivtDao);
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
param.put("change_qty", ivtDao.getCanuse_qty());
param.put("result_qty", ivtDao.getCanuse_qty());
param.put("bill_code",mst.getBill_code());
param.put("inv_id",mst.getIostorinv_id());
param.put("bill_type_scode",IOSEnum.IO_TYPE.code("入库"));
iStIvtStructivtflowService.insetIvtChange(param);
} else {
// 增加库存
structivtBcpService.update(
new UpdateWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getMaterial_id, mst.getMaterial_id())
.eq(StIvtStructivtBcp::getStruct_id, mst.getStruct_id())
.set(StIvtStructivtBcp::getCanuse_qty, NumberUtil.add(ivtDaoNow.getCanuse_qty(),mst.getPlan_qty()))
);
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDaoNow));
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
param.put("change_qty", mst.getPlan_qty());
param.put("result_qty", ivtDaoNow.getCanuse_qty());
param.put("bill_code",mst.getBill_code());
param.put("inv_id",mst.getIostorinv_id());
param.put("bill_type_scode",IOSEnum.IO_TYPE.code("入库"));
iStIvtStructivtflowService.insetIvtChange(param);
}
return null;
}
private void delTask(String task_id) {
StIvtIostorinvBcp mstDao = this.getOne(

View File

@@ -211,7 +211,13 @@ public class StIvtMoreorlessmstBcpServiceImpl extends ServiceImpl<StIvtMoreorles
.eq(StIvtStructattr::getStruct_id, ivt.getStruct_id())
);
} else {
iStIvtStructivtBcpService.updateById(ivt);
// iStIvtStructivtBcpService.updateById(ivt);
iStIvtStructivtBcpService.update(
new UpdateWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getStruct_id, ivt.getStruct_id())
.eq(StIvtStructivtBcp::getMaterial_id, ivt.getMaterial_id())
.set(StIvtStructivtBcp::getCanuse_qty, NumberUtil.sub(canuse_qty, mol_qty))
);
}
});
} else {
@@ -274,7 +280,13 @@ public class StIvtMoreorlessmstBcpServiceImpl extends ServiceImpl<StIvtMoreorles
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
iStIvtStructivtBcpService.updateById(ivt);
// iStIvtStructivtBcpService.updateById(ivt);
iStIvtStructivtBcpService.update(
new UpdateWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getStruct_id, ivt.getStruct_id())
.eq(StIvtStructivtBcp::getMaterial_id, ivt.getMaterial_id())
.set(StIvtStructivtBcp::getCanuse_qty, NumberUtil.add(canuse_qty, mol_qty))
);
}
//更新明细状态

View File

@@ -382,7 +382,13 @@ public class StIvtShutframeinvBcpServiceImpl extends ServiceImpl<StIvtShutframei
}
in_ivt.setCanuse_qty(NumberUtil.add(in_ivt.getCanuse_qty(), dtl.getFact_qty()));
structivtBcpService.remove(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", turnout_struct_id));
structivtBcpService.updateById(in_ivt);
// structivtBcpService.updateById(in_ivt);
structivtBcpService.update(
new UpdateWrapper<StIvtStructivtBcp>().lambda()
.eq(StIvtStructivtBcp::getStruct_id, in_ivt.getStruct_id())
.set(StIvtStructivtBcp::getCanuse_qty, NumberUtil.add(in_ivt.getCanuse_qty(), dtl.getFact_qty()))
);
dtl.setWork_status(SHUTEnum.WORK_STATUS.code("完成"));
shutframedtlBcpService.updateById(dtl);

View File

@@ -40,6 +40,14 @@ export function getIODtl(data) {
})
}
export function getIODtlVirtual(data) {
return request({
url: '/api/in/semiproductIn/getIODtlVirtual',
method: 'post',
data
})
}
export function insertDtl(data) {
return request({
url: '/api/in/semiproductIn/insertDtl',
@@ -136,6 +144,14 @@ export function confirm(data) {
})
}
export function confirmVirtual(data) {
return request({
url: '/api/in/semiproductIn/confirmVirtual',
method: 'post',
data
})
}
export function delDis(data) {
return request({
url: '/api/in/semiproductIn/delDis',
@@ -187,6 +203,8 @@ export default {
updateTask,
confirmTask,
confirm,
confirmVirtual,
queryStor,
getDisTask
getDisTask,
getIODtlVirtual
}

View File

@@ -1,4 +1,3 @@
<!--suppress ALL -->
<template>
<el-dialog
:title="crud.status.title"
@@ -12,65 +11,25 @@
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
<span/>
</el-col>
<el-col :span="4">
<span>
<el-button
icon="el-icon-check"
size="mini"
:loading="crud.cu === 2"
type="primary"
@click="crud.submitCU"
>保存</el-button>
<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 ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
<label slot="label">单&nbsp;&nbsp;据&nbsp;号2:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker
v-model="form.biz_date"
type="date"
placeholder="选择日期"
style="width: 210px"
align="center"
value-format="yyyy-MM-dd"
:disabled="crud.status.view > 0"
/>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
size="mini"
placeholder="业务类型"
class="filter-item"
>
<el-option
v-for="item in dict.ST_INV_RAW_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓库</label>
<el-form-item label="仓库" prop="product_code">
<label slot="label">所属仓库:</label>
<el-select
v-model="form.stor_id"
clearable
@@ -87,23 +46,6 @@
/>
</el-select>
</el-form-item>
<el-form-item label="车间" prop="workshop_id">
<label slot="label">车间</label>
<el-select
v-model="form.workshop_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="仓位" prop="struct_id">
<label slot="label">仓位:</label>
<el-cascader
@@ -115,6 +57,23 @@
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in dict.ST_INV_BCP_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
@@ -134,46 +93,34 @@
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
<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">总&nbsp;&nbsp;&nbsp;量:</label>
<label slot="label">总&nbsp;&nbsp;&nbsp;量:</label>
<el-input-number
v-model.number="form.total_qty"
v-model="form.total_qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"
value-format="yyyy-MM-dd" :disabled="crud.status.view > 0"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input
v-model="form.remark"
style="width: 380px;"
rows="2"
type="textarea"
:disabled="crud.status.view > 0"
/>
<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;">
<div v-show="crud.status.add === 1" 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="insertBill()"
>
添加单据物料
</el-button>
<slot name="left"/>
<el-button
slot="left"
class="filter-item"
@@ -195,14 +142,26 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="入库重量">
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码"/>
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称"/>
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格"/>
<!-- <el-table-column show-overflow-tooltip prop="base_bill_code" label="订单号">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].base_bill_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>-->
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量">
<template slot-scope="scope">
<el-input-number
v-model.number="form.tableData[scope.$index].plan_qty"
v-model="form.tableData[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
@@ -212,20 +171,19 @@
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
<el-table-column show-overflow-tooltip prop="unit_weight" label="">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].remark"
<el-input-number
v-model="form.tableData[scope.$index].unit_weight"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="source_bill_type_name" label="源单类型" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
<el-table-column v-if="crud.status.add === 1" align="center" label="操作" width="170" fixed="right">
<template scope="scope">
<el-button
type="danger"
@@ -240,38 +198,29 @@
<MaterDtl
:dialog-show.sync="materShow"
:is-single="false"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="tableChanged"
/>
<BillDtl
:dialog-show.sync="billShow"
:is-single="false"
@setMaterValue="tableChanged2"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import crudsemiproductIn from '@/views/wms/storage_manage/semiproduct/semiproductIn/semiproductIn'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import BillDtl from '@/views/wms/storage_manage/rawproduct/rawProductIn/AddDtl'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import crudStructattr from '@/api/wms/basedata/st/structattr'
const defaultForm = {
bill_code: '',
product_code: '',
product_code: 'A1',
bill_status: '10',
total_qty: 0,
total_qty: '0',
detail_count: '0',
stor_id: '',
struct_id: '',
bill_type: '',
remark: '',
workshop_id: '',
biz_date: new Date(),
create_mode: '',
tableData: []
@@ -279,34 +228,42 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { MaterDtl, BillDtl },
components: {MaterDtl},
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
dicts: ['IO_BILL_STATUS', 'ST_QUALITY_SCODE', 'ST_INV_BCP_IN_TYPE', 'product_area'],
cruds() {
return CRUD({title: '入库新增', crudMethod: {...crudsemiproductIn}})
},
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
materShow: false,
billShow: false,
sects: [],
dtlShow: false,
opendtlParam: null,
materType: '01',
struct_id: '',
sect_id: '',
opendtlParam: null,
storlist: [],
sects: [],
billtypelist: [],
rules: {
product_code: [
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
{required: true, message: '生产车间不能为空', trigger: 'blur'}
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
{required: true, message: '业务类型不能为空', trigger: 'blur'}
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
{required: true, message: '业务日期不能为空', trigger: 'blur'}
]
}
}
@@ -320,16 +277,24 @@ export default {
},
methods: {
open() {
crudStorattr.getStor({ 'stor_type': '3' }).then(res => {
crudStorattr.getStor({'stor_type': '2'}).then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.beforeToEdit]() {
this.struct_id = this.crud.form.struct_id
this.sect_id = this.crud.form.sect_id
crudStructattr.getSectCascader({ 'stor_id': this.crud.form.stor_id }).then(res => {
this.sects = res.content
this.form.struct_id = this.struct_id
})
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudProductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
crudsemiproductIn.getIODtlVirtual({'iostorinv_id': this.form.iostorinv_id}).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
@@ -338,16 +303,8 @@ export default {
}
})
},
[CRUD.HOOK.beforeToEdit]() {
this.struct_id = this.crud.form.struct_id
this.sect_id = this.crud.form.sect_id
crudStructattr.getSectCascader({ 'stor_id': this.crud.form.stor_id }).then(res => {
this.sects = res.content
this.form.struct_id = this.search(this.sects, this.struct_id)
})
},
[CRUD.HOOK.afterToView]() {
crudProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
crudsemiproductIn.getIODtlVirtual({'iostorinv_id': this.form.iostorinv_id}).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
@@ -364,58 +321,32 @@ export default {
return false
}
if (!this.form.stor_id) {
this.crud.notify('仓库不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.struct_id) {
this.crud.notify('仓位不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
// if (!row.base_bill_code) {
// this.crud.notify('订单号', CRUD.NOTIFICATION_TYPE.INFO)
// return false
// }
if (!row.plan_qty) {
this.crud.notify('量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
this.crud.notify('量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.form.stor_id) {
this.crud.notify('所属仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.unit_weight) {
this.crud.notify('单重不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.struct_id) {
this.crud.notify('仓位不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.sect_id = this.sect_id
row.struct_id = this.struct_id
}
},
storChange(value) {
crudStructattr.getSectCascader({ 'stor_id': value }).then(res => {
this.sects = res.content
})
},
search(object, value) {
for (var key in object) {
if (object[key].value == value) return [object[key].value]
if (object[key].children && Object.keys(object[key].children).length > 0) {
var temp = this.search(object[key].children, value)
if (temp) return [object[key].value, temp].flat()
}
}
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.sect_id = val[0]
this.struct_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.struct_id = ''
}
if (val.length === 2) {
this.sect_id = val[0]
this.struct_id = val[1]
}
this.form.point_code = '0'
},
deleteRow(index, rows) {
const material_code = rows[index].material_code
@@ -432,9 +363,13 @@ export default {
}
}
},
tableChanged(rows) {
storChange(value) {
crudStructattr.getSectCascader({ 'stor_id': value }).then(res => {
this.sects = res.content
})
},
tableChanged(item) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code) {
@@ -443,51 +378,47 @@ export default {
})
if (same_mater) {
item.quality_scode = '01'
item.unit_weight = item.net_weight
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = 1
item.qty_unit_id = item.base_unit_id
item.qty_unit_name = item.base_unit_name
item.plan_qty = '1'
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
tableChanged2(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code && row.po_code === item.po.code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = parseFloat(item.need_qty)
item.source_bill_code = item.po_code
item.source_bill_type_name = '原料需求'
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
insertEvent(row) {
this.materShow = true
},
insertBill(row) {
this.billShow = true
},
changeQty() {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
})
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.sect_id = val[0]
this.struct_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.struct_id = ''
}
if (val.length === 2) {
this.sect_id = val[0]
this.struct_id = val[1]
}
},
search(object, value) {
for (var key in object) {
if (object[key].value === value) return [object[key].value]
if (object[key].children && Object.keys(object[key].children).length > 0) {
var temp = this.search(object[key].children, value)
if (temp) return [object[key].value, temp].flat()
}
}
}
}
}

View File

@@ -1,142 +0,0 @@
<!--suppress ALL -->
<template>
<el-dialog
title="原料需求"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1200px"
@close="close"
@open="open"
>
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="日期">
<date-range-picker v-model="query.createTime" align="center" class="date-item" value-format="yyyy-MM-dd" />
</el-form-item>
<el-form-item label="单据号">
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="单据号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation />
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip width="150" prop="ask_time" label="日期" />
<el-table-column show-overflow-tooltip width="150" prop="po_code" label="单据号" />
<el-table-column show-overflow-tooltip prop="material_code" width="250" label="物料编号" />
<el-table-column show-overflow-tooltip width="100" prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip width="150" prop="class_name" label="物料类别" />
<el-table-column show-overflow-tooltip width="150" prop="qty" label="重量" />
<el-table-column show-overflow-tooltip width="170" prop="need_qty" label="待入重量" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
const start = new Date()
export default {
name: 'AddDtl',
components: { crudOperation, rrOperation, pagination, DateRangePicker },
cruds() {
return CRUD({
title: '采购订单',
url: '/api/pcsIfPurchaseorder/forRawIn',
crudMethod: {},
optShow: {
reset: true
}
})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
rows: [],
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
this.crud.toQuery()
},
close() {
this.$emit('update:dialogShow', false)
},
submit() {
this.$emit('update:dialogShow', false)
this.rows = this.$refs.multipleTable.selection
this.$emit('setMaterValue', this.rows)
}
}
}
</script>

View File

@@ -1,4 +1,3 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
@@ -9,22 +8,18 @@
@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="85px"
label-suffix=":"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="所属仓库" prop="stor_name">
<label slot="label">所属仓库:</label>
<el-input v-model="form.stor_name" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="生产车间">
<el-select
v-model="form.product_code"
v-model="form.workshop_id"
clearable
size="mini"
placeholder="全部"
@@ -52,7 +47,7 @@
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_RAW_IN_TYPE"
v-for="item in dict.ST_INV_BCP_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -77,8 +72,8 @@
</el-select>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.plan_qty" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
@@ -92,15 +87,7 @@
/>
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker
v-model="form.biz_date"
type="date"
placeholder="选择日期"
style="width: 210px"
align="center"
value-format="yyyy-MM-dd"
:disabled="true"
/>
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="true" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
@@ -108,12 +95,11 @@
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span2">入库明细</span>
<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"
@@ -121,15 +107,17 @@
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<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="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column prop="pcsn" label="批次" width="150" 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 show-overflow-tooltip prop="remark" label="明细备注" align="center" />
<el-table-column prop="unit_weight" label="单重" align="center" />
<el-table-column prop="struct_code" label="目的位置" align="center" />
</el-table>
</el-card>
</el-dialog>
@@ -138,13 +126,13 @@
<script>
import { crud } from '@crud/crud'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import crudsemiproductIn from '@/views/wms/storage_manage/semiproduct/semiproductIn/semiproductIn'
export default {
name: 'ViewDialog',
components: {},
components: { },
mixins: [crud()],
dicts: ['ST_INV_RAW_IN_TYPE', 'product_area', 'IO_BILL_STATUS'],
dicts: ['ST_INV_BCP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'task_status'],
props: {
dialogShow: {
type: Boolean,
@@ -187,8 +175,7 @@ export default {
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('AddChanged')
this.$emit('TaskChanged')
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
@@ -223,18 +210,12 @@ export default {
this.currentDis = current
},
queryTableDtl() {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
crudsemiproductIn.getIODtlVirtual({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getDisTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
}
}
}
@@ -250,14 +231,13 @@ export default {
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}

View File

@@ -1,4 +1,3 @@
<!--suppress ALL -->
<template>
<div class="app-container">
<!--工具栏-->
@@ -12,13 +11,12 @@
label-width="80px"
label-suffix=":"
>
<el-form-item label="仓库">
<el-form-item label="所属仓库">
<el-select
v-model="query.stor_id"
clearable
size="mini"
placeholder="仓库"
placeholder="单据状态"
class="filter-item"
@change="crud.toQuery"
>
@@ -50,31 +48,11 @@
</el-select>
</el-form-item>
<el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
clearable
filterable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_CREATE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据日期">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
align="center"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@@ -105,7 +83,7 @@
v-model="query.bill_code"
size="mini"
clearable
placeholder="入库单号"
placeholder="单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
@@ -139,7 +117,7 @@
type="warning"
icon="el-icon-check"
size="mini"
:disabled="confirm_flag"
:disabled="dis_flag"
@click="confirm"
>
强制确认
@@ -159,36 +137,28 @@
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="stor_name" label="生产车间" width="130" show-overflow-tooltip />
<el-table-column
show-overflow-tooltip
prop="bill_type"
min-width="120"
label="业务类型"
:formatter="bill_typeFormat"
/>
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column label="明细数量" align="center" prop="detail_count" />
<el-table-column label="总重量" align="center" prop="total_qty">
<template slot-scope="scope">
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column prop="workshop_id" label="生产车间" width="130" show-overflow-tooltip />
<el-table-column prop="stor_name" label="仓库" width="130" show-overflow-tooltip />
<el-table-column prop="sect_name" label="库区" width="130" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="业务类型" :formatter="bill_typeFormat" />
<!-- <el-table-column show-overflow-tooltip prop="base_bill_code" min-width="120" label="关联单据号" />-->
<el-table-column show-overflow-tooltip min-width="120" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip min-width="120" prop="plan_qty" label="总重量(g)" />
<el-table-column show-overflow-tooltip min-width="120" prop="qty" label="总数量(个)" />
<el-table-column show-overflow-tooltip min-width="120" prop="unit_weight" label="单重" />
<el-table-column show-overflow-tooltip min-width="120" prop="struct_code" label="分配货位" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="制单人" align="center" prop="create_name" />
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
<el-table-column label="创建人" align="center" prop="create_name" />
<el-table-column label="创建时间" align="center" prop="create_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_name" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="分配人" align="center" prop="dis_name" width="140px" />
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_name" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
@@ -205,43 +175,47 @@
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" @AddChanged="querytable" />
</div>
</template>
<script>
import rawProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import crudsemiproductIn from '@/views/wms/storage_manage/semiproduct/semiproductIn/semiproductIn'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import AddDialog from '@/views/wms/storage_manage/rawproduct/rawProductIn/AddDialog'
import ViewDialog from '@/views/wms/storage_manage/rawproduct/rawProductIn/ViewDialog'
import AddDialog from '@/views/wms/storage_manage/semiproduct/semivproductIn/AddDialog'
import ViewDialog from '@/views/wms/storage_manage/semiproduct/semivproductIn/ViewDialog'
import { mapGetters } from 'vuex'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
export default {
name: 'RawProductIn',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
name: 'SemiproductIn',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({
title: '',
query: {
'io_type': '0'
},
optShow: { add: true, reset: true },
idField: 'iostorinv_id',
url: '/api/stIvtIostorinvYl',
sort: ['bill_code'],
crudMethod: { ...rawProductIn }
url: '/api/in/semiproductIn/getVirtual',
crudMethod: { ...crudsemiproductIn }
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['IO_BILL_STATUS', 'ST_INV_BCP_IN_TYPE', 'product_area', 'ST_INV_CREATE'],
dicts: ['IO_BILL_STATUS', 'product_area', 'ST_INV_BCP_IN_TYPE', 'ST_INV_CREATE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {},
product_code: 'A1',
dis_flag: true,
confirm_flag: true,
disShow: false,
@@ -251,6 +225,8 @@ export default {
openParam: [],
currentRow: null,
storlist: [],
loadingAutodiv: false,
downloading: false,
storId: null
}
},
@@ -266,7 +242,7 @@ export default {
}
},
created() {
crudStorattr.getStor({ 'stor_type': '3' }).then(res => {
crudStorattr.getStor({ 'stor_type': '2' }).then(res => {
this.storlist = res.content
})
},
@@ -295,11 +271,16 @@ export default {
buttonChange(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10') {
if (currentRow.bill_status === '10' || currentRow.bill_status === '20') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
if (currentRow.bill_status !== '99') {
this.dis_flag = false
} else {
this.dis_flag = true
}
}
},
handleCurrentChange(currentRow) {
@@ -316,22 +297,49 @@ export default {
this.mstrow = row
this.viewShow = true
},
toEdtl(row) {
this.editShow = true
this.mstrow = row
},
confirm() {
if (!this.currentRow) {
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.confirm(this.currentRow).then(res => {
crudsemiproductIn.confirmVirtual(this.currentRow).then(res => {
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
confirmTask() {
if (!this.currentRow) {
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.loadingAutodiv = true
crudsemiproductIn.confirmTask(this.currentRow).then(res => {
this.crud.notify('单据下发任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}).finally(() => {
this.loadingAutodiv = false
})
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
},
downloadButton() {
this.downloading = true
download('/api/in/semiproductIn/download', this.query).then(result => {
downloadFile(result, '半成品入库单', 'xlsx')
this.downloading = false
}).catch(() => {
this.downloading = false
})
}
}
}

View File

@@ -1,49 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/stIvtIostorinvYl',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/stIvtIostorinvYl/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/stIvtIostorinvYl/update',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/stIvtIostorinvYl/confirm',
method: 'post',
data
})
}
export function getIODtl(data) {
return request({
url: '/api/stIvtIostorinvYl/getIODtl',
method: 'post',
data
})
}
export default {
add,
edit,
del,
confirm,
getIODtl
}