add:盘点管理
This commit is contained in:
@@ -0,0 +1,227 @@
|
||||
package org.nl.wms.sch_manage.service.util.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.util.TaskType;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点回库移库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-28
|
||||
*/
|
||||
@Component(value = "CheckBackMoveTask")
|
||||
@TaskType("CheckBackMoveTask")
|
||||
public class CheckBackMoveTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 任务服务类
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* 盘点主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
/**
|
||||
* 盘点明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckdtlService iStIvtCheckdtlService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(CheckBackMoveTask.class.getSimpleName());
|
||||
task.setPoint_code1(json.getString("point_code1"));
|
||||
task.setPoint_code2(json.getString("point_code2"));
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setContact_task(json.getString("contact_task"));
|
||||
task.setGroup_id(json.getString("group_id"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
taskService.save(task);
|
||||
|
||||
// 下发任务
|
||||
this.sendTaskOne(task.getTask_id());
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
SchBaseTask taskDao = taskService.getById(taskId);
|
||||
|
||||
// 组织下发给acs的数据
|
||||
AcsTaskDto acsTaskDto = new AcsTaskDto();
|
||||
acsTaskDto.setExt_task_id(taskDao.getTask_id());
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
acsTaskDto.setTask_type("1");
|
||||
return acsTaskDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
// 校验任务
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("该任务已完成!");
|
||||
}
|
||||
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
||||
throw new BadRequestException("该任务已取消!");
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
// 更新明细状态
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
if (Integer.parseInt(taskObj.getTask_status()) > Integer.parseInt(TaskStatus.CREATE.getCode())) {
|
||||
throw new BadRequestException("只能取消生成中的任务!");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
// 完成任务
|
||||
this.taskConfirm(taskObj.getTask_code());
|
||||
// 更新任务状态
|
||||
taskObj.setRemark("已完成");
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void cancelTask(SchBaseTask taskObj) {
|
||||
// 查询明细
|
||||
SchBaseTask moveTask = taskService.getById(taskObj.getContact_task());
|
||||
StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getOne(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getTask_id, moveTask.getTask_id())
|
||||
);
|
||||
// 更新盘点明细状态
|
||||
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("盘点中") );
|
||||
dtlDao.setCheck_result(IOSConstant.ZERO);
|
||||
dtlDao.setIs_down(IOSConstant.ZERO);
|
||||
dtlDao.setCheck_optid(SecurityUtils.getCurrentUserId());
|
||||
dtlDao.setCheck_optname(SecurityUtils.getCurrentNickName());
|
||||
dtlDao.setCheck_optname(DateUtil.now());
|
||||
iStIvtCheckdtlService.updateById(dtlDao);
|
||||
|
||||
// 更新主表状态
|
||||
iStIvtCheckmstService.updateMst(dtlDao.getCheck_id());
|
||||
|
||||
// 更新任务状态
|
||||
taskObj.setRemark("已取消");
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskConfirm(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
SchBaseTask moveTask = taskService.getById(taskObj.getContact_task());
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getIng_task_code, null)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
);
|
||||
// 更新终点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
|
||||
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code())
|
||||
);
|
||||
|
||||
// 更新盘点明细状态
|
||||
StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getOne(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getTask_id, moveTask.getTask_id())
|
||||
);
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("完成"));
|
||||
iStIvtCheckdtlService.updateById(dtlDao);
|
||||
|
||||
// 更新主表状态
|
||||
iStIvtCheckmstService.updateMst(dtlDao.getCheck_id());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package org.nl.wms.sch_manage.service.util.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.util.TaskType;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinvdtl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 盘点移库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-28
|
||||
*/
|
||||
@Component(value = "CheckMoveTask")
|
||||
@TaskType("CheckMoveTask")
|
||||
public class CheckMoveTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 任务服务类
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* 盘点主表服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckmstService iStIvtCheckmstService;
|
||||
|
||||
/**
|
||||
* 盘点明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckdtlService iStIvtCheckdtlService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(CheckMoveTask.class.getSimpleName());
|
||||
task.setPoint_code1(json.getString("point_code1"));
|
||||
task.setPoint_code2(json.getString("point_code2"));
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setGroup_id(json.getString("group_id"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
taskService.save(task);
|
||||
|
||||
// 下发任务
|
||||
this.sendTaskOne(task.getTask_id());
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
SchBaseTask taskDao = taskService.getById(taskId);
|
||||
|
||||
// 组织下发给acs的数据
|
||||
AcsTaskDto acsTaskDto = new AcsTaskDto();
|
||||
acsTaskDto.setExt_task_id(taskDao.getTask_id());
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
acsTaskDto.setTask_type("1");
|
||||
return acsTaskDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
// 校验任务
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("该任务已完成!");
|
||||
}
|
||||
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
||||
throw new BadRequestException("该任务已取消!");
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
// 更新明细状态
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
if (Integer.parseInt(taskObj.getTask_status()) > Integer.parseInt(TaskStatus.CREATE.getCode())) {
|
||||
throw new BadRequestException("只能取消生成中的任务!");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
// 完成任务
|
||||
this.taskConfirm(taskObj.getTask_code());
|
||||
// 更新任务状态
|
||||
taskObj.setRemark("已完成");
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void cancelTask(SchBaseTask taskObj) {
|
||||
// 更新盘点明细状态
|
||||
iStIvtCheckdtlService.update(
|
||||
new UpdateWrapper<StIvtCheckdtl>().lambda()
|
||||
.set(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("生成") )
|
||||
.set(StIvtCheckdtl::getTask_id, "")
|
||||
.eq(StIvtCheckdtl::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
|
||||
// 更新任务状态
|
||||
taskObj.setRemark("已取消");
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskConfirm(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
// 更新起点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code1())
|
||||
.set(Structattr::getStoragevehicle_code, null)
|
||||
);
|
||||
// 更新终点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有箱有料"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2())
|
||||
.set(SchBasePoint::getIng_task_code, taskObj.getTask_id())
|
||||
);
|
||||
|
||||
// 更新盘点明细状态
|
||||
StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getOne(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("盘点中"));
|
||||
iStIvtCheckdtlService.updateById(dtlDao);
|
||||
|
||||
// 更新主表状态
|
||||
iStIvtCheckmstService.updateMst(dtlDao.getCheck_id());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -64,13 +65,20 @@ public class CheckController {
|
||||
@GetMapping("/getDtl")
|
||||
@Log("获取明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtCheckmstService.getDtl(whereJson),HttpStatus.OK);
|
||||
return new ResponseEntity<>(iStIvtCheckmstService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveCheck")
|
||||
@Log("保存盘点")
|
||||
public ResponseEntity<Object> saveCheck(@RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.saveCheck(dto);
|
||||
@PostMapping("/dtlCheckConfirm")
|
||||
@Log("明细盘点确认")
|
||||
public ResponseEntity<Object> dtlCheckConfirm(@RequestBody StIvtCheckdtl dao) {
|
||||
iStIvtCheckmstService.dtlCheckConfirm(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/sendMoveTask")
|
||||
@Log("下发移库任务")
|
||||
public ResponseEntity<Object> sendMoveTask(@RequestBody CheckInsertDto dto) {
|
||||
iStIvtCheckmstService.sendMoveTask(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public enum IOSEnum {
|
||||
|
||||
// 移库任务配置类编码
|
||||
MOVE_CONFIG_CODE(MapOf.of("2001","InsideMoveTask", "2002", "CombinedBoxMoveTask",
|
||||
"2003", "PieceBoxMoveTask", "2004", "2004"
|
||||
"2003", "PieceBoxMoveTask", "CheckMoveTask", "2004"
|
||||
)),
|
||||
|
||||
//入库分配明细状态
|
||||
@@ -106,7 +106,7 @@ public enum IOSEnum {
|
||||
CHECK_MST_STATUS(MapOf.of("生成", "10", "盘点中", "20", "完成", "99")),
|
||||
|
||||
// 盘点明细状态
|
||||
CHECK_DTL_STATUS(MapOf.of("生成", "10", "盘点中", "20", "已盘点", "30", "完成", "99")),
|
||||
CHECK_DTL_STATUS(MapOf.of("生成", "10", "移库中", "15", "盘点中", "20", "回库中", "30", "完成", "99")),
|
||||
|
||||
// 拼箱主表状态
|
||||
PIECE_MST_STATUS(MapOf.of("生成", "10", "拼箱中", "20", "完成", "99")),
|
||||
|
||||
@@ -4,6 +4,7 @@ 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_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_management.service.dto.CheckInsertDto;
|
||||
|
||||
@@ -56,10 +57,10 @@ public interface IStIvtCheckmstService extends IService<StIvtCheckmst> {
|
||||
List<JSONObject> getDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 保存盘点单
|
||||
* @param dto 新增修改dto实体类
|
||||
* 明细盘点确认
|
||||
* @param dao 明细实体类
|
||||
*/
|
||||
void saveCheck(CheckInsertDto dto);
|
||||
void dtlCheckConfirm(StIvtCheckdtl dao);
|
||||
|
||||
/**
|
||||
* 确认盘点
|
||||
@@ -72,4 +73,11 @@ public interface IStIvtCheckmstService extends IService<StIvtCheckmst> {
|
||||
* @param check_id 主表id
|
||||
*/
|
||||
void updateMst(String check_id);
|
||||
|
||||
/**
|
||||
* 下发移库任务
|
||||
* @param dto 实体类dto
|
||||
*/
|
||||
void sendMoveTask(CheckInsertDto dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -100,10 +100,15 @@ public class StIvtCheckdtl implements Serializable {
|
||||
private BigDecimal fac_qty;
|
||||
|
||||
/**
|
||||
* 盘点结果
|
||||
* 盘点结果 1-正常 2-异常
|
||||
*/
|
||||
private String check_result;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 盘点人
|
||||
*/
|
||||
|
||||
@@ -114,6 +114,11 @@ public class StIvtCheckmst implements Serializable {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否异常
|
||||
*/
|
||||
private String is_nok;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
|
||||
@@ -8,13 +8,21 @@
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
sect.sect_name,
|
||||
attr.struct_name
|
||||
attr.struct_name,
|
||||
task.task_code,
|
||||
(
|
||||
CASE
|
||||
WHEN dtl.status > '20' THEN true
|
||||
ELSE false
|
||||
END
|
||||
) AS edit
|
||||
FROM
|
||||
st_ivt_checkdtl dtl
|
||||
LEFT JOIN st_ivt_checkmst ios ON ios.check_id = dtl.check_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
LEFT JOIN st_ivt_sectattr sect ON sect.sect_code = dtl.sect_code
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_code = dtl.struct_code
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.check_id != null and param.check_id != ''">
|
||||
|
||||
@@ -11,14 +11,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.CheckBackMoveTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.CheckMoveTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckdtlService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCheckmstService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckmst;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtCheckmstMapper;
|
||||
@@ -27,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -42,9 +48,30 @@ import java.util.Set;
|
||||
@Service
|
||||
public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, StIvtCheckmst> implements IStIvtCheckmstService {
|
||||
|
||||
/**
|
||||
* 盘点明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCheckdtlService iStIvtCheckdtlService;
|
||||
|
||||
/**
|
||||
* 盘点移库任务类服务
|
||||
*/
|
||||
@Autowired
|
||||
private CheckMoveTask checkMoveTask;
|
||||
|
||||
/**
|
||||
* 盘点回库任务类服务
|
||||
*/
|
||||
@Autowired
|
||||
private CheckBackMoveTask checkBackMoveTask;
|
||||
|
||||
/**
|
||||
* 组盘记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Override
|
||||
public IPage<StIvtCheckmst> queryAll(Map whereJson, PageQuery page) {
|
||||
String check_code = MapUtil.getStr(whereJson, "check_code");
|
||||
@@ -126,23 +153,56 @@ public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, S
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveCheck(CheckInsertDto dto) {
|
||||
StIvtCheckmst mstDao = this.getById(dto.getCheck_id());
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("盘点中"));
|
||||
this.updateById(mstDao);
|
||||
public void dtlCheckConfirm(StIvtCheckdtl dao) {
|
||||
StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getById(dao.getCheckdtl_id());
|
||||
dtlDao.setFac_qty(dao.getFac_qty());
|
||||
// 是否异常 1-正常 2-异常
|
||||
dtlDao.setCheck_result(
|
||||
dtlDao.getBase_qty().doubleValue() == dtlDao.getFac_qty().doubleValue() ?
|
||||
IOSConstant.ONE : IOSConstant.TWO
|
||||
);
|
||||
dtlDao.setCheck_optid(SecurityUtils.getCurrentUserId());
|
||||
dtlDao.setCheck_optname(SecurityUtils.getCurrentNickName());
|
||||
dtlDao.setCheck_optname(DateUtil.now());
|
||||
|
||||
// 判断是否有任务: 有任务判断是否完成,没任务直接确认
|
||||
if (ObjectUtil.isNotEmpty(dao.getTask_id())) {
|
||||
if (!dao.getStatus().equals(IOSEnum.CHECK_DTL_STATUS.code("盘点中"))) {
|
||||
throw new BadRequestException("当前移库任务未完成或已在回库中,不允许确认操作!");
|
||||
}
|
||||
|
||||
// 生成回库任务
|
||||
JSONObject jsonTask = new JSONObject();
|
||||
jsonTask.put("point_code1", IOSConstant.CZW_POINT);
|
||||
jsonTask.put("point_code2", dtlDao.getStruct_code());
|
||||
jsonTask.put("vehicle_code", dtlDao.getStoragevehicle_code());
|
||||
jsonTask.put("contact_task", dtlDao.getTask_id());
|
||||
checkBackMoveTask.create(jsonTask);
|
||||
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("回库中"));
|
||||
dtlDao.setIs_down(IOSConstant.ONE);
|
||||
} else {
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("完成"));
|
||||
}
|
||||
// 生成损益单据
|
||||
List<StIvtCheckdtl> dtlDaoList = new ArrayList<>();
|
||||
dtlDaoList.add(dtlDao);
|
||||
iStIvtCheckdtlService.createMore(dtlDaoList,dtlDao.getCheck_id());
|
||||
|
||||
// 更新组盘记录表
|
||||
iMdPbGroupplateService.update(
|
||||
new UpdateWrapper<GroupPlate>().lambda()
|
||||
.set(GroupPlate::getQty, dtlDao.getFac_qty())
|
||||
.eq(GroupPlate::getMaterial_id, dtlDao.getMaterial_id())
|
||||
.eq(GroupPlate::getStoragevehicle_code, dtlDao.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getPcsn, dtlDao.getPcsn())
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
);
|
||||
|
||||
// 更新明细
|
||||
iStIvtCheckdtlService.remove(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, mstDao.getCheck_id())
|
||||
.ne(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
);
|
||||
iStIvtCheckdtlService.createCheckDtl(dto);
|
||||
iStIvtCheckdtlService.update(
|
||||
new UpdateWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.ne(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("完成"))
|
||||
.set(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("盘点中"))
|
||||
);
|
||||
iStIvtCheckdtlService.updateById(dtlDao);
|
||||
// 更新主表状态
|
||||
updateMst(dao.getCheck_id());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,19 +230,66 @@ public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateMst(String check_id) {
|
||||
StIvtCheckmst mstDao = this.getById(check_id);
|
||||
|
||||
List<StIvtCheckdtl> dtlDaoList = iStIvtCheckdtlService.list(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, check_id)
|
||||
);
|
||||
|
||||
boolean is_create = dtlDaoList.stream()
|
||||
.allMatch(row -> row.getStatus().equals(IOSEnum.CHECK_DTL_STATUS.code("生成")));
|
||||
|
||||
boolean is_check = dtlDaoList.stream()
|
||||
.anyMatch(row -> row.getStatus().equals(IOSEnum.CHECK_DTL_STATUS.code("盘点中")));
|
||||
|
||||
boolean is_confirm = dtlDaoList.stream()
|
||||
.allMatch(row -> row.getStatus().equals(IOSEnum.CHECK_DTL_STATUS.code("完成")));
|
||||
|
||||
mstDao.setStatus(is_confirm ? IOSEnum.CHECK_MST_STATUS.code("完成") : IOSEnum.CHECK_MST_STATUS.code("盘点中"));
|
||||
mstDao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setConfirm_time(DateUtil.now());
|
||||
if (is_create) {
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("生成"));
|
||||
} else if (is_check) {
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("盘点中"));
|
||||
} else if (is_confirm) {
|
||||
mstDao.setStatus(IOSEnum.CHECK_MST_STATUS.code("完成"));
|
||||
mstDao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setConfirm_time(DateUtil.now());
|
||||
}
|
||||
|
||||
// 判断是否异常
|
||||
boolean is_result = dtlDaoList.stream()
|
||||
.filter(row -> ObjectUtil.isNotEmpty(row.getCheck_result()))
|
||||
.anyMatch(row -> row.getCheck_result().equals(IOSConstant.TWO));
|
||||
|
||||
mstDao.setIs_nok(is_result ? IOSConstant.TWO : IOSConstant.ONE);
|
||||
this.updateById(mstDao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void sendMoveTask(CheckInsertDto dto) {
|
||||
// 查询所有生成的明细
|
||||
List<StIvtCheckdtl> dtlDaoList = iStIvtCheckdtlService.list(
|
||||
new QueryWrapper<StIvtCheckdtl>().lambda()
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.eq(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("生成"))
|
||||
);
|
||||
|
||||
// 生成盘点移库任务
|
||||
for (StIvtCheckdtl dtlDao : dtlDaoList) {
|
||||
JSONObject jsonTask = new JSONObject();
|
||||
jsonTask.put("point_code1", dtlDao.getStruct_code());
|
||||
jsonTask.put("point_code2", IOSConstant.CZW_POINT);
|
||||
jsonTask.put("vehicle_code", dtlDao.getStoragevehicle_code());
|
||||
String task_id = checkMoveTask.create(jsonTask);
|
||||
|
||||
// 更新明细
|
||||
dtlDao.setTask_id(task_id);
|
||||
dtlDao.setStatus(IOSEnum.CHECK_DTL_STATUS.code("移库中"));
|
||||
}
|
||||
iStIvtCheckdtlService.updateBatchById(dtlDaoList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="焊材批号" prop="pcsn">
|
||||
<el-input v-model="formMst.pcsn" disabled placeholder="由系统自动生成" style="width: 200px;" />
|
||||
<el-input v-model="formMst.pcsn" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
@@ -237,13 +237,19 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否临时" prop="is_tempstruct">
|
||||
<el-radio v-model="form.is_tempstruct" label="1">是</el-radio>
|
||||
<el-radio v-model="form.is_tempstruct" label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否空载具" prop="is_emptyvehicle">
|
||||
<el-radio v-model="form.is_emptyvehicle" label="1">是</el-radio>
|
||||
<el-radio v-model="form.is_emptyvehicle" label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
<el-table-column prop="base_qty" label="库存数量" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('base_qty',crud.data,'库存数量')" />
|
||||
<el-table-column v-if="crud.status.view > 0" prop="fac_qty" label="盘点数量" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('fac_qty',crud.data,'盘点数量')" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" :min-width="flexWidth('input_time',crud.data,'创建日期')" />
|
||||
<el-table-column v-if="crud.status.view > 0" prop="task_code" label="移出任务编码" align="center" :min-width="flexWidth('task_code',crud.data,'移出任务编码')" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
return CRUD({
|
||||
title: '库存物料',
|
||||
optShow: {},
|
||||
url: 'api/moveStor/getCanuseIvt',
|
||||
url: 'api/checkoutbill/getCanuseIvt',
|
||||
idField: 'struct_id',
|
||||
sort: 'storagevehicleext_id,desc'
|
||||
})
|
||||
|
||||
@@ -7,6 +7,17 @@
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row style="padding-bottom: 10px" :gutter="20">
|
||||
<el-col :span="22" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<span>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form1" :inline="true" :model="form1" :rules="rules" size="mini" label-width="80px">
|
||||
<el-input v-show="false" v-model="form1.stor_code" placeholder="仓库编码" />
|
||||
@@ -67,18 +78,13 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<div style="padding-bottom: 10px;padding-top: 10px">
|
||||
<span class="role-span">盘点明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form1.tableData"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
@@ -92,29 +98,24 @@
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="material_code" label="物料编码" align="center" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次" align="center" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="base_qty" label="库存数量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('base_qty',crud.data,'库存数量')" />
|
||||
<el-table-column prop="fac_qty" label="盘点数量" align="center" :min-width="flexWidth('fac_qty',crud.data,'盘点数量')">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :precision="3" :min="0" :disabled="scope.row.status === '99'" />
|
||||
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :controls="false" :precision="3" :min="0" :disabled="scope.row.status === '99'" />
|
||||
<span v-show="isShow(scope.$index, scope.row,4)">{{ scope.row.fac_qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'计量单位')" />
|
||||
<el-table-column prop="task_code" label="移出任务编码" align="center" :min-width="flexWidth('task_code',crud.data,'移出任务编码')" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('status',crud.data,'状态')" />
|
||||
<el-table-column align="center" label="操作" fixed="right">
|
||||
<el-table-column align="center" :width="200" label="操作" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-if="false" :disabled="isCanDel(scope.$index, scope.row,1)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
<el-button v-show="!scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
<el-button :disabled="!scope.row.edit" type="success" class="filter-item" size="mini" @click="dtlCheckConfirm(scope.$index, scope.row)">确认盘点</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveCheck">保存</el-button>
|
||||
<!-- <el-button type="primary" @click="submitCheck">确认</el-button>-->
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -132,9 +133,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
@@ -147,6 +145,7 @@ export default {
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
tableData: [],
|
||||
form1: {
|
||||
check_id: '',
|
||||
check_code: '',
|
||||
@@ -168,31 +167,27 @@ export default {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.form1 = this.openParam
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.getDtl()
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
check.getDtl({ 'check_id': this.form1.check_id }).then(res => {
|
||||
this.form1.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form1.tableData.length; i++) {
|
||||
const row = this.form1.tableData[i]
|
||||
row.edit = false
|
||||
if (row.status > '20') {
|
||||
row.edit = true
|
||||
}
|
||||
this.$set(this.form1.tableData, i, row)
|
||||
}
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
this.$refs['form1'].resetFields()
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getDtl() {
|
||||
check.getDtl({ 'check_id': this.form1.check_id }).then(res => {
|
||||
this.tableData = res
|
||||
})
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
@@ -276,10 +271,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form1 = row
|
||||
},
|
||||
bill_statusFormat(row, column) {
|
||||
return this.dict.label.CHECK_DTL_STATUS[row.status]
|
||||
},
|
||||
@@ -300,29 +291,10 @@ export default {
|
||||
row.edit = !row.edit
|
||||
this.form1.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = null
|
||||
this.form1.detail_count = this.form1.tableData.length
|
||||
},
|
||||
saveCheck() {
|
||||
if (this.form1.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form1.tableData.length; i++) {
|
||||
if (!this.form1.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
if (this.form1.tableData[i].fac_qty === '' || this.form1.tableData[i].fac_qty === 0) {
|
||||
this.crud.notify('盘点数量不能为0序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
check.saveCheck(this.form1).then(res => {
|
||||
this.dialogVisible = false
|
||||
dtlCheckConfirm(index, row) {
|
||||
check.dtlCheckConfirm(row).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.getDtl()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -330,14 +302,4 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -46,11 +46,21 @@ export function confirm(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function saveCheck(data) {
|
||||
|
||||
export function sendMoveTask(data) {
|
||||
return request({
|
||||
url: '/api/check/saveCheck',
|
||||
url: '/api/check/sendMoveTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getDtl, getStructIvt, confirm, saveCheck }
|
||||
|
||||
export function dtlCheckConfirm(data) {
|
||||
return request({
|
||||
url: '/api/check/dtlCheckConfirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDtl, getStructIvt, confirm, sendMoveTask, dtlCheckConfirm }
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
:disabled="check_flag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="sendMoveTask"
|
||||
>
|
||||
下发移库
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -119,7 +130,7 @@
|
||||
>
|
||||
盘点
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -129,7 +140,7 @@
|
||||
@click="submitCheck"
|
||||
>
|
||||
确认
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -182,7 +193,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<CheckDialog ref="child" @AddChanged="querytable" />
|
||||
<CheckDialog ref="child" :dialog-show.sync="openCheck" :open-param="openParam" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -217,7 +228,7 @@ export default {
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['CHECK_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_TYPE_CK'],
|
||||
dicts: ['CHECK_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_TYPE_CK', 'check_result'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
@@ -227,6 +238,8 @@ export default {
|
||||
del: ['admin', 'check:del']
|
||||
},
|
||||
check_flag: true,
|
||||
openParam: null,
|
||||
openCheck: false,
|
||||
downdtl_flag: true,
|
||||
confirm_flag: true,
|
||||
currentRow: null,
|
||||
@@ -293,11 +306,7 @@ export default {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
is_nokFormat(row) {
|
||||
if (row.is_nok === '1') {
|
||||
return '异常'
|
||||
} else {
|
||||
return '正常'
|
||||
}
|
||||
return this.dict.label.check_result[row.is_nok]
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current === null) {
|
||||
@@ -310,9 +319,16 @@ export default {
|
||||
checkboxT(row) {
|
||||
return row.bill_status !== '99'
|
||||
},
|
||||
sendMoveTask() {
|
||||
check.sendMoveTask(this.currentRow).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
checkOpen() {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.child.setForm(this.currentRow)
|
||||
this.openParam = this.currentRow
|
||||
this.openCheck = true
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
|
||||
Reference in New Issue
Block a user