Commit f6a6ce28 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents c3d6758b 4b9c01b3
package com.zehong.web.controller.operationMonitor; package com.zehong.web.controller.operationMonitor;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.SysPost;
import com.zehong.system.service.ISysPostService;
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;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -33,6 +39,9 @@ public class TWorkOrderController extends BaseController ...@@ -33,6 +39,9 @@ public class TWorkOrderController extends BaseController
@Autowired @Autowired
private ITWorkOrderService tWorkOrderService; private ITWorkOrderService tWorkOrderService;
@Autowired
private ISysPostService iSysPostService;
/** /**
* 查询燃气任务列表 * 查询燃气任务列表
*/ */
...@@ -41,6 +50,7 @@ public class TWorkOrderController extends BaseController ...@@ -41,6 +50,7 @@ public class TWorkOrderController extends BaseController
public TableDataInfo list(TWorkOrder tWorkOrder) public TableDataInfo list(TWorkOrder tWorkOrder)
{ {
startPage(); startPage();
judgeUserRole(tWorkOrder);
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
return getDataTable(list); return getDataTable(list);
} }
...@@ -53,11 +63,34 @@ public class TWorkOrderController extends BaseController ...@@ -53,11 +63,34 @@ public class TWorkOrderController extends BaseController
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder) public AjaxResult export(TWorkOrder tWorkOrder)
{ {
judgeUserRole(tWorkOrder);
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
ExcelUtil<TWorkOrder> util = new ExcelUtil<TWorkOrder>(TWorkOrder.class); ExcelUtil<TWorkOrder> util = new ExcelUtil<TWorkOrder>(TWorkOrder.class);
return util.exportExcel(list, "燃气任务数据"); return util.exportExcel(list, "燃气任务数据");
} }
/**
* 判断用户角色
* @param tWorkOrder
*/
private void judgeUserRole(TWorkOrder tWorkOrder){
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户所属单位
long enterpriseId = user.getDeptId();
//判断是否为政府用户
if(!"-2".equals(String.valueOf(enterpriseId))){
tWorkOrder.setWorkAssignEnterproseId(enterpriseId);
//判断是否为巡线员
List<Integer> postIds = iSysPostService.selectPostListByUserId(user.getUserId());
for(Integer postId : postIds){
SysPost postInfo = iSysPostService.selectPostById(postId.longValue());
if("se".equals(postInfo.getPostCode())){
tWorkOrder.setWorkAssignManId(user.getUserId());
}
}
}
}
/** /**
* 获取燃气任务详细信息 * 获取燃气任务详细信息
*/ */
......
...@@ -78,19 +78,12 @@ public class TDeviceInfoController extends BaseController ...@@ -78,19 +78,12 @@ public class TDeviceInfoController extends BaseController
{ {
//添加设备信息表数据 并且返回新增id //添加设备信息表数据 并且返回新增id
tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo()); tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo());
Long deviceId = listaw.gettDeviceInfo().getDeviceId(); //将关联设备信息与设备进行绑定
if (listaw.gettDeviceInfoS().size()!=0){ tDeviceInfoService.updatetRelationDeviceDetailInfo(listaw.gettDeviceInfoS(),listaw.gettDeviceInfo().getDeviceId());
//添加 关联设备表 设备id添加 TDeviceInfo tDeviceInfo = new TDeviceInfo();
for (int i=0;i<listaw.gettDeviceInfoS().size();i++){ //根据企业id查询企业名称
listaw.gettDeviceInfoS().get(i).setRelationDeviceId(Math.toIntExact(deviceId)); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId());
} tDeviceInfo.setBeyondEnterpriseName(EnterpriseName);
//添加关联设备信息表数据
tDeviceInfoService.insertDeviceDetailInfo(listaw.gettDeviceInfoS());
}
// TDeviceInfo tDeviceInfo = new TDeviceInfo();
// //根据企业id查询企业名称
// String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId());
// tDeviceInfo.setBeyondEnterpriseName(EnterpriseName);
} }
/** /**
...@@ -123,12 +116,46 @@ public class TDeviceInfoController extends BaseController ...@@ -123,12 +116,46 @@ public class TDeviceInfoController extends BaseController
* 获取设备详细信息列表 * 获取设备详细信息列表
*/ */
@PreAuthorize("@ss.hasPermi('device:device:deviceDetailInfo')") @PreAuthorize("@ss.hasPermi('device:device:deviceDetailInfo')")
@GetMapping(value = "/{getdeviceDetailInfo}") @GetMapping("/getdeviceDetailInfo")
public AjaxResult getdeviceDetailInfo(@PathVariable("deviceId") Long deviceId) public AjaxResult getdeviceDetailInfo(Long deviceId) {
{
List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoService.getdeviceDetailInfo(deviceId); List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoService.getdeviceDetailInfo(deviceId);
System.out.println("111111111");
System.out.println(tDeviceInfoS+"111111111");
return AjaxResult.success(tDeviceInfoS); return AjaxResult.success(tDeviceInfoS);
} }
/**
* 查询无绑定的 关联设备信息
* @return
*/
@RequestMapping("/selectDetailInfo")
public TableDataInfo selectDetailInfo(@RequestBody TDeviceInfoS tDeviceInfos){
List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoService.selectDetailInfo(tDeviceInfos);
return getDataTable(tDeviceInfoS);
}
/**
* 添加关联设备数据接口
*/
@RequestMapping("/insertDetailInfo")
public void insertDetailInfo(@RequestBody TDeviceInfoS tDeviceInfoS){
//添加关联设备信息表数据
tDeviceInfoService.insertDeviceDetailInfo(tDeviceInfoS);
}
/**
* 关联设备批量数据删除接口
*/
@RequestMapping("/deleteDetailInfo")
public void deleteDetailInfo(@RequestBody int deviceId){
tDeviceInfoService.deleteDetailinfOS(deviceId);
}
/**
* 关联设备批量数据删除接口
* @param deviceId
*/
@RequestMapping("/deleteeListDetailInfo")
public void deleteeListDetailInfo(@RequestBody Long[] deviceId){
tDeviceInfoService.deleteDetailInfo(deviceId);
}
} }
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import com.zehong.framework.systemsetting.SystemSetting; import com.zehong.framework.systemsetting.SystemSetting;
import com.zehong.system.service.ISysPostService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -44,6 +45,9 @@ public class SysLoginController ...@@ -44,6 +45,9 @@ public class SysLoginController
@Autowired @Autowired
private SystemSetting systemSetting; private SystemSetting systemSetting;
@Autowired
private ISysPostService iSysPostService;
/** /**
* 登录方法 * 登录方法
* *
...@@ -80,6 +84,7 @@ public class SysLoginController ...@@ -80,6 +84,7 @@ public class SysLoginController
ajax.put("roles", roles); ajax.put("roles", roles);
ajax.put("permissions", permissions); ajax.put("permissions", permissions);
ajax.put("systemSetting",systemSetting.getSystemWebSetting()); ajax.put("systemSetting",systemSetting.getSystemWebSetting());
ajax.put("posts",iSysPostService.getPostListByUserId(user.getUserId()));
return ajax; return ajax;
} }
......
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 com.zehong.framework.systemsetting.SystemSetting; import com.zehong.framework.systemsetting.SystemSetting;
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;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.zehong.common.annotation.Log; import com.zehong.common.annotation.Log;
import com.zehong.common.constant.UserConstants; import com.zehong.common.constant.UserConstants;
...@@ -207,4 +202,19 @@ public class SysUserController extends BaseController ...@@ -207,4 +202,19 @@ public class SysUserController extends BaseController
user.setUpdateBy(SecurityUtils.getUsername()); user.setUpdateBy(SecurityUtils.getUsername());
return toAjax(userService.updateUserStatus(user)); return toAjax(userService.updateUserStatus(user));
} }
/**
* 根据企业获取巡线员
*
* @param enterpriseId 企业id
* @param postCode 岗位编码
* @return 巡线员信息
*/
@GetMapping("/getInspectionUsers")
public AjaxResult getInspectionUsers(@RequestParam(value = "enterpriseId") String enterpriseId, @RequestParam(value="postCode") String postCode){
Map<String,String> map = new HashMap<>();
map.put("enterpriseId",enterpriseId);
map.put("postCode",postCode);
return AjaxResult.success(userService.getInspectionUsers(map));
};
} }
...@@ -45,6 +45,18 @@ public class TEnterpriseInfoController extends BaseController ...@@ -45,6 +45,18 @@ public class TEnterpriseInfoController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
*查询所有企业信息
* @param tEnterpriseInfo
* @return
*/
@GetMapping("/enterpriseLists")
public TableDataInfo enterpriseLists(TEnterpriseInfo tEnterpriseInfo)
{
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
}
/** /**
* 导出企业信息列表 * 导出企业信息列表
*/ */
......
...@@ -83,6 +83,10 @@ public class SysUser extends BaseEntity ...@@ -83,6 +83,10 @@ public class SysUser extends BaseEntity
}) })
private SysDept dept; private SysDept dept;
/** 所属单位 */
@Excel(name = "所属单位", targetAttr = "enterpriseName", type = Type.EXPORT)
private String enterpriseName;
/** 角色对象 */ /** 角色对象 */
private List<SysRole> roles; private List<SysRole> roles;
...@@ -300,6 +304,14 @@ public class SysUser extends BaseEntity ...@@ -300,6 +304,14 @@ public class SysUser extends BaseEntity
this.postIds = postIds; this.postIds = postIds;
} }
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -6,8 +6,6 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -6,8 +6,6 @@ import com.zehong.common.core.domain.BaseEntity;
*/ */
public class TDeviceInfoS extends BaseEntity { public class TDeviceInfoS extends BaseEntity {
/** /**
* 关联设备详情ID * 关联设备详情ID
*/ */
...@@ -31,7 +29,7 @@ public class TDeviceInfoS extends BaseEntity { ...@@ -31,7 +29,7 @@ public class TDeviceInfoS extends BaseEntity {
/** /**
* 设备类型:1.压力表 2.流量计 * 设备类型:1.压力表 2.流量计
*/ */
private Integer deviceType; private String deviceType;
/** /**
* 物联网编号 * 物联网编号
...@@ -76,11 +74,11 @@ public class TDeviceInfoS extends BaseEntity { ...@@ -76,11 +74,11 @@ public class TDeviceInfoS extends BaseEntity {
this.deviceModel = deviceModel; this.deviceModel = deviceModel;
} }
public Integer getDeviceType() { public String getDeviceType() {
return deviceType; return deviceType;
} }
public void setDeviceType(Integer deviceType) { public void setDeviceType(String deviceType) {
this.deviceType = deviceType; this.deviceType = deviceType;
} }
......
...@@ -41,8 +41,8 @@ public class TSafeEquipmentStandingBook extends BaseEntity ...@@ -41,8 +41,8 @@ public class TSafeEquipmentStandingBook extends BaseEntity
private String linkMobile; private String linkMobile;
/** 安装时间 */ /** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date installTime; private Date installTime;
/** 品牌名称 */ /** 品牌名称 */
......
...@@ -59,6 +59,11 @@ public class TTroubleStandingBook extends BaseEntity ...@@ -59,6 +59,11 @@ public class TTroubleStandingBook extends BaseEntity
@Excel(name = "是否处理:1.已处理 2.未处理") @Excel(name = "是否处理:1.已处理 2.未处理")
private String isDeal; private String isDeal;
/** 事故发生时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "事故发生时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date happenDate;
/** 处理完成时间 */ /** 处理完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "处理完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "处理完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
...@@ -170,6 +175,15 @@ public class TTroubleStandingBook extends BaseEntity ...@@ -170,6 +175,15 @@ public class TTroubleStandingBook extends BaseEntity
{ {
return isDeal; return isDeal;
} }
public Date getHappenDate() {
return happenDate;
}
public void setHappenDate(Date happenDate) {
this.happenDate = happenDate;
}
public void setDealDate(Date dealDate) public void setDealDate(Date dealDate)
{ {
this.dealDate = dealDate; this.dealDate = dealDate;
......
...@@ -28,6 +28,14 @@ public class TTroubleStandingBookForm ...@@ -28,6 +28,14 @@ public class TTroubleStandingBookForm
/** 是否处理:1.已处理 2.未处理 */ /** 是否处理:1.已处理 2.未处理 */
private String isDeal; private String isDeal;
/** 事故发生起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date happenDateStart;
/** 事故发生截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date happenDateEnd;
/** 处理完成起始时间 */ /** 处理完成起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dealDateStart; private Date dealDateStart;
......
...@@ -41,6 +41,13 @@ public interface SysPostMapper ...@@ -41,6 +41,13 @@ public interface SysPostMapper
*/ */
public List<Integer> selectPostListByUserId(Long userId); public List<Integer> selectPostListByUserId(Long userId);
/**
* 根据用户ID查询岗位信息
* @param userId 用户id
* @return
*/
List<SysPost> getPostListByUserId(Long userId);
/** /**
* 查询用户所属岗位组 * 查询用户所属岗位组
* *
......
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
...@@ -108,4 +110,12 @@ public interface SysUserMapper ...@@ -108,4 +110,12 @@ public interface SysUserMapper
* @return 结果 * @return 结果
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
/**
* 根据企业获取巡线员
*
* @param map
* @return 巡线员信息
*/
List<SysUser> getInspectionUsers(Map<String,String> map);
} }
...@@ -3,6 +3,7 @@ package com.zehong.system.mapper; ...@@ -3,6 +3,7 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceInfoS; import com.zehong.system.domain.TDeviceInfoS;
import org.apache.ibatis.annotations.Param;
/** /**
* 设备信息Mapper接口 * 设备信息Mapper接口
...@@ -64,7 +65,7 @@ public interface TDeviceInfoMapper ...@@ -64,7 +65,7 @@ public interface TDeviceInfoMapper
* 添加关联设备信息表数据 * 添加关联设备信息表数据
* @param gettDeviceInfoS * @param gettDeviceInfoS
*/ */
void insertDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS); void insertDeviceDetailInfo(TDeviceInfoS gettDeviceInfoS);
/** /**
* 获取设备详细信息列表 * 获取设备详细信息列表
...@@ -72,4 +73,28 @@ public interface TDeviceInfoMapper ...@@ -72,4 +73,28 @@ public interface TDeviceInfoMapper
* @return * @return
*/ */
List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId); List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId);
/**
* 查询无绑定的 关联设备信息
* @return
*/
List<TDeviceInfoS> selectDetailInfo(TDeviceInfoS tDeviceInfos);
/**
* 关联设备数据删除接口
* @param deviceIds
*/
void deleteDetailInfo(Long[] deviceIds);
/**
* 关联设备数据删除接口 单条删除
* @param deviceId
*/
void deleteDetailinfOS(int deviceId);
/**
* 将关联设备信息与设备进行绑定
* @param gettDeviceInfoS
*/
void updatetRelationDeviceDetailInfo(@Param("gettDeviceInfoS")List<TDeviceInfoS> gettDeviceInfoS,@Param("id") Long id);
} }
...@@ -41,6 +41,13 @@ public interface ISysPostService ...@@ -41,6 +41,13 @@ public interface ISysPostService
*/ */
public List<Integer> selectPostListByUserId(Long userId); public List<Integer> selectPostListByUserId(Long userId);
/**
* 根据用户ID查询岗位信息
* @param userId 用户id
* @return
*/
List<SysPost> getPostListByUserId(Long userId);
/** /**
* 校验岗位名称 * 校验岗位名称
* *
......
package com.zehong.system.service; package com.zehong.system.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
/** /**
...@@ -164,4 +166,12 @@ public interface ISysUserService ...@@ -164,4 +166,12 @@ public interface ISysUserService
* @return 结果 * @return 结果
*/ */
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
/**
* 根据企业获取巡线员
*
* @param map
* @return 巡线员信息
*/
List<SysUser> getInspectionUsers(Map<String,String> map);
} }
...@@ -3,6 +3,7 @@ package com.zehong.system.service; ...@@ -3,6 +3,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceInfoS; import com.zehong.system.domain.TDeviceInfoS;
import org.apache.ibatis.annotations.Param;
/** /**
* 设备信息Service接口 * 设备信息Service接口
...@@ -64,7 +65,7 @@ public interface ITDeviceInfoService ...@@ -64,7 +65,7 @@ public interface ITDeviceInfoService
* 添加关联设备信息表数据 * 添加关联设备信息表数据
* @param gettDeviceInfoS * @param gettDeviceInfoS
*/ */
void insertDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS); void insertDeviceDetailInfo(TDeviceInfoS gettDeviceInfoS);
/** /**
* 获取设备详细信息列表 * 获取设备详细信息列表
...@@ -72,4 +73,28 @@ public interface ITDeviceInfoService ...@@ -72,4 +73,28 @@ public interface ITDeviceInfoService
* @return * @return
*/ */
List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId); List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId);
/**
* 查询无绑定的 关联设备信息
* @return
*/
List<TDeviceInfoS> selectDetailInfo(TDeviceInfoS tDeviceInfos);
/**
* 关联设备数据删除接口
* @param deviceIds
*/
void deleteDetailInfo(Long[] deviceIds);
/**
* 关联设备数据删除接口 单条删除
* @param deviceId
*/
void deleteDetailinfOS(int deviceId);
/**
* 将关联设备信息与设备进行绑定
* @param gettDeviceInfoS
*/
void updatetRelationDeviceDetailInfo(@Param("gettDeviceInfoS") List<TDeviceInfoS> gettDeviceInfoS,@Param("id") Long id);
} }
...@@ -72,6 +72,16 @@ public class SysPostServiceImpl implements ISysPostService ...@@ -72,6 +72,16 @@ public class SysPostServiceImpl implements ISysPostService
return postMapper.selectPostListByUserId(userId); return postMapper.selectPostListByUserId(userId);
} }
/**
* 根据用户ID查询岗位信息
* @param userId 用户id
* @return
*/
@Override
public List<SysPost> getPostListByUserId(Long userId){
return postMapper.getPostListByUserId(userId);
}
/** /**
* 校验岗位名称是否唯一 * 校验岗位名称是否唯一
* *
......
...@@ -2,6 +2,8 @@ package com.zehong.system.service.impl; ...@@ -2,6 +2,8 @@ package com.zehong.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -460,4 +462,16 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -460,4 +462,16 @@ public class SysUserServiceImpl implements ISysUserService
} }
return successMsg.toString(); return successMsg.toString();
} }
/**
* 根据企业获取巡线员
*
* @param map
* @return 巡线员信息
*/
@Override
public List<SysUser> getInspectionUsers(Map<String,String> map){
return userMapper.getInspectionUsers(map);
}
} }
...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl; ...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDeviceInfoS; import com.zehong.system.domain.TDeviceInfoS;
import org.apache.ibatis.annotations.Param;
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;
...@@ -100,7 +101,7 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -100,7 +101,7 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
* @param gettDeviceInfoS * @param gettDeviceInfoS
*/ */
@Override @Override
public void insertDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS) { public void insertDeviceDetailInfo(TDeviceInfoS gettDeviceInfoS) {
tDeviceInfoMapper.insertDeviceDetailInfo(gettDeviceInfoS); tDeviceInfoMapper.insertDeviceDetailInfo(gettDeviceInfoS);
} }
...@@ -114,4 +115,41 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -114,4 +115,41 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoMapper.getdeviceDetailInfo(deviceId); List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoMapper.getdeviceDetailInfo(deviceId);
return tDeviceInfoS; return tDeviceInfoS;
} }
/**
* 查询无绑定的 关联设备信息
* @return
*/
@Override
public List<TDeviceInfoS> selectDetailInfo(TDeviceInfoS tDeviceInfos) {
List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoMapper.selectDetailInfo(tDeviceInfos);
return tDeviceInfoS;
}
/**
* 关联设备数据删除接口
* @param deviceIds
*/
@Override
public void deleteDetailInfo(Long[] deviceIds) {
tDeviceInfoMapper.deleteDetailInfo(deviceIds);
}
/**
* 关联设备数据删除接口 单条删除
* @param deviceId
*/
@Override
public void deleteDetailinfOS(int deviceId) {
tDeviceInfoMapper.deleteDetailinfOS(deviceId);
}
/**
* 将关联设备信息与设备进行绑定
* @param gettDeviceInfoS
*/
@Override
public void updatetRelationDeviceDetailInfo(@Param("gettDeviceInfoS")List<TDeviceInfoS> gettDeviceInfoS,@Param("id") Long id) {
tDeviceInfoMapper.updatetRelationDeviceDetailInfo(gettDeviceInfoS,id);
}
} }
...@@ -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.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
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.TWorkOrderMapper; import com.zehong.system.mapper.TWorkOrderMapper;
...@@ -54,6 +55,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -54,6 +55,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public int insertTWorkOrder(TWorkOrder tWorkOrder) public int insertTWorkOrder(TWorkOrder tWorkOrder)
{ {
tWorkOrder.setCreateTime(DateUtils.getNowDate()); tWorkOrder.setCreateTime(DateUtils.getNowDate());
tWorkOrder.setCreateBy(SecurityUtils.getUsername());
return tWorkOrderMapper.insertTWorkOrder(tWorkOrder); return tWorkOrderMapper.insertTWorkOrder(tWorkOrder);
} }
...@@ -67,6 +69,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -67,6 +69,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public int updateTWorkOrder(TWorkOrder tWorkOrder) public int updateTWorkOrder(TWorkOrder tWorkOrder)
{ {
tWorkOrder.setUpdateTime(DateUtils.getNowDate()); tWorkOrder.setUpdateTime(DateUtils.getNowDate());
tWorkOrder.setUpdateBy(SecurityUtils.getUsername());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder); return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
} }
......
...@@ -54,6 +54,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -54,6 +54,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where u.user_id = #{userId} where u.user_id = #{userId}
</select> </select>
<select id="getPostListByUserId" parameterType="Long" resultMap="SysPostResult">
select p.*
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult"> <select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
select p.post_id, p.post_name, p.post_code select p.post_id, p.post_name, p.post_code
from sys_post p from sys_post p
......
...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="enterpriseName" column="enterprise_name" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
...@@ -56,8 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -56,8 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, (CASE WHEN u.dept_id = '-2' THEN '政府部门'
left join sys_dept d on u.dept_id = d.dept_id ELSE enter.enterprise_name END)AS enterprise_name from sys_user u
LEFT JOIN t_enterprise_info enter ON u.dept_id = enter.enterprise_id
where u.del_flag = '0' where u.del_flag = '0'
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%') AND u.user_name like concat('%', #{userName}, '%')
...@@ -74,9 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -74,9 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if> </if>
<if test="deptId != null and deptId != 0"> <!--<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if> </if>-->
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
...@@ -179,4 +181,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -179,4 +181,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<select id="getInspectionUsers" parameterType="java.util.Map" resultMap="SysUserResult">
SELECT
u.user_id,
u.dept_id,
u.user_name
FROM
sys_user u
LEFT JOIN sys_user_post up ON u.user_id = up.user_id
LEFT JOIN sys_post p ON up.post_id = p.post_id
<where>
<if test="enterpriseId != null and enterpriseId != 0">
AND u.dept_id = #{enterpriseId}
</if>
<if test="postCode !=null and postCode != ''">
AND p.post_code = #{postCode}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if> <if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if> <if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if>
</where> </where>
group by a.device_id desc
</select> </select>
<select id="selectTDeviceInfoById" parameterType="Long" resultMap="TDeviceInfoResult"> <select id="selectTDeviceInfoById" parameterType="Long" resultMap="TDeviceInfoResult">
...@@ -149,13 +150,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -149,13 +150,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</update> </update>
<!--添加关联设备信息表数据-->
<insert id="insertDeviceDetailInfo" parameterType="java.util.List"> <insert id="insertDeviceDetailInfo">
INSERT INTO t_relation_device_detail_info (relation_device_id,device_name,device_model,device_type,iot_no) INSERT INTO t_relation_device_detail_info (relation_device_id,device_name,device_model,device_type,iot_no,remarks)
VALUES VALUES
<foreach collection="list" item="item" index="key" separator=","> (#{relationDeviceId},#{deviceName},#{deviceModel},#{deviceType},#{iotNo},#{remarksn})
(#{item.relationDeviceId},#{item.deviceName},#{item.deviceModel},#{item.deviceType},#{item.iotNo})
</foreach>
</insert> </insert>
<!--获取设备详细信息列表--> <!--获取设备详细信息列表-->
...@@ -164,4 +163,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -164,4 +163,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from t_relation_device_detail_info where relation_device_id =#{deviceId} from t_relation_device_detail_info where relation_device_id =#{deviceId}
</select> </select>
<!--查询无绑定的 关联设备信息-->
<select id="selectDetailInfo" resultMap="TDeviceInfoResultS">
select relation_device_detail_id,relation_device_id,device_name,device_model,iot_no,remarks, (CASE device_type WHEN '1' THEN '压力表' WHEN '2' THEN '流量计' end) as device_type
from t_relation_device_detail_info where is_del='0' and relation_device_id is null
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceModel != null and deviceModel != ''"> and device_model like concat('%', #{deviceModel}, '%')</if>
<if test="iotNo != null and iotNo != ''"> and iot_no like concat('%', #{iotNo}, '%')</if>
group by relation_device_detail_id desc
</select>
<!--关联设备数据删除接口-->
<update id="deleteDetailInfo">
update t_relation_device_detail_info set is_del='1' where relation_device_detail_id in
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
#{deviceId}
</foreach>
</update>
<!--关联设备数据删除接口 单条删除-->
<update id="deleteDetailinfOS">
update t_relation_device_detail_info set is_del='1' where relation_device_detail_id = #{deviceId}
</update>
<!--将关联设备信息与设备进行绑定-->
<update id="updatetRelationDeviceDetailInfo" parameterType="java.util.List">
update t_relation_device_detail_info set relation_device_id = #{id}
where
relation_device_detail_id in
<foreach collection="gettDeviceInfoS" item="items" index="key" open="(" separator="," close=")">
#{items.relationDeviceDetailId}
</foreach>
</update>
</mapper> </mapper>
...@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="responsibleUnit" column="responsible_unit" /> <result property="responsibleUnit" column="responsible_unit" />
<result property="responsiblePeople" column="responsible_people" /> <result property="responsiblePeople" column="responsible_people" />
<result property="isDeal" column="is_deal" /> <result property="isDeal" column="is_deal" />
<result property="happenDate" column="happen_date" />
<result property="dealDate" column="deal_date" /> <result property="dealDate" column="deal_date" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
...@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTTroubleStandingBookVo"> <sql id="selectTTroubleStandingBookVo">
select trouble_id, trouble_name, trouble_location, longitude, latitude, trouble_type, brief_process, trouble_reason, responsible_unit, responsible_people, is_deal, deal_date, create_by, create_time, update_by, update_time, is_del, remarks from t_trouble_standing_book select trouble_id, trouble_name, trouble_location, longitude, latitude, trouble_type, brief_process, trouble_reason, responsible_unit, responsible_people, is_deal,happen_date, deal_date, create_by, create_time, update_by, update_time, is_del, remarks from t_trouble_standing_book
</sql> </sql>
<select id="selectTTroubleStandingBookList" parameterType="TTroubleStandingBookForm" resultMap="TTroubleStandingBookResult"> <select id="selectTTroubleStandingBookList" parameterType="TTroubleStandingBookForm" resultMap="TTroubleStandingBookResult">
...@@ -35,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -35,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="troubleName != null and troubleName != ''"> and trouble_name like concat('%', #{troubleName}, '%')</if> <if test="troubleName != null and troubleName != ''"> and trouble_name like concat('%', #{troubleName}, '%')</if>
<if test="troubleType != null and troubleType != ''"> and trouble_type = #{troubleType}</if> <if test="troubleType != null and troubleType != ''"> and trouble_type = #{troubleType}</if>
<if test="isDeal != null and isDeal != ''"> and is_deal = #{isDeal}</if> <if test="isDeal != null and isDeal != ''"> and is_deal = #{isDeal}</if>
<if test="happenDateStart != null "> and happen_date &gt;= #{happenDateStart}</if>
<if test="happenDateEnd != null "> and happen_date &lt;= #{happenDateEnd}</if>
<if test="dealDateStart != null "> and deal_date &gt;= #{dealDateStart}</if> <if test="dealDateStart != null "> and deal_date &gt;= #{dealDateStart}</if>
<if test="dealDateEnd != null "> and deal_date &lt;= #{dealDateEnd}</if> <if test="dealDateEnd != null "> and deal_date &lt;= #{dealDateEnd}</if>
</where> </where>
...@@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="responsibleUnit != null">responsible_unit,</if> <if test="responsibleUnit != null">responsible_unit,</if>
<if test="responsiblePeople != null">responsible_people,</if> <if test="responsiblePeople != null">responsible_people,</if>
<if test="isDeal != null">is_deal,</if> <if test="isDeal != null">is_deal,</if>
<if test="happenDate != null">happen_date,</if>
<if test="dealDate != null">deal_date,</if> <if test="dealDate != null">deal_date,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
...@@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="responsibleUnit != null">#{responsibleUnit},</if> <if test="responsibleUnit != null">#{responsibleUnit},</if>
<if test="responsiblePeople != null">#{responsiblePeople},</if> <if test="responsiblePeople != null">#{responsiblePeople},</if>
<if test="isDeal != null">#{isDeal},</if> <if test="isDeal != null">#{isDeal},</if>
<if test="happenDate != null">#{happenDate},</if>
<if test="dealDate != null">#{dealDate},</if> <if test="dealDate != null">#{dealDate},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
...@@ -100,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -100,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="responsibleUnit != null">responsible_unit = #{responsibleUnit},</if> <if test="responsibleUnit != null">responsible_unit = #{responsibleUnit},</if>
<if test="responsiblePeople != null">responsible_people = #{responsiblePeople},</if> <if test="responsiblePeople != null">responsible_people = #{responsiblePeople},</if>
<if test="isDeal != null">is_deal = #{isDeal},</if> <if test="isDeal != null">is_deal = #{isDeal},</if>
<if test="happenDate != null">happen_date = #{happenDate},</if>
<if test="dealDate != null">deal_date = #{dealDate},</if> <if test="dealDate != null">deal_date = #{dealDate},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
...@@ -61,9 +61,39 @@ export function selectTEnterprise() { ...@@ -61,9 +61,39 @@ export function selectTEnterprise() {
} }
// 关联设备详情信息 // 关联设备详情信息
export function getDdeviceDetailInfo(deviceId) { export function getDdeviceDetailInfo(data) {
return request({ return request({
url: '/device/device/getdeviceDetailInfo' + deviceId, url: '/device/device/selectDetailInfo',
method: 'get' method: 'post',
data:data
}) })
} }
// 新增关联设备信息
export function addDetailInfos(data) {
return request({
url: '/device/device/insertDetailInfo',
method: 'post',
data: data
})
}
// 删除关联设备信息
export function deleteDetailInfo(deviceId) {
return request({
url: '/device/device/deleteDetailInfo',
method: 'delete',
data:deviceId
})
}
// 删除关联设备信息
export function deleteeListDetailInfo(deviceId) {
return request({
url: '/device/device/deleteeListDetailInfo',
method: 'delete',
data: deviceId
})
}
...@@ -9,6 +9,17 @@ export function listInfo(query) { ...@@ -9,6 +9,17 @@ export function listInfo(query) {
}) })
} }
// 查询企业所有信息
export function enterpriseLists(query) {
return request({
url: '/regulation/info/enterpriseLists',
method: 'get',
params: query
})
}
// 查询企业信息详细 // 查询企业信息详细
export function getInfo(enterpriseId) { export function getInfo(enterpriseId) {
return request({ return request({
......
...@@ -51,3 +51,12 @@ export function exportPost(query) { ...@@ -51,3 +51,12 @@ export function exportPost(query) {
params: query params: query
}) })
} }
//查询所有岗位
export function optionselect(query) {
return request({
url: '/system/post/optionselect',
method: 'get',
params: query
})
}
...@@ -125,3 +125,17 @@ export function importTemplate() { ...@@ -125,3 +125,17 @@ export function importTemplate() {
method: 'get' method: 'get'
}) })
} }
//获取用户巡检员
export function getInspectionUsers(enterpriseId,postCode) {
const data = {
enterpriseId,
postCode
}
return request({
url: '/system/user/getInspectionUsers',
method: 'get',
params: data
})
}
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
class="upload-file-uploader" class="upload-file-uploader"
:class="{ hide: fileArr.length>0 ||addShow }" :class="{ hide: fileArr.length>0 ||addShow }"
ref="upload" ref="upload"
:disabled="readOnly"
> >
<!-- 上传按钮 --> <!-- 上传按钮 -->
<!-- <el-button size="mini" icon="" type="primary"></el-button> --> <!-- <el-button size="mini" icon="" type="primary"></el-button> -->
...@@ -95,6 +96,7 @@ export default { ...@@ -95,6 +96,7 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
readOnly: false
}, },
data() { data() {
return { return {
......
...@@ -9,6 +9,8 @@ const user = { ...@@ -9,6 +9,8 @@ const user = {
roles: [], roles: [],
permissions: [], permissions: [],
systemSetting:{}, systemSetting:{},
posts: [],
enterpriseId: ''
}, },
mutations: { mutations: {
...@@ -29,6 +31,12 @@ const user = { ...@@ -29,6 +31,12 @@ const user = {
}, },
SET_SYSTEMSETTING: (state, systemSetting) => { SET_SYSTEMSETTING: (state, systemSetting) => {
state.systemSetting = systemSetting state.systemSetting = systemSetting
},
SET_POSTS: (state, posts) => {
state.posts = posts
},
SET_ENTERPRISEID: (state,enterpriseId) =>{
state.enterpriseId = enterpriseId
} }
}, },
...@@ -67,6 +75,8 @@ const user = { ...@@ -67,6 +75,8 @@ const user = {
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
// 默认配置 // 默认配置
commit('SET_SYSTEMSETTING', res.systemSetting) commit('SET_SYSTEMSETTING', res.systemSetting)
commit('SET_POSTS',res.posts)
commit('SET_ENTERPRISEID',user.deptId)
console.log(res.systemSetting) console.log(res.systemSetting)
resolve(res) resolve(res)
}).catch(error => { }).catch(error => {
......
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">泽宏后台管理系统</h3> <h3 class="title">泽宏后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
...@@ -15,7 +29,11 @@ ...@@ -15,7 +29,11 @@
placeholder="密码" placeholder="密码"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
> >
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> <svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
...@@ -26,19 +44,27 @@ ...@@ -26,19 +44,27 @@
style="width: 63%" style="width: 63%"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
> >
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> <svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</el-form-item> </el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> <el-checkbox
<el-form-item style="width:100%;"> v-model="loginForm.rememberMe"
style="margin: 0px 0px 25px 0px"
>记住密码</el-checkbox
>
<el-form-item style="width: 100%">
<el-button <el-button
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
style="width:100%;" style="width: 100%"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
> >
<span v-if="!loading">登 录</span> <span v-if="!loading">登 录</span>
...@@ -54,9 +80,9 @@ ...@@ -54,9 +80,9 @@
</template> </template>
<script> <script>
import { getCodeImg } from "@/api/login"; import { getCodeImg,getInfo } from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from "@/utils/jsencrypt";
export default { export default {
name: "Login", name: "Login",
...@@ -69,29 +95,30 @@ export default { ...@@ -69,29 +95,30 @@ export default {
password: "admin123", password: "admin123",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "" uuid: "",
}, },
loginRules: { loginRules: {
username: [ username: [
{ required: true, trigger: "blur", message: "用户名不能为空" } { required: true, trigger: "blur", message: "用户名不能为空" },
], ],
password: [ password: [
{ required: true, trigger: "blur", message: "密码不能为空" } { required: true, trigger: "blur", message: "密码不能为空" },
],
code: [
{ required: true, trigger: "change", message: "验证码不能为空" },
], ],
code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
}, },
loading: false, loading: false,
redirect: undefined redirect: undefined,
}; };
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function (route) {
this.redirect = route.query && route.query.redirect; this.redirect = route.query && route.query.redirect;
}, },
immediate: true immediate: true,
} },
}, },
created() { created() {
this.getCode(); this.getCode();
...@@ -99,7 +126,7 @@ export default { ...@@ -99,7 +126,7 @@ export default {
}, },
methods: { methods: {
getCode() { getCode() {
getCodeImg().then(res => { getCodeImg().then((res) => {
this.codeUrl = "data:image/gif;base64," + res.img; this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid; this.loginForm.uuid = res.uuid;
}); });
...@@ -107,36 +134,55 @@ export default { ...@@ -107,36 +134,55 @@ export default {
getCookie() { getCookie() {
const username = Cookies.get("username"); const username = Cookies.get("username");
const password = Cookies.get("password"); const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get("rememberMe");
this.loginForm = { this.loginForm = {
username: username === undefined ? this.loginForm.username : username, username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password), password:
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}; };
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
if (this.loginForm.rememberMe) { if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); Cookies.set("password", encrypt(this.loginForm.password), {
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else { } else {
Cookies.remove("username"); Cookies.remove("username");
Cookies.remove("password"); Cookies.remove("password");
Cookies.remove('rememberMe'); Cookies.remove("rememberMe");
}
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
console.log("登录", res);
// 获取权限
return getInfo();
})
.then((res) => {
const roles = res.user.deptId;
let path = "/";
// 如果是最高权限,就进入大屏
if (roles == -2) {
path = "/bigWindow";
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$router.push({ path }).catch(() => {});
this.$router.push({ path: "/bigWindow" || "/" }).catch(()=>{}); })
}).catch(() => { .catch(() => {
this.loading = false; this.loading = false;
this.getCode(); this.getCode();
}); });
} }
}); });
} },
} },
}; };
</script> </script>
......
<template>
<el-dialog title="任务下发" :visible.sync="dialogVisible" width="900px" append-to-body>
<el-form ref="workForm" :model="workForm" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props:{
workForm:{},
dialogVisible:false
},
data() {
return {
}
},
created() {
console.log("dsaadddd=============>",this.workForm)
},
methods: {
submitForm(){
},
cancel(){
}
}
}
</script>
<style lang="scss" scoped>
</style>
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
</el-form-item> </el-form-item>
<el-form-item label="任务状态" prop="workStatus"> <el-form-item label="任务状态" prop="workStatus">
<el-select v-model="queryParams.workStatus" placeholder="请选择任务状态" clearable size="small"> <el-select v-model="queryParams.workStatus" placeholder="请选择任务状态" clearable size="small">
<el-option label="派发中" value="1" /> <el-option label="派发中" value="0" />
<el-option label="反馈" value="2" /> <el-option label="已接单" value="1" />
<el-option label="归档" value="3" /> <el-option label="已反馈" value="2" />
<el-option label="已归档" value="3" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -81,28 +82,42 @@ ...@@ -81,28 +82,42 @@
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="任务标题" align="center" prop="workTitle" /> <el-table-column label="任务标题" align="center" prop="workTitle" />
<el-table-column label="任务类型" align="center" prop="workType" /> <el-table-column label="任务类型" align="center" prop="workType">
<el-table-column label="任务内容" align="center" prop="workContent" /> <template slot-scope="scope">
<span v-if="scope.row.workType == 1">入户安检</span>
<span v-if="scope.row.workType == 2">巡检</span>
<span v-if="scope.row.workType == 3">报警巡查</span>
<span v-if="scope.row.workType == 4">其他</span>
</template>
</el-table-column>
<!-- <el-table-column label="任务内容" align="center" prop="workContent" />-->
<el-table-column label="创建单位" align="center" prop="workCreateEnterpriseName" /> <el-table-column label="创建单位" align="center" prop="workCreateEnterpriseName" />
<el-table-column label="指派单位" align="center" prop="workAssignEnterproseName" /> <el-table-column label="指派单位" align="center" prop="workAssignEnterproseName" />
<el-table-column label="指派人" align="center" prop="workAssignManId" /> <el-table-column label="指派人" align="center" prop="workAssignMan" />
<el-table-column label="任务状态" align="center" prop="workStatus" /> <el-table-column label="任务状态" align="center" prop="workStatus">
<el-table-column label="巡检时间" align="center" prop="inspectionDate" width="180"> <template slot-scope="scope">
<span v-if="scope.row.workStatus == 0">派发中</span>
<span v-if="scope.row.workStatus == 1">已接单</span>
<span v-if="scope.row.workStatus == 2">已反馈</span>
<span v-if="scope.row.workStatus == 3">已归档</span>
</template>
</el-table-column>>
<!--<el-table-column label="巡检时间" align="center" prop="inspectionDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="巡检路线" align="center" prop="inspectionRoute" /> <el-table-column label="巡检路线" align="center" prop="inspectionRoute" />-->
<el-table-column label="问题描述" align="center" prop="problemDescription" /> <!--<el-table-column label="问题描述" align="center" prop="problemDescription" />
<el-table-column label="问题图片" align="center" prop="pictureUrl" style="text-align:center;"> <el-table-column label="问题图片" align="center" prop="pictureUrl" style="text-align:center;">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.iconUrl" style="width: 20%;vertical-align:middle;cursor:pointer;" @click="showPicture(scope.row)"/> <img :src="scope.row.iconUrl" style="width: 20%;vertical-align:middle;cursor:pointer;" @click="showPicture(scope.row)"/>
<el-image :ref="'a'+scope.row.workId" :src="scope.row.iconUrl" v-show="false" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null"></el-image> <el-image :ref="'a'+scope.row.workId" :src="scope.row.iconUrl" v-show="false" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null"></el-image>
</template> </template>
</el-table-column> </el-table-column>-->
<!--<el-table-column label="图片路径" align="center" prop="iconUrl" />--> <!--<el-table-column label="图片路径" align="center" prop="iconUrl" />-->
<el-table-column label="整改方案" align="center" prop="rectificationPlan" /> <!-- <el-table-column label="整改方案" align="center" prop="rectificationPlan" />
<el-table-column label="整改结果" align="center" prop="rectificationResult" /> <el-table-column label="整改结果" align="center" prop="rectificationResult" />-->
<el-table-column label="责任单位" align="center" prop="responsibleUnit" /> <el-table-column label="责任单位" align="center" prop="responsibleUnit" />
<el-table-column label="责任人员" align="center" prop="responsiblePerson" /> <el-table-column label="责任人员" align="center" prop="responsiblePerson" />
<el-table-column label="截止日期" align="center" prop="expiryDate" width="180"> <el-table-column label="截止日期" align="center" prop="expiryDate" width="180">
...@@ -110,22 +125,14 @@ ...@@ -110,22 +125,14 @@
<span>{{ parseTime(scope.row.expiryDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.expiryDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" min-width="150%">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="'admin'==$store.state.user.roles[0] && scope.row.workAssignMan == null && scope.row.workStatus == '1'" <el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:order:edit']"
>任务下发</el-button>
<el-button v-if="'admin'==$store.state.user.roles[0] && scope.row.workStatus == '1'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="workDetail(scope.row)"
v-hasPermi="['system:order:edit']" >详情</el-button>
>接单</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -140,6 +147,30 @@ ...@@ -140,6 +147,30 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:order:remove']" v-hasPermi="['system:order:remove']"
>删除</el-button> >删除</el-button>
<el-button v-if="'inpector'!= roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null) && scope.row.workStatus == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="workIssue(scope.row)"
>任务下发</el-button>
<el-button v-if=" 'inpector'== roleType && scope.row.workStatus == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="takingOrder(scope.row)"
>接单</el-button>
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '1'"
size="mini"
type="text"
icon="el-icon-edit"
@click="feedbookWork(scope.row)"
>反馈</el-button>
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '2'"
size="mini"
type="text"
icon="el-icon-edit"
@click="sortWork(scope.row)"
>归档</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -153,17 +184,17 @@ ...@@ -153,17 +184,17 @@
/> />
<!-- 添加或修改燃气任务对话框 --> <!-- 添加或修改燃气任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" @closed="dialogClose" @open="dialogOpen">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="任务标题" prop="workTitle"> <el-form-item label="任务标题" prop="workTitle">
<el-input v-model="form.workTitle" placeholder="请输入任务标题" /> <el-input v-model="form.workTitle" placeholder="请输入任务标题" :disabled="isDetail"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="任务类型" prop="workType"> <el-form-item label="任务类型" prop="workType">
<el-select v-model="form.workType" placeholder="请选择任务类型" style="width: 350px"> <el-select v-model="form.workType" placeholder="请选择任务类型" style="width: 350px" :disabled="isDetail">
<el-option label="入户安检" value="1" /> <el-option label="入户安检" value="1" />
<el-option label="巡检" value="2" /> <el-option label="巡检" value="2" />
<el-option label="报警巡查" value="3" /> <el-option label="报警巡查" value="3" />
...@@ -172,60 +203,88 @@ ...@@ -172,60 +203,88 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="任务内容"> <el-form-item label="任务内容" prop="workContent">
<editor v-model="form.workContent" :min-height="192"/> <!--<editor v-model="form.workContent" :min-height="192" :readOnly="!s"/>-->
<editor v-if="isOpen" v-model="form.workContent" :min-height="192" :readOnly="isDetail"/>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="指派单位" prop="workAssignEnterproseName"> <el-form-item label="指派单位" prop="workAssignEnterproseName">
<el-input v-model="form.workAssignEnterproseName" placeholder="请输入指派单位名称" /> <!--<el-input v-model="form.workAssignEnterproseName" placeholder="请输入指派单位名称" />-->
<el-select v-model="form.workAssignEnterproseId" placeholder="请选择指派单位名称" style="width: 350px" @change="selectworkAssignEnterprose($event)" :disabled="isDetail">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="指派人" prop="workAssignManId"> <el-form-item label="指派人" prop="workAssignMan">
<el-input v-model="form.workAssignManId" placeholder="请输入指派人" /> <!--<el-input v-model="form.workAssignManId" placeholder="请输入指派人" />-->
<el-select v-model="form.workAssignManId" placeholder="请输入指派人" style="width: 350px" @change="selectInspection($event,'edit')" :disabled="isDetail">
<el-option
v-for="item in inspectors"
:key="item.userId "
:label="item.userName"
:value="item.userId "
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-form-item label="巡检时间" prop="inspectionDate"> <el-col :span="12">
<el-form-item label="创建单位" prop="inspectionDate">
<el-input v-model="form.workCreateEnterpriseName" placeholder="请输入创建单位名称" :disabled="isDetail"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检时间" prop="inspectionDate" v-show="form.workType=='2'">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="form.inspectionDate" v-model="form.inspectionDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择巡检时间" style="width: 350px"> placeholder="选择巡检时间" style="width: 350px" :disabled="isDetail">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="巡检路线" prop="inspectionRoute"> </el-col>
<el-input v-model="form.inspectionRoute" type="textarea" placeholder="请输入巡检路线" /> </el-row>
<el-form-item label="巡检路线" prop="inspectionRoute" v-show="form.workType=='2'">
<el-input v-model="form.inspectionRoute" type="textarea" placeholder="请输入巡检路线" :disabled="isDetail"/>
</el-form-item> </el-form-item>
<el-form-item label="问题描述" prop="problemDescription"> <el-form-item label="问题描述" prop="problemDescription">
<el-input v-model="form.problemDescription" type="textarea" placeholder="请输入问题描述" /> <el-input v-model="form.problemDescription" type="textarea" placeholder="请输入问题描述" :disabled="isDetail"/>
</el-form-item>
<el-form-item label="整改方案" prop="rectificationPlan" v-show="form.workType=='3' && isDetail && (form.workStatus =='2' || form.workStatus =='3')">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" :disabled="isDetail"/>
</el-form-item> </el-form-item>
<el-form-item label="问题图片" prop="iconUrl"> <el-form-item label="反馈图片" prop="iconUrl" v-show="isDetail && (form.workStatus =='2' || form.workStatus =='3')">
<MyFileUpload <MyFileUpload
listType="picture-card" listType="picture-card"
@resFun="getFileInfo" @resFun="getFileInfo"
@remove="listRemove" @remove="listRemove"
:fileArr="fileList" :fileArr="fileList"
:readOnly= "isDetail"
/> />
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input> <el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="整改方案" prop="rectificationPlan"> <el-form-item label="反馈信息" prop="rectificationResult" v-show="isDetail && (form.workStatus =='2' || form.workStatus =='3')">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" /> <el-input v-model="form.rectificationResult" type="textarea" placeholder="请输入整改结果" :disabled="isDetail"/>
</el-form-item>
<el-form-item label="整改结果" prop="rectificationResult">
<el-input v-model="form.rectificationResult" type="textarea" placeholder="请输入整改结果" />
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任单位" prop="responsibleUnit"> <el-form-item label="责任单位" prop="responsibleUnit">
<el-input v-model="form.responsibleUnit" placeholder="请输入责任单位" /> <el-input v-model="form.responsibleUnit" placeholder="请输入责任单位" :disabled="isDetail"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任人员" prop="responsiblePerson"> <el-form-item label="责任人员" prop="responsiblePerson">
<el-input v-model="form.responsiblePerson" placeholder="请输入责任人员" /> <el-input v-model="form.responsiblePerson" placeholder="请输入责任人员" :disabled="isDetail"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -235,15 +294,114 @@ ...@@ -235,15 +294,114 @@
v-model="form.expiryDate" v-model="form.expiryDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择截止日期" style="width: 350px"> placeholder="选择截止日期" style="width: 350px" :disabled="isDetail">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm" v-show="!isDetail"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 任务下发 -->
<el-dialog :title="title" :visible.sync="workOpen" width="900px" append-to-body>
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="任务标题" prop="workTitle">
<!-- <el-input v-model="workForm.workTitle" placeholder="请输入任务标题"/>-->
<span>{{ workForm.workTitle }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<span v-if="workForm.workType == '1'">入户安检</span>
<span v-if="workForm.workType == '2'">巡检</span>
<span v-if="workForm.workType == '3'">报警巡查</span>
<span v-if="workForm.workType == '4'">其他</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="指派单位" prop="workAssignEnterproseName">
<!--<el-input v-model="form.workAssignEnterproseName" placeholder="请输入指派单位名称" />-->
<el-select v-model="workForm.workAssignEnterproseId" placeholder="请选择指派单位名称" style="width: 350px" @change="selectworkAssignEnterprose($event)">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指派人" prop="workAssignMan">
<!--<el-input v-model="form.workAssignManId" placeholder="请输入指派人" />-->
<el-select v-model="workForm.workAssignManId" placeholder="请输入指派人" style="width: 350px" @change="selectInspection($event,'work')">
<el-option
v-for="item in inspectors"
:key="item.userId "
:label="item.userName"
:value="item.userId "
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitWorkForm"> </el-button>
<el-button @click="cancelWorkForm"> </el-button>
</div>
</el-dialog>
<!-- 反馈 -->
<el-dialog :title="title" :visible.sync="feedBookOpen" width="900px" append-to-body>
<el-form ref="feedBookForm" :model="feedBookForm" :rules="feedBookRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="任务标题" prop="workTitle">
<!--<el-input v-model="feedBookForm.workTitle" placeholder="请输入任务标题"/>-->
<span>{{feedBookForm.workTitle}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<span v-if="feedBookForm.workType == '1'">入户安检</span>
<span v-if="feedBookForm.workType == '2'">巡检</span>
<span v-if="feedBookForm.workType == '3'">报警巡查</span>
<span v-if="feedBookForm.workType == '4'">其他</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="整改方案" prop="rectificationPlan" v-show="feedBookForm.workType=='3'">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" />
</el-form-item>
<el-form-item label="反馈图片" prop="iconUrl">
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
:readOnly= "isDetail"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<el-form-item label="反馈信息" prop="rectificationResult">
<el-input v-model="form.rectificationResult" type="textarea" placeholder="反馈信息" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFeedBookForm"> </el-button>
<el-button @click="cancelFeedBook"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -251,18 +409,25 @@ ...@@ -251,18 +409,25 @@
import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/operationMonitor/order"; import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/operationMonitor/order";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import MyFileUpload from '@/components/MyFileUpload'; import MyFileUpload from '@/components/MyFileUpload';
import { enterpriseLists } from "@/api/regulation/info";
import { getInspectionUsers } from "@/api/system/user";
import ScrollPane from "../../../layout/components/TagsView/ScrollPane";
export default { export default {
name: "Order", name: "Order",
components: { components: {
ScrollPane,
Editor, Editor,
MyFileUpload MyFileUpload
}, },
data() { data() {
return { return {
isOpen:false,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
detailDialogVisible: false,
workForm: {},
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -279,8 +444,14 @@ export default { ...@@ -279,8 +444,14 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
//企业选项
enterprises: [],
//巡检员
inspectors:[],
// 上传文件列表 // 上传文件列表
fileList: [], fileList: [],
//详情
isDetail: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -311,13 +482,71 @@ export default { ...@@ -311,13 +482,71 @@ export default {
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
} workTitle: [
{ required: true, message: "任务标题", trigger: "blur" }
],
workType: [
{ required: true, message: "任务类型", trigger: "blur" }
],
workContent: [
{ required: true, message: "任务内容", trigger: "blur" }
],
workAssignEnterproseName: [
{ required: true, message: "指派单位", trigger: "blur" }
],
expiryDate: [
{ required: true, message: "截止时间", trigger: "blur" }
]
},
//任务下发表单校验
workRules: {
workAssignEnterproseName: [
{ required: true, message: "指派单位", trigger: "blur" }
],
workAssignMan: [
{ required: true, message: "指派人", trigger: "blur" }
]
},
//反馈校验
feedBookRules: {
iconUrl: [
{ required: true, message: "指派单位", trigger: "blur" }
],
rectificationResult: [
{ required: true, message: "指派人", trigger: "blur" }
]
},
roleType: "zhengfu",
workForm:{},
workOpen: false,
feedBookForm: {},
feedBookOpen: false
}; };
}, },
created() { created() {
window.func=()=>{
this.isDetail =!this.isDetail;
}
this.getList(); this.getList();
let enterpriseId = this.$store.state.user.enterpriseId;
let post = this.$store.state.user.posts.find(item => item.postCode === "se");
if(-2 != enterpriseId){
if(post){
this.roleType = "inpector";
}else{
this.roleType = "enterprise";
}
}
}, },
methods: { methods: {
dialogClose(){
this.isOpen=false;
},
dialogOpen(){
this.isOpen=true;
},
/** 查询燃气任务列表 */ /** 查询燃气任务列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -384,17 +613,22 @@ export default { ...@@ -384,17 +613,22 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.isDetail = false;
this.title = "添加燃气任务"; this.title = "添加燃气任务";
this.getEnterpriseLists();
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const workId = row.workId || this.ids const workId = row.workId || this.ids
this.isDetail = false;
getOrder(workId).then(response => { getOrder(workId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改燃气任务"; this.title = "修改燃气任务";
}); });
this.getEnterpriseLists();
this.getInspectionUserList(row.workAssignEnterproseId);
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
...@@ -454,7 +688,169 @@ export default { ...@@ -454,7 +688,169 @@ export default {
}, },
showPicture(row){ showPicture(row){
this.$refs['a'+row.workId].showViewer = true; this.$refs['a'+row.workId].showViewer = true;
},
//指派单位
getEnterpriseLists(){
enterpriseLists().then(response => {
this.enterprises = response.rows;
});
},
//获取巡检员
getInspectionUserList(enterpriseId){
getInspectionUsers(enterpriseId,"se").then(response =>{
this.inspectors = response.data;
})
},
//选择指派单位
selectworkAssignEnterprose(enterpriseId){
this.form.workAssignManId = "";
this.workForm.workAssignManId = "";
this.getInspectionUserList(enterpriseId);
let enterpriseName = this.enterprises.find(val=>val.enterpriseId == enterpriseId).enterpriseName;
this.form.workAssignEnterproseName = enterpriseName;
},
//获取指派人
selectInspection(userId,type){
let userName = this.inspectors.find(val=>val.userId == userId).userName;
if("edit" == type){
this.form.workAssignMan = userName;
}else{
this.workForm.workAssignMan = userName;
}
},
/*//选择任务类型
selectWorkType(workType){
if("2" == workType){
this.inspectorInfoIsShow = true;
}else{
this.inspectorInfoIsShow = false;
}
},*/
//详情
workDetail(row){
this.isDetail=true;
this.open = true;
this.title = "燃气任务详情";
this.form = row;
this.getEnterpriseLists();
this.getInspectionUserList(row.workAssignEnterproseId);
},
//任务下发
workIssue(row){
this.title = "任务下发";
this.workForm.workId = row.workId;
this.workForm.workTitle = row.workTitle;
this.workForm.workType = row.workType;
if(row.workAssignEnterproseId){
this.workForm.workAssignEnterproseId = row.workAssignEnterproseId;
this.workForm.workAssignEnterproseName = row.workAssignEnterproseName;
} }
if(row.workAssignManId){
this.workForm.workAssignManId = row.workAssignManId;
this.workForm.workAssignMan = row.workAssignMan;
}
//this.workForm = row;
this.workForm.workStatus = '1';
this.workOpen = true;
this.getEnterpriseLists();
this.getInspectionUserList(row.workAssignEnterproseId);
},
//接单
takingOrder(row){
this.$confirm('是否确认接单?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.workForm = {};
this.workForm.workId = row.workId;
this.workForm.workStatus = '1';
if (this.workForm.workId != null) {
updateOrder(this.workForm);
}
}).then(response => {
this.getList();
this.msgSuccess("接单成功");
}).catch(() => {});
},
//反馈
feedbookWork(row){
this.title = "反馈信息";
this.feedBookOpen = true;
this.feedBookForm.workId = row.workId;
this.feedBookForm.workTitle = row.workTitle;
this.feedBookForm.workType = row.workType;
if(row.iconUrl){
this.feedBookForm.iconUrl = row.iconUrl;
}
if(row.rectificationPlan){
this.feedBookForm.rectificationPlan = row.rectificationPlan;
}
if(row.rectificationResult){
this.feedBookForm.rectificationResult = row.rectificationResult;
}
//this.feedBookForm = row;
this.getEnterpriseLists();
},
//归档
sortWork(row){
this.$confirm('是否确认归档?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.workForm = {};
this.workForm.workId = row.workId;
this.workForm.workStatus = '3';
if (this.workForm.workId != null) {
updateOrder(this.workForm);
}
}).then(response => {
this.getList();
this.msgSuccess("归档成功");
}).catch(() => {});
},
//任务下发提交
submitWorkForm() {
this.$refs["workForm"].validate(valid => {
if (valid) {
if (this.workForm.workId != null) {
updateOrder(this.workForm).then(response => {
this.msgSuccess("任务下发成功");
this.workOpen = false;
this.getList();
});
}
}
});
},
//任务下发取消
cancelWorkForm(){
this.workOpen = false;
this.workForm = {};
},
//反馈提交
submitFeedBookForm(){
this.$refs["feedBookForm"].validate(valid => {
if (valid) {
if (this.feedBookForm.workId != null) {
this.feedBookForm.workStatus = '2';
updateOrder(this.feedBookForm).then(response => {
this.msgSuccess("反馈成功");
this.feedBookOpen = false;
this.getList();
});
}
}
});
},
//反馈取消
cancelFeedBook(){
this.feedBookOpen = false;
this.feedBookForm = {};
},
} }
}; };
</script> </script>
...@@ -123,61 +123,255 @@ ...@@ -123,61 +123,255 @@
@pagination="getList" @pagination="getList"
/> />
<!--选择关联设备弹出框-->
<el-dialog title="选择关联设备" :visible.sync="dialogTableVisible" formLabelWidth="160px">
<template>
<el-form :model="dateQueryParams" ref="queryForm" :inline="true" v-show="showSearch" >
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="dateQueryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备型号" prop="deviceCode">
<el-input
v-model="dateQueryParams.deviceModel"
placeholder="请输入设备型号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物联网编号" prop="deviceAddr">
<el-input
v-model="dateQueryParams.iotNo"
placeholder="请输入物联网编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryData">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryDate">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="dialogFormVisible = true"
v-hasPermi="['device:device:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['device:device:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="deleteListDetailInfo"
v-hasPermi="['device:device:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['device:device:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getDataList"></right-toolbar>
</el-row>
<el-table v-loading="loadings" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" max-height="250" @selection-change="tableDataSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDetailInfo(scope.row)"
v-hasPermi="['device:device:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="insertListDetailInfo"> </el-button>
<el-button @click="dialogTableVisible=false"> </el-button>
</div>
</template>
</el-dialog>
<!--添加关联设备弹出框-->
<el-dialog title="添加关联设备" :visible.sync="dialogFormVisible">
<el-form ref="formDetailInfo" :model="formDetailInfo" :rules="formDetailInfoRules" label-width="95px" style="height: 230px">
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="formDetailInfo.deviceName" placeholder="请输入设备名称" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="formDetailInfo.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo" >
<el-input v-model="formDetailInfo.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarksn">
<el-input v-model="formDetailInfo.remarksn" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addDetailInfo"> </el-button>
<el-button @click="dialogFormVisible=false"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改设备信息对话框 --> <!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="11">
<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="请输入设备名称" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备编号" prop="deviceCode"> <el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" /> <el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr"> <el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" /> <el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel"> <el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" /> <el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType"> <el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型"> <el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-option label="阀井" value="1" /> <el-option label="阀井" value="1" />
<el-option label="调压箱" value="2" /> <el-option label="调压箱" value="2" />
<el-option label="巡检员" value="3" />
<el-option label="视频" value="4" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<!-- <el-form-item label="权属单位" prop="beyondEnterpriseId">--> <el-col :span="11">
<!-- <el-input v-model="form.beyondEnterpriseId" placeholder="请输入权属单位" />--> <el-form-item label="权属单位" prop="beyondEnterpriseId">
<!-- </el-form-item>-->
<!-- <el-form-item label="权属单位名称" prop="beyondEnterpriseName">-->
<!-- <el-input v-model="form.beyondEnterpriseName" placeholder="请输入权属单位名称" />-->
<!-- </el-form-item>-->
<el-form-item label="权属单位" prop="beyondEnterpriseName">
<el-select v-model="form.beyondEnterpriseId" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable> <el-select v-model="form.beyondEnterpriseId" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable>
<el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId"> <el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="经度" prop="longitude"> <el-form-item label="经度" prop="longitude">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.longitude" placeholder="请输入经度" /> <el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.longitude" placeholder="请输入经度" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="纬度" prop="latitude"> <el-form-item label="纬度" prop="latitude">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.latitude" placeholder="请输入纬度" /> <el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="设备图片路径" prop="iconUrl"> <el-form-item label="设备图片路径" prop="iconUrl">
<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.iconUrl" type="textarea" placeholder="请输入图片路径" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="联系人" prop="linkman"> <el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" /> <el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="电话" prop="phone"> <el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" /> <el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="安装时间" prop="installationTime"> <el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="form.installationTime" v-model="form.installationTime"
...@@ -186,6 +380,9 @@ ...@@ -186,6 +380,9 @@
placeholder="选择安装时间"> placeholder="选择安装时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="最后巡检时间" prop="inspectionTime"> <el-form-item label="最后巡检时间" prop="inspectionTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="form.inspectionTime" v-model="form.inspectionTime"
...@@ -194,60 +391,49 @@ ...@@ -194,60 +391,49 @@
placeholder="选择最后巡检时间"> placeholder="选择最后巡检时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" /> <el-input v-model="form.remarks" type="textarea" placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<h3>关联设备</h3>
<el-table v-loading="loadings" ref="multipleTable" :data="DetailInfoList" tooltip-effect="dark" style="width: 100%" max-height="250" @selection-change="tableDataSelectionChange">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDataListilInfo(scope.row,scope.$index)"
v-hasPermi="['device:device:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!--自增关联设备信息--> <div slot="footer" class="dialog-footer">
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic" > <el-button type="primary" @click="selectDataListInfo">选择关联设备</el-button>
<div v-for="(domain, index) in dynamicValidateForm.domains" :key="domain.key"> <el-button type="primary" @click="submitForm"> </el-button>
<el-divider content-position="left">关联设备</el-divider> <el-button @click="cancel"> </el-button>
<el-form-item label="设备名称" prop="deviceModel">
<el-input v-model="domain.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="domain.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceModel" >
<el-select v-model="domain.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
</el-select>
</el-form-item>
<el-form-item label="物联网编号" prop="deviceModel">
<el-input v-model="domain.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="备注" prop="remarks" >
<el-input v-model="domain.remarksn" placeholder="请输入备注" />
</el-form-item>
<el-button @click.prevent="removeDomain(domain)">删除</el-button>
</div> </div>
<el-form-item>
<el-button type="primary" @click="submitForm('dynamicValidateForm')">提交</el-button>
<el-button @click="addDomain">新增关联设备</el-button>
</el-form-item>
</el-form>
<!--表单提交-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice, selectTEnterprise } from "@/api/regulation/device"; import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice, selectTEnterprise,getDdeviceDetailInfo,addDetailInfos,deleteDetailInfo,deleteeListDetailInfo } from "@/api/regulation/device";
export default { export default {
name: "Device", name: "Device",
...@@ -255,6 +441,37 @@ export default { ...@@ -255,6 +441,37 @@ export default {
}, },
data() { data() {
return { return {
/**弹出层*/
//下级设备数据数组
tableData: [],
//存储已被选中的下级数据id
DetailInfoListId :[],
//存储已经选中的下级关联数据
DetailInfoList:[],
multipleSelection: [],
dialogTableVisible: false,
dialogFormVisible: false,
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
formLabelWidth: '120px',
/*添加关联设备*/
formDetailInfo:{
relationDeviceDetailId:'',
deviceName: '',
deviceModel:'',
deviceType:'',
iotNo:'',
remarksn:''
},
/*动态添加输入框*/
dynamicValidateForm: { dynamicValidateForm: {
domains: [{ domains: [{
deviceName: '', deviceName: '',
...@@ -267,6 +484,8 @@ export default { ...@@ -267,6 +484,8 @@ export default {
// 遮罩层 // 遮罩层
loading: true, loading: true,
//下级数据的遮罩层
loadings:true,
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 选中数组 // 选中数组
...@@ -279,6 +498,8 @@ export default { ...@@ -279,6 +498,8 @@ export default {
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
//下级关联设备条数
detailTotal:0,
// 设备信息表格数据 // 设备信息表格数据
deviceList: [], deviceList: [],
// 弹出层标题 // 弹出层标题
...@@ -293,6 +514,17 @@ export default { ...@@ -293,6 +514,17 @@ export default {
deviceCode: null, deviceCode: null,
deviceAddr: null, deviceAddr: null,
}, },
// 查询参数
dateQueryParams: {
deviceName: null,
deviceModel: null,
iotNo: null,
},
//下级参数
detailInfoParams:{
pageNum: 1,
pageSize: 10,
},
// 表单参数 // 表单参数
form: {}, form: {},
// 关联设备表单参数 // 关联设备表单参数
...@@ -301,7 +533,43 @@ export default { ...@@ -301,7 +533,43 @@ export default {
test: {}, test: {},
// 表单校验 // 表单校验
rules: { rules: {
} deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
deviceCode: [
{ required: true, message: "请输入设备编号", trigger: "blur" },
],
deviceAddr: [
{ required: true, message: "请输入所在地址", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
beyondEnterpriseId: [
{ required: true, message: "请选择权属单位", trigger: "blur" },
],
},
//关联设备下级数据 表单校验
formDetailInfoRules:{
deviceName:[
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
deviceModel:[
{ required: true, message: "请输入设备型号", trigger: "blur" },
],
deviceType:[
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
iotNo:[
{ required: true, message: "请输入联网编号", trigger: "blur" },
],
remarksn:[
{ required: true, message: "请输入备注", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
...@@ -310,12 +578,26 @@ export default { ...@@ -310,12 +578,26 @@ export default {
methods: { methods: {
/** 查询设备信息列表 */ /** 查询设备信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listDevice(this.queryParams).then(response => { listDevice(this.queryParams).then(response => {
this.deviceList = response.rows; this.deviceList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
},
/**查询下级数据列表方法*/
getDataList(){
this.loadings = true;
// console.log(this.dateQueryParams)
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
//下级设备数据 到时候换成下级数据
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
...@@ -347,37 +629,60 @@ export default { ...@@ -347,37 +629,60 @@ export default {
isDel: null, isDel: null,
remarks: null remarks: null
}; };
this.forms = {
deviceName:null,
deviceModel:null,
deviceType:null,
iotNo:null,
remarksn:null
}
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 下级数据搜索*/
handleQueryData(){
this.getDataList();
},
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 下级数据重置按钮操作 搜索框重置*/
resetQueryDate(){
this.dateQueryParams={
deviceName: null,
deviceModel: null,
iotNo: null,
}
},
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.deviceId) this.ids = selection.map(item => item.deviceId)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
//关联数据多选框选中数据
tableDataSelectionChange(selection){
this.ids = selection.map(item => item.relationDeviceDetailId)
this.datalist=selection.map(item => item)
//按钮 非选中禁用
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
//查询企业名称下拉框数据 //查询企业名称下拉框数据
selectTEnterprise().then(response => { selectTEnterprise().then(response => {
this.test = response.data; this.test = response.data;
}); });
this.loadings = true;
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
//下级设备数据 到时候换成下级数据
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加设备信息"; this.title = "添加设备信息";
...@@ -388,12 +693,13 @@ export default { ...@@ -388,12 +693,13 @@ export default {
selectTEnterprise().then(response => { selectTEnterprise().then(response => {
this.test = response.data; this.test = response.data;
}); });
const deviceId = row.deviceId || this.ids
//查询关联设备信息数据 //查询关联设备信息数据
getDdeviceDetailInfo().then(response => { // getDdeviceDetailInfo(deviceId).then(response => {
this.dynamicValidateForm.domains = response.data; // this.dynamicValidateForm.domains = response.data;
}); // });
this.reset(); this.reset();
const deviceId = row.deviceId || this.ids
getDevice(deviceId).then(response => { getDevice(deviceId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
...@@ -403,6 +709,7 @@ export default { ...@@ -403,6 +709,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const deviceIds = row.deviceId || this.ids; const deviceIds = row.deviceId || this.ids;
// const deviceIds = row.relationDeviceDetailId || this.ids;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", { this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
...@@ -447,11 +754,8 @@ export default { ...@@ -447,11 +754,8 @@ export default {
this.dynamicValidateForm.domains.splice(index, 1) this.dynamicValidateForm.domains.splice(index, 1)
} }
}, },
/**提交数据方法*/ /**提交数据方法*/
submitForm(formName) { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
...@@ -461,11 +765,13 @@ export default { ...@@ -461,11 +765,13 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
//获取已经选中的下级设备id
const deviceIds = this.ids;
// alert(deviceIds)
var tDeviceInfon={ var tDeviceInfon={
tDeviceInfo:this.form, tDeviceInfo:this.form,
tDeviceInfoS:this.dynamicValidateForm.domains tDeviceInfoS:this.datalist
} }
addDevice(JSON.stringify(tDeviceInfon)).then(response => { addDevice(JSON.stringify(tDeviceInfon)).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
...@@ -476,13 +782,109 @@ export default { ...@@ -476,13 +782,109 @@ export default {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
} }
});
} }
} }
}); });
}, },
/**关联设备添加方法*/
addDetailInfo(){
this.$refs["formDetailInfo"].validate(valid => {
if (valid) {
addDetailInfos(this.formDetailInfo).then(response => {
// this.tableData.push(this.formDetailInfo)
//关闭弹出层
this.dialogFormVisible = false;
//数据表单重置
this.formDetailInfo={
deviceName: null,
deviceModel:null,
deviceType:null,
iotNo:null,
remarksn:null
};
this.getDataList();
this.msgSuccess("新增成功");
});
}
});
},
/**关联设备单条删除方法*/
deleteDetailInfo(row){
const deviceIds = row.relationDeviceDetailId;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteDetailInfo(deviceIds);
}).then(() => {
// this.tableData.splice(index,1);
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**关联设备已经选中数据删除方法*/
deleteDataListilInfo(row,index){
this.DetailInfoList.splice(index,1);
},
/**
* 批量删除关联设备方法
* @param row
*/
deleteListDetailInfo(row){
const deviceIds = this.ids;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteeListDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**添加关联设备与设备绑定的数据 (存储到数组中)*/
insertListDetailInfo(row){
//获取已经选中的下级设备id
const deviceIds = this.ids;
const li=this.datalist;
this.$confirm('是否确认添加关联设备信息?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
// this.DetailInfoList.push(this.datalist)
//清空数组数据 将之前的数据清空
this.DetailInfoListId.splice(row);
this.DetailInfoList=this.datalist;
//添加到数组中 以便下次使用
this.DetailInfoListId.push(deviceIds);
// alert(this.DetailInfoListId)
this.dialogTableVisible=false
this.msgSuccess("添加成功");
}).catch(() => {});
},
/**
* 选择关联设备查询方法
*/
selectDataListInfo(){
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
//下级设备数据 到时候换成下级数据
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
//打开选择关联设备弹出框
this.dialogTableVisible = true
});
}
} }
}; };
</script> </script>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<!-- 添加或修改燃气用户对话框 --> <!-- 添加或修改燃气用户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="用户账号" prop="username"> <el-form-item label="用户账号" prop="username">
<el-input v-model="form.username" placeholder="请输入用户账号" /> <el-input v-model="form.username" placeholder="请输入用户账号" />
</el-form-item> </el-form-item>
......
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
<el-form-item label="安装时间" prop="installTime"> <el-form-item label="安装时间" prop="installTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="queryParams.installTimeStart" v-model="queryParams.installTimeStart"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
placeholder="请选择起始时间"> placeholder="请选择起始时间">
</el-date-picker><span style="color: #bebfc3"> - </span> </el-date-picker><span style="color: #bebfc3"> - </span>
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="queryParams.installTimeEnd" v-model="queryParams.installTimeEnd"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
placeholder="请选择截止时间"> placeholder="请选择截止时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
/> />
<!-- 添加或修改用户加装安全装置台账对话框 --> <!-- 添加或修改用户加装安全装置台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel"> <el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @cancel="cancel1">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
...@@ -159,8 +159,8 @@ ...@@ -159,8 +159,8 @@
<el-form-item label="安装时间" prop="installTime"> <el-form-item label="安装时间" prop="installTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="form.installTime" v-model="form.installTime"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
placeholder="请选择安装时间" placeholder="请选择安装时间"
style="width: 100%"> style="width: 100%">
</el-date-picker> </el-date-picker>
...@@ -175,11 +175,54 @@ ...@@ -175,11 +175,54 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel1">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="title2" :visible.sync="open2" width="800px" append-to-body @cancel="cancel2">
<el-form ref="detailForm" :model="detailForm" label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="用户名称:">
<font>{{detailForm.userName}}</font>
</el-form-item>
<el-form-item label="身份证号:">
<font>{{detailForm.idCard}}</font>
</el-form-item>
<el-form-item label="品牌名称:">
<font v-if="detailForm.brandName != '' && detailForm.brandName != null">{{detailForm.brandName}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用户编号:">
<font v-if="detailForm.userNo != '' && detailForm.userNo != null">{{detailForm.userNo}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="联系电话:">
<font>{{detailForm.linkMobile}}</font>
</el-form-item>
<el-form-item label="安装时间:">
<font>{{detailForm.installTime}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="详细地址:">
<font>{{detailForm.userAddress}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:">
<font v-if="detailForm.remarks != '' && detailForm.remarks != null">{{detailForm.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
...@@ -209,9 +252,11 @@ export default { ...@@ -209,9 +252,11 @@ export default {
// 用户加装安全装置台账表格数据 // 用户加装安全装置台账表格数据
equipmentList: [], equipmentList: [],
// 弹出层标题 // 弹出层标题
title: "", title1: "",
title2: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open1: false,
open2: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -224,6 +269,7 @@ export default { ...@@ -224,6 +269,7 @@ export default {
}, },
// 表单参数 // 表单参数
form: {}, form: {},
detailForm: {},
// 表单校验 // 表单校验
rules: { rules: {
userName: [ userName: [
...@@ -260,12 +306,16 @@ export default { ...@@ -260,12 +306,16 @@ export default {
}); });
}, },
// 取消按钮 // 取消按钮
cancel() { cancel1() {
this.open = false; this.open1 = false;
this.reset(); this.reset1();
},
cancel2() {
this.open2 = false;
this.reset2();
}, },
// 表单重置 // 表单重置
reset() { reset1() {
this.form = { this.form = {
safeEquipmentId: null, safeEquipmentId: null,
userName: null, userName: null,
...@@ -284,6 +334,25 @@ export default { ...@@ -284,6 +334,25 @@ export default {
}; };
this.resetForm("form"); this.resetForm("form");
}, },
reset2() {
this.detailForm = {
safeEquipmentId: null,
userName: null,
userNo: null,
userAddress: null,
idCard: null,
linkMobile: null,
installTime: null,
brandName: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("detailForm");
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -296,18 +365,17 @@ export default { ...@@ -296,18 +365,17 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset1();
this.open = true; this.open1 = true;
this.title = "添加用户加装安全装置台账"; this.title1 = "添加用户加装安全装置台账";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset1();
getEquipment(row.safeEquipmentId).then(response => { getEquipment(row.safeEquipmentId).then(response => {
console.log("data",response.data);
this.form = response.data; this.form = response.data;
this.open = true; this.open1 = true;
this.title = "修改用户加装安全装置台账"; this.title1 = "修改用户加装安全装置台账";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -362,12 +430,12 @@ export default { ...@@ -362,12 +430,12 @@ export default {
}, },
/** 详细信息跳转 */ /** 详细信息跳转 */
showDetail(row) { showDetail(row) {
this.$router.push({ this.reset2();
path: '/standingBook/equipmentDetail', getEquipment(row.safeEquipmentId).then(response => {
query: { this.detailForm = response.data;
safeEquipmentId: row.safeEquipmentId this.open2 = true;
} this.title2 = "用户加装安全装置台账详情";
}) });
}, },
} }
}; };
......
<template>
<div class="app-container">
<!--<el-row>
<el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
<div style="height: 45px;" @click="$router.go(-1)">
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
</el-button>
</div>
</el-col>
</el-row>-->
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul>
<li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">燃气用户加装安全装置台账详情</li>
</ul>
</div>
</el-col>
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="用户名称:" prop="userName">
<font>{{form.userName}}</font>
</el-form-item>
<el-form-item label="身份证号:" prop="idCard">
<font>{{form.idCard}}</font>
</el-form-item>
<el-form-item label="品牌名称:" prop="brandName">
<font v-if="form.brandName != '' && form.brandName != null">{{form.brandName}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="用户编号:" prop="userNo">
<font v-if="form.userNo != '' && form.userNo != null">{{form.userNo}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="联系电话:" prop="linkMobile">
<font>{{form.linkMobile}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installTime">
<font>{{form.installTime}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="详细地址:" prop="userAddress">
<font>{{form.userAddress}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-row>
</div>
</template>
<script>
import { getEquipment } from "@/api/standingBook/equipment";
export default {
name: "equipmentDetail",
components: {
},
data() {
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.safeEquipmentId = this.$route.query.safeEquipmentId;
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
getEquipment(this.safeEquipmentId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
const obj =this.form;
});
},
}
}
</script>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
/> />
<!-- 添加或修改隐患整治台账对话框 --> <!-- 添加或修改隐患整治台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel"> <el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @cancel="cancel1">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
...@@ -169,7 +169,6 @@ ...@@ -169,7 +169,6 @@
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="经纬度坐标" prop="longitude"> <el-form-item label="经纬度坐标" prop="longitude">
<el-row>
<el-col :span="9"> <el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" /> <el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col> </el-col>
...@@ -179,7 +178,6 @@ ...@@ -179,7 +178,6 @@
<el-col :span="3" style="margin-left: 30px"> <el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button> <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col> </el-col>
</el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -231,10 +229,65 @@ ...@@ -231,10 +229,65 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel1">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="title2" :visible.sync="open2" width="800px" append-to-body @cancel="cancel2">
<el-form ref="detailForm" :model="detailForm" label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="隐患名称:">
<font>{{detailForm.hiddenTitle}}</font>
</el-form-item>
<el-form-item label="隐患发现人员:">
<font>{{detailForm.hiddenFindPeople}}</font>
</el-form-item>
<el-form-item label="隐患位置:">
<font>{{detailForm.hiddenLocation}}</font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患等级:">
<font v-if="detailForm.hiddenType == '1'">一级隐患</font>
<font v-if="detailForm.hiddenType == '2'">二级隐患</font>
<font v-if="detailForm.hiddenType == '3'">三级隐患</font>
</el-form-item>
<el-form-item label="发现时间:">
<font>{{detailForm.hiddenFindDate}}</font>
</el-form-item>
<el-form-item label="处理方案:">
<span
class="dbtn"
@click="checkFile(detailForm.dealPlanUrl)"
v-if="detailForm.dealPlan != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="隐患内容:">
<font>{{detailForm.hiddenContent}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="整治情况:">
<font v-if="detailForm.remediation != '' && detailForm.remediation != null">{{detailForm.remediation}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:">
<font v-if="detailForm.remarks != '' && detailForm.remarks != null">{{detailForm.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
<GetPos <GetPos
:dialogVisible.sync="dialogTableVisible" :dialogVisible.sync="dialogTableVisible"
device="" device=""
...@@ -279,9 +332,11 @@ export default { ...@@ -279,9 +332,11 @@ export default {
// 隐患整治台账表格数据 // 隐患整治台账表格数据
hiddenList: [], hiddenList: [],
// 弹出层标题 // 弹出层标题
title: "", title1: "",
title2: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open1: false,
open2: false,
// 隐患类型字典 // 隐患类型字典
typeOptions: [], typeOptions: [],
// 上传文件列表 // 上传文件列表
...@@ -300,6 +355,7 @@ export default { ...@@ -300,6 +355,7 @@ export default {
}, },
// 表单参数 // 表单参数
form: {}, form: {},
detailForm: {},
// 表单校验 // 表单校验
rules: { rules: {
hiddenTitle: [ hiddenTitle: [
...@@ -312,7 +368,7 @@ export default { ...@@ -312,7 +368,7 @@ export default {
{ required: true, message: "请输入隐患内容", trigger: "blur" }, { required: true, message: "请输入隐患内容", trigger: "blur" },
], ],
hiddenLocation: [ hiddenLocation: [
{ required: true, message: "请输入经纬度", trigger: "blur" }, { required: true, message: "请输入隐患位置", trigger: "blur" },
], ],
longitude: [ longitude: [
{ required: true, message: "请输入经纬度", trigger: "blur" }, { required: true, message: "请输入经纬度", trigger: "blur" },
...@@ -346,18 +402,25 @@ export default { ...@@ -346,18 +402,25 @@ export default {
}); });
}, },
// 取消按钮 // 取消按钮
cancel() { cancel1() {
this.open = false; this.open1 = false;
this.reset(); this.reset1();
this.fileList = []; this.fileList = [];
this.devicePos = [];
},
cancel2() {
this.open2 = false;
this.reset2();
}, },
// 表单重置 // 表单重置
reset() { reset1() {
this.form = { this.form = {
hiddenId: null, hiddenId: null,
hiddenTitle: null, hiddenTitle: null,
hiddenContent: null, hiddenContent: null,
hiddenLocation: null, hiddenLocation: null,
longitude:null,
latitude: null,
hiddenType: null, hiddenType: null,
hiddenFindPeople: null, hiddenFindPeople: null,
hiddenFindDate: null, hiddenFindDate: null,
...@@ -374,6 +437,28 @@ export default { ...@@ -374,6 +437,28 @@ export default {
this.fileList = []; this.fileList = [];
this.devicePos = []; this.devicePos = [];
}, },
reset2() {
this.detailForm = {
hiddenId: null,
hiddenTitle: null,
hiddenContent: null,
hiddenLocation: null,
longitude:null,
latitude: null,
hiddenType: null,
hiddenFindPeople: null,
hiddenFindDate: null,
dealPlan: null,
remediation: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("detailForm");
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -386,15 +471,14 @@ export default { ...@@ -386,15 +471,14 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset1();
this.open = true; this.open1 = true;
this.title = "添加隐患整治台账"; this.title1 = "添加隐患整治台账";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset1();
const hiddenId = row.hiddenId || this.ids getHidden(row.hiddenId).then(response => {
getHidden(hiddenId).then(response => {
this.form = response.data; this.form = response.data;
if (this.form.dealPlan) { if (this.form.dealPlan) {
this.fileList.push({ this.fileList.push({
...@@ -403,8 +487,8 @@ export default { ...@@ -403,8 +487,8 @@ export default {
}); });
} }
this.devicePos = [this.form.longitude, this.form.latitude]; this.devicePos = [this.form.longitude, this.form.latitude];
this.open = true; this.open1 = true;
this.title = "修改隐患整治台账"; this.title1 = "修改隐患整治台账";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -414,13 +498,13 @@ export default { ...@@ -414,13 +498,13 @@ export default {
if (this.form.hiddenId != null) { if (this.form.hiddenId != null) {
updateHidden(this.form).then(response => { updateHidden(this.form).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open1 = false;
this.getList(); this.getList();
}); });
} else { } else {
addHidden(this.form).then(response => { addHidden(this.form).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open1 = false;
this.getList(); this.getList();
}); });
} }
...@@ -459,12 +543,12 @@ export default { ...@@ -459,12 +543,12 @@ export default {
}, },
/** 详细信息跳转 */ /** 详细信息跳转 */
showDetail(row) { showDetail(row) {
this.$router.push({ this.reset2();
path: '/standingBook/hiddenDetail', getHidden(row.hiddenId).then(response => {
query: { this.detailForm = response.data;
hiddenId: row.hiddenId this.open2 = true;
} this.title2 = "隐患整治台账详情";
}) });
}, },
checkFile(url) { checkFile(url) {
window.open(url,'_blank'); window.open(url,'_blank');
...@@ -490,6 +574,8 @@ export default { ...@@ -490,6 +574,8 @@ export default {
this.dialogTableVisible = false; this.dialogTableVisible = false;
}, },
getPath(res){ getPath(res){
console.log("res", res);
console.log(this.form.longitude, this.form.latitude);
//确认选择经纬度 //确认选择经纬度
this.form.longitude = res[0]; this.form.longitude = res[0];
this.form.latitude = res[1]; this.form.latitude = res[1];
...@@ -500,13 +586,14 @@ export default { ...@@ -500,13 +586,14 @@ export default {
<style> <style>
.dbtn { .dbtn {
display: inline-block; display: inline-block;
padding: 2px 5px; line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer; cursor: pointer;
border-radius: 3px; border-radius: 3px;
border-style: solid; border-style: solid;
border-width: 0; border-width: 0;
color: rgb(48, 180, 107); color: rgb(48, 180, 107);
font-size: 9px;
} }
.dbtn:hover { .dbtn:hover {
border-width: 1px; border-width: 1px;
......
<template>
<div class="app-container">
<!--<el-row>
<el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
<div style="height: 45px;" @click="$router.go(-1)">
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
</el-button>
</div>
</el-col>
</el-row>-->
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul>
<li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">隐患整治台账详情</li>
</ul>
</div>
</el-col>
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="隐患名称:" prop="hiddenTitle">
<font>{{form.hiddenTitle}}</font>
</el-form-item>
<el-form-item label="隐患发现人员:" prop="hiddenFindPeople">
<font>{{form.hiddenFindPeople}}</font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="隐患等级:" prop="hiddenType">
<font v-if="form.hiddenType == '1'">一级隐患</font>
<font v-if="form.hiddenType == '2'">二级隐患</font>
<font v-if="form.hiddenType == '3'">三级隐患</font>
</el-form-item>
<el-form-item label="发现时间:" prop="hiddenFindDate">
<font>{{form.hiddenFindDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="隐患位置:" prop="hiddenLocation">
<font>{{form.hiddenLocation}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="隐患内容:" prop="hiddenContent">
<font>{{form.hiddenContent}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="整治情况:" prop="remediation">
<font v-if="form.remediation != '' && form.remediation != null">{{form.remediation}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-row>
</div>
</template>
<script>
import { getHidden } from "@/api/standingBook/hidden";
export default {
name: "hiddenDetail",
components: {
},
data() {
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.hiddenId = this.$route.query.hiddenId;
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
getHidden(this.hiddenId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
const obj =this.form;
});
},
}
}
</script>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否处理" prop="isDeal"> <el-form-item label="是否处理" prop="isDeal">
<el-select v-model="queryParams.isDeal" placeholder="请选择事故类型" clearable size="small"> <el-select v-model="queryParams.isDeal" placeholder="请选择是否处理" clearable size="small">
<el-option <el-option
v-for="dict in isDealOptions" v-for="dict in isDealOptions"
:key="dict.dictValue" :key="dict.dictValue"
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="处理完成时间" prop="dealDate"> <el-form-item label="事故发生时间" prop="happenDate">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="queryParams.dealDateStart" v-model="queryParams.happenDateStart"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择起始时间"> placeholder="请选择起始时间">
</el-date-picker><span style="color: #bebfc3"> - </span> </el-date-picker><span style="color: #bebfc3"> - </span>
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="queryParams.dealDateEnd" v-model="queryParams.happenDateEnd"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择截止时间"> placeholder="请选择截止时间">
...@@ -84,15 +84,16 @@ ...@@ -84,15 +84,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="事故地点" align="center" prop="troubleLocation" width="300px"/> <el-table-column label="事故地点" align="center" prop="troubleLocation" width="300px"/>
<el-table-column label="责任单位" align="center" prop="responsibleUnit" /> <el-table-column label="事故发生时间" align="center" prop="happenDate" width="180px"/>
<el-table-column label="责任人员" align="center" prop="responsiblePeople" /> <el-table-column label="责任单位" align="center" prop="responsibleUnit" width="150px"/>
<el-table-column label="责任人员" align="center" prop="responsiblePeople" width="150px"/>
<el-table-column label="是否处理" align="center" prop="isDeal" width="120px"> <el-table-column label="是否处理" align="center" prop="isDeal" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.isDeal == 1">已处理</span> <span v-if="scope.row.isDeal == 1">已处理</span>
<span v-if="scope.row.isDeal == 2">未处理</span> <span v-if="scope.row.isDeal == 2">未处理</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="处理完成时间" align="center" prop="dealDate" width="180px"/> <!-- <el-table-column label="处理完成时间" align="center" prop="dealDate" width="180px"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -129,7 +130,7 @@ ...@@ -129,7 +130,7 @@
/> />
<!-- 添加或修改事故台账对话框 --> <!-- 添加或修改事故台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel"> <el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @cancel="cancel1">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
...@@ -156,7 +157,6 @@ ...@@ -156,7 +157,6 @@
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
<el-form-item label="经纬度坐标" prop="longitude"> <el-form-item label="经纬度坐标" prop="longitude">
<el-row>
<el-col :span="9"> <el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" /> <el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col> </el-col>
...@@ -166,16 +166,26 @@ ...@@ -166,16 +166,26 @@
<el-col :span="3" style="margin-left: 30px"> <el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button> <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col> </el-col>
</el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="23"> <el-col :span="11">
<el-form-item label="事故原因" prop="troubleReason"> <el-form-item label="事故原因" prop="troubleReason">
<el-input v-model="form.troubleReason" placeholder="请输入事故原因" /> <el-input v-model="form.troubleReason" placeholder="请输入事故原因" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="事故发生时间" prop="happenDate">
<el-date-picker clearable size="small"
v-model="form.happenDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择事故发生时间"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
...@@ -228,10 +238,67 @@ ...@@ -228,10 +238,67 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel1">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="title2" :visible.sync="open2" width="800px" append-to-body @cancel="cancel2">
<el-form ref="detailForm" :model="detailForm" label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="事故名称:">
<font>{{detailForm.troubleName}}</font>
</el-form-item>
<el-form-item label="事故原因:">
<font>{{detailForm.troubleReason}}</font>
</el-form-item>
<el-form-item label="责任单位:">
<font v-if="detailForm.responsibleUnit != '' && detailForm.responsibleUnit != null">{{detailForm.responsibleUnit}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事故类型:">
<font v-if="detailForm.troubleType == '1'">安全生产事故</font>
<font v-if="detailForm.troubleType == '2'">非生产安全事故</font>
</el-form-item>
<el-form-item label="事故地点:">
<font>{{detailForm.troubleLocation}}</font>
</el-form-item>
<el-form-item label="责任人员:">
<font v-if="detailForm.responsiblePeople != '' && detailForm.responsiblePeople != null">{{detailForm.responsiblePeople}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="简要经过:">
<font v-if="detailForm.briefProcess != '' && detailForm.briefProcess != null">{{detailForm.briefProcess}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="是否处理:">
<font v-if="detailForm.isDeal == '1'">已处理</font>
<font v-if="detailForm.isDeal == '2'">未处理</font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处理完成时间:">
<font>{{detailForm.dealDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="备注信息:">
<font v-if="detailForm.remarks != '' && detailForm.remarks != null">{{detailForm.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
<GetPos <GetPos
:dialogVisible.sync="dialogTableVisible" :dialogVisible.sync="dialogTableVisible"
device="" device=""
...@@ -277,9 +344,11 @@ export default { ...@@ -277,9 +344,11 @@ export default {
dialogTableVisible: false, dialogTableVisible: false,
devicePos: [], devicePos: [],
// 弹出层标题 // 弹出层标题
title: "", title1: "",
title2: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open1: false,
open2: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -287,11 +356,14 @@ export default { ...@@ -287,11 +356,14 @@ export default {
troubleName: null, troubleName: null,
troubleType: null, troubleType: null,
isDeal: null, isDeal: null,
happenDateStart: null,
happenDateEnd: null,
dealDateStart: null, dealDateStart: null,
dealDateEnd: null dealDateEnd: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
detailForm: {},
// 表单校验 // 表单校验
rules: { rules: {
troubleName: [ troubleName: [
...@@ -306,6 +378,9 @@ export default { ...@@ -306,6 +378,9 @@ export default {
longitude: [ longitude: [
{ required: true, message: "请输入经纬度", trigger: "blur" }, { required: true, message: "请输入经纬度", trigger: "blur" },
], ],
happenDate: [
{ required: true, message: "请选择事故发生时间", trigger: "blur" },
],
troubleReason: [ troubleReason: [
{ required: true, message: "请输入事故原因", trigger: "blur" }, { required: true, message: "请输入事故原因", trigger: "blur" },
], ],
...@@ -338,22 +413,30 @@ export default { ...@@ -338,22 +413,30 @@ export default {
}); });
}, },
// 取消按钮 // 取消按钮
cancel() { cancel1() {
this.open = false; this.open1 = false;
this.reset(); this.reset1();
this.devicePos = [];
},
cancel2() {
this.open2 = false;
this.reset2();
}, },
// 表单重置 // 表单重置
reset() { reset1() {
this.form = { this.form = {
troubleId: null, troubleId: null,
troubleName: null, troubleName: null,
troubleLocation: null, troubleLocation: null,
longitude: null,
latitude: null,
troubleType: null, troubleType: null,
briefProcess: null, briefProcess: null,
troubleReason: null, troubleReason: null,
responsibleUnit: null, responsibleUnit: null,
responsiblePeople: null, responsiblePeople: null,
isDeal: null, isDeal: null,
happenDate: null,
dealDate: null, dealDate: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
...@@ -363,6 +446,31 @@ export default { ...@@ -363,6 +446,31 @@ export default {
remarks: null remarks: null
}; };
this.resetForm("form"); this.resetForm("form");
this.devicePos = [];
},
reset2() {
this.detailForm = {
troubleId: null,
troubleName: null,
troubleLocation: null,
longitude: null,
latitude: null,
troubleType: null,
briefProcess: null,
troubleReason: null,
responsibleUnit: null,
responsiblePeople: null,
isDeal: null,
happenDate: null,
dealDate: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("detailForm");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -376,19 +484,18 @@ export default { ...@@ -376,19 +484,18 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset1();
this.open = true; this.open1 = true;
this.title = "添加事故台账"; this.title1 = "添加燃气事故台账";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset1();
const troubleId = row.troubleId || this.ids getTrouble(row.troubleId).then(response => {
getTrouble(troubleId).then(response => {
this.form = response.data; this.form = response.data;
this.devicePos = [this.form.longitude, this.form.latitude]; this.devicePos = [this.form.longitude, this.form.latitude];
this.open = true; this.open1 = true;
this.title = "修改事故台账"; this.title1 = "修改燃气事故台账";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -443,12 +550,12 @@ export default { ...@@ -443,12 +550,12 @@ export default {
}, },
/** 详细信息跳转 */ /** 详细信息跳转 */
showDetail(row) { showDetail(row) {
this.$router.push({ this.reset2();
path: '/standingBook/troubleDetail', getTrouble(row.troubleId).then(response => {
query: { this.detailForm = response.data;
troubleId: row.troubleId this.open2 = true;
} this.title2 = "燃气事故台账详情";
}) });
}, },
MapdialogFun() { MapdialogFun() {
this.dialogTableVisible = true; this.dialogTableVisible = true;
...@@ -457,6 +564,8 @@ export default { ...@@ -457,6 +564,8 @@ export default {
this.dialogTableVisible = false; this.dialogTableVisible = false;
}, },
getPath(res){ getPath(res){
console.log("res", res);
console.log(this.form.longitude, this.form.latitude);
//确认选择经纬度 //确认选择经纬度
this.form.longitude = res[0]; this.form.longitude = res[0];
this.form.latitude = res[1]; this.form.latitude = res[1];
......
<template>
<div class="app-container">
<!--<el-row>
<el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
<div style="height: 45px;" @click="$router.go(-1)">
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
</el-button>
</div>
</el-col>
</el-row>-->
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul>
<li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">燃气事故台账详情</li>
</ul>
</div>
</el-col>
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="事故名称:" prop="troubleName">
<font>{{form.troubleName}}</font>
</el-form-item>
<el-form-item label="事故原因:" prop="troubleReason">
<font>{{form.troubleReason}}</font>
</el-form-item>
<el-form-item label="责任单位:" prop="responsibleUnit">
<font v-if="form.responsibleUnit != '' && form.responsibleUnit != null">{{form.responsibleUnit}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="事故类型:" prop="troubleType">
<font v-if="form.troubleType == '1'">安全生产事故</font>
<font v-if="form.troubleType == '2'">非生产安全事故</font>
</el-form-item>
<el-form-item label="事故地点:" prop="troubleLocation">
<font>{{form.troubleLocation}}</font>
</el-form-item>
<el-form-item label="责任人员:" prop="responsiblePeople">
<font v-if="form.responsiblePeople != '' && form.responsiblePeople != null">{{form.responsiblePeople}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="简要经过:" prop="briefProcess">
<font v-if="form.briefProcess != '' && form.briefProcess != null">{{form.briefProcess}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="是否处理:" prop="isDeal">
<font>{{form.isDeal}}</font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="处理完成时间:" prop="dealDate">
<font>{{form.dealDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-row>
</div>
</template>
<script>
import { getTrouble } from "@/api/standingBook/trouble";
export default {
name: "troubleDetail",
components: {
},
data() {
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.troubleId = this.$route.query.troubleId;
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
getTrouble(this.troubleId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
const obj =this.form;
});
},
}
}
</script>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-container"> <div class="app-container">
<el-row :gutter="20"> <el-row :gutter="20">
<!--部门数据--> <!--部门数据-->
<el-col :span="4" :xs="24"> <!-- <el-col :span="4" :xs="24">
<div class="head-container"> <div class="head-container">
<el-input <el-input
v-model="deptName" v-model="deptName"
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </div>
</el-col> </el-col>-->
<!--用户数据--> <!--用户数据-->
<el-col :span="20" :xs="24"> <el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName"> <el-form-item label="用户名称" prop="userName">
<el-input <el-input
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> <el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> <el-table-column label="所属单位" align="center" key="enterpriseName" prop="enterpriseName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible"> <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -214,8 +214,16 @@ ...@@ -214,8 +214,16 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="归属部门" prop="deptId"> <el-form-item label="所属单位" prop="deptId">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" /> <!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />-->
<el-select v-model="form.deptId" placeholder="请选择" @change="selectWorkUnit($event)">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -349,12 +357,15 @@ import { getToken } from "@/utils/auth"; ...@@ -349,12 +357,15 @@ import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { enterpriseLists } from "@/api/regulation/info";
import { optionselect } from "@/api/system/post";
export default { export default {
name: "User", name: "User",
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
zzz:'',
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
...@@ -389,8 +400,11 @@ export default { ...@@ -389,8 +400,11 @@ export default {
sexOptions: [], sexOptions: [],
// 岗位选项 // 岗位选项
postOptions: [], postOptions: [],
//企业选项
enterprises: [],
// 角色选项 // 角色选项
roleOptions: [], roleOptions: [],
// 表单参数 // 表单参数
form: {}, form: {},
defaultProps: { defaultProps: {
...@@ -467,7 +481,9 @@ export default { ...@@ -467,7 +481,9 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getTreeselect(); this.getPosts();
//this.getTreeselect();
//this.getEnterpriseLists();
this.getDicts("sys_normal_disable").then(response => { this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
...@@ -563,9 +579,10 @@ export default { ...@@ -563,9 +579,10 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.getTreeselect(); //this.getTreeselect();
this.getEnterpriseLists();
getUser().then(response => { getUser().then(response => {
this.postOptions = response.posts; //this.postOptions = response.posts;
this.roleOptions = response.roles; this.roleOptions = response.roles;
this.open = true; this.open = true;
this.title = "添加用户"; this.title = "添加用户";
...@@ -575,11 +592,13 @@ export default { ...@@ -575,11 +592,13 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.getTreeselect(); //this.getTreeselect();
this.getEnterpriseLists();
const userId = row.userId || this.ids; const userId = row.userId || this.ids;
getUser(userId).then(response => { getUser(userId).then(response => {
this.form = response.data; this.form = response.data;
this.postOptions = response.posts; this.getPosts();
//this.postOptions = response.posts;
this.roleOptions = response.roles; this.roleOptions = response.roles;
this.form.postIds = response.postIds; this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds; this.form.roleIds = response.roleIds;
...@@ -587,6 +606,7 @@ export default { ...@@ -587,6 +606,7 @@ export default {
this.title = "修改用户"; this.title = "修改用户";
this.form.password = ""; this.form.password = "";
}); });
}, },
/** 重置密码按钮操作 */ /** 重置密码按钮操作 */
handleResetPwd(row) { handleResetPwd(row) {
...@@ -674,6 +694,49 @@ export default { ...@@ -674,6 +694,49 @@ export default {
// 提交上传文件 // 提交上传文件
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
},
//查询所属单位
getEnterpriseLists(){
enterpriseLists().then(response => {
this.enterprises = response.rows;
this.enterprises.push({
enterpriseId: -2,
enterpriseName: "政府部门",
isDel: null
})
});
},
//选取所属单位
selectWorkUnit(val){
this.getPosts();
},
//获取岗位
getPosts(){
this.postOptions = [];
console.log(this.form.deptId,'dkdfsdfkfkfkfkfdkfdkfkfkdkdfk')
if(this.form.deptId == "-2"){
this.postOptions.push(
{
"searchValue": null,
"createBy": "admin",
"createTime": "2022-01-10 16:22:37",
"updateBy": null,
"updateTime": null,
"remark": "",
"params": {},
"postId": 1,
"postCode": "zhengfu",
"postName": "县级指挥",
"postSort": "1",
"status": "0",
"flag": false
}
)
return;
}
optionselect().then(response =>{
this.postOptions = response.data;
})
} }
} }
}; };
......
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