Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
Binary file not shown.
@@ -63,6 +63,10 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if (StrUtil.isNotEmpty(end_time)) {
|
||||
map.put("end_time", end_time.substring(0,10)+" 23:59:59");
|
||||
}
|
||||
String device_code = map.get("device_code");
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
map.put("device_code", "%" + device_code + "%");
|
||||
}
|
||||
JSONObject json = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "WorkOrder.planstart_time,mb.material_code,WorkOrder.pcsn");
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
输入.workprocedure_id TYPEAS s_string
|
||||
输入.device_id TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -71,6 +72,10 @@
|
||||
WorkOrder.is_delete = '0'
|
||||
OPTION 输入.workorder_code <> ""
|
||||
WorkOrder.workorder_code like 输入.workorder_code
|
||||
ENDOPTION
|
||||
OPTION 输入.device_code <> ""
|
||||
(device.device_code like 输入.device_code or
|
||||
device.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
WorkOrder.pcsn like 输入.pcsn
|
||||
|
||||
@@ -241,7 +241,7 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
Formula.put("masterbucket_qty",masterbucket_qty+"");
|
||||
Formula.put("ball_time",whereJson.getString("ball_time"));
|
||||
Formula.put("extadd_qty",extadd_qty+"");
|
||||
Formula.put("is_audit", "1");
|
||||
//Formula.put("is_audit", "1");
|
||||
Formula.put("audit_id",currentUserId);
|
||||
Formula.put("audit_name",nickName);
|
||||
Formula.put("audit_time",now);
|
||||
|
||||
@@ -19,6 +19,8 @@ import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-22
|
||||
@@ -190,4 +192,13 @@ public class DevicerepairmstController {
|
||||
devicerepairmstService.submitReceive(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/createExcel")
|
||||
@Log("下载Excel")
|
||||
@ApiOperation("下载Excel")
|
||||
public ResponseEntity<Object> createExcel(@RequestParam Map whereJson, HttpServletResponse response) {
|
||||
devicerepairmstService.createExcel(whereJson,response);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -182,4 +182,5 @@ public interface DevicerepairmstService {
|
||||
|
||||
Map<String, Object> queryBom(Map whereJson, Pageable page);
|
||||
|
||||
void createExcel(Map whereJson, HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,17 @@ package org.nl.wms.sb.repair.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
||||
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.impl.ParamServiceImpl;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.basedata.st.service.StorattrService;
|
||||
import org.nl.wms.basedata.st.service.dto.StorattrDto;
|
||||
@@ -17,6 +23,7 @@ import org.nl.wms.sb.core.service.impl.SparePartInServiceImpl;
|
||||
import org.nl.wms.sb.core.service.impl.SparePartOutServiceImpl;
|
||||
import org.nl.wms.sb.repair.service.DevicerepairmstService;
|
||||
import org.nl.wms.sb.repair.service.dto.DevicerepairmstDto;
|
||||
import org.nl.wms.test.service.dto.DataDto;
|
||||
import org.nl.wql.WQL;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -24,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -39,6 +48,9 @@ import org.nl.wql.util.WqlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
@@ -803,4 +815,70 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createExcel(Map whereJson, HttpServletResponse response) {
|
||||
String repair_id = MapUtil.getStr(whereJson,"repair_id");
|
||||
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 维修单主表
|
||||
|
||||
try {
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + repair_id + "'").uniqueResult(0);
|
||||
|
||||
HashMap<String, String> param1 = new HashMap<>();
|
||||
param1.put("flag", "1");
|
||||
param1.put("devicerecord_id", jsonReMst.getString("devicerecord_id"));
|
||||
|
||||
JSONObject jsonFile = WQL.getWO("EM_BI_DEVICEREPAIR002").addParamMap(param1).process().uniqueResult(0);
|
||||
|
||||
String template = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("REQUEST_EXCEL_PATH").getValue();
|
||||
// 设置文件名和防止乱码现象
|
||||
String fileName = URLEncoder.encode("eee", "UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTf-8''"+fileName+".xlsx");
|
||||
// 获取输出流
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
// 创建模板工作簿
|
||||
ExcelWriter workBook = EasyExcel.write(outputStream, DataDto.class).withTemplate(template).build();
|
||||
// 获取第一个sheet
|
||||
WriteSheet sheet = EasyExcel.writerSheet().build();
|
||||
|
||||
// 1.准备数据 - 单组填充
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (ObjectUtil.isNotEmpty(jsonFile)) {
|
||||
map.put("dept_name", jsonFile.getString("dept_name")); // 部门
|
||||
map.put("device_name", jsonFile.getString("device_name")); // 设备名称
|
||||
}
|
||||
map.put("input_time", jsonReMst.getString("input_time").substring(0,10)); // 故障发生时间
|
||||
map.put("plan_start_date", jsonReMst.getString("plan_start_date")); // 计划维修时间
|
||||
map.put("real_start_date", jsonReMst.getString("real_start_date").substring(0,10)); // 实际维修时间
|
||||
// 维修内容
|
||||
map.put("update_optname", jsonReMst.getString("update_optname")); // 维修人员
|
||||
map.put("real_end_date", jsonReMst.getString("real_end_date").substring(0,10)); // 完工时间
|
||||
|
||||
// 2.准备数据 - 多组填充
|
||||
HashMap<String, String> param2 = new HashMap<>();
|
||||
param2.put("flag","2");
|
||||
param2.put("repair_id",repair_id);
|
||||
JSONArray changArr = WQL.getWO("EM_BI_DEVICEREPAIR002").addParamMap(param2).process().getResultJSONArray(0);
|
||||
|
||||
ArrayList<HashMap<String,Object>> data = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(changArr)) {
|
||||
for (int i = 0; i < changArr.size(); i++) {
|
||||
JSONObject json = changArr.getJSONObject(i);
|
||||
HashMap<String, Object> mapData = new HashMap<>();
|
||||
mapData.put("material_name",json.getString("material_name")); // 配件名称
|
||||
mapData.put("real_qty",json.getString("real_qty")); // 配件数量
|
||||
data.add(mapData);
|
||||
}
|
||||
}
|
||||
// 下载
|
||||
workBook.fill(map, sheet);
|
||||
workBook.fill(new FillWrapper("data", data), sheet);
|
||||
workBook.finish();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
throw new BadRequestException("下载异常");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
[交易说明]
|
||||
交易名: 维修单维护-Excel
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.devicerecord_id TYPEAS s_string
|
||||
输入.repair_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
file.*,
|
||||
dept.name AS dept_name
|
||||
FROM
|
||||
EM_BI_EquipmentFile file
|
||||
LEFT JOIN sys_dept dept ON file.use_groupid = dept.dept_id
|
||||
WHERE
|
||||
file.is_delete = '0'
|
||||
|
||||
OPTION 输入.devicerecord_id <> ""
|
||||
file.devicerecord_id = 输入.devicerecord_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
recourd.*,
|
||||
mater.material_name
|
||||
FROM
|
||||
EM_BI_DeviceRepairReplaceRecord recourd
|
||||
LEFT JOIN md_me_materialbase mater ON recourd.material_id = mater.material_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.repair_id <> ""
|
||||
recourd.repair_id = 输入.repair_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -19,6 +19,8 @@ import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-06-17
|
||||
@@ -129,4 +131,12 @@ public class DevicemaintenancemstController {
|
||||
devicemaintenancemstService.auditMaintain(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/createExcel")
|
||||
@Log("下载Excel")
|
||||
@ApiOperation("下载Excel")
|
||||
public ResponseEntity<Object> createExcel(@RequestParam Map whereJson, HttpServletResponse response) {
|
||||
devicemaintenancemstService.createExcel(whereJson,response);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,4 +131,10 @@ public interface DevicemaintenancemstService {
|
||||
*/
|
||||
void auditMaintain(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 下载excel
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void createExcel(Map whereJson, HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -4,20 +4,29 @@ package org.nl.wms.sb.upkeep.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
||||
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.impl.ParamServiceImpl;
|
||||
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.upkeep.service.DevicemaintenancemstService;
|
||||
import org.nl.wms.sb.upkeep.service.dto.DevicemaintenancemstDto;
|
||||
import org.nl.wms.test.service.dto.DataDto;
|
||||
import org.nl.wql.WQL;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -33,6 +42,9 @@ import org.nl.wql.util.WqlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
@@ -57,12 +69,12 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("maintenancecycle",maintenancecycle);
|
||||
map.put("invstatus",invstatus);
|
||||
map.put("maintenancecycle", maintenancecycle);
|
||||
map.put("invstatus", invstatus);
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(maint_code)) map.put("maint_code","%"+maint_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code", "%" + device_code + "%");
|
||||
if (ObjectUtil.isNotEmpty(maint_code)) map.put("maint_code", "%" + maint_code + "%");
|
||||
//处理物料当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
map.put("material_type_id", material_type_id);
|
||||
@@ -89,12 +101,12 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "3");
|
||||
map.put("maintenancecycle",maintenancecycle);
|
||||
map.put("invstatus",invstatus);
|
||||
map.put("maintenancecycle", maintenancecycle);
|
||||
map.put("invstatus", invstatus);
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(maint_code)) map.put("maint_code","%"+maint_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code", "%" + device_code + "%");
|
||||
if (ObjectUtil.isNotEmpty(maint_code)) map.put("maint_code", "%" + maint_code + "%");
|
||||
//处理物料当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
map.put("material_type_id", material_type_id);
|
||||
@@ -151,25 +163,25 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
|
||||
// 插入主表
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
jsonMst.put("maint_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMst.put("maint_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonMst.put("maint_code", CodeUtil.getNewCode("MAINT_CODE"));
|
||||
jsonMst.put("devicerecord_id", whereJson.get("devicerecord_id"));
|
||||
jsonMst.put("maintenancecycle", whereJson.getString("maintenancecycle"));
|
||||
jsonMst.put("invstatus", "01");
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("detail_count",tableData.size());
|
||||
jsonMst.put("input_optid",currentUserId);
|
||||
jsonMst.put("input_optname",nickName);
|
||||
jsonMst.put("input_time",now);
|
||||
jsonMst.put("sysdeptid",deptId);
|
||||
jsonMst.put("syscompanyid",deptId);
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
jsonMst.put("input_optid", currentUserId);
|
||||
jsonMst.put("input_optname", nickName);
|
||||
jsonMst.put("input_time", now);
|
||||
jsonMst.put("sysdeptid", deptId);
|
||||
jsonMst.put("syscompanyid", deptId);
|
||||
mstTab.insert(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
JSONObject json = tableData.getJSONObject(i);
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("maint_dtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonDtl.put("maint_dtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonDtl.put("maint_id", jsonMst.get("maint_id"));
|
||||
jsonDtl.put("device_item_id", json.get("maint_item_id"));
|
||||
jsonDtl.put("dtl_remark", json.getString("dtl_remark"));
|
||||
@@ -191,15 +203,15 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
jsonMst.put("devicerecord_id", whereJson.get("devicerecord_id"));
|
||||
jsonMst.put("maintenancecycle", whereJson.getString("maintenancecycle"));
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("detail_count",tableData.size());
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
dtlTab.delete("maint_id = '"+whereJson.getString("maint_id")+"'");
|
||||
dtlTab.delete("maint_id = '" + whereJson.getString("maint_id") + "'");
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
JSONObject json = tableData.getJSONObject(i);
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("maint_dtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonDtl.put("maint_dtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonDtl.put("maint_id", jsonMst.get("maint_id"));
|
||||
jsonDtl.put("device_item_id", json.get("maint_item_id"));
|
||||
jsonDtl.put("dtl_remark", json.getString("dtl_remark"));
|
||||
@@ -269,19 +281,19 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
|
||||
// 插入设备声明周期表
|
||||
JSONObject jsonLife = new JSONObject();
|
||||
jsonLife.put("devicechangedtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonLife.put("devicerecord_id",jsonMainMst.get("devicerecord_id"));
|
||||
jsonLife.put("changetype","20");
|
||||
jsonLife.put("change_id",currentUserId);
|
||||
jsonLife.put("change_name",nickName);
|
||||
jsonLife.put("change_time",DateUtil.now());
|
||||
jsonLife.put("change_reason","保养开始");
|
||||
jsonLife.put("invtype","保养单");
|
||||
jsonLife.put("invsid",jsonMainMst.get("maint_id"));
|
||||
jsonLife.put("invcode",jsonMainMst.getString("maint_code"));
|
||||
jsonLife.put("create_id",currentUserId);
|
||||
jsonLife.put("create_name",nickName);
|
||||
jsonLife.put("create_time",DateUtil.now());
|
||||
jsonLife.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonLife.put("devicerecord_id", jsonMainMst.get("devicerecord_id"));
|
||||
jsonLife.put("changetype", "20");
|
||||
jsonLife.put("change_id", currentUserId);
|
||||
jsonLife.put("change_name", nickName);
|
||||
jsonLife.put("change_time", DateUtil.now());
|
||||
jsonLife.put("change_reason", "保养开始");
|
||||
jsonLife.put("invtype", "保养单");
|
||||
jsonLife.put("invsid", jsonMainMst.get("maint_id"));
|
||||
jsonLife.put("invcode", jsonMainMst.getString("maint_code"));
|
||||
jsonLife.put("create_id", currentUserId);
|
||||
jsonLife.put("create_name", nickName);
|
||||
jsonLife.put("create_time", DateUtil.now());
|
||||
lifeTab.insert(jsonLife);
|
||||
|
||||
// 根据来源标识 : 为空不处理、否则更新设备保养计划表
|
||||
@@ -328,18 +340,18 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
|
||||
// 插入设备声明周期表
|
||||
JSONObject jsonLife = new JSONObject();
|
||||
jsonLife.put("devicechangedtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonLife.put("devicerecord_id",jsonMainMst.get("devicerecord_id"));
|
||||
jsonLife.put("changetype","21");
|
||||
jsonLife.put("change_id",currentUserId);
|
||||
jsonLife.put("change_name",nickName);
|
||||
jsonLife.put("change_time",DateUtil.now());
|
||||
jsonLife.put("change_reason","保养结束");
|
||||
jsonLife.put("invsid",jsonMainMst.get("maint_id"));
|
||||
jsonLife.put("invcode",jsonMainMst.getString("maint_code"));
|
||||
jsonLife.put("create_id",currentUserId);
|
||||
jsonLife.put("create_name",nickName);
|
||||
jsonLife.put("create_time",DateUtil.now());
|
||||
jsonLife.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonLife.put("devicerecord_id", jsonMainMst.get("devicerecord_id"));
|
||||
jsonLife.put("changetype", "21");
|
||||
jsonLife.put("change_id", currentUserId);
|
||||
jsonLife.put("change_name", nickName);
|
||||
jsonLife.put("change_time", DateUtil.now());
|
||||
jsonLife.put("change_reason", "保养结束");
|
||||
jsonLife.put("invsid", jsonMainMst.get("maint_id"));
|
||||
jsonLife.put("invcode", jsonMainMst.getString("maint_code"));
|
||||
jsonLife.put("create_id", currentUserId);
|
||||
jsonLife.put("create_name", nickName);
|
||||
jsonLife.put("create_time", DateUtil.now());
|
||||
lifeTab.insert(jsonLife);
|
||||
}
|
||||
|
||||
@@ -356,15 +368,15 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
|
||||
// 更新主表
|
||||
JSONObject jsonMst = mstTab.query("maint_id ='" + maint_id + "'").uniqueResult(0);
|
||||
jsonMst.put("update_optname",whereJson.getString("update_optname"));
|
||||
jsonMst.put("update_time",DateUtil.now());
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonMst.put("update_time", DateUtil.now());
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 更新明细表
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
JSONObject json = tableData.getJSONObject(i);
|
||||
JSONObject jsonDtl = dtlTab.query("maint_dtl_id = '" + json.getString("maint_dtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("isfinish",json.getString("isfinish"));
|
||||
jsonDtl.put("isfinish", json.getString("isfinish"));
|
||||
dtlTab.update(jsonDtl);
|
||||
}
|
||||
}
|
||||
@@ -391,7 +403,8 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
// 2.保养人,保养时间不能为空
|
||||
String update_optname = jsonMst.getString("update_optname");
|
||||
String update_time = jsonMst.getString("update_time");
|
||||
if (ObjectUtil.isEmpty(update_optname) || ObjectUtil.isEmpty(update_time)) throw new BadRequestException("保养人或保养时间不能为空");
|
||||
if (ObjectUtil.isEmpty(update_optname) || ObjectUtil.isEmpty(update_time))
|
||||
throw new BadRequestException("保养人或保养时间不能为空");
|
||||
|
||||
// 3.更新主表
|
||||
jsonMst.put("invstatus", "05");
|
||||
@@ -414,9 +427,9 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
// 1.更新主表
|
||||
JSONObject jsonMst = mstTab.query("maint_id = '" + maint_id + "'").uniqueResult(0);
|
||||
jsonMst.put("invstatus", "99");
|
||||
jsonMst.put("audit_optid",currentUserId);
|
||||
jsonMst.put("audit_optname",nickName);
|
||||
jsonMst.put("audit_time",DateUtil.now());
|
||||
jsonMst.put("audit_optid", currentUserId);
|
||||
jsonMst.put("audit_optname", nickName);
|
||||
jsonMst.put("audit_time", DateUtil.now());
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 2.根据来源标识 : 为空不处理、否则更新设备保养计划表
|
||||
@@ -434,4 +447,76 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createExcel(Map whereJson, HttpServletResponse response) {
|
||||
|
||||
String maint_id = MapUtil.getStr(whereJson, "maint_id");
|
||||
WQLObject mainMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 设备保养主表
|
||||
try {
|
||||
|
||||
JSONObject jsonMainMst = mainMstTab.query("maint_id ='" + maint_id + "'").uniqueResult(0);
|
||||
|
||||
HashMap<String, String> paramMap1 = new HashMap<>();
|
||||
paramMap1.put("flag", "1");
|
||||
paramMap1.put("devicerecord_id", jsonMainMst.getString("devicerecord_id"));
|
||||
|
||||
JSONObject jsonFile = WQL.getWO("EM_BIDEVICEMAINTENANCEPLAN002").addParamMap(paramMap1).process().uniqueResult(0);
|
||||
|
||||
String template = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MAIN_EXCEL_PATH").getValue();
|
||||
// 设置文件名和防止乱码现象
|
||||
String fileName = URLEncoder.encode("eee", "UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTf-8''" + fileName + ".xlsx");
|
||||
// 获取输出流
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
// 创建模板工作簿
|
||||
ExcelWriter workBook = EasyExcel.write(outputStream, DataDto.class).withTemplate(template).build();
|
||||
// 获取第一个sheet
|
||||
WriteSheet sheet = EasyExcel.writerSheet().build();
|
||||
|
||||
// 1.准备数据 - 单组填充
|
||||
HashMap<String, String> sheetMap = new HashMap<>();
|
||||
sheetMap.put("input_time", jsonMainMst.getString("input_time").substring(0, 10)); // 时间
|
||||
sheetMap.put("plan_start_date", jsonMainMst.getString("plan_start_date")); // 计划日期
|
||||
if (ObjectUtil.isNotEmpty(jsonFile)) {
|
||||
sheetMap.put("device_name", jsonFile.getString("device_name")); // 设备名称
|
||||
sheetMap.put("leavefactory_number", jsonFile.getString("leavefactory_number")); // 出厂编号
|
||||
sheetMap.put("device_model", jsonFile.getString("device_model")); // 型号
|
||||
sheetMap.put("dept_name", jsonFile.getString("dept_name")); // 班组
|
||||
}
|
||||
|
||||
// 2.准备数据 - 多组填充
|
||||
HashMap<String, String> paramMap2 = new HashMap<>();
|
||||
paramMap2.put("flag", "2");
|
||||
paramMap2.put("maint_id", maint_id);
|
||||
|
||||
JSONArray jsonMainDtlArr = WQL.getWO("EM_BIDEVICEMAINTENANCEPLAN002").addParamMap(paramMap2).process().getResultJSONArray(0);
|
||||
ArrayList<HashMap<String, Object>> data1 = new ArrayList<>();
|
||||
ArrayList<HashMap<String, Object>> data2 = new ArrayList<>();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonMainDtlArr)) {
|
||||
for (int i = 0; i < jsonMainDtlArr.size(); i++) {
|
||||
JSONObject json = jsonMainDtlArr.getJSONObject(i);
|
||||
HashMap<String, Object> dataMap1 = new HashMap<>();
|
||||
HashMap<String, Object> dataMap2 = new HashMap<>();
|
||||
dataMap1.put("requirement", String.valueOf(i+1) + "." + json.getString("requirement"));
|
||||
dataMap2.put("acceptancecriteria", String.valueOf(i+1) + "." + json.getString("acceptancecriteria"));
|
||||
data1.add(dataMap1);
|
||||
data2.add(dataMap2);
|
||||
}
|
||||
}
|
||||
|
||||
// 下载
|
||||
workBook.fill(sheetMap, sheet);
|
||||
workBook.fill(new FillWrapper("data1", data1), sheet);
|
||||
workBook.fill(new FillWrapper("data2", data2), sheet);
|
||||
workBook.finish();
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
throw new BadRequestException("下载异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
[交易说明]
|
||||
交易名: 设备保养EXCEL
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.devicerecord_id TYPEAS s_string
|
||||
输入.maint_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
file.*,
|
||||
dept.name AS dept_name
|
||||
FROM
|
||||
EM_BI_EquipmentFile file
|
||||
LEFT JOIN sys_dept dept ON file.use_groupid = dept.dept_id
|
||||
WHERE
|
||||
file.is_delete = '0'
|
||||
|
||||
OPTION 输入.devicerecord_id <> ""
|
||||
file.devicerecord_id = 输入.devicerecord_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dtl.*,
|
||||
item.requirement,
|
||||
item.acceptancecriteria
|
||||
FROM
|
||||
EM_BI_DeviceMaintenanceDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceMaintenanceItems item ON dtl.device_item_id = item.maint_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.maint_id <> ""
|
||||
dtl.maint_id = 输入.maint_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
BIN
mes/qd/src/assets/images/bigScreen.png
Normal file
BIN
mes/qd/src/assets/images/bigScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 MiB |
BIN
mes/qd/src/assets/images/bigScreenTwo.png
Normal file
BIN
mes/qd/src/assets/images/bigScreenTwo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 459 KiB |
@@ -103,6 +103,15 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键设备">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -100,6 +100,17 @@
|
||||
>
|
||||
维修结果
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createExcel"
|
||||
>
|
||||
生成派工单
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
@@ -152,6 +163,8 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import resuftDialog from '@/views/wms/sb/repair/devicerepairudit/resuftDialog'
|
||||
import ReceiveDialog from '@/views/wms/sb/repair/devicerepairudit/ReceiveDialog'
|
||||
import {download} from "@/api/data";
|
||||
import {downloadFile} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: 'Devicerepairudit',
|
||||
@@ -270,6 +283,15 @@ export default {
|
||||
}
|
||||
this.receiveDialog = true
|
||||
})
|
||||
},
|
||||
createExcel() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
download('api/devicerepairmst/createExcel', { 'repair_id': data.repair_id }).then(result => {
|
||||
const name = data.repair_code + '派工单'
|
||||
this.crud.toQuery()
|
||||
downloadFile(result, name, 'xlsx')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="font-size: 22px; color: #f4f4f5; padding: 6px 50px 6px 700px;background-color: #2c3e50">当日任务列表</div>
|
||||
<div class="my_table">
|
||||
<el-table border style="width: 100%;" :data="tableData" max-height="800" :cell-style="cellStyle" :highlight-current-row="true" >
|
||||
<div class="login" :style="'background-image:url('+ Background +');'">
|
||||
<div style="font-size: 22px; color: #f4f4f5; padding: 6px 50px 6px 700px;background-color: transparent">当日任务列表</div>
|
||||
<div class="t_btn2">
|
||||
<el-table border style="width: 100%;" :data="tableData" max-height="800" :header-cell-style="cellStyle" :row-style="cellStyle" :cell-style="cellStyle" :highlight-current-row="true" >
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="input_time" label="生成时间" />
|
||||
<el-table-column prop="repair_code" label="任务号" />
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
<script>
|
||||
import crud from '@/mixins/crud'
|
||||
import Background from '@/assets/images/bigScreen.png'
|
||||
import BackgroundTwo from '@/assets/images/bigScreenTwo.png'
|
||||
|
||||
export default {
|
||||
name: 'BigscreenTask',
|
||||
@@ -30,6 +32,8 @@ export default {
|
||||
// path: 'ws://192.168.81.252:8086//webSocket/20',
|
||||
// path: window.g.dev.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/20',
|
||||
path: window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/20',
|
||||
Background: Background,
|
||||
BackgroundTwo: BackgroundTwo,
|
||||
currentDate: new Date(),
|
||||
getTime: '',
|
||||
getDate: '',
|
||||
@@ -68,7 +72,9 @@ export default {
|
||||
getMessage: function(msg) {
|
||||
debugger
|
||||
const data = JSON.parse(msg.data)
|
||||
if (data.msg.length !== 0) {
|
||||
this.tableData = data.msg
|
||||
}
|
||||
},
|
||||
send: function() {
|
||||
// eslint-disable-next-line no-undef
|
||||
@@ -78,54 +84,56 @@ export default {
|
||||
console.log('socket已经关闭')
|
||||
},
|
||||
cellStyle(row, column, rowIndex, columnIndex) {
|
||||
return 'font-size: 14px;'
|
||||
return 'color: #fff,backgroundColor: transparent,fontSize: fontSize(23),textAlign: center'
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$nextTick(() => {
|
||||
document.body.setAttribute('style', 'background-color: #2D2F3F')
|
||||
})
|
||||
},
|
||||
// 实例销毁之前钩子--移除body 标签的属性style
|
||||
beforeDestroy() {
|
||||
document.body.removeAttribute('style')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
/*.my_table >>> .el-table::before {
|
||||
!* 去除下边框 *!
|
||||
height: 0;
|
||||
}*/
|
||||
.login {
|
||||
height: 100%;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table__row>td {
|
||||
/*.t_btn2 >>> .el-table::before {*/
|
||||
/* !* 去除下边框 *!*/
|
||||
/* height: 0;*/
|
||||
/*}*/
|
||||
|
||||
/*.t_btn2 >>> .el-table--border {*/
|
||||
/* !* 去除上边框 *!*/
|
||||
/* border: none;*/
|
||||
/*}*/
|
||||
|
||||
.t_btn2 >>> .el-table th.is-leaf {
|
||||
/* 去除表头边框 */
|
||||
border: none;
|
||||
}
|
||||
.t_btn2 >>> .el-table__row>td {
|
||||
/* 去除表格线 */
|
||||
border: none;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table th.is-leaf {
|
||||
/* 去除上边框 */
|
||||
border: none;
|
||||
.t_btn2 >>> .el-table th {
|
||||
/* 设置表头的颜色和字体颜色 */
|
||||
background-color: #012957;
|
||||
color: #FFFFFF;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table tr {
|
||||
/* 设置每行的颜色和字体颜色 */
|
||||
background-color: #2D2F3F;
|
||||
.t_btn2 >>>.el-table,
|
||||
.el-table__expanded-cell {
|
||||
background-color: transparent;
|
||||
}
|
||||
.t_btn2 >>> .el-table tr {
|
||||
background-color: transparent !important;
|
||||
color: #FFFFFF;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table th {
|
||||
/* 设置表头的颜色和字体颜色 */
|
||||
background-color: rgb(19, 71, 98);
|
||||
color: #FFFFFF;
|
||||
font-size: 17px;
|
||||
}
|
||||
.my_span {
|
||||
padding: 10px 50px 10px 0px;
|
||||
font-size: 17px;
|
||||
.t_btn2 >>> .el-table--enable-row-transition .el-table__body td,
|
||||
.el-table .cell {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="font-size: 22px; color: #f4f4f5; padding: 6px 50px 6px 700px; background-color: #3184d7">维修班组任务列表</div>
|
||||
<div style="font-size: 20px; color: #f4f4f5; padding: 6px 50px 6px 10px; background-color: #2c3e50">报修任务</div>
|
||||
<div class="my_table">
|
||||
<div class="login" :style="'background-image:url('+ Background +');'">
|
||||
<div style="font-size: 22px; color: #f4f4f5; padding: 6px 50px 6px 700px;background-color: transparent">维修班组任务列表</div>
|
||||
<div style="font-size: 20px; color: #f4f4f5; padding: 6px 50px 6px 10px; background-color: transparent">报修任务</div>
|
||||
<div class="t_btn1">
|
||||
<el-table border style="width: 100%;" :data="table" max-height="300" :cell-style="cellStyle" :highlight-current-row="true" >
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column align="center" property="fault_time" label="日期"/>
|
||||
@@ -14,8 +14,8 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
|
||||
<div style="font-size: 20px; color: #f4f4f5; background-color: #2c3e50; padding: 6px 50px 6px 10px">在修任务</div>
|
||||
<div class="my_table">
|
||||
<div style="font-size: 20px; color: #f4f4f5; background-color: transparent; padding: 6px 50px 6px 10px">在修任务</div>
|
||||
<div class="t_btn2">
|
||||
<el-table border style="width: 100%;" :data="table2" max-height="300" :cell-style="cellStyle2" :highlight-current-row="true" >
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column align="center" property="fault_time" label="日期"/>
|
||||
@@ -32,6 +32,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Background from '@/assets/images/bigScreen.png'
|
||||
|
||||
export default {
|
||||
name: 'Test',
|
||||
data() {
|
||||
@@ -39,6 +41,7 @@ export default {
|
||||
// path: 'ws://192.168.81.252:8086//webSocket/21',
|
||||
// path: window.g.dev.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/21',
|
||||
path: window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/21',
|
||||
Background: Background,
|
||||
table: [
|
||||
{ 'fault_time': '暂无数据', 'create_time': '暂无数据', 'name': '暂无数据', 'device_name': '暂无数据', 'class_name': '暂无数据' }
|
||||
],
|
||||
@@ -75,8 +78,12 @@ export default {
|
||||
getMessage: function(msg) {
|
||||
debugger
|
||||
const data = JSON.parse(msg.data)
|
||||
if (data.msg.requestArr.length !== 0) {
|
||||
this.table = data.msg.requestArr
|
||||
}
|
||||
if (data.msg.repaiArr.length !== 0) {
|
||||
this.table2 = data.msg.repaiArr
|
||||
}
|
||||
},
|
||||
send: function() {
|
||||
// eslint-disable-next-line no-undef
|
||||
@@ -90,57 +97,103 @@ export default {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
cellStyle(row, column, rowIndex, columnIndex) {
|
||||
return 'color:red; font-size: 14px;'
|
||||
return 'color: #fff,backgroundColor: transparent,fontSize: fontSize(23),textAlign: center'
|
||||
},
|
||||
cellStyle2(row, column, rowIndex, columnIndex) {
|
||||
return 'font-size: 14px;'
|
||||
return 'color: #fff,backgroundColor: transparent,fontSize: fontSize(23),textAlign: center'
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$nextTick(() => {
|
||||
document.body.setAttribute('style', 'background-color: #2D2F3F')
|
||||
})
|
||||
},
|
||||
// 实例销毁之前钩子--移除body 标签的属性style
|
||||
beforeDestroy() {
|
||||
document.body.removeAttribute('style')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
/*.my_table >>> .el-table::before {
|
||||
!* 去除下边框 *!
|
||||
height: 0;
|
||||
}*/
|
||||
.login {
|
||||
height: 100%;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table__row>td {
|
||||
/*.t_btn2 >>> .el-table::before {*/
|
||||
/* !* 去除下边框 *!*/
|
||||
/* height: 0;*/
|
||||
/*}*/
|
||||
|
||||
/*.t_btn2 >>> .el-table--border {*/
|
||||
/* !* 去除上边框 *!*/
|
||||
/* border: none;*/
|
||||
/*}*/
|
||||
|
||||
.t_btn2 >>> .el-table th.is-leaf {
|
||||
/* 去除表头边框 */
|
||||
border: none;
|
||||
}
|
||||
.t_btn2 >>> .el-table__row>td {
|
||||
/* 去除表格线 */
|
||||
border: none;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table th.is-leaf {
|
||||
/* 去除上边框 */
|
||||
border: none;
|
||||
.t_btn2 >>> .el-table th {
|
||||
/* 设置表头的颜色和字体颜色 */
|
||||
background-color: #012957;
|
||||
color: #FFFFFF;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table tr {
|
||||
/* 设置每行的颜色和字体颜色 */
|
||||
background-color: #2D2F3F;
|
||||
.t_btn2 >>>.el-table,
|
||||
.el-table__expanded-cell {
|
||||
background-color: transparent;
|
||||
}
|
||||
.t_btn2 >>> .el-table tr {
|
||||
background-color: transparent !important;
|
||||
color: #FFFFFF;
|
||||
font-weight: 500;
|
||||
}
|
||||
.t_btn2 >>> .el-table--enable-row-transition .el-table__body td,
|
||||
.el-table .cell {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table th {
|
||||
/*.t_btn1 >>> .el-table::before {*/
|
||||
/* !* 去除下边框 *!*/
|
||||
/* height: 0;*/
|
||||
/*}*/
|
||||
|
||||
/*.t_btn1 >>> .el-table--border {*/
|
||||
/* !* 去除上边框 *!*/
|
||||
/* border: none;*/
|
||||
/*}*/
|
||||
|
||||
.t_btn1 >>> .el-table th.is-leaf {
|
||||
/* 去除表头边框 */
|
||||
border: none;
|
||||
}
|
||||
|
||||
.t_btn1 >>> .el-table th.is-leaf {
|
||||
/* 去除上边框 */
|
||||
border: none;
|
||||
}
|
||||
.t_btn1 >>> .el-table__row>td {
|
||||
/* 去除表格线 */
|
||||
border: none;
|
||||
}
|
||||
.t_btn1 >>> .el-table th {
|
||||
/* 设置表头的颜色和字体颜色 */
|
||||
background-color: rgb(19, 71, 98);
|
||||
background-color: #012957;
|
||||
color: #FFFFFF;
|
||||
font-size: 17px;
|
||||
}
|
||||
.my_span {
|
||||
padding: 10px 50px 10px 0px;
|
||||
font-size: 17px;
|
||||
.t_btn1 >>>.el-table,
|
||||
.el-table__expanded-cell {
|
||||
background-color: transparent;
|
||||
}
|
||||
.t_btn1 >>> .el-table tr {
|
||||
background-color: transparent !important;
|
||||
color: #FF0000;
|
||||
font-weight: 500;
|
||||
}
|
||||
.t_btn1 >>> .el-table--enable-row-transition .el-table__body td,
|
||||
.el-table .cell {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -89,6 +89,17 @@
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createExcel"
|
||||
>
|
||||
生成设备保养
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
@@ -140,6 +151,8 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import AddDialog from '@/views/wms/sb/upkeep/devicemaintenance/AddDialog'
|
||||
import {download} from "@/api/data";
|
||||
import {downloadFile} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: 'Devicemaintenance',
|
||||
@@ -234,6 +247,15 @@ export default {
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
createExcel() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
download('api/devicemaintenancemst/createExcel', { 'maint_id': data.maint_id }).then(result => {
|
||||
const name = data.maint_code + '保养工单'
|
||||
this.crud.toQuery()
|
||||
downloadFile(result, name, 'xlsx')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user