rev:设备台账功能修改
This commit is contained in:
@@ -296,6 +296,7 @@ public class EmBiIostorinvOutServiceImpl extends ServiceImpl<EmBiIostorinvOutMap
|
||||
stIvtIostorinvYl.setDetail_count(rows.size());
|
||||
stIvtIostorinvYl.setRemark(whereJson.getString("remark"));
|
||||
stIvtIostorinvYl.setWorkshop_id(whereJson.getString("workshop_id"));
|
||||
stIvtIostorinvYl.setSource_id(whereJson.getString("source_id"));
|
||||
|
||||
return stIvtIostorinvYl;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ 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.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
|
||||
import org.nl.wms.device_manage.repair.service.DevicerepairmstService;
|
||||
import org.nl.wms.device_manage.repair.service.dto.DevicerepairmstDto;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
@@ -49,6 +50,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
// private final StorattrService storattrService;
|
||||
// private final SparePartOutServiceImpl sparePartOutService;
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvOutService emBiIostorinvOutService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@@ -169,6 +173,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
jsonMst.put("remark", whereJson.getString("remark"));
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonMst.put("input_optid", currentUserId);
|
||||
jsonMst.put("input_optname", nickName);
|
||||
jsonMst.put("input_time", DateUtil.now());
|
||||
@@ -208,6 +213,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
jsonMst.put("remark", whereJson.getString("remark"));
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("estimaterepair_times", whereJson.getString("estimaterepair_times"));
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
@@ -260,8 +266,8 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst");
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl");
|
||||
|
||||
JSONArray resultJSONArray = dtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(resultJSONArray)) throw new BadRequestException("维修项目为空");
|
||||
/* JSONArray resultJSONArray = dtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(resultJSONArray)) throw new BadRequestException("维修项目为空");*/
|
||||
|
||||
JSONObject json = mstTab.query("repair_id ='" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
json.put("invstatus", "02");
|
||||
@@ -283,7 +289,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
jsonReMst.put("invstatus", "03");
|
||||
jsonReMst.put("estimaterepair_times", whereJson.getString("estimaterepair_times"));
|
||||
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
// jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonReMst.put("real_start_date", DateUtil.now());
|
||||
reMstTab.update(jsonReMst);
|
||||
// 2.更新设备档案表
|
||||
@@ -322,7 +328,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void endRepair(JSONObject whereJson) {
|
||||
public void endRepair(JSONObject whereJson2) {
|
||||
JSONObject whereJson = whereJson2.getJSONObject("form");
|
||||
|
||||
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -374,6 +382,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
jsonReMst.put("invstatus", "06");
|
||||
jsonReMst.put("real_end_date", DateUtil.now());
|
||||
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonReMst.put("confirm_optid", currentUserId);
|
||||
jsonReMst.put("confirm_optname", nickName);
|
||||
jsonReMst.put("confirm_time", DateUtil.now());
|
||||
@@ -397,6 +406,28 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
jsonLife.put("create_name",nickName);
|
||||
jsonLife.put("create_time", DateUtil.now());
|
||||
lifeTab.insert(jsonLife);
|
||||
|
||||
// 5.判断是否需要新增备件出库单
|
||||
Boolean aSwitch = whereJson.getBoolean("switch");
|
||||
if (ObjectUtil.isEmpty(aSwitch)) aSwitch = false;
|
||||
if (aSwitch) {
|
||||
whereJson2.put("repair_code", jsonReMst.getString("repair_code"));
|
||||
this.createIos(whereJson2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void createIos(JSONObject whereJson) {
|
||||
JSONObject mst = whereJson.getJSONObject("form2");
|
||||
JSONArray tableDataDtl = mst.getJSONArray("tableDataDtl");
|
||||
|
||||
// 准备参数
|
||||
mst.put("biz_date", DateUtil.now());
|
||||
mst.put("tableData", tableDataDtl);
|
||||
mst.put("source_id", whereJson.getString("repair_code"));
|
||||
mst.put("remark", "由维修单创建");
|
||||
|
||||
emBiIostorinvOutService.create(mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -407,19 +438,27 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
||||
WQLObject reDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单明细表
|
||||
WQLObject recordTab = WQLObject.getWQLObject("EM_BI_DeviceRepairRecord"); // 设备维修单情况记录表
|
||||
WQLObject itemTab = WQLObject.getWQLObject("em_bi_devicerepairitems"); // 设备维修项目表
|
||||
|
||||
// 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);
|
||||
// 2.更新明细表
|
||||
|
||||
// 2.删除所有明细重新插入
|
||||
reDtlTab.delete("repair_id = '"+whereJson.getString("repair_id")+"'");
|
||||
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
JSONObject json = tableData.getJSONObject(i);
|
||||
JSONObject jsonRedtl = reDtlTab.query("repair_dtl_id = '" + json.getString("repair_dtl_id") + "'").uniqueResult(0);
|
||||
jsonRedtl.put("isfinish", json.getString("isfinish"));
|
||||
reDtlTab.update(jsonRedtl);
|
||||
JSONObject jsonObject = tableData.getJSONObject(i);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("repair_dtl_id", org.nl.common.utils.IdUtil.getStringId());
|
||||
json.put("repair_id", whereJson.getString("repair_id"));
|
||||
json.put("repair_item_id", jsonObject.getString("repair_item_id"));
|
||||
json.put("isfinish", jsonObject.getString("isfinish"));
|
||||
reDtlTab.insert(json);
|
||||
}
|
||||
|
||||
// 3.插入设备维修单情况记录表
|
||||
|
||||
@@ -10,6 +10,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
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;
|
||||
@@ -21,6 +22,8 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.device_manage.repair.service.DevicerepairrequestService;
|
||||
import org.nl.wms.device_manage.repair.service.dto.DevicerepairrequestDto;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiRepairDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiRepairDevice;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
@@ -50,6 +53,9 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private EmBiRepairDeviceService emBiRepairDeviceService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
@@ -272,7 +278,15 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
jsonRequest.put("process_time", DateUtil.now());
|
||||
requestTab.update(jsonRequest);
|
||||
|
||||
// 3.插入设备维修单主表
|
||||
// 3.判断此设备是否有对应的维修人
|
||||
List<EmBiRepairDevice> repairDeviceDaoList = emBiRepairDeviceService.list(
|
||||
new QueryWrapper<EmBiRepairDevice>().lambda()
|
||||
.eq(EmBiRepairDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应维修人员超过2人,请检查!");
|
||||
|
||||
// 4.插入设备维修单主表
|
||||
JSONObject jsonReMst = new JSONObject();
|
||||
jsonReMst.put("repair_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonReMst.put("repair_code", CodeUtil.getNewCode("REPAIR_CODE"));
|
||||
@@ -292,6 +306,10 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
jsonReMst.put("input_time", DateUtil.now());
|
||||
jsonReMst.put("sysdeptid", 1);
|
||||
jsonReMst.put("syscompanyid",1);
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonReMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
reMstTab.insert(jsonReMst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,10 @@ public class DevicePairQueryController {
|
||||
return new ResponseEntity<>(devicePairQueryService.getDeviceInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getIosMst")
|
||||
@ApiOperation("获取备件出库单信息")
|
||||
public ResponseEntity<Object> getIosMst(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(devicePairQueryService.getIosMst(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,4 +32,7 @@ public interface DevicePairQueryService {
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject getDeviceInfo(JSONObject whereJson);
|
||||
|
||||
JSONObject getIosMst(JSONObject whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,13 +5,17 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.modules.common.utils.FileUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.stat.service.DevicePairQueryService;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
@@ -33,6 +37,9 @@ public class DevicePairQueryServiceImpl implements DevicePairQueryService {
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvOutService emBiIostorinvOutService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
|
||||
@@ -194,4 +201,13 @@ public class DevicePairQueryServiceImpl implements DevicePairQueryService {
|
||||
json.put("tableData2", relArr);
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getIosMst(JSONObject whereJson) {
|
||||
EmBiostorinv dao = emBiIostorinvOutService.getOne(
|
||||
new QueryWrapper<EmBiostorinv>().lambda()
|
||||
.eq(EmBiostorinv::getSource_id, whereJson.getString("repair_code"))
|
||||
);
|
||||
return JSON.parseObject(JSONObject.toJSONString(dao));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ 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.common.utils.RedissonUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.tools.domain.LocalStorage;
|
||||
@@ -20,6 +22,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -34,7 +37,7 @@ public class EquipmentfileController {
|
||||
private final EquipmentfileService equipmentfileService;
|
||||
private final LocalStorageService localStorageService;
|
||||
@GetMapping
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
@@ -46,20 +49,20 @@ public class EquipmentfileController {
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增工令")
|
||||
@ApiOperation("新增设备档案")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject json){
|
||||
equipmentfileService.create(json);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改工令")
|
||||
@ApiOperation("修改设备档案")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson){
|
||||
equipmentfileService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ApiOperation("删除工令")
|
||||
@ApiOperation("删除设备档案")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
equipmentfileService.deleteAll(ids);
|
||||
@@ -74,48 +77,48 @@ public class EquipmentfileController {
|
||||
}
|
||||
|
||||
@GetMapping("/queryivt1")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt1(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll1(whereJson),HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/queryivt2")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt2(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll2(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryivt3")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt3(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll3(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryivt4")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt4(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll4(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryivt5")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt5(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll5(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryivt6")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt6(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll6(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryivt7")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryivt7(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryAll7(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryBomList")
|
||||
@ApiOperation("查询工令")
|
||||
@ApiOperation("查询设备档案")
|
||||
public ResponseEntity<Object> queryBomList(@RequestParam Map whereJson){
|
||||
return new ResponseEntity<>(equipmentfileService.queryBomList(whereJson),HttpStatus.OK);
|
||||
}
|
||||
@@ -140,4 +143,14 @@ public class EquipmentfileController {
|
||||
storateTab.update(param, "storage_id = '" + localStorage.getId() + "'");
|
||||
return new ResponseEntity(localStorage, HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入bom数据
|
||||
*/
|
||||
@Log("导入设备档案")
|
||||
@PostMapping("/excelImport")
|
||||
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||
RedissonUtils.lock(() -> equipmentfileService.excelImport(file, request), "导入设备档案", null);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ package org.nl.wms.masterdata_manage.em.service;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -105,4 +108,11 @@ public interface EquipmentfileService {
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
JSONArray queryBomList(Map whereJson);
|
||||
|
||||
/**
|
||||
* 导入设备档案
|
||||
* @param file
|
||||
* @param request
|
||||
*/
|
||||
void excelImport(MultipartFile file, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ package org.nl.wms.masterdata_manage.em.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -19,21 +21,28 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.masterdata_manage.em.service.EquipmentfileService;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
import org.nl.wms.system_manage.service.tableData.ColumnInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||
|
||||
private final ClassstandardService classstandardService;
|
||||
@Autowired
|
||||
private ClassstandardService classstandardService;
|
||||
|
||||
@Autowired
|
||||
private ColumnInfoService columnInfoService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
@@ -432,4 +441,51 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void excelImport(MultipartFile file, HttpServletRequest request) {
|
||||
try {
|
||||
// 调用用 hutool 方法读取数据 调用第一个sheet白班数据
|
||||
ExcelReader excelReader = ExcelUtil.getReader(file.getInputStream(), 0);
|
||||
// 从第1行开始获取数据 excelReader.read的结果是一个2纬的list,外层是行,内层是行对应的所有列
|
||||
Map<String, String> tableColumn = columnInfoService.TableColumn2("em_bi_equipmentfile");
|
||||
List<List<Object>> read = excelReader.read(0, excelReader.getRowCount());
|
||||
Map<Integer, String> IndexValue = new HashMap<>();
|
||||
for (int i = 0; i < read.get(0).size(); i++) {
|
||||
String label = String.valueOf(read.get(0).get(i));String value = tableColumn.get(label);
|
||||
if (value!=null){ IndexValue.put(i,value); }
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
JSONArray array = new JSONArray();
|
||||
List<String> ids = new ArrayList<>();
|
||||
for (int i = 1; i < read.size(); i++) {
|
||||
List<Object> list = read.get(i);
|
||||
JSONObject item = new JSONObject();
|
||||
for (int i1 = 0; i1 < list.size(); i1++) {
|
||||
String s = IndexValue.get(i1);
|
||||
if (s!=null){
|
||||
item.put(s,list.get(i1));
|
||||
|
||||
}
|
||||
}
|
||||
item.put("create_id",currentUserId);
|
||||
item.put("create_name",currentUsername);
|
||||
item.put("create_time",now);
|
||||
array.add(item);
|
||||
ids.add(item.getString("devicerecord_id"));
|
||||
}
|
||||
System.out.println(array.size());
|
||||
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
||||
mstTab.delete("devicerecord_id in "+"('" + ids.stream().collect(Collectors.joining("','")) + "')");
|
||||
for (Object o : array) {
|
||||
mstTab.insert((JSONObject)o);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
throw new BadRequestException(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -11,9 +11,9 @@ import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrServic
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.MaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.dto.MaterialbaseDto;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.impl.MaterialbaseServiceImpl;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.MaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.dto.MaterialbaseDto;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.impl.MaterialbaseServiceImpl;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.StIvtIostorinvdisYl;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.StIvtIostorinvdtlYl;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ColumnInfoService {
|
||||
private ColumnMapper columnMapper;
|
||||
|
||||
|
||||
Map<String,String> TableColumn(String tableName){
|
||||
public Map<String,String> TableColumn(String tableName){
|
||||
Map map = new HashMap<>();
|
||||
try {
|
||||
List<Map<String, String>> mapList = columnMapper.listTableColumn(tableName);
|
||||
@@ -41,6 +41,16 @@ public class ColumnInfoService {
|
||||
}
|
||||
return map;
|
||||
};
|
||||
public Map<String,String> TableColumn2(String tableName){
|
||||
Map map = new HashMap<>();
|
||||
try {
|
||||
List<Map<String, String>> mapList = columnMapper.listTableColumn(tableName);
|
||||
map = mapList.stream().collect(Collectors.toMap((Function<Map<String, String>, Object>) stringStringMap -> stringStringMap.get("COLUMN_COMMENT"), (Function<Map<String, String>, Object>) stringStringMap -> stringStringMap.get("COLUMN_NAME")));
|
||||
}catch (Exception ex){
|
||||
log.error(tableName+"获取表结构失败",ex);
|
||||
}
|
||||
return map;
|
||||
};
|
||||
|
||||
@SneakyThrows
|
||||
public <T> void exportFile(String tableName,List<Map> data, HttpServletResponse response,List passParam, Map<String,String> customizMap) {
|
||||
|
||||
@@ -12,7 +12,7 @@ spring:
|
||||
task:
|
||||
pool:
|
||||
# 核心线程池大小
|
||||
core-pool-size: 10pcsIfPurchaseorder/confirm
|
||||
core-pool-size: 10
|
||||
# 最大线程数
|
||||
max-pool-size: 30
|
||||
# 活跃时间
|
||||
|
||||
@@ -22,3 +22,7 @@ ALTER TABLE st_ivt_structivt_bcp
|
||||
-- CP移库类型
|
||||
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1703954832731279360', 'ST_INV_CP_IN_TYPE', '成品入库单据类型', '移库入库', '0003', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-19 10:11:04', '1694303357524643840', '管理员', '2023-09-19 10:11:04');
|
||||
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1703955348920078336', 'ST_INV_CP_OUT_TYPE', '成品出库单据类型', '移库出库', '1003', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-19 10:13:07', '1694303357524643840', '管理员', '2023-09-19 10:13:16');
|
||||
-- 设备档案新增字段
|
||||
ALTER TABLE em_bi_equipmentfile
|
||||
ADD COLUMN `power` varchar(64) COMMENT '功率',
|
||||
ADD COLUMN `plc_model` varchar(64) COMMENT 'plc型号';
|
||||
|
||||
@@ -51,6 +51,14 @@
|
||||
<label slot="label">制造国别:</label>
|
||||
<el-input v-model.trim="form.country_manufactur" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="PCL型号" prop="plc_model">
|
||||
<label slot="label">PCL型号:</label>
|
||||
<el-input v-model.trim="form.plc_model" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="功率" prop="manufacturer">
|
||||
<label slot="label">功率:</label>
|
||||
<el-input v-model.trim="form.power" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂编号" prop="leavefactory_number">
|
||||
<label slot="label">出厂编号:</label>
|
||||
<el-input v-model.trim="form.leavefactory_number" clearable style="width: 210px" />
|
||||
@@ -133,8 +141,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="内部自编号" prop="extend_code">
|
||||
<label slot="label">内部自编号:</label>
|
||||
<el-form-item label="erp设备标识" prop="extend_code">
|
||||
<label slot="label">erp设备标识:</label>
|
||||
<el-input v-model.trim="form.extend_code" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="资产编码" prop="assets_code">
|
||||
@@ -175,16 +183,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="理论节拍" prop="theory_beat">
|
||||
<label slot="label">理论节拍:</label>
|
||||
<el-input-number
|
||||
v-model="form.theory_beat"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="理论节拍" prop="theory_beat">-->
|
||||
<!-- <label slot="label">理论节拍:</label>-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="form.theory_beat"-->
|
||||
<!-- :controls="false"-->
|
||||
<!-- :precision="3"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- style="width: 210px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="卡片编号" prop="card_code">
|
||||
<label slot="label">卡片编号:</label>
|
||||
<el-input v-model.trim="form.card_code" clearable style="width: 210px" />
|
||||
@@ -197,26 +205,26 @@
|
||||
<label slot="label">使用人:</label>
|
||||
<el-input v-model.trim="form.user_name" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="本币原值" prop="oraginal_value">
|
||||
<label slot="label">本币原值:</label>
|
||||
<el-input-number
|
||||
v-model="form.oraginal_value"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="净额" prop="net_amount">
|
||||
<label slot="label">净额:</label>
|
||||
<el-input-number
|
||||
v-model="form.net_amount"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="本币原值" prop="oraginal_value">-->
|
||||
<!-- <label slot="label">本币原值:</label>-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="form.oraginal_value"-->
|
||||
<!-- :controls="false"-->
|
||||
<!-- :precision="3"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- style="width: 210px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="净额" prop="net_amount">-->
|
||||
<!-- <label slot="label">净额:</label>-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="form.net_amount"-->
|
||||
<!-- :controls="false"-->
|
||||
<!-- :precision="3"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- style="width: 210px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model.trim="form.remark" style="width: 480px;" rows="3" type="textarea" :disabled="crud.status.view > 0" />
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudEquipmentfile from '@/views/wms/device_manage/deviceFile/equipmentfile/equipmentfile'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
crudEquipmentfile.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
// const list = err.response.data.message
|
||||
// download2('/api/produceWorkorder/download', list).then(result => {
|
||||
// downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
// crud.downloadLoading = false
|
||||
// })
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,6 +51,14 @@
|
||||
<label slot="label">制造国别:</label>
|
||||
<el-input v-model.trim="form.country_manufactur" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="PCL型号" prop="plc_model">
|
||||
<label slot="label">PCL型号:</label>
|
||||
<el-input v-model.trim="form.plc_model" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="功率" prop="manufacturer">
|
||||
<label slot="label">功率:</label>
|
||||
<el-input v-model.trim="form.power" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂编号" prop="leavefactory_number">
|
||||
<label slot="label">出厂编号:</label>
|
||||
<el-input v-model.trim="form.leavefactory_number" disabled style="width: 210px" />
|
||||
@@ -123,8 +131,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="内部自编号" prop="extend_code">
|
||||
<label slot="label">内部自编号:</label>
|
||||
<el-form-item label="erp设备标识" prop="extend_code">
|
||||
<label slot="label">erp设备标识:</label>
|
||||
<el-input v-model.trim="form.extend_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="资产编码" prop="assets_code">
|
||||
@@ -159,17 +167,17 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="理论节拍" prop="theory_beat">
|
||||
<label slot="label">理论节拍:</label>
|
||||
<el-input-number
|
||||
v-model="form.theory_beat"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
disabled
|
||||
:min="0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="理论节拍" prop="theory_beat">-->
|
||||
<!-- <label slot="label">理论节拍:</label>-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="form.theory_beat"-->
|
||||
<!-- :controls="false"-->
|
||||
<!-- :precision="3"-->
|
||||
<!-- disabled-->
|
||||
<!-- :min="0"-->
|
||||
<!-- style="width: 210px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="卡片编号" prop="card_code">
|
||||
<label slot="label">卡片编号:</label>
|
||||
<el-input v-model.trim="form.card_code" disabled style="width: 210px" />
|
||||
@@ -182,28 +190,28 @@
|
||||
<label slot="label">使用人:</label>
|
||||
<el-input v-model.trim="form.user_name" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="本币原值" prop="oraginal_value">
|
||||
<label slot="label">本币原值:</label>
|
||||
<el-input-number
|
||||
v-model="form.oraginal_value"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
disabled
|
||||
:min="0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="净额" prop="net_amount">
|
||||
<label slot="label">净额:</label>
|
||||
<el-input-number
|
||||
v-model="form.net_amount"
|
||||
:controls="false"
|
||||
disabled
|
||||
:precision="3"
|
||||
:min="0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="本币原值" prop="oraginal_value">-->
|
||||
<!-- <label slot="label">本币原值:</label>-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="form.oraginal_value"-->
|
||||
<!-- :controls="false"-->
|
||||
<!-- :precision="3"-->
|
||||
<!-- disabled-->
|
||||
<!-- :min="0"-->
|
||||
<!-- style="width: 210px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="净额" prop="net_amount">-->
|
||||
<!-- <label slot="label">净额:</label>-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model="form.net_amount"-->
|
||||
<!-- :controls="false"-->
|
||||
<!-- disabled-->
|
||||
<!-- :precision="3"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- style="width: 210px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model.trim="form.remark" style="width: 480px;" rows="3" type="textarea" disabled />
|
||||
|
||||
@@ -94,4 +94,13 @@ export function queryBomList(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, submit, queryivt1, queryivt2, queryivt3, queryivt4, queryivt5, queryivt6, queryivt7, queryBomList }
|
||||
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/equipmentfile/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { excelImport, add, edit, del, submit, queryivt1, queryivt2, queryivt3, queryivt4, queryivt5, queryivt6, queryivt7, queryBomList }
|
||||
|
||||
@@ -195,6 +195,16 @@
|
||||
>
|
||||
导出excel
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -229,7 +239,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_name" min-width="150" label="设备名称" />
|
||||
<el-table-column prop="extend_code" min-width="100" label="内部自编号" />
|
||||
<el-table-column prop="extend_code" min-width="100" label="erp设备标识" />
|
||||
<el-table-column prop="device_model" min-width="130" label="设备型号" />
|
||||
<el-table-column prop="device_spec" min-width="130" label="设备规格" />
|
||||
<el-table-column prop="device_level" min-width="90" label="设备等级" :formatter="device_levelFormat" />
|
||||
@@ -241,6 +251,8 @@
|
||||
<el-table-column prop="supplier_name" min-width="180" label="供应商" show-overflow-tooltip />
|
||||
<el-table-column prop="manufacturer" min-width="180" label="制造商" show-overflow-tooltip />
|
||||
<el-table-column prop="country_manufactur" min-width="90" label="制造国别" show-overflow-tooltip />
|
||||
<el-table-column prop="plc_model" min-width="90" label="plc型号" show-overflow-tooltip />
|
||||
<el-table-column prop="power" min-width="90" label="功率" show-overflow-tooltip />
|
||||
<el-table-column prop="leavefactory_date" min-width="80" label="出厂日期" show-overflow-tooltip />
|
||||
<el-table-column prop="leavefactory_number" min-width="130" label="出厂编号" show-overflow-tooltip />
|
||||
<el-table-column prop="drawing_number" min-width="130" label="图号" show-overflow-tooltip />
|
||||
@@ -259,6 +271,7 @@
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<ChangeDialog :dialog-show.sync="changeShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -280,10 +293,12 @@ 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'
|
||||
import UploadDialog from '@/views/wms/device_manage/deviceFile/equipmentfile/UploadDialog'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'Equipmentfile',
|
||||
components: { Treeselect, ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
components: { UploadDialog, Treeselect, ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '设备档案', idField: 'devicerecord_id', url: 'api/equipmentfile', crudMethod: { ...equipmentfile },
|
||||
optShow: {
|
||||
@@ -309,6 +324,7 @@ export default {
|
||||
class_idStr: null,
|
||||
mstrow: {},
|
||||
XLList: [],
|
||||
uploadShow: false,
|
||||
depts: [],
|
||||
classes: [],
|
||||
workProcedureList: [],
|
||||
@@ -341,6 +357,9 @@ export default {
|
||||
canUd(row) {
|
||||
return row.status !== '00'
|
||||
},
|
||||
tableChanged3() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
seriesFormat2(row) {
|
||||
for (const item of this.workProcedureList) {
|
||||
if (item.workprocedure_id === row.workprocedure_id) {
|
||||
|
||||
@@ -180,7 +180,8 @@
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip min-width="120" />
|
||||
<el-table-column label="来源单据号" align="center" prop="source_id" show-overflow-tooltip min-width="120" />
|
||||
<el-table-column label="制单人" align="center" prop="create_name" />
|
||||
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
|
||||
<el-table-column label="修改人" align="center" prop="update_name" />
|
||||
@@ -244,7 +245,7 @@ export default {
|
||||
mstrow: {},
|
||||
divShow: false,
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
storlist: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="crud.status.edit !== 0 || crud.status.view !== 0 " label="维修人" prop="update_optname">
|
||||
<el-input v-show="crud.status.edit !== 0 || crud.status.view !== 0 " v-model.trim="form.update_optname" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="crud.status.edit === 1" label="预计修复时间(小时)" prop="estimaterepair_times">
|
||||
<el-input-number v-show="crud.status.edit === 1" v-model="form.estimaterepair_times" :disabled="crud.status.view > 0" :precision="1" :min="0" :max="999" style="width: 200px" :controls="false" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -152,4 +152,12 @@ export function getDeviceInfo(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo }
|
||||
export function getIosMst(data) {
|
||||
return request({
|
||||
url: 'api/devicerepairquery/getIosMst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo, getIosMst }
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" min-width="35" />
|
||||
<el-table-column prop="repair_code" label="维修单号" min-width="140px" >
|
||||
<el-table-column prop="repair_code" label="维修单号" min-width="140px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.repair_code }}</el-link>
|
||||
</template>
|
||||
@@ -134,7 +134,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog/>
|
||||
<AddDialog />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -155,7 +155,7 @@ import AddDialog from '@/views/wms/device_manage/repair/devicerepair/AddDialog'
|
||||
export default {
|
||||
name: 'Devicerepair',
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'EM_DEVICE_WX_INVSTATUS', 'EM_FAULT_LEVEL'],
|
||||
components: {AddDialog, pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect },
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -244,6 +244,9 @@ export default {
|
||||
if (data.invstatus !== '01') {
|
||||
return this.crud.notify('只能对生成状态的单据提交', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (data.update_optname === '') {
|
||||
return this.crud.notify('维修人不允许为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicerepairmst.submit(data).then(res => {
|
||||
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
@@ -320,7 +323,6 @@ export default {
|
||||
|
||||
color: "#CCCFD6";
|
||||
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__input {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="18" style="border: 1px solid white">
|
||||
@@ -14,7 +15,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitMain">预保存</el-button>
|
||||
<!-- <el-button icon="el-icon-check" size="mini" type="primary" @click="submitMain">预保存</el-button>-->
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="endRepair">保存并结束</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
@@ -23,19 +24,19 @@
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="120px" label-suffix=":">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据号" prop="repair_code">
|
||||
<el-input v-model.trim="form.repair_code" style="width: 200px;" disabled placeholder="系统自动生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="计划维修日期" prop="plan_start_date">
|
||||
<el-date-picker v-model="form.plan_start_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="维修类型" prop="maintenancecycle">
|
||||
<el-select
|
||||
v-model="form.maintenancecycle"
|
||||
@@ -55,21 +56,26 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="设备名称" prop="device_name">
|
||||
<el-input v-model.trim="form.device_name" :disabled="true" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="维修人" prop="update_optname">
|
||||
<el-input v-model.trim="form.update_optname" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="班组配合人" prop="product_person_name">
|
||||
<el-input v-model.trim="form.product_person_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="备件出库">
|
||||
<el-switch v-model="form.switch" active-color="#13ce66" inactive-color="#ff4949" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -122,6 +128,23 @@
|
||||
<span class="role-span">项目明细</span>
|
||||
</div>
|
||||
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="putItem"
|
||||
>
|
||||
添加项目
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -154,18 +177,159 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" :disabled="scope.row.isfinish === '1'" @click.native.prevent="delRow(scope.$index, form.tableData)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<div v-if="form.switch" class="crud-opts2">
|
||||
<span class="role-span">新增备件出库</span>
|
||||
</div>
|
||||
|
||||
<div v-if="form.switch" class="crud-opts2">
|
||||
<el-form
|
||||
ref="form"
|
||||
:inline="true"
|
||||
:model="form2"
|
||||
:rules="rules"
|
||||
size="mini"
|
||||
label-width="85px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="业务类型" prop="bill_type">
|
||||
<el-select
|
||||
v-model="form2.bill_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_BI_OUT_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓库</label>
|
||||
<el-select
|
||||
v-model="form2.stor_id"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshop_id">
|
||||
<label slot="label">车间</label>
|
||||
<el-select
|
||||
v-model="form2.workshop_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div v-if="form.switch" class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="insertEvent"
|
||||
>
|
||||
添加库存
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<el-card v-if="form.switch" class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table2"
|
||||
:data="form2.tableDataDtl"
|
||||
style="width: 100%;"
|
||||
max-height="500"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="备件编码" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="备件名称" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="form2.tableDataDtl[scope.$index].plan_qty"
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
precision="3"
|
||||
:min="0"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="form2.tableDataDtl[scope.$index].remark"
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="delRow(scope.$index, form2.tableDataDtl)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1" />
|
||||
<StructIvt :dialog-show.sync="ivtShow" @setMaterValue="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
|
||||
import ItemDialog from '@/views/wms/device_manage/repair/devicerepairplan/ItemDialog'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import StructIvt from '@/views/wms/device_manage/ios/embiout/StructIvt'
|
||||
|
||||
export default {
|
||||
name: 'ExecuteDialog',
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT'],
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT', 'EM_BI_OUT_TYPE', 'product_area'],
|
||||
components: { ItemDialog, StructIvt },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -179,8 +343,19 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
switch: false,
|
||||
tableData: []
|
||||
},
|
||||
form2: {
|
||||
bill_type: '',
|
||||
stor_id: '',
|
||||
workshop_id: '',
|
||||
total_qty: '0',
|
||||
tableDataDtl: []
|
||||
},
|
||||
storlist: [],
|
||||
itemDialog: false,
|
||||
ivtShow: false,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
@@ -202,6 +377,11 @@ export default {
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
@@ -214,12 +394,95 @@ export default {
|
||||
})
|
||||
},
|
||||
endRepair() {
|
||||
const data = this.form
|
||||
// 校验备件出库
|
||||
if (this.form.switch) {
|
||||
if (this.form2.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
if (this.form2.stor_id === '') {
|
||||
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
if (this.form2.workshop_id === '') {
|
||||
this.crud.notify('请选择车间!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
if (this.form2.tableDataDtl.length === 0) {
|
||||
this.crud.notify('请添加备件!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.form2.tableDataDtl.length; i++) {
|
||||
const row = this.form2.tableDataDtl[i]
|
||||
if (!row.plan_qty) {
|
||||
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const data = {
|
||||
'form': this.form,
|
||||
'form2': this.form2
|
||||
}
|
||||
crudDevicerepairmst.endRepair(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.dialogVisible = false
|
||||
})
|
||||
},
|
||||
putItem() {
|
||||
this.openParam = this.form
|
||||
this.itemDialog = true
|
||||
},
|
||||
tableChanged1(row) {
|
||||
const arr = row
|
||||
const data = this.form.tableData
|
||||
arr.forEach((item) => {
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.fla = false
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].repair_item_id === item.repair_item_id) {
|
||||
this.fla = true
|
||||
}
|
||||
}
|
||||
if (this.fla === false) {
|
||||
this.form.tableData.push(item)
|
||||
}
|
||||
} else {
|
||||
this.form.tableData.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
insertEvent(row) {
|
||||
this.ivtShow = true
|
||||
},
|
||||
delRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
},
|
||||
tableChanged(rows) {
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form2.tableDataDtl.forEach((row) => {
|
||||
if (row.material_code === item.material_code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
item.quality_scode = '01'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.plan_qty = item.canuse_qty
|
||||
this.form2.total_qty = parseFloat(this.form2.total_qty) + parseFloat(item.plan_qty)
|
||||
this.form2.tableDataDtl.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form2.detail_count = this.form2.tableDataDtl.length
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,4 +513,8 @@ export default {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" :inline="true" :model="form4" :rules="rules" size="mini" label-width="150px" label-suffix=":">
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="维修人" prop="update_optname">
|
||||
<el-input v-model.trim="form4.update_optname" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>-->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="预计修复时间(小时)" prop="estimaterepair_times">
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="维修领用"
|
||||
title="维修详情"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
@@ -97,22 +98,7 @@
|
||||
</el-card>
|
||||
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">设备bom</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
disabled
|
||||
@click="addChange"
|
||||
>
|
||||
添加更换件
|
||||
</el-button>
|
||||
</span>
|
||||
<span class="role-span">备件出库明细</span>
|
||||
</div>
|
||||
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
@@ -127,18 +113,11 @@
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="repair_item_code" label="维修项目编号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="device_code" label="设备编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="sparepart_only_id" label="备件唯一标识" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="change_only_id" label="更换备件唯一标识" align="center" />
|
||||
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" disabled class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="delRow(scope.$index, tableData)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="备件编码" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="备件名称" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
@@ -152,6 +131,7 @@
|
||||
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import AddChangeDialog from '@/views/wms/device_manage/repair/devicerepairpa/AddChangeDialog'
|
||||
import crudProductOut from '@/views/wms/device_manage/ios/embiout/embiout'
|
||||
|
||||
export default {
|
||||
name: 'ReceiveDialog',
|
||||
@@ -188,6 +168,13 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudDevicerepairmst.getIosMst(this.form3).then(res => {
|
||||
crudProductOut.getIODtl({ 'iostorinv_id': res.iostorinv_id }).then(res => {
|
||||
this.tableData = res
|
||||
})
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
@@ -239,7 +226,6 @@ export default {
|
||||
this.form3.device_id = row.device_id
|
||||
},
|
||||
tableChanged(rows) {
|
||||
|
||||
const arr = rows
|
||||
arr.forEach((item) => {
|
||||
this.tableData.push(item)
|
||||
|
||||
Reference in New Issue
Block a user