设备档案
This commit is contained in:
@@ -0,0 +1,122 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.basedata.em.rest;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.annotation.Log;
|
||||||
|
import org.nl.domain.LocalStorage;
|
||||||
|
import org.nl.exception.BadRequestException;
|
||||||
|
import org.nl.service.LocalStorageService;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.basedata.em.service.EquipmentfileService;
|
||||||
|
import org.nl.wms.pdm.service.WorkOrdereService;
|
||||||
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "设备档案管理")
|
||||||
|
@RequestMapping("/api/equipmentfile")
|
||||||
|
@Slf4j
|
||||||
|
public class EquipmentfileController {
|
||||||
|
|
||||||
|
private final EquipmentfileService equipmentfileService;
|
||||||
|
private final LocalStorageService localStorageService;
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询工令")
|
||||||
|
@ApiOperation("查询工令")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||||
|
return new ResponseEntity<>(equipmentfileService.queryAll(whereJson,page),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增工令")
|
||||||
|
@ApiOperation("新增工令")
|
||||||
|
public ResponseEntity<Object> create(@RequestBody JSONObject json){
|
||||||
|
equipmentfileService.create(json);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改工令")
|
||||||
|
@ApiOperation("修改工令")
|
||||||
|
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson){
|
||||||
|
equipmentfileService.update(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除工令")
|
||||||
|
@ApiOperation("删除工令")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||||
|
equipmentfileService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("提交")
|
||||||
|
@ApiOperation("提交")
|
||||||
|
@PostMapping("/submit")
|
||||||
|
public ResponseEntity<Object> submit(@RequestBody JSONObject whereJson) {
|
||||||
|
equipmentfileService.submit(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryivt1")
|
||||||
|
@Log("查询成型剂")
|
||||||
|
@ApiOperation("查询工令")
|
||||||
|
public ResponseEntity<Object> queryivt1(@RequestParam Map whereJson){
|
||||||
|
return new ResponseEntity<>(equipmentfileService.queryAll1(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
@GetMapping("/queryivt2")
|
||||||
|
@Log("查询成型剂")
|
||||||
|
@ApiOperation("查询工令")
|
||||||
|
public ResponseEntity<Object> queryivt2(@RequestParam Map whereJson){
|
||||||
|
return new ResponseEntity<>(equipmentfileService.queryAll2(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryivt3")
|
||||||
|
@Log("查询成型剂")
|
||||||
|
@ApiOperation("查询工令")
|
||||||
|
public ResponseEntity<Object> queryivt3(@RequestParam Map whereJson){
|
||||||
|
return new ResponseEntity<>(equipmentfileService.queryAll3(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryBomList")
|
||||||
|
@Log("查询成型剂")
|
||||||
|
@ApiOperation("查询工令")
|
||||||
|
public ResponseEntity<Object> queryBomList(@RequestParam Map whereJson){
|
||||||
|
return new ResponseEntity<>(equipmentfileService.queryBomList(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping({"/pictures/{inspection_id}"})
|
||||||
|
@ApiOperation("质保书上传")
|
||||||
|
public ResponseEntity<Object> upload(@RequestParam MultipartFile file, @PathVariable String inspection_id) {
|
||||||
|
LocalStorage localStorage = this.localStorageService.create((String) null, file);
|
||||||
|
JSONObject mstObj = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + inspection_id + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(mstObj)) throw new BadRequestException("未找到相关设备档案!");
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
//更新存储表的来源标识
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("source_bill_id", inspection_id);
|
||||||
|
param.put("source_bill_code", mstObj.getString("devicerecord_code"));
|
||||||
|
param.put("source_bill_table", "EM_BI_EquipmentFile");
|
||||||
|
param.put("source_bill_table_pk", "devicerecord_id");
|
||||||
|
param.put("is_delete", "0");
|
||||||
|
param.put("create_id", currentUserId);
|
||||||
|
param.put("create_name", SecurityUtils.getNickName());
|
||||||
|
WQLObject storateTab = WQLObject.getWQLObject("tool_local_storage");
|
||||||
|
storateTab.update(param, "storage_id = '" + localStorage.getId() + "'");
|
||||||
|
return new ResponseEntity(localStorage, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.basedata.em.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public interface EquipmentfileService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param json /
|
||||||
|
*/
|
||||||
|
void create(JSONObject json);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param whereJson /
|
||||||
|
*/
|
||||||
|
void update(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Long[] ids);
|
||||||
|
/**
|
||||||
|
* 提交
|
||||||
|
* @param whereJson /
|
||||||
|
*/
|
||||||
|
void submit(JSONObject whereJson);
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
JSONArray queryAll1(Map whereJson);
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
JSONArray queryAll2(Map whereJson);
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
JSONArray queryAll3(Map whereJson);
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
JSONArray queryBomList(Map whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
|
||||||
|
package org.nl.wms.basedata.em.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
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 lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.exception.BadRequestException;
|
||||||
|
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.basedata.em.service.EquipmentfileService;
|
||||||
|
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||||
|
import org.nl.wms.pdm.service.WorkOrdereService;
|
||||||
|
import org.nl.wql.WQL;
|
||||||
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wql.util.WqlUtil;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
|
|
||||||
|
map.put("flag", "1");
|
||||||
|
String device_code = map.get("device_code");
|
||||||
|
if (StrUtil.isNotEmpty(device_code)) {
|
||||||
|
map.put("device_code", "%" + device_code + "%");
|
||||||
|
}
|
||||||
|
String manufacturer = map.get("manufacturer");
|
||||||
|
if (StrUtil.isNotEmpty(manufacturer)) {
|
||||||
|
map.put("manufacturer", "%" + manufacturer + "%");
|
||||||
|
}
|
||||||
|
String begin_time = map.get("begin_time");
|
||||||
|
if (StrUtil.isNotEmpty(begin_time)) {
|
||||||
|
map.put("begin_time", begin_time.substring(0,10)+" 00:00:00");
|
||||||
|
}
|
||||||
|
String end_time = map.get("end_time");
|
||||||
|
if (StrUtil.isNotEmpty(end_time)) {
|
||||||
|
map.put("end_time", end_time.substring(0,10)+" 23:59:59");
|
||||||
|
}
|
||||||
|
JSONObject json = WQL.getWO("QEM_EQUIPMENTFILE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "equipmentfile.devicerecord_code");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void create(JSONObject json) {
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
||||||
|
Long deptId = currentUser.getDeptId();
|
||||||
|
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
||||||
|
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
|
||||||
|
// 插入主表
|
||||||
|
String devicerecord_id = IdUtil.getSnowflake(1, 1).nextId()+"";
|
||||||
|
json.put("devicerecord_id", devicerecord_id);
|
||||||
|
String devicerecord_code = CodeUtil.getNewCode("EM_EF_CODE");
|
||||||
|
json.put("devicerecord_code", devicerecord_code);
|
||||||
|
json.put("is_delete", "0");
|
||||||
|
json.put("create_id", currentUserId);
|
||||||
|
json.put("create_name", nickName);
|
||||||
|
json.put("create_time", now);
|
||||||
|
mstTab.insert(json);
|
||||||
|
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jo.put("devicerecord_id", devicerecord_id);
|
||||||
|
jo.put("changetype", "00");
|
||||||
|
jo.put("change_reason", "生成");
|
||||||
|
jo.put("change_id", currentUserId);
|
||||||
|
jo.put("change_name", nickName);
|
||||||
|
jo.put("change_time", now);
|
||||||
|
jo.put("create_id", currentUserId);
|
||||||
|
jo.put("create_name", nickName);
|
||||||
|
jo.put("create_time", now);
|
||||||
|
EM_BI_DeviceLifeCycle.insert(jo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(JSONObject whereJson) {
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
||||||
|
Long deptId = currentUser.getDeptId();
|
||||||
|
|
||||||
|
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
||||||
|
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
|
||||||
|
whereJson.put("update_optid", currentUserId);
|
||||||
|
whereJson.put("update_optname", nickName);
|
||||||
|
whereJson.put("update_time", now);
|
||||||
|
mstTab.update(whereJson);
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jo.put("devicerecord_id", whereJson.getString("devicerecord_id"));
|
||||||
|
jo.put("changetype", "00");
|
||||||
|
jo.put("change_reason", "生成");
|
||||||
|
jo.put("change_id", currentUserId);
|
||||||
|
jo.put("change_name", nickName);
|
||||||
|
jo.put("change_time", now);
|
||||||
|
jo.put("create_id", currentUserId);
|
||||||
|
jo.put("create_name", nickName);
|
||||||
|
jo.put("create_time", now);
|
||||||
|
EM_BI_DeviceLifeCycle.insert(jo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteAll(Long[] ids) {
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("EM_BI_EquipmentFile");
|
||||||
|
for (Long devicerecord_id : ids) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("devicerecord_id", String.valueOf(devicerecord_id));
|
||||||
|
param.put("is_delete", "1");
|
||||||
|
param.put("update_optid", currentUserId);
|
||||||
|
param.put("update_optname", nickName);
|
||||||
|
param.put("update_time", now);
|
||||||
|
wo.update(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void submit(JSONObject json) {
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
||||||
|
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
|
||||||
|
String status = json.getString("status");
|
||||||
|
JSONArray ja = json.getJSONArray("rows");
|
||||||
|
for (int i = 0; i < ja.size(); i++) {
|
||||||
|
JSONObject jo = ja.getJSONObject(i);
|
||||||
|
JSONObject jsonMst = mstTab.query("devicerecord_id ='" + jo.getString("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||||
|
if (jsonMst == null) {
|
||||||
|
throw new BadRequestException(jo.getString("devicerecord_code") + "当前记录状态异常,操作失败!");
|
||||||
|
}
|
||||||
|
String nowStatus = jsonMst.getString("status");
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
if ("10".equals(status)) {//启用
|
||||||
|
if (StrUtil.isEmpty(jsonMst.getString("device_bom_id"))) {
|
||||||
|
throw new BadRequestException("设备BOM不能为空!");
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(jsonMst.getString("use_deptid"))) {
|
||||||
|
throw new BadRequestException("使用部门不能为空!");
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(jsonMst.getString("use_groupid"))) {
|
||||||
|
throw new BadRequestException("使用班组不能为空!");
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(jsonMst.getString("user_name"))) {
|
||||||
|
throw new BadRequestException("使用人不能为空!");
|
||||||
|
}
|
||||||
|
map.put("status", "10");
|
||||||
|
|
||||||
|
JSONObject jo2 = new JSONObject();
|
||||||
|
jo2.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jo2.put("devicerecord_id", jsonMst.getString("devicerecord_id"));
|
||||||
|
jo2.put("changetype", "10");
|
||||||
|
jo2.put("change_reason", "启用");
|
||||||
|
jo2.put("change_id", currentUserId);
|
||||||
|
jo2.put("change_name", nickName);
|
||||||
|
jo2.put("change_time", now);
|
||||||
|
jo2.put("create_id", currentUserId);
|
||||||
|
jo2.put("create_name", nickName);
|
||||||
|
jo2.put("create_time", now);
|
||||||
|
EM_BI_DeviceLifeCycle.insert(jo);
|
||||||
|
} else if ("11".equals(status)) {//禁用
|
||||||
|
map.put("status", "11");
|
||||||
|
|
||||||
|
JSONObject jo2 = new JSONObject();
|
||||||
|
jo2.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jo2.put("devicerecord_id", jsonMst.getString("devicerecord_id"));
|
||||||
|
jo2.put("changetype", "11");
|
||||||
|
jo2.put("change_reason", "停用");
|
||||||
|
jo2.put("change_id", currentUserId);
|
||||||
|
jo2.put("change_name", nickName);
|
||||||
|
jo2.put("change_time", now);
|
||||||
|
jo2.put("create_id", currentUserId);
|
||||||
|
jo2.put("create_name", nickName);
|
||||||
|
jo2.put("create_time", now);
|
||||||
|
EM_BI_DeviceLifeCycle.insert(jo);
|
||||||
|
}
|
||||||
|
map.put("update_optid", currentUserId + "");
|
||||||
|
map.put("update_optname", nickName);
|
||||||
|
map.put("update_time", now);
|
||||||
|
mstTab.update(map, "workorder_id ='" + jo.getString("workorder_id") + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray queryAll1(Map whereJson) {
|
||||||
|
String devicerecord_id = (String) whereJson.get("devicerecord_id");
|
||||||
|
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
|
||||||
|
JSONArray ja = EM_BI_DeviceLifeCycle.query("devicerecord_id='"+devicerecord_id+"'").getResultJSONArray(0);
|
||||||
|
return ja;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray queryAll2(Map whereJson) {
|
||||||
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
|
map.put("flag", "2");
|
||||||
|
String devicerecord_id = map.get("devicerecord_id");
|
||||||
|
if (StrUtil.isEmpty(devicerecord_id)) {
|
||||||
|
return new JSONArray();
|
||||||
|
}
|
||||||
|
map.put("devicerecord_id", devicerecord_id);
|
||||||
|
JSONArray ja = WQL.getWO("QEM_EQUIPMENTFILE01")
|
||||||
|
.addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
return ja;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray queryAll3(Map whereJson) {
|
||||||
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
|
map.put("flag", "3");
|
||||||
|
String devicerecord_id = map.get("devicerecord_id");
|
||||||
|
if (StrUtil.isEmpty(devicerecord_id)) {
|
||||||
|
return new JSONArray();
|
||||||
|
}
|
||||||
|
map.put("devicerecord_id", devicerecord_id);
|
||||||
|
JSONArray ja = WQL.getWO("QEM_EQUIPMENTFILE01")
|
||||||
|
.addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
return ja;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray queryBomList(Map whereJson) {
|
||||||
|
WQLObject EM_BI_DeviceBOM = WQLObject.getWQLObject("EM_BI_DeviceBOM"); // 工艺路线主表
|
||||||
|
JSONArray ja = EM_BI_DeviceBOM.query("is_delete='0' and is_used='1'").getResultJSONArray(0);
|
||||||
|
return ja;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
[交易说明]
|
||||||
|
交易名: 工艺路线分页查询
|
||||||
|
所属模块:
|
||||||
|
功能简述:
|
||||||
|
版权所有:
|
||||||
|
表引用:
|
||||||
|
版本经历:
|
||||||
|
|
||||||
|
[数据库]
|
||||||
|
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||||
|
|
||||||
|
[IO定义]
|
||||||
|
#################################################
|
||||||
|
## 表字段对应输入参数
|
||||||
|
#################################################
|
||||||
|
输入.flag TYPEAS s_string
|
||||||
|
输入.use_deptid TYPEAS s_string
|
||||||
|
输入.material_type_id TYPEAS s_string
|
||||||
|
输入.device_code TYPEAS s_string
|
||||||
|
输入.status TYPEAS s_string
|
||||||
|
输入.end_time TYPEAS s_string
|
||||||
|
输入.begin_time TYPEAS s_string
|
||||||
|
输入.manufacturer TYPEAS s_string
|
||||||
|
输入.device_type TYPEAS s_string
|
||||||
|
输入.workprocedure_id TYPEAS s_string
|
||||||
|
输入.is_produceuse TYPEAS s_string
|
||||||
|
输入.devicerecord_id TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
|
[临时表]
|
||||||
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
|
[临时变量]
|
||||||
|
--所有中间过程变量均可在此处定义
|
||||||
|
|
||||||
|
[业务过程]
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 1、输入输出检查 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 2、主过程前处理 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 3、业务主过程 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
IF 输入.flag = "1"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
equipmentfile.*,
|
||||||
|
classstandard.class_name AS material_type_name,
|
||||||
|
dept1.name AS use_deptname,
|
||||||
|
dept2.name AS belong_deptname
|
||||||
|
FROM
|
||||||
|
em_bi_equipmentfile equipmentfile
|
||||||
|
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = equipmentfile.material_type_id
|
||||||
|
LEFT JOIN sys_dept dept1 ON dept1.dept_id = equipmentfile.use_deptid
|
||||||
|
LEFT JOIN sys_dept dept2 ON dept2.dept_id = equipmentfile.belong_deptid
|
||||||
|
WHERE
|
||||||
|
equipmentfile.is_delete = '0'
|
||||||
|
OPTION 输入.is_produceuse <> ""
|
||||||
|
equipmentfile.is_produceuse = 输入.is_produceuse
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.status <> ""
|
||||||
|
equipmentfile.status = 输入.status
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.use_deptid <> ""
|
||||||
|
equipmentfile.use_deptid = 输入.use_deptid
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.device_type <> ""
|
||||||
|
equipmentfile.device_type = 输入.device_type
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.material_type_id <> ""
|
||||||
|
equipmentfile.material_type_id = 输入.material_type_id
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.device_code <> ""
|
||||||
|
(equipmentfile.device_code like 输入.device_code or equipmentfile.device_name like 输入.device_code)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.manufacturer <> ""
|
||||||
|
equipmentfile.manufacturer like 输入.manufacturer
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
equipmentfile.beginuse_date >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
equipmentfile.beginuse_date <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "2"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
bomdtl.*,
|
||||||
|
materialbase.material_code,
|
||||||
|
materialbase.material_name,
|
||||||
|
classstandard.class_code,
|
||||||
|
classstandard.class_name
|
||||||
|
FROM
|
||||||
|
EM_BI_EquipmentSpareBOM bomdtl
|
||||||
|
left join md_me_materialbase materialbase on materialbase.material_id = bomdtl.material_id
|
||||||
|
left join md_pb_classstandard classstandard on materialbase.material_type_id = classstandard.class_id
|
||||||
|
OPTION 输入.devicerecord_id <> ""
|
||||||
|
bomdtl.devicerecord_id = 输入.devicerecord_id
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "3"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
local_storage.*
|
||||||
|
FROM
|
||||||
|
tool_local_storage local_storage
|
||||||
|
where local_storage.is_delete = '0'
|
||||||
|
OPTION 输入.devicerecord_id <> ""
|
||||||
|
local_storage.source_bill_id = 输入.devicerecord_id
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
66
mes/qd/src/api/wms/basedata/em/equipmentfile.js
Normal file
66
mes/qd/src/api/wms/basedata/em/equipmentfile.js
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function submit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile/submit',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryivt1(params) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile/queryivt1',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryivt2(params) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile/queryivt2',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryivt3(params) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile/queryivt3',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryBomList(params) {
|
||||||
|
return request({
|
||||||
|
url: 'api/equipmentfile/queryBomList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, submit, queryivt1, queryivt2, queryivt3, queryBomList }
|
||||||
431
mes/qd/src/views/wms/basedata/em/equipmentfile/AddDialog.vue
Normal file
431
mes/qd/src/views/wms/basedata/em/equipmentfile/AddDialog.vue
Normal file
@@ -0,0 +1,431 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="设备档案编辑"
|
||||||
|
width="800px"
|
||||||
|
:before-close="crud.cancelCU"
|
||||||
|
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="105px" label-suffix=":">
|
||||||
|
<el-form-item label="设备档案编码" prop="devicerecord_code">
|
||||||
|
<label slot="label">设备档案编码:</label>
|
||||||
|
<el-input v-model="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="form.status"
|
||||||
|
placeholder="设备状态"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_status"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备编码" prop="device_code">
|
||||||
|
<label slot="label">设备编码:</label>
|
||||||
|
<el-input v-model="form.device_code" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备名称" prop="device_name">
|
||||||
|
<label slot="label">设备名称:</label>
|
||||||
|
<el-input v-model="form.device_name" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备规格" prop="device_spec">
|
||||||
|
<label slot="label">设备规格:</label>
|
||||||
|
<el-input v-model="form.device_spec" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备型号" prop="device_model">
|
||||||
|
<label slot="label">设备型号:</label>
|
||||||
|
<el-input v-model="form.device_model" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="制造商" prop="manufacturer">
|
||||||
|
<label slot="label">制造商:</label>
|
||||||
|
<el-input v-model="form.manufacturer" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="制造国别" prop="country_manufactur">
|
||||||
|
<label slot="label">制造国别:</label>
|
||||||
|
<el-input v-model="form.country_manufactur" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出厂编号" prop="leavefactory_number">
|
||||||
|
<label slot="label">出厂编号:</label>
|
||||||
|
<el-input v-model="form.leavefactory_number" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出厂日期" prop="leavefactory_date">
|
||||||
|
<label slot="label">出厂日期:</label>
|
||||||
|
<el-date-picker v-model="form.leavefactory_date" value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="图号" prop="drawing_number">
|
||||||
|
<label slot="label">图号:</label>
|
||||||
|
<el-input v-model="form.drawing_number" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商" prop="supplier_name">
|
||||||
|
<label slot="label">供应商:</label>
|
||||||
|
<el-input v-model="form.supplier_name" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备类别" prop="material_type_id">
|
||||||
|
<treeselect
|
||||||
|
v-model="form.material_type_id"
|
||||||
|
:options="classes"
|
||||||
|
:load-options="loadClass"
|
||||||
|
style="width: 210px;"
|
||||||
|
placeholder="设备类别"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产用途" prop="is_produceuse">
|
||||||
|
<el-select
|
||||||
|
v-model="form.is_produceuse"
|
||||||
|
placeholder="生产用途"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.is_produceuse"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用部门" prop="use_deptid">
|
||||||
|
<treeselect
|
||||||
|
v-model="form.use_deptid"
|
||||||
|
:options="depts"
|
||||||
|
:load-options="loadDepts"
|
||||||
|
style="width: 210px"
|
||||||
|
placeholder="使用部门"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用班组" prop="use_groupid">
|
||||||
|
<el-select
|
||||||
|
v-model="form.use_groupid"
|
||||||
|
placeholder="使用班组"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备属性" prop="device_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.device_type"
|
||||||
|
placeholder="设备属性"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="外部编码" prop="extend_code">
|
||||||
|
<label slot="label">外部编码:</label>
|
||||||
|
<el-input v-model="form.extend_code" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资产编码" prop="assets_code">
|
||||||
|
<label slot="label">资产编码:</label>
|
||||||
|
<el-input v-model="form.assets_code" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资产名称" prop="assets_name">
|
||||||
|
<label slot="label">资产名称:</label>
|
||||||
|
<el-input v-model="form.assets_name" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归属部门" prop="belong_deptid">
|
||||||
|
<treeselect
|
||||||
|
v-model="form.belong_deptid"
|
||||||
|
:options="depts"
|
||||||
|
:load-options="loadDepts"
|
||||||
|
style="width: 210px"
|
||||||
|
placeholder="选择部门"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启用日期" prop="beginuse_date">
|
||||||
|
<label slot="label">启用日期:</label>
|
||||||
|
<el-date-picker v-model="form.beginuse_date" value-format="yyyy-MM-dd" type="date" placeholder="启用日期" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工序" prop="workprocedure_id">
|
||||||
|
<el-select
|
||||||
|
v-model="form.workprocedure_id"
|
||||||
|
clearable
|
||||||
|
placeholder="工序"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workProcedureList"
|
||||||
|
:key="item.workprocedure_id"
|
||||||
|
:label="item.workprocedure_name"
|
||||||
|
:value="item.workprocedure_id"
|
||||||
|
/>
|
||||||
|
</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="设备BOM" prop="device_bom_id">
|
||||||
|
<el-select
|
||||||
|
v-model="form.device_bom_id"
|
||||||
|
placeholder="设备BOM"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in bomlist"
|
||||||
|
:key="item.device_bom_id"
|
||||||
|
:label="item.material_name"
|
||||||
|
:value="item.device_bom_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="卡片编号" prop="card_code">
|
||||||
|
<label slot="label">卡片编号:</label>
|
||||||
|
<el-input v-model="form.card_code" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装地点" prop="setting_place">
|
||||||
|
<label slot="label">安装地点:</label>
|
||||||
|
<el-input v-model="form.setting_place" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用人" prop="user_name">
|
||||||
|
<label slot="label">使用人:</label>
|
||||||
|
<el-input v-model="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="remark">
|
||||||
|
<label slot="label">备 注:</label>
|
||||||
|
<el-input v-model="form.remark" style="width: 480px;" rows="3" type="textarea" :disabled="crud.status.view > 0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button slot="left" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||||
|
<el-button slot="left" type="primary" :loading="crud.cu === 2" @click="crud.submitCU">保存</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud, form } from '@crud/crud'
|
||||||
|
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
||||||
|
import crudClassstandard from "@/api/wms/basedata/master/classstandard";
|
||||||
|
import crudMaterialbase from "@/api/wms/basedata/master/materialbase";
|
||||||
|
import equipmentfile from "@/api/wms/basedata/em/equipmentfile";
|
||||||
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
import {getDepts} from "@/api/system/dept";
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
devicerecord_id: '',
|
||||||
|
devicerecord_code: '',
|
||||||
|
status: '00',
|
||||||
|
device_code: '',
|
||||||
|
device_name: '',
|
||||||
|
device_model: '',
|
||||||
|
device_spec: '',
|
||||||
|
device_type: '',
|
||||||
|
manufacturer: '',
|
||||||
|
country_manufactur: '',
|
||||||
|
leavefactory_date: new Date().format('yyyy-MM-dd'),
|
||||||
|
leavefactory_number: '',
|
||||||
|
drawing_number: '',
|
||||||
|
supplier_name: '',
|
||||||
|
supplier_id: '',
|
||||||
|
supplier_code: '',
|
||||||
|
is_produceuse: '1',
|
||||||
|
use_groupid: '',
|
||||||
|
user_id: '',
|
||||||
|
user_code: '',
|
||||||
|
user_name: '',
|
||||||
|
extend_code: '',
|
||||||
|
card_code: '',
|
||||||
|
assets_id: '',
|
||||||
|
assets_code: '',
|
||||||
|
assets_name: '',
|
||||||
|
beginuse_date: new Date().format('yyyy-MM-dd'),
|
||||||
|
workprocedure_id: '',
|
||||||
|
setting_place: '',
|
||||||
|
device_bom_id: '',
|
||||||
|
theory_beat: '',
|
||||||
|
oraginal_value: '',
|
||||||
|
net_amount: '',
|
||||||
|
remark: ''
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'AddDialog',
|
||||||
|
components: { Treeselect },
|
||||||
|
mixins: [crud(), form(defaultForm)],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['device_type', 'workorder_type', 'is_produceuse', 'device_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
dtlShow: false,
|
||||||
|
workProcedureList: [],
|
||||||
|
classes: [],
|
||||||
|
depts: [],
|
||||||
|
bomlist: [],
|
||||||
|
class_idStr: null,
|
||||||
|
materShow: false,
|
||||||
|
rules: {
|
||||||
|
device_type: [
|
||||||
|
{ required: true, message: '设备属性不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
device_name: [
|
||||||
|
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
device_code: [
|
||||||
|
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
material_type_id: [
|
||||||
|
{ required: true, message: '设备类别不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
is_produceuse: [
|
||||||
|
{ required: true, message: '生产用途不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudWorkProcedure.downSelect().then(res => {
|
||||||
|
this.workProcedureList = res
|
||||||
|
})
|
||||||
|
|
||||||
|
equipmentfile.queryBomList().then(res => {
|
||||||
|
this.bomlist = res
|
||||||
|
})
|
||||||
|
const param = {
|
||||||
|
'materOpt_code': '23'
|
||||||
|
}
|
||||||
|
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||||
|
this.class_idStr = res.class_idStr
|
||||||
|
this.queryClassId()
|
||||||
|
})
|
||||||
|
this.getDepts()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
close() {
|
||||||
|
this.$emit('AddChanged')
|
||||||
|
},
|
||||||
|
createPcsn() {
|
||||||
|
if (this.form.material_code === '') {
|
||||||
|
this.crud.notify('请选择产品!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.form.org_id === '') {
|
||||||
|
this.crud.notify('请选择所属组织!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
},
|
||||||
|
queryClassId() {
|
||||||
|
const param = {
|
||||||
|
'class_idStr': this.class_idStr
|
||||||
|
}
|
||||||
|
crudClassstandard.queryClassById(param).then(res => {
|
||||||
|
this.classes = res.content.map(obj => {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadClass({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取弹窗内部门数据
|
||||||
|
loadDepts({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 200)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDepts() {
|
||||||
|
getDepts({ enabled: true }).then(res => {
|
||||||
|
this.depts = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
291
mes/qd/src/views/wms/basedata/em/equipmentfile/ChangeDialog.vue
Normal file
291
mes/qd/src/views/wms/basedata/em/equipmentfile/ChangeDialog.vue
Normal file
@@ -0,0 +1,291 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="设备档案维护"
|
||||||
|
width="1100px"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<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-form-item label="设备档案编码" prop="devicerecord_code">
|
||||||
|
<label slot="label">设备档案编码:</label>
|
||||||
|
<el-input v-model="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备编码" prop="device_code">
|
||||||
|
<label slot="label">设备编码:</label>
|
||||||
|
<el-input v-model="form.device_code" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备名称" prop="device_name">
|
||||||
|
<label slot="label">设备名称:</label>
|
||||||
|
<el-input v-model="form.device_name" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用班组" prop="use_groupid">
|
||||||
|
<el-select
|
||||||
|
v-model="form.use_groupid"
|
||||||
|
placeholder="使用班组"
|
||||||
|
disabled
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归属部门" prop="belong_deptname">
|
||||||
|
<label slot="label">归属部门:</label>
|
||||||
|
<el-input v-model="form.belong_deptname" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-tabs type="card">
|
||||||
|
<el-tab-pane label="备品备件" name="first">
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table2"
|
||||||
|
:data="tableDtl2"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="400"
|
||||||
|
size="mini"
|
||||||
|
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 min-width="150" prop="sparepart_only_id" label="备件编码" align="center"/>
|
||||||
|
<el-table-column prop="sparepart_only_id" label="备件名称" align="center" width="120px" />
|
||||||
|
<el-table-column min-width="120" prop="material_code" label="物料编码" align="center" />
|
||||||
|
<el-table-column min-width="80" prop="material_name" label="物料名称" align="center" />
|
||||||
|
<el-table-column min-width="80" prop="class_code" label="分类编码" align="center" />
|
||||||
|
<el-table-column min-width="120" prop="class_name" label="分类名称" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="文档管理" name="second">
|
||||||
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload2">新增文档</el-button>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table3"
|
||||||
|
:data="tableDtl3"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="400"
|
||||||
|
size="mini"
|
||||||
|
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 min-width="80" prop="storage_id" label="文档编号" align="center"/>
|
||||||
|
<el-table-column prop="name" label="文档名称" align="center" width="200" />
|
||||||
|
<el-table-column min-width="200" prop="path" label="文档路径" align="center" />
|
||||||
|
<el-table-column min-width="100" prop="remark" label="备注" align="center" />
|
||||||
|
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="变更情况" name="third">
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="tableDtl"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="400"
|
||||||
|
size="mini"
|
||||||
|
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 min-width="150" prop="create_time" label="变更时间" align="center"/>
|
||||||
|
<el-table-column prop="changetype" label="变更类型编码" align="center" width="120px" />
|
||||||
|
<el-table-column prop="changetype" label="变更类型名称" align="center" width="120px" :formatter="device_typeFormat" />
|
||||||
|
<el-table-column min-width="120" prop="change_reason" label="变更内容" align="center" />
|
||||||
|
<el-table-column min-width="80" prop="change_name" label="操作人" align="center" />
|
||||||
|
<el-table-column min-width="80" prop="invtype" label="源单类型" align="center" />
|
||||||
|
<el-table-column min-width="120" prop="invcode" label="源单号" align="center" />
|
||||||
|
<el-table-column min-width="120" prop="change_content" label="备注" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
|
<!-- 质保书上传弹出框-->
|
||||||
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="dialogVisible2"
|
||||||
|
width="30%"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
:headers="headers"
|
||||||
|
class="upload-demo"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag
|
||||||
|
:action="baseApi +'/api/equipmentfile/pictures/'+this.form.devicerecord_id"
|
||||||
|
multiple
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:on-error="handleError"
|
||||||
|
:on-success="handleSuccess"
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload" />
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div slot="tip" class="el-upload__tip">只能上传不超过50MB的文件!</div>
|
||||||
|
</el-upload>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="info" @click="dialogVisible2 = false">取消</el-button>
|
||||||
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
||||||
|
import localStorage from "@/api/tools/localStorage";
|
||||||
|
import equipmentfile, {queryivt1} from "@/api/wms/basedata/em/equipmentfile";
|
||||||
|
import {getToken} from "@/utils/auth";
|
||||||
|
import {mapGetters} from "vuex";
|
||||||
|
import CRUD, { crud } from '@crud/crud'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ChangeDialog',
|
||||||
|
components: { },
|
||||||
|
mixins: [crud()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
rowmst: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['device_type', 'workorder_type', 'changetype', 'is_produceuse', 'device_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogVisible2: false,
|
||||||
|
workProcedureList: [],
|
||||||
|
headers: { 'Authorization': getToken() },
|
||||||
|
tableDtl: [],
|
||||||
|
tableDtl2: [],
|
||||||
|
tableDtl3: [],
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rowmst: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.form = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
'baseApi',
|
||||||
|
'fileUploadApi'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudWorkProcedure.downSelect().then(res => {
|
||||||
|
this.workProcedureList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
close() {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.form = {}
|
||||||
|
this.$emit('AddChanged')
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
equipmentfile.queryivt1(this.form).then(res => {
|
||||||
|
this.tableDtl = res
|
||||||
|
})
|
||||||
|
|
||||||
|
equipmentfile.queryivt2(this.form).then(res => {
|
||||||
|
this.tableDtl2 = res
|
||||||
|
})
|
||||||
|
equipmentfile.queryivt3(this.form).then(res => {
|
||||||
|
this.tableDtl3 = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.dialogVisible2 = false
|
||||||
|
},
|
||||||
|
handleExceed(files, fileList) {
|
||||||
|
this.crud.notify('当前限制最多能选择 1 个文件', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||||
|
},
|
||||||
|
handleSuccess(files, fileList) {
|
||||||
|
this.crud.notify('上传成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
this.dialogVisible2 = false
|
||||||
|
equipmentfile.queryivt3(this.form).then(res => {
|
||||||
|
this.tableDtl3 = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitUpload() {
|
||||||
|
debugger
|
||||||
|
const flag = this.$refs.upload.submit()
|
||||||
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
let isLt2M = true
|
||||||
|
isLt2M = file.size / 1024 / 1024 < 50
|
||||||
|
if (!isLt2M) {
|
||||||
|
//this.loading = false
|
||||||
|
this.$message.error('上传文件大小不能超过 50MB!')
|
||||||
|
}
|
||||||
|
return isLt2M
|
||||||
|
},
|
||||||
|
// 监听上传失败
|
||||||
|
handleError(e, file, fileList) {
|
||||||
|
const msg = JSON.parse(e.message)
|
||||||
|
this.$notify({
|
||||||
|
title: msg.message,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2500
|
||||||
|
})
|
||||||
|
//this.loading = false
|
||||||
|
},
|
||||||
|
submitUpload2() {
|
||||||
|
this.dialogVisible2 = true
|
||||||
|
},
|
||||||
|
deleteRow(index, row) {
|
||||||
|
localStorage.del([row.storage_id])
|
||||||
|
equipmentfile.queryivt3(this.form).then(res => {
|
||||||
|
this.tableDtl3 = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
device_typeFormat(row) {
|
||||||
|
return this.dict.label.changetype[row.changetype]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 0 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.crud-opts2 .crud-opts-right2 {
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 4px 4px;
|
||||||
|
}
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
298
mes/qd/src/views/wms/basedata/em/equipmentfile/ViewDialog.vue
Normal file
298
mes/qd/src/views/wms/basedata/em/equipmentfile/ViewDialog.vue
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="设备档案详情"
|
||||||
|
width="1100px"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<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-form-item label="设备档案编码" prop="devicerecord_code">
|
||||||
|
<label slot="label">设备档案编码:</label>
|
||||||
|
<el-input v-model="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="form.status"
|
||||||
|
placeholder="设备状态"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_status"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备编码" prop="device_code">
|
||||||
|
<label slot="label">设备编码:</label>
|
||||||
|
<el-input v-model="form.device_code" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备名称" prop="device_name">
|
||||||
|
<label slot="label">设备名称:</label>
|
||||||
|
<el-input v-model="form.device_name" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备规格" prop="device_spec">
|
||||||
|
<label slot="label">设备规格:</label>
|
||||||
|
<el-input v-model="form.device_spec" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备型号" prop="device_model">
|
||||||
|
<label slot="label">设备型号:</label>
|
||||||
|
<el-input v-model="form.device_model" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="制造商" prop="manufacturer">
|
||||||
|
<label slot="label">制造商:</label>
|
||||||
|
<el-input v-model="form.manufacturer" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="制造国别" prop="country_manufactur">
|
||||||
|
<label slot="label">制造国别:</label>
|
||||||
|
<el-input v-model="form.country_manufactur" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出厂编号" prop="leavefactory_number">
|
||||||
|
<label slot="label">出厂编号:</label>
|
||||||
|
<el-input v-model="form.leavefactory_number" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出厂日期" prop="leavefactory_date">
|
||||||
|
<label slot="label">出厂日期:</label>
|
||||||
|
<el-date-picker v-model="form.leavefactory_date" disabled value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="图号" prop="drawing_number">
|
||||||
|
<label slot="label">图号:</label>
|
||||||
|
<el-input v-model="form.drawing_number" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商" prop="supplier_name">
|
||||||
|
<label slot="label">供应商:</label>
|
||||||
|
<el-input v-model="form.supplier_name" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备类别" prop="material_type_name">
|
||||||
|
<label slot="label">设备类别:</label>
|
||||||
|
<el-input v-model="form.material_type_name" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产用途" prop="is_produceuse">
|
||||||
|
<el-select
|
||||||
|
v-model="form.is_produceuse"
|
||||||
|
placeholder="生产用途"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.is_produceuse"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用部门" prop="use_deptname">
|
||||||
|
<label slot="label">使用部门:</label>
|
||||||
|
<el-input v-model="form.use_deptname" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用班组" prop="use_groupid">
|
||||||
|
<el-select
|
||||||
|
v-model="form.use_groupid"
|
||||||
|
placeholder="使用班组"
|
||||||
|
disabled
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备属性" prop="device_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.device_type"
|
||||||
|
placeholder="设备属性"
|
||||||
|
disabled
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="外部编码" prop="extend_code">
|
||||||
|
<label slot="label">外部编码:</label>
|
||||||
|
<el-input v-model="form.extend_code" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资产编码" prop="assets_code">
|
||||||
|
<label slot="label">资产编码:</label>
|
||||||
|
<el-input v-model="form.assets_code" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资产名称" prop="assets_name">
|
||||||
|
<label slot="label">资产名称:</label>
|
||||||
|
<el-input v-model="form.assets_name" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归属部门" prop="belong_deptname">
|
||||||
|
<label slot="label">归属部门:</label>
|
||||||
|
<el-input v-model="form.belong_deptname" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启用日期" prop="beginuse_date">
|
||||||
|
<label slot="label">启用日期:</label>
|
||||||
|
<el-date-picker v-model="form.beginuse_date" value-format="yyyy-MM-dd" type="date" placeholder="启用日期" style="width: 210px" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工序" prop="workprocedure_id">
|
||||||
|
<el-select
|
||||||
|
v-model="form.workprocedure_id"
|
||||||
|
placeholder="工序"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workProcedureList"
|
||||||
|
:key="item.workprocedure_id"
|
||||||
|
:label="item.workprocedure_name"
|
||||||
|
:value="item.workprocedure_id"
|
||||||
|
/>
|
||||||
|
</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="设备BOM" prop="device_bom_id">
|
||||||
|
<el-select
|
||||||
|
v-model="form.device_bom_id"
|
||||||
|
placeholder="设备BOM"
|
||||||
|
disabled
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.workorder_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="卡片编号" prop="card_code">
|
||||||
|
<label slot="label">卡片编号:</label>
|
||||||
|
<el-input v-model="form.card_code" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装地点" prop="setting_place">
|
||||||
|
<label slot="label">安装地点:</label>
|
||||||
|
<el-input v-model="form.setting_place" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用人" prop="user_name">
|
||||||
|
<label slot="label">使用人:</label>
|
||||||
|
<el-input v-model="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="remark">
|
||||||
|
<label slot="label">备 注:</label>
|
||||||
|
<el-input v-model="form.remark" style="width: 480px;" rows="3" type="textarea" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ViewDialog',
|
||||||
|
components: { },
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
rowmst: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['device_type', 'workorder_type', 'is_produceuse', 'device_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
workProcedureList: [],
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rowmst: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.form = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudWorkProcedure.downSelect().then(res => {
|
||||||
|
this.workProcedureList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
close() {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.form = {}
|
||||||
|
this.$emit('AddChanged')
|
||||||
|
},
|
||||||
|
storChange() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 0 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.crud-opts2 .crud-opts-right2 {
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 4px 4px;
|
||||||
|
}
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
494
mes/qd/src/views/wms/basedata/em/equipmentfile/index.vue
Normal file
494
mes/qd/src/views/wms/basedata/em/equipmentfile/index.vue
Normal file
@@ -0,0 +1,494 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="使用部门">
|
||||||
|
<treeselect
|
||||||
|
v-model="query.use_deptid"
|
||||||
|
:options="depts"
|
||||||
|
:load-options="loadDepts"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
placeholder="选择部门"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备类别">
|
||||||
|
<treeselect
|
||||||
|
v-model="query.material_type_id"
|
||||||
|
:options="classes"
|
||||||
|
clearable
|
||||||
|
:load-options="loadClass"
|
||||||
|
style="width: 200px"
|
||||||
|
placeholder="设备类别"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备属性">
|
||||||
|
<el-select
|
||||||
|
v-model="query.device_type"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
placeholder="设备属性"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备编码">
|
||||||
|
<el-input
|
||||||
|
v-model="query.device_code"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
placeholder="设备编码或名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产厂家">
|
||||||
|
<el-input
|
||||||
|
v-model="query.manufacturer"
|
||||||
|
style="width: 200px"
|
||||||
|
clearable
|
||||||
|
placeholder="生产厂家"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启用日期">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.beginuse_date"
|
||||||
|
type="daterange"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属工序">
|
||||||
|
<el-select
|
||||||
|
v-model="query.workprocedure_id"
|
||||||
|
clearable
|
||||||
|
placeholder="所属工序"
|
||||||
|
style="width: 200px"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workProcedureList"
|
||||||
|
:key="item.workprocedure_id"
|
||||||
|
:label="item.workprocedure_name"
|
||||||
|
:value="item.workprocedure_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
placeholder="设备状态"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.device_status"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产用途">
|
||||||
|
<el-select
|
||||||
|
v-model="query.is_produceuse"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
placeholder="生产用途"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.is_produceuse"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-position"
|
||||||
|
size="mini"
|
||||||
|
:disabled="sub_flag"
|
||||||
|
@click="submit('10')"
|
||||||
|
>
|
||||||
|
启用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
:disabled="dissub_flag"
|
||||||
|
icon="el-icon-position"
|
||||||
|
size="mini"
|
||||||
|
@click="submit('11')"
|
||||||
|
>
|
||||||
|
停用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="warning"
|
||||||
|
:disabled="open_flag"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
@click="openWork"
|
||||||
|
>
|
||||||
|
档案维护
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
@click="printCard"
|
||||||
|
>
|
||||||
|
打印
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
size="mini"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
:highlight-current-row="true"
|
||||||
|
@selection-change="mySelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
v-permission="['admin','equipmentfile:del','equipmentfile:edit']"
|
||||||
|
min-width="130"
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
:disabled-edit="canUd(scope.row)"
|
||||||
|
:disabled-dle="canUd(scope.row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||||
|
<el-table-column prop="设备代码" width="130" label="设备代码">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.device_code }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="device_name" min-width="130" label="设备名称"/>
|
||||||
|
<el-table-column prop="extend_code" min-width="130" label="外部编码"/>
|
||||||
|
<el-table-column prop="device_model" min-width="130" label="设备型号"/>
|
||||||
|
<el-table-column prop="device_spec" min-width="130" label="设备规格"/>
|
||||||
|
<el-table-column prop="material_type_name" min-width="80" label="设备类别" />
|
||||||
|
<el-table-column :formatter="is_produceuseFormat" min-width="100" prop="is_produceuse" label="生产用途" />
|
||||||
|
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="设备状态" />
|
||||||
|
<el-table-column prop="beginuse_date" min-width="130" label="启用日期"/>
|
||||||
|
<el-table-column prop="use_deptname" min-width="130" label="使用部门"/>
|
||||||
|
<el-table-column prop="use_groupid" min-width="130" label="使用班组"/>
|
||||||
|
<el-table-column prop="supplier_name" min-width="130" label="供应商"/>
|
||||||
|
<el-table-column prop="manufacturer" min-width="130" label="制造商"/>
|
||||||
|
<el-table-column prop="country_manufactur" min-width="130" label="制造国别"/>
|
||||||
|
<el-table-column prop="leavefactory_date" min-width="130" label="出厂日期"/>
|
||||||
|
<el-table-column prop="leavefactory_number" min-width="130" label="出厂编号"/>
|
||||||
|
<el-table-column prop="drawing_number" min-width="130" label="图号"/>
|
||||||
|
<el-table-column prop="device_type" min-width="130" label="设备属性" :formatter="device_typeFormat"/>
|
||||||
|
<el-table-column prop="workprocedure_id" min-width="130" label="工序" :formatter="seriesFormat2" />
|
||||||
|
<el-table-column prop="assets_code" min-width="130" label="资产编码"/>
|
||||||
|
<el-table-column prop="assets_name" min-width="130" label="资产名称"/>
|
||||||
|
<el-table-column prop="create_name" min-width="130" label="生成人"/>
|
||||||
|
<el-table-column prop="create_time" min-width="150" label="生成时间"/>
|
||||||
|
<el-table-column prop="update_optname" min-width="130" label="修改人"/>
|
||||||
|
<el-table-column prop="update_time" min-width="150" label="修改时间"/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<AddDialog @AddChanged="querytable" />
|
||||||
|
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||||
|
<ChangeDialog :dialog-show.sync="changeShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import equipmentfile from '@/api/wms/basedata/em/equipmentfile'
|
||||||
|
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import AddDialog from '@/views/wms/basedata/em/equipmentfile/AddDialog'
|
||||||
|
import ViewDialog from '@/views/wms/basedata/em/equipmentfile/ViewDialog'
|
||||||
|
import ChangeDialog from '@/views/wms/basedata/em/equipmentfile/ChangeDialog'
|
||||||
|
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
|
||||||
|
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
||||||
|
import Date from "@/utils/datetime";
|
||||||
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
import {getDepts} from "@/api/system/dept";
|
||||||
|
import crudClassstandard from "@/api/wms/basedata/master/classstandard";
|
||||||
|
import crudMaterialbase from "@/api/wms/basedata/master/materialbase";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'equipmentfile',
|
||||||
|
components: { Treeselect, ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '设备档案', idField: 'devicerecord_id', url: 'api/equipmentfile', crudMethod: { ...equipmentfile },
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
reset: true,
|
||||||
|
download: false
|
||||||
|
}})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
// 数据字典
|
||||||
|
dicts: ['workorder_status', 'workorder_type', 'product_series', 'device_type', 'is_produceuse', 'device_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'workorder:add'],
|
||||||
|
edit: ['admin', 'workorder:edit'],
|
||||||
|
del: ['admin', 'workorder:del']
|
||||||
|
},
|
||||||
|
divShow: false,
|
||||||
|
sub_flag: true,
|
||||||
|
dissub_flag: true,
|
||||||
|
open_flag: true,
|
||||||
|
class_idStr: null,
|
||||||
|
mstrow: {},
|
||||||
|
XLList: [],
|
||||||
|
depts: [],
|
||||||
|
classes: [],
|
||||||
|
workProcedureList: [],
|
||||||
|
viewShow: false,
|
||||||
|
changeShow: false,
|
||||||
|
currentRow: null,
|
||||||
|
checkrows: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
const that = this
|
||||||
|
window.onresize = function temp() {
|
||||||
|
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudWorkProcedure.downSelect().then(res => {
|
||||||
|
this.workProcedureList = res
|
||||||
|
})
|
||||||
|
this.crud.query.beginuse_date = [new Date(), new Date()]
|
||||||
|
this.crud.toQuery()
|
||||||
|
|
||||||
|
const param = {
|
||||||
|
'materOpt_code': '23'
|
||||||
|
}
|
||||||
|
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||||
|
this.class_idStr = res.class_idStr
|
||||||
|
this.queryClassId()
|
||||||
|
})
|
||||||
|
this.getDepts()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
canUd(row) {
|
||||||
|
return row.status !== '00'
|
||||||
|
},
|
||||||
|
seriesFormat2(row) {
|
||||||
|
for (const item of this.workProcedureList) {
|
||||||
|
if (item.workprocedure_id === row.workprocedure_id) {
|
||||||
|
return item.workprocedure_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
this.handleCurrentChange()
|
||||||
|
},
|
||||||
|
toView(index, row) {
|
||||||
|
this.mstrow = row
|
||||||
|
this.viewShow = true
|
||||||
|
},
|
||||||
|
queryClassId() {
|
||||||
|
const param = {
|
||||||
|
'class_idStr': this.class_idStr
|
||||||
|
}
|
||||||
|
crudClassstandard.queryClassById(param).then(res => {
|
||||||
|
this.classes = res.content.map(obj => {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadClass({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取弹窗内部门数据
|
||||||
|
loadDepts({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 200)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDepts() {
|
||||||
|
getDepts({ enabled: true }).then(res => {
|
||||||
|
this.depts = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mySelectionChange(rows) {
|
||||||
|
this.buttonChange(rows)
|
||||||
|
},
|
||||||
|
buttonChange(rows) {
|
||||||
|
if (rows.length !== 0) {
|
||||||
|
this.sub_flag = false
|
||||||
|
this.dissub_flag = false
|
||||||
|
this.open_flag = false
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
if (rows[i].is_active !== '10') {
|
||||||
|
this.sub_flag = true
|
||||||
|
}
|
||||||
|
if (rows[i].is_active !== '11') {
|
||||||
|
this.dissub_flag = true
|
||||||
|
}
|
||||||
|
if (rows.length !== 1) {
|
||||||
|
this.open_flag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.handleCurrentChange()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stateFormat(row) {
|
||||||
|
return this.dict.label.device_status[row.status]
|
||||||
|
},
|
||||||
|
device_typeFormat(row) {
|
||||||
|
return this.dict.label.device_type[row.device_type]
|
||||||
|
},
|
||||||
|
is_produceuseFormat(row) {
|
||||||
|
return this.dict.label.is_produceuse[row.is_produceuse]
|
||||||
|
},
|
||||||
|
handleCurrentChange() {
|
||||||
|
this.checkrows = []
|
||||||
|
this.mstrow = {}
|
||||||
|
this.sub_flag = true
|
||||||
|
this.dissub_flag = true
|
||||||
|
this.open_flag = true
|
||||||
|
},
|
||||||
|
checkboxT(row) {
|
||||||
|
return row.status !== '99'
|
||||||
|
},
|
||||||
|
submit(status) {
|
||||||
|
this.checkrows = this.$refs.table.selection
|
||||||
|
if(this.checkrows.length === 0 ){
|
||||||
|
this.crud.notify('请勾选需要操作的记录!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
equipmentfile.submit({ 'status': status, rows: this.checkrows}).then(res => {
|
||||||
|
this.crud.notify('操作成功!')
|
||||||
|
this.querytable()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openWork(row) {
|
||||||
|
this.checkrows = this.$refs.table.selection
|
||||||
|
if(this.checkrows.length === 0 ){
|
||||||
|
this.crud.notify('请勾选一条需要操作的记录!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.mstrow = this.checkrows[0]
|
||||||
|
this.changeShow = true
|
||||||
|
},
|
||||||
|
querytable() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.handleCurrentChange()
|
||||||
|
},
|
||||||
|
printCard() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
if (_selectData.length > 1 || _selectData.length === 0) {
|
||||||
|
return this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}
|
||||||
|
const data = _selectData[0]
|
||||||
|
const time = data.create_time
|
||||||
|
const strTime = time.slice(0, 10)
|
||||||
|
const LODOP = getLodop()
|
||||||
|
|
||||||
|
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||||
|
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||||
|
LODOP.PRINT_INIT('')
|
||||||
|
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '')
|
||||||
|
LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1)
|
||||||
|
LODOP.SET_PRINT_STYLE('FontSize', 12)
|
||||||
|
LODOP.SET_PRINT_STYLE('Bold', 1)
|
||||||
|
LODOP.ADD_PRINT_BARCODE('8mm', '25mm', '38mm', '38mm', 'QRCode', data.workorder_id + '##' + data.ext_id + '##' + data.pcsn + '##' + data.workorder_qty + '##' + strTime)
|
||||||
|
LODOP.ADD_PRINT_TEXT('45mm', '16mm', '80mm', '15mm', '工令号:' + data.workorder_code + '')
|
||||||
|
LODOP.PRINT()// 打印
|
||||||
|
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user