设备与工单基础CRUD
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
package org.nl.wms.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Description: 工单枚举
|
||||||
|
* @Date: 2023/3/16
|
||||||
|
*/
|
||||||
|
public enum WorkerOrderEnum {
|
||||||
|
// 1-创建、2-下发、3-生产中、4-暂停、5-完成
|
||||||
|
CREATE("创建", "1"),
|
||||||
|
SEND("下发", "2"),
|
||||||
|
PRODUCTING("生产中", "3"),
|
||||||
|
STOP("暂停", "4"),
|
||||||
|
COMPLETE("完成", "5"),
|
||||||
|
// 1-PC创建、2-Excel导入
|
||||||
|
PCINTO("PC创建", "1"),
|
||||||
|
EXCELINTO("EXCEL导入", "2"),
|
||||||
|
// 1白班、2夜班
|
||||||
|
DAYSHIFT("白班", "1"),
|
||||||
|
NIGHTSHIFT("夜班", "2")
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
WorkerOrderEnum(String name, String code) {
|
||||||
|
this.name = name;
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package org.nl.wms.mps.rest;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.wms.mps.service.ProduceWorkorderService;
|
||||||
|
import org.nl.wms.mps.service.dto.ProduceWorkorderDto;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-03-16
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "工单管理管理")
|
||||||
|
@RequestMapping("/api/produceWorkorder")
|
||||||
|
@Slf4j
|
||||||
|
public class ProduceWorkorderController {
|
||||||
|
|
||||||
|
private final ProduceWorkorderService produceWorkorderService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询工单管理")
|
||||||
|
@ApiOperation("查询工单管理")
|
||||||
|
//@PreAuthorize("@el.check('produceWorkorder:list')")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(produceWorkorderService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增工单管理")
|
||||||
|
@ApiOperation("新增工单管理")
|
||||||
|
//@PreAuthorize("@el.check('produceWorkorder:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody ProduceWorkorderDto dto) {
|
||||||
|
produceWorkorderService.create(dto);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改工单管理")
|
||||||
|
@ApiOperation("修改工单管理")
|
||||||
|
//@PreAuthorize("@el.check('produceWorkorder:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody ProduceWorkorderDto dto) {
|
||||||
|
produceWorkorderService.update(dto);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除工单管理")
|
||||||
|
@ApiOperation("删除工单管理")
|
||||||
|
//@PreAuthorize("@el.check('produceWorkorder:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||||
|
produceWorkorderService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getNotWorkDeviceByWorkproceduceId")
|
||||||
|
@Log("根据工序查询没有工单的设备")
|
||||||
|
@ApiOperation("根据工序查询没有工单的设备")
|
||||||
|
//@PreAuthorize("@el.check('WorkProcedure:add')")
|
||||||
|
public ResponseEntity<Object> getNotWorkDeviceByWorkproceduceId(@RequestBody JSONObject param) {
|
||||||
|
return new ResponseEntity<>(produceWorkorderService.getNotWorkDeviceByWorkproceduceId(param),HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getDtl")
|
||||||
|
@Log("获取当前工单下的工单生产记录")
|
||||||
|
@ApiOperation("获取当前工单下的工单生产记录")
|
||||||
|
//@PreAuthorize("@el.check('produceshiftorder:list')")
|
||||||
|
public ResponseEntity<Object> getDtl(@RequestBody JSONObject param) {
|
||||||
|
return new ResponseEntity<>(produceWorkorderService.getDtl(param), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/forceFinish")
|
||||||
|
@Log("工单强制完成")
|
||||||
|
@ApiOperation("工单强制完成")
|
||||||
|
//@PreAuthorize("@el.check('produceshiftorder:list')")
|
||||||
|
public ResponseEntity<Object> forceFinish(@RequestBody JSONObject param) {
|
||||||
|
produceWorkorderService.forceFinish(param);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/excelImport")
|
||||||
|
@Log("excel导入")
|
||||||
|
@ApiOperation("excel导入")
|
||||||
|
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||||
|
produceWorkorderService.excelImport(file, request);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.mps.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.wms.mps.service.dto.ProduceWorkorderDto;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务接口
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-03-16
|
||||||
|
**/
|
||||||
|
public interface ProduceWorkorderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据不分页
|
||||||
|
* @param whereJson 条件参数
|
||||||
|
* @return List<ProduceWorkorderDto>
|
||||||
|
*/
|
||||||
|
List<ProduceWorkorderDto> queryAll(Map whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询
|
||||||
|
* @param workorder_id ID
|
||||||
|
* @return ProduceWorkorder
|
||||||
|
*/
|
||||||
|
ProduceWorkorderDto findById(String workorder_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据编码查询
|
||||||
|
* @param code code
|
||||||
|
* @return ProduceWorkorder
|
||||||
|
*/
|
||||||
|
ProduceWorkorderDto findByCode(String code);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param dto /
|
||||||
|
*/
|
||||||
|
void create(ProduceWorkorderDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param dto /
|
||||||
|
*/
|
||||||
|
void update(ProduceWorkorderDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更换设备时根据工单所属工序 查询所有工单中没有生产的设备
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONArray getNotWorkDeviceByWorkproceduceId(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前工单的记录
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONArray getDtl(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 强制完成
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
void forceFinish(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 看板强制完成
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
void finish(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel导入
|
||||||
|
* @param file
|
||||||
|
* @param request
|
||||||
|
*/
|
||||||
|
void excelImport(MultipartFile file, HttpServletRequest request);
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
package org.nl.wms.mps.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @description /
|
||||||
|
* @date 2023-03-16
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class ProduceWorkorderDto implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
private String workorder_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
private String workorder_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班次类型
|
||||||
|
*/
|
||||||
|
private String shift_type_scode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序编码
|
||||||
|
*/
|
||||||
|
private String workprocedure_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产区域
|
||||||
|
*/
|
||||||
|
private String product_area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划数量
|
||||||
|
*/
|
||||||
|
private BigDecimal plan_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际数量
|
||||||
|
*/
|
||||||
|
private BigDecimal real_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员实际数量
|
||||||
|
*/
|
||||||
|
private BigDecimal person_real_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电气实际数量
|
||||||
|
*/
|
||||||
|
private BigDecimal dq_real_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料单重
|
||||||
|
*/
|
||||||
|
private BigDecimal material_weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划生产开始时间
|
||||||
|
*/
|
||||||
|
private String planproducestart_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划生产结束时间
|
||||||
|
*/
|
||||||
|
private String planproduceend_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际生产开始时间
|
||||||
|
*/
|
||||||
|
private String realproducestart_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际生产结束时间
|
||||||
|
*/
|
||||||
|
private String realproduceend_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前生产设备编码
|
||||||
|
*/
|
||||||
|
private String current_device_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前生产人员id
|
||||||
|
*/
|
||||||
|
private String current_produce_person_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作工是否允许修改报工数量
|
||||||
|
*/
|
||||||
|
private String is_canupdate_update;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单状态
|
||||||
|
*/
|
||||||
|
private String workorder_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否搬运
|
||||||
|
*/
|
||||||
|
private String is_needmove;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售单标识
|
||||||
|
*/
|
||||||
|
private String sale_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建类型
|
||||||
|
*/
|
||||||
|
private String create_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单是否异常
|
||||||
|
*/
|
||||||
|
private String is_error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常信息
|
||||||
|
*/
|
||||||
|
private String error_info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
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 String is_delete;
|
||||||
|
}
|
||||||
@@ -0,0 +1,557 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.mps.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.poi.excel.ExcelReader;
|
||||||
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
|
import org.nl.system.service.user.ISysUserService;
|
||||||
|
import org.nl.system.service.user.dao.SysUser;
|
||||||
|
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||||
|
import org.nl.wms.enums.WorkerOrderEnum;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
|
import org.nl.wms.mps.service.ProduceWorkorderService;
|
||||||
|
import org.nl.wms.mps.service.WorkOrderImportEnum;
|
||||||
|
import org.nl.wms.mps.service.dto.ProduceWorkorderDto;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @description 服务实现
|
||||||
|
* @date 2023-03-16
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||||
|
|
||||||
|
private final ClassstandardService classstandardService;
|
||||||
|
|
||||||
|
private final WmsToAcsService wmsToAcsService;
|
||||||
|
|
||||||
|
private final ISysUserService userService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
|
String produceorder_code = MapUtil.getStr(whereJson, "produceorder_code");
|
||||||
|
String material = MapUtil.getStr(whereJson, "material");
|
||||||
|
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||||
|
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||||
|
String order_status = MapUtil.getStr(whereJson, "order_status");
|
||||||
|
String shift_type_scode = MapUtil.getStr(whereJson, "shift_type_scode");
|
||||||
|
String parent_id = MapUtil.getStr(whereJson, "product_series");
|
||||||
|
String sale_id = MapUtil.getStr(whereJson, "sale_id");
|
||||||
|
String is_error = MapUtil.getStr(whereJson, "is_error");
|
||||||
|
String product_series = "";
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "1");
|
||||||
|
//map.put("order_status", order_status);
|
||||||
|
map.put("shift_type_scode", shift_type_scode);
|
||||||
|
map.put("begin_time", begin_time);
|
||||||
|
map.put("end_time", end_time);
|
||||||
|
if (StrUtil.isNotEmpty(order_status)) {
|
||||||
|
order_status = order_status.replace("[\"", "").replace("\"]", "").replace("\"", "");
|
||||||
|
}
|
||||||
|
map.put("order_status", order_status);
|
||||||
|
map.put("is_error", is_error);
|
||||||
|
//处理状态为未完成
|
||||||
|
if (StrUtil.isNotEmpty(order_status) && order_status.contains("-1")) {
|
||||||
|
map.put("unFinish", "-1");
|
||||||
|
map.put("order_status", order_status.replace("-1", ""));
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(parent_id)) {
|
||||||
|
product_series = classstandardService.getChildIdStr(parent_id);
|
||||||
|
map.put("product_series", product_series);
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(produceorder_code)) {
|
||||||
|
map.put("produceorder_code", "%" + produceorder_code + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(material)) {
|
||||||
|
map.put("material", "%" + material + "%");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(sale_id)) {
|
||||||
|
map.put("sale_id", "%" + sale_id + "%");
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = WQL.getWO("MPS_PRODUCEWORKORDER").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ShiftOrder.update_time desc");
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProduceWorkorderDto> queryAll(Map whereJson) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||||
|
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(ProduceWorkorderDto.class);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProduceWorkorderDto findById(String workorder_id) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||||
|
JSONObject json = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(json)) {
|
||||||
|
return json.toJavaObject(ProduceWorkorderDto.class);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProduceWorkorderDto findByCode(String code) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||||
|
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(json)) {
|
||||||
|
return json.toJavaObject(ProduceWorkorderDto.class);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void create(ProduceWorkorderDto dto) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
dto.setCreate_id(currentUserId);
|
||||||
|
dto.setCreate_name(nickName);
|
||||||
|
dto.setUpdate_id(currentUserId);
|
||||||
|
dto.setUpdate_name(nickName);
|
||||||
|
dto.setUpdate_time(DateUtil.now());
|
||||||
|
dto.setCreate_time(DateUtil.now());
|
||||||
|
dto.setWorkorder_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||||
|
dto.setWorkorder_code(CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||||
|
dto.setCreate_type(WorkerOrderEnum.PCINTO.getCode());
|
||||||
|
dto.setWorkorder_status(WorkerOrderEnum.CREATE.getCode());
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
|
wo.insert(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(ProduceWorkorderDto dto) {
|
||||||
|
ProduceWorkorderDto entity = this.findById(dto.getWorkorder_id());
|
||||||
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
|
||||||
|
|
||||||
|
dto.setUpdate_time(DateUtil.now());
|
||||||
|
dto.setUpdate_id(currentUserId);
|
||||||
|
dto.setUpdate_name(nickName);
|
||||||
|
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
|
wo.update(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteAll(String[] ids) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
|
||||||
|
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||||
|
for (String workorder_id : ids) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("workorder_id", String.valueOf(workorder_id));
|
||||||
|
param.put("is_delete", "1");
|
||||||
|
param.put("update_optid", currentUserId);
|
||||||
|
param.put("update_optname", nickName);
|
||||||
|
param.put("update_time", DateUtil.now());
|
||||||
|
wo.update(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getNotWorkDeviceByWorkproceduceId(JSONObject param) {
|
||||||
|
Map res = new HashMap();
|
||||||
|
res.put("flag", "2");
|
||||||
|
res.put("workprocedure_id", param.getString("workproceduce_id"));
|
||||||
|
JSONArray resultJSONArray = WQL.getWO("MPS_PRODUCEWORKORDER").addParamMap(res).process().getResultJSONArray(0);
|
||||||
|
return resultJSONArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getDtl(JSONObject param) {
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "3");
|
||||||
|
map.put("workorder_id", param.getString("workorder_id"));
|
||||||
|
JSONArray resultJSONArray = WQL.getWO("MPS_PRODUCEWORKORDER").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
return resultJSONArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void forceFinish(JSONObject param) {
|
||||||
|
this.finish(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void finish(JSONObject param) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
|
||||||
|
JSONObject row = param.getJSONObject("row");
|
||||||
|
//强制完成时修改工单状态
|
||||||
|
String workorder_id = row.getString("workorder_id");
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("PDM_produce_workOrder");
|
||||||
|
ProduceWorkorderDto workorderDto = this.findById(workorder_id);
|
||||||
|
JSONObject produceorderMap = new JSONObject();
|
||||||
|
produceorderMap.put("workorder_id", workorder_id);
|
||||||
|
produceorderMap.put("workorder_status", WorkerOrderEnum.COMPLETE.getCode());
|
||||||
|
produceorderMap.put("update_id", currentUserId);
|
||||||
|
produceorderMap.put("device_code", null);
|
||||||
|
produceorderMap.put("update_name", nickName);
|
||||||
|
produceorderMap.put("update_time", DateUtil.now());
|
||||||
|
produceorderMap.put("realproduceend_date", DateUtil.now());
|
||||||
|
wo.update(produceorderMap);
|
||||||
|
JSONObject jsonObject = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||||
|
String real_qty = jsonObject.getString("real_qty");
|
||||||
|
if (StrUtil.isEmpty(real_qty)) {
|
||||||
|
real_qty = "0";
|
||||||
|
}
|
||||||
|
//同时修改工单记录表中的期末数量及完成数量
|
||||||
|
WQLObject wo_record = WQLObject.getWQLObject("PDM_produce_workOrderRecord");
|
||||||
|
JSONObject result = wo_record.query("workorder_id = '" + workorder_id + "' and (operatetime_end = '' or operatetime_end is null) ").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
|
// todo: 数量不明确
|
||||||
|
result.put("person_finish_qty", real_qty);
|
||||||
|
result.put("person_report_qty", real_qty);
|
||||||
|
result.put("operatetime_end", DateUtil.now());
|
||||||
|
wo_record.update(result);
|
||||||
|
}
|
||||||
|
//工单开工以后需要向acs强制完成 wms向acs发送请求 工单强制完成
|
||||||
|
// TODO: 业务不明
|
||||||
|
String order_status = workorderDto.getWorkorder_status();
|
||||||
|
if (!order_status.equals("1") && !order_status.equals("2")) {
|
||||||
|
JSONArray array = new JSONArray();
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("ext_order_id", workorder_id);
|
||||||
|
map.put("type", "3");
|
||||||
|
array.add(map);
|
||||||
|
wmsToAcsService.orderStatusUpdate(array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void excelImport(MultipartFile file, HttpServletRequest request) {
|
||||||
|
// todo: 根据需求修改
|
||||||
|
if (file.isEmpty()) {
|
||||||
|
throw new BadRequestException("文件为空,请添加数据后重新导入");
|
||||||
|
}
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
|
||||||
|
// 1.获取上传文件输入流
|
||||||
|
InputStream inputStream = null;
|
||||||
|
try {
|
||||||
|
inputStream = file.getInputStream();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
//工单表
|
||||||
|
WQLObject wo_order = WQLObject.getWQLObject("PDM_produce_workOrder");
|
||||||
|
//物料表
|
||||||
|
WQLObject wo_material = WQLObject.getWQLObject("md_me_materialbase");
|
||||||
|
//设备表
|
||||||
|
WQLObject wo_device = WQLObject.getWQLObject("pdm_bi_device");
|
||||||
|
//工序表
|
||||||
|
WQLObject wo_workprocedure = WQLObject.getWQLObject("pdm_bi_workprocedure");
|
||||||
|
//人员表
|
||||||
|
//WQLObject wo_user = WQLObject.getWQLObject("sys_user");
|
||||||
|
|
||||||
|
// 调用用 hutool 方法读取数据 调用第一个sheet白班数据
|
||||||
|
ExcelReader excelReader = ExcelUtil.getReader(inputStream, 0);
|
||||||
|
// 从第1行开始获取数据 excelReader.read的结果是一个2纬的list,外层是行,内层是行对应的所有列
|
||||||
|
List<List<Object>> read = excelReader.read(0, excelReader.getRowCount());
|
||||||
|
String produce_date = "";
|
||||||
|
// 循环获取的数据
|
||||||
|
row:
|
||||||
|
for (int i = 0; i < read.size(); i++) {
|
||||||
|
List<Object> list = read.get(i);
|
||||||
|
if (ObjectUtil.isEmpty(list)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//获取每列
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
//按照列获取
|
||||||
|
param.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
param.put("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||||
|
param.put("macoperate_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
param.put("workorder_status", WorkerOrderEnum.CREATE.getCode());
|
||||||
|
param.put("shift_type_scode", WorkerOrderEnum.DAYSHIFT.getCode()); // 默认白班
|
||||||
|
String is_error = "0";
|
||||||
|
String error_message = "";
|
||||||
|
//循环每一行
|
||||||
|
col:
|
||||||
|
for (int j = 0; j < list.size(); j++) {
|
||||||
|
|
||||||
|
String col = String.valueOf(list.get(j));
|
||||||
|
//如果是第一行 为生产日期
|
||||||
|
if (i == 0 && j == 0) {
|
||||||
|
produce_date = col.split(":")[col.split(":").length - 1];
|
||||||
|
continue row;
|
||||||
|
}
|
||||||
|
//如果第一列包含规格二字 则为表头 结束内循环列
|
||||||
|
if (j == 0 && col.contains("规格名称")) {
|
||||||
|
continue row;
|
||||||
|
}
|
||||||
|
if (j == 0) {
|
||||||
|
//物料
|
||||||
|
if (StrUtil.isEmpty(col)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "物料规格为空,";
|
||||||
|
}
|
||||||
|
JSONObject json_material = wo_material.query("is_delete = '0' and material_spec = '" + col + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json_material)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "物料规格对应物料信息不存在,";
|
||||||
|
}else {
|
||||||
|
param.put("material_id", json_material.getString("material_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 2) {
|
||||||
|
if (StrUtil.isEmpty(col)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "工序名称为空,";
|
||||||
|
}
|
||||||
|
WorkOrderImportEnum idByName = WorkOrderImportEnum.getIdByName(col);
|
||||||
|
if (ObjectUtil.isEmpty(idByName)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "工序名称是否正确,";
|
||||||
|
}else {
|
||||||
|
param.put("workprocedure_id", idByName.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 4) {
|
||||||
|
//单重
|
||||||
|
param.put("material_weight", col);
|
||||||
|
}
|
||||||
|
if (j == 6) {
|
||||||
|
if (StrUtil.isEmpty(col)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "工单计划数量为空,";
|
||||||
|
}else {
|
||||||
|
param.put("plan_qty", col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 10) {
|
||||||
|
String workprocedure_id = param.getString("workprocedure_id");
|
||||||
|
JSONObject json_device = wo_device.query("is_delete = '0' and device_code = '" + col + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json_device)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "设备编码不存在,";
|
||||||
|
}
|
||||||
|
if (!workprocedure_id.equals(json_device.getString("workprocedure_id"))) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "设备与所属工序不匹配,";
|
||||||
|
}else {
|
||||||
|
param.put("device_id", json_device.getString("device_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 11) {
|
||||||
|
SysUser jsonUser = userService.getOne(new QueryWrapper<SysUser>().eq("username", SecurityUtils.getCurrentUsername()));
|
||||||
|
if (ObjectUtil.isEmpty(jsonUser)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "生产人员编码不存在!";
|
||||||
|
}else {
|
||||||
|
param.put("jockey_id", jsonUser.getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 12) {
|
||||||
|
//允许修改报工数量
|
||||||
|
String is_canupdate = "0";
|
||||||
|
if (col.equals("是")) {
|
||||||
|
is_canupdate = "1";
|
||||||
|
}
|
||||||
|
param.put("is_canupdate_update", is_canupdate);
|
||||||
|
}
|
||||||
|
if (j == 13) {
|
||||||
|
//是否agv搬运
|
||||||
|
String needmoce = "0";
|
||||||
|
if (col.equals("是")) {
|
||||||
|
needmoce = "1";
|
||||||
|
}
|
||||||
|
param.put("is_needmove", needmoce);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
param.put("is_error", is_error);
|
||||||
|
param.put("error_info", error_message);
|
||||||
|
param.put("planproducestart_date", produce_date + "07:30:00");
|
||||||
|
param.put("planproduceend_date", produce_date + "18:30:00");
|
||||||
|
param.put("create_id", currentUserId);
|
||||||
|
param.put("create_name", nickName);
|
||||||
|
param.put("create_time", DateUtil.now());
|
||||||
|
wo_order.insert(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1.获取上传文件输入流
|
||||||
|
inputStream = null;
|
||||||
|
try {
|
||||||
|
inputStream = file.getInputStream();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
//读取夜班工单数据
|
||||||
|
excelReader = ExcelUtil.getReader(inputStream, 1);
|
||||||
|
read = excelReader.read(0, excelReader.getRowCount());
|
||||||
|
String is_error = "0";
|
||||||
|
String error_message = "";
|
||||||
|
// 循环获取的数据
|
||||||
|
row:
|
||||||
|
for (int i = 0; i < read.size(); i++) {
|
||||||
|
List<Object> list = read.get(i);
|
||||||
|
//获取每列
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
//按照列获取
|
||||||
|
param.put("produceorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
param.put("produceorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||||
|
param.put("producedeviceorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||||
|
param.put("order_status", "00");
|
||||||
|
param.put("order_type_scode", "01");
|
||||||
|
param.put("produce_date", produce_date);
|
||||||
|
param.put("shift_type_scode", "02");
|
||||||
|
//循环每一行
|
||||||
|
col:
|
||||||
|
for (int j = 0; j < list.size(); j++) {
|
||||||
|
|
||||||
|
String col = String.valueOf(list.get(j));
|
||||||
|
//如果是第一行 为生产日期
|
||||||
|
if (i == 0 && j == 0) {
|
||||||
|
produce_date = col.split(":")[col.split(":").length - 1];
|
||||||
|
continue row;
|
||||||
|
}
|
||||||
|
//如果第一列包含规格二字 则为表头 结束内循环列
|
||||||
|
if (j == 0 && col.contains("规格名称")) {
|
||||||
|
continue row;
|
||||||
|
}
|
||||||
|
if (j == 0) {
|
||||||
|
//物料
|
||||||
|
if (StrUtil.isEmpty(col)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "物料规格为空,";
|
||||||
|
}
|
||||||
|
JSONObject json_material = wo_material.query("is_delete = '0' and material_spec = '" + col + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json_material)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "物料规格对应物料信息不存在,";
|
||||||
|
}else {
|
||||||
|
param.put("material_id", json_material.getString("material_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 2) {
|
||||||
|
if (StrUtil.isEmpty(col)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "工序名称为空,";
|
||||||
|
}
|
||||||
|
WorkOrderImportEnum idByName = WorkOrderImportEnum.getIdByName(col);
|
||||||
|
if (ObjectUtil.isEmpty(idByName)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "工序名称是否正确,";
|
||||||
|
}else {
|
||||||
|
param.put("workprocedure_id", idByName.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 4) {
|
||||||
|
//单重
|
||||||
|
param.put("material_weight", col);
|
||||||
|
}
|
||||||
|
if (j == 6) {
|
||||||
|
if (StrUtil.isEmpty(col)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "工单计划数量为空,";
|
||||||
|
}else {
|
||||||
|
param.put("plan_qty", col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if (j == 10) {
|
||||||
|
// //物料
|
||||||
|
// JSONObject json_material = wo_material.query("is_delete = '0' and material_code = '" + col + "'").uniqueResult(0);
|
||||||
|
// if (ObjectUtil.isEmpty(json_material)) {
|
||||||
|
// throw new BadRequestException("第'" + (i + 2) + "'行,物料编码不存在");
|
||||||
|
// }
|
||||||
|
// param.put("material_id", json_material.getString("material_id"));
|
||||||
|
// }
|
||||||
|
if (j == 10) {
|
||||||
|
String workprocedure_id = param.getString("workprocedure_id");
|
||||||
|
JSONObject json_device = wo_device.query("is_delete = '0' and device_code = '" + col + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json_device)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "设备编码不存在,";
|
||||||
|
}
|
||||||
|
if (!workprocedure_id.equals(json_device.getString("workprocedure_id"))) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "设备与所属工序不匹配,";
|
||||||
|
}else {
|
||||||
|
param.put("device_id", json_device.getString("device_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 11) {
|
||||||
|
SysUser jsonUser = userService.getOne(new QueryWrapper<SysUser>().eq("username", SecurityUtils.getCurrentUsername()));
|
||||||
|
if (ObjectUtil.isEmpty(jsonUser)) {
|
||||||
|
is_error = "1";
|
||||||
|
error_message = error_message + "生产人员编码不存在!";
|
||||||
|
}else {
|
||||||
|
param.put("jockey_id", jsonUser.getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j == 12) {
|
||||||
|
//允许修改报工数量
|
||||||
|
String is_canupdate = "0";
|
||||||
|
if (col.equals("是")) {
|
||||||
|
is_canupdate = "1";
|
||||||
|
}
|
||||||
|
param.put("is_canupdate_update", is_canupdate);
|
||||||
|
}
|
||||||
|
if (j == 13) {
|
||||||
|
//是否agv搬运
|
||||||
|
String needmoce = "0";
|
||||||
|
if (col.equals("是")) {
|
||||||
|
needmoce = "1";
|
||||||
|
}
|
||||||
|
param.put("is_needmove", needmoce);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
param.put("is_error", is_error);
|
||||||
|
param.put("error_info", error_message);
|
||||||
|
param.put("planproducestart_date", produce_date + "18:30:00");
|
||||||
|
DateTime dateTime = DateUtil.offsetDay(DateUtil.parse(produce_date), 1);
|
||||||
|
param.put("planproduceend_date", DateUtil.format(dateTime,"yyyy-MM-dd") + " 07:30:00");
|
||||||
|
param.put("create_id", currentUserId);
|
||||||
|
param.put("create_name", nickName);
|
||||||
|
param.put("create_time", DateUtil.now());
|
||||||
|
wo_order.insert(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
[交易说明]
|
||||||
|
交易名: 工单分页查询
|
||||||
|
所属模块:
|
||||||
|
功能简述:
|
||||||
|
版权所有:
|
||||||
|
表引用:
|
||||||
|
版本经历:
|
||||||
|
|
||||||
|
[数据库]
|
||||||
|
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||||
|
|
||||||
|
[IO定义]
|
||||||
|
#################################################
|
||||||
|
## 表字段对应输入参数
|
||||||
|
#################################################
|
||||||
|
输入.flag TYPEAS s_string
|
||||||
|
输入.jockey_id TYPEAS s_string
|
||||||
|
输入.sale_id TYPEAS s_string
|
||||||
|
输入.produceorder_id TYPEAS s_string
|
||||||
|
输入.workprocedure_code TYPEAS s_string
|
||||||
|
输入.order_status TYPEAS s_string
|
||||||
|
输入.shift_type_scode TYPEAS s_string
|
||||||
|
输入.begin_time TYPEAS s_string
|
||||||
|
输入.end_time TYPEAS s_string
|
||||||
|
输入.produceorder_code TYPEAS s_string
|
||||||
|
输入.material TYPEAS s_string
|
||||||
|
输入.is_error TYPEAS s_string
|
||||||
|
输入.product_series TYPEAS f_string
|
||||||
|
输入.workprocedure_ids TYPEAS f_string
|
||||||
|
输入.workprocedure_id TYPEAS f_string
|
||||||
|
输入.unFinish TYPEAS s_string
|
||||||
|
输入.device_ids TYPEAS f_string
|
||||||
|
|
||||||
|
|
||||||
|
[临时表]
|
||||||
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
|
[临时变量]
|
||||||
|
--所有中间过程变量均可在此处定义
|
||||||
|
|
||||||
|
[业务过程]
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 1、输入输出检查 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 2、主过程前处理 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 3、业务主过程 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
IF 输入.flag = "1"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
ShiftOrder.*,
|
||||||
|
material.material_name,
|
||||||
|
material.material_code,
|
||||||
|
material.material_spec,
|
||||||
|
pro.workprocedure_code,
|
||||||
|
pro.workprocedure_name,
|
||||||
|
user.person_name
|
||||||
|
FROM
|
||||||
|
PDM_produce_workOrder ShiftOrder
|
||||||
|
left join md_me_materialbase material on material.material_id = ShiftOrder.material_id
|
||||||
|
left join PDM_BI_WorkProcedure pro on pro.workprocedure_id = ShiftOrder.workprocedure_id
|
||||||
|
left join sys_user user on user.user_id = ShiftOrder.current_produce_person_id
|
||||||
|
WHERE
|
||||||
|
ShiftOrder.is_delete = '0'
|
||||||
|
OPTION 输入.unFinish <> ""
|
||||||
|
ShiftOrder.workorder_status <> '5'
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.order_status <> ""
|
||||||
|
find_in_set( ShiftOrder.workorder_status, 输入.order_status)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.shift_type_scode <> ""
|
||||||
|
ShiftOrder.shift_type_scode = 输入.shift_type_scode
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.is_error <> ""
|
||||||
|
ShiftOrder.is_error = 输入.is_error
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.product_series <> ""
|
||||||
|
material.product_series in 输入.product_series
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
ShiftOrder.produce_date >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
ShiftOrder.produce_date <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.sale_id <> ""
|
||||||
|
ShiftOrder.sale_id like 输入.sale_id
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.workprocedure_code <> ""
|
||||||
|
ShiftOrder.workprocedure_code like 输入.workprocedure_code
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.material <> ""
|
||||||
|
(
|
||||||
|
material.material_code like 输入.material or
|
||||||
|
material.material_name like 输入.material or
|
||||||
|
material.material_spec like 输入.material
|
||||||
|
)
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
IF 输入.flag = "2"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
device.*
|
||||||
|
FROM
|
||||||
|
pdm_bi_device device
|
||||||
|
WHERE
|
||||||
|
device.is_delete = '0'
|
||||||
|
OPTION 输入.workprocedure_id <> ""
|
||||||
|
device.workprocedure_id = 输入.workprocedure_id
|
||||||
|
and device.device_code not in (
|
||||||
|
select o.current_device_code as device_code
|
||||||
|
from PDM_produce_workOrder o
|
||||||
|
where o.workorder_status <> '5'
|
||||||
|
)
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
IF 输入.flag = "3"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
record.*,
|
||||||
|
device.device_code,
|
||||||
|
device.device_name
|
||||||
|
FROM
|
||||||
|
PDM_produce_workOrderRecord record
|
||||||
|
LEFT JOIN PDM_BI_Device device ON record.device_code = device.device_code
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
OPTION 输入.workorder_id <> ""
|
||||||
|
record.workorder_id = 输入.workorder_id
|
||||||
|
ENDOPTION
|
||||||
|
order by record.seq_number
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
Binary file not shown.
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder',
|
url: 'api/produceWorkorder',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -10,7 +10,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function addRows(data) {
|
export function addRows(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/addRows',
|
url: 'api/produceWorkorder/addRows',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -18,7 +18,7 @@ export function addRows(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/',
|
url: 'api/produceWorkorder/',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -26,7 +26,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder',
|
url: 'api/produceWorkorder',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -34,7 +34,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function submits(data) {
|
export function submits(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/submits',
|
url: 'api/produceWorkorder/submits',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -42,7 +42,7 @@ export function submits(data) {
|
|||||||
|
|
||||||
export function getDevice(data) {
|
export function getDevice(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/getDevice',
|
url: 'api/produceWorkorder/getDevice',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -50,7 +50,7 @@ export function getDevice(data) {
|
|||||||
|
|
||||||
export function getTable(data) {
|
export function getTable(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/getTable',
|
url: 'api/produceWorkorder/getTable',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -58,7 +58,7 @@ export function getTable(data) {
|
|||||||
|
|
||||||
export function openStart(data) {
|
export function openStart(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/openStart',
|
url: 'api/produceWorkorder/openStart',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -66,7 +66,7 @@ export function openStart(data) {
|
|||||||
|
|
||||||
export function saveReport(data) {
|
export function saveReport(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/saveReport',
|
url: 'api/produceWorkorder/saveReport',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -74,7 +74,7 @@ export function saveReport(data) {
|
|||||||
|
|
||||||
export function finish(data) {
|
export function finish(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/finish',
|
url: 'api/produceWorkorder/finish',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -82,7 +82,7 @@ export function finish(data) {
|
|||||||
|
|
||||||
export function forceFinish(data) {
|
export function forceFinish(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/forceFinish',
|
url: 'api/produceWorkorder/forceFinish',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -90,7 +90,7 @@ export function forceFinish(data) {
|
|||||||
|
|
||||||
export function getReportWork(data) {
|
export function getReportWork(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/getReportWork',
|
url: 'api/produceWorkorder/getReportWork',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -98,7 +98,7 @@ export function getReportWork(data) {
|
|||||||
|
|
||||||
export function getDtl(data) {
|
export function getDtl(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/getDtl',
|
url: 'api/produceWorkorder/getDtl',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -106,7 +106,7 @@ export function getDtl(data) {
|
|||||||
|
|
||||||
export function excelImport(data) {
|
export function excelImport(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/excelImport',
|
url: 'api/produceWorkorder/excelImport',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -114,7 +114,7 @@ export function excelImport(data) {
|
|||||||
|
|
||||||
export function getNotWorkDeviceByWorkproceduceId(data) {
|
export function getNotWorkDeviceByWorkproceduceId(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/getNotWorkDeviceByWorkproceduceId',
|
url: 'api/produceWorkorder/getNotWorkDeviceByWorkproceduceId',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -122,17 +122,10 @@ export function getNotWorkDeviceByWorkproceduceId(data) {
|
|||||||
|
|
||||||
export function replaceDevice(data) {
|
export function replaceDevice(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/produceshiftorder/replaceDevice',
|
url: 'api/produceWorkorder/replaceDevice',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUser() {
|
export default { add, addRows, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, excelImport, getNotWorkDeviceByWorkproceduceId, replaceDevice }
|
||||||
return request({
|
|
||||||
url: 'api/produceshiftorder/getUser',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default { add, addRows, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, excelImport, getNotWorkDeviceByWorkproceduceId, replaceDevice, getUser }
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div style="margin: 5px" v-loading="loading">
|
<div style="margin: 5px" v-loading="loading">
|
||||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane :label="d.label" :name="d.value" v-for="d in dict.notice_type" :key="d.id">
|
<el-tab-pane :label="d.label" :name="d.value" v-for="d in dict.notice_type" :key="d.id">
|
||||||
<el-empty v-show="notReadMsgList[d.value-1].length == 0" description="暂无信息" ></el-empty>
|
<!-- <el-empty v-show="notReadMsgList[d.value-1].length == 0" description="暂无信息" ></el-empty>-->
|
||||||
<div v-for="o in notReadMsgList[d.value-1]" :key="o.notice_id">
|
<div v-for="o in notReadMsgList[d.value-1]" :key="o.notice_id">
|
||||||
<a href="javascript:" @click="showMessage(o)">
|
<a href="javascript:" @click="showMessage(o)">
|
||||||
<el-row @click="showMessage">
|
<el-row @click="showMessage">
|
||||||
|
|||||||
@@ -10,17 +10,7 @@
|
|||||||
<el-card class="box-card" shadow="never">
|
<el-card class="box-card" shadow="never">
|
||||||
<el-form ref="form" disabled :inline="true" :model="form" :rules="rules" size="mini" label-width="180px">
|
<el-form ref="form" disabled :inline="true" :model="form" :rules="rules" size="mini" label-width="180px">
|
||||||
<el-form-item label="工单编码">
|
<el-form-item label="工单编码">
|
||||||
<el-input v-model="form.produceorder_code" style="width: 200px;" />
|
<el-input v-model="form.workorder_code" style="width: 200px;" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工单类型">
|
|
||||||
<el-select v-model="form.order_type_scode" style="width: 200px" filterable placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.PDM_BI_ORDERTYPE"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属工序">
|
<el-form-item label="所属工序">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -38,9 +28,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="生产日期">
|
|
||||||
<el-date-picker v-model="form.produce_date" type="date" value-format="yyyy-MM-dd" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="false" label="物料标识">
|
<el-form-item v-if="false" label="物料标识">
|
||||||
<el-input v-model="form.material_id" style="width: 200px;" />
|
<el-input v-model="form.material_id" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -89,9 +76,6 @@
|
|||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="报工数量">
|
|
||||||
<el-input v-model="form.report_qty" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="实际开始时间">
|
<el-form-item label="实际开始时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.realproducestart_date"
|
v-model="form.realproducestart_date"
|
||||||
@@ -178,17 +162,20 @@
|
|||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
>
|
>
|
||||||
<el-table-column prop="device_code" label="设备编码" align="center" />
|
<el-table-column prop="device_code" label="设备编码" align="center" />
|
||||||
|
<el-table-column prop="workorder_code" label="工单编号" />
|
||||||
|
<el-table-column prop="shift_type_scode" label="班次类型" />
|
||||||
|
<el-table-column prop="product_area" label="生产区域" />
|
||||||
<el-table-column prop="device_name" label="设备名称" align="center" min-width="200" show-overflow-tooltip/>
|
<el-table-column prop="device_name" label="设备名称" align="center" min-width="200" show-overflow-tooltip/>
|
||||||
<el-table-column prop="produce_qty" label="生产数量" align="center" />
|
<el-table-column prop="dq_init_qty" label="电气期初数量" />
|
||||||
<el-table-column prop="init_qty" label="期初数量" align="center" />
|
<el-table-column prop="person_init_qty" label="人员期初数量" />
|
||||||
<el-table-column prop="finish_qty" label="期末数量" align="center" />
|
<el-table-column prop="dq_report_qty" label="电气报工数量" />
|
||||||
<el-table-column prop="finishproduct_qty" label="完成数量" align="center" />
|
<el-table-column prop="person_report_qty" label="人员报工数量" />
|
||||||
<el-table-column prop="report_qty" label="报工数量" align="center" />
|
<el-table-column prop="dq_finish_qty" label="电气期末数量" />
|
||||||
<el-table-column prop="operatetime_start" label="开始时间" align="center" min-width="130" show-overflow-tooltip/>
|
<el-table-column prop="person_finish_qty" label="人员期末数量" />
|
||||||
<el-table-column prop="operatetime_end" label="结束时间" align="center" min-width="130" show-overflow-tooltip />
|
<el-table-column prop="operatetime_start" label="开工时间" />
|
||||||
|
<el-table-column prop="operatetime_end" label="完工时间" />
|
||||||
<el-table-column prop="nick_name" label="操作人" align="center" />
|
<el-table-column prop="nick_name" label="操作人" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="dialogVisible = false">确定</el-button>
|
<el-button type="primary" @click="dialogVisible = false">确定</el-button>
|
||||||
@@ -227,8 +214,8 @@ export default {
|
|||||||
classes3: [],
|
classes3: [],
|
||||||
form: {
|
form: {
|
||||||
sale_id: null,
|
sale_id: null,
|
||||||
produceorder_id: null,
|
workorder_id: null,
|
||||||
produceorder_code: null,
|
workorder_code: null,
|
||||||
producedeviceorder_code: null,
|
producedeviceorder_code: null,
|
||||||
shift_type_scode: null,
|
shift_type_scode: null,
|
||||||
workprocedure_id: null,
|
workprocedure_id: null,
|
||||||
@@ -278,7 +265,7 @@ export default {
|
|||||||
this.getworkprocedure()
|
this.getworkprocedure()
|
||||||
this.initClass3()
|
this.initClass3()
|
||||||
this.is_null()
|
this.is_null()
|
||||||
crudProduceshiftorder.getDtl({ produceorder_id: this.form.produceorder_id }).then(res => {
|
crudProduceshiftorder.getDtl({ workorder_id: this.form.workorder_id }).then(res => {
|
||||||
this.tableData = res
|
this.tableData = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,23 +31,6 @@
|
|||||||
class="filter-item"
|
class="filter-item"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工单类型">
|
|
||||||
<el-select
|
|
||||||
v-model="query.order_type_scode"
|
|
||||||
style="width: 200px"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
placeholder="请选择"
|
|
||||||
@change="crud.toQuery"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.PDM_BI_ORDERTYPE"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label=" 工单状态">
|
<el-form-item label=" 工单状态">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -120,21 +103,14 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否异常">
|
<el-form-item label="是否异常">
|
||||||
<el-select
|
<el-switch
|
||||||
v-model="query.is_error"
|
v-model="query.is_error"
|
||||||
style="width: 200px"
|
active-value="0"
|
||||||
clearable
|
inactive-value="1"
|
||||||
filterable
|
active-color="#C0CCDA"
|
||||||
placeholder="请选择"
|
inactive-color="#409EFF"
|
||||||
@change="crud.toQuery"
|
@change="crud.toQuery"
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.IS_OR_NOT"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
/>
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<rrOperation :crud="crud" />
|
<rrOperation :crud="crud" />
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -204,16 +180,6 @@
|
|||||||
width="1200px"
|
width="1200px"
|
||||||
>
|
>
|
||||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="160px">
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="160px">
|
||||||
<el-form-item label="工单类型" prop="order_type_scode">
|
|
||||||
<el-select v-model="form.order_type_scode" style="width: 200px" filterable placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.PDM_BI_ORDERTYPE"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所属工序" prop="workprocedure_id">
|
<el-form-item label="所属工序" prop="workprocedure_id">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.workprocedure_id"
|
v-model="form.workprocedure_id"
|
||||||
@@ -231,8 +197,20 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="生产日期" prop="produce_date">
|
<el-form-item v-if="crud.status.add" label="生产设备" prop="current_device_code">
|
||||||
<el-date-picker v-model="form.produce_date" type="date" value-format="yyyy-MM-dd" style="width: 200px;" />
|
<el-select
|
||||||
|
v-model="form.current_device_code"
|
||||||
|
clearable
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in deviceList"
|
||||||
|
:key="item.device_code"
|
||||||
|
:label="item.device_name"
|
||||||
|
:value="item.device_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="false" label="物料标识" prop="material_id">
|
<el-form-item v-if="false" label="物料标识" prop="material_id">
|
||||||
<el-input v-model="form.material_id" style="width: 200px;" />
|
<el-input v-model="form.material_id" style="width: 200px;" />
|
||||||
@@ -282,9 +260,6 @@
|
|||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="crud.status.edit" label="报工数量" prop="report_qty">
|
|
||||||
<el-input v-model="form.report_qty" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="crud.status.edit" label="实际数量" prop="report_qty">
|
<el-form-item v-if="crud.status.edit" label="实际数量" prop="report_qty">
|
||||||
<el-input v-model="form.real_qty" style="width: 200px;" />
|
<el-input v-model="form.real_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -327,42 +302,6 @@
|
|||||||
>{{ item.label }}
|
>{{ item.label }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="工单数量" prop="orderNum">
|
|
||||||
<el-input v-model="form.orderNum" type="number" :min="1" oninput="value = value.replace(/[^\d]/g, '')" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="操作人员" prop="jockey_id">
|
|
||||||
<el-select
|
|
||||||
v-model="form.jockey_id"
|
|
||||||
clearable
|
|
||||||
size="mini"
|
|
||||||
class="filter-item"
|
|
||||||
style="width: 200px;"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in userList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.nickName"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="crud.status.add" label="生产设备" prop="device_id">
|
|
||||||
<el-select
|
|
||||||
v-model="form.device_id"
|
|
||||||
clearable
|
|
||||||
size="mini"
|
|
||||||
class="filter-item"
|
|
||||||
style="width: 200px;"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in deviceList"
|
|
||||||
:key="item.device_id"
|
|
||||||
:label="item.device_name"
|
|
||||||
:value="item.device_id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
@@ -379,71 +318,69 @@
|
|||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column v-if="false" prop="produceorder_id" label="生产班次工单标识" />
|
<el-table-column v-if="false" prop="workorder_id" label="生产班次工单标识" />
|
||||||
<el-table-column prop="produceorder_code" label="工单编号" width="140px">
|
<el-table-column prop="workorder_code" label="工单编号" width="140px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.produceorder_code }}</el-link>
|
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.workorder_code }}</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="producedeviceorder_code" label="机台工单号" width="100px" />
|
<el-table-column prop="shift_type_scode" label="班次类型" >
|
||||||
<el-table-column prop="order_status" label="工单状态">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ dict.label.MPS_BD_ORDERSTATUS[scope.row.order_status] }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="shift_type_scode" label="班次类型">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
|
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="false" prop="workprocedure_id" label="工序标识" />
|
<el-table-column prop="workprocedure_code" label="工序编码" />
|
||||||
<el-table-column prop="produce_date" label="生产日期" width="100px" />
|
<el-table-column prop="product_area" label="生产区域" />
|
||||||
<el-table-column prop="device_code" label="设备编码" />
|
|
||||||
<el-table-column prop="device_name" label="设备名称" />
|
|
||||||
<el-table-column prop="jockey_name" label="操作工" />
|
|
||||||
<el-table-column prop="plan_qty" label="计划数量" />
|
<el-table-column prop="plan_qty" label="计划数量" />
|
||||||
<el-table-column prop="real_qty" label="实际数量" />
|
<el-table-column prop="real_qty" label="实际数量" />
|
||||||
<el-table-column prop="report_qty" label="报工数量" />
|
<el-table-column prop="person_name" label="操作员" />
|
||||||
<el-table-column prop="is_error" label="是否异常">
|
<el-table-column prop="person_real_qty" label="人员实际数量" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="dq_real_qty" label="电气实际数量" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="material_name" label="物料名称" width="120" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="workprocedure_name" label="工序名称" width="120" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="material_weight" label="物料单重" width="100"/>
|
||||||
|
<el-table-column prop="planproducestart_date" label="计划开始时间" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="planproduceend_date" label="计划结束时间" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="realproducestart_date" label="实际开始时间" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="realproduceend_date" label="实际结束时间" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="current_device_code" label="当前设备编码" width="100" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="is_canupdate_update" label="操作工是否允许修改报工数量" width="200" show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.IS_OR_NOT[scope.row.is_error] }}
|
{{ dict.label.IS_OR_NOT[scope.row.is_canupdate_update] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="error_info" label="异常信息" show-overflow-tooltip />
|
<el-table-column prop="workorder_status" label="工单状态">
|
||||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
|
{{ dict.label.MPS_BD_ORDERSTATUS[scope.row.workorder_status] }}
|
||||||
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
|
</template>
|
||||||
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
|
</el-table-column>
|
||||||
<el-table-column prop="sale_id" label="销售单标识" width="100" show-overflow-tooltip />
|
<el-table-column prop="is_needmove" label="是否搬运" >
|
||||||
<el-table-column prop="class_name" label="产品系列" width="100" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="material_weight" label="物料单重" />
|
|
||||||
<el-table-column prop="planproducestart_date" label="计划生产开始时间" width="150" />
|
|
||||||
<el-table-column prop="planproduceend_date" label="计划生产结束时间" width="150" />
|
|
||||||
<el-table-column prop="realproducestart_date" label="实际生产开始时间" width="150" />
|
|
||||||
<el-table-column prop="realproduceend_date" label="实际生产结束时间" width="150" />
|
|
||||||
<el-table-column prop="is_needmove" label="是否搬运">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.IS_OR_NOT[scope.row.is_needmove] }}
|
{{ dict.label.IS_OR_NOT[scope.row.is_needmove] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="order_type_scode" label="工单类型">
|
<el-table-column prop="create_type" label="创建类型">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.PDM_BI_ORDERTYPE[scope.row.order_type_scode] }}
|
{{ dict.label.WORKORDER_CREATE_TYPE[scope.row.create_type] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="create_name" label="创建人" />
|
<el-table-column prop="is_error" label="是否异常" >
|
||||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="update_optname" label="修改人" />
|
{{ dict.label.IS_OR_NOT[scope.row.is_error] }}
|
||||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="error_info" label="异常信息" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
<el-table-column prop="create_name" label="创建人" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="create_time" label="创建时间" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="update_name" label="修改人" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="update_time" label="修改时间" show-overflow-tooltip/>
|
||||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<udOperation
|
<udOperation
|
||||||
:data="scope.row"
|
:data="scope.row"
|
||||||
:permission="permission"
|
:permission="permission"
|
||||||
/>
|
/>
|
||||||
<el-button slot="right" :disabled="scope.row.order_status === '04' || scope.row.order_status === '02'" size="mini" type="text" icon="el-icon-warning" @click="replaceDevice(scope.row.workprocedure_id, scope.row.produceorder_code)">
|
|
||||||
更换设备
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -481,50 +418,47 @@ import UploadDialog from '@/views/wms/mps/produce/UploadDialog'
|
|||||||
import ReplaceDeviceDialog from '@/views/wms/mps/produce/ReplaceDeviceDialog'
|
import ReplaceDeviceDialog from '@/views/wms/mps/produce/ReplaceDeviceDialog'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
produceorder_id: null,
|
workorder_id: null,
|
||||||
produceorder_code: null,
|
workorder_code: null,
|
||||||
producedeviceorder_code: null,
|
shift_type_scode: null,
|
||||||
shift_type_scode: '01',
|
|
||||||
workprocedure_id: null,
|
workprocedure_id: null,
|
||||||
produce_date: null,
|
product_area: null,
|
||||||
plan_qty: null,
|
plan_qty: null,
|
||||||
real_qty: null,
|
real_qty: null,
|
||||||
report_qty: null,
|
person_real_qty: null,
|
||||||
|
dq_real_qty: null,
|
||||||
material_id: null,
|
material_id: null,
|
||||||
material_code: null,
|
|
||||||
material_weight: null,
|
material_weight: null,
|
||||||
planproducestart_date: null,
|
planproducestart_date: null,
|
||||||
planproduceend_date: null,
|
planproduceend_date: null,
|
||||||
realproducestart_date: null,
|
realproducestart_date: null,
|
||||||
realproduceend_date: null,
|
realproduceend_date: null,
|
||||||
order_status: '00',
|
current_device_code: null,
|
||||||
is_needmove: '0',
|
current_produce_person_id: null,
|
||||||
order_type_scode: '01',
|
is_canupdate_update: null,
|
||||||
|
workorder_status: null,
|
||||||
|
is_needmove: null,
|
||||||
|
sale_id: null,
|
||||||
|
create_type: null,
|
||||||
|
is_error: null,
|
||||||
|
error_info: null,
|
||||||
|
remark: null,
|
||||||
create_id: null,
|
create_id: null,
|
||||||
create_name: null,
|
create_name: null,
|
||||||
create_time: null,
|
create_time: null,
|
||||||
update_optid: null,
|
update_id: null,
|
||||||
update_optname: null,
|
update_name: null,
|
||||||
update_time: null,
|
update_time: null,
|
||||||
sysdeptid: null,
|
is_delete: null
|
||||||
syscompanyid: null,
|
|
||||||
is_delete: null,
|
|
||||||
material_name: null,
|
|
||||||
device_id: null,
|
|
||||||
is_canupdate_update: '1',
|
|
||||||
material_spec: null,
|
|
||||||
sale_id: null,
|
|
||||||
orderNum: 1,
|
|
||||||
jockey_id: ''
|
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'Produceshiftorder',
|
name: 'Produceshiftorder',
|
||||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, MaterDtl, Treeselect, ViewDialog, UploadDialog, ReplaceDeviceDialog },
|
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, MaterDtl, Treeselect, ViewDialog, UploadDialog, ReplaceDeviceDialog },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
dicts: ['PDM_BI_SHIFTTYPE', 'MPS_BD_ORDERSTATUS', 'is_used', 'PDM_BI_ORDERTYPE', 'IS_OR_NOT'],
|
dicts: ['PDM_BI_SHIFTTYPE', 'MPS_BD_ORDERSTATUS', 'WORKORDER_CREATE_TYPE', 'is_used', 'PDM_BI_ORDERTYPE', 'IS_OR_NOT'],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '工单', url: 'api/produceshiftorder', idField: 'produceorder_id', sort: 'produceorder_id,desc',
|
title: '工单', url: 'api/produceWorkorder', idField: 'produceorder_id', sort: 'produceorder_id,desc',
|
||||||
optShow: {
|
optShow: {
|
||||||
add: true,
|
add: true,
|
||||||
edit: false,
|
edit: false,
|
||||||
@@ -533,7 +467,8 @@ export default {
|
|||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
order_status: '-1'
|
order_status: '-1',
|
||||||
|
is_error: '0'
|
||||||
},
|
},
|
||||||
crudMethod: { ...crudProduceshiftorder }
|
crudMethod: { ...crudProduceshiftorder }
|
||||||
})
|
})
|
||||||
@@ -555,12 +490,6 @@ export default {
|
|||||||
produceorder_code: [
|
produceorder_code: [
|
||||||
{ required: true, message: '生产班次工单编号不能为空', trigger: 'blur' }
|
{ required: true, message: '生产班次工单编号不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
jockey_id: [
|
|
||||||
{ required: true, message: '操作人员不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
producedeviceorder_code: [
|
|
||||||
{ required: true, message: '机台工单号不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
shift_type_scode: [
|
shift_type_scode: [
|
||||||
{ required: true, message: '班次类型不能为空', trigger: 'blur' }
|
{ required: true, message: '班次类型不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@@ -585,14 +514,11 @@ export default {
|
|||||||
order_type_scode: [
|
order_type_scode: [
|
||||||
{ required: true, message: '工单类型不能为空', trigger: 'blur' }
|
{ required: true, message: '工单类型不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
orderNum: [
|
|
||||||
{ required: true, message: '生成工单数量不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
is_canupdate_update: [
|
is_canupdate_update: [
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
device_id: [
|
current_device_code: [
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
{ required: true, message: '设备不能为空', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -600,22 +526,16 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getworkprocedure()
|
this.getworkprocedure()
|
||||||
this.initClass3()
|
this.initClass3()
|
||||||
this.getUser()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tableChanged3() {
|
tableChanged3() {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
getNotWorkDeviceByWorkproceduceId(workproceduce_id) {
|
getNotWorkDeviceByWorkproceduceId(workproceduce_id) { // 根据工序标识获取设备列表
|
||||||
crudProduceshiftorder.getNotWorkDeviceByWorkproceduceId({ workproceduce_id: workproceduce_id }).then(res => {
|
crudProduceshiftorder.getNotWorkDeviceByWorkproceduceId({ workproceduce_id: workproceduce_id }).then(res => {
|
||||||
this.deviceList = res
|
this.deviceList = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUser() {
|
|
||||||
crudProduceshiftorder.getUser().then(res => {
|
|
||||||
this.userList = res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
initDataPlan() {
|
initDataPlan() {
|
||||||
const date = this.dateFormatter(new Date())
|
const date = this.dateFormatter(new Date())
|
||||||
const formatter1 = this.dateFormatter1(new Date())
|
const formatter1 = this.dateFormatter1(new Date())
|
||||||
|
|||||||
@@ -50,46 +50,62 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
<!--表单组件-->
|
<!--表单组件-->
|
||||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
<el-dialog
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
:close-on-click-modal="false"
|
||||||
<el-form-item label="设备编码" prop="device_code">
|
:before-close="crud.cancelCU"
|
||||||
<el-input v-model="form.device_code" style="width: 370px;" />
|
:visible.sync="crud.status.cu > 0"
|
||||||
|
:title="crud.status.title"
|
||||||
|
width="1200px">
|
||||||
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="160px">
|
||||||
|
<el-form-item label="设备编码" prop="material_code">
|
||||||
|
<el-input
|
||||||
|
v-model="form.device_code"
|
||||||
|
style="width: 200px;"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备名称" prop="device_name">
|
<el-form-item label="设备名称" prop="material_code">
|
||||||
<el-input v-model="form.device_name" style="width: 370px;" />
|
<el-input
|
||||||
|
v-model="form.device_name"
|
||||||
|
style="width: 200px;"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="生产区域" prop="product_area">
|
<el-form-item label="生产区域" prop="product_area">
|
||||||
<el-input v-model="form.product_area" style="width: 370px;" />
|
<el-input v-model="form.product_area" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备编码2">
|
<el-form-item label="设备编码2">
|
||||||
<el-input v-model="form.device_code2" style="width: 370px;" />
|
<el-input v-model="form.device_code2" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备来料仓上限数" prop="inupperlimit_qty">
|
<el-form-item label="设备来料仓上限数" prop="inupperlimit_qty">
|
||||||
<el-input v-model="form.inupperlimit_qty" style="width: 370px;" />
|
<el-input v-model="form.inupperlimit_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备来料仓下限数" prop="inlowerlimit_qty">
|
<el-form-item label="设备来料仓下限数" prop="inlowerlimit_qty">
|
||||||
<el-input v-model="form.inlowerlimit_qty" style="width: 370px;" />
|
<el-input v-model="form.inlowerlimit_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备产品仓上限数" prop="outupperlimit_qty">
|
<el-form-item label="设备产品仓上限数" prop="outupperlimit_qty">
|
||||||
<el-input v-model="form.outupperlimit_qty" style="width: 370px;" />
|
<el-input v-model="form.outupperlimit_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备产品仓下限数" prop="outlowerlimit_qty">
|
<el-form-item label="设备产品仓下限数" prop="outlowerlimit_qty">
|
||||||
<el-input v-model="form.outlowerlimit_qty" style="width: 370px;" />
|
<el-input v-model="form.outlowerlimit_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备初始来料仓数" prop="deviceinitinstor_qty">
|
<el-form-item label="设备初始来料仓数" prop="deviceinitinstor_qty">
|
||||||
<el-input v-model="form.deviceinitinstor_qty" style="width: 370px;" />
|
<el-input v-model="form.deviceinitinstor_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备实时来料仓数" prop="deviceinstor_qty">
|
<el-form-item label="设备实时来料仓数" prop="deviceinstor_qty">
|
||||||
<el-input v-model="form.deviceinstor_qty" style="width: 370px;" />
|
<el-input v-model="form.deviceinstor_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备实时产品仓数" prop="deviceoutstor_qty">
|
<el-form-item label="设备实时产品仓数" prop="deviceoutstor_qty">
|
||||||
<el-input v-model="form.deviceoutstor_qty" style="width: 370px;" />
|
<el-input v-model="form.deviceoutstor_qty" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否人工" prop="is_artificial">
|
<el-form-item label="是否人工" prop="is_artificial">
|
||||||
<el-input v-model="form.is_artificial" style="width: 370px;" />
|
<el-radio
|
||||||
</el-form-item>
|
v-for="item in dict.IS_OR_NOT"
|
||||||
<el-form-item label="备注">
|
:key="item.id"
|
||||||
<el-input v-model="form.remark" style="width: 370px;" />
|
v-model="form.is_artificial"
|
||||||
|
:label="item.value"
|
||||||
|
>{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -150,16 +166,37 @@ import DeviceItemDialog from '@/views/wms/pdm/device/DeviceItemDialog'
|
|||||||
import DeviceInfoDialog from '@/views/wms/pdm/device/DeviceInfoDialog'
|
import DeviceInfoDialog from '@/views/wms/pdm/device/DeviceInfoDialog'
|
||||||
import CopyDialog from '@/views/wms/pdm/device/CopyDialog'
|
import CopyDialog from '@/views/wms/pdm/device/CopyDialog'
|
||||||
|
|
||||||
const defaultForm = {device_code: null, device_name: null, product_area: null, workprocedure_id: null, ext_code: null,
|
const defaultForm = {
|
||||||
material_id: null, workorder_code: null, device_code2: null, inupperlimit_qty: null, inlowerlimit_qty: null,
|
device_code: null,
|
||||||
outupperlimit_qty: null, outlowerlimit_qty: null, deviceinitinstor_qty: null, deviceinstor_qty: null,
|
device_name: null,
|
||||||
deviceoutstor_qty: null, is_artificial: null, remark: null, create_id: null, create_name: null, create_time: null,
|
product_area: null,
|
||||||
update_id: null, update_name: null, update_time: null, is_delete: null }
|
workprocedure_id: null,
|
||||||
|
ext_code: null,
|
||||||
|
material_id: null,
|
||||||
|
workorder_code: null,
|
||||||
|
device_code2: null,
|
||||||
|
inupperlimit_qty: null,
|
||||||
|
inlowerlimit_qty: null,
|
||||||
|
outupperlimit_qty: null,
|
||||||
|
outlowerlimit_qty: null,
|
||||||
|
deviceinitinstor_qty: null,
|
||||||
|
deviceinstor_qty: null,
|
||||||
|
deviceoutstor_qty: null,
|
||||||
|
is_artificial: null,
|
||||||
|
remark: null,
|
||||||
|
create_id: null,
|
||||||
|
create_name: null,
|
||||||
|
create_time: null,
|
||||||
|
update_id: null,
|
||||||
|
update_name: null,
|
||||||
|
update_time: null,
|
||||||
|
is_delete: null
|
||||||
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'Device',
|
name: 'Device',
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation, DeviceItemDialog, CopyDialog, DeviceInfoDialog },
|
components: { pagination, crudOperation, rrOperation, udOperation, DeviceItemDialog, CopyDialog, DeviceInfoDialog },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
dicts: ['is_used'],
|
dicts: ['is_used', 'IS_OR_NOT'],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '生产设备', url: 'api/device', idField: 'device_code', sort: 'device_code,desc',
|
return CRUD({ title: '生产设备', url: 'api/device', idField: 'device_code', sort: 'device_code,desc',
|
||||||
optShow: {
|
optShow: {
|
||||||
|
|||||||
Reference in New Issue
Block a user