add:拣选页面机功能
This commit is contained in:
@@ -123,6 +123,10 @@ public class BmFormStruc implements Serializable {
|
||||
* 关联上级表单id
|
||||
*/
|
||||
private String parent_id;
|
||||
/**
|
||||
* 关联上级表单id
|
||||
*/
|
||||
private Boolean auto_mapping;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package org.nl.wms.dispatch_manage.task.handler.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.dispatch_manage.task.handler.AbstractTask;
|
||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/5/6 14:34
|
||||
* 出库任务入库任务
|
||||
*/
|
||||
@Service
|
||||
public class ConveyorOutStorageTask extends AbstractTask {
|
||||
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private ISysParamService iSysParamService;
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService iStIvtStructattrService;
|
||||
@Autowired
|
||||
private IMdPbVehicleMaterService iMdPbVehicleMaterService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public JSONObject createTask(JSONObject from) {
|
||||
String vehicle_code = from.getString("vehicle_code");
|
||||
String outbound = from.getJSONObject("form_data").getString("outbound");
|
||||
String start_point = from.getString("start_point");
|
||||
String task_type = from.getString("task_type");
|
||||
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(start_point)||StringUtils.isEmpty(outbound)){
|
||||
throw new BadRequestException("创建任务失败:方法请求参数不能为空");
|
||||
}
|
||||
List<SchBaseTask> list = taskService.list(new QueryWrapper<SchBaseTask>().eq("vehicle_code", vehicle_code)
|
||||
.ne("status", StatusEnum.FORM_STATUS.code("完成")));
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
throw new BadRequestException("当前载具存在任务:"+list.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
|
||||
}
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setId(IdUtil.getStringId());
|
||||
task.setSource_form_id(from.getString("id"));
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
||||
task.setHandle_class(this.getClass().getName());
|
||||
task.setAcs_type(StatusEnum.ACS_TYPE.code("立库"));
|
||||
task.setCreate_time(DateUtil.now());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setTask_type(task_type);
|
||||
task.setVehicle_code(vehicle_code);
|
||||
task.setPoint_code1(start_point);
|
||||
task.setPoint_code2(outbound);
|
||||
taskService.create(task);
|
||||
iMdPbVehicleMaterService.update(new LambdaUpdateWrapper<MdPbVehicleMater>()
|
||||
.set(MdPbVehicleMater::getTask_code,task.getTask_code())
|
||||
.eq(MdPbVehicleMater::getVehicle_code,task.getVehicle_code()));
|
||||
return (JSONObject) JSON.toJSON(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(JSONObject data) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -44,9 +44,9 @@ public class InStorageTask extends AbstractTask {
|
||||
public JSONObject createTask(JSONObject from) {
|
||||
String vehicle_code = from.getString("vehicle_code");
|
||||
String struct_code = from.getString("struct_code");
|
||||
String target_point = from.getString("target_point");
|
||||
String start_point = from.getString("start_point");
|
||||
String task_type = from.getString("task_type");
|
||||
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(target_point)||StringUtils.isEmpty(struct_code)){
|
||||
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(start_point)||StringUtils.isEmpty(struct_code)){
|
||||
throw new BadRequestException("创建任务失败:方法请求参数不能为空");
|
||||
}
|
||||
List<SchBaseTask> list = taskService.list(new QueryWrapper<SchBaseTask>().eq("vehicle_code", vehicle_code)
|
||||
@@ -65,7 +65,7 @@ public class InStorageTask extends AbstractTask {
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setTask_type(task_type);
|
||||
task.setVehicle_code(vehicle_code);
|
||||
task.setPoint_code1(target_point);
|
||||
task.setPoint_code1(start_point);
|
||||
task.setPoint_code2(struct_code);
|
||||
taskService.create(task);
|
||||
iMdPbVehicleMaterService.update(new LambdaUpdateWrapper<MdPbVehicleMater>()
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.nl.wms.flow_manage.flow.controller.execution;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -10,14 +9,11 @@ import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.early_manage.service.early_dtl.dao.AlmEarlyDtl;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IFlowOperationService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.StartProcessInstanceVo;
|
||||
import org.nl.wms.flow_manage.flow.service.history.IActHiExecutionService;
|
||||
import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -98,7 +94,7 @@ public class ExecutionController {
|
||||
|
||||
@GetMapping(value = "/confirm/{proc_inst_id}")
|
||||
public ResponseEntity<Object> flowConfirm(@PathVariable String proc_inst_id) {
|
||||
return new ResponseEntity<>(flowOperationService.flowConfirm(proc_inst_id, null), HttpStatus.OK);
|
||||
return new ResponseEntity<>(flowOperationService.flowConfirm(proc_inst_id, null, null), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/queryByParentId/{id}")
|
||||
|
||||
@@ -23,6 +23,7 @@ public class StartEventConverter extends BaseNodeConverter {
|
||||
start.setName(properties.getString("name"));
|
||||
start.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
start.setForm_type(properties.getString("form_type"));
|
||||
start.setPassNode(properties.getBoolean("passNode"));
|
||||
start.setExecutionListeners(null);
|
||||
start.setSkipExpression(properties.getString("skipExpression"));
|
||||
|
||||
@@ -26,6 +26,8 @@ public class SubProcessConverter extends BaseNodeConverter {
|
||||
subProcess.setType(node.getString("type"));
|
||||
subProcess.setChildren(node.getJSONArray("children").toJavaList(String.class));
|
||||
subProcess.setName(properties.getString("name"));
|
||||
subProcess.setSplit(properties.getString("split"));
|
||||
subProcess.setSplitSwitch(properties.getBoolean("splitSwitch"));
|
||||
subProcess.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
subProcess.setExecutionListeners(null);
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
@@ -9,7 +10,9 @@ import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBeh
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.operation.impl.SequenceFlowOperation;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode.StartEvent;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
@@ -57,14 +60,18 @@ public class StartEventActivityBehavior extends FlowNodeActivityBehavior {
|
||||
execution.setCreate_time(DateUtil.now());
|
||||
execution.setStatus(StatusEnum.FLOW_STATUS.code("启动"));
|
||||
iActRuExecutionService.save(execution);
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("update ")
|
||||
.append(entity.getForm_type())
|
||||
.append(" set status = ")
|
||||
.append("'"+StatusEnum.FORM_STATUS.code("执行中")+"'")
|
||||
.append(" where id = ")
|
||||
.append("'"+entity.getForm_id()+"'");
|
||||
iPmFormDataService.dynamicSql(sql.toString());
|
||||
StartEvent currentFlowElement = (StartEvent)entity.getCurrentFlowElement();
|
||||
String form_type = currentFlowElement.getForm_type();
|
||||
if (StringUtils.isNotEmpty(form_type)){
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("update ")
|
||||
.append(entity.getForm_type())
|
||||
.append(" set status = ")
|
||||
.append("'"+StatusEnum.FORM_STATUS.code("执行中")+"'")
|
||||
.append(" where id = ")
|
||||
.append("'"+entity.getForm_id()+"'");
|
||||
iPmFormDataService.dynamicSql(sql.toString());
|
||||
}
|
||||
Consumer callback = entity.getCallback();
|
||||
if (callback!=null){
|
||||
callback.accept(execution.getProc_inst_id());
|
||||
|
||||
@@ -1,38 +1,25 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.BpmnJSONConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.unify.impl.StartInstanceCmd;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode.StartEvent;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.SubProcess.SubProcess;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
@@ -62,30 +49,32 @@ public class SubProcessActivityBehavior extends FlowNodeActivityBehavior<JSONObj
|
||||
|
||||
JSONObject form = entity.getT();
|
||||
JSONArray items = (JSONArray)form.get("item");
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
//基于明细id拆分还是继续vehicle_code拆分
|
||||
List<JSONObject> subList = new ArrayList<>();
|
||||
Map<String, JSONObject> tmpMap = new HashMap<>();
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
JSONObject item = items.getJSONObject(i);
|
||||
JSONObject t = (JSONObject)item.remove("t");
|
||||
String[] vehicle_codes = t.getString("vehicle_code").split(",");
|
||||
for (String vehicle_code : vehicle_codes) {
|
||||
JSONObject subt = new JSONObject();
|
||||
subt.putAll(t);
|
||||
subt.put("vehicle_code",vehicle_code);
|
||||
JSONObject sub = new JSONObject();
|
||||
sub.putAll(item);
|
||||
sub.put("t",subt);
|
||||
subList.add(sub);
|
||||
if (tmpMap.get(vehicle_code) == null){
|
||||
tmpMap.put(vehicle_code,sub);
|
||||
List<Object> subList = new ArrayList<>();
|
||||
String splitParam = subProcess.getSplit();
|
||||
if (StringUtils.isNotEmpty(splitParam)){
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
JSONObject item = items.getJSONObject(i);
|
||||
JSONObject t = (JSONObject)item.remove("t");
|
||||
String[] splits = t.getString(splitParam).split(",");
|
||||
for (String splitValue : splits) {
|
||||
JSONObject subt = new JSONObject();
|
||||
subt.putAll(t);
|
||||
subt.put(splitParam,splitValue);
|
||||
JSONObject sub = new JSONObject();
|
||||
sub.putAll(item);
|
||||
sub.put("t",subt);
|
||||
subList.add(sub);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
subList.addAll(items);
|
||||
}
|
||||
|
||||
//现在子流程跟载具有关后续可以通过配置拆分字段:vehicle_code跟拆分规则实现
|
||||
System.out.println("子流程数据合并结果:"+subList.size()+"__"+tmpMap.size());
|
||||
if (!CollectionUtils.isEmpty(tmpMap)){
|
||||
System.out.println("子流程数据合并结果:"+subList.size());
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
if (!CollectionUtils.isEmpty(subList)){
|
||||
// for (JSONObject o : subList) {
|
||||
// ExecutionEntity subEntity = new ExecutionEntity();
|
||||
// subEntity.setParent_id(entity.getProc_inst_id());
|
||||
@@ -98,7 +87,7 @@ public class SubProcessActivityBehavior extends FlowNodeActivityBehavior<JSONObj
|
||||
// commandExecutor.execute(new StartInstanceCmd(), subEntity);
|
||||
// }
|
||||
//子流程并行,子流程单一的时候直接串行
|
||||
tmpMap.values().stream().map((Function<Object, CompletableFuture>) o -> CompletableFuture.runAsync(() -> {
|
||||
subList.stream().map((Function<Object, CompletableFuture>) o -> CompletableFuture.runAsync(() -> {
|
||||
ExecutionEntity subEntity = new ExecutionEntity();
|
||||
subEntity.setParent_id(entity.getProc_inst_id());
|
||||
subEntity.setForm_id(entity.getForm_id());
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.entity;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.*;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
@@ -17,6 +14,7 @@ import java.util.List;
|
||||
* 流程传输数据
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class ExecutionDto {
|
||||
|
||||
@@ -22,6 +22,7 @@ public class StartEvent extends FlowNode {
|
||||
|
||||
protected String skipExpression;
|
||||
protected FlowElement targetFlowElement;
|
||||
protected String form_type;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ public class SubProcess extends FlowNode {
|
||||
|
||||
protected List<FlowElement> flowElementList = new ArrayList<>();
|
||||
|
||||
protected String split;
|
||||
|
||||
protected Boolean splitSwitch;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
|
||||
item = data.getJSONArray("item");
|
||||
}
|
||||
BmFormStruc item_struc = iBmFormStrucService.getOne(new QueryWrapper<BmFormStruc>().eq("parent_id",form_struc.getId()));
|
||||
if (item_struc != null){
|
||||
if (item_struc != null && item_struc.getAuto_mapping()){
|
||||
if (item==null){
|
||||
//暂定:强制校验
|
||||
throw new BadRequestException("当前数据存在明细且目标单据:"+form_struc.getForm_type()+" 未配置明细表");
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.nl.wms.flow_manage.flow.service.execution;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionDto;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.StartProcessInstanceVo;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -18,5 +17,5 @@ public interface IFlowOperationService {
|
||||
String startUp(String model_key, Consumer callback,ExecutionDto dto,JSONObject auxParam);
|
||||
|
||||
|
||||
Boolean flowConfirm(String proc_inst_id,JSONObject auxParam);
|
||||
Boolean flowConfirm(String proc_inst_id,JSONObject auxParam,ExecutionDto dto);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.flow_manage.flow.service.execution.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -19,7 +20,6 @@ import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IFlowOperationService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.StartProcessInstanceVo;
|
||||
import org.nl.wms.flow_manage.flow.service.model.IActDeModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -79,7 +79,7 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean flowConfirm(String proc_inst_id,JSONObject auxParam) {
|
||||
public Boolean flowConfirm(String proc_inst_id, JSONObject auxParam, ExecutionDto dto) {
|
||||
if (StringUtils.isNotEmpty(proc_inst_id)){
|
||||
//当前流程
|
||||
ActRuExecution execution = iActRuExecutionService.getOne(new QueryWrapper<ActRuExecution>()
|
||||
@@ -109,14 +109,18 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
||||
flowNode.setAuxParam(auxParam);
|
||||
}
|
||||
ExecutionEntity entity = new ExecutionEntity();
|
||||
entity.setCurrentFlowElement(flowNode);
|
||||
entity.setCurrentFlowElement(flowNode);
|
||||
entity.setProc_inst_id(execution.getProc_inst_id());
|
||||
entity.setParent_id(execution.getParent_id());
|
||||
entity.setForm_type(execution.getForm_type());
|
||||
entity.setForm_id(execution.getForm_id());
|
||||
entity.setStartActivityId(execution.getActivity_id());
|
||||
entity.setDeploymentId(execution.getDeployment_id());
|
||||
if (dto!=null){
|
||||
entity.setT(JSON.toJSON(dto));
|
||||
}else {
|
||||
entity.setT(execution.getForm_data());
|
||||
entity.setProc_inst_id(execution.getProc_inst_id());
|
||||
entity.setParent_id(execution.getParent_id());
|
||||
entity.setForm_type(execution.getForm_type());
|
||||
entity.setForm_id(execution.getForm_id());
|
||||
entity.setStartActivityId(execution.getActivity_id());
|
||||
entity.setDeploymentId(execution.getDeployment_id());
|
||||
}
|
||||
//如果流程执行异常:需要重新执行,如果执行中则走下一步
|
||||
commandExecutor.execute(new ExeInstanceCmd(execution.getStatus()),entity);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.wms.flow_manage.monitor;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.publish.AbstraceListener;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IFlowOperationService;
|
||||
import org.nl.wms.flow_manage.monitor.event.FlowContinueEvent;
|
||||
import org.nl.wms.flow_manage.monitor.event.FlowStartEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/5/17 15:27
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FlowContinueEventListener extends AbstraceListener<FlowContinueEvent> {
|
||||
|
||||
@Autowired
|
||||
private IFlowOperationService flowOperationService;
|
||||
|
||||
@Override
|
||||
protected String doEvent(FlowContinueEvent event) {
|
||||
String s = JSON.toJSONString(event.getDto());
|
||||
log.info("触发流程"+ s);
|
||||
flowOperationService.flowConfirm(event.getProc_inst_id(), event.getAuxParam(),event.getDto());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.nl.wms.flow_manage.monitor.event;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.publish.event.PublishEvent;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/5/17 15:02
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class FlowContinueEvent extends PublishEvent {
|
||||
//数据传输
|
||||
private ExecutionDto dto;
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
/**
|
||||
* 流程实例全局数据
|
||||
*/
|
||||
private JSONObject auxParam;
|
||||
|
||||
public FlowContinueEvent(String proc_inst_id, Consumer callback, JSONObject auxParam) {
|
||||
this.proc_inst_id = proc_inst_id;
|
||||
this.auxParam = auxParam;
|
||||
this.setCallback(callback);
|
||||
}
|
||||
|
||||
public FlowContinueEvent setDto(ExecutionDto dto) {
|
||||
this.dto = dto;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -39,6 +40,14 @@ public class PmFormDataController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(formDataService.queryTree(query,page)), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
if (ids.length > 0) {
|
||||
formDataService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getSonFormData/{id}")
|
||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
||||
//参数判读,参数解析,调用参数入库
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.nl.wms.pm_manage.form_data.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
@@ -38,4 +37,7 @@ public interface IPmFormDataService extends IService<PmFormData> {
|
||||
Object getSonDtlFormData(String id);
|
||||
|
||||
void dynamicSql(String sql);
|
||||
|
||||
List<PmFormData> getByParentId(String parent_id);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@@ -224,5 +222,11 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
this.baseMapper.dynamicSql(sql);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmFormData> getByParentId(String parent_id) {
|
||||
Assert.notNull(parent_id,"请求参数不能为空");
|
||||
return this.list(new QueryWrapper<PmFormData>().eq("parent_id",parent_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package org.nl.wms.stor_manage.pick.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.stor_manage.pick.service.PickingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -23,26 +28,46 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class PickingController {
|
||||
|
||||
@Autowired
|
||||
private IPmFormDataService formDataService;
|
||||
private IPmFormDataService iPmFormDataService;
|
||||
@Autowired
|
||||
private PickingService pickingService;
|
||||
|
||||
|
||||
@GetMapping()
|
||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(formDataService.queryTree(query,page)), HttpStatus.CREATED);
|
||||
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query,page)), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@GetMapping("/getSonFormData/{id}")
|
||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
||||
//参数判读,参数解析,调用参数入库
|
||||
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
||||
return new ResponseEntity<>(formDataService.getSonDtlFormData(id),HttpStatus.OK);
|
||||
return new ResponseEntity<>(iPmFormDataService.getSonDtlFormData(id),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/sync/{type}")
|
||||
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
||||
//参数判读,参数解析,调用参数入库
|
||||
formDataService.syncFormData("type", formDtl);
|
||||
iPmFormDataService.syncFormData("type", formDtl);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@PostMapping("/savePickTask")
|
||||
public ResponseEntity<Object> savePickTask(@RequestBody JSONArray params) {
|
||||
pickingService.savePickTask(params);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@PostMapping("/updateStatus")
|
||||
public ResponseEntity<Object> updateStatus(@RequestBody JSONObject param) {
|
||||
//TODO:明细校验
|
||||
iPmFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
.set("status",param.getString("status"))
|
||||
.eq("id",param.getString("id")));
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@PostMapping("/taskOpen")
|
||||
public ResponseEntity<Object> taskOpen(@RequestBody JSONObject param) {
|
||||
pickingService.taskOpen(param);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
package org.nl.wms.stor_manage.pick.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.vehicle.service.IBmVehicleInfoService;
|
||||
import org.nl.wms.base_manage.vehicle.service.dao.BmVehicleInfo;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionDto;
|
||||
import org.nl.wms.flow_manage.monitor.event.FlowContinueEvent;
|
||||
import org.nl.wms.flow_manage.monitor.event.FlowStartEvent;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.stor_manage.io.service.iostor.dao.StIvtIostorinv;
|
||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.dto.StIvtIostorinvdtlVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/6/17 21:25
|
||||
*/
|
||||
@Service
|
||||
public class PickingService {
|
||||
@Autowired
|
||||
private IPmFormDataService iFormDataService;
|
||||
@Autowired
|
||||
private IMdPbVehicleMaterService iMdPbVehicleMaterService;
|
||||
@Autowired
|
||||
private IMdGruopDickService iMdGruopDickService;
|
||||
@Autowired
|
||||
private IBmVehicleInfoService iBmVehicleInfoService;
|
||||
|
||||
/**
|
||||
* 生成拣选任务
|
||||
* @param params
|
||||
*/
|
||||
@Transactional
|
||||
public void savePickTask(JSONArray params){
|
||||
String now = DateUtil.now();
|
||||
String user = SecurityUtils.getCurrentNickName();
|
||||
PmFormData dtl = iFormDataService.getById((String)((Map) params.get(0)).get("parent_id"));
|
||||
MdPbVehicleMater one = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
|
||||
.eq("vehicle_code", dtl.getVehicle_code()).eq("material_id", dtl.getMaterial_id()));
|
||||
if (one==null){
|
||||
throw new BadRequestException("拣选明细载具物料信息不存在");
|
||||
}
|
||||
Set<Object> vehicleCodes = params.stream().map(a -> ((Map) a).get("vehicle_code")).collect(Collectors.toSet());
|
||||
int vCode = iBmVehicleInfoService.count(new QueryWrapper<BmVehicleInfo>().in("vehicle_code", vehicleCodes));
|
||||
if (vCode!=vehicleCodes.size()){
|
||||
throw new BadRequestException("载具编码不存在");
|
||||
}
|
||||
vehicleCodes.remove(one.getVehicle_code());
|
||||
int mCode = iMdPbVehicleMaterService.count(new QueryWrapper<MdPbVehicleMater>().in("vehicle_code", vehicleCodes));
|
||||
if (mCode>0){
|
||||
throw new BadRequestException("当前载具以存在载具物料信息");
|
||||
}
|
||||
for (Object param : params) {
|
||||
JSONObject task = new JSONObject((Map) param);
|
||||
PmFormData data = task.toJavaObject(PmFormData.class);
|
||||
if (StringUtils.isEmpty(data.getParent_id())||StringUtils.isEmpty(data.getVehicle_code())){
|
||||
throw new BadRequestException("创建失败:缺少参数");
|
||||
}
|
||||
String task_type = data.getForm_data().getString("task_type");
|
||||
if (StringUtils.isEmpty(task_type)){
|
||||
throw new BadRequestException("创建失败:未配置任务类型");
|
||||
}
|
||||
data.setCreate_time(now);
|
||||
data.setCreate_name(user);
|
||||
data.setId(IdUtil.getStringId());
|
||||
iFormDataService.save(data);
|
||||
String vehicle_code = data.getVehicle_code();
|
||||
if (dtl.getVehicle_code().equals(vehicle_code)){
|
||||
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||
.set("frozen_qty",0).set("update_time",now)
|
||||
.set("update_name", user)
|
||||
.set("qty",data.getQty())
|
||||
.eq("vehicle_code",vehicle_code));
|
||||
}else {
|
||||
MdGruopDick dick = new MdGruopDick();
|
||||
dick.setVehicle_code(vehicle_code);
|
||||
dick.setSource_form_type("Picking_Task");
|
||||
dick.setSource_form_id(data.getId());
|
||||
dick.setCreate_name(user);
|
||||
dick.setCreate_time(now);
|
||||
dick.setStatus(StatusEnum.FORM_STATUS.code("完成"));
|
||||
dick.setCode(CodeUtil.getNewCode("md_group_dick"));
|
||||
dick.setId(IdUtil.getStringId());
|
||||
MdPbVehicleMater mater = new MdPbVehicleMater();
|
||||
mater.setMaterial_id(one.getMaterial_id());
|
||||
mater.setPcsn(one.getPcsn());
|
||||
mater.setQty(data.getQty());
|
||||
mater.setUnit_id(data.getUnit_id());
|
||||
mater.setVehicle_code(vehicle_code);
|
||||
//设置目标仓库
|
||||
mater.setStor_code(data.getForm_data().getString("stor_code"));
|
||||
mater.setHas_child(false);
|
||||
mater.setId(IdUtil.getStringId());
|
||||
mater.setGroup_id(dick.getId());
|
||||
mater.setCreate_name(user);
|
||||
mater.setCreate_time(now);
|
||||
mater.setSource_form_type("Picking_Task");
|
||||
mater.setSource_form_id(data.getId());
|
||||
mater.setForm_data(one.getForm_data());
|
||||
mater.setStor_code(one.getStor_code());
|
||||
iMdPbVehicleMaterService.save(mater);
|
||||
iMdGruopDickService.save(dick);
|
||||
}
|
||||
}
|
||||
iFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
.set("status",StatusEnum.FORM_STATUS.code("已分配")));
|
||||
}
|
||||
|
||||
|
||||
public void taskOpen(JSONObject form){
|
||||
PmFormData mst = form.toJavaObject(PmFormData.class);
|
||||
if (StringUtils.isEmpty(mst.getProc_inst_id())){
|
||||
throw new BadRequestException("当前单据不存在流程实例id");
|
||||
}
|
||||
JSONObject mstJ = (JSONObject) JSON.toJSON(mst);
|
||||
ExecutionDto dto = new ExecutionDto();
|
||||
dto.setForm_id(mst.getId());
|
||||
dto.setForm_type(mst.getForm_type());
|
||||
dto.setSource_form_type(mst.getSource_form_type());
|
||||
dto.setSource_form_id(mst.getSource_form_id());
|
||||
dto.setT(mstJ);
|
||||
dto.setItem(packageT(mstJ,"id"));
|
||||
|
||||
BussEventMulticaster.Publish(new FlowContinueEvent(mst.getProc_inst_id(), o -> iFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
.set("status",StatusEnum.FORM_STATUS.code("执行中"))
|
||||
.eq("id",mst.getId())), null)
|
||||
.setDto(dto));
|
||||
|
||||
}
|
||||
private List<ExecutionDto> packageT(JSONObject current,String itemField){
|
||||
String id = current.getString(itemField);
|
||||
List<PmFormData> items = iFormDataService.getByParentId(id);
|
||||
if (!CollectionUtils.isEmpty(items)){
|
||||
List<ExecutionDto> list = new ArrayList<>();
|
||||
for (PmFormData item : items) {
|
||||
JSONObject itemJ = (JSONObject) JSON.toJSON(item);
|
||||
ExecutionDto itemDto = new ExecutionDto();
|
||||
itemDto.setT(itemJ);
|
||||
itemDto.setForm_id(item.getId());
|
||||
itemDto.setForm_type(item.getForm_type());
|
||||
itemDto.setSource_form_type(item.getSource_form_type());
|
||||
itemDto.setSource_form_id(item.getSource_form_id());
|
||||
itemDto.setItem(packageT(itemJ,itemField));
|
||||
list.add(itemDto);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,6 @@ const user = {
|
||||
const rememberMe = userInfo.rememberMe
|
||||
return new Promise((resolve, reject) => {
|
||||
login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => {
|
||||
debugger
|
||||
setToken(res.token, rememberMe)
|
||||
commit('SET_TOKEN', res.token)
|
||||
setUserInfo(res.user, commit)
|
||||
|
||||
@@ -319,7 +319,7 @@ export default {
|
||||
this.vehicledis.push({ vehicle_code: '', qty: 0 })
|
||||
},
|
||||
subRow(index,row){
|
||||
this.vehicledis.slice(index,1)
|
||||
this.vehicledis.splice(index,1)
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="拣选作业"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="savePickMst">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="closeDialog">关闭</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" size="mini" label-width="100px" label-suffix=":">
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
@@ -58,12 +60,12 @@
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in formStatus"
|
||||
v-for="item in statusEnum.FORM_STATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
|
||||
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="create_time">
|
||||
<!-- <el-date-picker v-model="form.create_time" type="date" placeholder="选择日期" style="width: 210px"-->
|
||||
@@ -78,7 +80,7 @@
|
||||
</template>
|
||||
</el-form>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span2">作业明细</span>
|
||||
<span class="role-span">拣选明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
@@ -94,19 +96,29 @@
|
||||
@current-change="handleDtlCurrentChange"
|
||||
>
|
||||
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
|
||||
|
||||
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
|
||||
<el-table-column prop="assign_qty" label="拣选数量" show-overflow-tooltip/>
|
||||
<el-table-column prop="assign_qty" label="拣选数量" show-overflow-tooltip width="120"/>
|
||||
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-select disabled v-model="tableDtl[scope.$index].unit_id"
|
||||
class="filter-item" placeholder="单位" size="small" style="width: 90px">
|
||||
<el-option
|
||||
v-for="item in unitDict"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" label="拣选载具" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
|
||||
<template slot-scope="scope">
|
||||
<template v-for="item in formStatus">
|
||||
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
|
||||
</template>
|
||||
{{ statusEnum.label.FORM_STATUS[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="source_form_id" label="业务单据id" show-overflow-tooltip width="120"/>
|
||||
@@ -121,73 +133,190 @@
|
||||
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">作业明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="right"/>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addPickTask()"
|
||||
>
|
||||
新增一行
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="savePickTask()"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tabledis"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
size="mini"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="90"/>
|
||||
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="tabledis[scope.$index].qty" clearable style="width: 120px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="tabledis[scope.$index].unit_id"
|
||||
class="filter-item" placeholder="单位" size="small" style="width: 90px">
|
||||
<el-option
|
||||
v-for="item in unitDict"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" label="周转载具" show-overflow-tooltip width="120" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tabledis[scope.$index].vehicle_code" clearable />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in disCols" :key="item.value"
|
||||
:label="item.lable">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-if="item.value == 'is_artificiality'"
|
||||
v-model="tabledis[scope.$index].form_data[item.value]"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
:active-value=true
|
||||
:inactive-valu=false
|
||||
/>
|
||||
<el-select v-if="item.value == 'task_type'"
|
||||
v-model="tabledis[scope.$index].form_data[item.value]"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="任务类型"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
@change="changeTaskType(scope.$index,tabledis[scope.$index].form_data[item.value])"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in PickTaskType"
|
||||
:key="item.key"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-if="item.value == 'outbound'"
|
||||
v-model="tabledis[scope.$index].form_data[item.value]"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="出库口"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in outboundList"
|
||||
:key="item.key"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="subRow(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {crud} from '@crud/crud'
|
||||
import crudFormData, {getSonFormData} from './formData'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import crudFormData, {inDecision} from "./formData";
|
||||
import pick from "./pick";
|
||||
import measureunit from '@/views/wms/base_manage/measure/measureunit'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: {formstruc},
|
||||
name: 'TaskDialog',
|
||||
components: { },
|
||||
mixins: [crud()],
|
||||
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
|
||||
dicts: ['IO_BILL_STATUS', 'VEHICLE_OVER_TYPE', 'PCS_SAL_TYPE'],
|
||||
statusEnums: [ 'IOBILL_TYPE_OUT','FORM_STATUS' ],
|
||||
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#stor_code' ],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
openParam: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
storId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
divflag: false,
|
||||
cols: [],
|
||||
dtlCols: [],
|
||||
dialogVisible: false,
|
||||
unitDict: [],
|
||||
disCols: [],
|
||||
disFormData: [],
|
||||
tableDtl: [],
|
||||
tabledis: [],
|
||||
billtypelist: [],
|
||||
storlist: [],
|
||||
currentdtl: null,
|
||||
currentDis: {},
|
||||
vehicledis: [],
|
||||
vehicleform:{},
|
||||
un_assign_qty:0,
|
||||
currentDtl: null,
|
||||
PickTaskType:[
|
||||
{"label":"拣选回库","value":"13"},{"label":"拣选出库","value":"23"}
|
||||
],
|
||||
outboundList:[
|
||||
{"label":"一楼出库口","value":"1101"},{"label":"二楼出库口","value":"2114"}
|
||||
],
|
||||
form: {},
|
||||
formStatus: [
|
||||
{
|
||||
value: '10',
|
||||
label: '生成'
|
||||
},
|
||||
{
|
||||
value: '20',
|
||||
label: '执行中'
|
||||
},
|
||||
{
|
||||
value: '99',
|
||||
label: '完成'
|
||||
}
|
||||
]
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.form = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form = row
|
||||
@@ -198,62 +327,103 @@ export default {
|
||||
formstruc.getHeader(dtl_form_type).then(res => {
|
||||
this.dtlCols = res
|
||||
})
|
||||
formstruc.getHeader("Picking_Task").then(res => {
|
||||
this.disCols = res
|
||||
res.forEach(a => {
|
||||
this.disFormData[a.value,'']
|
||||
})
|
||||
}),
|
||||
measureunit.getSelect().then(res => {
|
||||
this.unitDict = res.content
|
||||
})
|
||||
this.queryTableDtl(row.id)
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
addPickTask(){
|
||||
let dis_assign_qty = 0;
|
||||
this.tabledis.forEach(a=>{
|
||||
dis_assign_qty = dis_assign_qty+a.qty
|
||||
})
|
||||
if (!this.currentDtl) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
let dtl = {};
|
||||
dtl.material_id = this.currentDtl.material_id
|
||||
dtl.material_name = this.currentDtl.material_name
|
||||
dtl.material_spec = this.currentDtl.material_spec
|
||||
dtl.material_pcsn = this.currentDtl.material_pcsn
|
||||
dtl.qty = this.currentDtl.assign_qty-dis_assign_qty
|
||||
dtl.pcsn = this.currentDtl.pcsn
|
||||
dtl.unit_id = this.currentDtl.unit_id
|
||||
dtl.form_type = 'Picking_Task'
|
||||
dtl.source_form_type = this.currentDtl.source_form_type
|
||||
dtl.source_form_id = this.currentDtl.id
|
||||
dtl.source_form_date = this.currentDtl.create_time
|
||||
dtl.parent_id = this.currentDtl.id
|
||||
dtl.form_data = {}
|
||||
this.disFormData.forEach(a => {
|
||||
dtl.form_data[a.value,'']
|
||||
})
|
||||
this.tabledis.push(dtl)
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
statusFormat(row) {
|
||||
return this.dict.label.status[row.status]
|
||||
},
|
||||
work_statusFormat(row) {
|
||||
return this.dict.label.work_status[row.work_status]
|
||||
subRow(index){
|
||||
this.tabledis.splice(this.tabledis.indexOf(index),1)
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.tabledis = []
|
||||
this.currentdtl = current
|
||||
this.queryTableDdis()
|
||||
this.currentDtl = current
|
||||
this.queryTableDis()
|
||||
} else {
|
||||
this.tabledis = []
|
||||
this.currentdtl = {}
|
||||
this.currentDtl = {}
|
||||
}
|
||||
},
|
||||
invtypeFormat(row, column) {
|
||||
for (const item of this.billtypelist) {
|
||||
if (item.code === row.source_bill_type) {
|
||||
return item.name
|
||||
}
|
||||
changeTaskType(index,taskType) {
|
||||
if (taskType == "13"){
|
||||
let dis_assign_qty = 0;
|
||||
this.tabledis.forEach(a=>{
|
||||
dis_assign_qty = dis_assign_qty+a.qty
|
||||
})
|
||||
this.tabledis[index].qty = this.currentDtl.qty-dis_assign_qty
|
||||
}
|
||||
},
|
||||
handleDisCurrentChange(current) {
|
||||
this.currentDis = current
|
||||
savePickTask() {
|
||||
pick.savePickTask(this.tabledis).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
|
||||
queryTableDtl(id) {
|
||||
crudFormData.getSonFormData(id).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
queryTableDdis() {
|
||||
if (this.currentdtl !== null) {
|
||||
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
|
||||
queryTableDis() {
|
||||
if (this.currentDtl !== null) {
|
||||
crudFormData.getSonFormData(this.currentDtl.id).then(res => {
|
||||
this.tabledis = res
|
||||
}).catch(() => {
|
||||
this.tabledis = []
|
||||
})
|
||||
}
|
||||
},
|
||||
formatStatus(row) {
|
||||
return this.dict.label.status[row.status]
|
||||
closeDialog(){
|
||||
this.dialogVisible = false
|
||||
this.tabledis = []
|
||||
this.tableDtl = []
|
||||
},
|
||||
formatBaseType(row) {
|
||||
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
|
||||
savePickMst(){
|
||||
pick.updateStatus({"status":"13","id":this.form.id})
|
||||
this.closeDialog()
|
||||
},
|
||||
close() {
|
||||
this.form.tableMater = []
|
||||
this.form.dtl_row = null
|
||||
this.form.bucketunique = null
|
||||
this.sectProp = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('AddChanged')
|
||||
this.crud.refresh()
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -273,12 +443,18 @@ export default {
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span2 {
|
||||
padding: 0px 0px 20px 0px;
|
||||
.crud-opts2 .role-span {
|
||||
padding: 10px 0px 10px 0px;
|
||||
}
|
||||
|
||||
.crud-opts2 {
|
||||
padding: 10px 0px 0px 50px;
|
||||
.crud-opts2 .crud-opts-form {
|
||||
padding: 10px 0px 0px 20px;
|
||||
}
|
||||
.crud-opts-right2 {
|
||||
padding-left: 77%;
|
||||
}
|
||||
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -109,8 +109,87 @@
|
||||
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">作业明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tabledis"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
size="mini"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="90"/>
|
||||
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip width="150"/>
|
||||
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-select disabled v-model="tabledis[scope.$index].unit_id"
|
||||
class="filter-item" placeholder="单位" size="small" style="width: 90px">
|
||||
<el-option
|
||||
v-for="item in unitDict"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column disabled prop="vehicle_code" label="周转载具" show-overflow-tooltip width="120" />
|
||||
<el-table-column show-overflow-tooltip v-for="(item, index) in disCols" :key="item.value"
|
||||
:label="item.lable">
|
||||
<template slot-scope="scope">
|
||||
<el-switch disabled v-if="item.value == 'is_artificiality'"
|
||||
v-model="tabledis[scope.$index].form_data[item.value]"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
:active-value=true
|
||||
:inactive-valu=false
|
||||
/>
|
||||
<el-select disabled v-if="item.value == 'task_type'"
|
||||
v-model="tabledis[scope.$index].form_data[item.value]"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="任务类型"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
@change="changeTaskType(scope.$index,tabledis[scope.$index].form_data[item.value])"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in PickTaskType"
|
||||
:key="item.key"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select disabled v-if="item.value == 'outbound'"
|
||||
v-model="tabledis[scope.$index].form_data[item.value]"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="出库口"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in outboundList"
|
||||
:key="item.key"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -136,14 +215,22 @@ export default {
|
||||
return {
|
||||
cols: [],
|
||||
dtlCols: [],
|
||||
disCols: [],
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
tabledis: [],
|
||||
disFormData: {},
|
||||
billtypelist: [],
|
||||
storlist: [],
|
||||
currentdtl: null,
|
||||
currentDis: {},
|
||||
form: {},
|
||||
PickTaskType:[
|
||||
{"label":"拣选回库","value":"13"},{"label":"拣选出库","value":"23"}
|
||||
],
|
||||
outboundList:[
|
||||
{"label":"一楼出库口","value":"1101"},{"label":"二楼出库口","value":"2114"}
|
||||
],
|
||||
formStatus: [
|
||||
{
|
||||
value: '10',
|
||||
@@ -186,6 +273,12 @@ export default {
|
||||
formstruc.getHeader(dtl_form_type).then(res => {
|
||||
this.dtlCols = res
|
||||
})
|
||||
formstruc.getHeader("Picking_Task").then(res => {
|
||||
this.disCols = res
|
||||
res.forEach(a => {
|
||||
this.disFormData[a.value,'']
|
||||
})
|
||||
}),
|
||||
this.queryTableDtl(row.id)
|
||||
},
|
||||
close() {
|
||||
@@ -204,10 +297,10 @@ export default {
|
||||
return this.dict.label.work_status[row.work_status]
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
debugger
|
||||
if (current !== null) {
|
||||
this.tabledis = []
|
||||
this.currentdtl = current
|
||||
this.queryTableDdis()
|
||||
this.queryTableDis(this.currentdtl.id)
|
||||
} else {
|
||||
this.tabledis = []
|
||||
this.currentdtl = {}
|
||||
@@ -228,14 +321,10 @@ export default {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
queryTableDdis() {
|
||||
if (this.currentdtl !== null) {
|
||||
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
|
||||
queryTableDis(id) {
|
||||
crudFormData.getSonFormData(id).then(res => {
|
||||
this.tabledis = res
|
||||
}).catch(() => {
|
||||
this.tabledis = []
|
||||
})
|
||||
}
|
||||
},
|
||||
formatStatus(row) {
|
||||
return this.dict.label.status[row.status]
|
||||
|
||||
@@ -69,14 +69,17 @@
|
||||
>
|
||||
拣选作业
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- icon="el-icon-view"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="hideShow"-->
|
||||
<!-- >-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="task_flag"
|
||||
@click="taskOpen"
|
||||
>
|
||||
作业下发
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -90,7 +93,7 @@
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@select="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
:data="crud.data"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
@@ -169,6 +172,7 @@ import pagination from '@crud/Pagination'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import ViewDialog from './ViewDialog'
|
||||
import TaskDialog from './TaskDialog'
|
||||
import crudPick from './pick'
|
||||
|
||||
|
||||
// import UploadDialog from './UploadDialog'
|
||||
@@ -217,6 +221,7 @@ export default {
|
||||
return {
|
||||
cols: [],
|
||||
classes: [],
|
||||
task_flag: true,
|
||||
currentRow: null,
|
||||
uploadShow: false,
|
||||
dis_flag: true,
|
||||
@@ -268,20 +273,32 @@ export default {
|
||||
this.$refs.viewDialog.setForm(row)
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.dis_flag = true
|
||||
this.currentRow = {}
|
||||
} else if (val.length === 1) {
|
||||
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length === 1) {
|
||||
this.task_flag = false
|
||||
this.dis_flag = false
|
||||
this.currentRow = row
|
||||
} else {
|
||||
this.task_flag = true
|
||||
this.dis_flag = true
|
||||
this.currentRow = null
|
||||
}
|
||||
},
|
||||
|
||||
disOpen(row) {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.taskDis.setForm(this.currentRow)
|
||||
}
|
||||
}
|
||||
},
|
||||
taskOpen(row) {
|
||||
if (this.currentRow !== null) {
|
||||
crudPick.taskopen(this.currentRow).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
49
wms_pro/qd/src/views/wms/stor_manage/warehouse/pick/pick.js
Normal file
49
wms_pro/qd/src/views/wms/stor_manage/warehouse/pick/pick.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/picking',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/picking',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/picking',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updateStatus(data) {
|
||||
return request({
|
||||
url: '/api/picking/updateStatus',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function savePickTask(data) {
|
||||
return request({
|
||||
url: 'api/picking/savePickTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function taskopen(data) {
|
||||
return request({
|
||||
url: '/api/picking/taskOpen',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {add, edit, del, savePickTask, updateStatus, taskopen}
|
||||
Reference in New Issue
Block a user