Commit 84e38404 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 611e698d 7617257a
......@@ -27,7 +27,7 @@ import com.zehong.common.core.page.TableDataInfo;
* @date 2022-03-24
*/
@RestController
@RequestMapping("/system/info")
@RequestMapping("/system/hidden")
public class THiddenTroubleInfoController extends BaseController
{
@Autowired
......@@ -36,7 +36,7 @@ public class THiddenTroubleInfoController extends BaseController
/**
* 查询燃气隐患列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@PreAuthorize("@ss.hasPermi('system:hidden:list')")
@GetMapping("/list")
public TableDataInfo list(THiddenTroubleInfo tHiddenTroubleInfo)
{
......@@ -53,7 +53,7 @@ public class THiddenTroubleInfoController extends BaseController
/**
* 导出燃气隐患列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@PreAuthorize("@ss.hasPermi('system:hidden:export')")
@Log(title = "燃气隐患", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(THiddenTroubleInfo tHiddenTroubleInfo)
......@@ -66,7 +66,7 @@ public class THiddenTroubleInfoController extends BaseController
/**
* 获取燃气隐患详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@PreAuthorize("@ss.hasPermi('system:hidden:query')")
@GetMapping(value = "/{hiddenTroubleId}")
public AjaxResult getInfo(@PathVariable("hiddenTroubleId") Long hiddenTroubleId)
{
......@@ -76,7 +76,7 @@ public class THiddenTroubleInfoController extends BaseController
/**
* 新增燃气隐患
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@PreAuthorize("@ss.hasPermi('system:hidden:add')")
@Log(title = "燃气隐患", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THiddenTroubleInfo tHiddenTroubleInfo)
......@@ -87,7 +87,7 @@ public class THiddenTroubleInfoController extends BaseController
/**
* 修改燃气隐患
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@PreAuthorize("@ss.hasPermi('system:hidden:edit')")
@Log(title = "燃气隐患", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THiddenTroubleInfo tHiddenTroubleInfo)
......@@ -98,7 +98,7 @@ public class THiddenTroubleInfoController extends BaseController
/**
* 删除燃气隐患
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@PreAuthorize("@ss.hasPermi('system:hidden:remove')")
@Log(title = "燃气隐患", businessType = BusinessType.DELETE)
@DeleteMapping("/{hiddenTroubleIds}")
public AjaxResult remove(@PathVariable Long[] hiddenTroubleIds)
......
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -40,6 +43,9 @@ public class TDetectorUserController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TDetectorUser tDetectorUser)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDetectorUser.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TDetectorUser> list = tDetectorUserService.selectTDetectorUserList(tDetectorUser);
return getDataTable(list);
......@@ -71,6 +77,9 @@ public class TDetectorUserController extends BaseController
@GetMapping("/export")
public AjaxResult export(TDetectorUser tDetectorUser)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDetectorUser.setBeyondEnterpriseId(user.getDeptId());
List<TDetectorUser> list = tDetectorUserService.selectTDetectorUserList(tDetectorUser);
ExcelUtil<TDetectorUser> util = new ExcelUtil<TDetectorUser>(TDetectorUser.class);
return util.exportExcel(list, "燃气用户数据");
......@@ -94,6 +103,9 @@ public class TDetectorUserController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody TDetectorUser tDetectorUser)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDetectorUser.setBeyondEnterpriseId(user.getDeptId());
return toAjax(tDetectorUserService.insertTDetectorUser(tDetectorUser));
}
......
......@@ -5,6 +5,8 @@ import java.util.List;
import java.util.Map;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.Listaw;
import com.zehong.system.domain.TDetailInfoList;
import com.zehong.system.domain.TDeviceInfoS;
......@@ -53,6 +55,9 @@ public class TDeviceInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TDeviceInfo tDeviceInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDeviceInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
return getDataTable(list);
......@@ -66,6 +71,9 @@ public class TDeviceInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TDeviceInfo tDeviceInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDeviceInfo.setBeyondEnterpriseId(user.getDeptId());
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
ExcelUtil<TDeviceInfo> util = new ExcelUtil<TDeviceInfo>(TDeviceInfo.class);
return util.exportExcel(list, "设备信息数据");
......@@ -95,7 +103,6 @@ public class TDeviceInfoController extends BaseController
listaw.gettDeviceInfo().setDeviceCode(intFlag);
//添加设备信息表数据 并且返回新增id
tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo());
if (CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())){
//将关联设备信息与设备进行绑定
tDeviceInfoService.updatetRelationDeviceDetailInfo(listaw.gettDeviceInfoS(),listaw.gettDeviceInfo().getDeviceId(),listaw.gettDeviceInfo().getRelationDeviceType());
......
......@@ -2,8 +2,9 @@ package com.zehong.web.controller.supervise;
import java.io.File;
import java.text.ParseException;
import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -37,6 +38,9 @@ public class TEmployedPeopleInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TEmployedPeopleInfo tEmployedPeopleInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEmployedPeopleInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TEmployedPeopleInfo> list = tEmployedPeopleInfoService.selectTEmployedPeopleInfoList(tEmployedPeopleInfo);
return getDataTable(list);
......@@ -50,6 +54,9 @@ public class TEmployedPeopleInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TEmployedPeopleInfo tEmployedPeopleInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEmployedPeopleInfo.setBeyondEnterpriseId(user.getDeptId());
List<TEmployedPeopleInfo> list = tEmployedPeopleInfoService.selectTEmployedPeopleInfoList(tEmployedPeopleInfo);
ExcelUtil<TEmployedPeopleInfo> util = new ExcelUtil<TEmployedPeopleInfo>(TEmployedPeopleInfo.class);
return util.exportExcel(list, "从业人员信息数据");
......@@ -122,7 +129,9 @@ public class TEmployedPeopleInfoController extends BaseController
@Log(title = "企业信息查询")
@RequestMapping("/selectTEnterprise")
public AjaxResult select(){
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise());
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise(user.getDeptId()));
}
......
package com.zehong.web.controller.system;
package com.zehong.web.controller.supervise;
import java.io.File;
import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.utils.file.FileUploadUtils;
import com.zehong.framework.config.ServerConfig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.framework.config.ServerConfig;
import com.zehong.system.domain.TEnterpriseInfo;
import com.zehong.system.service.ITEnterpriseInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import static com.zehong.common.utils.file.FileUtils.deleteFile;
import static org.apache.tomcat.util.http.fileupload.FileUtils.deleteDirectory;
import java.io.File;
import java.util.List;
/**
* 企业信息Controller
......@@ -45,10 +36,13 @@ public class TEnterpriseInfoController extends BaseController
/**
* 查询企业信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@PreAuthorize("@ss.hasPermi('regulation:info:list')")
@GetMapping("/list")
public TableDataInfo list(TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setEnterpriseId(user.getDeptId());
startPage();
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
......@@ -62,6 +56,9 @@ public class TEnterpriseInfoController extends BaseController
@GetMapping("/enterpriseLists")
public TableDataInfo enterpriseLists(TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setEnterpriseId(user.getDeptId());
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
}
......@@ -80,11 +77,14 @@ public class TEnterpriseInfoController extends BaseController
/**
* 导出企业信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@PreAuthorize("@ss.hasPermi('regulation:info:export')")
@Log(title = "企业信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setEnterpriseId(user.getDeptId());
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
ExcelUtil<TEnterpriseInfo> util = new ExcelUtil<TEnterpriseInfo>(TEnterpriseInfo.class);
return util.exportExcel(list, "企业信息数据");
......@@ -93,7 +93,7 @@ public class TEnterpriseInfoController extends BaseController
/**
* 获取企业信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@PreAuthorize("@ss.hasPermi('regulation:info:query')")
@GetMapping(value = "/{enterpriseId}")
public AjaxResult getInfo(@PathVariable("enterpriseId") Long enterpriseId)
{
......@@ -103,18 +103,21 @@ public class TEnterpriseInfoController extends BaseController
/**
* 新增企业信息
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@PreAuthorize("@ss.hasPermi('regulation:info:add')")
@Log(title = "企业信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setCreateEnterpriseId(user.getDeptId());
return toAjax(tEnterpriseInfoService.insertTEnterpriseInfo(tEnterpriseInfo));
}
/**
* 修改企业信息
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@PreAuthorize("@ss.hasPermi('regulation:info:edit')")
@Log(title = "企业信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TEnterpriseInfo tEnterpriseInfo)
......@@ -139,7 +142,7 @@ public class TEnterpriseInfoController extends BaseController
/**
* 删除企业信息
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@PreAuthorize("@ss.hasPermi('regulation:info:remove')")
@Log(title = "企业信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{enterpriseIds}")
public AjaxResult remove(@PathVariable Long[] enterpriseIds)
......
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,6 +46,9 @@ public class TPipeInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TPipeInfo tPipeInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tPipeInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TPipeInfo> list = tPipeInfoService.selectTPipeInfoList(tPipeInfo);
return getDataTable(list);
......@@ -56,6 +62,9 @@ public class TPipeInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TPipeInfo tPipeInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tPipeInfo.setBeyondEnterpriseId(user.getDeptId());
List<TPipeInfo> list = tPipeInfoService.selectTPipeInfoList(tPipeInfo);
ExcelUtil<TPipeInfo> util = new ExcelUtil<TPipeInfo>(TPipeInfo.class);
return util.exportExcel(list, "管道信息数据");
......
......@@ -44,6 +44,9 @@ public class TProjectInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TProjectInfo tProjectInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TProjectInfo> list = tProjectInfoService.selectTProjectInfoList(tProjectInfo);
return getDataTable(list);
......@@ -57,6 +60,9 @@ public class TProjectInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TProjectInfo tProjectInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
List<TProjectInfo> list = tProjectInfoService.selectTProjectInfoList(tProjectInfo);
ExcelUtil<TProjectInfo> util = new ExcelUtil<TProjectInfo>(TProjectInfo.class);
return util.exportExcel(list, "工程项目信息数据");
......@@ -79,17 +85,25 @@ public class TProjectInfoController extends BaseController
@Log(title = "工程项目信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProjectInfo tProjectInfo) throws ParseException {
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
//查询是否已经有重复的年份数据
List<TProjectInfo> tProjectInfos = tProjectInfoService.selectSameYear(tProjectInfo.getProjectYear());
List<TProjectInfo> tProjectInfos = tProjectInfoService.selectSameYear(tProjectInfo.getProjectYear(),tProjectInfo.getBeyondEnterpriseId());
//说明有重复的年份 将重复的年份删除
if (tProjectInfos.size()!=0){
//重复年份删除方法
tProjectInfoService.deleteisSameYear(tProjectInfo.getProjectYear());
tProjectInfoService.deleteisSameYear(tProjectInfo.getProjectYear(),tProjectInfo.getBeyondEnterpriseId());
}
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户所属单位
String enterpriseName = user.getEnterpriseName();
tProjectInfo.setEnterpriseCode(String.valueOf(enterpriseName));
if (user.getDeptId()!=-2){
//查询企业名称
String enterpriseName = tProjectInfoService.selectEnterpriseName(user.getDeptId());
tProjectInfo.setEnterpriseCode(String.valueOf(enterpriseName));
}else {
tProjectInfo.setEnterpriseCode("政府部门");
}
//添加企业
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
return toAjax(tProjectInfoService.insertTProjectInfo(tProjectInfo));
}
......
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTSiteStationInfoList;
import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.system.service.ITEmployedPeopleInfoService;
......@@ -49,6 +51,9 @@ public class TSiteStationInfoController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(TSiteStationInfo tSiteStationInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tSiteStationInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TSiteStationInfo> list = tSiteStationInfoService.selectTSiteStationInfoList(tSiteStationInfo);
return getDataTable(list);
......@@ -62,6 +67,9 @@ public class TSiteStationInfoController extends BaseController {
@GetMapping("/export")
public AjaxResult export(TSiteStationInfo tSiteStationInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tSiteStationInfo.setBeyondEnterpriseId(user.getDeptId());
List<TSiteStationInfo> list = tSiteStationInfoService.selectTSiteStationInfoList(tSiteStationInfo);
ExcelUtil<TSiteStationInfo> util = new ExcelUtil<TSiteStationInfo>(TSiteStationInfo.class);
return util.exportExcel(list, "场站信息数据");
......
......@@ -20,13 +20,15 @@ public class TDetectorUser extends BaseEntity
private Long userId;
/** 用户账号 */
@Excel(name = "用户账号")
private String username;
/** 用户名称 */
@Excel(name = "用户名称")
private String nickName;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 用户类型(1居民用户,2商业用户,3工业用户) */
@Excel(name = "用户类型")
private String userType;
......@@ -62,6 +64,18 @@ public class TDetectorUser extends BaseEntity
@Excel(name = "备注")
private String remarks;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Long getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public void setUserId(Long userId)
{
this.userId = userId;
......@@ -173,19 +187,20 @@ public class TDetectorUser extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("username", getUsername())
.append("nickName", getNickName())
.append("userType", getUserType())
.append("address", getAddress())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("linkman", getLinkman())
.append("phone", getPhone())
.append("email", getEmail())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
return "TDetectorUser{" +
"userId=" + userId +
", username='" + username + '\'' +
", nickName='" + nickName + '\'' +
", beyondEnterpriseId=" + beyondEnterpriseId +
", userType='" + userType + '\'' +
", address='" + address + '\'' +
", longitude=" + longitude +
", latitude=" + latitude +
", linkman='" + linkman + '\'' +
", phone='" + phone + '\'' +
", email='" + email + '\'' +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
'}';
}
}
......@@ -20,6 +20,9 @@ public class TEnterpriseInfo extends BaseEntity
/** 企业id */
private Long enterpriseId;
/**创建企业id*/
private Long createEnterpriseId;
/** 企业名称 */
@Excel(name = "企业名称")
private String enterpriseName;
......@@ -70,6 +73,14 @@ public class TEnterpriseInfo extends BaseEntity
/**本地存储图片路径*/
private String burl;
public Long getCreateEnterpriseId() {
return createEnterpriseId;
}
public void setCreateEnterpriseId(Long createEnterpriseId) {
this.createEnterpriseId = createEnterpriseId;
}
public String getBurl() {
return burl;
}
......@@ -210,6 +221,7 @@ public class TEnterpriseInfo extends BaseEntity
public String toString() {
return "TEnterpriseInfo{" +
"enterpriseId=" + enterpriseId +
", createEnterpriseId=" + createEnterpriseId +
", enterpriseName='" + enterpriseName + '\'' +
", registerAddress='" + registerAddress + '\'' +
", legalRepresentative='" + legalRepresentative + '\'' +
......
......@@ -83,7 +83,18 @@ public class THiddenTroubleInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
public void setHiddenTroubleId(Long hiddenTroubleId)
/**上报人名称*/
private String reportPersonName;
public String getReportPersonName() {
return reportPersonName;
}
public void setReportPersonName(String reportPersonName) {
this.reportPersonName = reportPersonName;
}
public void setHiddenTroubleId(Long hiddenTroubleId)
{
this.hiddenTroubleId = hiddenTroubleId;
}
......
......@@ -20,11 +20,11 @@ public class TPipeInfo extends BaseEntity
private Long pipeId;
/** 管道长度 */
@Excel(name = "管道长度")
@Excel(name = "管道长度(米)")
private BigDecimal pipeLength;
/** 管径 */
@Excel(name = "管径")
@Excel(name = "管径(厘米)")
private String pipeDiameter;
/** 压力 */
......@@ -36,7 +36,6 @@ public class TPipeInfo extends BaseEntity
private String pipeMaterial;
/** 管道地址 */
@Excel(name = "管道地址")
private String pipeAddr;
/** 埋深 */
......@@ -59,7 +58,6 @@ public class TPipeInfo extends BaseEntity
private String peopleOccupation;
/** 权属单位 */
@Excel(name = "权属单位")
private Long beyondEnterpriseId;
/** 权属单位名称 */
......
......@@ -23,33 +23,35 @@ public class TProjectInfo extends BaseEntity
/** 工程项目年度 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "工程项目年度", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "工程项目年度", width = 30, dateFormat = "yyyy")
private Date projectYear;
/**企业编码*/
@Excel(name = "企业名称")
private String enterpriseCode;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 门站地址 */
@Excel(name = "门站地址")
private String gateStationAddress;
/** 门站金额 */
@Excel(name = "门站金额")
@Excel(name = "门站投资额(万元)")
private BigDecimal gateStationInvestment;
/** 门站数量 */
@Excel(name = "门站数量")
@Excel(name = "门站数量(个)")
private Long numberGateStations;
/** 管道长度 */
@Excel(name = "管道长度")
@Excel(name = "管道长度(米)")
private Long pipeLength;
/** 管道金额 */
@Excel(name = "管道金额")
@Excel(name = "管道投资额(万元)")
private BigDecimal pipeInvestment;
/**企业编码*/
@Excel(name = "企业编码")
private String enterpriseCode;
/** 附件地址 */
private String nearbyAddress;
......@@ -60,6 +62,13 @@ public class TProjectInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
public Long getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public String getEnterpriseCode() {
return enterpriseCode;
......@@ -167,6 +176,7 @@ public class TProjectInfo extends BaseEntity
return "TProjectInfo{" +
"projectId=" + projectId +
", projectYear=" + projectYear +
", beyondEnterpriseId=" + beyondEnterpriseId +
", gateStationAddress='" + gateStationAddress + '\'' +
", gateStationInvestment=" + gateStationInvestment +
", numberGateStations=" + numberGateStations +
......
......@@ -64,7 +64,7 @@ public interface TEmployedPeopleInfoMapper
* 企业信息查询(下拉框数据)
* @return
*/
List<TEnterpriseInfo> selectTEnterprise();
List<TEnterpriseInfo> selectTEnterprise(Long deptId);
/**
* 根据企业id查询企业名称
......
......@@ -3,6 +3,7 @@ package com.zehong.system.mapper;
import java.util.Date;
import java.util.List;
import com.zehong.system.domain.TProjectInfo;
import org.apache.ibatis.annotations.Param;
/**
* 工程项目信息Mapper接口
......@@ -65,13 +66,13 @@ public interface TProjectInfoMapper
* @param projectYear
* @return
*/
List<TProjectInfo> selectSameYear(Date projectYear);
List<TProjectInfo> selectSameYear(@Param("projectYear") Date projectYear,@Param("beyondEnterpriseId") Long beyondEnterpriseId);
/**
* 重复年份删除方法
* @param isSameYear
*/
void deleteisSameYear(Date isSameYear);
void deleteisSameYear(@Param("isSameYear")Date isSameYear,@Param("beyondEnterpriseId")Long beyondEnterpriseId);
/**
* 查询修改文件之前的路径
......@@ -79,4 +80,11 @@ public interface TProjectInfoMapper
* @return
*/
TProjectInfo selectNearbyAddress(Long projectId);
/**
* 查询企业名称
* @param deptId
* @return
*/
String selectEnterpriseName(Long deptId);
}
......@@ -64,7 +64,7 @@ public interface ITEmployedPeopleInfoService
* 企业信息查询(下拉框数据)
* @return
*/
public List<TEnterpriseInfo> selectTEnterprise();
public List<TEnterpriseInfo> selectTEnterprise(Long deptId);
/**
* 根据企业id查询企业名称
......
......@@ -65,17 +65,24 @@ public interface ITProjectInfoService
* @param projectYear
* @return
*/
List<TProjectInfo> selectSameYear(Date projectYear);
List<TProjectInfo> selectSameYear(Date projectYear,Long beyondEnterpriseId);
/**
* 重复年份删除方法
* @param isSameYear
*/
void deleteisSameYear(Date isSameYear);
void deleteisSameYear(Date isSameYear,Long beyondEnterpriseId);
/**
* 查询修改文件之前的路径
* @param projectId
*/
TProjectInfo selectNearbyAddress(Long projectId);
/**
* 查询企业名称
* @param deptId
* @return
*/
String selectEnterpriseName(Long deptId);
}
......@@ -100,8 +100,8 @@ public class TEmployedPeopleInfoServiceImpl implements ITEmployedPeopleInfoServi
* @return
*/
@Override
public List<TEnterpriseInfo> selectTEnterprise() {
return tEmployedPeopleInfoMapper.selectTEnterprise();
public List<TEnterpriseInfo> selectTEnterprise(Long deptId) {
return tEmployedPeopleInfoMapper.selectTEnterprise(deptId);
}
/**
......
......@@ -101,8 +101,8 @@ public class TProjectInfoServiceImpl implements ITProjectInfoService
* @return
*/
@Override
public List<TProjectInfo> selectSameYear(Date projectYear) {
List<TProjectInfo> tProjectInfos = tProjectInfoMapper.selectSameYear(projectYear);
public List<TProjectInfo> selectSameYear(Date projectYear,Long beyondEnterpriseId) {
List<TProjectInfo> tProjectInfos = tProjectInfoMapper.selectSameYear(projectYear,beyondEnterpriseId);
return tProjectInfos;
}
......@@ -111,8 +111,8 @@ public class TProjectInfoServiceImpl implements ITProjectInfoService
* @param isSameYear
*/
@Override
public void deleteisSameYear(Date isSameYear) {
tProjectInfoMapper.deleteisSameYear(isSameYear);
public void deleteisSameYear(Date isSameYear,Long beyondEnterpriseId) {
tProjectInfoMapper.deleteisSameYear(isSameYear,beyondEnterpriseId);
}
/**
......@@ -125,4 +125,15 @@ public class TProjectInfoServiceImpl implements ITProjectInfoService
TProjectInfo tProjectInfo = tProjectInfoMapper.selectNearbyAddress(projectId);
return tProjectInfo;
}
/**
* 查询企业名称
* @param deptId
* @return
*/
@Override
public String selectEnterpriseName(Long deptId) {
String enterpriseName = tProjectInfoMapper.selectEnterpriseName(deptId);
return enterpriseName;
}
}
......@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" />
<result property="username" column="username" />
<result property="nickName" column="nick_name" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="userType" column="user_type" />
<result property="address" column="address" />
<result property="longitude" column="longitude" />
......@@ -26,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTDetectorUserList" parameterType="TDetectorUser" resultMap="TDetectorUserResult">
select user_id, username, nick_name, (CASE user_type WHEN '1' THEN '居民用户' WHEN '2' THEN '商业用户'WHEN '3' THEN '工业用户'end) as user_type , address, longitude, latitude, linkman, phone, email, is_del, remarks from t_detector_user
<where> is_del = '0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id =#{beyondEnterpriseId}</if>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
</where>
......@@ -115,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">address,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="linkman != null">linkman,</if>
<if test="phone != null">phone,</if>
<if test="email != null">email,</if>
......@@ -128,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">#{address},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="linkman != null">#{linkman},</if>
<if test="phone != null">#{phone},</if>
<if test="email != null">#{email},</if>
......
......@@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTDeviceInfoVo"/>
<where>
a.is_del='0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if>
......
......@@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select employed_people_id, employed_people_name,avatar_address, id_card, certificate_num, beyond_enterprise_name, beyond_enterprise_id, register_examination_type,(CASE people_occupation WHEN '1' THEN '主要负责人' WHEN '2' THEN '安全管理人员' WHEN '3' THEN '运行维护和抢修人员'end ) as people_occupation, issue_date, certificate_change, create_by, create_time, update_by, update_time, is_del, remarks from t_employed_people_info
<where>
1=1 and is_del='0'
<if test=" beyondEnterpriseId !='-2' and beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="employedPeopleName != null and employedPeopleName != ''"> and employed_people_name like concat('%', #{employedPeopleName}, '%')</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
......@@ -137,7 +138,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--企业信息查询(下拉框数据)-->
<select id="selectTEnterprise" resultMap="TEnterpriseInfoResult">
select enterprise_id,enterprise_name from t_enterprise_info where is_del='0'
select enterprise_id,enterprise_name from t_enterprise_info where
<if test="deptId!=null and deptId!= -2">
enterprise_id =#{deptId} and
</if>
is_del='0'
</select>
<!--根据企业id查询企业名称-->
......
......@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TEnterpriseInfo" id="TEnterpriseInfoResult">
<result property="enterpriseId" column="enterprise_id" />
<result property="createEnterpriseId" column="create_enterprise_id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="registerAddress" column="register_address" />
<result property="legalRepresentative" column="legal_representative" />
......@@ -35,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTEnterpriseInfoVo"/>
<where>
1=1 and is_del='0'
<if test="enterpriseId != -2 and enterpriseId != null and enterpriseId != ''">
and create_enterprise_id = #{enterpriseId}
</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="registerAddress != null and registerAddress != ''"> and register_address = #{registerAddress}</if>
<if test="legalRepresentative != null and legalRepresentative != ''"> and legal_representative = #{legalRepresentative}</if>
......@@ -43,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="licenseValidityTime != null and licenseValidityTime != ''"> and license_validity_time = #{licenseValidityTime}</if>
<if test="annualSupervisionInspection != null and annualSupervisionInspection != ''"> and annual_supervision_inspection = #{annualSupervisionInspection}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
</where>
group by enterprise_id desc
</select>
......@@ -56,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTEnterpriseInfo" parameterType="TEnterpriseInfo" useGeneratedKeys="true" keyProperty="enterpriseId">
insert into t_enterprise_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createEnterpriseId != null">create_enterprise_id,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="registerAddress != null">register_address,</if>
<if test="legalRepresentative != null">legal_representative,</if>
......@@ -75,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="doDusiness != null">do_business,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createEnterpriseId != null">#{createEnterpriseId},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="registerAddress != null">#{registerAddress},</if>
<if test="legalRepresentative != null">#{legalRepresentative},</if>
......
......@@ -21,10 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="hiddenTroubleDealFinishTime" column="hidden_trouble_deal_finish_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="reportPersonName" column="report_person_name" />
</resultMap>
<sql id="selectTHiddenTroubleInfoVo">
select hidden_trouble_id, work_id, hidden_trouble_name, hidden_trouble_level, hidden_trouble_type, longitude, latitude, picture_url, hidden_trouble_describe, report_time, (select u.user_name from sys_user u where u.user_id = report_person) AS report_person, hidden_trouble_deal_status, hidden_trouble_deal_condition, hidden_trouble_deal_finish_time, is_del, remarks from t_hidden_trouble_info
select hidden_trouble_id, work_id, hidden_trouble_name, hidden_trouble_level, hidden_trouble_type, longitude, latitude, picture_url, hidden_trouble_describe, report_time, (select u.user_name from sys_user u where u.user_id = report_person) AS report_person_name, report_person, hidden_trouble_deal_status, hidden_trouble_deal_condition, hidden_trouble_deal_finish_time, is_del, remarks from t_hidden_trouble_info
</sql>
<select id="selectTHiddenTroubleInfoList" parameterType="THiddenTroubleInfo" resultMap="THiddenTroubleInfoResult">
......
......@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pipeTrend != null and pipeTrend != ''"> and pipe_trend = #{pipeTrend}</if>
<if test="buildDate != null and buildDate != ''"> and build_date = #{buildDate}</if>
<if test="buildUnit != null and buildUnit != ''"> and build_unit = #{buildUnit}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="coordinates != null and coordinates != ''"> and coordinates = #{coordinates}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
......
......@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="projectId" column="project_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="projectYear" column="project_year" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="gateStationAddress" column="gate_station_address" />
<result property="gateStationInvestment" column="gate_station_investment" />
<result property="numberGateStations" column="number_gate_stations" />
......@@ -31,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
is_del='0'
<if test="projectYear != null "> and project_year = #{projectYear}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2 "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="gateStationAddress != null and gateStationAddress != ''"> and gate_station_address = #{gateStationAddress}</if>
<if test="gateStationInvestment != null "> and gate_station_investment = #{gateStationInvestment}</if>
<if test="numberGateStations != null "> and number_gate_stations = #{numberGateStations}</if>
......@@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTProjectInfo" parameterType="TProjectInfo" useGeneratedKeys="true" keyProperty="projectId">
insert into t_project_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="projectYear != null">project_year,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="gateStationAddress != null">gate_station_address,</if>
......@@ -67,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="projectYear != null">#{projectYear},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="gateStationAddress != null">#{gateStationAddress},</if>
......@@ -118,16 +122,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--查询是否已经有重复的年份数据-->
<select id="selectSameYear" resultMap="TProjectInfoResult">
select project_id from t_project_info where project_year=#{projectYear}
select project_id from t_project_info where project_year=#{projectYear} and beyond_enterprise_id=#{beyondEnterpriseId}
</select>
<!--重复年份删除方法-->
<update id="deleteisSameYear">
update t_project_info set is_del='1' where project_year=#{isSameYear}
update t_project_info set is_del='1' where project_year=#{isSameYear} and beyond_enterprise_id=#{beyondEnterpriseId}
</update>
<!--查询修改文件之前的路径-->
<select id="selectNearbyAddress" resultMap="TProjectInfoResult">
select nearby_address from t_project_info where project_id=#{projectId}
</select>
<!--查询企业名称-->
<select id="selectEnterpriseName" resultType="java.lang.String">
select enterprise_name from t_enterprise_info where
enterprise_id =#{deptId} and is_del='0'
</select>
</mapper>
......@@ -33,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTSiteStationInfoVo"/>
<where>
is_del='0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2">
and beyond_enterprise_id = #{beyondEnterpriseId}
</if>
<if test="siteStationName != null and siteStationName != ''"> and site_station_name like concat('%', #{siteStationName}, '%')</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
......
......@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询燃气隐患列表
export function listInfo(query) {
return request({
url: '/system/info/list',
url: '/system/hidden/list',
method: 'get',
params: query
})
......@@ -12,7 +12,7 @@ export function listInfo(query) {
// 查询燃气隐患
export function hiddenTroubleList(query) {
return request({
url: '/system/info/hiddenTroubleList',
url: '/system/hidden/hiddenTroubleList',
method: 'get',
params: query
})
......@@ -21,41 +21,41 @@ export function hiddenTroubleList(query) {
// 查询燃气隐患详细
export function getInfo(hiddenTroubleId) {
return request({
url: '/system/info/' + hiddenTroubleId,
url: '/system/hidden/' + hiddenTroubleId,
method: 'get'
})
}
// 新增燃气隐患
export function addInfo(data) {
export function addHiddenInfo(data) {
return request({
url: '/system/info',
url: '/system/hidden',
method: 'post',
data: data
})
}
// 修改燃气隐患
export function updateInfo(data) {
export function updateHiddenInfo(data) {
return request({
url: '/system/info',
url: '/system/hidden',
method: 'put',
data: data
})
}
// 删除燃气隐患
export function delInfo(hiddenTroubleId) {
export function delHiddenInfo(hiddenTroubleId) {
return request({
url: '/system/info/' + hiddenTroubleId,
url: '/system/hidden/' + hiddenTroubleId,
method: 'delete'
})
}
// 导出燃气隐患
export function exportInfo(query) {
export function exportHiddenInfo(query) {
return request({
url: '/system/info/export',
url: '/system/hidden/export',
method: 'get',
params: query
})
......
<template>
<div class="hidden">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="small"
@click="handleAdd"
v-if="!isView"
>新增隐患信息</el-button>
</el-col>
</el-row>
<!--隐患信息-->
<el-table :data="hiddenList">
<el-table-column label="隐患名称" align="center" prop="hiddenTroubleName" />
<el-table-column label="隐患等级" align="center" prop="hiddenTroubleLevel">
<template slot-scope="scope">
<span v-if="scope.row.hiddenTroubleLevel == '1'">I级</span>
<span v-if="scope.row.hiddenTroubleLevel == '2'">II级</span>
<span v-if="scope.row.hiddenTroubleLevel == '3'">III级</span>
</template>
</el-table-column>
<el-table-column label="隐患类型" align="center" prop="hiddenTroubleType">
<template slot-scope="scope">
<span v-if="item.dictValue == scope.row.hiddenTroubleType" v-for="item in hiddenTroubleOptions" :key="item.dictValue">
{{ item.dictLabel }}
</span>
</template>
</el-table-column>
<el-table-column label="隐患图片" align="center" prop="pictureUrl">
<template slot-scope="scope">
<el-image :src="scope.row.pictureUrl" :preview-src-list="[scope.row.pictureUrl]" v-if="scope.row.pictureUrl != '' && scope.row.pictureUrl != null" :z-index=5000 style="width: auto;height: auto;"></el-image>
</template>
</el-table-column>
<el-table-column label="上报时间" align="center" prop="reportTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="上报人" align="center" prop="reportPersonName" />
<el-table-column label="处理状态" align="center" prop="hiddenTroubleDealStatus">
<template slot-scope="scope">
<span v-if="scope.row.hiddenTroubleDealStatus == '1'">待处理</span>
<span v-if="scope.row.hiddenTroubleDealStatus == '2'">处理中</span>
<span v-if="scope.row.hiddenTroubleDealStatus == '3'">已完成</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="viewDetail(scope.row,scope.$index)"
v-if="isView"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row,scope.$index)"
v-if="!isView"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-if="!isView"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改燃气隐患对话框 -->
<el-dialog :title="title" :visible.sync="hiddenOpen" width="900px" append-to-body destroy-on-close @close="cancel">
<el-form ref="hiddenForm" :model="hiddenForm" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="隐患名称" prop="hiddenTroubleName">
<el-input v-model="hiddenForm.hiddenTroubleName" placeholder="请输入隐患名称" :disabled="isView"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患等级" prop="hiddenTroubleLevel">
<el-select v-model="hiddenForm.hiddenTroubleLevel" placeholder="请选择隐患类型" style="width: 330px" :disabled="isView">
<el-option label="I级" value="1" />
<el-option label="II级" value="2" />
<el-option label="III级" value="3" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="隐患类型" prop="hiddenTroubleType">
<el-select v-model="hiddenForm.hiddenTroubleType" placeholder="请选择隐患类型" style="width: 330px" :disabled="isView">
<el-option
v-for="dict in hiddenTroubleOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="24">
<el-form-item label="经纬度坐标" prop="longitude">
<el-col :span="8">
<el-input v-model="hiddenForm.longitude" placeholder="请输入经度" :disabled="isView"/>
</el-col>
<el-col :span="8" style="margin-left: 20px">
<el-input v-model="hiddenForm.latitude" placeholder="请输入纬度" :disabled="isView"/>
</el-col>
<el-col :span="4" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun" v-if="!isView">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="图片地址" prop="pictureUrl">
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
v-if="!isView"
/>
<div style="width: 20%;" v-if="isView">
<el-image :src="hiddenForm.pictureUrl" :preview-src-list="[hiddenForm.pictureUrl]" style="width: auto;height: auto;" :z-index= "3000"></el-image>
</div>
<el-input v-show="false" disabled v-model="hiddenForm.pictureUrl"></el-input>
</el-form-item>
<el-form-item label="隐患描述" prop="hiddenTroubleDescribe">
<el-input v-model="hiddenForm.hiddenTroubleDescribe" type="textarea" placeholder="请输入隐患描述" :disabled="isView"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-if="!isView"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
style="z-index: 3000"
/>
</div>
</template>
<script>
import MyFileUpload from '@/components/MyFileUpload';
import GetPos from '@/components/GetPos';
import moment from "moment";
import { hiddenTroubleList, addHiddenInfo , updateHiddenInfo ,delHiddenInfo } from "@/api/operationMonitor/hiddenTrouble"
export default {
name: "HiddenTrouble",
components: {
MyFileUpload,
GetPos
},
props:{
workId:{
type:Number
},
//是否为查看
isView:{
type:Boolean,
default:true
}
},
data() {
return {
// 遮罩层
loading: true,
// 燃气隐患表格数据
/* infoList: [],*/
// 弹出层标题
title: "",
// 是否显示弹出层
hiddenOpen: false,
// 表单参数
hiddenForm: {
pictureUrl: ""
},
/**隐患信息数据*/
hiddenList:[],
// 表单校验
rules: {
hiddenTroubleName: [
{ required: true, message: "请输入隐患名称", trigger: "blur" }
],
hiddenTroubleLevel: [
{ required: true, message: "请输入隐患等级", trigger: "blur" }
],
hiddenTroubleType: [
{ required: true, message: "请输入隐患类型", trigger: "blur" }
],
longitude: [
{ required: true, message: "请输入经纬度", trigger: ["blur","change"] }
],
pictureUrl: [
{ required: true, message: "请上传图片", trigger: "blur" }
],
hiddenTroubleDescribe: [
{ required: true, message: "请输入隐患描述", trigger: "blur" }
]
},
fileList:[],
devicePos: [],
dialogTableVisibles: false,
hiddenTroubleOptions:[],
/**修改时当前数据下标*/
index: -1,
};
},
created(){
this.getDicts("t_hidden_trouble_type").then(response => {
this.hiddenTroubleOptions = response.data;
});
console.log("fdafdsafds",this.workId)
this.getHiddenInfoList({workId:this.workId});
},
methods: {
// 取消按钮
cancel() {
this.hiddenOpen = false;
this.fileList = [];
this.reset();
},
/**获取隐患信息*/
getHiddenInfoList(param){
hiddenTroubleList(param).then(res =>{
this.hiddenList = res.data;
/* this.hiddenList.forEach(item=>{
item.reportPersonName = item.reportPerson;
})*/
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.title = "新增隐患信息"
this.hiddenOpen = true;
},
/** 详情按钮操作 */
viewDetail(row,index) {
this.reset();
this.index = index;
this.hiddenForm = {...row};
this.title = "查看隐患信息"
this.hiddenOpen = true;
if (this.hiddenForm.pictureUrl) {
this.fileList.push({
url: this.hiddenForm.pictureUrl,
});
}
},
/** 修改按钮操作 */
handleUpdate(row,index) {
this.reset();
this.index = index;
this.hiddenForm = {...row};
console.log(row,"ffffffffff",this.hiddenForm);
this.title = "修改隐患信息"
this.hiddenOpen = true;
if (this.hiddenForm.pictureUrl) {
this.fileList.push({
url: this.hiddenForm.pictureUrl,
});
}
},
/** 提交按钮 */
submitForm() {
this.$refs["hiddenForm"].validate(valid => {
if (valid) {
if (this.hiddenForm.hiddenTroubleId != null) {
updateHiddenInfo(this.hiddenForm).then(response => {
this.msgSuccess("修改成功");
this.hiddenOpen = false;
this.getHiddenInfoList({workId:this.workId});
});
} else {
this.hiddenForm.workId = this.workId;
this.hiddenForm.reportTime = moment().format("YYYY-MM-DD HH:mm:ss");
this.hiddenForm.reportPersonName = this.$store.state.user.name;
this.hiddenForm.reportPerson = this.$store.state.user.userId;
addHiddenInfo(this.hiddenForm).then(response => {
this.msgSuccess("新增成功");
this.hiddenOpen = false;
this.getHiddenInfoList({workId:this.workId});
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const hiddenTroubleId = row.hiddenTroubleId;
this.$confirm('是否确认删除隐患名称为"' + row.hiddenTroubleName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delHiddenInfo(hiddenTroubleId);
}).then(() => {
this.getHiddenInfoList({workId:this.workId});
this.msgSuccess("删除成功");
}).catch(() => {});
},
getFileInfo(res){
this.hiddenForm.pictureUrl = res.url;
},
listRemove(e) {
this.fileList = [];
},
// 表单重置
reset() {
this.hiddenForm = {
hiddenTroubleId: null,
workId: null,
hiddenTroubleName: null,
hiddenTroubleLevel: null,
hiddenTroubleType: null,
longitude: null,
latitude: null,
pictureUrl: null,
hiddenTroubleDescribe: null,
reportTime: null,
reportPerson: null,
hiddenTroubleDealStatus: null,
hiddenTroubleDealCondition: null,
hiddenTroubleDealFinishTime: null,
isDel: null,
remarks: null,
uniqueMark: null,
reportPersonName:null
};
this.resetForm("hiddenForm");
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.hiddenForm.longitude = res[0];
this.hiddenForm.latitude = res[1];
},
/**父组件校验子组件数据*/
checkChildData(){
return this.hiddenList.length <=0;
}
}
}
</script>
<style lang="scss" scoped>
.hidden{
.el-dialog__header{
height: 52px;
}
}
</style>
......@@ -71,9 +71,10 @@
</template>
</el-table-column>
<!-- <el-table-column label="任务内容" align="center" prop="workContent" />-->
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
<el-table-column label="创建单位" align="center" prop="workCreateEnterpriseName" />
<el-table-column label="指派单位" align="center" prop="workAssignEnterproseName" />
<el-table-column label="指派人" align="center" prop="workAssignMan" />
<el-table-column label="执行单位" align="center" prop="workAssignEnterproseName" />
<el-table-column label="执行人" align="center" prop="workAssignMan" />
<el-table-column label="任务状态" align="center" prop="workStatus">
<template slot-scope="scope">
<span v-if="scope.row.workStatus == 0" style="color: #ff7272">派发中</span>
......@@ -98,8 +99,8 @@
<!--<el-table-column label="图片路径" align="center" prop="iconUrl" />-->
<!-- <el-table-column label="整改方案" align="center" prop="rectificationPlan" />
<el-table-column label="整改结果" align="center" prop="rectificationResult" />-->
<el-table-column label="责任单位" align="center" prop="responsibleUnit" />
<el-table-column label="责任人员" align="center" prop="responsiblePerson" />
<!--<el-table-column label="责任单位" align="center" prop="responsibleUnit" />
<el-table-column label="责任人员" align="center" prop="responsiblePerson" />-->
<el-table-column label="截止日期" align="center" prop="expiryDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.expiryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
......@@ -131,7 +132,7 @@
v-if="('zhengfu'== roleType || (('enterprise'== roleType || 'doubleRole' == roleType) && scope.row.workCreateEnterpriseId == $store.state.user.enterpriseId))&& scope.row.workStatus == '0'"
key="detele"
>删除</el-button>
<el-button v-if="'inpector'!= roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null) && scope.row.workStatus == '0'"
<el-button v-if="'inpector'!= roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null) && scope.row.workStatus == '0' && scope.row.workCreateEnterpriseId == $store.state.user.enterpriseId"
size="mini"
type="text"
icon="el-icon-edit"
......@@ -155,7 +156,7 @@
v-hasPermi="['system:order:edit']"
key="feedbook"
>反馈</el-button>
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '2'"
<el-button v-if="'inpector'!= roleType && scope.row.workStatus == '2' && scope.row.workCreateEnterpriseId == $store.state.user.enterpriseId"
size="mini"
type="text"
icon="el-icon-edit"
......@@ -163,6 +164,14 @@
v-hasPermi="['system:order:edit']"
key="sort"
>归档</el-button>
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus != '3'"
size="mini"
type="text"
icon="el-icon-edit"
@click="hiddenFeed(scope.row)"
v-hasPermi="['system:order:edit']"
key="hidden"
>隐患反馈</el-button>
</template>
</el-table-column>
</el-table>
......@@ -205,9 +214,9 @@
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="指派单位" prop="workAssignEnterproseId">
<!--<el-input v-model="form.workAssignEnterproseName" placeholder="请输入指派单位名称" />-->
<el-select v-model="form.workAssignEnterproseId" placeholder="请选择指派单位名称" style="width: 100%" @change="selectworkAssignEnterprose($event)" :disabled="isDetail || isEnterproser">
<el-form-item label="执行单位" prop="workAssignEnterproseId">
<!--<el-input v-model="form.workAssignEnterproseName" placeholder="请输入执行单位名称" />-->
<el-select v-model="form.workAssignEnterproseId" placeholder="请选择执行单位名称" style="width: 100%" @change="selectworkAssignEnterprose($event)" :disabled="isDetail || isEnterproser">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
......@@ -218,9 +227,9 @@
</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="form.workAssignManId" placeholder="请输入指派人" style="width: 100%" @change="selectInspection($event,'edit')" :disabled="isDetail" clearable>
<el-form-item label="执行人" prop="workAssignMan">
<!--<el-input v-model="form.workAssignManId" placeholder="请输入执行人" />-->
<el-select v-model="form.workAssignManId" placeholder="请输入执行人" style="width: 100%" @change="selectInspection($event,'edit')" :disabled="isDetail" clearable>
<el-option
v-for="item in inspectors"
:key="item.userId "
......@@ -350,9 +359,9 @@
<el-row>
<el-col :span="12">
<el-form-item label="指派单位" prop="workAssignEnterproseId">
<!--<el-input v-model="form.workAssignEnterproseName" placeholder="请输入指派单位名称" />-->
<el-select v-model="workForm.workAssignEnterproseId" placeholder="请选择指派单位名称" style="width: 350px" @change="selectworkAssignEnterprose($event)" :disabled="isEnterproser">
<el-form-item label="执行单位" prop="workAssignEnterproseId">
<!--<el-input v-model="form.workAssignEnterproseName" placeholder="请输入执行单位名称" />-->
<el-select v-model="workForm.workAssignEnterproseId" placeholder="请选择执行单位名称" style="width: 350px" @change="selectworkAssignEnterprose($event)" :disabled="isEnterproser">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
......@@ -363,9 +372,9 @@
</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-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 "
......@@ -432,6 +441,37 @@
<el-button @click="cancelFeedBook"> </el-button>
</div>
</el-dialog>
<!-- 隐患反馈信息 -->
<el-dialog :title="title" :visible.sync="hiddenFeedOpen" width="900px" append-to-body @close="cancelHiddenFeedForm">
<el-form ref="hiddenFeedForm" :model="hiddenFeedForm" :rules="hiddenFeedRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="任务标题" prop="workTitle">
<span>{{hiddenFeedForm.workTitle}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<span v-if="hiddenFeedForm.workType == '1'">入户安检</span>
<span v-if="hiddenFeedForm.workType == '2'">巡检</span>
<!-- <span v-if="feedBookForm.workType == '3'">报警巡查</span>-->
<span v-if="hiddenFeedForm.workType == '4'">其他</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="隐患信息" prop="hiddenInfo">
<HiddenFeedTrouble
:workId="hiddenFeedForm.workId"
:isView="false"
ref="hiddenChild"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitHiddenFeedForm"> </el-button>
<el-button @click="cancelHiddenFeedForm"> </el-button>
</div>
</el-dialog>
</div>
</template>
......@@ -444,15 +484,24 @@ import { enterpriseLists } from "@/api/regulation/info";
import { getInspectionUsers } from "@/api/system/user";
import ScrollPane from "../../../layout/components/TagsView/ScrollPane";
import HiddenTrouble from "./components/HiddenTrouble";
import HiddenFeedTrouble from "./components/HiddenFeedTrouble"
export default {
name: "Order",
components: {
ScrollPane,
Editor,
MyFileUpload,
HiddenTrouble
HiddenTrouble,
HiddenFeedTrouble
},
data() {
const validateHiddenFeedInfo = (rule, value, callback) => {
if (this.$refs.hiddenChild.checkChildData()) {
callback(new Error("隐患信息不能为空!"));
} else {
callback();
}
};
return {
isOpen:false,
// 遮罩层
......@@ -526,7 +575,7 @@ export default {
{ required: true, message: "任务内容", trigger: "blur" }
],
workAssignEnterproseId: [
{ required: true, message: "指派单位", trigger: "blur" }
{ required: true, message: "执行单位", trigger: "blur" }
],
expiryDate: [
{ required: true, message: "截止时间", trigger: "blur" }
......@@ -535,10 +584,10 @@ export default {
//任务下发表单校验
workRules: {
workAssignEnterproseId: [
{ required: true, message: "指派单位", trigger: "blur" }
{ required: true, message: "执行单位", trigger: "blur" }
],
workAssignMan: [
{ required: true, message: "指派人", trigger: "blur" }
{ required: true, message: "执行人", trigger: "blur" }
]
},
//反馈校验
......@@ -559,7 +608,17 @@ export default {
},
feedBookOpen: false,
//详情隐患信息
hiddenInfoList:[]
hiddenInfoList:[],
hiddenFeedOpen:false,
hiddenFeedForm:{
hiddenList:[]
},
//反馈校验
hiddenFeedRules: {
hiddenInfo: [
{ type: "array", validator: validateHiddenFeedInfo, required: true }
]
}
};
},
......@@ -734,7 +793,7 @@ export default {
showPicture(row){
this.$refs['a'+row.workId].showViewer = true;
},
//指派单位
//执行单位
getEnterpriseLists(){
const param = {};
this.judgeOperateType(param);
......@@ -742,7 +801,7 @@ export default {
this.enterprises = response.rows;
});
},
//根据用户角色和操作类型设置指派人是否可选
//根据用户角色和操作类型设置执行人是否可选
judgeOperateType(param){
if(this.roleType != "zhengfu"){
param.enterpriseId = this.$store.state.user.enterpriseId;
......@@ -762,7 +821,7 @@ export default {
this.inspectors = response.data;
})
},
//选择指派单位
//选择执行单位
selectworkAssignEnterprose(enterpriseId){
this.form.workAssignManId = "";
this.workForm.workAssignManId = "";
......@@ -772,7 +831,7 @@ export default {
let enterpriseName = this.enterprises.find(val=>val.enterpriseId == enterpriseId).enterpriseName;
this.form.workAssignEnterproseName = enterpriseName;
},
//获取指派
//获取执行
selectInspection(userId,type){
if(userId){
let userName = this.inspectors.find(val=>val.userId == userId).userName;
......@@ -944,11 +1003,35 @@ export default {
getHiddenInfos(param){
hiddenTroubleList(param).then(res =>{
this.hiddenInfoList = res.data;
this.hiddenInfoList.forEach(item=>{
/*this.hiddenInfoList.forEach(item=>{
item.reportPersonName = item.reportPerson;
})
})*/
});
}
},
//隐患信息反馈
hiddenFeed(row){
this.title = "隐患反馈信息";
this.hiddenFeedOpen = true;
this.hiddenFeedForm.workId = row.workId;
this.hiddenFeedForm.workTitle = row.workTitle;
this.hiddenFeedForm.workType = row.workType;
},
//隐患反馈提交
submitHiddenFeedForm(){
this.$refs["hiddenFeedForm"].validate(valid => {
if (valid) {
this.msgSuccess("隐患信息反馈成功");
this.hiddenFeedOpen = false;
this.getList();
}
});
},
//隐患反馈取消
cancelHiddenFeedForm(){
this.hiddenFeedOpen = false;
this.hiddenFeedForm = {hiddenList:[]};
this.fileList = [];
},
}
};
</script>
......
......@@ -48,8 +48,7 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:device:add']"
>新增</el-button
>
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -60,8 +59,7 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:device:edit']"
>修改</el-button
>
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -72,8 +70,7 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:device:remove']"
>删除</el-button
>
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -81,85 +78,54 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['device:device:export']"
>导出</el-button
>
>导出</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="deviceList"
@selection-change="handleSelectionChange"
>
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="设备id" align="center" prop="deviceId" />-->
<el-table-column label="照片" align="center">
<template slot-scope="List">
<img :src="List.row.iconUrl" width="100px" />
<!-- <el-table-column label="设备id" align="center" prop="deviceId" />-->
<el-table-column label="照片" align="center" >
<template scope="List">
<img :src="List.row.iconUrl" width="100px">
</template>
</el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName">
<span slot-scope="scope" v-if="scope.row.deviceName">{{
scope.row.deviceName
}}</span>
<span slot-scope="scope" v-if="scope.row.deviceName">{{scope.row.deviceName}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="设备编号" align="center" prop="deviceCode">
<span slot-scope="scope" v-if="scope.row.deviceCode">{{
scope.row.deviceCode
}}</span>
<span slot-scope="scope" v-if="scope.row.deviceCode">{{scope.row.deviceCode}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="所在地址" align="center" prop="deviceAddr">
<span slot-scope="scope" v-if="scope.row.deviceAddr">{{
scope.row.deviceAddr
}}</span>
<span slot-scope="scope" v-if="scope.row.deviceAddr">{{scope.row.deviceAddr}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="设备型号" align="center" prop="deviceModel">
<span slot-scope="scope" v-if="scope.row.deviceModel">{{
scope.row.deviceModel
}}</span>
<el-table-column label="设备型号" align="center" prop="deviceModel" >
<span slot-scope="scope" v-if="scope.row.deviceModel">{{scope.row.deviceModel}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType">
<span slot-scope="scope" v-if="scope.row.deviceType">{{
scope.row.deviceType
}}</span>
<el-table-column label="设备类型" align="center" prop="deviceType" >
<span slot-scope="scope" v-if="scope.row.deviceType">{{scope.row.deviceType}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column
label="权属单位名称"
align="center"
prop="beyondEnterpriseName"
>
<span slot-scope="scope" v-if="scope.row.beyondEnterpriseName">{{
scope.row.beyondEnterpriseName
}}</span>
<el-table-column label="权属单位名称" align="center" prop="beyondEnterpriseName" >
<span slot-scope="scope" v-if="scope.row.beyondEnterpriseName">{{scope.row.beyondEnterpriseName}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column
label="安装时间"
align="center"
prop="installationTime"
width="180"
>
<el-table-column label="安装时间" align="center" prop="installationTime" width="180">
<template slot-scope="scope">
<span v-if="scope.row.installationTime">{{
parseTime(scope.row.installationTime, "{y}-{m}-{d}")
}}</span>
<span v-if="scope.row.installationTime">{{ parseTime(scope.row.installationTime, '{y}-{m}-{d}') }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="照片" align="center">
<template slot-scope="List">
<el-table-column label="照片" align="center" >
<template slot-scope="List">
<span
class="dbtn"
@click="checkFile(List.row.iconUrl)"
......@@ -167,14 +133,10 @@
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</template>
<span v-else>-</span>
</template>
</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">
<template slot-scope="scope">
<el-button
size="mini"
......@@ -182,462 +144,363 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:device:edit']"
>修改</el-button
>
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:device:remove']"
>删除</el-button
>
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!--选择关联设备弹出框-->
<el-dialog
title="选择关联设备"
width="1100px"
: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-dialog title="选择关联设备" width="1100px" :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-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="detectionMedium" />
<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
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="danger"
plain
type="text"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="deleteListDetailInfo"
@click="deleteDetailInfo(scope.row)"
v-hasPermi="['device:device:remove']"
>删除</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="detectionMedium"
/>
<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-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-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="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-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-option label="探测器" value="3" />
</el-select>
</el-form-item>
</el-col>
<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-option label="探测器" value="3" />
</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-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="detectionMedium">
<el-input
v-model="formDetailInfo.detectionMedium"
placeholder="请输入探测介质"
/>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium" >
<el-input v-model="formDetailInfo.detectionMedium" 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-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>
<el-button @click="dialogFormVisible=false"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" 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="120px">
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="form.deviceName"
placeholder="请输入设备名称"
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="form.deviceCode"
placeholder="请输入设备编号"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr">
<el-input
v-model="form.deviceAddr"
placeholder="请输入所在地址"
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备型号" prop="deviceModel">
<el-input
v-model="form.deviceModel"
placeholder="请输入设备型号"
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.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="form.deviceType" placeholder="请选择设备类型">
<el-option label="阀井" value="1" />
<el-option label="调压箱" value="2" />
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-option label="阀井" value="1" />
<el-option label="调压箱" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="权属单位" prop="beyondEnterpriseId">
<el-select
v-model="form.beyondEnterpriseId"
placeholder="请在下拉框中选择权属单位"
maxlength="255"
:disabled="false"
clearable
style="width: 100%"
>
<el-option
v-for="item in test"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
>
</el-option>
</el-select>
</el-form-item>
<el-col :span="11">
<el-form-item label="权属单位" prop="beyondEnterpriseId">
<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>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item label="经度" prop="longitude">-->
<!-- <el-input v-model="form.longitude" placeholder="请输入经度" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item label="纬度" prop="latitude">-->
<!-- <el-input v-model="form.latitude" placeholder="请输入纬度" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="23">
<el-col :span="21">
<el-form-item label="经纬度坐标" prop="longitude">
<el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="9" style="margin-left: 10px">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
<el-col :span="9" style="margin-left: 15px">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col>
<el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun"
>选择经纬度</el-button
>
<el-col :span="3" style="margin-left: 35px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-col :span="22">
<el-form-item label="上传照片">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
>
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker
clearable
size="small"
v-model="form.installationTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择安装时间"
>
</el-date-picker>
<el-col :span="11">
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
v-model="form.installationTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择安装时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item label="最后巡检时间" prop="inspectionTime">
<el-date-picker
clearable
size="small"
v-model="form.inspectionTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最后巡检时间"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="最后巡检时间" prop="inspectionTime">
<el-date-picker clearable size="small"
v-model="form.inspectionTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最后巡检时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input
v-model="form.remarks"
type="textarea"
placeholder="请输入备注"
/>
<el-input v-model="form.remarks" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="tableTitle">
<img
:src="relationImg"
style="
width: 24px;
height: 25px;
position: relative;
left: -339px;
top: -12px;
"
/>
<img :src="relationImg" style="width: 24px; height: 25px;position: relative; left: -339px; top: -12px;"/>
<span class="midText">关联设备</span>
</div>
<el-table
v-loading="loadings"
ref="multipleTable"
:data="DetailInfoList"
tooltip-effect="dark"
style="width: 100%"
max-height="250"
@selection-change="tableDataSelectionChange"
>
<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"
>
<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)"
@click="deleteDataListilInfo(scope.row,scope.$index)"
v-hasPermi="['device:device:remove']"
>删除</el-button
>
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="selectDataListInfo"
>选择关联设备</el-button
>
<el-button type="primary" @click="selectDataListInfo">选择关联设备</el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
......@@ -654,24 +517,9 @@
<script>
import {
listDevice,
getDevice,
delDevice,
addDevice,
updateDevice,
exportDevice,
selectTEnterprise,
getDdeviceDetailInfo,
addDetailInfos,
deleteDetailInfo,
deleteeListDetailInfo,
selectDetailInfoList,
deleteDeviceDetailInfo,
updateDetailInfoLists,
} from "@/api/regulation/device";
import GetPos from "@/components/GetPos";
import FileUpload from "@/components/FileSuperviseUpload";
import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice, selectTEnterprise,getDdeviceDetailInfo,addDetailInfos,deleteDetailInfo,deleteeListDetailInfo,selectDetailInfoList,deleteDeviceDetailInfo,updateDetailInfoLists} from "@/api/regulation/device";
import GetPos from '@/components/GetPos';
import FileUpload from '@/components/FileSuperviseUpload';
export default {
name: "Device",
components: {
......@@ -680,16 +528,16 @@ export default {
},
data() {
return {
relationImg: require("@/assets/project/relation.png"),
relationImg: require('@/assets/project/relation.png'),
//头像
fileList: [],
/**弹出层*/
//下级设备数据数组
tableData: [],
//存储已被选中的下级数据id
DetailInfoListId: [],
DetailInfoListId :[],
//存储已经选中的下级关联数据
DetailInfoList: [],
DetailInfoList:[],
multipleSelection: [],
dialogTableVisible: false,
dialogFormVisible: false,
......@@ -698,43 +546,41 @@ export default {
devicePos: [],
/**--------------地图使用数据---------------*/
form: {
name: "",
region: "",
date1: "",
date2: "",
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: "",
desc: "",
resource: '',
desc: '',
},
formLabelWidth: "120px",
formLabelWidth: '120px',
/*添加关联设备*/
formDetailInfo: {
relationDeviceDetailId: "",
deviceName: "",
deviceModel: "",
deviceType: "",
iotNo: "",
detectionMedium: "",
remarksn: "",
formDetailInfo:{
relationDeviceDetailId:'',
deviceName: '',
deviceModel:'',
deviceType:'',
iotNo:'',
detectionMedium:'',
remarksn:''
},
/*动态添加输入框*/
dynamicValidateForm: {
domains: [
{
deviceName: "",
deviceModel: "",
deviceType: "",
iotNo: "",
remarksn: "",
},
],
domains: [{
deviceName: '',
deviceModel:'',
deviceType:'',
iotNo:'',
remarksn:''
}],
},
// 遮罩层
loading: true,
//下级数据的遮罩层
loadings: true,
loadings:true,
// 导出遮罩层
exportLoading: false,
// 选中数组
......@@ -748,7 +594,7 @@ export default {
// 总条数
total: 0,
//下级关联设备条数
detailTotal: 0,
detailTotal:0,
// 设备信息表格数据
deviceList: [],
// 弹出层标题
......@@ -770,7 +616,7 @@ export default {
iotNo: null,
},
//下级参数
detailInfoParams: {
detailInfoParams:{
pageNum: 1,
pageSize: 10,
},
......@@ -798,19 +644,19 @@ export default {
],
},
//关联设备下级数据 表单校验
formDetailInfoRules: {
deviceName: [
formDetailInfoRules:{
deviceName:[
{ required: true, message: "请输入设备名称", trigger: "blur" },
{ min: 0, max: 20, message: "长度20位", trigger: "blur" },
],
deviceModel: [
deviceModel:[
{ required: true, message: "请输入设备型号", trigger: "blur" },
{ min: 0, max: 20, message: "长度20位", trigger: "blur" },
],
deviceType: [
deviceType:[
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
iotNo: [
iotNo:[
{ required: true, message: "请输入联网编号", trigger: "blur" },
{ min: 0, max: 20, message: "长度20位", trigger: "blur" },
],
......@@ -822,18 +668,18 @@ export default {
},
methods: {
/**上传头像*/
getFileInfo(res) {
getFileInfo(res){
this.form.dealPlan = res.fileName;
this.form.iconUrl = res.url;
this.form.burl = res.burl;
this.form.burl=res.burl;
this.fileList.push({
name: res.fileName,
url: uploadfile,
burl: res.burl,
burl:res.burl,
});
},
checkFile(url) {
window.open(url, "_blank");
window.open(url,'_blank');
},
listRemove(e) {
this.form.dealPlan = "";
......@@ -841,19 +687,21 @@ export default {
},
/** 查询设备信息列表 */
getList() {
this.loading = true;
listDevice(this.queryParams).then((response) => {
listDevice(this.queryParams).then(response => {
this.deviceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/**查询下级数据列表方法*/
getDataList() {
getDataList(){
this.loadings = true;
// console.log(this.dateQueryParams)
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then((response) => {
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
//下级设备数据 到时候换成下级数据
this.tableData = response.rows;
this.detailTotal = response.total;
......@@ -890,7 +738,7 @@ export default {
updateTime: null,
isDel: null,
remarks: null,
relationDeviceType: "1",
relationDeviceType:'1',
};
this.resetForm("form");
},
......@@ -900,7 +748,7 @@ export default {
this.getList();
},
/** 下级数据搜索*/
handleQueryData() {
handleQueryData(){
this.getDataList();
},
/** 重置按钮操作 */
......@@ -909,39 +757,39 @@ export default {
this.handleQuery();
},
/** 下级数据重置按钮操作 搜索框重置*/
resetQueryDate() {
this.dateQueryParams = {
resetQueryDate(){
this.dateQueryParams={
deviceName: null,
deviceModel: null,
iotNo: null,
};
deviceModel: null,
iotNo: null,
}
this.getDataList();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.deviceId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
this.ids = selection.map(item => item.deviceId)
this.single = selection.length!==1
this.multiple = !selection.length
},
//关联数据多选框选中数据
tableDataSelectionChange(selection) {
this.ids = selection.map((item) => item.relationDeviceDetailId);
this.datalist = selection.map((item) => item);
tableDataSelectionChange(selection){
this.ids = selection.map(item => item.relationDeviceDetailId)
this.datalist=selection.map(item => item)
//按钮 非选中禁用
this.single = selection.length !== 1;
this.multiple = !selection.length;
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//查询企业名称下拉框数据
selectTEnterprise().then((response) => {
selectTEnterprise().then(response => {
this.test = response.data;
});
//清空关联设备数据
this.DetailInfoList = "";
this.DetailInfoList=''
this.loadings = true;
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then((response) => {
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
//下级设备数据 到时候换成下级数据
this.tableData = response.rows;
this.detailTotal = response.total;
......@@ -955,28 +803,28 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
//查询企业名称下拉框数据
selectTEnterprise().then((response) => {
selectTEnterprise().then(response => {
this.test = response.data;
});
const deviceId = row.deviceId || this.ids;
var tDeviceInfon = {
id: deviceId,
relationDeviceType: "1",
};
const deviceId = row.deviceId || this.ids
var tDeviceInfon={
id:deviceId,
relationDeviceType:'1'
}
//查询关联设备信息数据
selectDetailInfoList(JSON.stringify(tDeviceInfon)).then((response) => {
selectDetailInfoList(JSON.stringify(tDeviceInfon)).then(response => {
this.DetailInfoList = response.rows;
this.loadings = false;
});
this.reset();
getDevice(deviceId).then((response) => {
getDevice(deviceId).then(response => {
this.form = response.data;
//图片回显
if (this.form.iconUrl) {
this.fileList.push({
name: "照片",
name: '照片',
url: this.form.iconUrl,
});
}
......@@ -989,226 +837,205 @@ export default {
handleDelete(row) {
const deviceIds = row.deviceId || this.ids;
// const deviceIds = row.relationDeviceDetailId || this.ids;
this.$confirm(
'是否确认删除设备信息编号为"' + deviceIds + '"的数据项?',
"警告",
{
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
type: "warning"
}).then(function() {
return delDevice(deviceIds);
})
.then(() => {
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有设备信息数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$confirm('是否确认导出所有设备信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDevice(queryParams);
})
.then((response) => {
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
.catch(() => {});
}).catch(() => {});
},
/**动态添加输入框方法*/
addDomain() {
this.dynamicValidateForm.domains.push({
deviceName: "",
deviceModel: "",
deviceType: "",
iotNo: "",
remarksn: "",
deviceName: '',
deviceModel:'',
deviceType:'',
iotNo:'',
remarksn:'',
});
},
/**动态删除输入框方法*/
removeDomain(item) {
var index = this.dynamicValidateForm.domains.indexOf(item);
var index = this.dynamicValidateForm.domains.indexOf(item)
if (index !== -1) {
this.dynamicValidateForm.domains.splice(index, 1);
this.dynamicValidateForm.domains.splice(index, 1)
}
},
/**提交数据方法*/
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.deviceId != null) {
updateDevice(this.form).then((response) => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
if (this.datalist != null) {
this.form.relationDeviceType = "1";
var tDeviceInfon = {
tDeviceInfo: this.form,
tDeviceInfoS: this.datalist,
};
//重新绑定修改后的关联设备
updateDetailInfoLists(JSON.stringify(tDeviceInfon)).then(
(response) => {
this.open = false;
this.getList();
}
);
}
} else {
if (valid) {
//获取已经选中的下级设备id
const deviceIds = this.ids;
// alert(deviceIds)
this.form.relationDeviceType = "1";
var tDeviceInfon = {
tDeviceInfo: this.form,
tDeviceInfoS: this.datalist,
};
addDevice(JSON.stringify(tDeviceInfon)).then((response) => {
this.msgSuccess("新增成功");
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.deviceId != null) {
updateDevice(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
if ( this.datalist !=null){
this.form.relationDeviceType='1';
var tDeviceInfon={
tDeviceInfo:this.form,
tDeviceInfoS:this.datalist
}
//重新绑定修改后的关联设备
updateDetailInfoLists(JSON.stringify(tDeviceInfon)).then(response => {
this.open = false;
this.getList();
});
}
} else {
console.log("error submit!!");
return false;
if (valid) {
//获取已经选中的下级设备id
const deviceIds = this.ids;
// alert(deviceIds)
this.form.relationDeviceType='1';
var tDeviceInfon={
tDeviceInfo:this.form,
tDeviceInfoS:this.datalist
}
addDevice(JSON.stringify(tDeviceInfon)).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
console.log('error submit!!');
return false;
}
}
}
}
});
});
},
/**关联设备添加方法*/
addDetailInfo() {
this.$refs["formDetailInfo"].validate((valid) => {
addDetailInfo(){
this.$refs["formDetailInfo"].validate(valid => {
if (valid) {
addDetailInfos(this.formDetailInfo).then((response) => {
addDetailInfos(this.formDetailInfo).then(response => {
// this.tableData.push(this.formDetailInfo)
//关闭弹出层
this.dialogFormVisible = false;
//数据表单重置
this.formDetailInfo = {
this.formDetailInfo={
deviceName: null,
deviceModel: null,
deviceType: null,
iotNo: null,
remarksn: null,
deviceModel:null,
deviceType:null,
iotNo:null,
remarksn:null
};
this.getDataList();
this.msgSuccess("新增成功");
});
}
});
},
/**关联设备单条删除方法*/
deleteDetailInfo(row) {
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(() => {});
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) {
deleteDataListilInfo(row,index){
const deviceIds = row.relationDeviceDetailId;
//判断form表单是否有id来验证是修改的删除还是添加的删除
if (this.form.deviceId != null) {
deleteDeviceDetailInfo(deviceIds).then((response) => {
deleteDeviceDetailInfo(deviceIds).then(response => {
this.msgSuccess("删除成功");
this.DetailInfoList.splice(index, 1);
this.DetailInfoList.splice(index,1);
});
} else {
this.DetailInfoList.splice(index, 1);
}else {
this.DetailInfoList.splice(index,1);
this.msgSuccess("删除成功");
}
},
/**
* 批量删除关联设备方法
* @param row
*/
deleteListDetailInfo(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(() => {});
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteeListDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**添加关联设备与设备绑定的数据 (存储到数组中)*/
insertListDetailInfo(row) {
insertListDetailInfo(row){
//获取已经选中的下级设备id
const deviceIds = this.ids;
const li = this.datalist;
if (this.form.deviceId != null) {
//修改
this.DetailInfoList = this.DetailInfoList.concat(this.datalist);
//添加到数组中 以便下次使用
this.DetailInfoListId.push(deviceIds);
// alert(this.DetailInfoListId)
this.dialogTableVisible = false;
this.msgSuccess("添加成功");
} else {
//添加
// 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("添加成功");
}
const deviceIds = this.ids;
const li=this.datalist;
if (this.form.deviceId != null) {
//修改
this.DetailInfoList=this.DetailInfoList.concat(this.datalist)
//添加到数组中 以便下次使用
this.DetailInfoListId.push(deviceIds);
// alert(this.DetailInfoListId)
this.dialogTableVisible=false
this.msgSuccess("添加成功");
}else {
//添加
// 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("添加成功");
}
},
/**
* 选择关联设备查询方法
*/
selectDataListInfo() {
selectDataListInfo(){
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then((response) => {
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
//下级设备数据 到时候换成下级数据
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
//打开选择关联设备弹出框
this.dialogTableVisible = true;
this.dialogTableVisible = true
});
},
......@@ -1230,47 +1057,47 @@ export default {
* 经纬度 选择
* @param res
*/
getPath(res) {
getPath(res){
console.log("res", res);
console.log(this.form.longitude, this.form.latitude);
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
},
},
}
}
};
</script>
<style>
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
.tableTitle {
position: relative;
margin: 24px auto;
width: 600px;
height: 2px;
background-color: #d4d4d4;
text-align: center;
font-size: 16px;
color: rgba(101, 101, 101, 1);
}
.midText {
position: absolute;
left: 3%;
background-color: #ffffff;
padding: 0 15px;
transform: translateX(-50%) translateY(-50%);
}
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
.tableTitle {
position: relative;
margin: 24px auto;
width: 600px;
height: 2px;
background-color: #d4d4d4;
text-align: center;
font-size: 16px;
color: rgba(101, 101, 101, 1);
}
.midText {
position: absolute;
left: 3%;
background-color: #ffffff;
padding: 0 15px;
transform: translateX(-50%) translateY(-50%);
}
</style>
......@@ -36,6 +36,28 @@
v-hasPermi="['supervise:user: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="['supervise:user:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['supervise:user:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
......@@ -115,51 +137,65 @@
/>
<!-- 添加或修改燃气用户对话框 -->
<el-dialog :title="title" :visible.sync="open"width="800px" 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="120px">
<el-row>
<el-col :span="11">
<el-form-item label="用户账号" prop="username">
<el-input v-model="form.username" placeholder="请输入用户账号" />
</el-form-item>
<el-form-item label="用户账号" prop="username">
<el-input v-model="form.username" placeholder="请输入用户账号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用户名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户名称" />
</el-form-item>
<el-col :span="11">
<el-form-item label="用户名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型" style="width: 100%">
<el-option label="居民用户" value="1" />
<el-option label="商业用户" value="2" />
<el-option label="工业用户" value="3" />
</el-select>
</el-form-item>
<el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型">
<el-option label="居民用户" value="1" />
<el-option label="商业用户" value="2" />
<el-option label="工业用户" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" placeholder="请输入地址" />
</el-form-item>
<el-col :span="11">
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" placeholder="请输入地址" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item label="经度" prop="longitude">-->
<!-- <el-input v-model="form.longitude" placeholder="请输入经度" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="11">-->
<!-- <el-form-item label="纬度" prop="latitude">-->
<!-- <el-input v-model="form.latitude" placeholder="请输入纬度" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="23">
<el-col :span="21">
<el-form-item label="经纬度坐标" prop="longitude">
<el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="9" style="margin-left: 10px">
<el-col :span="9" style="margin-left: 15px">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col>
<el-col :span="3" style="margin-left: 30px">
<el-col :span="3" style="margin-left: 33px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
......@@ -168,31 +204,31 @@
<el-row>
<el-col :span="11">
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话" prop="phone">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
<el-col :span="11">
<el-form-item label="电话" prop="phone">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" type="textarea" placeholder="请输入邮箱" />
</el-form-item>
<el-col :span="22">
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" type="textarea" placeholder="请输入邮箱" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
......
......@@ -96,10 +96,10 @@
<span slot-scope="scope" v-if="scope.row.buildUnit">{{scope.row.buildUnit}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="权属单位" align="center" prop="beyondEnterpriseId" >
<span slot-scope="scope" v-if="scope.row.beyondEnterpriseId">{{scope.row.beyondEnterpriseId}}</span>
<span v-else>-</span>
</el-table-column>
<!-- <el-table-column label="权属单位" align="center" prop="beyondEnterpriseId" >-->
<!-- <span slot-scope="scope" v-if="scope.row.beyondEnterpriseId">{{scope.row.beyondEnterpriseId}}</span>-->
<!-- <span v-else>-</span>-->
<!-- </el-table-column>-->
<el-table-column label="权属单位" align="center" prop="beyondEnterpriseName" >
<span slot-scope="scope" v-if="scope.row.beyondEnterpriseName">{{scope.row.beyondEnterpriseName}}</span>
<span v-else>-</span>
......
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