add:新增回温区移库快速回温区功能
This commit is contained in:
@@ -51,13 +51,21 @@ public class ReportController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/yl/movedetail")
|
@GetMapping("/yl/movedetail")
|
||||||
@Log("原料库工单库存明细")
|
@Log("原料缓存区移库明细")
|
||||||
@ApiOperation("原料库工单库存明细")
|
@ApiOperation("原料缓存区移库明细")
|
||||||
//@SaCheckPermission("@el.check('material:list')")
|
//@SaCheckPermission("@el.check('material:list')")
|
||||||
public ResponseEntity<Object> queryMoveDetail(ReportQuery whereJson, PageQuery page){
|
public ResponseEntity<Object> queryMoveDetail(ReportQuery whereJson, PageQuery page){
|
||||||
return new ResponseEntity<>(TableDataInfo.build(reportService.queryMoveDetail(whereJson,page)),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(reportService.queryMoveDetail(whereJson,page)),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/yl/movedetail2")
|
||||||
|
@Log("回温区移库库存明细")
|
||||||
|
@ApiOperation("回温区移库库存明细")
|
||||||
|
//@SaCheckPermission("@el.check('material:list')")
|
||||||
|
public ResponseEntity<Object> queryMoveDetail2(ReportQuery whereJson, PageQuery page){
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(reportService.queryMoveDetail2(whereJson,page)),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/yl/in")
|
@GetMapping("/yl/in")
|
||||||
@Log("原材入库明细")
|
@Log("原材入库明细")
|
||||||
@ApiOperation("原材入库明细")
|
@ApiOperation("原材入库明细")
|
||||||
|
|||||||
@@ -85,6 +85,14 @@ public interface IReportService extends IService<ReportDto> {
|
|||||||
*/
|
*/
|
||||||
IPage<YCLKCDto> queryMoveDetail(ReportQuery whereJson, PageQuery pageable);
|
IPage<YCLKCDto> queryMoveDetail(ReportQuery whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询回温区库存-----
|
||||||
|
* @param whereJson
|
||||||
|
* @param pageable
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<YCLKCDto> queryMoveDetail2(ReportQuery whereJson, PageQuery pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 原材入库明细--------
|
* 原材入库明细--------
|
||||||
* @param whereJson
|
* @param whereJson
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public interface ReportMapper extends BaseMapper<ReportDto> {
|
|||||||
|
|
||||||
IPage<YCLKCDto> queryMoveDetail(IPage<YCLKCDto> pages, ReportQuery query);
|
IPage<YCLKCDto> queryMoveDetail(IPage<YCLKCDto> pages, ReportQuery query);
|
||||||
|
|
||||||
|
IPage<YCLKCDto> queryMoveDetail2(IPage<YCLKCDto> pages, ReportQuery query);
|
||||||
|
|
||||||
IPage<YlDto> queryYlIn(IPage<YlDto> pages, ReportQuery query);
|
IPage<YlDto> queryYlIn(IPage<YlDto> pages, ReportQuery query);
|
||||||
|
|
||||||
IPage<YlDto> queryYlOut(IPage<YlDto> pages, ReportQuery query);
|
IPage<YlDto> queryYlOut(IPage<YlDto> pages, ReportQuery query);
|
||||||
|
|||||||
@@ -210,6 +210,36 @@
|
|||||||
ORDER BY a.pointCode ASC
|
ORDER BY a.pointCode ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryMoveDetail2" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto">
|
||||||
|
SELECT
|
||||||
|
a.*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
p.point_code AS pointCode,
|
||||||
|
p.region_name AS regionName,
|
||||||
|
p.vehicle_code2 AS subTray,
|
||||||
|
p.vehicle_code AS motherTray,
|
||||||
|
( CASE WHEN ( p.ing_task_code = '' OR p.ing_task_code IS NULL ) THEN 0 ELSE 1 END ) AS STATUS,
|
||||||
|
p.update_time AS updateTime
|
||||||
|
FROM
|
||||||
|
sch_base_point p
|
||||||
|
WHERE
|
||||||
|
p.vehicle_code2 != ''
|
||||||
|
AND p.vehicle_code2 IS NOT NULL
|
||||||
|
AND p.is_used = '1'
|
||||||
|
AND (p.ing_task_code IS NULL or p.ing_task_code = '')
|
||||||
|
AND p.region_code IN ( 'HW' )) a
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="query.point_code != null">
|
||||||
|
and a.pointCode = #{query.point_code}
|
||||||
|
</if>
|
||||||
|
<if test="query.status != null">
|
||||||
|
and a.status = #{query.status}
|
||||||
|
</if>
|
||||||
|
ORDER BY a.pointCode ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="queryYlIn" resultType="org.nl.wms.sch.report.service.dto.YlDto">
|
<select id="queryYlIn" resultType="org.nl.wms.sch.report.service.dto.YlDto">
|
||||||
SELECT
|
SELECT
|
||||||
m.lotSN,
|
m.lotSN,
|
||||||
|
|||||||
@@ -72,6 +72,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
|
|||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<YCLKCDto> queryMoveDetail2(ReportQuery query, PageQuery pageQuery){
|
||||||
|
IPage<YCLKCDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||||
|
pages = reportMapper.queryMoveDetail2(pages, query);
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<YlDto> queryYlIn(ReportQuery query, PageQuery pageQuery){
|
public IPage<YlDto> queryYlIn(ReportQuery query, PageQuery pageQuery){
|
||||||
IPage<YlDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
|
IPage<YlDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.pdm.service.dao.PointDetailAdd;
|
||||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -98,4 +99,14 @@ public class SchBaseTaskController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/move2")
|
||||||
|
@Log("管理端一键移库")
|
||||||
|
@ApiOperation("管理端一键移库")
|
||||||
|
@SaIgnore
|
||||||
|
//@PreAuthorize("@el.check('task:list')")
|
||||||
|
public ResponseEntity<Object> move2(@RequestBody PointDetailAdd pointDetailAdd) {
|
||||||
|
schBaseTaskService.move2(pointDetailAdd);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.pdm.service.dao.PointDetailAdd;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||||
|
|
||||||
@@ -111,4 +112,11 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void move();
|
void move();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理端一键移库
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void move2(PointDetailAdd pointDetailAdd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.nl.common.exception.BadRequestException;
|
|||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.ext.service.AcsToWmsService;
|
import org.nl.wms.ext.service.AcsToWmsService;
|
||||||
import org.nl.wms.ext.service.dto.to.BaseResponse;
|
import org.nl.wms.ext.service.dto.to.BaseResponse;
|
||||||
|
import org.nl.wms.pdm.service.dao.PointDetailAdd;
|
||||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||||
@@ -344,4 +345,74 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理端一键移库:回温区---》快速回温区
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void move2(PointDetailAdd pointDetailAdd) {
|
||||||
|
log.info("管理端发起一键移库!");
|
||||||
|
String time = pointDetailAdd.getTime();
|
||||||
|
List<SchBasePoint> schBasePointList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
|
.eq(SchBasePoint::getRegion_code, "HW")
|
||||||
|
.isNotNull(SchBasePoint::getVehicle_code2)
|
||||||
|
.ne(SchBasePoint::getVehicle_code2, "")
|
||||||
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||||
|
.or()
|
||||||
|
.eq(SchBasePoint::getIng_task_code, "")
|
||||||
|
));
|
||||||
|
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getRegion_code, "HWK")
|
||||||
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
|
.eq(SchBasePoint::getVehicle_qty, 0)
|
||||||
|
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
|
||||||
|
.or()
|
||||||
|
.eq(SchBasePoint::getVehicle_code2, ""))
|
||||||
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||||
|
.or()
|
||||||
|
.eq(SchBasePoint::getIng_task_code, "")));
|
||||||
|
for (SchBasePoint schBasePoint : schBasePointList) {
|
||||||
|
if(nextList.size()==0){
|
||||||
|
log.info("快速回温区无可用点位,取消后续循环");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
SchBasePoint nexSchBasePoint = nextList.get(0);
|
||||||
|
param.put("start_point", schBasePoint.getPoint_code());
|
||||||
|
param.put("next_point", nexSchBasePoint.getPoint_code());
|
||||||
|
param.put("create_mode","1");
|
||||||
|
param.put("request_medthod_code", "POINTTask");
|
||||||
|
param.put("request_medthod_name", "点对点任务");
|
||||||
|
param.put("vehicle_code",schBasePoint.getVehicle_code());
|
||||||
|
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
|
||||||
|
param.put("device_code", schBasePoint.getPoint_code());
|
||||||
|
param.put("time", time);
|
||||||
|
|
||||||
|
BaseResponse baseResponse= acsToWmsService.pdaApply(param);
|
||||||
|
Integer resultCode = baseResponse.getCode();
|
||||||
|
if(resultCode.equals(200)){
|
||||||
|
Map<String, String> parameters = baseResponse.getParameters();
|
||||||
|
//设置初始值
|
||||||
|
schBasePoint.setIng_task_code("1");
|
||||||
|
nexSchBasePoint.setIng_task_code("1");
|
||||||
|
if(ObjectUtil.isNotNull(parameters)){
|
||||||
|
String task_code = parameters.get("task_code");
|
||||||
|
if(ObjectUtil.isNotEmpty(task_code)){
|
||||||
|
schBasePoint.setIng_task_code(task_code);
|
||||||
|
nexSchBasePoint.setIng_task_code(task_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//发起任务时先把点位占用,防止发起重复任务
|
||||||
|
pointService.update(schBasePoint);
|
||||||
|
pointService.update(nexSchBasePoint);
|
||||||
|
nextList.remove(0);
|
||||||
|
}else{
|
||||||
|
log.info(baseResponse.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,6 +233,11 @@ public class POINTTask extends AbstractTask {
|
|||||||
if(endPointObj.getRegion_code().contains("CB")){
|
if(endPointObj.getRegion_code().contains("CB")){
|
||||||
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
||||||
}
|
}
|
||||||
|
if(ObjectUtil.isEmpty(extGroupData.getString("time"))){
|
||||||
|
one.setStanding_time(1);
|
||||||
|
}else{
|
||||||
|
one.setStanding_time(Integer.valueOf(extGroupData.getString("time")));
|
||||||
|
}
|
||||||
one.setUpdate_id(GeneralDefinition.ACS_ID);
|
one.setUpdate_id(GeneralDefinition.ACS_ID);
|
||||||
one.setUpdate_name(GeneralDefinition.ACS_NAME);
|
one.setUpdate_name(GeneralDefinition.ACS_NAME);
|
||||||
one.setUpdate_time(DateUtil.now());
|
one.setUpdate_time(DateUtil.now());
|
||||||
@@ -305,6 +310,20 @@ public class POINTTask extends AbstractTask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
|
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
|
||||||
//该场景无需重算等待点
|
if(schBaseTask.getPoint_code2().startsWith("DKT")){
|
||||||
|
//叠盘任务需要二次分配
|
||||||
|
SchBasePoint nextSchBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getPoint_code, "DKT01"));
|
||||||
|
Integer max_qty = nextSchBasePoint.getVehicle_max_qty();
|
||||||
|
//如果是叠盘位,根据当前数量+1为目标地址
|
||||||
|
int qty=nextSchBasePoint.getVehicle_qty()+1;
|
||||||
|
if(qty <= max_qty){
|
||||||
|
schBaseTask.setPoint_code2(schBaseTask.getPoint_code2().substring(0,schBaseTask.getPoint_code2().length()-1)+qty);
|
||||||
|
}else{
|
||||||
|
schBaseTask.setRemark("叠盘机空盘数量已达最大值:["+max_qty+"],暂时无法放置托盘!");
|
||||||
|
taskService.update(schBaseTask);
|
||||||
|
throw new BadRequestException("叠盘机空盘数量已达最大值:[\"+max_qty+\"],暂时无法放置托盘!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,4 +77,13 @@ public class WorkorderController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/batchCreate2")
|
||||||
|
@Log("批量生成移库任务")
|
||||||
|
@ApiOperation("批量生成移库任务")
|
||||||
|
public ResponseEntity<Object> batchCreate2(@RequestBody PointDetailAdd pointDetailAdd){
|
||||||
|
log.info("批量生成移库任务:"+pointDetailAdd.toString());
|
||||||
|
workorderService.batchCreate2(pointDetailAdd);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ public interface IWorkorderService extends IService<Workorder> {
|
|||||||
*/
|
*/
|
||||||
void batchCreate( PointDetailAdd pointDetailAdd);
|
void batchCreate( PointDetailAdd pointDetailAdd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量生成移库任务
|
||||||
|
* @param pointDetailAdd
|
||||||
|
*/
|
||||||
|
void batchCreate2( PointDetailAdd pointDetailAdd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量生成工单出库任务
|
* 批量生成工单出库任务
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -203,6 +203,84 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void batchCreate2( PointDetailAdd pointDetailAdd){
|
||||||
|
log.info("管理端发起一键移库!");
|
||||||
|
//点位集合
|
||||||
|
List<String> pointCodes = pointDetailAdd.getPointCodes();
|
||||||
|
//下发状态
|
||||||
|
String status = pointDetailAdd.getStatus();
|
||||||
|
String time = pointDetailAdd.getTime();
|
||||||
|
//查询是否有目的空点位
|
||||||
|
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getRegion_code, "HWK")
|
||||||
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
|
.eq(SchBasePoint::getVehicle_qty, 0)
|
||||||
|
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
|
||||||
|
.or()
|
||||||
|
.eq(SchBasePoint::getVehicle_code2, ""))
|
||||||
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||||
|
.or()
|
||||||
|
.eq(SchBasePoint::getIng_task_code, "")));
|
||||||
|
if("1".equals(status)){
|
||||||
|
for(String pointCode : pointCodes){
|
||||||
|
if(nextList.size()==0){
|
||||||
|
log.info("快速回温区无可用点位,取消后续循环");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//查询当前点位最新信息
|
||||||
|
SchBasePoint schBasePoint =schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
|
.eq(SchBasePoint::getRegion_code, "HW")
|
||||||
|
.eq(SchBasePoint::getPoint_code, pointCode)
|
||||||
|
.isNotNull(SchBasePoint::getVehicle_code2)
|
||||||
|
.ne(SchBasePoint::getVehicle_code2, "")
|
||||||
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||||
|
.or()
|
||||||
|
.eq(SchBasePoint::getIng_task_code, "")
|
||||||
|
));
|
||||||
|
if(ObjectUtil.isNull(schBasePoint)){
|
||||||
|
log.info("移库点位异常:"+pointCode);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
SchBasePoint nexSchBasePoint = nextList.get(0);
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("start_point", schBasePoint.getPoint_code());
|
||||||
|
param.put("next_point", nexSchBasePoint.getPoint_code());
|
||||||
|
param.put("create_mode","1");
|
||||||
|
param.put("request_medthod_code", "POINTTask");
|
||||||
|
param.put("request_medthod_name", "点对点任务");
|
||||||
|
param.put("vehicle_code",schBasePoint.getVehicle_code());
|
||||||
|
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
|
||||||
|
param.put("device_code", schBasePoint.getPoint_code());
|
||||||
|
param.put("time", time);
|
||||||
|
|
||||||
|
BaseResponse baseResponse= acsToWmsService.pdaApply(param);
|
||||||
|
Integer resultCode = baseResponse.getCode();
|
||||||
|
if(resultCode.equals(200)){
|
||||||
|
Map<String, String> parameters = baseResponse.getParameters();
|
||||||
|
//设置初始值
|
||||||
|
schBasePoint.setIng_task_code("1");
|
||||||
|
nexSchBasePoint.setIng_task_code("1");
|
||||||
|
if(ObjectUtil.isNotNull(parameters)){
|
||||||
|
String task_code = parameters.get("task_code");
|
||||||
|
if(ObjectUtil.isNotEmpty(task_code)){
|
||||||
|
schBasePoint.setIng_task_code(task_code);
|
||||||
|
nexSchBasePoint.setIng_task_code(task_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//发起任务时先把点位占用,防止发起重复任务
|
||||||
|
pointService.update(schBasePoint);
|
||||||
|
pointService.update(nexSchBasePoint);
|
||||||
|
nextList.remove(0);
|
||||||
|
}else{
|
||||||
|
log.info(baseResponse.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//@Transactional(rollbackFor = Exception.class)
|
//@Transactional(rollbackFor = Exception.class)
|
||||||
public void batchCreateTask(){
|
public void batchCreateTask(){
|
||||||
|
|||||||
67
lms/nladmin-ui/src/views/wms/hw/movestor2/detail.js
Normal file
67
lms/nladmin-ui/src/views/wms/hw/movestor2/detail.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report/getGroup',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSupplierNameList(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report/getSupplierNameList',
|
||||||
|
method: 'get',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProductDescriptionList(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report/getProductDescriptionList',
|
||||||
|
method: 'get',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLotSNList(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report/getLotSNList',
|
||||||
|
method: 'get',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIngotBatchList(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/report/getIngotBatchList',
|
||||||
|
method: 'get',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, getGroup, getSupplierNameList, getProductDescriptionList, getLotSNList, getIngotBatchList }
|
||||||
256
lms/nladmin-ui/src/views/wms/hw/movestor2/index.vue
Normal file
256
lms/nladmin-ui/src/views/wms/hw/movestor2/index.vue
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
<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.point_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位编码"
|
||||||
|
class="filter-item"
|
||||||
|
filterable
|
||||||
|
@remote-method="getPointList"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointList"
|
||||||
|
:label="item.point_code"
|
||||||
|
:value="item.point_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
:disabled="confirm_flag"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
@click="confirm"
|
||||||
|
>
|
||||||
|
提交移库
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
size="mini"
|
||||||
|
@click="autoMove"
|
||||||
|
>
|
||||||
|
一键移库
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<el-dialog
|
||||||
|
title="确认"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="30%"
|
||||||
|
>
|
||||||
|
<span>您确定要移库吗?</span>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirmMove">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
size="mini"
|
||||||
|
:cell-style="cellStyle"
|
||||||
|
style="width: 100%;"
|
||||||
|
height="550"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="pointCode" label="点位名称" :min-width="flexWidth('pointCode',crud.data,'点位名称')" />
|
||||||
|
<el-table-column prop="regionName" label="区域名称" :min-width="flexWidth('regionName',crud.data,'区域名称')" />
|
||||||
|
<el-table-column prop="subTray" label="子托编码" :min-width="flexWidth('subTray',crud.data,'子托编码')" />
|
||||||
|
<el-table-column prop="motherTray" label="母托编码" :min-width="flexWidth('motherTray',crud.data,'母托编码')" />
|
||||||
|
<el-table-column prop="status" label="提交状态" :formatter="format_work_order_two_status" :min-width="flexWidth('status',crud.data,'工单状态')" />
|
||||||
|
<el-table-column prop="updateTime" label="入库时间" :min-width="flexWidth('updateTime',crud.data,'入库时间')" />
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'moveStor2',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '回温区移库快速回温区',
|
||||||
|
url: 'api/report/yl/movedetail2',
|
||||||
|
idField: 'pointCode',
|
||||||
|
sort: 'pointCode,desc',
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: false
|
||||||
|
},
|
||||||
|
query: {status:'0'}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
confirm_flag: false,
|
||||||
|
dialogVisible: false,
|
||||||
|
rows: [],
|
||||||
|
pointList: [],
|
||||||
|
choose: '物料'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getPointList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
this.handleCurrentChange(null)
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
this.rows = this.$refs.table.selection
|
||||||
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选托盘!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取选中行的托盘号 subTray
|
||||||
|
const pointCodes = this.rows.map(row => row.pointCode)
|
||||||
|
// 弹出输入回温时间和回温模式的对话框
|
||||||
|
this.$prompt('请输入回温时间(小时)', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
inputPattern: /\d+/,
|
||||||
|
inputErrorMessage: '回温时间(小时)必须为数字'
|
||||||
|
}).then(({ value: time }) => {
|
||||||
|
// 提交数据给后台接口
|
||||||
|
this.$axios.post('/api/workorder/batchCreate2', {
|
||||||
|
pointCodes: pointCodes,
|
||||||
|
time: time,
|
||||||
|
status: '1'
|
||||||
|
}).then(response => {
|
||||||
|
// 提交成功处理
|
||||||
|
this.$message.success('移库提交成功!')
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(error => {
|
||||||
|
// 提交失败处理
|
||||||
|
this.$message.error('移库提交失败,请重试')
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
// 用户点击了取消按钮
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消移库操作'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
autoMove(){
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
confirmMove(){///api/schBaseTask/move
|
||||||
|
// 弹出输入回温时间和回温模式的对话框
|
||||||
|
this.$prompt('请输入回温时间(小时)', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
inputPattern: /\d+/,
|
||||||
|
inputErrorMessage: '回温时间(小时)必须为数字'
|
||||||
|
}).then(({ value: time }) => {
|
||||||
|
// 提交数据给后台接口
|
||||||
|
this.$axios.post('/api/schBaseTask/move2', {
|
||||||
|
time: time
|
||||||
|
}).then(response => {
|
||||||
|
// 提交成功处理
|
||||||
|
this.$message.success('一键移库提交成功!')
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(error => {
|
||||||
|
// 提交失败处理
|
||||||
|
this.$message.error('一键移库提交失败,请重试')
|
||||||
|
}) .finally(() => {
|
||||||
|
this.dialogVisible = false // Close the dialog
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.dialogVisible = false // Close the dialog
|
||||||
|
// 用户点击了取消按钮
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消一键移库操作'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSelectionChange(val, row) {
|
||||||
|
this.rows = this.$refs.table.selection
|
||||||
|
var strs = ''
|
||||||
|
this.handleCurrentChange(null)
|
||||||
|
if (this.rows.length > 0) {
|
||||||
|
this.rows.forEach(now => {
|
||||||
|
strs += now.status
|
||||||
|
})
|
||||||
|
if (strs.indexOf('1') != -1) {
|
||||||
|
this.confirm_flag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCurrentChange(current) {
|
||||||
|
if (current === null) {
|
||||||
|
this.confirm_flag = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cellStyle({ row, column, rowIndex, columnIndex }) {
|
||||||
|
const status = row.status
|
||||||
|
|
||||||
|
if (column.property === 'status') {
|
||||||
|
if (status == '1') {
|
||||||
|
return 'background: #13ce66'
|
||||||
|
} else {
|
||||||
|
return 'background: #FFBA00'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
format_work_order_two_status(row, column) {
|
||||||
|
if(row.status ==='1'){
|
||||||
|
return '已提交';
|
||||||
|
}
|
||||||
|
return '未提交';
|
||||||
|
},
|
||||||
|
getPointList() { // 获取点位列表
|
||||||
|
crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
|
||||||
|
this.pointList = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
<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.productname"
|
|
||||||
clearable
|
|
||||||
size="mini"
|
|
||||||
placeholder="物料编码"
|
|
||||||
:disabled="true"
|
|
||||||
@keyup.enter.native="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'}"
|
|
||||||
@selection-change="crud.selectionChangeHandler"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" />
|
|
||||||
<el-table-column prop="point_code" label="所在点位" width="120px" />
|
|
||||||
<el-table-column prop="productName" label="物料编码" />
|
|
||||||
<el-table-column prop="palletSN" label="子托盘号" min-width="120" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="qty" label="数量" width="100" show-overflow-tooltip />
|
|
||||||
</el-table>
|
|
||||||
<!--分页组件-->
|
|
||||||
<pagination />
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
@click="submitSelectedRows"
|
|
||||||
>
|
|
||||||
原材料出库
|
|
||||||
</el-button>
|
|
||||||
</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: 'WorkOrderDetailDialog',
|
|
||||||
components: { rrOperation, pagination },
|
|
||||||
dicts: ['is_used', 'vehicle_type'],
|
|
||||||
cruds() {
|
|
||||||
return CRUD({ title: '点位详情', url: 'api/pointDetail', optShow: {}})
|
|
||||||
},
|
|
||||||
mixins: [presenter(), header()],
|
|
||||||
props: {
|
|
||||||
dialogShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
productname: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}, workorderCode: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogVisible: false,
|
|
||||||
tableRadio: null,
|
|
||||||
tableData: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
dialogShow: {
|
|
||||||
handler(newValue) {
|
|
||||||
this.dialogVisible = newValue
|
|
||||||
}
|
|
||||||
},
|
|
||||||
productname(newVal) {
|
|
||||||
// 监听传递的值变化,并在变化时执行赋值操作
|
|
||||||
this.query.productname = newVal
|
|
||||||
this.executeQuery()
|
|
||||||
},
|
|
||||||
workorder_code(newVal) {
|
|
||||||
// 监听传递的值变化,并在变化时执行赋值操作
|
|
||||||
this.workorder_code = newVal
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
open() {
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.crud.resetQuery(false)
|
|
||||||
this.$emit('update:dialogShow', false)
|
|
||||||
},
|
|
||||||
executeQuery() {
|
|
||||||
this.crud.toQuery()
|
|
||||||
},
|
|
||||||
submitSelectedRows() {
|
|
||||||
const selectedRows = this.$refs.table.selection
|
|
||||||
if (selectedRows.length === 0) {
|
|
||||||
this.$message.error('请至少选择一行数据')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取选中行的 point_code
|
|
||||||
const pointCodes = selectedRows.map(row => row.point_code)
|
|
||||||
|
|
||||||
// 弹出输入回温时间和回温模式的对话框
|
|
||||||
this.$prompt('请输入回温时间', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
inputPattern: /\d+/,
|
|
||||||
inputErrorMessage: '回温时间必须为数字'
|
|
||||||
}).then(({ value: time }) => {
|
|
||||||
this.$prompt('请输入回温模式(0-普通模式,1-快速模式)', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消'
|
|
||||||
}).then(({ value: mode }) => {
|
|
||||||
// 提交数据给后台接口
|
|
||||||
this.$axios.post('/api/pointDetail/add', {
|
|
||||||
pointCodes,
|
|
||||||
time,
|
|
||||||
mode,
|
|
||||||
workorder_code: this.workorder_code // 使用workorder_code属性
|
|
||||||
}).then(response => {
|
|
||||||
// 提交成功处理
|
|
||||||
this.$message.success('提交成功!')
|
|
||||||
// 关闭当前对话框
|
|
||||||
this.dialogVisible = false
|
|
||||||
}).catch(error => {
|
|
||||||
// 提交失败处理
|
|
||||||
this.$message.error('提交失败,请重试')
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
// 用户点击了取消按钮
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '已取消提交操作'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
// 用户点击了取消按钮
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '已取消提交操作'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
::v-deep .el-dialog__body {
|
|
||||||
padding-top: 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<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.workorder_code"
|
|
||||||
clearable
|
|
||||||
size="mini"
|
|
||||||
placeholder="工单编号"
|
|
||||||
:disabled="true"
|
|
||||||
@keyup.enter.native="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'}"
|
|
||||||
@selection-change="crud.selectionChangeHandler"
|
|
||||||
>
|
|
||||||
<el-table-column prop="workorder_code" label="工单编号" width="120px" />
|
|
||||||
<el-table-column prop="matnr" label="物料编码" />
|
|
||||||
<el-table-column prop="maktx" label="物料名称" min-width="120" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="mtype" label="产品类别" width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="mtytxt" label="产品类别描述" width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="bdmng" label="数量" width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="meins" label="计量单位" width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-add"
|
|
||||||
@click="doOperate(scope.row)"
|
|
||||||
>原材料出库</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<!--分页组件-->
|
|
||||||
<pagination />
|
|
||||||
</el-dialog>
|
|
||||||
<PointDetailDialog :dialog-show.sync="pointDetailDialog" :workorder_code="workorder_code" :productname="productname" />
|
|
||||||
</div>
|
|
||||||
</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'
|
|
||||||
import PointDetailDialog from '@/views/wms/pdm/workerorder/PointDetailDialog.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'WorkOrderDetailDialog',
|
|
||||||
components: { PointDetailDialog, rrOperation, pagination },
|
|
||||||
dicts: ['is_used', 'vehicle_type'],
|
|
||||||
cruds() {
|
|
||||||
return CRUD({ title: '生产工单', url: 'api/pdmBdWorkorderDetail', optShow: {}})
|
|
||||||
},
|
|
||||||
mixins: [presenter(), header()],
|
|
||||||
props: {
|
|
||||||
dialogShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
message: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogVisible: false,
|
|
||||||
pointDetailDialog: false,
|
|
||||||
productname: null,
|
|
||||||
workorder_code: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
dialogShow: {
|
|
||||||
handler(newValue) {
|
|
||||||
this.dialogVisible = newValue
|
|
||||||
}
|
|
||||||
},
|
|
||||||
message(newVal) {
|
|
||||||
// 监听传递的值变化,并在变化时执行赋值操作
|
|
||||||
this.query.workorder_code = newVal
|
|
||||||
this.executeQuery()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
open() {
|
|
||||||
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.crud.resetQuery(false)
|
|
||||||
this.$emit('update:dialogShow', false)
|
|
||||||
},
|
|
||||||
executeQuery() {
|
|
||||||
this.crud.toQuery()
|
|
||||||
},
|
|
||||||
doOperate(row) {
|
|
||||||
this.productname = row.matnr
|
|
||||||
this.workorder_code = row.workorder_code
|
|
||||||
this.pointDetailDialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
::v-deep .el-dialog__body {
|
|
||||||
padding-top: 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
@@ -1,509 +0,0 @@
|
|||||||
<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="80px"
|
|
||||||
label-suffix=":"
|
|
||||||
>
|
|
||||||
<el-form-item label="工单编号">
|
|
||||||
<el-input
|
|
||||||
v-model="query.workorder_code"
|
|
||||||
clearable
|
|
||||||
placeholder="工单编号"
|
|
||||||
class="filter-item"
|
|
||||||
@keyup.enter.native="crud.toQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备编码">
|
|
||||||
<el-input
|
|
||||||
v-model="query.point_code"
|
|
||||||
clearable
|
|
||||||
placeholder="设备编码"
|
|
||||||
class="filter-item"
|
|
||||||
@keyup.enter.native="crud.toQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="query.createTime"
|
|
||||||
type="datetimerange"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
@change="crud.toQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工单状态">
|
|
||||||
<el-select
|
|
||||||
v-model="query.workorder_status"
|
|
||||||
multiple
|
|
||||||
placeholder="工单状态"
|
|
||||||
class="filter-item"
|
|
||||||
clearable
|
|
||||||
@change="handOrderStatus"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.pdm_workorder_status"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<rrOperation :crud="crud" />
|
|
||||||
</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="820px"
|
|
||||||
>
|
|
||||||
<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="135px"
|
|
||||||
label-suffix=":"
|
|
||||||
>
|
|
||||||
<el-form-item v-if="false" label="所属车间">
|
|
||||||
<el-select
|
|
||||||
v-model="form.workshop_code"
|
|
||||||
placeholder="请选择"
|
|
||||||
style="width: 240px;"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in workShopList"
|
|
||||||
:label="item.workshop_name"
|
|
||||||
:value="item.workshop_code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="物料名称" prop="material_name">
|
|
||||||
<el-input v-model="form.material_name" style="width: 240px;" @focus="getMaterial" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="物料编码">
|
|
||||||
<el-input v-model="form.material_id" style="width: 240px;" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="物料规格">
|
|
||||||
<el-input v-model="form.material_spec" style="width: 240px;" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="计划数量" prop="plan_qty">
|
|
||||||
<el-input-number
|
|
||||||
v-model.number="form.plan_qty"
|
|
||||||
:min="0"
|
|
||||||
style="width: 240px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="计划开始时间" prop="planproducestart_date">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.planproducestart_date"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="datetime"
|
|
||||||
style="width: 240px;"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="计划结束时间" prop="planproduceend_date">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.planproduceend_date"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="datetime"
|
|
||||||
style="width: 240px;"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="crud.status.edit" label="实际开始时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.realproducestart_date"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="datetime"
|
|
||||||
style="width: 240px;"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="crud.status.edit" label="实际结束时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.realproduceend_date"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="datetime"
|
|
||||||
style="width: 240px;"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所属工序" prop="region_code">
|
|
||||||
<el-select
|
|
||||||
v-model="form.region_code"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择"
|
|
||||||
style="width: 240px;"
|
|
||||||
@change="setRegionName"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in regionList"
|
|
||||||
:key="item.region_code"
|
|
||||||
:label="item.region_code"
|
|
||||||
:value="item.region_code"
|
|
||||||
>
|
|
||||||
<span style="float: left">{{ item.region_name }}</span>
|
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.region_code }}</span>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工序名称">
|
|
||||||
<el-input v-model="form.region_name" style="width: 240px;" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备编码" prop="point_code">
|
|
||||||
<el-select
|
|
||||||
v-model="form.point_code"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择"
|
|
||||||
style="width: 240px;"
|
|
||||||
@change="setPointName"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in pointList"
|
|
||||||
:key="item.point_code"
|
|
||||||
:label="item.point_code"
|
|
||||||
:value="item.point_code"
|
|
||||||
>
|
|
||||||
<span style="float: left">{{ item.point_name }}</span>
|
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.point_code }}</span>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备名称">
|
|
||||||
<el-input v-model="form.point_name" style="width: 240px;" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="回温时间(小时)" prop="standing_time">
|
|
||||||
<el-input-number
|
|
||||||
v-model.number="form.standing_time"
|
|
||||||
:min="0"
|
|
||||||
:max="999"
|
|
||||||
style="width: 240px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="crud.status.edit" label="实际数量" prop="real_qty">
|
|
||||||
<el-input-number
|
|
||||||
v-model.number="form.real_qty"
|
|
||||||
:min="0"
|
|
||||||
style="width: 240px;"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="载具类型">
|
|
||||||
<el-select
|
|
||||||
v-model="form.vehicle_type"
|
|
||||||
clearable
|
|
||||||
size="mini"
|
|
||||||
placeholder="请选择"
|
|
||||||
class="filter-item"
|
|
||||||
style="width: 240px;"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.vehicle_type"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="false" label="工单类型" prop="workorder_type">
|
|
||||||
<el-input v-model="form.workorder_type" style="width: 240px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否自动搬运" prop="is_needmove">
|
|
||||||
<el-radio-group v-model="form.is_needmove" 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="is_needmove">
|
|
||||||
<el-radio-group v-model="form.is_urgent" style="width: 240px">
|
|
||||||
<el-radio :label="true">是</el-radio>
|
|
||||||
<el-radio :label="false">否</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</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="workorder_code" label="工单编号" :min-width="flexWidth('workorder_code',crud.data,'工单编号')" />
|
|
||||||
<el-table-column
|
|
||||||
prop="workorder_status"
|
|
||||||
label="工单状态"
|
|
||||||
:min-width="flexWidth('workorder_status',crud.data,'工单状态')"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ dict.label.pdm_workorder_status[scope.row.workorder_status] }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')" />
|
|
||||||
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',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_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="material_code" label="物料编码" :min-width="flexWidth('material_name',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_name',crud.data,'物料标识')" /> -->
|
|
||||||
<!-- <el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"> -->
|
|
||||||
<!-- <template slot-scope="scope">
|
|
||||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column
|
|
||||||
prop="planproducestart_date"
|
|
||||||
label="计划开始时间"
|
|
||||||
:min-width="flexWidth('planproducestart_date',crud.data,'计划开始时间')"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="planproduceend_date"
|
|
||||||
label="计划结束时间"
|
|
||||||
:min-width="flexWidth('planproduceend_date',crud.data,'计划结束时间')"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="realproducestart_date"
|
|
||||||
label="实际开始时间"
|
|
||||||
:min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="realproduceend_date"
|
|
||||||
label="实际结束时间"
|
|
||||||
:min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')"
|
|
||||||
/>
|
|
||||||
<!-- <el-table-column
|
|
||||||
prop="standing_time"
|
|
||||||
label="回温时间(小时)"
|
|
||||||
:min-width="flexWidth('standing_time',crud.data,'回温时间(小时)')"
|
|
||||||
/> -->
|
|
||||||
<!-- <el-table-column prop="is_needmove" label="是否自动搬运" :min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.is_needmove ? '是' : '否' }}
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<!-- <el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.is_urgent ? '是' : '否' }}
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<!-- <el-table-column prop="workorder_type" label="工单类型" :min-width="flexWidth('workorder_type',crud.data,'工单类型')" />-->
|
|
||||||
<!--<el-table-column
|
|
||||||
prop="passback_status"
|
|
||||||
label="回传MES状态"
|
|
||||||
:min-width="flexWidth('passback_status',crud.data,'回传MES状态')"
|
|
||||||
/>-->
|
|
||||||
<!-- <el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',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">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-add"
|
|
||||||
:disabled="scope.row.workorder_status!=='1'"
|
|
||||||
@click="doOperate(scope.row)"
|
|
||||||
>原材料出库</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<!--分页组件-->
|
|
||||||
<pagination />
|
|
||||||
</div>
|
|
||||||
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" />
|
|
||||||
<WorkOrderDetailDialog :dialog-show.sync="workOrderDetailDialog" :message="message" @tableChanged="tableChanged" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import crudPdmBdWorkorder from './pdmBdWorkorder'
|
|
||||||
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
|
||||||
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
|
||||||
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 crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
|
||||||
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
|
|
||||||
import WorkOrderDetailDialog from '@/views/wms/pdm/workerorder/WorkOrderDetailDialog.vue'
|
|
||||||
import item from '@/layout/components/Sidebar/Item.vue'
|
|
||||||
|
|
||||||
const defaultForm = {
|
|
||||||
workorder_id: null,
|
|
||||||
workorder_code: null,
|
|
||||||
plan_qty: null,
|
|
||||||
real_qty: null,
|
|
||||||
material_id: null,
|
|
||||||
vehicle_type: null,
|
|
||||||
planproducestart_date: null,
|
|
||||||
planproduceend_date: null,
|
|
||||||
realproducestart_date: null,
|
|
||||||
realproduceend_date: null,
|
|
||||||
material_spec: null,
|
|
||||||
material_code: null,
|
|
||||||
material_name: null,
|
|
||||||
standing_time: null,
|
|
||||||
point_code: null,
|
|
||||||
point_name: null,
|
|
||||||
region_code: null,
|
|
||||||
region_name: null,
|
|
||||||
workorder_status: null,
|
|
||||||
is_needmove: true,
|
|
||||||
workorder_type: null,
|
|
||||||
passback_status: null,
|
|
||||||
workshop_code: null,
|
|
||||||
ext_id: null,
|
|
||||||
is_delete: false,
|
|
||||||
is_urgent: false
|
|
||||||
}
|
|
||||||
export default {
|
|
||||||
name: 'PdmBdWorkorder',
|
|
||||||
dicts: ['vehicle_type', 'pdm_workorder_status'],
|
|
||||||
components: { WorkOrderDetailDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
|
||||||
cruds() {
|
|
||||||
return CRUD({
|
|
||||||
title: '工单管理',
|
|
||||||
url: 'api/pdmBdWorkorder',
|
|
||||||
idField: 'workorder_id',
|
|
||||||
sort: 'workorder_id,desc',
|
|
||||||
crudMethod: { ...crudPdmBdWorkorder }
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
permission: {},
|
|
||||||
rules: {
|
|
||||||
material_code: [
|
|
||||||
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
plan_qty: [
|
|
||||||
{ required: true, message: '计划数量不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
planproducestart_date: [
|
|
||||||
{ required: true, message: '计划开始不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
planproduceend_date: [
|
|
||||||
{ required: true, message: '计划结束不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
point_code: [
|
|
||||||
{ required: true, message: '设备编码不能为空', trigger: 'change' }
|
|
||||||
],
|
|
||||||
region_code: [
|
|
||||||
{ required: true, message: '区域编码不能为空', trigger: 'change' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
queryTypeOptions: [
|
|
||||||
{ key: 'workorder_code', display_name: '工单编号' },
|
|
||||||
{ key: 'point_code', display_name: '设备编码' }
|
|
||||||
],
|
|
||||||
workShopList: [],
|
|
||||||
regionList: [],
|
|
||||||
pointList: [],
|
|
||||||
regionCodeParam: null,
|
|
||||||
materialDialog: false,
|
|
||||||
workOrderDetailDialog: false,
|
|
||||||
message: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getWorkShopList()
|
|
||||||
this.getRegionList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
item() {
|
|
||||||
return item
|
|
||||||
},
|
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
getWorkShopList() { // 获取车间列表
|
|
||||||
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
|
||||||
this.workShopList = res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getRegionList() { // 获取区域列表
|
|
||||||
const param = {
|
|
||||||
is_has_workder: true
|
|
||||||
}
|
|
||||||
crudSchBaseRegion.getRegionList(param).then(res => {
|
|
||||||
this.regionList = res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getPointList() { // 获取点位列表
|
|
||||||
if (this.regionCodeParam) {
|
|
||||||
const param = {
|
|
||||||
region_code: this.regionCodeParam
|
|
||||||
}
|
|
||||||
crudSchBasePoint.getPointList(param).then(res => {
|
|
||||||
this.pointList = res
|
|
||||||
this.regionCodeParam = null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getMaterial() {
|
|
||||||
this.materialDialog = true
|
|
||||||
},
|
|
||||||
tableChanged(row) {
|
|
||||||
this.form.material_name = row.material_name
|
|
||||||
this.form.material_id = row.material_id
|
|
||||||
this.form.material_spec = row.material_spec
|
|
||||||
this.form.material_code = row.material_code
|
|
||||||
},
|
|
||||||
setRegionName(data) {
|
|
||||||
// 清空
|
|
||||||
this.form.point_code = null
|
|
||||||
this.form.point_name = null
|
|
||||||
this.regionCodeParam = data
|
|
||||||
var region = this.regionList.find(item => item.region_code === data)
|
|
||||||
this.form.region_name = region.region_name
|
|
||||||
this.getPointList()
|
|
||||||
},
|
|
||||||
setPointName(data) {
|
|
||||||
var point = this.pointList.find(item => item.point_code === data)
|
|
||||||
this.form.point_name = point.point_name
|
|
||||||
},
|
|
||||||
handOrderStatus(value) {
|
|
||||||
this.crud.query.more_order_status = null
|
|
||||||
if (value) {
|
|
||||||
this.crud.query.more_order_status = value.toString()
|
|
||||||
}
|
|
||||||
this.crud.toQuery()
|
|
||||||
},
|
|
||||||
doOperate(row) {
|
|
||||||
this.message = row.workorder_code
|
|
||||||
this.workOrderDetailDialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
export function add(data) {
|
|
||||||
return request({
|
|
||||||
url: 'api/pdmBdWorkorder',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function del(ids) {
|
|
||||||
return request({
|
|
||||||
url: 'api/pdmBdWorkorder/',
|
|
||||||
method: 'delete',
|
|
||||||
data: ids
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function edit(data) {
|
|
||||||
return request({
|
|
||||||
url: 'api/pdmBdWorkorder',
|
|
||||||
method: 'put',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default { add, edit, del }
|
|
||||||
Reference in New Issue
Block a user