rev:部门树修改
This commit is contained in:
@@ -25,6 +25,7 @@ import org.nl.wms.device_manage.repair.service.dto.DevicerepairmstDto;
|
|||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||||
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
||||||
|
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -48,6 +49,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
// private final StorattrService storattrService;
|
// private final StorattrService storattrService;
|
||||||
// private final SparePartOutServiceImpl sparePartOutService;
|
// private final SparePartOutServiceImpl sparePartOutService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStIvtBsrealstorattrService storattrService; // 仓库服务
|
private IStIvtBsrealstorattrService storattrService; // 仓库服务
|
||||||
|
|
||||||
@@ -1097,7 +1101,6 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> query5(Map whereJson, Pageable page) {
|
public Map<String, Object> query5(Map whereJson, Pageable page) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
|
|
||||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
String repair_code = MapUtil.getStr(whereJson, "repair_code");
|
String repair_code = MapUtil.getStr(whereJson, "repair_code");
|
||||||
@@ -1128,8 +1131,8 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
// 归属部门
|
// 归属部门
|
||||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||||
if (!StrUtil.isEmpty(dept_id)) {
|
if (!StrUtil.isEmpty(dept_id)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||||
return json;
|
return json;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.nl.modules.wql.util.WqlUtil;
|
|||||||
import org.nl.wms.device_manage.repair.service.DevicerepairrequestService;
|
import org.nl.wms.device_manage.repair.service.DevicerepairrequestService;
|
||||||
import org.nl.wms.device_manage.repair.service.dto.DevicerepairrequestDto;
|
import org.nl.wms.device_manage.repair.service.dto.DevicerepairrequestDto;
|
||||||
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
||||||
|
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.ISysUserService;
|
||||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -46,6 +47,9 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService iSysUserService;
|
private ISysUserService iSysUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
@@ -78,8 +82,6 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> query2(Map whereJson, Pageable page) {
|
public Map<String, Object> query2(Map whereJson, Pageable page) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
|
|
||||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
String request_code = MapUtil.getStr(whereJson, "request_code");
|
String request_code = MapUtil.getStr(whereJson, "request_code");
|
||||||
@@ -107,14 +109,14 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
|||||||
// 归属部门
|
// 归属部门
|
||||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||||
if (!StrUtil.isEmpty(dept_id)) {
|
if (!StrUtil.isEmpty(dept_id)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
// 归属部门
|
// 归属部门
|
||||||
String use_groupid = MapUtil.getStr(whereJson, "use_groupid");
|
String use_groupid = MapUtil.getStr(whereJson, "use_groupid");
|
||||||
if (!StrUtil.isEmpty(use_groupid)) {
|
if (!StrUtil.isEmpty(use_groupid)) {
|
||||||
// String use_groupidIds = deptService.getChildIdStr(Long.parseLong(use_groupid));
|
String use_groupidIds = deptService.getChildIdStr(Long.parseLong(use_groupid));
|
||||||
// map.put("use_groupid", use_groupidIds);
|
map.put("use_groupid", use_groupidIds);
|
||||||
}
|
}
|
||||||
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIRREQUEST_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.create_time DESC");
|
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIRREQUEST_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.create_time DESC");
|
||||||
return json;
|
return json;
|
||||||
@@ -151,8 +153,6 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(DevicerepairrequestDto dto) {
|
public void create(DevicerepairrequestDto dto) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
|
|
||||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile");
|
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile");
|
||||||
WQLObject userTab = WQLObject.getWQLObject("sys_user");
|
WQLObject userTab = WQLObject.getWQLObject("sys_user");
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import org.nl.modules.wql.util.WqlUtil;
|
|||||||
import org.nl.wms.device_manage.upkeep.service.DevicemaintenancemstService;
|
import org.nl.wms.device_manage.upkeep.service.DevicemaintenancemstService;
|
||||||
import org.nl.wms.device_manage.upkeep.service.dto.DevicemaintenancemstDto;
|
import org.nl.wms.device_manage.upkeep.service.dto.DevicemaintenancemstDto;
|
||||||
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
||||||
|
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -40,6 +42,9 @@ import java.util.Map;
|
|||||||
public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstService {
|
public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstService {
|
||||||
private final ClassstandardService classstandardService;
|
private final ClassstandardService classstandardService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
@@ -552,7 +557,6 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> query4(Map whereJson, Pageable page) {
|
public Map<String, Object> query4(Map whereJson, Pageable page) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
||||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
@@ -582,8 +586,8 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
// 归属部门
|
// 归属部门
|
||||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||||
if (!StrUtil.isEmpty(dept_id)) {
|
if (!StrUtil.isEmpty(dept_id)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||||
return json;
|
return json;
|
||||||
@@ -591,7 +595,6 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> query5(Map whereJson, Pageable page) {
|
public Map<String, Object> query5(Map whereJson, Pageable page) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
||||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
@@ -623,8 +626,8 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
// 归属部门
|
// 归属部门
|
||||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||||
if (!StrUtil.isEmpty(dept_id)) {
|
if (!StrUtil.isEmpty(dept_id)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "input_time DESC");
|
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "input_time DESC");
|
||||||
return json;
|
return json;
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import org.nl.modules.wql.util.WqlUtil;
|
|||||||
import org.nl.wms.device_manage.upkeep.service.DevicemaintenanceplanmstService;
|
import org.nl.wms.device_manage.upkeep.service.DevicemaintenanceplanmstService;
|
||||||
import org.nl.wms.device_manage.upkeep.service.dto.DevicemaintenanceplanmstDto;
|
import org.nl.wms.device_manage.upkeep.service.dto.DevicemaintenanceplanmstDto;
|
||||||
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
||||||
|
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -39,7 +41,9 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class DevicemaintenanceplanmstServiceImpl implements DevicemaintenanceplanmstService {
|
public class DevicemaintenanceplanmstServiceImpl implements DevicemaintenanceplanmstService {
|
||||||
private final ClassstandardService classstandardService;
|
private final ClassstandardService classstandardService;
|
||||||
// private final DeptService deptService;
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
@@ -247,7 +251,6 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Map<String, Object> queryDevice(Map whereJson, Pageable page) {
|
public Map<String, Object> queryDevice(Map whereJson, Pageable page) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
// 查询设备档案
|
// 查询设备档案
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
@@ -256,14 +259,14 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
|
|||||||
|
|
||||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||||
if (!StrUtil.isEmpty(dept_id)) {
|
if (!StrUtil.isEmpty(dept_id)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
String use_id = MapUtil.getStr(whereJson, "use_id");
|
String use_id = MapUtil.getStr(whereJson, "use_id");
|
||||||
if (!StrUtil.isEmpty(use_id)) {
|
if (!StrUtil.isEmpty(use_id)) {
|
||||||
// String useIds = deptService.getChildIdStr(Long.parseLong(use_id));
|
String useIds = deptService.getChildIdStr(Long.parseLong(use_id));
|
||||||
// map.put("useIds", useIds);
|
map.put("useIds", useIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCEPLAN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "file.update_time DESC");
|
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCEPLAN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "file.update_time DESC");
|
||||||
@@ -272,7 +275,6 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryDevice2(Map whereJson, Pageable page) {
|
public Map<String, Object> queryDevice2(Map whereJson, Pageable page) {
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
// 查询设备档案
|
// 查询设备档案
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
@@ -281,14 +283,14 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
|
|||||||
|
|
||||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||||
if (!StrUtil.isEmpty(dept_id)) {
|
if (!StrUtil.isEmpty(dept_id)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
String use_id = MapUtil.getStr(whereJson, "use_id");
|
String use_id = MapUtil.getStr(whereJson, "use_id");
|
||||||
if (!StrUtil.isEmpty(use_id)) {
|
if (!StrUtil.isEmpty(use_id)) {
|
||||||
// String useIds = deptService.getChildIdStr(Long.parseLong(use_id));
|
String useIds = deptService.getChildIdStr(Long.parseLong(use_id));
|
||||||
// map.put("useIds", useIds);
|
map.put("useIds", useIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果班组为空 则默认当前用户部门
|
// 如果班组为空 则默认当前用户部门
|
||||||
|
|||||||
@@ -15,10 +15,11 @@ import org.nl.modules.common.utils.FileUtil;
|
|||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
|
||||||
import org.nl.modules.wql.util.WqlUtil;
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
import org.nl.wms.masterdata_manage.em.service.EquipmentfileService;
|
import org.nl.wms.masterdata_manage.em.service.EquipmentfileService;
|
||||||
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
|
||||||
|
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -31,12 +32,15 @@ import java.util.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EquipmentfileServiceImpl implements EquipmentfileService {
|
public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||||
|
|
||||||
private final ClassstandardService classstandardService;
|
private final ClassstandardService classstandardService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
map.put("flag", "1");
|
map.put("flag", "1");
|
||||||
String device_code = map.get("device_code");
|
String device_code = map.get("device_code");
|
||||||
if (StrUtil.isNotEmpty(device_code)) {
|
if (StrUtil.isNotEmpty(device_code)) {
|
||||||
@@ -53,8 +57,8 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
|||||||
}
|
}
|
||||||
String use_deptid = map.get("use_deptid");
|
String use_deptid = map.get("use_deptid");
|
||||||
if (!StrUtil.isEmpty(use_deptid)) {
|
if (!StrUtil.isEmpty(use_deptid)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(use_deptid));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(use_deptid));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
String begin_time = map.get("begin_time");
|
String begin_time = map.get("begin_time");
|
||||||
if (StrUtil.isNotEmpty(begin_time)) {
|
if (StrUtil.isNotEmpty(begin_time)) {
|
||||||
@@ -71,7 +75,6 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
|||||||
@Override
|
@Override
|
||||||
public JSONArray query(Map whereJson) {
|
public JSONArray query(Map whereJson) {
|
||||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
// DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
|
||||||
map.put("flag", "11");
|
map.put("flag", "11");
|
||||||
String device_code = map.get("device_code");
|
String device_code = map.get("device_code");
|
||||||
if (StrUtil.isNotEmpty(device_code)) {
|
if (StrUtil.isNotEmpty(device_code)) {
|
||||||
@@ -88,8 +91,8 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
|||||||
}
|
}
|
||||||
String use_deptid = map.get("use_deptid");
|
String use_deptid = map.get("use_deptid");
|
||||||
if (!StrUtil.isEmpty(use_deptid)) {
|
if (!StrUtil.isEmpty(use_deptid)) {
|
||||||
// String deptIds = deptService.getChildIdStr(Long.parseLong(use_deptid));
|
String deptIds = deptService.getChildIdStr(Long.parseLong(use_deptid));
|
||||||
// map.put("deptIds", deptIds);
|
map.put("deptIds", deptIds);
|
||||||
}
|
}
|
||||||
String begin_time = map.get("begin_time");
|
String begin_time = map.get("begin_time");
|
||||||
if (StrUtil.isNotEmpty(begin_time)) {
|
if (StrUtil.isNotEmpty(begin_time)) {
|
||||||
@@ -108,8 +111,6 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
|||||||
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
|
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
// JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
|
||||||
// Long deptId = currentUser.getDeptId();
|
|
||||||
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
||||||
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
|
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
|
||||||
|
|
||||||
@@ -149,8 +150,6 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
|||||||
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
|
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
// JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
|
||||||
// Long deptId = currentUser.getDeptId();
|
|
||||||
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
|
||||||
String device_code = whereJson.getString("device_code");
|
String device_code = whereJson.getString("device_code");
|
||||||
String devicerecord_id = whereJson.getString("devicerecord_id");
|
String devicerecord_id = whereJson.getString("devicerecord_id");
|
||||||
|
|||||||
@@ -67,4 +67,20 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
|
|
||||||
void createDept(SysDept dept);
|
void createDept(SysDept dept);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前节点的所有子类节点集合数据
|
||||||
|
*
|
||||||
|
* @param dept_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Set<Long> getChildIdSet(Long dept_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前节点的所有子类节点集合串,用于拼接SQL(in)
|
||||||
|
*
|
||||||
|
* @param dept_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getChildIdStr(Long dept_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package org.nl.wms.system_manage.service.dept.impl;
|
package org.nl.wms.system_manage.service.dept.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.db.Db;
|
||||||
|
import cn.hutool.db.Entity;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -10,6 +13,7 @@ import org.nl.common.utils.CopyUtil;
|
|||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||||
import org.nl.wms.system_manage.service.dept.dao.SysDept;
|
import org.nl.wms.system_manage.service.dept.dao.SysDept;
|
||||||
import org.nl.wms.system_manage.service.dept.dao.mapper.SysDeptMapper;
|
import org.nl.wms.system_manage.service.dept.dao.mapper.SysDeptMapper;
|
||||||
@@ -22,6 +26,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -183,4 +189,44 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
sysDeptMapper.updateSubCount(dept.getPid());
|
sysDeptMapper.updateSubCount(dept.getPid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Long> getChildIdSet(Long pid) {
|
||||||
|
String sql = "select dept_id from (\n" +
|
||||||
|
" select t1.dept_id,\n" +
|
||||||
|
" if(find_in_set(pid, @pids) > 0, @pids := concat(@pids, ',', dept_id), 0) as ischild\n" +
|
||||||
|
" from (\n" +
|
||||||
|
" select dept_id,pid from sys_dept t where t.is_used = 1\n" +
|
||||||
|
" ) t1,\n" +
|
||||||
|
" (select @pids :=" + pid + ") t2\n" +
|
||||||
|
" ) t3 where ischild != 0";
|
||||||
|
Set<Long> set = new HashSet<>();
|
||||||
|
//添加本级
|
||||||
|
set.add(pid);
|
||||||
|
|
||||||
|
//添加子节点
|
||||||
|
try {
|
||||||
|
List<Entity> list = Db.use((DataSource) SpringContextHolder.getBean("dataSource")).query(sql);
|
||||||
|
list.forEach(item -> {
|
||||||
|
set.add(item.getLong("dept_id"));
|
||||||
|
});
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getChildIdStr(Long dept_id) {
|
||||||
|
Set<Long> set = this.getChildIdSet(dept_id);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
set.forEach(item -> {
|
||||||
|
sb.append(",'" + item + "'");
|
||||||
|
});
|
||||||
|
String str = sb.toString();
|
||||||
|
if (StrUtil.isNotEmpty(str)) {
|
||||||
|
str = "(" + str.substring(1) + ")";
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<label slot="label">设备档案编码:</label>
|
<label slot="label">设备档案编码:</label>
|
||||||
<el-input v-model.trim="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
|
<el-input v-model.trim="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="设备状态" prop="status">
|
<el-form-item label="设备状态" prop="status">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.status"
|
v-model="form.status"
|
||||||
placeholder="设备状态"
|
placeholder="设备状态"
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item label="设备编码" prop="device_code">
|
<el-form-item label="设备编码" prop="device_code">
|
||||||
<label slot="label">设备编码:</label>
|
<label slot="label">设备编码:</label>
|
||||||
<el-input v-model.trim="form.device_code" clearable style="width: 210px" />
|
<el-input v-model.trim="form.device_code" clearable style="width: 210px" />
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
@select="typeChange"
|
@select="typeChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="生产用途" prop="is_produceuse">
|
<el-form-item label="生产用途" prop="is_produceuse">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.is_produceuse"
|
v-model="form.is_produceuse"
|
||||||
placeholder="生产用途"
|
placeholder="生产用途"
|
||||||
@@ -92,26 +92,18 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item label="使用部门" prop="use_deptid">
|
<el-form-item label="使用部门" prop="use_deptid">
|
||||||
<treeselect
|
<treeselect
|
||||||
v-model="form.use_deptid"
|
v-model="form.use_deptid"
|
||||||
:options="depts"
|
:options="depts"
|
||||||
:load-options="loadDepts"
|
:load-options="loadDepts"
|
||||||
|
:normalizer="normalizer"
|
||||||
style="width: 210px"
|
style="width: 210px"
|
||||||
placeholder="使用部门"
|
placeholder="使用部门"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="使用班组" prop="use_groupid">
|
<el-form-item label="设备属性" prop="device_type">
|
||||||
<treeselect
|
|
||||||
v-model="form.use_groupid"
|
|
||||||
:options="depts"
|
|
||||||
:load-options="loadDepts"
|
|
||||||
style="width: 210px"
|
|
||||||
placeholder="使用班组"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="设备属性" prop="device_type">
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.device_type"
|
v-model="form.device_type"
|
||||||
placeholder="设备属性"
|
placeholder="设备属性"
|
||||||
@@ -125,8 +117,8 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
<!-- <el-form-item label="设备等级" prop="device_level">
|
<el-form-item label="设备等级" prop="device_level">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.device_level"
|
v-model="form.device_level"
|
||||||
placeholder="设备等级"
|
placeholder="设备等级"
|
||||||
@@ -140,7 +132,7 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item label="内部自编号" prop="extend_code">
|
<el-form-item label="内部自编号" prop="extend_code">
|
||||||
<label slot="label">内部自编号:</label>
|
<label slot="label">内部自编号:</label>
|
||||||
<el-input v-model.trim="form.extend_code" clearable style="width: 210px" />
|
<el-input v-model.trim="form.extend_code" clearable style="width: 210px" />
|
||||||
@@ -163,6 +155,7 @@
|
|||||||
:options="depts"
|
:options="depts"
|
||||||
:load-options="loadDepts"
|
:load-options="loadDepts"
|
||||||
style="width: 210px"
|
style="width: 210px"
|
||||||
|
:normalizer="normalizer"
|
||||||
placeholder="选择部门"
|
placeholder="选择部门"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -260,7 +253,7 @@ import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
|||||||
import equipmentfile from '@/views/wms/device_manage/deviceFile/equipmentfile/equipmentfile'
|
import equipmentfile from '@/views/wms/device_manage/deviceFile/equipmentfile/equipmentfile'
|
||||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
// import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
import crudDept from '@/views/system/dept/dept'
|
||||||
// import crudDevicebom from '@/api/wms/basedata/em/devicebom'
|
// import crudDevicebom from '@/api/wms/basedata/em/devicebom'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
@@ -313,7 +306,7 @@ export default {
|
|||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// dicts: ['device_type', 'is_produceuse', 'device_status', 'device_level'],
|
dicts: ['device_type', 'is_produceuse', 'device_status', 'device_level'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
@@ -360,6 +353,14 @@ export default {
|
|||||||
crudWorkProcedure.downSelect().then(res => {
|
crudWorkProcedure.downSelect().then(res => {
|
||||||
this.workProcedureList = res
|
this.workProcedureList = res
|
||||||
})
|
})
|
||||||
|
const param = {
|
||||||
|
'materOpt_code': '23'
|
||||||
|
}
|
||||||
|
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||||
|
this.class_idStr = res.class_idStr
|
||||||
|
this.queryClassId()
|
||||||
|
})
|
||||||
|
this.deptTree()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
@@ -395,23 +396,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSubTypes(id) {
|
|
||||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
|
||||||
const date = res.content
|
|
||||||
this.buildClass(date)
|
|
||||||
this.classes = date
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buildClass(classes) {
|
|
||||||
classes.forEach(data => {
|
|
||||||
if (data.children) {
|
|
||||||
this.buildClass(data.children)
|
|
||||||
}
|
|
||||||
if (data.hasChildren && !data.children) {
|
|
||||||
data.children = null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
queryClassId() {
|
queryClassId() {
|
||||||
const param = {
|
const param = {
|
||||||
'class_idStr': this.class_idStr
|
'class_idStr': this.class_idStr
|
||||||
@@ -440,56 +424,40 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSupDepts(deptId) {
|
|
||||||
var number = parseFloat(deptId)
|
// 获取部门
|
||||||
getDeptSuperior(number).then(res => {
|
|
||||||
const date = res.content
|
|
||||||
this.buildDepts(date)
|
|
||||||
this.depts = date
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buildDepts(depts) {
|
|
||||||
depts.forEach(data => {
|
|
||||||
if (data.children) {
|
|
||||||
this.buildDepts(data.children)
|
|
||||||
}
|
|
||||||
if (data.hasChildren && !data.children) {
|
|
||||||
data.children = null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取弹窗内部门数据
|
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
obj.children = null
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
callback()
|
callback()
|
||||||
}, 200)
|
}, 100)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDepts() {
|
deptTree() {
|
||||||
getDepts({ enabled: true }).then(res => {
|
setTimeout(() => {
|
||||||
this.depts = res.content.map(function(obj) {
|
crudDept.getDeptTree().then(res => {
|
||||||
if (obj.hasChildren) {
|
this.depts = res.content
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
|
||||||
})
|
})
|
||||||
})
|
}, 100)
|
||||||
|
},
|
||||||
|
normalizer(node) {
|
||||||
|
return {
|
||||||
|
id: node.dept_id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children
|
||||||
|
}
|
||||||
},
|
},
|
||||||
typeChange(old) {
|
typeChange(old) {
|
||||||
debugger
|
/*this.form.device_bom_id = ''
|
||||||
this.form.device_bom_id = ''
|
|
||||||
equipmentfile.queryBomList({ material_type_id: old.class_id }).then(res => {
|
equipmentfile.queryBomList({ material_type_id: old.class_id }).then(res => {
|
||||||
this.bomlist = res
|
this.bomlist = res
|
||||||
})
|
})*/
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeSubmit]() {
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
v-model="query.use_deptid"
|
v-model="query.use_deptid"
|
||||||
:options="depts"
|
:options="depts"
|
||||||
:load-options="loadDepts"
|
:load-options="loadDepts"
|
||||||
|
:normalizer="normalizer"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
placeholder="选择部门"
|
placeholder="选择部门"
|
||||||
@@ -287,6 +288,7 @@ import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
|
|||||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
// import { getDepts } from '@/api/system/dept'
|
// import { getDepts } from '@/api/system/dept'
|
||||||
|
import crudDept, { getDeptTree } from '@/views/system/dept/dept'
|
||||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||||
import { download } from '@/api/data'
|
import { download } from '@/api/data'
|
||||||
@@ -346,7 +348,7 @@ export default {
|
|||||||
this.class_idStr = res.class_idStr
|
this.class_idStr = res.class_idStr
|
||||||
this.queryClassId()
|
this.queryClassId()
|
||||||
})
|
})
|
||||||
// this.getDepts()
|
this.deptTree()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
canUd(row) {
|
canUd(row) {
|
||||||
@@ -394,32 +396,36 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取弹窗内部门数据
|
|
||||||
|
// 获取部门
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
obj.children = null
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
callback()
|
callback()
|
||||||
}, 200)
|
}, 100)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDepts() {
|
deptTree() {
|
||||||
getDepts({ enabled: true }).then(res => {
|
setTimeout(() => {
|
||||||
this.depts = res.content.map(function(obj) {
|
crudDept.getDeptTree().then(res => {
|
||||||
if (obj.hasChildren) {
|
this.depts = res.content
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
|
||||||
})
|
})
|
||||||
})
|
}, 100)
|
||||||
},
|
},
|
||||||
|
normalizer(node) {
|
||||||
|
return {
|
||||||
|
id: node.dept_id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
mySelectionChange(rows) {
|
mySelectionChange(rows) {
|
||||||
this.buttonChange(rows)
|
this.buttonChange(rows)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,15 +20,6 @@
|
|||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="使用班组">
|
|
||||||
<treeselect
|
|
||||||
v-model="query.dept_id"
|
|
||||||
:load-options="loadDepts"
|
|
||||||
:options="depts"
|
|
||||||
style="width: 200px;"
|
|
||||||
placeholder="请选择"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备">
|
<el-form-item label="设备">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="query.device_code"
|
v-model="query.device_code"
|
||||||
|
|||||||
@@ -24,15 +24,7 @@
|
|||||||
<treeselect
|
<treeselect
|
||||||
v-model="query.dept_id"
|
v-model="query.dept_id"
|
||||||
:load-options="loadDepts"
|
:load-options="loadDepts"
|
||||||
:options="depts"
|
:normalizer="normalizer"
|
||||||
style="width: 200px;"
|
|
||||||
placeholder="请选择"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="使用班组">
|
|
||||||
<treeselect
|
|
||||||
v-model="query.use_groupid"
|
|
||||||
:load-options="loadDepts"
|
|
||||||
:options="depts"
|
:options="depts"
|
||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@@ -217,6 +209,7 @@ import DeviceDialog from '@/views/wms/device_manage/repair/devicevprs/DeviceDial
|
|||||||
import FaultDialog from '@/views/wms/device_manage/repair/devicevprs/FaultDialog'
|
import FaultDialog from '@/views/wms/device_manage/repair/devicevprs/FaultDialog'
|
||||||
// import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
// import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import crudDept from '@/views/system/dept/dept'
|
||||||
|
|
||||||
const defaultForm = { material_type_id: null, product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
|
const defaultForm = { material_type_id: null, product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
|
||||||
export default {
|
export default {
|
||||||
@@ -291,7 +284,7 @@ export default {
|
|||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
this.queryClassId()
|
this.queryClassId()
|
||||||
})
|
})
|
||||||
this.getDepts()
|
this.deptTree()
|
||||||
this.query.use_groupid = this.user.dept.id
|
this.query.use_groupid = this.user.dept.id
|
||||||
this.getSupDepts(this.user.dept.id)
|
this.getSupDepts(this.user.dept.id)
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
@@ -397,37 +390,30 @@ export default {
|
|||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
obj.children = null
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
callback()
|
callback()
|
||||||
}, 200)
|
}, 100)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDepts() {
|
deptTree() {
|
||||||
getDepts({ enabled: true }).then(res => {
|
setTimeout(() => {
|
||||||
this.depts = res.content.map(function(obj) {
|
crudDept.getDeptTree().then(res => {
|
||||||
if (obj.hasChildren) {
|
this.depts = res.content
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
|
||||||
})
|
})
|
||||||
})
|
}, 100)
|
||||||
},
|
},
|
||||||
getSupDepts(deptId) {
|
normalizer(node) {
|
||||||
debugger
|
return {
|
||||||
var number = parseFloat(deptId)
|
id: node.dept_id,
|
||||||
getDeptSuperior(number).then(res => {
|
label: node.name,
|
||||||
const date = res.content
|
children: node.children
|
||||||
this.buildDepts(date)
|
}
|
||||||
this.depts = date
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
buildDepts(depts) {
|
buildDepts(depts) {
|
||||||
depts.forEach(data => {
|
depts.forEach(data => {
|
||||||
|
|||||||
Reference in New Issue
Block a user