Commit 59be76f4 authored by yaqizhang's avatar yaqizhang

解决冲突

parents 21b766b7 dd8dcc50
...@@ -77,8 +77,7 @@ public class CommonController ...@@ -77,8 +77,7 @@ public class CommonController
// String fileName = FileUploadUtils.upload(filePath, file); // String fileName = FileUploadUtils.upload(filePath, file);
// String url = serverConfig.getUrl() + fileName; // String url = serverConfig.getUrl() + fileName;
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String fileServer = serverConfig.getUrl().contains("127") && serverConfig.getUrl().contains("8093") && !filePath.contains("/data")? serverConfig.getUrl() : serverConfig.getUrl().replace("127.0.0.1:8903","36.148.23.59:8901"); String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
String url = fileServer + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName); ajax.put("fileName", fileName);
ajax.put("url", url); ajax.put("url", url);
......
...@@ -3,6 +3,7 @@ package com.zehong.web.controller.device; ...@@ -3,6 +3,7 @@ package com.zehong.web.controller.device;
import com.zehong.common.annotation.Log; import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController; import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult; import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.common.core.page.TableDataInfo; import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType; import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
...@@ -50,6 +51,15 @@ public class TDeviceInfoController extends BaseController ...@@ -50,6 +51,15 @@ public class TDeviceInfoController extends BaseController
return AjaxResult.success(tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo)); return AjaxResult.success(tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo));
} }
/**
* 获取设备下拉树列表
*/
@PutMapping("/deviceTree")
public AjaxResult deviceTree(@RequestBody List<TDeviceInfo> deviceInfoList)
{
return AjaxResult.success(tDeviceInfoService.buildDeviceTreeSelect(deviceInfoList));
}
/** /**
* 导出设备信息列表 * 导出设备信息列表
*/ */
......
package com.zehong.web.controller.system; package com.zehong.web.controller.system;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -65,6 +67,17 @@ public class SysUserController extends BaseController ...@@ -65,6 +67,17 @@ public class SysUserController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取巡检员列表
*/
@PreAuthorize("@ss.hasPermi('system:user:inspectorList')")
@GetMapping("/inspectorList")
public AjaxResult inspectorList()
{
List<SysUser> list = userService.selectInspectorList();
return AjaxResult.success(list);
}
@Log(title = "用户管理", businessType = BusinessType.EXPORT) @Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')") @PreAuthorize("@ss.hasPermi('system:user:export')")
@GetMapping("/export") @GetMapping("/export")
......
...@@ -2,7 +2,9 @@ package com.zehong.web.controller.workOrder; ...@@ -2,7 +2,9 @@ package com.zehong.web.controller.workOrder;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo; import com.zehong.system.domain.vo.WorkOrderVo;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -41,12 +43,12 @@ public class TWorkOrderController extends BaseController ...@@ -41,12 +43,12 @@ public class TWorkOrderController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder) throws Exception public TableDataInfo list(TWorkOrderForm tWorkOrderForm) throws Exception
{ {
startPage(); startPage();
List<WorkOrderVo> list = null; List<WorkOrderVo> list = null;
try { try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); list = tWorkOrderService.selectTWorkOrderList(tWorkOrderForm);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new Exception(StringUtils.format("查询工单基础信息列表失败")); throw new Exception(StringUtils.format("查询工单基础信息列表失败"));
...@@ -60,11 +62,11 @@ public class TWorkOrderController extends BaseController ...@@ -60,11 +62,11 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')")
@Log(title = "工单基础信息", businessType = BusinessType.EXPORT) @Log(title = "工单基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder) throws Exception public AjaxResult export(TWorkOrderForm tWorkOrderForm) throws Exception
{ {
List<WorkOrderVo> list = null; List<WorkOrderVo> list = null;
try { try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); list = tWorkOrderService.selectTWorkOrderList(tWorkOrderForm);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new Exception(StringUtils.format("导出工单基础信息列表失败")); throw new Exception(StringUtils.format("导出工单基础信息列表失败"));
...@@ -116,8 +118,8 @@ public class TWorkOrderController extends BaseController ...@@ -116,8 +118,8 @@ public class TWorkOrderController extends BaseController
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception
{ {
String orderStatus = tWorkOrder.getOrderStatus(); String orderStatus = tWorkOrder.getOrderStatus();
// 工单状态只有是0未下发或1已下发,才允许修改 // 工单状态只有是0未接收才允许修改
if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){ if(!"0".equals(orderStatus)){
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId())); throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
} }
...@@ -139,7 +141,14 @@ public class TWorkOrderController extends BaseController ...@@ -139,7 +141,14 @@ public class TWorkOrderController extends BaseController
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception
{ {
String orderStatus = tWorkOrder.getOrderStatus(); String orderStatus = tWorkOrder.getOrderStatus();
if("5".equals(orderStatus)) { if("0".equals(orderStatus)){
tWorkOrder.setOrderStatus("1");
tWorkOrder.setActualTime(DateUtils.getNowDate());
} else if("1".equals(orderStatus)) {
tWorkOrder.setOrderStatus("2");
} else if("2".equals(orderStatus)) {
tWorkOrder.setOrderStatus("3");
} else if("3".equals(orderStatus)) {
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态", tWorkOrder.getOrderId())); throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态", tWorkOrder.getOrderId()));
} }
......
package com.zehong.system.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 工单基础信息对象 t_work_order
*
* @author zehong
* @date 2021-07-19
*/
public class TWorkOrderForm extends BaseEntity
{
/** 工单id */
private String orderId;
/** 工单类型(1巡检信息,2隐患信息,3报警信息) */
private String orderType;
/** 工单名称 */
private String orderName;
/** 工单状态(0未接收,1已接收,2进行中,3已反馈,4已归档) */
private String orderStatus;
/** 指定执行人员(巡检员id) */
private Long appointInspector;
/** 开始下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startAllotTime;
/** 结束下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endAllotTime;
/** 实际接收人员(巡检员id) */
@Excel(name = "实际接收人员", readConverterExp = "巡检员id")
private Long actualInspector;
/** 实际接收时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际接收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualTime;
/** 用户名 */
private String userName;
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getOrderType()
{
return orderType;
}
public void setOrderName(String orderName)
{
this.orderName = orderName;
}
public String getOrderName()
{
return orderName;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setAppointInspector(Long appointInspector)
{
this.appointInspector = appointInspector;
}
public Long getAppointInspector()
{
return appointInspector;
}
public Date getStartAllotTime() {
return startAllotTime;
}
public void setStartAllotTime(Date startAllotTime) {
this.startAllotTime = startAllotTime;
}
public Date getEndAllotTime() {
return endAllotTime;
}
public void setEndAllotTime(Date endAllotTime) {
this.endAllotTime = endAllotTime;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Long getActualInspector() {
return actualInspector;
}
public void setActualInspector(Long actualInspector) {
this.actualInspector = actualInspector;
}
public Date getActualTime() {
return actualTime;
}
public void setActualTime(Date actualTime) {
this.actualTime = actualTime;
}
}
...@@ -36,6 +36,9 @@ public class WorkOrderVo extends BaseEntity ...@@ -36,6 +36,9 @@ public class WorkOrderVo extends BaseEntity
/** 设备编号 */ /** 设备编号 */
private String deviceCodes; private String deviceCodes;
/** 设备名称 */
private String deviceName;
/** 设备列表 */ /** 设备列表 */
private List<TDeviceInfo> deviceInfoList; private List<TDeviceInfo> deviceInfoList;
...@@ -150,6 +153,14 @@ public class WorkOrderVo extends BaseEntity ...@@ -150,6 +153,14 @@ public class WorkOrderVo extends BaseEntity
this.deviceCodes = deviceCodes; this.deviceCodes = deviceCodes;
} }
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public List<TDeviceInfo> getDeviceInfoList() { public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList; return deviceInfoList;
} }
......
...@@ -19,6 +19,14 @@ public interface SysUserMapper ...@@ -19,6 +19,14 @@ public interface SysUserMapper
*/ */
public List<SysUser> selectUserList(SysUser sysUser); public List<SysUser> selectUserList(SysUser sysUser);
/**
* 查询巡检员列表
*
* @param
* @return 用户信息集合信息
*/
public List<SysUser> selectInspectorList();
/** /**
* 通过用户名查询用户 * 通过用户名查询用户
* *
......
...@@ -2,6 +2,7 @@ package com.zehong.system.mapper; ...@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.form.TWorkOrderForm;
/** /**
* 工单基础信息Mapper接口 * 工单基础信息Mapper接口
...@@ -32,7 +33,7 @@ public interface TWorkOrderMapper ...@@ -32,7 +33,7 @@ public interface TWorkOrderMapper
* @param tWorkOrder 工单基础信息 * @param tWorkOrder 工单基础信息
* @return 工单基础信息集合 * @return 工单基础信息集合
*/ */
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder); public List<TWorkOrder> selectTWorkOrderList(TWorkOrderForm tWorkOrderForm);
/** /**
* 新增工单基础信息 * 新增工单基础信息
......
...@@ -18,6 +18,14 @@ public interface ISysUserService ...@@ -18,6 +18,14 @@ public interface ISysUserService
*/ */
public List<SysUser> selectUserList(SysUser user); public List<SysUser> selectUserList(SysUser user);
/**
* 查询巡检员列表
*
* @param
* @return 用户信息集合信息
*/
public List<SysUser> selectInspectorList();
/** /**
* 通过用户名查询用户 * 通过用户名查询用户
* *
......
...@@ -3,6 +3,8 @@ package com.zehong.system.service; ...@@ -3,6 +3,8 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
/** /**
...@@ -29,6 +31,14 @@ public interface ITDeviceInfoService ...@@ -29,6 +31,14 @@ public interface ITDeviceInfoService
*/ */
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo); public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
* 构建前端所需要下拉树结构
*
* @param deviceInfoList 设备列表
* @return 下拉树结构列表
*/
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList);
/** /**
* 统计各设备类型的设备总数 * 统计各设备类型的设备总数
* @return * @return
......
...@@ -2,6 +2,7 @@ package com.zehong.system.service; ...@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo; import com.zehong.system.domain.vo.WorkOrderVo;
/** /**
...@@ -24,10 +25,10 @@ public interface ITWorkOrderService ...@@ -24,10 +25,10 @@ public interface ITWorkOrderService
/** /**
* 查询工单基础信息列表 * 查询工单基础信息列表
* *
* @param tWorkOrder 工单基础信息 * @param tWorkOrderForm 工单基础信息表单
* @return 工单基础信息集合 * @return 工单基础信息集合
*/ */
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception; public List<WorkOrderVo> selectTWorkOrderList(TWorkOrderForm tWorkOrderForm) throws Exception;
/** /**
* 新增工单基础信息 * 新增工单基础信息
......
...@@ -66,6 +66,18 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -66,6 +66,18 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.selectUserList(user); return userMapper.selectUserList(user);
} }
/**
* 查询巡检员列表
*
* @param
* @return 用户信息集合信息
*/
@Override
public List<SysUser> selectInspectorList()
{
return userMapper.selectInspectorList();
}
/** /**
* 通过用户名查询用户 * 通过用户名查询用户
* *
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.List; import java.util.*;
import java.util.Map; import java.util.stream.Collectors;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper; import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService; import com.zehong.system.service.ITDeviceInfoService;
import org.springframework.web.bind.annotation.RequestParam;
/** /**
* 设备信息Service业务层处理 * 设备信息Service业务层处理
...@@ -45,6 +48,28 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -45,6 +48,28 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo); return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo);
} }
/**
* 构建前端所需要下拉树结构
*
* @param deviceInfoList 部门列表
* @return 下拉树结构列表
*/
@Override
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList)
{
List<Map<Object, Object>> list = new ArrayList<>();
for (TDeviceInfo deviceInfo : deviceInfoList) {
Map<Object, Object> map = new HashMap<>();
map.put("id", deviceInfo.getDeviceId());
map.put("label", deviceInfo.getDeviceName());
list.add(map);
}
return list;
}
/** /**
* 统计各设备类型的设备总数 * 统计各设备类型的设备总数
* @return * @return
......
...@@ -2,6 +2,7 @@ package com.zehong.system.service.impl; ...@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import com.zehong.system.mapper.*; import com.zehong.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -78,18 +79,18 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -78,18 +79,18 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
trouble.setDealStatus(dealStatus); trouble.setDealStatus(dealStatus);
tHiddenTroubleMapper.updateTHiddenTrouble(trouble); tHiddenTroubleMapper.updateTHiddenTrouble(trouble);
} else { } else if("3".equals(orderType)) {
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(order.getResourceId()); TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(order.getResourceId());
alarm.setDealStatus(dealStatus); alarm.setDealStatus(dealStatus);
tDeviceAlarmMapper.updateTDeviceAlarm(alarm); tDeviceAlarmMapper.updateTDeviceAlarm(alarm);
} }
// 如果工单状态是进行中,修改状态为已反馈 // 如果工单状态是已接收,修改状态为已反馈
if("2".equals(order.getOrderStatus())){ if("1".equals(order.getOrderStatus())){
order.setOrderStatus("3"); order.setOrderStatus("2");
tWorkOrderMapper.updateTWorkOrder(order); tWorkOrderMapper.updateTWorkOrder(order);
} }
tOrderFeedback.setFeedbackTime(DateUtils.getNowDate());
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback); return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
} }
......
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo; import com.zehong.system.domain.vo.WorkOrderVo;
import com.zehong.system.mapper.*; import com.zehong.system.mapper.*;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -107,6 +108,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -107,6 +108,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
String deviceCode = trouble.getDeviceCode(); String deviceCode = trouble.getDeviceCode();
TDeviceInfo device = tDeviceInfoMapper.selectTDeviceInfoByCode(deviceCode); TDeviceInfo device = tDeviceInfoMapper.selectTDeviceInfoByCode(deviceCode);
if(device != null){ if(device != null){
workOrderVo.setDeviceName(device.getDeviceName());
deviceInfoList.add(device); deviceInfoList.add(device);
} }
...@@ -128,6 +130,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -128,6 +130,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setLongitude(device.getLongitude()); workOrderVo.setLongitude(device.getLongitude());
workOrderVo.setLatitude(device.getLatitude()); workOrderVo.setLatitude(device.getLatitude());
workOrderVo.setDeviceType(device.getDeviceType()); workOrderVo.setDeviceType(device.getDeviceType());
workOrderVo.setDeviceName(device.getDeviceName());
workOrderVo.setAddress(device.getDeviceAddr()); workOrderVo.setAddress(device.getDeviceAddr());
deviceInfoList.add(device); deviceInfoList.add(device);
} }
...@@ -152,14 +155,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -152,14 +155,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
/** /**
* 查询工单基础信息列表 * 查询工单基础信息列表
* *
* @param tWorkOrder 工单基础信息 * @param tWorkOrderForm 工单基础信息
* @return 工单基础信息 * @return 工单基础信息
*/ */
@Override @Override
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception public List<WorkOrderVo> selectTWorkOrderList(TWorkOrderForm tWorkOrderForm) throws Exception
{ {
List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>(); List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>();
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder); List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrderForm);
if(workOrderList.size() != 0){ if(workOrderList.size() != 0){
...@@ -172,7 +175,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -172,7 +175,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setAppointInspectorName(appointInspector.getNickName()); workOrderVo.setAppointInspectorName(appointInspector.getNickName());
if(workOrder.getActualInspector() != workOrder.getAppointInspector() && workOrder.getActualInspector() != null){ if(workOrder.getActualInspector() != workOrder.getAppointInspector() && workOrder.getActualInspector() != null){
SysUser actualInspector = sysUserMapper.selectUserById(tWorkOrder.getActualInspector()); SysUser actualInspector = sysUserMapper.selectUserById(workOrder.getActualInspector());
workOrderVo.setActualInspectorName(actualInspector.getNickName()); workOrderVo.setActualInspectorName(actualInspector.getNickName());
} else { } else {
workOrderVo.setActualInspectorName(appointInspector.getNickName()); workOrderVo.setActualInspectorName(appointInspector.getNickName());
...@@ -237,8 +240,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -237,8 +240,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
{ {
if("1".equals(tWorkOrder.getOrderStatus())){ if("1".equals(tWorkOrder.getOrderStatus())){
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tWorkOrder.getOrderId()); int planId = tWorkOrder.getResourceId();
int planId = order.getResourceId();
// 修改巡检计划状态为进行中 // 修改巡检计划状态为进行中
TInspectionPlan plan = new TInspectionPlan(); TInspectionPlan plan = new TInspectionPlan();
plan.setPlanId(planId); plan.setPlanId(planId);
...@@ -246,10 +248,11 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -246,10 +248,11 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
plan.setUpdateTime(DateUtils.getNowDate()); plan.setUpdateTime(DateUtils.getNowDate());
tInspectionPlanMapper.updateTInspectionPlan(plan); tInspectionPlanMapper.updateTInspectionPlan(plan);
} else if ("4".equals(tWorkOrder.getOrderStatus())){ tWorkOrder.setActualTime(DateUtils.getNowDate());
} else if ("3".equals(tWorkOrder.getOrderStatus())){
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tWorkOrder.getOrderId()); int planId = tWorkOrder.getResourceId();
int planId = order.getResourceId();
// 修改巡检计划状态为已完成 // 修改巡检计划状态为已完成
TInspectionPlan plan = new TInspectionPlan(); TInspectionPlan plan = new TInspectionPlan();
plan.setPlanId(planId); plan.setPlanId(planId);
...@@ -257,8 +260,9 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -257,8 +260,9 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
plan.setUpdateTime(DateUtils.getNowDate()); plan.setUpdateTime(DateUtils.getNowDate());
tInspectionPlanMapper.updateTInspectionPlan(plan); tInspectionPlanMapper.updateTInspectionPlan(plan);
} } else if ("0".equals(tWorkOrder.getOrderStatus())){
tWorkOrder.setUpdateTime(DateUtils.getNowDate()); tWorkOrder.setUpdateTime(DateUtils.getNowDate());
}
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder); return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
} }
......
...@@ -91,6 +91,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -91,6 +91,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where u.user_id = #{userId} where u.user_id = #{userId}
</select> </select>
<select id="selectInspectorList" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.del_flag = '0' and r.role_id = 102
</select>
<select id="checkUserNameUnique" parameterType="String" resultType="int"> <select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName} limit 1 select count(1) from sys_user where user_name = #{userName} limit 1
</select> </select>
......
...@@ -52,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -52,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTOrderFeedback" parameterType="TOrderFeedback"> <insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
insert into t_order_feedback insert into t_order_feedback
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="feedbackId != null">feedback_id,</if>
<if test="orderId != null">order_id,</if> <if test="orderId != null">order_id,</if>
<if test="deviceCode != null">device_code,</if> <if test="deviceCode != null">device_code,</if>
<if test="contents != null">contents,</if> <if test="contents != null">contents,</if>
...@@ -65,7 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -65,7 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="feedbackId != null">#{feedbackId},</if>
<if test="orderId != null">#{orderId},</if> <if test="orderId != null">#{orderId},</if>
<if test="deviceCode != null">#{deviceCode},</if> <if test="deviceCode != null">#{deviceCode},</if>
<if test="contents != null">#{contents},</if> <if test="contents != null">#{contents},</if>
......
...@@ -23,26 +23,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,26 +23,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<sql id="selectTWorkOrderVo"> <sql id="selectTWorkOrderVo">
select order_id, order_type, resource_id, order_name, order_status, update_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order select t.order_id, t.order_type, t.resource_id, t.order_name, t.order_status, t.update_time, t.appoint_inspector, t.allot_time, t.actual_inspector, t.actual_time, t.remarks
from t_work_order t
left join sys_user s on t.appoint_inspector = s.user_id
</sql> </sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult"> <select id="selectTWorkOrderList" parameterType="TWorkOrderForm" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/> <include refid="selectTWorkOrderVo"/>
<where> <where>
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if> <if test="orderId != null and orderId != ''"> and t.order_id like concat('%',#{orderId},'%')</if>
<if test="orderName != null and orderName != ''"> and order_name like concat('%', #{orderName}, '%')</if> <if test="orderType != null and orderType != ''"> and t.order_type = #{orderType}</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if> <if test="orderName != null and orderName != ''"> and t.order_name like concat('%', #{orderName}, '%')</if>
<if test="appointInspector != null "> and appoint_inspector = #{appointInspector}</if> <if test="orderStatus != null and orderStatus != ''"> and t.order_status = #{orderStatus}</if>
<if test="allotTime != null "> and allot_time = #{allotTime}</if> <if test="appointInspector != null "> and t.appoint_inspector = #{appointInspector}</if>
<if test="actualInspector != null "> and actual_inspector = #{actualInspector}</if> <if test="startAllotTime != null "> and t.allot_time &gt;= #{startAllotTime}</if>
<if test="actualTime != null "> and actual_time = #{actualTime}</if> <if test="endAllotTime != null "> and t.allot_time &lt;= #{endAllotTime}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="userName != null and userName != ''"> and s.user_name = #{userName}</if>
</where> </where>
</select> </select>
<select id="selectTWorkOrderById" parameterType="String" resultMap="TWorkOrderResult"> <select id="selectTWorkOrderById" parameterType="String" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/> <include refid="selectTWorkOrderVo"/>
where order_id = #{orderId} where t.order_id = #{orderId}
</select> </select>
<insert id="insertTWorkOrder" parameterType="TWorkOrder"> <insert id="insertTWorkOrder" parameterType="TWorkOrder">
......
This diff is collapsed.
...@@ -62,9 +62,19 @@ export function exportDeviceInfo(query) { ...@@ -62,9 +62,19 @@ export function exportDeviceInfo(query) {
} }
// 统计各设备类型的设备总数 // 统计各设备类型的设备总数
export function countDeviceByType(){ export function countDeviceByType() {
return request({ return request({
url: '/device/deviceInfo/countDeviceByType', url: '/device/deviceInfo/countDeviceByType',
method: 'get' method: 'get'
}) })
} }
// 查询设备下拉树结构
export function deviceTree(data) {
return request({
url: '/device/deviceInfo/deviceTree',
method: 'put',
data: data
})
}
...@@ -10,6 +10,15 @@ export function listUser(query) { ...@@ -10,6 +10,15 @@ export function listUser(query) {
}) })
} }
// 查询巡检员列表
export function inspectorList(query) {
return request({
url: '/system/user/inspectorList',
method: 'get',
params: query
})
}
// 查询用户详细 // 查询用户详细
export function getUser(userId) { export function getUser(userId) {
return request({ return request({
......
...@@ -4,28 +4,38 @@ ...@@ -4,28 +4,38 @@
:action="uploadFileUrl" :action="uploadFileUrl"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:file-list="fileArr" :file-list="fileArr"
:limit="1" :limit="3"
:list-type="listType"
:on-error="handleUploadError" :on-error="handleUploadError"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
:on-remove="handleRemove"
:on-preview="handleFileClick"
:show-file-list="true" :show-file-list="true"
:headers="headers" :headers="headers"
class="upload-file-uploader" class="upload-file-uploader"
ref="upload" ref="upload"
> >
<!-- 上传按钮 --> <!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button> <!-- <el-button size="mini" icon="" type="primary"></el-button> -->
<i class="el-icon-plus"></i>
<!-- 上传提示 --> <!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
请上传 请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> <template v-if="fileSize">
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件 的文件
</div> </div>
</el-upload> </el-upload>
<el-dialog :modal="modal" :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
<!-- 文件列表 --> <!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> <!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list"> <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank"> <el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span> <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
...@@ -34,17 +44,21 @@ ...@@ -34,17 +44,21 @@
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link> <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div> </div>
</li> </li>
</transition-group> </transition-group> -->
</div> </div>
</template> </template>
<script> <script>
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
props: { props: {
// 值 // 值
value: [String, Object, Array], value: [String, Object, Array],
listType: {
type: String,
defaule: "text",
},
// 大小限制(MB) // 大小限制(MB)
fileSize: { fileSize: {
type: Number, type: Number,
...@@ -57,13 +71,13 @@ export default { ...@@ -57,13 +71,13 @@ export default {
// 文件类型, 例如['png', 'jpg', 'jpeg'] // 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: { fileType: {
type: Array, type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf",'png', 'jpg', 'jpeg'], default: () => ["doc", "xls", "ppt", "txt", "pdf", "png", "jpg", "jpeg"],
}, },
// 是否显示提示 // 是否显示提示
isShowTip: { isShowTip: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() { data() {
return { return {
...@@ -72,6 +86,9 @@ export default { ...@@ -72,6 +86,9 @@ export default {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
fileList: [], fileList: [],
modal:false,
dialogVisible:false,
dialogImageUrl:"",
}; };
}, },
computed: { computed: {
...@@ -114,7 +131,9 @@ export default { ...@@ -114,7 +131,9 @@ export default {
return false; return false;
}); });
if (!isTypeOk) { if (!isTypeOk) {
this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false; return false;
} }
} }
...@@ -130,7 +149,7 @@ export default { ...@@ -130,7 +149,7 @@ export default {
}, },
// 文件个数超出 // 文件个数超出
handleExceed() { handleExceed() {
this.$message.error(`只允许上传单个文件`); this.$message.error(`只允许上传三张照片`);
}, },
// 上传失败 // 上传失败
handleUploadError(err) { handleUploadError(err) {
...@@ -141,10 +160,15 @@ export default { ...@@ -141,10 +160,15 @@ export default {
this.$message.success("上传成功"); this.$message.success("上传成功");
this.$emit("resFun", res); this.$emit("resFun", res);
}, },
// 文件列表移除文件
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.$emit("remove", file);
},
// 删除文件 // 删除文件
handleDelete(index) { handleDelete(index) {
this.fileList.splice(index, 1); this.fileList.splice(index, 1);
this.$emit("input", ''); this.$emit("input", "");
// let that = this, // let that = this,
// param; // param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%") // param = file.response ? file.response.fileName.replace(/\\/g, "%")
...@@ -160,6 +184,11 @@ export default { ...@@ -160,6 +184,11 @@ export default {
// } // }
// }); // });
}, },
handleFileClick(file) {
this.dialogImageUrl = file.response.url;
this.dialogVisible=true;
console.log(file);
},
// 获取文件名称 // 获取文件名称
getFileName(name) { getFileName(name) {
if (name.lastIndexOf("/") > -1) { if (name.lastIndexOf("/") > -1) {
...@@ -167,31 +196,31 @@ export default { ...@@ -167,31 +196,31 @@ export default {
} else { } else {
return ""; return "";
} }
} },
}, },
created() { created() {
// this.fileList = this.list; // this.fileList = this.list;
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.upload-file-uploader { .upload-file-uploader {
margin-bottom: 5px; margin-bottom: 5px;
} }
.upload-file-list .el-upload-list__item { .upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
line-height: 2; line-height: 2;
margin-bottom: 10px; margin-bottom: 10px;
position: relative; position: relative;
} }
.upload-file-list .ele-upload-list__item-content { .upload-file-list .ele-upload-list__item-content {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
color: inherit; color: inherit;
} }
.ele-upload-list__item-content-action .el-link { .ele-upload-list__item-content-action .el-link {
margin-right: 10px; margin-right: 10px;
} }
</style> </style>
...@@ -6,7 +6,14 @@ ...@@ -6,7 +6,14 @@
:before-close="handleClose"> :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeCode">
<el-input v-model="form.pipeCode" placeholder="请输入所属管道" /> <el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" /> <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
...@@ -62,9 +69,8 @@ ...@@ -62,9 +69,8 @@
<script> <script>
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo"; import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload"; import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js"; import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default { export default {
...@@ -84,7 +90,8 @@ ...@@ -84,7 +90,8 @@
map : null, map : null,
obj : null, obj : null,
gaoMap : null, gaoMap : null,
fileArr: [] fileArr: [],
pipeList: []
} }
}, },
components: { components: {
...@@ -117,7 +124,7 @@ ...@@ -117,7 +124,7 @@
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form); this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear(); //this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
}else{ }else{
...@@ -135,6 +142,11 @@ ...@@ -135,6 +142,11 @@
this.form.url = ""; this.form.url = "";
this.fileArr = []; this.fileArr = [];
} }
},
mounted(){
pipeAllInfoList({}).then(response => {
this.pipeList = response.data;
});
} }
} }
</script> </script>
......
...@@ -2,51 +2,60 @@ ...@@ -2,51 +2,60 @@
<div class="wrapper"> <div class="wrapper">
<div class="top display-default"> <div class="top display-default">
<div class="left text">{{ obj.pipeName }}</div> <div class="left text">{{ obj.pipeName }}</div>
<div v-if="!obj.editorPage" class="right text"> <div class="right text">
<img src="../../assets/images/closeBtn.png" alt="" /> <img @click="close" src="../../assets/images/closeBtn.png" alt="" />
</div> </div>
</div> </div>
<!-- 设备信息 --> <!-- 设备信息 -->
<div class="content">
<div class="eq-content display-default"> <div class="eq-content display-default">
<div class="text-wrapper"> <div class="text-wrapper">
<div :title="obj.pipeName" class="eq-text"> <!-- <div :title="obj.pipeName" class="eq-text">
<span>管道名称:</span> <span>管道名称:</span>
<span>{{ obj.pipeName }}</span> <span>{{ obj.pipeName }}</span>
</div> </div> -->
<div class="eq-text"> <div class="eq-text">
<span>管道编号:</span> <span>管道编号:</span>
<span>{{ obj.pipeCode }}</span> <span>{{ obj.pipeCode }} </span>
</div> </div>
<div class="eq-text"> <div class="eq-text">
<span>管道长度:</span> <span>管道长度:</span>
<span>{{ `${obj.pipeLength ?obj.pipeLength+'米':""}` }}</span> <span>{{ `${obj.pipeLength ? obj.pipeLength + "米" : ""}` }}</span>
</div> </div>
<div class="eq-text"> <div class="eq-text">
<span>管道类型:</span> <span>管道类型:</span>
<span>{{ ["地埋管线", "地表管线"][obj.pipeType] }}</span> <span>{{ ["地埋管线", "地表管线"][obj.pipeType - 1] }}</span>
</div> </div>
<div class="eq-text"> <div class="eq-text">
<span>管道压力:</span> <span>管道压力:</span>
<span>{{ <span>{{
["低押", "中压", "次高压", "高压"][obj.pipePressure] ["低押", "中压", "次高压", "高压"][obj.pipePressure - 1]
}}</span> }}</span>
</div> </div>
</div> </div>
<div class="pic"> <div class="pic">
<img :src="obj.url" alt="" /> <img :src="obj.iconUrl" alt="" />
</div> </div>
</div> </div>
<div class="maintain-content"> <div class="maintain-content">
<div> <div>
安装日期:<span>{{ obj.installationTime }}</span> <span>管道所在地址:</span>
<span>{{ obj.pipeAddr }}</span>
</div>
<div>
<span>安装日期:</span>
<span>{{ moment(obj.installationTime).format("YYYY-MM-DD") }}</span>
</div> </div>
<div> <div>
最后巡检日期:<span>{{ obj.inspectionTime }}</span> <span>最后巡检日期:</span>
<span>{{ obj.inspectionTime }}</span>
</div> </div>
<div> <div>
备注信息;<span>{{ obj.remarks }}</span> <span>备注信息;</span>
<span>{{ obj.remarks }} </span>
</div> </div>
</div> </div>
<template v-if="!obj.editorPage"> <template v-if="!obj.editorPage">
...@@ -58,16 +67,28 @@ ...@@ -58,16 +67,28 @@
<el-button class="elbtn" type="primary">生成工单</el-button> <el-button class="elbtn" type="primary">生成工单</el-button>
</div> </div>
</template> </template>
</div>
<!-- 报警状态 --> <!-- 报警状态 -->
</div> </div>
</template> </template>
<script> <script>
//line移入时的的infowindow //line移入时的的infowindow
import moment from "moment";
export default { export default {
props: { props: {
obj: { typs: Object }, obj: { typs: Object },
}, },
created() {
console.log("created", this.obj);
},
methods: {
moment,
close() {
this.obj.polyline.infoWindow.close();
},
},
}; };
</script> </script>
...@@ -78,7 +99,7 @@ export default { ...@@ -78,7 +99,7 @@ export default {
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden; // overflow: hidden;
.top { .top {
width: 100%; width: 100%;
height: 51px; height: 51px;
...@@ -93,15 +114,21 @@ export default { ...@@ -93,15 +114,21 @@ export default {
padding-left: 22px; padding-left: 22px;
} }
.right { .right {
padding-right: 16px; padding-right: 22px;
img{
cursor: pointer;
} }
} }
}
.content {
max-height: 400px;
overflow: hidden;
overflow-y: auto;
.eq-content { .eq-content {
min-height: 156px; min-height: 156px;
box-sizing: border-box; box-sizing: border-box;
padding: 13px 16px 13px 22px; padding: 13px 22px 0px 22px;
border-bottom: 1px solid #e2e2e2; // border-bottom: 1px solid #e2e2e2;
.text-wrapper { .text-wrapper {
padding-top: 1px; padding-top: 1px;
& > div { & > div {
...@@ -112,12 +139,12 @@ export default { ...@@ -112,12 +139,12 @@ export default {
font-weight: 400; font-weight: 400;
color: #1d1d1d; color: #1d1d1d;
opacity: 1; opacity: 1;
& > span { & > span {
vertical-align: top;
display: inline-block; display: inline-block;
white-space: nowrap; // white-space: nowrap;
text-overflow: ellipsis; // text-overflow: ellipsis;
overflow: hidden; // overflow: hidden;
word-break: break-all; word-break: break-all;
max-width: 100px; max-width: 100px;
} }
...@@ -126,24 +153,34 @@ export default { ...@@ -126,24 +153,34 @@ export default {
.pic { .pic {
width: 177px; width: 177px;
height: 129px; height: 129px;
background-color: black; // background-color: black;
img { img {
width: 100%; width: 100%;
height: 100%;
}
} }
} }
} }
.maintain-content { .maintain-content {
width: 100%; width: 100%;
height: 109px; height: 119px;
padding-left: 22px; padding-left: 22px;
padding-top: 16px; padding-right: 22px;
padding-bottom: 10px;
// padding-top: 16px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #e2e2e2; // border-bottom: 1px solid #e2e2e2;
& > div { & > div {
margin-bottom: 8px; margin-bottom: 8px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
span {
vertical-align: top;
display: inline-block;
word-break: break-all;
max-width: 280px;
}
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:before-close="handleClose" :before-close="handleClose"
> >
<el-row > <el-row>
<el-form <el-form
:rules="rules" :rules="rules"
ref="editForm" ref="editForm"
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<el-col> <el-col>
<el-form-item v-show="false" label="企业id" prop="enterpriseId"> <el-form-item v-show="false" label="企业id" prop="enterpriseId">
<el-input disabled v-model="editForm.enterpriseId"></el-input> <el-input disabled v-model="editForm.enterpriseId"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="管道长度" prop="pipeLength"> <el-form-item label="管道长度" prop="pipeLength">
<el-input v-model="editForm.pipeLength"> <el-input type="number" min=0 v-model="editForm.pipeLength">
<i <i
slot="suffix" slot="suffix"
style="color: #000; font-style: normal; margin-right: 10px" style="color: #000; font-style: normal; margin-right: 10px"
...@@ -99,7 +100,11 @@ ...@@ -99,7 +100,11 @@
@remove="listRemove" @remove="listRemove"
:fileArr="fileArr" :fileArr="fileArr"
/> />
<el-input v-show="false" disabled v-model="editForm.iconUrl"></el-input> <el-input
v-show="false"
disabled
v-model="editForm.iconUrl"
></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item v-show="false" label="设备图片路径" prop="iconUrl"> --> <!-- <el-form-item v-show="false" label="设备图片路径" prop="iconUrl"> -->
<!-- </el-form-item> --> <!-- </el-form-item> -->
...@@ -111,7 +116,7 @@ ...@@ -111,7 +116,7 @@
<el-form-item label="安装日期" prop="installationTime"> <el-form-item label="安装日期" prop="installationTime">
<el-col :span="11"> <el-col :span="11">
<el-date-picker <el-date-picker
type="datetime" type="date"
placeholder="选择日期" placeholder="选择日期"
style="width: 100%" style="width: 100%"
v-model="editForm.installationTime" v-model="editForm.installationTime"
...@@ -141,7 +146,9 @@ ...@@ -141,7 +146,9 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="ok"> </el-button> <el-button :loading="okLoading" type="primary" @click="ok"
> </el-button
>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
...@@ -177,9 +184,10 @@ export default { ...@@ -177,9 +184,10 @@ export default {
data() { data() {
return { return {
// isShow: false, // isShow: false,
okLoading: false,
fileArr: [], fileArr: [],
editForm: { editForm: {
pipeName:"", pipeName: "",
pipeType: "1", pipeType: "1",
pipePressure: "1", pipePressure: "1",
iconUrl: "", iconUrl: "",
...@@ -205,7 +213,7 @@ export default { ...@@ -205,7 +213,7 @@ export default {
pipePressure: [ pipePressure: [
{ required: true, message: "请选择管道压力", trigger: "blur" }, { required: true, message: "请选择管道压力", trigger: "blur" },
], ],
iconUrl: [{ required: true, message: "请上传片", trigger: "change" }], iconUrl: [{ required: true, message: "请上传片", trigger: "change" }],
installationTime: [ installationTime: [
{ {
// type: "date", // type: "date",
...@@ -227,28 +235,46 @@ export default { ...@@ -227,28 +235,46 @@ export default {
this.fileArr = this.lineData.pipeId ? [{ url: this.editForm.iconUrl }] : []; this.fileArr = this.lineData.pipeId ? [{ url: this.editForm.iconUrl }] : [];
}, },
methods: { methods: {
mouseup(){ mouseup() {
console.log('组件mouseup') console.log("组件mouseup");
}, },
ok() { ok() {
this.$refs.editForm.validate((valid)=>{ this.$refs.editForm.validate((valid) => {
if(valid){ if (valid) {
this.okLoading = true;
const data = { ...this.editForm }; const data = { ...this.editForm };
data.installationTime = moment(this.editForm.installationTime).format( data.installationTime = moment(this.editForm.installationTime).format(
"YYYY-MM-DD HH:mm:ss" "YYYY-MM-DD HH:mm:ss"
); );
console.log("data", data); console.log("data", data);
console.log(this.editForm.pipeId); console.log(this.editForm.pipeId);
this.requeset(this.editForm.pipeId, data).then((res) => { this.requeset(this.editForm.pipeId, data)
.then((res) => {
// 改变this指向,传回去target ,传回去data // 改变this指向,传回去target ,传回去data
if (res.code == 200) { if (res.code == 200) {
this.dialogVisible = false; this.dialogVisible = false;
data.pipeId =data.pipeId ?data.pipeId: res.data; data.pipeId = data.pipeId ? data.pipeId : res.data;
this.lineOkCallBack.call(this.gaodeMap, this.target, data); this.lineOkCallBack.call(this.gaodeMap, this.target, data);
if (!this.editForm.pipeId) {
this.gaodeMap.newLineObj = null;
this.gaodeMap.createNewLine();
} }
this.$message({
type: "success",
offset: 100,
// center:true,
message: `${
this.editForm.pipeId ? "修改管道成功" : "添加管道成功"
}`,
}); });
} }
}) })
.catch(() => {
this.okLoading = false;
});
}
});
// console.log(this.gaodeMap,this.target) // console.log(this.gaodeMap,this.target)
}, },
async requeset(id, data) { async requeset(id, data) {
...@@ -270,13 +296,13 @@ export default { ...@@ -270,13 +296,13 @@ export default {
this.$confirm("确认关闭?") this.$confirm("确认关闭?")
.then((_) => { .then((_) => {
done(); done();
}) })
.catch((_) => {}); .catch((_) => {});
}, },
// 图片上传成功 // 图片上传成功
fileFinshed(e) { fileFinshed(e) {
this.editForm.iconUrl = e.url; this.editForm.iconUrl = e.url;
console.log(this.editForm.iconUrl);
}, },
// 图片列表移除 // 图片列表移除
listRemove(e) { listRemove(e) {
......
...@@ -6,7 +6,14 @@ ...@@ -6,7 +6,14 @@
:before-close="handleClose"> :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeCode">
<el-input v-model="form.pipeCode" placeholder="请输入所属管道" /> <el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" /> <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
...@@ -62,9 +69,8 @@ ...@@ -62,9 +69,8 @@
<script> <script>
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo"; import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload"; import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js"; import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default { export default {
...@@ -84,7 +90,8 @@ ...@@ -84,7 +90,8 @@
map : null, map : null,
obj : null, obj : null,
gaoMap : null, gaoMap : null,
fileArr: [] fileArr: [],
pipeList: []
} }
}, },
components: { components: {
...@@ -117,7 +124,7 @@ ...@@ -117,7 +124,7 @@
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form); this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear(); //this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
}else{ }else{
...@@ -135,6 +142,11 @@ ...@@ -135,6 +142,11 @@
this.form.url = ""; this.form.url = "";
this.fileArr = []; this.fileArr = [];
} }
},
mounted(){
pipeAllInfoList({}).then(response => {
this.pipeList = response.data;
});
} }
} }
</script> </script>
......
...@@ -6,7 +6,14 @@ ...@@ -6,7 +6,14 @@
:before-close="handleClose"> :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeCode">
<el-input v-model="form.pipeCode" placeholder="请输入所属管道" /> <el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" /> <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
...@@ -62,6 +69,7 @@ ...@@ -62,6 +69,7 @@
<script> <script>
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo"; import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload"; import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js"; import { DEVICE_TYPE } from "utils/gaodeMap.js";
...@@ -82,7 +90,8 @@ ...@@ -82,7 +90,8 @@
map : null, map : null,
obj : null, obj : null,
gaoMap : null, gaoMap : null,
fileArr: [] fileArr: [],
pipeList: []
} }
}, },
components: { components: {
...@@ -91,6 +100,7 @@ ...@@ -91,6 +100,7 @@
methods: { methods: {
show () { show () {
this.dialogVisible = true; this.dialogVisible = true;
//this.getPipeInfo();
}, },
hide () { hide () {
this.remove() this.remove()
...@@ -116,7 +126,7 @@ ...@@ -116,7 +126,7 @@
this.form.deviceId = response.data; this.form.deviceId = response.data;
console.log(this.gaoMap,"addgaoMap") console.log(this.gaoMap,"addgaoMap")
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form); this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear(); //this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
}else{ }else{
...@@ -134,6 +144,11 @@ ...@@ -134,6 +144,11 @@
handleClose(done) { handleClose(done) {
done(); done();
} }
},
mounted(){
pipeAllInfoList({}).then(response => {
this.pipeList = response.data;
});
} }
} }
</script> </script>
......
...@@ -6,7 +6,14 @@ ...@@ -6,7 +6,14 @@
:before-close="handleClose"> :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeCode">
<el-input v-model="form.pipeCode" placeholder="请输入所属管道" /> <el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" /> <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
...@@ -62,9 +69,8 @@ ...@@ -62,9 +69,8 @@
<script> <script>
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo"; import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload"; import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js"; import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default { export default {
...@@ -84,7 +90,8 @@ ...@@ -84,7 +90,8 @@
map : null, map : null,
obj : null, obj : null,
gaoMap : null, gaoMap : null,
fileArr: [] fileArr: [],
pipeList: []
} }
}, },
components: { components: {
...@@ -117,7 +124,7 @@ ...@@ -117,7 +124,7 @@
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form); this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear(); //this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
}else{ }else{
...@@ -135,6 +142,11 @@ ...@@ -135,6 +142,11 @@
this.form.url = ""; this.form.url = "";
this.fileArr = []; this.fileArr = [];
} }
},
mounted(){
pipeAllInfoList({}).then(response => {
this.pipeList = response.data;
});
} }
} }
</script> </script>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment