Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
@@ -22,6 +22,8 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -39,6 +41,12 @@ public class EquipmentfileController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
@Log("导出月计划模板")
|
||||
@ApiOperation("导出月计划模板")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
equipmentfileService.download(equipmentfileService.query(whereJson), response);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增工令")
|
||||
|
||||
@@ -3,8 +3,12 @@ package org.nl.wms.basedata.em.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pcs.service.dto.ProductplanprocDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -18,6 +22,21 @@ public interface EquipmentfileService {
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
JSONArray query(Map whereJson);
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param ja 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(JSONArray ja, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param json /
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.basedata.em.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -16,11 +17,13 @@ import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||
import org.nl.modules.system.service.DeptService;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.basedata.em.service.EquipmentfileService;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.pcs.service.dto.ProductplanprocDto;
|
||||
import org.nl.wms.pdm.service.WorkOrdereService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
@@ -29,6 +32,8 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@@ -71,6 +76,41 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||
JSONObject json = WQL.getWO("QEM_EQUIPMENTFILE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "equipmentfile.devicerecord_code");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray query(Map whereJson) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
||||
map.put("flag", "11");
|
||||
String device_code = map.get("device_code");
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
map.put("device_code", "%" + device_code + "%");
|
||||
}
|
||||
String manufacturer = map.get("manufacturer");
|
||||
if (StrUtil.isNotEmpty(manufacturer)) {
|
||||
map.put("manufacturer", "%" + manufacturer + "%");
|
||||
}
|
||||
String material_type_id = map.get("material_type_id");
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
String classIds = classstandardService.getChildIdStr(material_type_id);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
String use_deptid = map.get("use_deptid");
|
||||
if (!StrUtil.isEmpty(use_deptid)) {
|
||||
String deptIds = deptService.getChildIdStr(Long.parseLong(use_deptid));
|
||||
map.put("deptIds", deptIds);
|
||||
}
|
||||
String begin_time = map.get("begin_time");
|
||||
if (StrUtil.isNotEmpty(begin_time)) {
|
||||
map.put("begin_time", begin_time.substring(0,10));
|
||||
}
|
||||
String end_time = map.get("end_time");
|
||||
if (StrUtil.isNotEmpty(end_time)) {
|
||||
map.put("end_time", end_time.substring(0,10));
|
||||
}
|
||||
JSONArray json = WQL.getWO("QEM_EQUIPMENTFILE01").addParamMap(map).process().getResultJSONArray(0);
|
||||
return json;
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(JSONObject json) {
|
||||
@@ -283,4 +323,73 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||
JSONArray ja = EM_BI_DeviceBOM.query("is_delete='0' and is_used='1' and material_type_id='"+material_type_id+"'").getResultJSONArray(0);
|
||||
return ja;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void download(JSONArray ja, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
WQLObject pdm_bi_workprocedure = WQLObject.getWQLObject("pdm_bi_workprocedure");
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
Map<String, Object> dtl_map = new LinkedHashMap<>();
|
||||
dtl_map.put("设备代码", jo.getString("device_code"));
|
||||
dtl_map.put("设备名称", jo.getString("device_name"));
|
||||
dtl_map.put("内部自编号", jo.getString("extend_code"));
|
||||
dtl_map.put("设备型号", jo.getString("device_model"));
|
||||
dtl_map.put("设备规格", jo.getString("material_type_name"));
|
||||
if(jo.getString("is_produceuse").equals("1")){
|
||||
dtl_map.put("生产用途", "生产");
|
||||
}else{
|
||||
dtl_map.put("生产用途", "非生产");
|
||||
}
|
||||
String status = jo.getString("status");
|
||||
if(status.equals("00")){
|
||||
dtl_map.put("设备状态", "生成");
|
||||
}else if(status.equals("10")){
|
||||
dtl_map.put("设备状态", "正常");
|
||||
}else if(status.equals("11")){
|
||||
dtl_map.put("设备状态", "闲置");
|
||||
}else if(status.equals("20")){
|
||||
dtl_map.put("设备状态", "故障");
|
||||
}else if(status.equals("30")){
|
||||
dtl_map.put("设备状态", "维修");
|
||||
}else if(status.equals("40")){
|
||||
dtl_map.put("设备状态", "保养");
|
||||
}else if(status.equals("90")){
|
||||
dtl_map.put("设备状态", "报废");
|
||||
}else if(status.equals("91")){
|
||||
dtl_map.put("设备状态", "报废处理");
|
||||
}
|
||||
dtl_map.put("启用日期", jo.getString("beginuse_date"));
|
||||
dtl_map.put("使用部门", jo.getString("use_deptname"));
|
||||
dtl_map.put("使用班组", jo.getString("use_groupname"));
|
||||
dtl_map.put("供应商", jo.getString("supplier_name"));
|
||||
dtl_map.put("制造商", jo.getString("manufacturer"));
|
||||
dtl_map.put("制造国别", jo.getString("country_manufactur"));
|
||||
dtl_map.put("出厂日期", jo.getString("leavefactory_date"));
|
||||
dtl_map.put("出厂编号", jo.getString("leavefactory_number"));
|
||||
dtl_map.put("图号", jo.getString("drawing_number"));
|
||||
|
||||
String device_type = jo.getString("device_type");
|
||||
if(device_type.equals("01")){
|
||||
dtl_map.put("设备属性", "资产");
|
||||
}else if(device_type.equals("02")){
|
||||
dtl_map.put("设备属性", "普通设备");
|
||||
}else if(device_type.equals("03")){
|
||||
dtl_map.put("设备属性", "其他");
|
||||
}
|
||||
dtl_map.put("工序", jo.getString("workprocedure_name"));
|
||||
dtl_map.put("资产编码", jo.getString("assets_code"));
|
||||
dtl_map.put("资产名称", jo.getString("assets_name"));
|
||||
dtl_map.put("生成人", jo.getString("create_name"));
|
||||
dtl_map.put("生成时间", jo.getString("create_time"));
|
||||
|
||||
dtl_map.put("修改人", jo.getString("update_optname"));
|
||||
dtl_map.put("修改时间", jo.getString("update_time"));
|
||||
list.add(dtl_map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,59 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "11"
|
||||
QUERY
|
||||
SELECT
|
||||
equipmentfile.*,
|
||||
workprocedure.workprocedure_name,
|
||||
classstandard.class_name AS material_type_name,
|
||||
dept1.name AS use_deptname,
|
||||
dept2.name AS belong_deptname,
|
||||
dept3.name AS use_groupname
|
||||
FROM
|
||||
em_bi_equipmentfile equipmentfile
|
||||
LEFT JOIN pdm_bi_workprocedure workprocedure ON workprocedure.workprocedure_id = equipmentfile.workprocedure_id
|
||||
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = equipmentfile.material_type_id
|
||||
LEFT JOIN sys_dept dept1 ON dept1.dept_id = equipmentfile.use_deptid
|
||||
LEFT JOIN sys_dept dept2 ON dept2.dept_id = equipmentfile.belong_deptid
|
||||
LEFT JOIN sys_dept dept3 ON dept3.dept_id = equipmentfile.use_groupid
|
||||
WHERE
|
||||
equipmentfile.is_delete = '0'
|
||||
OPTION 输入.is_produceuse <> ""
|
||||
equipmentfile.is_produceuse = 输入.is_produceuse
|
||||
ENDOPTION
|
||||
OPTION 输入.status <> ""
|
||||
equipmentfile.status = 输入.status
|
||||
ENDOPTION
|
||||
OPTION 输入.use_deptid <> ""
|
||||
equipmentfile.use_deptid in 输入.deptIds
|
||||
ENDOPTION
|
||||
OPTION 输入.workprocedure_id <> ""
|
||||
equipmentfile.workprocedure_id = 输入.workprocedure_id
|
||||
ENDOPTION
|
||||
OPTION 输入.device_type <> ""
|
||||
equipmentfile.device_type = 输入.device_type
|
||||
ENDOPTION
|
||||
OPTION 输入.material_type_id <> ""
|
||||
equipmentfile.material_type_id in 输入.classIds
|
||||
ENDOPTION
|
||||
OPTION 输入.device_code <> ""
|
||||
(equipmentfile.device_code like 输入.device_code or equipmentfile.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.manufacturer <> ""
|
||||
equipmentfile.manufacturer like 输入.manufacturer
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
equipmentfile.beginuse_date >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
equipmentfile.beginuse_date <= 输入.end_time
|
||||
ENDOPTION
|
||||
order by equipmentfile.devicerecord_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
|
||||
Binary file not shown.
@@ -1443,6 +1443,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
//纯粉重量
|
||||
double net_qty = workorder_qty;
|
||||
//1.需添加软废
|
||||
if(waste_limit_down==100 || waste_limit_up== 100){
|
||||
throw new BadRequestException("软废含量上限或下限不能等于100%!");
|
||||
}
|
||||
//R下
|
||||
double waste_limit_down_weight = workorder_qty * waste_limit_down/100.0;
|
||||
//R上
|
||||
@@ -3213,7 +3216,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}
|
||||
//BOM中碳化钨需含总碳
|
||||
double CT2 = new_qty*(sum_Cr3C2/100.0)*(c_balance/100.0);
|
||||
if(CT1==CT2){//配粉结束
|
||||
//配粉结束
|
||||
if(CT1==CT2){
|
||||
double W = net_qty;//钨Wp=桶重量 - (R1p*R1纯粉系数+ R2p*R2纯粉系数…) - (Y1p+X1p+X2p…)
|
||||
//软废总碳
|
||||
for(int i=0;i<rf_list.size();i++){
|
||||
@@ -3247,7 +3251,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
W_weight.put("quality_scode","01");
|
||||
cw_list.add(W_weight);
|
||||
}
|
||||
}else if(CT1<CT2){//需配碳粉
|
||||
}else
|
||||
//需配碳粉
|
||||
if(CT1<CT2){
|
||||
//B、若有软废,先加钨Wp=桶重量 - (R1p*R1纯粉系数+ R2p*R2纯粉系数…) - (Y1p+X1p+X2p…)
|
||||
if(rf_list.size()!=0){//只配库存明细时
|
||||
double W = net_qty;
|
||||
@@ -3256,37 +3262,60 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
JSONObject ivt_new = rf_list.getJSONObject(i);
|
||||
//R1p*R1纯粉系数
|
||||
double net_rate_qty = ivt_new.getDouble("formula_qty")*ivt_new.getDouble("net_rate")/100.0;
|
||||
W = NumberUtil.round(W - net_rate_qty,3).doubleValue();
|
||||
W = NumberUtil.round(W - net_rate_qty,6).doubleValue();
|
||||
}
|
||||
//桶重量 - (R1p*R1纯粉系数+ R2p*R2纯粉系数…) - (Y1p+X1p+X2p…)
|
||||
for(int i=0;i<xl_list.size();i++){
|
||||
JSONObject bomdlt = xl_list.getJSONObject(i);
|
||||
//Y1p+X1p+X2p
|
||||
double need_qty = bomdlt.getDouble("formula_qty");
|
||||
W = NumberUtil.round(W - need_qty,3).doubleValue();
|
||||
W = NumberUtil.round(W - need_qty,6).doubleValue();
|
||||
}
|
||||
if(W<0){
|
||||
throw new BadRequestException("补钨粉重量为负数,请检查bom及其他参数!");
|
||||
//throw new BadRequestException("补钨粉重量为负数,请检查bom及其他参数!");
|
||||
W = 0;
|
||||
}
|
||||
//补碳Cp=CT2-CT1,比较Cp、Wp:若Cp<=Wp,更新Wp=Wp-Cp,结束
|
||||
double Cp = NumberUtil.round(CT2-CT1,3).doubleValue();
|
||||
double Cp = NumberUtil.round(CT2-CT1,6).doubleValue();
|
||||
//若Cp<=Wp,更新Wp=Wp-Cp,结束
|
||||
if(Cp<=W){
|
||||
JSONObject W_weight = new JSONObject();
|
||||
W_weight.put("formula_qty",NumberUtil.round(W-Cp,3).doubleValue());
|
||||
//钨分类id
|
||||
W_weight.put("material_id","1503644362234531840");
|
||||
W_weight.put("material_name","钨粉");
|
||||
W_weight.put("material_code","09030103");
|
||||
W_weight.put("material_type","02");
|
||||
W_weight.put("is_need_move","0");
|
||||
W_weight.put("is_need_manage","1");
|
||||
W_weight.put("is_rf_xl","0");
|
||||
W_weight.put("ivt_level","01");
|
||||
W_weight.put("is_active","1");
|
||||
W_weight.put("quality_scode","01");
|
||||
cw_list.add(W_weight);
|
||||
}else{//若Cp>Wp
|
||||
double Wp = NumberUtil.round(W-Cp,6).doubleValue();
|
||||
if(Wp>0){
|
||||
JSONObject W_weight = new JSONObject();
|
||||
W_weight.put("formula_qty",NumberUtil.round(Wp,6).doubleValue());
|
||||
//钨分类id
|
||||
W_weight.put("material_id","1503644362234531840");
|
||||
W_weight.put("material_name","钨粉");
|
||||
W_weight.put("material_code","09030103");
|
||||
W_weight.put("material_type","02");
|
||||
W_weight.put("is_need_move","0");
|
||||
W_weight.put("is_need_manage","1");
|
||||
W_weight.put("is_rf_xl","0");
|
||||
W_weight.put("ivt_level","01");
|
||||
W_weight.put("is_active","1");
|
||||
W_weight.put("quality_scode","01");
|
||||
cw_list.add(W_weight);
|
||||
}
|
||||
|
||||
if(Cp>0){
|
||||
JSONObject C_weight = new JSONObject();
|
||||
C_weight.put("formula_qty",Cp);
|
||||
//钨分类id
|
||||
C_weight.put("material_id","1503644362788179968");
|
||||
C_weight.put("material_name","碳粉");
|
||||
C_weight.put("material_code","09030104");
|
||||
C_weight.put("material_type","02");
|
||||
C_weight.put("is_need_move","0");
|
||||
C_weight.put("is_need_manage","1");
|
||||
C_weight.put("is_tan","100");
|
||||
C_weight.put("is_rf_xl","1");
|
||||
C_weight.put("ivt_level","01");
|
||||
C_weight.put("is_active","1");
|
||||
C_weight.put("quality_scode","01");
|
||||
cw_list.add(C_weight);
|
||||
}
|
||||
}else{
|
||||
//若Cp>Wp
|
||||
//解方程组
|
||||
//获取最后一个配粉软废R3p
|
||||
JSONObject R3p = rf_list.getJSONObject(rf_list.size()-1);
|
||||
@@ -3391,15 +3420,13 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}
|
||||
}
|
||||
});
|
||||
//R3p减=C缺/[1-(R3的bom碳化钨含量*R3碳平衡+R3的bom碳化钨含量+Y1含量+Z1含量+Z2含量)]
|
||||
double R3p_jian = C_que/(1.0-(rf3_Cr3C2*is_tan3+rf3_Cr3C2+sum_YZ.get()));
|
||||
// R3p减=C缺/[1-(R3的bom碳化钨含量*R3碳平衡+Y1含量+Z1含量+Z2含量)]
|
||||
double R3p_jian = C_que/(1.0-(rf3_Cr3C2*is_tan3+sum_YZ.get()));
|
||||
|
||||
R3p_jian = NumberUtil.round(R3p_jian,3).doubleValue();
|
||||
R3p_jian = NumberUtil.round(R3p_jian,6).doubleValue();
|
||||
|
||||
//C补=R3p减*R3的bom碳化钨含量*R3碳平衡+C缺
|
||||
double C_bu = R3p_jian*rf3_Cr3C2*is_tan3+C_que;
|
||||
//W补= R3p减*R3的bom碳化钨含量
|
||||
double W_bu = R3p_jian*rf3_Cr3C2;
|
||||
if(C_bu<=0) {
|
||||
if (rf_list.size() == 1) {
|
||||
throw new BadRequestException("无解!");
|
||||
@@ -3434,29 +3461,12 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
});
|
||||
// R3p=R3p-R3p减/ R3纯粉系数
|
||||
double r3_formula_qty = R3p.getDouble("formula_qty");
|
||||
r3_formula_qty = NumberUtil.round(r3_formula_qty - R3p_jian/(R3p.getDouble("net_rate")/100.0),3).doubleValue();
|
||||
r3_formula_qty = NumberUtil.round(r3_formula_qty - R3p_jian/(R3p.getDouble("net_rate")/100.0),6).doubleValue();
|
||||
R3p.put("formula_qty",r3_formula_qty);
|
||||
rf_map.put(R3p.getString("stockrecord_id"),R3p);
|
||||
if(r3_formula_qty<=0){
|
||||
rf_map.remove(R3p.getString("stockrecord_id"));
|
||||
}
|
||||
if(W_bu>0){
|
||||
//Wp=W补
|
||||
JSONObject W_weight = new JSONObject();
|
||||
W_weight.put("formula_qty",W_bu);
|
||||
//钨分类id
|
||||
W_weight.put("material_id","1503644362234531840");
|
||||
W_weight.put("material_name","钨粉");
|
||||
W_weight.put("material_code","09030103");
|
||||
W_weight.put("material_type","02");
|
||||
W_weight.put("is_need_move","0");
|
||||
W_weight.put("is_need_manage","1");
|
||||
W_weight.put("is_rf_xl","0");
|
||||
W_weight.put("ivt_level","01");
|
||||
W_weight.put("is_active","1");
|
||||
W_weight.put("quality_scode","01");
|
||||
cw_list.add(W_weight);
|
||||
}
|
||||
if(C_bu>0){
|
||||
//Wp=Wp+W补
|
||||
Cp = Cp + C_bu;
|
||||
@@ -3507,13 +3517,13 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}
|
||||
});
|
||||
//除数
|
||||
double sub1 = R3p_jian*rf3_Cr3C2*is_tan3+C_que+R3p_jian*rf3_Cr3C2+ sum_he_R3p.get();
|
||||
double sub1 = R3p_jian*rf3_Cr3C2*is_tan3+C_que+ sum_he_R3p.get();
|
||||
//被除数
|
||||
double sub2 = 1.0 - (sum_he.get() + rf2_Cr3C2 + rf2_Cr3C2*is_tan2);
|
||||
double sub2 = 1.0 - (sum_he.get() + rf2_Cr3C2*is_tan2);
|
||||
/**
|
||||
* R2p减 = (R3p*R3的bom碳化钨含量*R3碳平衡 + C缺 + R3p*R3的bom碳化钨含量
|
||||
* + R3p*Y1含量 + R3p*Z1含量 + R3p*Z2含量 - R3p)/(1-(Z2含量+Y1含量+Z1含量
|
||||
* +R2的bom碳化钨含量+R2的bom碳化钨含量*R2碳平衡))
|
||||
* R2p减 =
|
||||
* (R3p*R3的bom碳化钨含量*R3碳平衡 + C缺+ R3p*Y1含量 + R3p*Z1含量 + R3p*Z2含量 - R3p)/
|
||||
* (1-(Z2含量+Y1含量+Z1含量+R2的bom碳化钨含量*R2碳平衡))
|
||||
*/
|
||||
double R2p_jian = sub1/sub2;
|
||||
//计算非碳化钨需补重量
|
||||
@@ -3553,7 +3563,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
});
|
||||
// R3p=R3p-R3p减/ R3纯粉系数
|
||||
double r3_formula_qty = R3p.getDouble("formula_qty");
|
||||
r3_formula_qty = NumberUtil.round(r3_formula_qty - r3_formula_qty/(R3p.getDouble("net_rate")/100.0),3).doubleValue();
|
||||
r3_formula_qty = NumberUtil.round(r3_formula_qty - r3_formula_qty/(R3p.getDouble("net_rate")/100.0),6).doubleValue();
|
||||
R3p.put("formula_qty",r3_formula_qty);
|
||||
rf_map.put(R3p.getString("stockrecord_id"),R3p);
|
||||
if(r3_formula_qty<=0){
|
||||
@@ -3561,37 +3571,18 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}
|
||||
// R2p=R2p-R2p减/ R2纯粉系数
|
||||
double r2_formula_qty = R2p.getDouble("formula_qty");
|
||||
r2_formula_qty = NumberUtil.round(r2_formula_qty - R2p_jian/(R2p.getDouble("net_rate")/100.0),3).doubleValue();
|
||||
r2_formula_qty = NumberUtil.round(r2_formula_qty - R2p_jian/(R2p.getDouble("net_rate")/100.0),6).doubleValue();
|
||||
R2p.put("formula_qty",r2_formula_qty);
|
||||
rf_map.put(R2p.getString("stockrecord_id"),R2p);
|
||||
if(r2_formula_qty<=0){
|
||||
rf_map.remove(R2p.getString("stockrecord_id"));
|
||||
}
|
||||
//W补= R3p减*R3的bom碳化钨含量+ R2p减*R2的bom碳化钨含量
|
||||
double W_bu = R3p_jian*rf3_Cr3C2 + R2p_jian*rf2_Cr3C2;
|
||||
//C补=R3p减*R3的bom碳化钨含量*R3碳平衡+ R2p减*R2的bom碳化钨含量*R2碳平衡+C缺
|
||||
double C_bu = R3p_jian*rf3_Cr3C2*is_tan3 + R2p_jian*rf2_Cr3C2*is_tan2 + C_que;
|
||||
//W补= R3p减*R3的bom碳化钨含量
|
||||
if(C_bu<=0) {
|
||||
throw new BadRequestException("无解!");
|
||||
}else{
|
||||
if(W_bu>0){
|
||||
//Wp=W补
|
||||
JSONObject W_weight = new JSONObject();
|
||||
W_weight.put("formula_qty",W_bu);
|
||||
//钨分类id
|
||||
W_weight.put("material_id","1503644362234531840");
|
||||
W_weight.put("material_name","钨粉");
|
||||
W_weight.put("material_code","09030103");
|
||||
W_weight.put("material_type","02");
|
||||
W_weight.put("is_need_move","0");
|
||||
W_weight.put("is_need_manage","1");
|
||||
W_weight.put("is_rf_xl","0");
|
||||
W_weight.put("ivt_level","01");
|
||||
W_weight.put("is_active","1");
|
||||
W_weight.put("quality_scode","01");
|
||||
cw_list.add(W_weight);
|
||||
}
|
||||
if(C_bu>0){
|
||||
//Wp=Wp+W补
|
||||
Cp = Cp + C_bu;
|
||||
@@ -3617,7 +3608,10 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
}else{
|
||||
throw new BadRequestException("满足条件的软废为0,请按新料模式配粉!");
|
||||
}
|
||||
}else if(CT1>CT2){//需配钨粉
|
||||
|
||||
}else
|
||||
//需配钨粉
|
||||
if(CT1>CT2){
|
||||
//B、若有软废,先加钨Wp=桶重量 - (R1p*R1纯粉系数+ R2p*R2纯粉系数…) - (Y1p+X1p+X2p…)
|
||||
if(rf_list.size()!=0){
|
||||
double W = net_qty;
|
||||
@@ -3635,7 +3629,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
||||
double need_qty = bomdlt.getDouble("formula_qty");
|
||||
W = NumberUtil.round(W - need_qty,3).doubleValue();
|
||||
}
|
||||
|
||||
if(W<=0){
|
||||
W = 0;
|
||||
}
|
||||
//解方程组
|
||||
//获取最后一个配粉软废R3p
|
||||
JSONObject R3p = rf_list.getJSONObject(rf_list.size()-1);
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
OPTION 输入.set_type <> ""
|
||||
ProductMaterialSet.set_type = 输入.set_type
|
||||
ENDOPTION
|
||||
order by classstandard.class_code asc
|
||||
order by classstandard.class_code asc,ProductMaterialSet.set_material_id
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -40,6 +40,14 @@ public class DevicerepairrequestController {
|
||||
return new ResponseEntity<>(devicerepairrequestService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/query2")
|
||||
@Log("查询设备报修2")
|
||||
@ApiOperation("查询设备报修2")
|
||||
//@PreAuthorize("@el.check('devicerepairrequest:list')")
|
||||
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(devicerepairrequestService.query2(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增设备报修")
|
||||
@ApiOperation("新增设备报修")
|
||||
|
||||
@@ -26,6 +26,15 @@ public interface DevicerepairrequestService {
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> query2(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
|
||||
@@ -80,4 +80,7 @@ public class DevicerepairrequestDto implements Serializable {
|
||||
|
||||
/** 公司ID */
|
||||
private Long syscompanyid;
|
||||
|
||||
/** 班组配合人 */
|
||||
private String product_person_name;
|
||||
}
|
||||
|
||||
@@ -289,6 +289,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
// 1. 更新设备维修单主表
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
jsonReMst.put("invstatus", "03");
|
||||
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonReMst.put("real_start_date", DateUtil.now());
|
||||
reMstTab.update(jsonReMst);
|
||||
// 2.更新设备档案表
|
||||
@@ -381,7 +382,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
|
||||
// 1.更新维修主表
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
// jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonReMst.put("product_person_name", whereJson.getString("product_person_name"));
|
||||
jsonReMst.put("update_time", DateUtil.now());
|
||||
reMstTab.update(jsonReMst);
|
||||
|
||||
@@ -8,7 +8,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||
import org.nl.modules.system.service.DeptService;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.sb.repair.service.DevicerepairrequestService;
|
||||
import org.nl.wms.sb.repair.service.dto.DevicerepairrequestDto;
|
||||
@@ -74,6 +76,44 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> query2(Map whereJson, Pageable page) {
|
||||
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
||||
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String request_code = MapUtil.getStr(whereJson, "request_code");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String class_idStr = (String) whereJson.get("class_idStr");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "3");
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("status", status);
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(request_code)) map.put("request_code","%"+request_code+"%");
|
||||
//处理物料当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
map.put("material_type_id", material_type_id);
|
||||
String classIds = classstandardService.getChildIdStr(material_type_id);
|
||||
map.put("classIds", classIds);
|
||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
// 归属部门
|
||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||
if (!StrUtil.isEmpty(dept_id)) {
|
||||
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||
map.put("deptIds", deptIds);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIRREQUEST001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.create_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevicerepairrequestDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
|
||||
@@ -176,7 +216,7 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
jsonFile.put("status","20");
|
||||
fileTab.update(jsonFile);
|
||||
|
||||
// 2.更新设备保修单
|
||||
// 2.更新设备报修单
|
||||
JSONObject jsonRequest = requestTab.query("request_id = '" + whereJson.getString("request_id") + "'").uniqueResult(0);
|
||||
jsonRequest.put("is_passed", "1");
|
||||
jsonRequest.put("status", "02");
|
||||
@@ -192,6 +232,7 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
jsonReMst.put("devicerecord_id", jsonRequest.get("devicerecord_id"));
|
||||
jsonReMst.put("maintenancecycle", "02");
|
||||
jsonReMst.put("invstatus", "01");
|
||||
jsonReMst.put("product_person_name", jsonRequest.getString("product_person_name"));
|
||||
jsonReMst.put("fault_desc", jsonRequest.getString("fault_desc"));
|
||||
jsonReMst.put("fault_level", jsonRequest.getString("fault_level"));
|
||||
jsonReMst.put("plan_start_date", DateUtil.today());
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
输入.request_code TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -107,5 +108,61 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
mst.*,
|
||||
class.class_name,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
file.extend_code,
|
||||
class2.device_faultclass_name,
|
||||
d1.name AS dept_name,
|
||||
d2.name AS use_name
|
||||
FROM
|
||||
EM_BI_DeviceRepairRequest mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id
|
||||
LEFT JOIN EM_BI_DeviceFaultClass class2 ON mst.device_faultclass_id = class2.device_faultclass_id
|
||||
LEFT JOIN sys_dept d1 ON file.belong_deptid = d1.dept_id
|
||||
LEFT JOIN sys_dept d2 ON file.use_groupid = d2.dept_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.request_code <> ""
|
||||
(mst.request_code like 输入.request_code or
|
||||
mst.request_code like 输入.request_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classIds <> ""
|
||||
class.class_id in 输入.classIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.deptIds <> ""
|
||||
d1.dept_id in 输入.deptIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.status <> ""
|
||||
mst.status = 输入.status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -177,6 +177,16 @@
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="downdtl()"
|
||||
>
|
||||
导出excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -204,35 +214,35 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="设备代码" width="130" label="设备代码">
|
||||
<el-table-column prop="设备代码" width="100" label="设备代码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_name" min-width="130" label="设备名称"/>
|
||||
<el-table-column prop="extend_code" min-width="130" label="内部自编号"/>
|
||||
<el-table-column prop="device_name" min-width="150" label="设备名称"/>
|
||||
<el-table-column prop="extend_code" min-width="100" label="内部自编号"/>
|
||||
<el-table-column prop="device_model" min-width="130" label="设备型号"/>
|
||||
<el-table-column prop="device_spec" min-width="130" label="设备规格"/>
|
||||
<el-table-column prop="material_type_name" min-width="80" label="设备类别" />
|
||||
<el-table-column :formatter="is_produceuseFormat" min-width="100" prop="is_produceuse" label="生产用途" />
|
||||
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="设备状态" />
|
||||
<el-table-column prop="beginuse_date" min-width="130" label="启用日期"/>
|
||||
<el-table-column prop="material_type_name" min-width="150" label="设备类别" />
|
||||
<el-table-column :formatter="is_produceuseFormat" min-width="70" prop="is_produceuse" label="生产用途" />
|
||||
<el-table-column :formatter="stateFormat" min-width="70" prop="status" label="设备状态" />
|
||||
<el-table-column prop="beginuse_date" min-width="90" label="启用日期"/>
|
||||
<el-table-column prop="use_deptname" min-width="130" label="使用部门"/>
|
||||
<el-table-column prop="use_groupname" min-width="130" label="使用班组"/>
|
||||
<el-table-column prop="supplier_name" min-width="130" label="供应商"/>
|
||||
<el-table-column prop="manufacturer" min-width="130" label="制造商"/>
|
||||
<el-table-column prop="country_manufactur" min-width="130" label="制造国别"/>
|
||||
<el-table-column prop="leavefactory_date" min-width="130" label="出厂日期"/>
|
||||
<el-table-column prop="supplier_name" min-width="180" label="供应商"/>
|
||||
<el-table-column prop="manufacturer" min-width="180" label="制造商"/>
|
||||
<el-table-column prop="country_manufactur" min-width="90" label="制造国别"/>
|
||||
<el-table-column prop="leavefactory_date" min-width="80" label="出厂日期"/>
|
||||
<el-table-column prop="leavefactory_number" min-width="130" label="出厂编号"/>
|
||||
<el-table-column prop="drawing_number" min-width="130" label="图号"/>
|
||||
<el-table-column prop="device_type" min-width="130" label="设备属性" :formatter="device_typeFormat"/>
|
||||
<el-table-column prop="workprocedure_id" min-width="130" label="工序" :formatter="seriesFormat2" />
|
||||
<el-table-column prop="assets_code" min-width="130" label="资产编码"/>
|
||||
<el-table-column prop="assets_name" min-width="130" label="资产名称"/>
|
||||
<el-table-column prop="create_name" min-width="130" label="生成人"/>
|
||||
<el-table-column prop="create_time" min-width="150" label="生成时间"/>
|
||||
<el-table-column prop="update_optname" min-width="130" label="修改人"/>
|
||||
<el-table-column prop="update_time" min-width="150" label="修改时间"/>
|
||||
<el-table-column prop="device_type" min-width="70" label="设备属性" :formatter="device_typeFormat"/>
|
||||
<el-table-column prop="workprocedure_id" min-width="70" label="工序" :formatter="seriesFormat2" />
|
||||
<el-table-column prop="assets_code" min-width="100" label="资产编码"/>
|
||||
<el-table-column prop="assets_name" min-width="150" label="资产名称"/>
|
||||
<el-table-column prop="create_name" min-width="90" label="生成人"/>
|
||||
<el-table-column prop="create_time" min-width="140" label="生成时间"/>
|
||||
<el-table-column prop="update_optname" min-width="90" label="修改人"/>
|
||||
<el-table-column prop="update_time" min-width="140" label="修改时间"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -261,6 +271,8 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { getDepts } from '@/api/system/dept'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'equipmentfile',
|
||||
@@ -459,6 +471,15 @@ export default {
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange()
|
||||
},
|
||||
downdtl() {
|
||||
crud.downloadLoading = true
|
||||
download('/api/equipmentfile/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '设备档案', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
},
|
||||
printCard() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length > 1 || _selectData.length === 0) {
|
||||
|
||||
@@ -8,12 +8,13 @@
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<el-row>
|
||||
<el-col :span="18" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="endRepair">结束维修</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitMain">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
@@ -65,7 +66,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产配合人" prop="product_person_name">
|
||||
<el-form-item label="班组配合人" prop="product_person_name">
|
||||
<el-input v-model="form.product_person_name" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -169,14 +170,19 @@ export default {
|
||||
},
|
||||
submitMain() {
|
||||
const data = this.form
|
||||
if (this.form.update_optname === '') {
|
||||
return this.crud.notify('维修人不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicerepairmst.submitRepair(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.dialogVisible = false
|
||||
})
|
||||
},
|
||||
endRepair() {
|
||||
const data = this.form
|
||||
crudDevicerepairmst.endRepair(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
111
mes/qd/src/views/wms/sb/repair/devicerepairpa/StartDialog.vue
Normal file
111
mes/qd/src/views/wms/sb/repair/devicerepairpa/StartDialog.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="开始维修"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
:before-close="handleClose"
|
||||
width="550px"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="维修人" prop="update_optname">
|
||||
<el-input v-model="form4.update_optname" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitResuft">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudDevicerepairmst from '@/api/wms/sb/devicerepairmst'
|
||||
export default {
|
||||
name: 'StartDialog',
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.form4 = this.openParam
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form4: {
|
||||
},
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submitResuft() {
|
||||
if (!this.form4.update_optname) {
|
||||
return this.crud.notify('维修人不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const data = this.form4
|
||||
crudDevicerepairmst.startRepair(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .el-dialog__title2 {
|
||||
line-height: 24px;
|
||||
font-size:20px;
|
||||
color:#303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span {
|
||||
padding: 10px 0px 10px 0px;
|
||||
}
|
||||
.crud-opts2 .crud-opts-form {
|
||||
padding: 10px 0px 0px 20px;
|
||||
}
|
||||
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -89,7 +89,7 @@
|
||||
>
|
||||
开始维修
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -99,6 +99,17 @@
|
||||
@click="executeRepair"
|
||||
>
|
||||
维修执行
|
||||
</el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="open_flag"
|
||||
@click="openReceive"
|
||||
>
|
||||
维修领用
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
@@ -111,17 +122,6 @@
|
||||
>
|
||||
结束维修
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="open_flag"
|
||||
@click="openReceive"
|
||||
>
|
||||
维修领用
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -131,7 +131,7 @@
|
||||
:disabled="confirm_flag"
|
||||
@click="confirmRepair"
|
||||
>
|
||||
维修确认
|
||||
班组验收
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
@@ -179,6 +179,7 @@
|
||||
<ExecuteDialog :dialog-show.sync="executeDialog" :open-param="openParam" />
|
||||
<resuftDialog :dialog-show.sync="resuftDialog" :open-param="openParam" />
|
||||
<ReceiveDialog :dialog-show.sync="receiveDialog" :open-param="openParam" />
|
||||
<StartDialog :dialog-show.sync="startDialog" :open-param="openParam" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -197,11 +198,12 @@ import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import ExecuteDialog from '@/views/wms/sb/repair/devicerepairpa/ExecuteDialog'
|
||||
import resuftDialog from '@/views/wms/sb/repair/devicerepairpa/resuftDialog'
|
||||
import ReceiveDialog from '@/views/wms/sb/repair/devicerepairpa/ReceiveDialog'
|
||||
import StartDialog from '@/views/wms/sb/repair/devicerepairpa/StartDialog'
|
||||
|
||||
export default {
|
||||
name: 'Devicerepairpa',
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'EM_DEVICE_WX_INVSTATUS', 'EM_FAULT_LEVEL'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, ExecuteDialog, resuftDialog, ReceiveDialog },
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, ExecuteDialog, resuftDialog, ReceiveDialog, StartDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -234,6 +236,7 @@ export default {
|
||||
executeDialog: false,
|
||||
resuftDialog: false,
|
||||
receiveDialog: false,
|
||||
startDialog: false,
|
||||
permission: {
|
||||
}
|
||||
}
|
||||
@@ -300,18 +303,19 @@ export default {
|
||||
if (data.invstatus !== '02') {
|
||||
return this.crud.notify('只能对提交状态的单据维修', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicerepairmst.startRepair(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
this.openParam = data
|
||||
this.startDialog = true
|
||||
},
|
||||
endRepair() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
if (data.invstatus === '03' || data.invstatus === '05') {
|
||||
crudDevicerepairmst.endRepair(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
crudDevicerepairmst.getDtl(data).then(res => {
|
||||
this.openParam = {
|
||||
'form': data,
|
||||
'tableData': res
|
||||
}
|
||||
this.executeDialog = true
|
||||
})
|
||||
} else {
|
||||
return this.crud.notify('只能对开始或者委外验收的单据结束维修', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
|
||||
@@ -20,6 +20,15 @@
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门">
|
||||
<treeselect
|
||||
v-model="query.dept_id"
|
||||
:load-options="loadDepts"
|
||||
:options="depts"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
@@ -95,6 +104,11 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-form-item label="班组配合人:" prop="product_person_name">
|
||||
<el-input v-model="form.product_person_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="故障等级:" prop="fault_level">
|
||||
<el-select
|
||||
@@ -141,6 +155,9 @@
|
||||
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
|
||||
<el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip />
|
||||
<el-table-column prop="dept_name" label="所属部门" show-overflow-tooltip />
|
||||
<el-table-column prop="use_name" label="使用班组" show-overflow-tooltip />
|
||||
<el-table-column prop="product_person_name" label="班组配合人" width="90px" show-overflow-tooltip />
|
||||
<el-table-column prop="device_faultclass_name" label="故障分类" />
|
||||
<el-table-column prop="fault_level" label="故障等级" :formatter="formaLevelName" />
|
||||
<el-table-column prop="status" label="状态" :formatter="formatStatusName"/>
|
||||
@@ -187,8 +204,9 @@ import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import PicDialog from '@/views/wms/sb/repair/devicerepairrequest/PicDialog'
|
||||
import DeviceDialog from '@/views/wms/sb/upkeep/devicemaintenanceplan/DeviceDialog'
|
||||
import FaultDialog from '@/views/wms/sb/repair/devicevprs/FaultDialog'
|
||||
import { getDepts } from '@/api/system/dept'
|
||||
|
||||
const defaultForm = { device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
|
||||
const defaultForm = { product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
|
||||
export default {
|
||||
name: 'Devicevprs',
|
||||
dicts: ['EM_FAULT_LEVEL'],
|
||||
@@ -197,7 +215,7 @@ export default {
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '设备报修',
|
||||
url: 'api/devicerepairrequest',
|
||||
url: 'api/devicerepairrequest/query2',
|
||||
idField: 'request_id',
|
||||
sort: 'request_id,desc',
|
||||
crudMethod: { ...crudDevicerepairrequest },
|
||||
@@ -216,6 +234,7 @@ export default {
|
||||
faultDialog: false,
|
||||
classes: [],
|
||||
class_idStr: null,
|
||||
depts: [],
|
||||
materOpt_code: '23',
|
||||
statusList: [
|
||||
{ 'label': '生成', 'value': '01' },
|
||||
@@ -234,6 +253,9 @@ export default {
|
||||
],
|
||||
fault_level: [
|
||||
{ required: true, message: '故障等级不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_person_name: [
|
||||
{ required: true, message: '班组配合人不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -248,6 +270,7 @@ export default {
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
this.getDepts()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
@@ -350,6 +373,32 @@ export default {
|
||||
tableChanged(row) {
|
||||
this.form.device_faultclass_id = row.device_faultclass_id
|
||||
this.form.device_faultclass_name = row.device_faultclass_name
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 200)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDepts() {
|
||||
getDepts({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createExcel"
|
||||
>
|
||||
生成设备保养
|
||||
生成保养单
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
|
||||
Reference in New Issue
Block a user