rev:组盘->流程实例关系
This commit is contained in:
@@ -22,7 +22,7 @@ public class BussEventMulticaster implements BeanPostProcessor {
|
||||
|
||||
public static Set<AbstraceListener<?>> LISTENER_SRT = new LinkedHashSet<>();
|
||||
|
||||
public final static void publish(PublishEvent event, Boolean sync){
|
||||
public final static void Publish(PublishEvent event, Boolean sync){
|
||||
if (event == null){
|
||||
return;
|
||||
}
|
||||
@@ -40,7 +40,8 @@ public class BussEventMulticaster implements BeanPostProcessor {
|
||||
}
|
||||
}
|
||||
}
|
||||
public final static void Publish(PublishEvent event){ publish(event,true); }
|
||||
public final static void Publish(PublishEvent event){
|
||||
Publish(event,true); }
|
||||
private static List<AbstraceListener<?>> getListenerByEvent(PublishEvent event){
|
||||
List<AbstraceListener<?>> list = new ArrayList<>();
|
||||
try {
|
||||
|
||||
@@ -2,9 +2,12 @@ package org.nl.config.mybatis;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import com.github.pagehelper.PageInterceptor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -36,7 +39,10 @@ public class MybatisPlusConfig {
|
||||
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
ConfigurationCustomizer mybatisConfigurationCustomizer() {
|
||||
return configuration -> configuration.addInterceptor(new PageInterceptor());
|
||||
}
|
||||
@PostConstruct
|
||||
public void datainnit(){
|
||||
String url = ((DruidDataSource) dataSource).getUrl();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class BmMeasureunitController {
|
||||
List<BmMeasureUnit> list = measureUnitService.list();
|
||||
List<Map> result = new ArrayList<>();
|
||||
for (BmMeasureUnit item : list) {
|
||||
result.add(MapOf.of("label", item.getUnit_name(), "value", item.getMeasure_unit_id()));
|
||||
result.add(MapOf.of("label", item.getUnit_name(), "value", item.getUnit_id()));
|
||||
}
|
||||
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BmMeasureUnit implements Serializable {
|
||||
* 计量单位标识
|
||||
*/
|
||||
@TableId
|
||||
private String measure_unit_id;
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BmMeasureUnitServiceImpl extends ServiceImpl<BmMeasureUnitMapper, B
|
||||
BigDecimal qty_precision = jo.getBigDecimal("qty_precision");
|
||||
boolean is_used = jo.getBoolean("is_used");
|
||||
BmMeasureUnit unit = new BmMeasureUnit();
|
||||
unit.setMeasure_unit_id(IdUtil.getStringId());
|
||||
unit.setUnit_id(IdUtil.getStringId());
|
||||
unit.setUnit_code(unit_code);
|
||||
unit.setUnit_name(unit_name);
|
||||
unit.setQty_precision(qty_precision);
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.nl.wms.base_manage.vehicle.vehicleMater.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleInfo.service.IBmVehicleInfoService;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleInfo.service.dto.VehicleQuery;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dto.VehicleMaterQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -15,6 +17,8 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表 前端控制器
|
||||
@@ -37,6 +41,13 @@ public class MdPbVehicleMaterController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbVehicleMaterService.page(page.build(), query.build())), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("getVehicleMater/{code}")
|
||||
public ResponseEntity<Object> vehicleInfo(@PathVariable String code) {
|
||||
List<MdPbVehicleMater> dick_code = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>()
|
||||
.eq("dick_code", code));
|
||||
return new ResponseEntity<>(TableDataInfo.build(dick_code), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.nl.wms.base_manage.vehicle.vehicleMater.service.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -17,7 +20,7 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_pb_vehicleMater")
|
||||
@TableName(value = "md_pb_vehicleMater", autoResultMap = true)
|
||||
public class MdPbVehicleMater implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -57,8 +60,7 @@ public class MdPbVehicleMater implements Serializable {
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 父容器
|
||||
@@ -73,16 +75,8 @@ public class MdPbVehicleMater implements Serializable {
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
private String form_data;
|
||||
|
||||
/**
|
||||
* 物料关联单据id
|
||||
*/
|
||||
private String source_form_id;
|
||||
/**
|
||||
* 物料关联单据
|
||||
*/
|
||||
private String source_form_type;
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
private JSONObject form_data;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
@@ -94,10 +88,4 @@ public class MdPbVehicleMater implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 组盘表code
|
||||
*/
|
||||
private String dick_code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -63,12 +64,26 @@ public class BmFormStrucController {
|
||||
public ResponseEntity<Object> save(@RequestBody JSONObject param){
|
||||
//参数判读,参数解析,调用参数入库
|
||||
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
||||
formStruc.setCreate_time(DateUtil.now());
|
||||
formStruc.setUpdate_time(DateUtil.now());
|
||||
formStruc.setId(IdUtil.getStringId());
|
||||
formStruc.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
formStruc.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
iBmFormStrucService.save(formStruc);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/update")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject param){
|
||||
//逻辑判断:如果有数据了则不允许修改
|
||||
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
||||
List<PmFormData> formDatas = iPmFormDataService.getByType(param.getString("form_type"));
|
||||
if (!CollectionUtils.isEmpty(formDatas)){
|
||||
throw new BadRequestException("当前表单存在数据,不允许直接修改");
|
||||
}
|
||||
formStruc.setUpdate_time(DateUtil.now());
|
||||
formStruc.setUpdate_name(SecurityUtils.getCurrentUserId());
|
||||
iBmFormStrucService.updateById(formStruc);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids){
|
||||
//参数判读,参数解析,调用参数入库
|
||||
|
||||
@@ -56,12 +56,12 @@ public class BmFormStruc implements Serializable {
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_time;
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_id;
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 业务单据单据id
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.nl.wms.flow_manage.event;
|
||||
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/5/17 15:27
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FlowEventListener extends AbstraceListener<FlowStartEvent> {
|
||||
|
||||
@Autowired
|
||||
private IFlowOperationService flowOperationService;
|
||||
|
||||
@Override
|
||||
protected String doEvent(FlowStartEvent event) {
|
||||
String s = JSON.toJSONString(event.getDto());
|
||||
log.info("触发流程"+ s);
|
||||
return flowOperationService.startUp(event.getModel_key(), event.getCallback(), event.getDto());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.nl.wms.flow_manage.event;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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
|
||||
*/
|
||||
|
||||
public class FlowStartEvent extends PublishEvent {
|
||||
//数据传输
|
||||
private ExecutionDto dto;
|
||||
|
||||
private String model_key;
|
||||
|
||||
public FlowStartEvent(String model_key, Consumer callback) {
|
||||
this.model_key = model_key;
|
||||
this.setCallback(callback);
|
||||
}
|
||||
|
||||
public String getModel_key() {
|
||||
return model_key;
|
||||
}
|
||||
|
||||
public FlowStartEvent build(String form_type, String form_id, JSONObject data){
|
||||
if (dto == null){
|
||||
dto = ExecutionDto.builder().form_id(form_id).form_type(form_type).t(data).build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public FlowStartEvent build(String form_type,List<String> ids, List<JSONObject> datas){
|
||||
if (dto == null){
|
||||
throw new BadRequestException("主数据参数未构建");
|
||||
}
|
||||
List<ExecutionDto> item =new ArrayList();
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
String id = ids.get(i);
|
||||
JSONObject data = datas.get(i);
|
||||
ExecutionDto build = ExecutionDto.builder().form_id(id).form_type(form_type).t(data).build();
|
||||
item.add(build);
|
||||
}
|
||||
dto.setItem(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ExecutionDto getDto() {
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,11 @@ public class ServerTaskActivityBehavior extends FlowNodeActivityBehavior<JSONObj
|
||||
FlowElement element = entity.getCurrentFlowElement();
|
||||
ServerTask currentNode = (ServerTask) element;
|
||||
if (!CollectionUtils.isEmpty(currentNode.getSkipExpression())) {
|
||||
TypeHandler<ExecutionDto<JSONObject>, ExecutionEntity<JSONObject>> typeHandler = TypeHandler.HANDLER_MAP.get(currentNode.getCategory());
|
||||
TypeHandler<ExecutionDto, ExecutionEntity<JSONObject>> typeHandler = TypeHandler.HANDLER_MAP.get(currentNode.getCategory());
|
||||
if (typeHandler == null) {
|
||||
throw new BadRequestException("【flow】当前节点处理类型未定义");
|
||||
}
|
||||
ExecutionDto<JSONObject> result = typeHandler.handler(currentNode.getSkipExpression(), entity, null);
|
||||
ExecutionDto result = typeHandler.handler(currentNode.getSkipExpression(), entity, null);
|
||||
entity.setT(result.getT());
|
||||
entity.setForm_id(result.getForm_id());
|
||||
entity.setForm_type(currentNode.getForm_type());
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
@@ -52,6 +54,10 @@ public class StartEventActivityBehavior extends FlowNodeActivityBehavior {
|
||||
execution.setCreate_time(DateUtil.now());
|
||||
execution.setStatus(StatusEnum.FLOW_STATUS.code("启动"));
|
||||
iActRuExecutionService.save(execution);
|
||||
Consumer callback = entity.getCallback();
|
||||
if (callback!=null){
|
||||
callback.accept(execution.getProc_inst_id());
|
||||
}
|
||||
entity.setProc_inst_id(execution.getProc_inst_id());
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.entity;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -8,17 +9,63 @@ 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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:15
|
||||
* 流程执行相关参数
|
||||
* 流程传输数据
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ExecutionDto<T> {
|
||||
|
||||
public class ExecutionDto {
|
||||
/**
|
||||
* 表单id
|
||||
*/
|
||||
private String form_id;
|
||||
private T t;
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String form_type;
|
||||
/**
|
||||
* 主数据
|
||||
*/
|
||||
private JSONObject t;
|
||||
/**
|
||||
* 明细数据
|
||||
*/
|
||||
private List<ExecutionDto> item;
|
||||
|
||||
/**
|
||||
* 获取数据时:合并主表明细表
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getT() {
|
||||
t.put("item",item);
|
||||
return t;
|
||||
}
|
||||
|
||||
public void setT(JSONObject t) {
|
||||
this.t = t;
|
||||
}
|
||||
|
||||
public void setItem(List<ExecutionDto> item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getForm_id() {
|
||||
return form_id;
|
||||
}
|
||||
|
||||
public void setForm_id(String form_id) {
|
||||
this.form_id = form_id;
|
||||
}
|
||||
|
||||
public String getForm_type() {
|
||||
return form_type;
|
||||
}
|
||||
|
||||
public void setForm_type(String form_type) {
|
||||
this.form_type = form_type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ 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;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:15
|
||||
@@ -36,6 +38,9 @@ public class ExecutionEntity<T> implements Cloneable{
|
||||
protected String form_type;
|
||||
protected BmFormStruc form_struc;
|
||||
protected String form_id;
|
||||
//回调执行
|
||||
protected Consumer callback = null;
|
||||
|
||||
protected T t;
|
||||
|
||||
public void setCurrentFlowElement(FlowElement currentFlowElement) {
|
||||
@@ -75,4 +80,8 @@ public class ExecutionEntity<T> implements Cloneable{
|
||||
public void setParent_id(String parent_id) {
|
||||
this.parent_id = parent_id;
|
||||
}
|
||||
|
||||
public void setCallback(Consumer callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@ 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.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* @program: flow
|
||||
@@ -14,7 +15,7 @@ import java.util.List;
|
||||
**/
|
||||
public interface IFlowOperationService {
|
||||
|
||||
Boolean startUp(String model_key, JSONObject mst, List<JSONObject> items);
|
||||
String startUp(String model_key, Consumer callback,ExecutionDto dto);
|
||||
|
||||
Boolean startFormFlow(StartProcessInstanceVo params);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.nl.wms.flow_manage.flow.framework.converter.BpmnJSONConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.unify.impl.ExeInstanceCmd;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.unify.impl.StartInstanceCmd;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionDto;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
@@ -23,7 +24,7 @@ import org.nl.wms.flow_manage.flow.service.model.IActDeModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
@@ -44,7 +45,7 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
||||
private CommandExecutor commandExecutor;
|
||||
|
||||
@Override
|
||||
public Boolean startUp(String model_key, JSONObject mst, List<JSONObject> items) {
|
||||
public String startUp(String model_key, Consumer callback, ExecutionDto dto) {
|
||||
ActReProcdef deployment = actReProcdefService.getCurrentVersion(model_key);
|
||||
if (deployment==null){
|
||||
throw new BadRequestException("当前单据类型未配置业务流程");
|
||||
@@ -54,14 +55,13 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
||||
JSONObject model_json = JSONObject.parseObject(model_json_string);
|
||||
BpmnModel bpmnModel = bpmnJSONConverter.convertToBpmnModel(deployment.getModel_key(), deployment.getVersion(), model_json);
|
||||
System.out.println(bpmnModel.getNodeFlow().size());
|
||||
|
||||
//创建流程参数ExecutionEntity:执行流程
|
||||
mst.put("item",items);
|
||||
ExecutionEntity entity = new ExecutionEntity();
|
||||
entity.setCurrentFlowElement(bpmnModel.getStartEvent());
|
||||
entity.setT(mst);
|
||||
entity.setForm_type(deployment.getForm_type());
|
||||
entity.setForm_id(mst.getString("id"));
|
||||
entity.setT(dto.getT());
|
||||
entity.setCallback(callback);
|
||||
entity.setForm_type(dto.getForm_type());
|
||||
entity.setForm_id(dto.getForm_id());
|
||||
entity.setStartActivityId(entity.getActivityId());
|
||||
entity.setDeploymentId(deployment.getDeployment_id());
|
||||
commandExecutor.execute(new StartInstanceCmd(),entity);
|
||||
|
||||
@@ -4,14 +4,17 @@ package org.nl.wms.md_manage.group_dick.controller;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
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.group_dick.service.dto.GroupDickQuery;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.MdGruopDtlDto;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -46,10 +49,13 @@ public class MdGruopDickController {
|
||||
public ResponseEntity<Object> queryBygroup(GroupDickQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(iMdGruopDickService.queryAll(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("getVehicleMater/{code}")
|
||||
public ResponseEntity<Object> vehicleInfo(@PathVariable String code) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdGruopDickService.getGroupDtl(code)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/updategroup")
|
||||
@Log("修改桶记录表")
|
||||
@Log("修改组盘信息")
|
||||
//("查询桶记录表")
|
||||
public ResponseEntity<Object> updategroup(@RequestBody JSONObject whereJson) {
|
||||
if (whereJson!=null){
|
||||
@@ -85,5 +91,7 @@ public class MdGruopDickController {
|
||||
iMdGruopDickService.groupDick(dicks);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.MdGruopDtlVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -34,4 +35,11 @@ public interface IMdGruopDickService extends IService<MdGruopDick> {
|
||||
*/
|
||||
void excelImport(MultipartFile file, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 查询组盘明细
|
||||
* @param dick_id
|
||||
* @return
|
||||
*/
|
||||
List<MdGruopDtlVo> getGroupDtl(String dick_id);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.md_manage.group_dick.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDtl;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
public interface IMdGruopDtlService extends IService<MdGruopDtl> {
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "md_gruop_dick",autoResultMap = true)
|
||||
@TableName(value = "md_group_dick",autoResultMap = true)
|
||||
public class MdGruopDick implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -80,5 +80,10 @@ public class MdGruopDick implements Serializable {
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
private JSONObject form_data;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "md_group_dtl")
|
||||
public class MdGruopDtl implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 主表id
|
||||
*/
|
||||
private String dick_id;
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
/**
|
||||
* 载具
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 载具
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 组盘状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 源单
|
||||
*/
|
||||
private String source_form_type;
|
||||
/**
|
||||
* 源单id
|
||||
*/
|
||||
private String source_form_id;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.MdGruopDtlDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -19,4 +21,6 @@ import java.util.Map;
|
||||
public interface MdGruopDickMapper extends BaseMapper<MdGruopDick> {
|
||||
|
||||
List<MdGruopDick> query(@Param("query") GroupDickQuery query);
|
||||
|
||||
List<JSONObject> getGroupDtl(String dickId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDtl;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
public interface MdGruopDtlMapper extends BaseMapper<MdGruopDtl> {
|
||||
|
||||
}
|
||||
@@ -4,22 +4,16 @@
|
||||
|
||||
<resultMap id="BaseResultMap" type="org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick">
|
||||
<result property="id" column="id"/>
|
||||
<result property="vehicle_code" column="vehicle_code"/>
|
||||
<result property="has_child" column="has_child"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="parent_vehicle_code" column="parent_vehicle_code"/>
|
||||
<result property="material_id" column="material_id"/>
|
||||
<result property="material_code" column="material_code"/>
|
||||
<result property="material_name" column="material_name"/>
|
||||
<result property="material_pcsn" column="material_pcsn"/>
|
||||
<result property="pcsn" column="pcsn"/>
|
||||
<result property="qty_unit_id" column="qty_unit_id"/>
|
||||
<result property="qty_unit_name" column="qty_unit_name"/>
|
||||
<result property="qty" column="qty"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="source_form_type" column="source_form_type"/>
|
||||
<result property="source_form_id" column="source_form_id"/>
|
||||
<result property="update_name" column="update_name"/>
|
||||
<result property="update_time" column="update_time"/>
|
||||
<result property="create_time" column="create_time"/>
|
||||
<result property="form_data" column="form_data" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="status" column="status"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -27,7 +21,7 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
md_gruop_dick
|
||||
md_group_dick
|
||||
<where>
|
||||
<if test="query.material_code != null and query.material_code != ''">
|
||||
and material_code = #{query.material_code}
|
||||
@@ -38,6 +32,10 @@
|
||||
<if test="query.pcsn != null and query.pcsn != ''">
|
||||
and pcsn = #{query.pcsn}
|
||||
</if>
|
||||
|
||||
<if test="query.status != null and query.status != ''">
|
||||
and status = #{query.status}
|
||||
</if>
|
||||
<if test="query.form_query != null and query.form_query.size() > 0">
|
||||
<foreach collection="query.form_query" item="value" index="key" >
|
||||
<if test="value != null and value != ''">
|
||||
@@ -47,4 +45,16 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getGroupDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
*,
|
||||
md_me_materialbase.material_code,
|
||||
md_me_materialbase.material_name,
|
||||
md_me_materialbase.material_spec
|
||||
FROM
|
||||
md_group_dtl
|
||||
LEFT JOIN md_pb_vehicleMater ON md_group_dtl.vehicle_code = md_pb_vehicleMater.vehicle_code
|
||||
LEFT JOIN md_me_materialbase on md_pb_vehicleMater.material_id = md_me_materialbase.material_id
|
||||
where md_group_dtl.dick_id = #{dickId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -19,5 +19,6 @@ public class GroupDickQuery extends BaseQuery<MdGruopDick> {
|
||||
private String vehicle_code;
|
||||
private String material_code;
|
||||
private String pcsn;
|
||||
private String status;
|
||||
private Map<String,String> form_query;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDtl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@Data
|
||||
public class MdGruopDtlDto extends MdPbVehicleMater {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 主表id
|
||||
*/
|
||||
private String dick_id;
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
/**
|
||||
* 载具
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 组盘状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 源单
|
||||
*/
|
||||
private String source_form_type;
|
||||
/**
|
||||
* 源单id
|
||||
*/
|
||||
private String source_form_id;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@Data
|
||||
public class MdGruopDtlVo extends MdGruopDtlDto {
|
||||
|
||||
private String material_name;
|
||||
private String material_spec;
|
||||
private String material_code;
|
||||
|
||||
}
|
||||
@@ -1,26 +1,34 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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 com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
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.config_manage.form_struc.service.IBmFormStrucService;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IFlowOperationService;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.flow_manage.event.FlowStartEvent;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDtlService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDtl;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.mapper.MdGruopDickMapper;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.MdGruopDtlDto;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.MdGruopDtlVo;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -28,6 +36,9 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -41,12 +52,15 @@ import java.util.List;
|
||||
public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGruopDick> implements IMdGruopDickService {
|
||||
|
||||
@Autowired
|
||||
private IFlowOperationService iFlowOperationService;
|
||||
|
||||
@Lazy
|
||||
private IMdGruopDickService self;
|
||||
@Autowired
|
||||
private IMdGruopDtlService iMdGruopDtlService;
|
||||
@Autowired
|
||||
private IMdPbVehicleMaterService iMdPbVehicleMaterService;
|
||||
|
||||
@Override
|
||||
public Object queryAll(GroupDickQuery query, PageQuery pageQuery) {
|
||||
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("create_time DESC");
|
||||
List<MdGruopDick> mstDetail = this.baseMapper.query(query);
|
||||
@@ -57,32 +71,62 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void groupDick(JSONObject forms) {
|
||||
//TEST:iFlowOperationService.startUp("GROUP_DICK",forms.get(0),forms);
|
||||
List<JSONObject> tableData = (ArrayList)forms.remove("tableData");
|
||||
List<JSONObject> tableData = (ArrayList)forms.remove("item");
|
||||
String now = DateUtil.now();
|
||||
forms.put("update_name",SecurityUtils.getCurrentNickName());
|
||||
forms.put("update_time",DateUtil.now());
|
||||
forms.put("update_time", now);
|
||||
forms.put("id",IdUtil.getStringId());
|
||||
forms.put("id",IdUtil.getStringId());
|
||||
forms.put("code", CodeUtil.getNewCode("md_group_dick"));
|
||||
MdGruopDick mdGroupMst = forms.toJavaObject(MdGruopDick.class);
|
||||
|
||||
List<MdGruopDtl> items = new ArrayList<>();
|
||||
List<MdPbVehicleMater> vehicleMaters = new ArrayList<>();
|
||||
List<JSONObject> dtlJson = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(forms)){
|
||||
List<JSONObject> items = new ArrayList<>();
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
JSONObject item = new JSONObject(tableData.get(i));
|
||||
Map item = tableData.get(i);
|
||||
item.put("update_name",SecurityUtils.getCurrentNickName());
|
||||
item.put("update_time",DateUtil.now());
|
||||
item.put("update_time", now);
|
||||
item.put("id",IdUtil.getStringId());
|
||||
item.put("mst_id",mdGroupMst.getId());
|
||||
// MdGruopDick dick = item.toJavaObject(MdGruopDick.class);
|
||||
// this.save(dick);
|
||||
items.add(item);
|
||||
item.put("dick_id",mdGroupMst.getId());
|
||||
JSONObject item_json = new JSONObject(item);
|
||||
MdGruopDtl mdGruopDtl = item_json.toJavaObject(MdGruopDtl.class);
|
||||
MdPbVehicleMater vehicleMater = item_json.toJavaObject(MdPbVehicleMater.class);
|
||||
items.add(mdGruopDtl);
|
||||
vehicleMaters.add(vehicleMater);
|
||||
dtlJson.add(item_json);
|
||||
}
|
||||
// iMdGroupMstService.save(mdGroupMst);
|
||||
iFlowOperationService.startUp("service_source_apply",forms,items);
|
||||
}
|
||||
this.save(mdGroupMst);
|
||||
iMdGruopDtlService.saveBatch(items);
|
||||
iMdPbVehicleMaterService.saveBatch(vehicleMaters);
|
||||
|
||||
BussEventMulticaster.Publish(new FlowStartEvent("md_group_dick", (Consumer<String>) proc_inst_id -> {
|
||||
self.update(new UpdateWrapper<MdGruopDick>()
|
||||
.set("proc_inst_id",proc_inst_id).eq("id",mdGroupMst.getId())); })
|
||||
.build("md_group_dick",mdGroupMst.getId(),forms)
|
||||
.build("md_group_dtl",items.stream().map(MdGruopDtl::getId).collect(Collectors.toList()), dtlJson)
|
||||
,true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void excelImport(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdGruopDtlVo> getGroupDtl(String dick_id) {
|
||||
List<MdGruopDtlVo> result = new ArrayList<>();
|
||||
if (StringUtils.isEmpty(dick_id)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<JSONObject> groupDtl = this.baseMapper.getGroupDtl(dick_id);
|
||||
for (JSONObject json : groupDtl) {
|
||||
result.add(json.toJavaObject(MdGruopDtlVo.class));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDtlService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDtl;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.mapper.MdGruopDtlMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class MdGruopDtlServiceImpl extends ServiceImpl<MdGruopDtlMapper, MdGruopDtl> implements IMdGruopDtlService {
|
||||
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class PmFormDataController {
|
||||
|
||||
@GetMapping()
|
||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(formDataService.queryAll(query,page), HttpStatus.CREATED);
|
||||
return new ResponseEntity<>(TableDataInfo.build(formDataService.queryTree(query,page)), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@GetMapping("/getSonFormData/{id}")
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package org.nl.wms.pm_manage.form_data.service;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
import org.nl.wms.sync_manage.service.form_mapping.dao.SyncFormMapping;
|
||||
|
||||
import java.util.List;
|
||||
@@ -22,7 +24,12 @@ public interface IPmFormDataService extends IService<PmFormData> {
|
||||
|
||||
List<PmFormData> syncAnalyse(SyncFormMapping mapping, String dataString);
|
||||
|
||||
List<PmFormData> getByType(String from_type);
|
||||
|
||||
Object queryAll(FormDataQuery query, PageQuery page);
|
||||
|
||||
List<PmFormDataDto> queryTree(FormDataQuery query, PageQuery page);
|
||||
|
||||
|
||||
Object getSonDtlFormData(String id);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class PmFormData implements Serializable {
|
||||
private BigDecimal assign_qty;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
* 单位
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
@@ -116,8 +116,6 @@ public class PmFormData implements Serializable {
|
||||
*/
|
||||
private String parent_id;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Boolean hasChildren = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,5 +20,5 @@ public interface PmFormDataMapper extends BaseMapper<PmFormData> {
|
||||
|
||||
List<PmFormData> query(@Param("query") FormDataQuery query);
|
||||
|
||||
// List<PmFormData> query(@Param("id") String id);
|
||||
List<PmFormDataDto> queryTree(@Param("query")FormDataQuery query);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,28 @@
|
||||
<result property="unit_id" column="unit_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="dataDetail" type="org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto" >
|
||||
<result property="id" column="id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="proc_inst_id" column="proc_inst_id"/>
|
||||
<result property="biz_code" column="biz_code"/>
|
||||
<result property="biz_id" column="biz_id"/>
|
||||
<result property="biz_date" column="biz_date"/>
|
||||
<result property="form_type" column="form_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="create_name" column="create_name"/>
|
||||
<result property="create_time" column="create_time"/>
|
||||
<result property="material_id" column="material_id"/>
|
||||
<result property="qty" column="qty"/>
|
||||
<result property="pcsn" column="pcsn"/>
|
||||
<result property="vehicle_code" column="vehicle_code"/>
|
||||
<result property="parent_id" column="parent_id"/>
|
||||
<result property="form_data" column="form_data" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="unit_id" column="unit_id"/>
|
||||
<!-- <result property="HasChildren" column="HasChildren"/>-->
|
||||
<collection property="children" ofType="org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto" column="id" select="selectChild"></collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="query" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
child.*
|
||||
@@ -40,4 +62,36 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryTree" resultMap="dataDetail">
|
||||
SELECT
|
||||
pm_form_data.*,
|
||||
md_me_materialbase.material_code,
|
||||
md_me_materialbase.material_name,
|
||||
md_me_materialbase.material_spec
|
||||
FROM
|
||||
pm_form_data
|
||||
left join md_me_materialbase on pm_form_data.material_id = md_me_materialbase.material_id
|
||||
<where>
|
||||
<if test="query.form_type != null and query.form_type != ''">
|
||||
and form_type = #{query.form_type}
|
||||
</if>
|
||||
<if test="query.form_query != null and query.form_query.size() > 0">
|
||||
<foreach collection="query.form_query" item="value" index="key" >
|
||||
<if test="value != null and value != ''">
|
||||
and JSON_CONTAINS(form_data, '{"${key}":"${value}"}')
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectChild" resultMap="dataDetail">
|
||||
select
|
||||
pm_form_data.*,
|
||||
md_me_materialbase.material_code,
|
||||
md_me_materialbase.material_name,
|
||||
md_me_materialbase.material_spec
|
||||
from pm_form_data left join md_me_materialbase on pm_form_data.material_id = md_me_materialbase.material_id
|
||||
where parent_id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -3,12 +3,16 @@ package org.nl.wms.pm_manage.form_data.service.dto;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -26,17 +30,29 @@ public class PmFormDataDto implements Serializable {
|
||||
/**
|
||||
* 业务单据单据id
|
||||
*/
|
||||
private String bus_id;
|
||||
private String id;
|
||||
/**
|
||||
* 单据编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 对应流程实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String bus_code;
|
||||
private String biz_id;
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String biz_code;
|
||||
|
||||
/**
|
||||
* 业务单据日期
|
||||
*/
|
||||
private String bus_date;
|
||||
private String biz_date;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
@@ -56,22 +72,48 @@ public class PmFormDataDto implements Serializable {
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_id;
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String material_id;
|
||||
/**
|
||||
* 物料name
|
||||
*/
|
||||
private String material_name;
|
||||
/**
|
||||
* 物料code
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 物料spec
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 分配数量
|
||||
*/
|
||||
private BigDecimal assign_qty;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 载具
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单字段
|
||||
@@ -83,9 +125,14 @@ public class PmFormDataDto implements Serializable {
|
||||
*/
|
||||
private String parent_id;
|
||||
|
||||
private Boolean HasChildren=Boolean.FALSE;
|
||||
|
||||
private List<PmFormDataDto> dtl;
|
||||
|
||||
|
||||
private List<PmFormDataDto> children;
|
||||
|
||||
public void setChildren(List<PmFormDataDto> children) {
|
||||
if (!CollectionUtils.isEmpty(children)){
|
||||
this.HasChildren=Boolean.TRUE;
|
||||
}
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -15,20 +14,22 @@ import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.utils.*;
|
||||
import org.nl.wms.config_manage.form_struc.service.IBmFormStrucService;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.mapper.PmFormDataMapper;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
import org.nl.wms.sync_manage.service.form_mapping.ISyncFormMappingService;
|
||||
import org.nl.wms.sync_manage.service.form_mapping.dao.SyncFormMapping;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -108,41 +109,46 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
|
||||
@Override
|
||||
public Object queryAll(FormDataQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("create_time DESC");
|
||||
List<PmFormData> pmFormData = this.baseMapper.query(query);
|
||||
TableDataInfo<PmFormData> build = TableDataInfo.build(pmFormData);
|
||||
List<PmFormData> content = build.getContent();
|
||||
for (PmFormData formData : content) {
|
||||
LambdaQueryWrapper<PmFormData> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(PmFormData::getParent_id, formData.getId());
|
||||
List<PmFormData> list = this.baseMapper.selectList(lqw);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
formData.setHasChildren(true);
|
||||
Page page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("id DESC");
|
||||
this.baseMapper.query(query);
|
||||
List<PmFormData> content = page.getResult();
|
||||
List<String> ids = content.stream().map(PmFormData::getId).collect(Collectors.toList());
|
||||
Map<String, List<PmFormData>> childMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(ids)){
|
||||
List<PmFormData> childs = this.list(new QueryWrapper<PmFormData>().in("parent_id", ids));
|
||||
childMap = childs.stream().collect(Collectors.groupingBy(PmFormData::getParent_id));
|
||||
}
|
||||
List<PmFormDataDto> list = new ArrayList<>();
|
||||
for (PmFormData record : content) {
|
||||
PmFormDataDto strucDto = new PmFormDataDto();
|
||||
BeanUtils.copyProperties(record, strucDto);
|
||||
list.add(strucDto);
|
||||
List<PmFormData> dtl = childMap.get(record.getId());
|
||||
if (!CollectionUtils.isEmpty(dtl)){
|
||||
strucDto.setHasChildren(true);
|
||||
strucDto.setChildren(CopyUtil.copyList(dtl,PmFormDataDto.class));
|
||||
}
|
||||
}
|
||||
build.setTotalElements(page.getTotal());
|
||||
TableDataInfo build = TableDataInfo.build(page);
|
||||
build.setContent(list);
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page queryTree(FormDataQuery query, PageQuery pageQuery) {
|
||||
Page page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("id DESC");
|
||||
this.baseMapper.queryTree(query);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getSonDtlFormData(String id) {
|
||||
LambdaQueryWrapper<PmFormData> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(PmFormData::getParent_id, id);
|
||||
return this.list(lqw);
|
||||
// List<PmFormData> pmFormData = this.baseMapper.query(id);
|
||||
// TableDataInfo<PmFormData> build = TableDataInfo.build(pmFormData);
|
||||
// List<PmFormData> content = build.getContent();
|
||||
// for (PmFormData formData : content) {
|
||||
// LambdaQueryWrapper<PmFormData> lqw = new LambdaQueryWrapper<>();
|
||||
// lqw.eq(PmFormData::getParent_id, formData.getId());
|
||||
// List<PmFormData> list = this.baseMapper.selectList(lqw);
|
||||
// if (CollectionUtil.isNotEmpty(list)) {
|
||||
// formData.setHasChildren(true);
|
||||
// }
|
||||
// }
|
||||
// build.setTotalElements(page.getTotal());
|
||||
// return build;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,5 +208,11 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmFormData> getByType(String from_type) {
|
||||
Assert.notNull(from_type,"表单类型参数不能为空");
|
||||
return this.list(new QueryWrapper<PmFormData>().eq("form_type",from_type));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,3 +85,9 @@ feishu: https://open.feishu.cn/open-apis/bot/v2/hook/cfe495f7-9bcd-40bb-ab66-038
|
||||
lucene:
|
||||
index:
|
||||
path: E:\lms\lucene\index
|
||||
pageheiper:
|
||||
helperDialect: mysql
|
||||
reasonable: true
|
||||
supportMethodsArguments: true
|
||||
pageSizeZero: false #pageSize=0 返回所有
|
||||
params: count=countSgl
|
||||
|
||||
@@ -110,7 +110,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
measure_unit_id: null,
|
||||
unit_id: null,
|
||||
unit_code: null,
|
||||
unit_name: null,
|
||||
qty_precision: null,
|
||||
@@ -138,8 +138,8 @@ export default {
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
idField: 'measure_unit_id',
|
||||
sort: 'measure_unit_id,desc',
|
||||
idField: 'unit_id',
|
||||
sort: 'unit_id,desc',
|
||||
crudMethod: { ...crudMdPbMeasureunit }
|
||||
})
|
||||
},
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
measure_unit_id: [
|
||||
unit_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
unit_code: [
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="表单对应JSON" prop="convert_json">
|
||||
<el-form-item label="数据映射字段" prop="convert_json">
|
||||
<el-input type="textarea" v-model="form.convert_json" style="width: 430px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -133,13 +133,18 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料单位" prop="pcsn">
|
||||
<el-input v-model="form.unit_id" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料批次映射" prop="pcsn">
|
||||
<el-input v-model="form.pcsn" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="自定义字段JSON" prop="form_param">
|
||||
<el-form-item label="自定义字段" prop="form_param">
|
||||
<el-input type="textarea" v-model="form.form_param" :formatter="jsonFormat" style="width: 430px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -163,7 +168,7 @@
|
||||
<el-table-column prop="form_type" show-overflow-tooltip width="150" label="表单类型"/>
|
||||
<el-table-column prop="form_name" show-overflow-tooltip width="120" label="表单名称"/>
|
||||
<el-table-column prop="form_desc" show-overflow-tooltip width="120" label="描述"/>
|
||||
<el-table-column prop="convert_json" show-overflow-tooltip width="120" label="表单对应JSON"/>
|
||||
<el-table-column prop="convert_json" show-overflow-tooltip width="120" label="数据映射字段"/>
|
||||
<el-table-column prop="has_child" show-overflow-tooltip width="120" :formatter="booleanFormat" label="是否关联子表"/>
|
||||
<!-- <el-table-column prop="parent_id" show-overflow-tooltip width="120" label="父表id"/>-->
|
||||
<el-table-column prop="bus_id" show-overflow-tooltip width="120" label="业务单据id映射"/>
|
||||
@@ -174,7 +179,8 @@
|
||||
<el-table-column prop="qty" show-overflow-tooltip width="120" label="物料数量映射"/>
|
||||
<el-table-column prop="pcsn" show-overflow-tooltip width="120" label="物料批次映射"/>
|
||||
<el-table-column prop="form_param" show-overflow-tooltip width="120" :formatter="jsonFormat" label="自定义字段映射"/>
|
||||
<el-table-column prop="create_time" show-overflow-tooltip width="150" label="创建时间"/>
|
||||
<el-table-column prop="update_time" show-overflow-tooltip width="150" label="更新时间"/>
|
||||
<el-table-column prop="update_name" show-overflow-tooltip width="150" label="更新人"/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="120px"
|
||||
@@ -202,8 +208,8 @@
|
||||
|
||||
<script>
|
||||
import formstruc from './formstruc'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
@@ -233,15 +239,15 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'FormStruc',
|
||||
dicts: ['base_data'],
|
||||
components: {UploadDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
components: { UploadDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [ presenter(), header(), form(defaultForm), crud() ],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '基础类别',
|
||||
url: 'api/bmFormStruc',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: {...formstruc},
|
||||
crudMethod: { ...formstruc },
|
||||
optShow: {
|
||||
add: true,
|
||||
reset: true
|
||||
|
||||
@@ -64,14 +64,14 @@
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="proc_inst_id" show-overflow-tooltip show-tooltip-when-overflow width="200" label="流程标识"/>
|
||||
<el-table-column prop="proc_inst_id" show-overflow-tooltip show-tooltip-when-overflow width="200" label="流程实例"/>
|
||||
<el-table-column prop="parent_id" width="200" label="父流程"/>
|
||||
<el-table-column v-if="false" prop="deployment_id" label="当前实例标识"/>
|
||||
<el-table-column v-if="false" prop="deployment_id" label="流程部署ID"/>
|
||||
<el-table-column prop="deployment_name" show-overflow-tooltip show-tooltip-when-overflow width="130"
|
||||
label="当前实例名称"/>
|
||||
<el-table-column v-if="false" prop="activity_id" label="当前实例节点"/>
|
||||
label="流程模型"/>
|
||||
<el-table-column v-if="false" prop="activity_id" label="当前节点ID"/>
|
||||
<el-table-column prop="activity_name" show-overflow-tooltip show-tooltip-when-overflow width="130"
|
||||
label="当前实例节点名称"/>
|
||||
label="当前节点"/>
|
||||
<el-table-column prop="is_active" label="启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@@ -86,21 +86,13 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="实例状态">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
v-for="(item, index) in statusList"
|
||||
:key="index"
|
||||
:value="item.value"
|
||||
v-if="scope.row.status == item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</span>
|
||||
{{ dict.label.FLOW_STATUS[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" show-overflow-tooltip show-tooltip-when-overflow label="备注"/>
|
||||
<el-table-column prop="form_id" show-overflow-tooltip show-tooltip-when-overflow width="130" label="业务主键"/>
|
||||
<el-table-column prop="form_type" show-overflow-tooltip show-tooltip-when-overflow width="130" label="业务类型"/>
|
||||
<el-table-column prop="form_data" show-overflow-tooltip show-tooltip-when-overflow width="130"
|
||||
show-overflow-tooltip show-tooltip-when-overflow label="业务数据"/>
|
||||
<el-table-column prop="form_data" show-overflow-tooltip show-tooltip-when-overflow width="130" label="业务数据" :formatter="jsonFormat"/>
|
||||
<el-table-column prop="create_id" label="创建人" width="135"/>
|
||||
<el-table-column prop="create_time" label="创建时间" width="135"/>
|
||||
<el-table-column prop="update_time" label="修改时间" width="135"/>
|
||||
@@ -154,7 +146,7 @@ const defaultForm = {
|
||||
form_data: null
|
||||
}
|
||||
export default {
|
||||
dicts: [],
|
||||
dicts: [ "FLOW_STATUS" ],
|
||||
name: 'Execution',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, ViewCurrentFlowDesigner},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
@@ -204,6 +196,12 @@ export default {
|
||||
this.form.form_data = JSON.stringify(this.form.form_data)
|
||||
return true
|
||||
},
|
||||
jsonFormat(row, index) {
|
||||
if (row.form_data != null) {
|
||||
return JSON.stringify(row.form_data)
|
||||
}
|
||||
return ''
|
||||
},
|
||||
viewClick(row) {
|
||||
curdExecution.getDeploymentById(row.deployment_id).then(res => {
|
||||
this.$refs.viewCurrentFlowDesigner.showLogicFlowDesigner(res.model_editor_json, row);
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
<el-form-item label="模型描述">
|
||||
<el-input v-model="form.description" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型KEY">
|
||||
<el-input v-model="form.model_key" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模型注释">
|
||||
<el-input v-model="form.model_comment" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
width="1200px"
|
||||
width="1600px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
@@ -22,47 +22,30 @@
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="主载具编码" prop="parent_vehicle_code">
|
||||
<label slot="label">主载具编码:</label>
|
||||
<el-input v-model="form.parent_vehicle_code" clearable style="width: 210px" />
|
||||
<el-form-item label="组盘编码" prop="code">
|
||||
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-input v-model="form.status" disabled placeholder="生成" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子托盘总数" prop="child_qty">
|
||||
<label slot="label">子托盘总数:</label>
|
||||
<el-input-number
|
||||
v-model="form.child_qty"
|
||||
:controls="false"
|
||||
:precision="0"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
<el-form-item label="父载具" prop="parent_vehicle_code">
|
||||
<el-input v-model="form.parent_vehicle_code" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="源单类型" prop="source_form_type">
|
||||
<el-input v-model="form.source_form_type" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="源单id" prop="source_form_id">
|
||||
<el-input v-model="form.source_form_id" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<template v-for="(col,index) in cols">
|
||||
<el-form-item label="col.lable" prop="bill_code">
|
||||
<label slot="label">{{col.lable}}:</label>
|
||||
<el-input v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 210px" />
|
||||
<el-input v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -114,47 +97,59 @@
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
|
||||
<el-table-column show-overflow-tooltip prop="vehicle_code" label="载具编号" width="120" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="vehicle_code" label="载具编号" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].vehicle_code" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="has_child" label="是否含有子载具" width="120" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="has_child" label="是否含有子载具" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].has_child" class="input-with-select" />
|
||||
<el-switch
|
||||
v-model="tableData[scope.$index].has_child"
|
||||
active-color="#F56C6C"
|
||||
inactive-color="#409EFF"
|
||||
active-value="1"
|
||||
inactive-valu="0"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="parent_vehicle_code" label="父载具编码" width="120" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="parent_vehicle_code" label="父载具编码" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].parent_vehicle_code" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].material_name" disabled class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].material_spec" disabled class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="物料批次" width="120" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="160" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" width="160" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="物料批次" width="160" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].pcsn" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="数量" width="120" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].qty" class="input-with-select" /></template>
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="数量" width="160" align="center">
|
||||
<template scope="scope"><el-input-number v-model="tableData[scope.$index].qty" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" width="120" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].qty_unit_name" class="input-with-select" /></template>
|
||||
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="tableData[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 v-for="(item, index) in dtlCols" :key="item.value" :label="item.lable" >
|
||||
<!-- <el-table-column v-for="(item, index) in dtlCols" :key="item.value" :label="item.lable" width="160">-->
|
||||
<!-- <template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column v-for="(item, index) in dtlCols" :key="item.value" :label="item.lable" width="160">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].form_data[item.value]" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="120" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="source_form_type" label="源单类型" width="160" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单id" width="210" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="210" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].remark" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
||||
@@ -179,8 +174,7 @@
|
||||
<FormDialog
|
||||
:dialog-show.sync="formShow"
|
||||
:is-single="false"
|
||||
:mater-opt-code="materType"
|
||||
@setMaterValue="tableDtlMaterial"
|
||||
@setMaterValue="tableDtlMaterial2"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -190,6 +184,7 @@ import CRUD, { crud, form } from '@crud/crud'
|
||||
import MaterDialog from '@/views/wms/base_manage/material/MaterDialog'
|
||||
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import measureunit from '@/views/wms/base_manage/measure/measureunit'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
@@ -206,9 +201,9 @@ const defaultForm = {
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { formstruc, MaterDialog, FormDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area', 'PCS_SAL_TYPE'],
|
||||
components: { formstruc, MaterDialog, FormDialog, measureunit },
|
||||
mixins: [ crud(), form(defaultForm) ],
|
||||
dicts: [ 'FORM_STATUS' ],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
@@ -220,17 +215,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cols:[],
|
||||
dtlCols:[],
|
||||
tableData:[],
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
formShow: false,
|
||||
dtlShow: false,
|
||||
opendtlParam: null,
|
||||
cols:[],
|
||||
dtlCols:[],
|
||||
tableData:[],
|
||||
unitDict: [],
|
||||
|
||||
materType: '03', // 关键成品
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
rules: {
|
||||
|
||||
}
|
||||
@@ -245,16 +239,19 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
formstruc.getHeader('GROUP_MST').then(res => {
|
||||
this.tableData = []
|
||||
formstruc.getHeader('md_group_dick').then(res => {
|
||||
this.cols = res
|
||||
res.forEach(a => {
|
||||
this.form.form_data[a.value,'']
|
||||
})
|
||||
}),
|
||||
formstruc.getHeader('GROUP_DICK').then(res => {
|
||||
formstruc.getHeader('md_pb_vehicleivt').then(res => {
|
||||
this.dtlCols = res
|
||||
})
|
||||
|
||||
measureunit.getSelect().then(res => {
|
||||
this.unitDict = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
@@ -266,7 +263,8 @@ export default {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return true
|
||||
}
|
||||
this.form.tableData = this.tableData
|
||||
debugger
|
||||
this.form.item = this.tableData
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
@@ -286,6 +284,29 @@ export default {
|
||||
})
|
||||
this.form.child_qty = this.tableData.length
|
||||
},
|
||||
tableDtlMaterial2(rows) {
|
||||
rows.forEach((row) => {
|
||||
const data = {}
|
||||
data.material_name = row.material_name
|
||||
data.material_code = row.material_code
|
||||
data.material_id = row.material_id
|
||||
data.material_spec = row.material_spec
|
||||
data.source_form_type = row.form_type
|
||||
data.source_form_id = row.id
|
||||
data.unit_id = row.unit_id
|
||||
data.form_data = {}
|
||||
let row_form_data = row.form_data;
|
||||
this.dtlCols.forEach(a=>{
|
||||
let item = null
|
||||
if (a.value in row_form_data) {
|
||||
item = row_form_data[a.value];
|
||||
}
|
||||
this.$set(data.form_data,a.value,item)
|
||||
})
|
||||
this.tableData.splice(-1, 0, data)
|
||||
})
|
||||
this.form.child_qty = this.tableData.length
|
||||
},
|
||||
insertEvent(row) {
|
||||
this.materShow = true
|
||||
},
|
||||
@@ -304,8 +325,18 @@ export default {
|
||||
}
|
||||
this.tableData.push({ edit: false, qty: '0' })
|
||||
},
|
||||
formatBaseType(row) {
|
||||
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
|
||||
|
||||
unitFormatter(row) {
|
||||
debugger
|
||||
if (row.unit_id!=null){
|
||||
for (let i = 0; i < this.unitDict.length; i++) {
|
||||
let item = this.unitDict[i];
|
||||
if (item.value == row.unit_id){
|
||||
return key.label
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
177
wms_pro/qd/src/views/wms/md_manage/group_dick/ViewDialog.vue
Normal file
177
wms_pro/qd/src/views/wms/md_manage/group_dick/ViewDialog.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="组盘详情"
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="组盘编码" prop="code">
|
||||
<el-input v-model="form.code" disabled style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="父托盘" prop="parent_vehicle_code">
|
||||
<el-input v-model="form.parent_vehicle_code" disabled clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
clearable
|
||||
style="width: 120px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.FORM_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="源单类型" prop="source_form_type">
|
||||
<el-input v-model="form.source_form_type" disabled style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="源单id" prop="source_form_id">
|
||||
<el-input v-model="form.source_form_id" disabled style="width: 150px" />
|
||||
</el-form-item>
|
||||
<template v-for="(col,index) in cols">
|
||||
<el-form-item label="col.lable" prop="bill_code">
|
||||
<label slot="label">{{col.lable}}:</label>
|
||||
<el-input v-model="form.form_data[col.value]" :value="col.value" disabled style="width: 150px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" disabled style="width: 380px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span2">载具物料信息</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
size="mini"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="vehicle_code" label="托盘编号" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="parent_vehicle_code" label="父托盘编码" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_id" label="物料id" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
||||
<el-table-column prop="pcsn" label="批次" width="150" align="center" />
|
||||
<el-table-column prop="qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||
<el-table-column prop="frozen_qty" :formatter="crud.formatNum3" label="冻结数" align="center" />
|
||||
<el-table-column prop="unit_id" label="单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_form_type" label="源单类型" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单号" align="center" />
|
||||
<el-table-column v-for="(item, index) in dtlCols" :key="item.value" :label="item.lable" >
|
||||
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="has_child" label="含子托盘" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="update_time" label="更新时间" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { crud } from '@crud/crud'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import crudVehicleMater from '@/views/wms/md_manage/vehicleMater/vehicleMater'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: { formstruc, crudVehicleMater },
|
||||
mixins: [ crud() ],
|
||||
dicts: [ 'FORM_STATUS' ],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cols: [],
|
||||
dtlCols: [],
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
form: {},
|
||||
form_data: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.form = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
formstruc.getHeader('md_group_dick').then(res => {
|
||||
this.cols = res
|
||||
}),
|
||||
formstruc.getHeader('md_pb_vehicleivt').then(res => {
|
||||
this.dtlCols = res
|
||||
})
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form = row
|
||||
crudVehicleMater.getgroupDtl(this.form.id).then(res => {
|
||||
this.tableDtl = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .el-dialog__title2 {
|
||||
line-height: 24px;
|
||||
font-size:20px;
|
||||
color:#303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span2 {
|
||||
padding: 0px 0px 20px 0px;
|
||||
}
|
||||
.crud-opts2 {
|
||||
padding: 10px 0px 0px 50px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -2,133 +2,26 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<span>组盘配置信息</span>
|
||||
</div>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="600px"
|
||||
>
|
||||
<el-form ref="form" :model="form" size="mini" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="表单类型" prop="class_code">
|
||||
<el-input v-model="form.form_type" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="表单名称" prop="class_name">
|
||||
<el-input v-model="form.form_name" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col >
|
||||
<el-form-item label="表单描述" prop="class_name">
|
||||
<el-input v-model="form.form_desc" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col >
|
||||
<el-form-item label="表单对应json" prop="class_name">
|
||||
<el-input v-model="form.convert_json" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col >
|
||||
<el-form-item label="是否含有子表" prop="class_name">
|
||||
<el-radio-group v-model="form.has_child" style="width: 140px">
|
||||
<el-radio label=true>是</el-radio>
|
||||
<el-radio label=false>否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-select
|
||||
v-model="form.parent_id"
|
||||
placeholder="父表类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in form_types"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务表id映射" prop="class_desc">
|
||||
<el-input v-model="form.bus_id" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务表编码映射" prop="class_desc">
|
||||
<el-input v-model="form.bus_code" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务表时间映射" prop="class_desc">
|
||||
<el-input v-model="form.bus_data" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务表状态映射" prop="class_desc">
|
||||
<el-input v-model="form.bus_status" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料id映射" prop="class_desc">
|
||||
<el-input v-model="form.material_id" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料数量映射" prop="class_desc">
|
||||
<el-input v-model="form.qty" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料批次映射" prop="class_desc">
|
||||
<el-input v-model="form.pcsn" style="width: 120px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="自定义字段JSON" prop="class_desc">
|
||||
<el-input type="textarea" v-model="form.form_param" :formatter="jsonFormat" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">组盘表配置信息</span>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:load="load"
|
||||
lazy
|
||||
:load="getClassDatas"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:data="crud.data"
|
||||
row-key="id"
|
||||
@select="crud.selectChange"
|
||||
@select-all="crud.selectAllChange"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
row-key="form_type"
|
||||
table-layout="auto"
|
||||
>
|
||||
<el-table-column prop="form_type" label="表单类型" />
|
||||
<el-table-column prop="form_type" label="表单类型" width="180" />
|
||||
<el-table-column prop="form_name" label="表单名称" />
|
||||
<el-table-column prop="form_desc" label="描述" />
|
||||
<el-table-column prop="convert_json" label="表单对应json" />
|
||||
<el-table-column prop="convert_json" label="数据映射字段" />
|
||||
<el-table-column prop="create_time" label="创建时间" />
|
||||
<el-table-column prop="has_child" :formatter="booleanFormat" label="是否关联子表" />
|
||||
<el-table-column prop="parent_id" label="父表id" />
|
||||
@@ -139,72 +32,47 @@
|
||||
<el-table-column prop="material_id" label="物料id映射" />
|
||||
<el-table-column prop="qty" label="物料数量映射" />
|
||||
<el-table-column prop="pcsn" label="物料批次映射" />
|
||||
<el-table-column prop="form_param" :show-overflow-tooltip="true" :formatter="jsonFormat" label="自定义字段映射" />
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="操作"-->
|
||||
<!-- width="250px"-->
|
||||
<!-- align="center"-->
|
||||
<!-- >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <udOperation-->
|
||||
<!-- style="display: inline"-->
|
||||
<!-- :data="scope.row"-->
|
||||
<!-- :permission="permission"-->
|
||||
<!-- :disabled-edit="scope.row.is_modify === '0'"-->
|
||||
<!-- :disabled-dle="scope.row.is_modify === '0'"-->
|
||||
<!-- msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"-->
|
||||
<!-- />-->
|
||||
<!-- <el-button slot="right" size="mini" type="text" icon="el-icon-circle-plus-outline" @click="crud.toAddAndData(addSibling(scope.row))">新增同级</el-button>-->
|
||||
<!-- <el-button slot="right" size="mini" type="text" icon="el-icon-circle-plus" @click="crud.toAddAndData(addChildren(scope.row))">新增子级</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="form_param" show-overflow-tooltip :formatter="jsonFormat" label="自定义字段映射" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
form_type: null,
|
||||
form_name: null,
|
||||
form_desc: null,
|
||||
convert_json: null,
|
||||
create_time: null,
|
||||
create_id: null,
|
||||
has_child: null,
|
||||
parent_id: null,
|
||||
bus_id: null,
|
||||
bus_code: null,
|
||||
bus_date: null,
|
||||
bus_status: null,
|
||||
status: null,
|
||||
material_id: null,
|
||||
qty: null,
|
||||
pcsn: null,
|
||||
form_param: null,
|
||||
has_child: false,
|
||||
parent_id: null
|
||||
}
|
||||
export default {
|
||||
name: 'FormStruc',
|
||||
dicts: ['base_data'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
components: {},
|
||||
mixins: [ presenter(), header(), form(defaultForm), crud() ],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '基础类别',
|
||||
url: 'api/bmFormStruc',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
query: {'search':'组盘'},
|
||||
query: { search: '组盘' },
|
||||
crudMethod: { ...formstruc },
|
||||
optShow: {
|
||||
add: true,
|
||||
@@ -217,18 +85,38 @@ export default {
|
||||
classes: [],
|
||||
uploadShow: false,
|
||||
form_types: [],
|
||||
permission: {}
|
||||
permission: {},
|
||||
rules: {
|
||||
form_type: [
|
||||
{required: true, message: '表单类型不能为空', trigger: 'blur'}
|
||||
],
|
||||
form_name: [
|
||||
{required: true, message: '表单名称不能为空', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getFormSelect() // 获取分类
|
||||
// this.getFormSelect() // 获取分类
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getFormSelect()
|
||||
},
|
||||
[CRUD.HOOK.beforeToEdit]() {
|
||||
this.form.form_param = JSON.stringify(this.form.form_param)
|
||||
return true
|
||||
},
|
||||
getFormSelect() {
|
||||
formstruc.getTypes().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
|
||||
this.form_types = res
|
||||
})
|
||||
},
|
||||
load(tree, treeNode, resolve) {
|
||||
setTimeout(() => {
|
||||
resolve(tree.children)
|
||||
}, 100)
|
||||
},
|
||||
booleanFormat(row, index) {
|
||||
if (row.has_child) {
|
||||
return '是'
|
||||
|
||||
@@ -11,12 +11,8 @@
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="query.sale_code" clearable placeholder="订单号" style="width: 200px;"
|
||||
class="filter-item"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘号">
|
||||
<el-input v-model="query.storagevehicle_code" clearable placeholder="托盘号" style="width: 200px;"
|
||||
<el-input v-model="query.vehicle_code" clearable placeholder="托盘号" style="width: 200px;"
|
||||
class="filter-item"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="组盘日期">
|
||||
@@ -38,7 +34,7 @@
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.BOX_STATUS"
|
||||
v-for="item in dict.FORM_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -68,12 +64,38 @@
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog width ="380px" :close-on-click-modal="false" :visible.sync="statusEdit" title="编辑托盘状态">
|
||||
<el-form
|
||||
ref="form"
|
||||
:inline="true"
|
||||
:model="editForm"
|
||||
label-width="100px"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
>
|
||||
<el-form-item label="组盘编码" prop="code">
|
||||
<el-input v-model="editForm.code" disabled style="width: 160px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="editForm.status" placeholder="" style="width: 120px">
|
||||
<el-option
|
||||
v-for="item in dict.FORM_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitStatus">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="code" label="组盘编号">
|
||||
<el-table-column prop="code" label="组盘编号" width="160px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="vechile(scope.row)">{{ scope.row.code }}</el-link>
|
||||
</template>
|
||||
@@ -83,7 +105,7 @@
|
||||
<el-table-column prop="source_form_id" label="源单id" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.BOX_STATUS[scope.row.status] }}
|
||||
{{ dict.label.FORM_STATUS[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="组盘时间"/>
|
||||
@@ -98,7 +120,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<pagination></pagination>
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog ref="viewRef" :form="form" />
|
||||
@@ -107,16 +129,13 @@
|
||||
|
||||
<script>
|
||||
import crudbucketrecord from '@/views/wms/md_manage/group_dick/groupdick'
|
||||
import CRUD, {presenter, header, form, crud} from '@crud/crud'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/md_manage/group_dick/AddDialog'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import ViewDialog from '@/views/wms/md_manage/group_dick/viewDialog'
|
||||
|
||||
import ViewDialog from '@/views/wms/md_manage/group_dick/ViewDialog'
|
||||
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
@@ -127,16 +146,17 @@ const defaultForm = {
|
||||
update_time: '',
|
||||
status: '',
|
||||
tableData: [],
|
||||
form_data: {}
|
||||
form_data: null
|
||||
}
|
||||
export default {
|
||||
name: 'DeliveryOrder',
|
||||
dicts: ['PCS_DELIVER_TYPE', 'BOX_STATUS'],
|
||||
components: {ViewDialog, AddDialog, formstruc,pagination, crudOperation, rrOperation, udOperation},
|
||||
dicts: ['PCS_DELIVER_TYPE', 'FORM_STATUS'],
|
||||
components: { ViewDialog, AddDialog, crudbucketrecord, formstruc, pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '组盘表', url: '/api/mdGruopDick', idField: 'id', sort: 'code,desc',
|
||||
crudMethod: { ...crudbucketrecord },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
@@ -144,17 +164,19 @@ export default {
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: {...crudbucketrecord}
|
||||
query: {
|
||||
form_data: {}
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cols:[],
|
||||
cols: [],
|
||||
GroupShow: false,
|
||||
viewShow: false,
|
||||
statusEdit:false,
|
||||
vachileView:false,
|
||||
editForm:{},
|
||||
editForm: {},
|
||||
classes3: [],
|
||||
uploadShow: false,
|
||||
dialogShow: false,
|
||||
@@ -171,7 +193,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
formstruc.getHeader('md_gruop_dick').then(res => {
|
||||
formstruc.getHeader('md_group_dick').then(res => {
|
||||
this.cols = res
|
||||
})
|
||||
},
|
||||
@@ -180,7 +202,19 @@ export default {
|
||||
},
|
||||
vechile(row){
|
||||
this.$refs.viewRef.setForm(row)
|
||||
}
|
||||
},
|
||||
editStatus(row){
|
||||
this.editForm = row,
|
||||
this.statusEdit = true
|
||||
},
|
||||
submitStatus(){
|
||||
crudbucketrecord.updategroup(this.editForm).then(res => {
|
||||
this.editForm = {}
|
||||
this.crud.notify('编辑成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.statusEdit = false
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="dialogVisible"
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="主载具编码" prop="parent_vehicle_code">
|
||||
<label slot="label">主载具编码:</label>
|
||||
<el-input v-model="form.parent_vehicle_code" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="子托盘总数" prop="child_qty">
|
||||
<label slot="label">子托盘总数:</label>
|
||||
<el-input-number
|
||||
v-model="form.child_qty"
|
||||
:controls="false"
|
||||
:precision="0"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<template v-for="(col,index) in cols">
|
||||
<el-form-item label="col.lable" prop="bill_code">
|
||||
<label slot="label">{{col.lable}}:</label>
|
||||
<el-input v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
|
||||
<el-table-column show-overflow-tooltip prop="vehicle_code" label="载具编号" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].vehicle_code" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="has_child" label="是否含有子载具" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].has_child" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="parent_vehicle_code" label="父载具编码" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].parent_vehicle_code" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].material_name" disabled class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" width="120" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].material_spec" disabled class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="物料批次" width="120" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].pcsn" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="数量" width="120" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].qty" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" width="120" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].qty_unit_name" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column v-for="(item, index) in dtlCols" :key="item.value" :label="item.lable" >
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].form_data[item.value]" class="input-with-select" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="120" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].remark" class="input-with-select" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import vehicleMater from '@/views/wms/md_manage/vehicleMater/vehicleMater'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
parent_vehicle_code: '',
|
||||
child_qty: '0',
|
||||
remark: '',
|
||||
update_name: '',
|
||||
update_time: '',
|
||||
status: '',
|
||||
tableData: [],
|
||||
form_data: {}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'viewDialog',
|
||||
components: { formstruc, vehicleMater },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area', 'PCS_SAL_TYPE'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cols:[],
|
||||
dtlCols:[],
|
||||
tableData:[],
|
||||
dialogVisible: false,
|
||||
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setForm(row){
|
||||
this.form=row
|
||||
this.dialogVisible = true
|
||||
vehicleMater.
|
||||
},
|
||||
open() {
|
||||
formstruc.getHeader('md_gruop_dick').then(res => {
|
||||
this.cols = res
|
||||
res.forEach(a => {
|
||||
this.form.form_data[a.value,'']
|
||||
})
|
||||
}),
|
||||
formstruc.getHeader('md_pb_vehicleivt').then(res => {
|
||||
this.dtlCols = res
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
formatBaseType(row) {
|
||||
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,16 +1,24 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick',
|
||||
url: '/api/MdPbVehicleMater',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getgroupDtl(code) {
|
||||
return request({
|
||||
url: 'api/mdGruopDick/getVehicleMater/' + code,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/',
|
||||
url: '/api/MdPbVehicleMater/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
@@ -18,65 +26,10 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updategroup(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/updategroup',
|
||||
url: '/api/MdPbVehicleMater',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/getHeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceIdByUserId(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/getDeviceIdByUserId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevices(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/addDevices',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRow(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/deleteRow',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: '/api/mdGruopDick/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, addPersons, getHeader, deleteRow, addDevices,excelImport,updategroup }
|
||||
export default { add, getgroupDtl, edit, del }
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
lazy
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:data="crud.data"
|
||||
row-key="id"
|
||||
@select="crud.selectChange"
|
||||
@@ -57,7 +55,7 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120">
|
||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.code }}</el-link>
|
||||
</template>
|
||||
@@ -77,7 +75,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间"/>
|
||||
<el-table-column
|
||||
v-permission="['admin','Classstandard:edit','Classstandard:del']"
|
||||
label="操作"
|
||||
width="120px"
|
||||
align="center"
|
||||
@@ -87,7 +84,6 @@
|
||||
<udOperation
|
||||
style="display: inline"
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="scope.row.is_modify === '0'"
|
||||
:disabled-dle="scope.row.is_modify === '0'"
|
||||
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
||||
@@ -101,16 +97,45 @@
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
<el-dialog
|
||||
title="单据明细"
|
||||
append-to-body
|
||||
:visible.sync="dtlVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="childrenList">
|
||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px" />
|
||||
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
|
||||
<el-table-column prop="material_id" label="物料id" 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="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
|
||||
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
|
||||
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" :label="item.lable" >
|
||||
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dtlVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudMaterialbase from '@/views/wms/base_manage/material/material'
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/views/wms/base_manage/class_standard/classstandard'
|
||||
import crudFormData from "./formData";
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
@@ -118,9 +143,9 @@ import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
|
||||
export default {
|
||||
name: 'FormDia',
|
||||
components: { rrOperation, pagination, Treeselect },
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudMaterialbase }, optShow: {}})
|
||||
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudFormData }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['product_series'],
|
||||
@@ -143,9 +168,9 @@ export default {
|
||||
fromTypes: [],
|
||||
cols: [],
|
||||
dialogVisible: false,
|
||||
classes: [],
|
||||
dtlVisible: false,
|
||||
childrenList: [],
|
||||
tableRadio: null,
|
||||
class_idStr: null,
|
||||
checkrow: null,
|
||||
rows: []
|
||||
}
|
||||
@@ -161,10 +186,6 @@ export default {
|
||||
open() {
|
||||
this.getFromTypes()
|
||||
},
|
||||
created() {
|
||||
console.log("created......")
|
||||
this.getFromTypes()
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.fromTypes.length > 0){
|
||||
formstruc.getHeader(this.query.form_type).then(res => {
|
||||
@@ -183,27 +204,18 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
toView(row){},
|
||||
toView(row){
|
||||
if (row.hasChildren){
|
||||
this.dtlVisible = true
|
||||
this.childrenList = row.children;
|
||||
}
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
seriesFormat(row) {
|
||||
return this.dict.label.product_series[row.product_series]
|
||||
},
|
||||
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (this.isSingle) {
|
||||
if (val.length > 1) {
|
||||
@@ -236,23 +248,8 @@ export default {
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('setMaterValue', this.rows)
|
||||
this.$emit('setMaterValue', this.rows[0].children)
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user