add:任务管理,任务配置,区域管理,点位管理
This commit is contained in:
@@ -0,0 +1,78 @@
|
|||||||
|
package org.nl.wms.sch_manage.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.base.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
|
||||||
|
@RequestMapping("/api/schBasePoint")
|
||||||
|
public class SchBasePointController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService schBasePointService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询点位管理")
|
||||||
|
public ResponseEntity<Object> query(SchBasePointQuery whereJson, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(schBasePointService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增点位管理")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody SchBasePoint entity) {
|
||||||
|
schBasePointService.create(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改点位管理")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody SchBasePoint entity) {
|
||||||
|
schBasePointService.update(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除点位管理")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
schBasePointService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("启动与禁用")
|
||||||
|
@PostMapping("/changeUsed")
|
||||||
|
public ResponseEntity<Object> changeUsedOn(@RequestBody JSONObject jsonObject) {
|
||||||
|
schBasePointService.changeUsed(jsonObject);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getPointList")
|
||||||
|
@Log("获取区域下拉框")
|
||||||
|
public ResponseEntity<Object> getPointList(@RequestBody(required = false) SchBasePoint region) {
|
||||||
|
return new ResponseEntity<>(schBasePointService.getPointList(region), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("锁定与解锁")
|
||||||
|
@PostMapping("/changeLock")
|
||||||
|
public ResponseEntity<Object> changeLock(@RequestBody JSONObject points) {
|
||||||
|
schBasePointService.changeLock(points);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package org.nl.wms.sch_manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.base.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
|
||||||
|
@RequestMapping("/api/schBaseRegion")
|
||||||
|
public class SchBaseRegionController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseRegionService regionService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询区域管理")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(regionService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增区域管理")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody SchBaseRegion entity) {
|
||||||
|
regionService.create(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改区域管理")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody SchBaseRegion entity) {
|
||||||
|
regionService.update(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除区域管理")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
regionService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getRegionList")
|
||||||
|
@Log("获取区域下拉框")
|
||||||
|
public ResponseEntity<Object> getRegionList(@RequestBody(required = false) SchBaseRegion region) {
|
||||||
|
return new ResponseEntity<>(regionService.getRegionList(region), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getPointStatusSelectById")
|
||||||
|
@Log("获取点位状态下拉框")
|
||||||
|
public ResponseEntity<Object> getPointStatusSelectById(@RequestBody String region_id) {
|
||||||
|
return new ResponseEntity<>(regionService.getPointStatusSelectById(region_id), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getPointTypeSelectById")
|
||||||
|
@Log("获取点位类型下拉框")
|
||||||
|
public ResponseEntity<Object> getPointTypeSelectById(@RequestBody String region_id) {
|
||||||
|
return new ResponseEntity<>(regionService.getPointTypeSelectById(region_id), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.nl.wms.sch_manage.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: Liuxy
|
||||||
|
* @Description:
|
||||||
|
* @Date: 2025/5/20
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PointStatusEnum {
|
||||||
|
/**
|
||||||
|
* 空位/无货
|
||||||
|
*/
|
||||||
|
EMPTY_POINT("1", "空位/无货"),
|
||||||
|
/**
|
||||||
|
* 有料
|
||||||
|
*/
|
||||||
|
FULL_POINT("3", "有料"),
|
||||||
|
/**
|
||||||
|
* 空载具/有货
|
||||||
|
*/
|
||||||
|
EMPTY_VEHICLE("2", "空载具/有货");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String label;
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package org.nl.wms.sch_manage.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务接口
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return IPage<SchBasePoint>
|
||||||
|
*/
|
||||||
|
IPage<SchBasePoint> queryAll(SchBasePointQuery whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
*
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void create(SchBasePoint entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void update(SchBasePoint entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
*
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 改变启用状态
|
||||||
|
*
|
||||||
|
* @param jsonObject 参数
|
||||||
|
*/
|
||||||
|
void changeUsed(JSONObject jsonObject);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取点位
|
||||||
|
*
|
||||||
|
* @param region 参数
|
||||||
|
* @return List<SchBasePoint>
|
||||||
|
*/
|
||||||
|
List<SchBasePoint> getPointList(SchBasePoint region);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解锁/上锁
|
||||||
|
*
|
||||||
|
* @param points 参数
|
||||||
|
*/
|
||||||
|
void changeLock(JSONObject points);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有未解锁的点位
|
||||||
|
*
|
||||||
|
* @return List<SchBasePoint>
|
||||||
|
*/
|
||||||
|
List<SchBasePoint> getAllUnlockAbnormalPoints();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行锁获取对应点位
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @return SchBasePoint
|
||||||
|
*/
|
||||||
|
SchBasePoint selectByIdLock(String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package org.nl.wms.sch_manage.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务接口
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
public interface ISchBaseRegionService extends IService<SchBaseRegion> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return IPage<SchBaseRegion>
|
||||||
|
*/
|
||||||
|
IPage<SchBaseRegion> queryAll(Map whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
*
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void create(SchBaseRegion entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void update(SchBaseRegion entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
*
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域下拉框
|
||||||
|
*
|
||||||
|
* @param region 区域
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<SchBaseRegion> getRegionList(SchBaseRegion region);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取点位状态下拉框
|
||||||
|
*
|
||||||
|
* @param regionId /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
JSONArray getPointStatusSelectById(String regionId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取点位类型下拉框
|
||||||
|
*
|
||||||
|
* @param regionId /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
JSONArray getPointTypeSelectById(String regionId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description /
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("sch_base_point")
|
||||||
|
public class SchBasePoint implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "point_code")
|
||||||
|
|
||||||
|
private String point_code;
|
||||||
|
|
||||||
|
|
||||||
|
private String point_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String region_code;
|
||||||
|
|
||||||
|
|
||||||
|
private String region_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String point_type;
|
||||||
|
|
||||||
|
|
||||||
|
private String point_status;
|
||||||
|
|
||||||
|
|
||||||
|
private String can_material_type;
|
||||||
|
|
||||||
|
|
||||||
|
private String can_vehicle_type;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer vehicle_max_qty;
|
||||||
|
|
||||||
|
|
||||||
|
private String vehicle_type;
|
||||||
|
|
||||||
|
|
||||||
|
private String vehicle_code;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer vehicle_qty;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer block_num;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer row_num;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer col_num;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer layer_num;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer in_order_seq;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer out_order_seq;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer in_empty_seq;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer out_empty_seq;
|
||||||
|
|
||||||
|
|
||||||
|
private String parent_point_code;
|
||||||
|
|
||||||
|
|
||||||
|
private String ext_point_code;
|
||||||
|
|
||||||
|
|
||||||
|
private String ing_task_code;
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean is_has_workder;
|
||||||
|
|
||||||
|
|
||||||
|
private String workshop_code;
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean is_auto;
|
||||||
|
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean is_used;
|
||||||
|
|
||||||
|
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
|
||||||
|
private String update_id;
|
||||||
|
|
||||||
|
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<String> can_vehicle_types;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String point_type_name;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String point_status_name;
|
||||||
|
|
||||||
|
// 组盘标识
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String group_id;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String record_id;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String device_code;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String material_qty;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String material_code;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String material_name;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String material_spec;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String material_model;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String raw_material_code;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String task_warn;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description /
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("sch_base_region")
|
||||||
|
public class SchBaseRegion implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "region_code")
|
||||||
|
private String region_code;
|
||||||
|
|
||||||
|
|
||||||
|
private String region_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String point_type_explain;
|
||||||
|
|
||||||
|
|
||||||
|
private String point_status_explain;
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean is_has_workder;
|
||||||
|
|
||||||
|
|
||||||
|
private String workshop_code;
|
||||||
|
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
|
||||||
|
private String update_id;
|
||||||
|
|
||||||
|
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer order_seq;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量禁用启用
|
||||||
|
*
|
||||||
|
* @param pointCodes 参数
|
||||||
|
* @param used 参数
|
||||||
|
*/
|
||||||
|
void batchChangeUsed(List<String> pointCodes, Boolean used);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得所有解锁异常点
|
||||||
|
*
|
||||||
|
* @return List<SchBasePoint>
|
||||||
|
*/
|
||||||
|
List<SchBasePoint> getAllUnlockAbnormalPoints();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行锁获取id的点位
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @return SchBasePoint
|
||||||
|
*/
|
||||||
|
SchBasePoint selectByIdLock(String id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点位left join查询
|
||||||
|
*
|
||||||
|
* @param pages 参数
|
||||||
|
* @return IPage<SchBasePoint>
|
||||||
|
*/
|
||||||
|
IPage<SchBasePoint> selectPageLeftJoin(IPage<SchBasePoint> pages, SchBasePointQuery whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper">
|
||||||
|
|
||||||
|
<update id="batchChangeUsed">
|
||||||
|
UPDATE sch_base_point
|
||||||
|
SET is_used = #{used}
|
||||||
|
<where>
|
||||||
|
point_code IN
|
||||||
|
<foreach collection="pointCodes" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
<select id="getAllUnlockAbnormalPoints" resultType="org.nl.wms.sch_manage.service.dao.SchBasePoint">
|
||||||
|
SELECT p.*
|
||||||
|
FROM `sch_base_point` p
|
||||||
|
LEFT JOIN sch_base_task t ON t.task_code = p.ing_task_code
|
||||||
|
WHERE p.ing_task_code IS NOT NULL
|
||||||
|
AND p.ing_task_code != '' AND (t.task_status = '5' OR t.task_status = '6')
|
||||||
|
</select>
|
||||||
|
<select id="selectByIdLock" resultType="org.nl.wms.sch_manage.service.dao.SchBasePoint">
|
||||||
|
SELECT p.*
|
||||||
|
FROM `sch_base_point` p
|
||||||
|
WHERE p.point_code = #{id}
|
||||||
|
FOR UPDATE
|
||||||
|
</select>
|
||||||
|
<select id="selectPageLeftJoin" resultType="org.nl.wms.sch_manage.service.dao.SchBasePoint"
|
||||||
|
parameterType="org.nl.wms.sch_manage.service.dto.SchBasePointQuery">
|
||||||
|
SELECT
|
||||||
|
p.*
|
||||||
|
FROM
|
||||||
|
`sch_base_point` p
|
||||||
|
<where>
|
||||||
|
<if test="whereJson.workshop_code != null and workshop_code != ''">
|
||||||
|
p.workshop_code = #{whereJson.workshop_code}
|
||||||
|
</if>
|
||||||
|
<if test="whereJson.blurry != null">
|
||||||
|
AND (p.point_code LIKE '%${whereJson.blurry}%' OR p.point_name LIKE '%${whereJson.blurry}%')
|
||||||
|
</if>
|
||||||
|
<if test="whereJson.region_code != null">
|
||||||
|
AND p.region_code = #{whereJson.region_code}
|
||||||
|
</if>
|
||||||
|
<if test="whereJson.point_type != null">
|
||||||
|
AND p.point_type = #{whereJson.point_type}
|
||||||
|
</if>
|
||||||
|
<if test="whereJson.point_status != null">
|
||||||
|
AND p.point_status = #{whereJson.point_status}
|
||||||
|
</if>
|
||||||
|
<if test="whereJson.is_used != null">
|
||||||
|
AND p.is_used = #{whereJson.is_used}
|
||||||
|
</if>
|
||||||
|
<choose>
|
||||||
|
<!-- Case: whereJson.lock_type is true -->
|
||||||
|
<when test="whereJson.lock_type">
|
||||||
|
AND (p.ing_task_code IS NOT NULL AND p.ing_task_code <![CDATA[<>]]> '')
|
||||||
|
</when>
|
||||||
|
<!-- Case: whereJson.lock_type is false -->
|
||||||
|
<otherwise>
|
||||||
|
AND (p.ing_task_code IS NULL OR p.ing_task_code = '')
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</where>
|
||||||
|
ORDER BY p.region_code, p.point_code, p.point_type
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
public interface SchBaseRegionMapper extends BaseMapper<SchBaseRegion> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.wms.sch_manage.service.dao.mapper.SchBaseRegionMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class SchBasePointQuery implements Serializable {
|
||||||
|
private String blurry;
|
||||||
|
private String workshop_code;
|
||||||
|
private String region_code;
|
||||||
|
private String point_type;
|
||||||
|
private String point_status;
|
||||||
|
private Boolean is_used;
|
||||||
|
private Boolean lock_type;
|
||||||
|
private Boolean parent_point;
|
||||||
|
}
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.sch_manage.enums.PointStatusEnum;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.mapper.SchBaseRegionMapper;
|
||||||
|
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
||||||
|
import org.nl.wms.sch_manage.service.util.PointUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务实现
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, SchBasePoint> implements ISchBasePointService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBasePointMapper pointMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBaseRegionMapper regionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<SchBasePoint> queryAll(SchBasePointQuery whereJson, PageQuery page) {
|
||||||
|
IPage<SchBasePoint> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
pages = pointMapper.selectPageLeftJoin(pages, whereJson);
|
||||||
|
// 可以存放的载具类型
|
||||||
|
pages.getRecords().forEach(point -> {
|
||||||
|
if (ObjectUtil.isNotEmpty(point.getCan_vehicle_type())) {
|
||||||
|
point.setCan_vehicle_types(Arrays.asList(point.getCan_vehicle_type().split(",")));
|
||||||
|
}
|
||||||
|
String pointStatus = point.getPoint_status(); // 点位状态
|
||||||
|
String pointType = point.getPoint_type(); // 点位类型
|
||||||
|
SchBaseRegion regionObj = regionMapper.selectById(point.getRegion_code());
|
||||||
|
if (ObjectUtil.isNotEmpty(regionObj)) {
|
||||||
|
if (ObjectUtil.isNotEmpty(pointStatus) && ObjectUtil.isNotEmpty(regionObj.getPoint_status_explain())) {
|
||||||
|
// 设置
|
||||||
|
point.setPoint_status_name(PointUtils.getStatusOrTypeName(
|
||||||
|
regionObj.getPoint_status_explain(), pointStatus));
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pointType) && ObjectUtil.isNotEmpty(regionObj.getPoint_type_explain())) {
|
||||||
|
// 设置
|
||||||
|
point.setPoint_type_name(PointUtils.getStatusOrTypeName(
|
||||||
|
regionObj.getPoint_type_explain(), pointType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(SchBasePoint entity) {
|
||||||
|
String point_code = entity.getPoint_code();
|
||||||
|
SchBasePoint pointObj = pointMapper.selectById(point_code);
|
||||||
|
if (ObjectUtil.isNotEmpty(pointObj) && !pointObj.getPoint_code().equals(entity.getPoint_code())) {
|
||||||
|
throw new BadRequestException("存在相同的点位编码");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认父类点位为自身
|
||||||
|
if (ObjectUtil.isEmpty(entity.getParent_point_code())) {
|
||||||
|
entity.setParent_point_code(entity.getPoint_code());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(entity.getCan_vehicle_types())) {
|
||||||
|
String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||||
|
entity.setCan_vehicle_type(can_vehicle_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
// 获取region_name
|
||||||
|
SchBaseRegion baseRegion = regionMapper.selectById(entity.getRegion_code());
|
||||||
|
entity.setRegion_name(baseRegion.getRegion_name());
|
||||||
|
|
||||||
|
entity.setCreate_id(currentUserId);
|
||||||
|
entity.setCreate_name(nickName);
|
||||||
|
entity.setCreate_time(now);
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
pointMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(SchBasePoint entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
// 获取region_name
|
||||||
|
SchBaseRegion baseRegion = regionMapper.selectById(entity.getRegion_code());
|
||||||
|
entity.setRegion_name(baseRegion.getRegion_name());
|
||||||
|
if (ObjectUtil.isNotEmpty(entity.getCan_vehicle_types())) {
|
||||||
|
String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||||
|
entity.setCan_vehicle_type(can_vehicle_type);
|
||||||
|
}
|
||||||
|
String pointStatus = entity.getPoint_status();
|
||||||
|
// 根据点位状态来判断更新内容
|
||||||
|
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals(PointStatusEnum.EMPTY_POINT.getCode())) {
|
||||||
|
entity.setVehicle_type("");
|
||||||
|
entity.setVehicle_code("");
|
||||||
|
}
|
||||||
|
pointMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Set<String> ids) {
|
||||||
|
// 真删除
|
||||||
|
pointMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void changeUsed(JSONObject jsonObject) {
|
||||||
|
// 不可能为空
|
||||||
|
JSONArray data = jsonObject.getJSONArray("data");
|
||||||
|
Boolean used = jsonObject.getBoolean("used");
|
||||||
|
Assert.notNull(data, "数据为空!");
|
||||||
|
Assert.notNull(used, "数据为空!");
|
||||||
|
List<SchBasePoint> schBasePoints = JSONArray.parseArray(JSONArray.toJSONString(data), SchBasePoint.class);
|
||||||
|
// 获取所有pointCode
|
||||||
|
List<String> pointCodes = schBasePoints.stream()
|
||||||
|
.map(SchBasePoint::getPoint_code)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
pointMapper.batchChangeUsed(pointCodes, used);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SchBasePoint> getPointList(SchBasePoint region) {
|
||||||
|
if (ObjectUtil.isEmpty(region)) {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
return pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getRegion_code, region.getRegion_code())
|
||||||
|
.eq(SchBasePoint::getIs_has_workder, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void changeLock(JSONObject points) {
|
||||||
|
JSONArray data = points.getJSONArray("data");
|
||||||
|
Boolean lockType = points.getBoolean("lock_type");
|
||||||
|
List<SchBasePoint> pointList = data.toJavaList(SchBasePoint.class);
|
||||||
|
pointList.forEach(point -> point.setIng_task_code(lockType ? "" : "-"));
|
||||||
|
this.updateBatchById(pointList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SchBasePoint> getAllUnlockAbnormalPoints() {
|
||||||
|
return pointMapper.getAllUnlockAbnormalPoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SchBasePoint selectByIdLock(String id) {
|
||||||
|
return pointMapper.selectByIdLock(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.mapper.SchBaseRegionMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Liuxy
|
||||||
|
* @description 服务实现
|
||||||
|
* @date 2025-05-20
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, SchBaseRegion> implements ISchBaseRegionService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBaseRegionMapper schBaseRegionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<SchBaseRegion> queryAll(Map whereJson, PageQuery page) {
|
||||||
|
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code")) ? whereJson.get("workshop_code").toString() : null;
|
||||||
|
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||||
|
Boolean is_has_workder = ObjectUtil.isNotEmpty(whereJson.get("is_has_workder")) ? Boolean.valueOf(whereJson.get("is_has_workder").toString()) : null;
|
||||||
|
LambdaQueryWrapper<SchBaseRegion> lam = new LambdaQueryWrapper<>();
|
||||||
|
lam.eq(ObjectUtil.isNotEmpty(workshop_code), SchBaseRegion::getWorkshop_code, workshop_code)
|
||||||
|
.eq(ObjectUtil.isNotEmpty(is_has_workder), SchBaseRegion::getIs_has_workder, is_has_workder)
|
||||||
|
.like(ObjectUtil.isNotEmpty(blurry), SchBaseRegion::getRegion_code, blurry)
|
||||||
|
.or(ObjectUtil.isNotEmpty(blurry), la -> la.like(SchBaseRegion::getRegion_name, blurry))
|
||||||
|
.orderByAsc(SchBaseRegion::getOrder_seq);
|
||||||
|
IPage<SchBaseRegion> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
schBaseRegionMapper.selectPage(pages, lam);
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(SchBaseRegion entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
entity.setCreate_id(currentUserId);
|
||||||
|
entity.setCreate_name(nickName);
|
||||||
|
entity.setCreate_time(now);
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
schBaseRegionMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(SchBaseRegion entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
|
||||||
|
schBaseRegionMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Set<String> ids) {
|
||||||
|
// 真删除
|
||||||
|
schBaseRegionMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SchBaseRegion> getRegionList(SchBaseRegion region) {
|
||||||
|
return schBaseRegionMapper.selectList(new LambdaQueryWrapper<SchBaseRegion>()
|
||||||
|
.eq(ObjectUtil.isNotEmpty(region), SchBaseRegion::getIs_has_workder, true)
|
||||||
|
.orderByAsc(SchBaseRegion::getOrder_seq));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getPointStatusSelectById(String regionId) {
|
||||||
|
/**
|
||||||
|
* label,value
|
||||||
|
*/
|
||||||
|
SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId);
|
||||||
|
JSONArray res = new JSONArray();
|
||||||
|
String pointStatusExplain = schBaseRegion.getPoint_status_explain();
|
||||||
|
if (ObjectUtil.isEmpty(pointStatusExplain)) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
String[] explain = pointStatusExplain.split(",");
|
||||||
|
for (int i = 0; i < explain.length; i++) {
|
||||||
|
String[] status = explain[i].split("-");
|
||||||
|
JSONObject point_status = new JSONObject();
|
||||||
|
point_status.put("label", status[1]);
|
||||||
|
point_status.put("value", status[0]);
|
||||||
|
res.add(point_status);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getPointTypeSelectById(String regionId) {
|
||||||
|
/**
|
||||||
|
* label,value
|
||||||
|
*/
|
||||||
|
SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId);
|
||||||
|
JSONArray res = new JSONArray();
|
||||||
|
String pointTypeExplain = schBaseRegion.getPoint_type_explain();
|
||||||
|
if (ObjectUtil.isEmpty(pointTypeExplain)) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
String[] explain = pointTypeExplain.split(",");
|
||||||
|
for (int i = 0; i < explain.length; i++) {
|
||||||
|
String[] types = explain[i].split("-");
|
||||||
|
JSONObject point_type = new JSONObject();
|
||||||
|
point_type.put("label", types[1]);
|
||||||
|
point_type.put("value", types[0]);
|
||||||
|
res.add(point_type);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.nl.wms.sch_manage.service.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: Liuxy
|
||||||
|
* @Description: 点位工具类
|
||||||
|
* @Date: 2025/5/20
|
||||||
|
*/
|
||||||
|
public class PointUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态名或者类型名
|
||||||
|
*
|
||||||
|
* @param explain 参数
|
||||||
|
* @param label 参数
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static String getStatusOrTypeName(String explain, String label) {
|
||||||
|
JSONObject statusArr = new JSONObject();
|
||||||
|
String[] split = explain.split(",");
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
String[] status = split[j].split("-");
|
||||||
|
statusArr.put(status[0], status[1]);
|
||||||
|
}
|
||||||
|
// 设置
|
||||||
|
return statusArr.getString(label);
|
||||||
|
}
|
||||||
|
}
|
||||||
172
wms/nladmin-ui/src/views/wms/sch/point/PointDialog.vue
Normal file
172
wms/nladmin-ui/src/views/wms/sch/point/PointDialog.vue
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="父类点位选择"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
destroy-on-close
|
||||||
|
width="1000px"
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="点位名称">
|
||||||
|
<el-input
|
||||||
|
v-model="query.blurry"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用">
|
||||||
|
<el-switch
|
||||||
|
v-model="query.is_used"
|
||||||
|
:active-value="true"
|
||||||
|
:inactive-value="false"
|
||||||
|
@change="crud.toQuery()"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
size="mini"
|
||||||
|
border
|
||||||
|
:cell-style="{'text-align':'center'}"
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||||
|
@select="handleSelectionChange"
|
||||||
|
@current-change="clickChange"
|
||||||
|
>
|
||||||
|
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||||
|
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="point_code" label="点位名称" width="160" />
|
||||||
|
<el-table-column prop="point_name" label="点位编码" width="180" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />
|
||||||
|
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
|
||||||
|
<el-table-column prop="point_type_name" label="点位类型" :min-width="flexWidth('point_type_name',crud.data,'点位类型')"/>
|
||||||
|
<el-table-column prop="point_status_name" label="点位状态" :min-width="flexWidth('point_status_name',crud.data,'点位类型')"/>
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||||
|
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_used?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import CRUD, { header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'PointDialog',
|
||||||
|
components: { rrOperation, pagination },
|
||||||
|
dicts: ['is_used'],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '点位',
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
optShow: {},
|
||||||
|
query: {
|
||||||
|
is_used: true,
|
||||||
|
parent_point: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isSingle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
tableRadio: null,
|
||||||
|
tableData: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickChange(item) {
|
||||||
|
this.tableRadio = item
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
|
||||||
|
},
|
||||||
|
handleSelectionChange(val, row) {
|
||||||
|
if (val.length > 1 && this.isSingle) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(val.pop())
|
||||||
|
} else {
|
||||||
|
this.checkrow = row
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSelectAll() {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
// 处理单选
|
||||||
|
if (this.isSingle && this.tableRadio) {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.rows = this.$refs.table.selection
|
||||||
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选点位')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
217
wms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue
Normal file
217
wms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="点位详情"
|
||||||
|
append-to-body
|
||||||
|
fullscreen
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@open="open"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-weight: bold;font-size: 15px;">点位信息:</span>
|
||||||
|
<!-- <el-button style="float: right; padding: 3px 10px;" type="text">操作按钮</el-button>-->
|
||||||
|
</div>
|
||||||
|
<el-form ref="form" disabled :inline="true" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||||
|
<el-form-item label="区域编码">
|
||||||
|
<el-input v-model="form.region_code" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域名称">
|
||||||
|
<el-input v-model="form.region_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位编码">
|
||||||
|
<el-input v-model="form.point_code" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位名称">
|
||||||
|
<el-input v-model="form.point_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位类型">
|
||||||
|
<el-input v-model="form.point_type_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位状态">
|
||||||
|
<el-input v-model="form.point_status_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="载具类型">
|
||||||
|
<el-input v-model="form.vehicle_type" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="载具编码">
|
||||||
|
<el-input v-model="form.vehicle_code" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="载具数量">
|
||||||
|
<el-input v-model="form.vehicle_qty" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card" shadow="always">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-weight: bold;font-size: 15px;">库存信息:</span>
|
||||||
|
<!-- <el-button style="float: right; padding: 3px 10px;" type="text">操作按钮</el-button>-->
|
||||||
|
</div>
|
||||||
|
<el-form ref="form" disabled :inline="true" :model="groups" :rules="rules" size="mini" label-width="100px">
|
||||||
|
<el-form-item label="物料编码">
|
||||||
|
<el-input v-model="groups.material_code" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料名称">
|
||||||
|
<el-input v-model="groups.material_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料规格">
|
||||||
|
<el-input v-model="groups.material_spec" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="泥料编码">
|
||||||
|
<el-input v-model="groups.raw_material_code" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料批次">
|
||||||
|
<el-input v-model="groups.pcsn" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料数量">
|
||||||
|
<el-input v-model="groups.material_qty" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料重量">
|
||||||
|
<el-input v-model="groups.material_weight" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备">
|
||||||
|
<el-input v-model="groups.point_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库时间">
|
||||||
|
<el-input v-model="groups.instorage_time" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="静置时间(分)">
|
||||||
|
<el-input v-model="groups.standing_time" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="绑定状态">
|
||||||
|
<el-input v-model="groups.group_bind_material_status_name" style="width: 200px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { crud } from '@crud/crud'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ViewDialog',
|
||||||
|
components: {},
|
||||||
|
dicts: ['group_bind_material_status'],
|
||||||
|
mixins: [crud()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
classes3: [],
|
||||||
|
parentData: {},
|
||||||
|
form: {
|
||||||
|
point_code: null,
|
||||||
|
point_name: null,
|
||||||
|
region_code: null,
|
||||||
|
region_name: null,
|
||||||
|
point_type: null,
|
||||||
|
point_status: null,
|
||||||
|
can_material_type: null,
|
||||||
|
can_vehicle_type: null,
|
||||||
|
vehicle_max_qty: null,
|
||||||
|
vehicle_type: null,
|
||||||
|
vehicle_code: null,
|
||||||
|
vehicle_qty: 0,
|
||||||
|
block_num: null,
|
||||||
|
row_num: null,
|
||||||
|
col_num: null,
|
||||||
|
layer_num: null,
|
||||||
|
in_order_seq: null,
|
||||||
|
out_order_seq: null,
|
||||||
|
in_empty_seq: null,
|
||||||
|
out_empty_seq: null,
|
||||||
|
parent_point_code: null,
|
||||||
|
ext_point_code: null,
|
||||||
|
ing_task_code: null,
|
||||||
|
is_has_workder: 'true',
|
||||||
|
workshop_code: null,
|
||||||
|
is_auto: 'true',
|
||||||
|
remark: null,
|
||||||
|
is_used: 'true',
|
||||||
|
can_vehicle_types: null
|
||||||
|
},
|
||||||
|
groups: {
|
||||||
|
group_id: null,
|
||||||
|
vehicle_code: null,
|
||||||
|
material_id: null,
|
||||||
|
child_vehicle_code: null,
|
||||||
|
source_vehicle_code: null,
|
||||||
|
point_code: null,
|
||||||
|
point_name: null,
|
||||||
|
is_full: true,
|
||||||
|
pcsn: null,
|
||||||
|
instorage_time: null,
|
||||||
|
standing_time: null,
|
||||||
|
material_qty: null,
|
||||||
|
material_weight: null,
|
||||||
|
workorder_code: null,
|
||||||
|
group_number: null,
|
||||||
|
task_code: null,
|
||||||
|
ext_data: null,
|
||||||
|
workshop_code: null,
|
||||||
|
group_status: null,
|
||||||
|
table_name: null,
|
||||||
|
group_bind_material_status_name: null,
|
||||||
|
table_fk: null,
|
||||||
|
table_fk_id: null,
|
||||||
|
buss_move_id: null,
|
||||||
|
is_first_flow_task: true,
|
||||||
|
flow_code: null,
|
||||||
|
flow_num: null,
|
||||||
|
before_task_code: null,
|
||||||
|
next_task_code: null,
|
||||||
|
remark: null,
|
||||||
|
is_delete: false
|
||||||
|
},
|
||||||
|
workprocedureList: [],
|
||||||
|
tableData: [],
|
||||||
|
rules: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('AddChanged')
|
||||||
|
},
|
||||||
|
setParentData(parentData) {
|
||||||
|
if (parentData) {
|
||||||
|
console.log(parentData)
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.form = parentData
|
||||||
|
// 根据载具编码获取信息
|
||||||
|
const param = {
|
||||||
|
vehicle_code: parentData.vehicle_code,
|
||||||
|
vehicle_type: parentData.vehicle_type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
::v-deep .el-card__header {
|
||||||
|
padding: 5px 0 5px 10px;
|
||||||
|
background-color: #f8f8f9;
|
||||||
|
}
|
||||||
|
::v-deep .el-card__body {
|
||||||
|
padding: 10px 0 10px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
548
wms/nladmin-ui/src/views/wms/sch/point/index.vue
Normal file
548
wms/nladmin-ui/src/views/wms/sch/point/index.vue
Normal file
@@ -0,0 +1,548 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="90px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="query.workshop_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="所属车间"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="模糊搜索">
|
||||||
|
<el-input
|
||||||
|
v-model="query.blurry"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="编码名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域类型">
|
||||||
|
<el-select
|
||||||
|
v-model="query.region_code"
|
||||||
|
@clear="handleClear"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="区域类型"
|
||||||
|
class="filter-item"
|
||||||
|
@change="getPointStatusAndTypeList(query.region_code, 1)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in regionList"
|
||||||
|
:label="item.region_name"
|
||||||
|
:value="item.region_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位类型">
|
||||||
|
<el-select
|
||||||
|
v-model="query.point_type"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位类型"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointTypesList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.point_status"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位状态"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointStatusList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="锁定类型">
|
||||||
|
<el-switch
|
||||||
|
v-model="query.lock_type"
|
||||||
|
:active-value="true"
|
||||||
|
:inactive-value="false"
|
||||||
|
active-color="#409EFF"
|
||||||
|
inactive-color="#C0CCDA"
|
||||||
|
@change="hand"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用">
|
||||||
|
<el-switch
|
||||||
|
v-model="query.is_used"
|
||||||
|
active-value="true"
|
||||||
|
inactive-value="false"
|
||||||
|
active-color="#409EFF"
|
||||||
|
inactive-color="#C0CCDA"
|
||||||
|
@change="hand"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" >
|
||||||
|
<el-button
|
||||||
|
v-if="crud.query.is_used == 'false'"
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-circle-check"
|
||||||
|
:disabled="crud.selections.length === 0"
|
||||||
|
@click="changeUsed(crud.selections, true)"
|
||||||
|
>
|
||||||
|
启用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="crud.query.is_used == 'true'"
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-circle-close"
|
||||||
|
:disabled="crud.selections.length === 0"
|
||||||
|
@click="changeUsed(crud.selections, false)"
|
||||||
|
>
|
||||||
|
禁用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="!crud.query.lock_type"
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-circle-check"
|
||||||
|
:disabled="crud.selections.length === 0"
|
||||||
|
@click="changeLock(crud.selections)"
|
||||||
|
>
|
||||||
|
锁定
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="crud.query.lock_type"
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-circle-close"
|
||||||
|
:disabled="crud.selections.length === 0"
|
||||||
|
@click="changeLock(crud.selections)"
|
||||||
|
>
|
||||||
|
解锁
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="540px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;">
|
||||||
|
<el-form-item v-if="false" label="点位标识" prop="point_id">
|
||||||
|
<el-input v-model="form.point_id" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="form.workshop_code"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属区域" prop="region_code">
|
||||||
|
<el-select
|
||||||
|
v-model="form.region_code"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
@change="getPointStatusAndTypeList(form.region_code, 2)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in regionList"
|
||||||
|
:label="item.region_name"
|
||||||
|
:value="item.region_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位编码" prop="point_code">
|
||||||
|
<el-input v-model="form.point_code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位名称" prop="point_name">
|
||||||
|
<el-input v-model="form.point_name" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="pointStatusDialogList.length > 0" label="点位状态" prop="point_status">
|
||||||
|
<el-select
|
||||||
|
v-model="form.point_status"
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位状态"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 370px;"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointStatusDialogList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-show="pointTypesDialogList.length > 0" label="点位类型" prop="device_point_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.point_type"
|
||||||
|
size="mini"
|
||||||
|
placeholder="设备点位类型"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointTypesDialogList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="父类编码" prop="vehicle_code">
|
||||||
|
<el-input v-model="form.parent_point_code" clearable style="width: 370px;" @focus="getParentPoint"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.point_status !== '1'" label="载具编码" prop="vehicle_code">
|
||||||
|
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.point_status !== '1'" label="载具类型" prop="vehicle_code">
|
||||||
|
<el-select v-model="form.vehicle_type" placeholder="请选择" clearable style="width: 370px;">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.vehicle_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="可放载具类型" prop="can_vehicle_types">
|
||||||
|
<el-select v-model="form.can_vehicle_types" multiple placeholder="请选择" clearable style="width: 370px;">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.vehicle_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="载具数量" prop="vehicle_qty">
|
||||||
|
<el-input-number style="width: 370px;" :controls="false" class="clear-number-input" v-model="form.vehicle_qty" :min="0" :precision="0" :max="99999" label="载具数量" size="mini" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否有工单">
|
||||||
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_has_workder" :label="item.value">{{ item.label }}</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否自动">
|
||||||
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_auto" :label="item.value">{{ item.label }}</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
||||||
|
</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>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<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="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />
|
||||||
|
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" />
|
||||||
|
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" />
|
||||||
|
<el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />
|
||||||
|
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
|
||||||
|
<el-table-column prop="point_type_name" label="点位类型" :min-width="flexWidth('point_type_name',crud.data,'点位类型')"/>
|
||||||
|
<el-table-column prop="point_status_name" label="点位状态" :min-width="flexWidth('point_status_name',crud.data,'点位类型')"/>
|
||||||
|
<!-- <el-table-column prop="point_type" label="点位类型" :min-width="flexWidth('point_type',crud.data,'点位类型')" />-->
|
||||||
|
<!-- <el-table-column prop="point_status" label="点位状态" :min-width="flexWidth('point_status',crud.data,'点位状态')" />-->
|
||||||
|
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 30)">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
|
||||||
|
<el-table-column prop="vehicle_qty" label="载具数量" :min-width="flexWidth('vehicle_qty',crud.data,'载具数量')" />
|
||||||
|
<el-table-column label="是否锁定" :min-width="flexWidth('vehicle_qty',crud.data,'是否锁定')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.ing_task_code?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'载具数量')" />
|
||||||
|
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'载具数量')" />
|
||||||
|
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'载具数量')" />
|
||||||
|
<el-table-column prop="material_model" label="物料型号" :min-width="flexWidth('material_model',crud.data,'载具数量')" />
|
||||||
|
<el-table-column prop="material_qty" label="物料数量" :min-width="flexWidth('material_qty',crud.data,'载具数量')" />
|
||||||
|
<el-table-column prop="parent_point_code" label="父点位编码" :min-width="flexWidth('parent_point_code',crud.data,'父点位编码')"/>
|
||||||
|
<el-table-column prop="ing_task_code" label="在执行的任务标识" :min-width="flexWidth('ing_task_code',crud.data,'在执行的任务标识')" />
|
||||||
|
<el-table-column prop="is_has_workder" label="是否有工单" :min-width="flexWidth('is_has_workder',crud.data,'是否有工单')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_has_workder?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="is_auto" label="是否自动" :min-width="flexWidth('is_auto',crud.data,'是否自动')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_auto?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||||
|
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_used?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||||
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||||
|
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||||
|
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||||
|
<el-table-column v-permission="[]" label="操作" width="200px" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
style="display: inline"
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
v-if="showButton(scope.row.point_status)"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-view"
|
||||||
|
@click="toView(scope.row)"
|
||||||
|
>
|
||||||
|
查看详情
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<ViewDialog ref="viewDialog"/>
|
||||||
|
<PointDialog :dialog-show.sync="pointDialog" :is-single="false" @tableChanged="tableChanged"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||||
|
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||||
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import ViewDialog from '@/views/wms/sch/point/ViewDialog'
|
||||||
|
import PointDialog from '@/views/wms/sch/point/PointDialog'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
point_code: null,
|
||||||
|
point_name: null,
|
||||||
|
region_code: null,
|
||||||
|
region_name: null,
|
||||||
|
point_type: null,
|
||||||
|
point_status: null,
|
||||||
|
can_material_type: null,
|
||||||
|
can_vehicle_type: null,
|
||||||
|
vehicle_max_qty: null,
|
||||||
|
vehicle_type: null,
|
||||||
|
vehicle_code: null,
|
||||||
|
vehicle_qty: 0,
|
||||||
|
block_num: null,
|
||||||
|
row_num: null,
|
||||||
|
col_num: null,
|
||||||
|
layer_num: null,
|
||||||
|
in_order_seq: null,
|
||||||
|
out_order_seq: null,
|
||||||
|
in_empty_seq: null,
|
||||||
|
out_empty_seq: null,
|
||||||
|
parent_point_code: null,
|
||||||
|
ext_point_code: null,
|
||||||
|
ing_task_code: null,
|
||||||
|
is_has_workder: 'true',
|
||||||
|
workshop_code: null,
|
||||||
|
is_auto: 'true',
|
||||||
|
remark: null,
|
||||||
|
is_used: 'true',
|
||||||
|
can_vehicle_types: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'Point',
|
||||||
|
dicts: ['vehicle_type', 'TrueOrFalse'],
|
||||||
|
components: { PointDialog, ViewDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '点位管理',
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
idField: 'point_code',
|
||||||
|
sort: 'point_code,desc',
|
||||||
|
crudMethod: { ...crudSchBasePoint },
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
is_used: 'true',
|
||||||
|
lock_type: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {},
|
||||||
|
rules: {
|
||||||
|
point_code: [
|
||||||
|
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
point_name: [
|
||||||
|
{ required: true, message: '点位名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
point_type: [
|
||||||
|
{ required: true, message: '点位类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
region_code: [
|
||||||
|
{ required: true, message: '区域类型不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
workShopList: [
|
||||||
|
{ 'name': '第一车间', 'code': 'A1' }
|
||||||
|
],
|
||||||
|
regionList: [],
|
||||||
|
pointTypesList: [],
|
||||||
|
pointStatusList: [],
|
||||||
|
pointStatusDialogList: [],
|
||||||
|
pointTypesDialogList: [],
|
||||||
|
pointDialog: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getRegionList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeToCU]() {
|
||||||
|
this.form.is_has_workder = this.form.is_has_workder.toString()
|
||||||
|
this.form.is_auto = this.form.is_auto.toString()
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.afterToCU]() {
|
||||||
|
if (this.form.region_code) {
|
||||||
|
this.getPointStatusAndTypeList(this.form.region_code, 2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hand(value) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
getRegionList() {
|
||||||
|
crudSchBaseRegion.getRegionList().then(res => {
|
||||||
|
this.regionList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getPointStatusAndTypeList(id, flag) {
|
||||||
|
if (id) {
|
||||||
|
this.getPointStatusList(id, flag)
|
||||||
|
this.getPointTypeList(id, flag)
|
||||||
|
}
|
||||||
|
if (flag === 1) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPointStatusList(id, flag) {
|
||||||
|
crudSchBaseRegion.getPointStatusSelectById(id).then(res => {
|
||||||
|
if (flag === 1) {
|
||||||
|
this.pointStatusList = res
|
||||||
|
} else {
|
||||||
|
this.pointStatusDialogList = res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getPointTypeList(id, flag) {
|
||||||
|
crudSchBaseRegion.getPointTypeSelectById(id).then(res => {
|
||||||
|
if (flag === 1) {
|
||||||
|
this.pointTypesList = res
|
||||||
|
} else {
|
||||||
|
this.pointTypesDialogList = res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeUsed(data, flag) { // 更改启用状态
|
||||||
|
const param = {}
|
||||||
|
param.data = data
|
||||||
|
param.used = flag
|
||||||
|
crudSchBasePoint.changeUsed(param).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showButton(point_status) {
|
||||||
|
if (point_status && (point_status === '2' || point_status === '3')) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
toView(row) {
|
||||||
|
if (row) {
|
||||||
|
this.$refs.viewDialog.setParentData(row)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableChanged(row) {
|
||||||
|
this.form.parent_point_code = row.map(point => point.point_code).join(',')
|
||||||
|
},
|
||||||
|
getParentPoint() {
|
||||||
|
this.pointDialog = true
|
||||||
|
},
|
||||||
|
handleClear() {
|
||||||
|
this.crud.query.region_code = null
|
||||||
|
this.crud.query.point_type = null
|
||||||
|
this.crud.query.point_status = null
|
||||||
|
this.hand()
|
||||||
|
},
|
||||||
|
changeLock(data) {
|
||||||
|
const param = {}
|
||||||
|
param.data = data
|
||||||
|
param.lock_type = this.crud.query.lock_type
|
||||||
|
crudSchBasePoint.changeLock(param).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
51
wms/nladmin-ui/src/views/wms/sch/point/schBasePoint.js
Normal file
51
wms/nladmin-ui/src/views/wms/sch/point/schBasePoint.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function changeUsed(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint/changeUsed',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPointList(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint/getPointList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function changeLock(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint/changeLock',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, changeUsed, getPointList, changeLock }
|
||||||
193
wms/nladmin-ui/src/views/wms/sch/region/index.vue
Normal file
193
wms/nladmin-ui/src/views/wms/sch/region/index.vue
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="90px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="query.workshop_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="所属车间"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="模糊搜索">
|
||||||
|
<el-input
|
||||||
|
v-model="query.blurry"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="编码名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:before-close="crud.cancelCU"
|
||||||
|
:visible.sync="crud.status.cu > 0"
|
||||||
|
:title="crud.status.title"
|
||||||
|
width="520px">
|
||||||
|
<el-form style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="form.workshop_code"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域编码">
|
||||||
|
<el-input v-model="form.region_code" style="width: 370px;" :disabled="crud.status.edit===1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域名称">
|
||||||
|
<el-input v-model="form.region_name" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="顺序号">
|
||||||
|
<label slot="label">顺序号</label>
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.order_seq"
|
||||||
|
:controls="true"
|
||||||
|
:precision="0"
|
||||||
|
:min="0"
|
||||||
|
:step="1"
|
||||||
|
style="width: 370px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="点位类型说明">
|
||||||
|
<el-input v-model="form.point_type_explain" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位状态说明">
|
||||||
|
<el-input v-model="form.point_status_explain" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否有工单">
|
||||||
|
<el-radio-group v-model="form.is_has_workder" style="width: 240px">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="description">
|
||||||
|
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" />
|
||||||
|
</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>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<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="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />
|
||||||
|
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
|
||||||
|
<el-table-column prop="point_type_explain" label="点位类型说明" :min-width="flexWidth('point_type_explain',crud.data,'点位类型说明')" />
|
||||||
|
<el-table-column prop="point_status_explain" label="点位状态说明" :min-width="flexWidth('point_status_explain',crud.data,'点位状态说明')" />
|
||||||
|
<el-table-column prop="is_has_workder" label="是否有工单" :min-width="flexWidth('is_has_workder',crud.data,'是否有工单')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_has_workder?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />
|
||||||
|
<el-table-column prop="order_seq" label="顺序号" :min-width="flexWidth('order_seq',crud.data,'顺序号')" />
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||||
|
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||||
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||||
|
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||||
|
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||||
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||||
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
region_code: null,
|
||||||
|
region_name: null,
|
||||||
|
point_type_explain: null,
|
||||||
|
point_status_explain: null,
|
||||||
|
is_has_workder: true,
|
||||||
|
workshop_code: null,
|
||||||
|
order_seq: 0,
|
||||||
|
remark: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'Region',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '区域管理',
|
||||||
|
url: 'api/schBaseRegion',
|
||||||
|
idField: 'region_code',
|
||||||
|
sort: 'region_code,desc',
|
||||||
|
crudMethod: { ...crudSchBaseRegion }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
workShopList: [
|
||||||
|
{ 'name': '第一车间', 'code': 'A1' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
hand(value) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
51
wms/nladmin-ui/src/views/wms/sch/region/schBaseRegion.js
Normal file
51
wms/nladmin-ui/src/views/wms/sch/region/schBaseRegion.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRegionList(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/getRegionList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPointStatusSelectById(id) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/getPointStatusSelectById',
|
||||||
|
method: 'post',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPointTypeSelectById(id) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/getPointTypeSelectById',
|
||||||
|
method: 'post',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, getRegionList, getPointStatusSelectById, getPointTypeSelectById }
|
||||||
@@ -383,6 +383,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudSchBaseTaskconfig from '@/views/wms/sch/taskconfig/taskconfig'
|
import crudSchBaseTaskconfig from '@/views/wms/sch/taskconfig/taskconfig'
|
||||||
|
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation.vue'
|
import rrOperation from '@crud/RR.operation.vue'
|
||||||
import crudOperation from '@crud/CRUD.operation.vue'
|
import crudOperation from '@crud/CRUD.operation.vue'
|
||||||
@@ -472,9 +473,7 @@ export default {
|
|||||||
workShopList: [
|
workShopList: [
|
||||||
{ 'name': '第一车间', 'code': 'A1' }
|
{ 'name': '第一车间', 'code': 'A1' }
|
||||||
],
|
],
|
||||||
regionList: [
|
regionList: []
|
||||||
{ 'region_name': '区域A', 'region_code': 'A2' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -495,10 +494,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.getRegionList()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
|
},
|
||||||
|
getRegionList() { // 获取区域列表
|
||||||
|
crudSchBaseRegion.getRegionList().then(res => {
|
||||||
|
this.regionList = res
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user