Commit 66b2fabe authored by wanghao's avatar wanghao

1 基础信息管理-用户管理-居住区(村庄) 管理模块开发,并调整左侧导航栏宽度

parent 07c82b63
package com.zehong.web.controller.supervise;
import java.util.List;
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.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TUserManageVillage;
import com.zehong.system.service.ITUserManageVillageService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 基本信息维护-用户管理-居住区(村庄)Controller
*
* @author zehong
* @date 2024-08-27
*/
@RestController
@RequestMapping("/system/village")
public class TUserManageVillageController extends BaseController
{
@Autowired
private ITUserManageVillageService tUserManageVillageService;
/**
* 查询基本信息维护-用户管理-居住区(村庄)列表
*/
@GetMapping("/list")
public TableDataInfo list(TUserManageVillage tUserManageVillage)
{
startPage();
List<TUserManageVillage> list = tUserManageVillageService.selectTUserManageVillageList(tUserManageVillage);
return getDataTable(list);
}
/**
* 导出基本信息维护-用户管理-居住区(村庄)列表
*/
@Log(title = "基本信息维护-用户管理-居住区(村庄)", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TUserManageVillage tUserManageVillage)
{
List<TUserManageVillage> list = tUserManageVillageService.exportTUserManageVillageList(tUserManageVillage);
ExcelUtil<TUserManageVillage> util = new ExcelUtil<TUserManageVillage>(TUserManageVillage.class);
return util.exportExcel(list, "基本信息维护-用户管理-居住区(村庄)数据");
}
/**
* 获取基本信息维护-用户管理-居住区(村庄)详细信息
*/
@GetMapping(value = "/{fVillageId}")
public AjaxResult getInfo(@PathVariable("fVillageId") Long fVillageId)
{
return AjaxResult.success(tUserManageVillageService.selectTUserManageVillageById(fVillageId));
}
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*/
@Log(title = "基本信息维护-用户管理-居住区(村庄)", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TUserManageVillage tUserManageVillage)
{
return toAjax(tUserManageVillageService.insertTUserManageVillage(tUserManageVillage));
}
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*/
@Log(title = "基本信息维护-用户管理-居住区(村庄)", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TUserManageVillage tUserManageVillage)
{
return toAjax(tUserManageVillageService.updateTUserManageVillage(tUserManageVillage));
}
/**
* 删除基本信息维护-用户管理-居住区(村庄)
*/
@Log(title = "基本信息维护-用户管理-居住区(村庄)", businessType = BusinessType.DELETE)
@DeleteMapping("/{fVillageIds}")
public AjaxResult remove(@PathVariable Long[] fVillageIds)
{
return toAjax(tUserManageVillageService.deleteTUserManageVillageByIds(fVillageIds));
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 基本信息维护-用户管理-居住区(村庄)对象 t_user_manage_village
*
* @author zehong
* @date 2024-08-27
*/
public class TUserManageVillage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long fVillageId;
/** 燃气企业 */
private String beyondEnterpriseId;
/**
* 燃气企业名称 导出用
*/
@Excel(name = "所属企业")
private String beyondEnterpriseName;
/** 居住区(村庄)名称 */
@Excel(name = "居住区(村庄)名称")
private String fVillageName;
/** 所在县(市、区)ID */
private Long fRegion;
/** 所在县(市、区)ID 名称,导出使用 */
@Excel(name = "所在县(市、区)")
private String fRegionName;
/** 居民总户数 */
@Excel(name = "居民总户数")
private Long fTotalNumHouse;
/** 管道燃气用户数(开通数) */
@Excel(name = "管道燃气用户数")
private Long fPipeGasUsers;
/** 瓶装燃气用户数 */
@Excel(name = "瓶装燃气用户数")
private Long fBottledGasUsers;
/** 经度 */
private BigDecimal longitude;
/** 纬度 */
private BigDecimal latitude;
/** 备注 */
private String remarks;
public void setfVillageId(Long fVillageId)
{
this.fVillageId = fVillageId;
}
public Long getfVillageId()
{
return fVillageId;
}
public void setfVillageName(String fVillageName)
{
this.fVillageName = fVillageName;
}
public String getfVillageName()
{
return fVillageName;
}
public void setfRegion(Long fRegion)
{
this.fRegion = fRegion;
}
public Long getfRegion()
{
return fRegion;
}
public void setfTotalNumHouse(Long fTotalNumHouse)
{
this.fTotalNumHouse = fTotalNumHouse;
}
public Long getfTotalNumHouse()
{
return fTotalNumHouse;
}
public void setfPipeGasUsers(Long fPipeGasUsers)
{
this.fPipeGasUsers = fPipeGasUsers;
}
public Long getfPipeGasUsers()
{
return fPipeGasUsers;
}
public void setfBottledGasUsers(Long fBottledGasUsers)
{
this.fBottledGasUsers = fBottledGasUsers;
}
public Long getfBottledGasUsers()
{
return fBottledGasUsers;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public String getfRegionName() {
return fRegionName;
}
public void setfRegionName(String fRegionName) {
this.fRegionName = fRegionName;
}
public String getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(String beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public String getBeyondEnterpriseName() {
return beyondEnterpriseName;
}
public void setBeyondEnterpriseName(String beyondEnterpriseName) {
this.beyondEnterpriseName = beyondEnterpriseName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fVillageId", getfVillageId())
.append("fVillageName", getfVillageName())
.append("fRegion", getfRegion())
.append("fTotalNumHouse", getfTotalNumHouse())
.append("fPipeGasUsers", getfPipeGasUsers())
.append("fBottledGasUsers", getfBottledGasUsers())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TUserManageVillage;
/**
* 基本信息维护-用户管理-居住区(村庄)Mapper接口
*
* @author zehong
* @date 2024-08-27
*/
public interface TUserManageVillageMapper
{
/**
* 查询基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
* @return 基本信息维护-用户管理-居住区(村庄)
*/
public TUserManageVillage selectTUserManageVillageById(Long fVillageId);
/**
* 查询基本信息维护-用户管理-居住区(村庄)列表
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 基本信息维护-用户管理-居住区(村庄)集合
*/
public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 导出用
* @param tUserManageVillage tUserManageVillage
* @return list
*/
public List<TUserManageVillage> exportUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 结果
*/
public int insertTUserManageVillage(TUserManageVillage tUserManageVillage);
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 结果
*/
public int updateTUserManageVillage(TUserManageVillage tUserManageVillage);
/**
* 删除基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
* @return 结果
*/
public int deleteTUserManageVillageById(Long fVillageId);
/**
* 批量删除基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageIds 需要删除的数据ID
* @return 结果
*/
public int deleteTUserManageVillageByIds(Long[] fVillageIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TUserManageVillage;
/**
* 基本信息维护-用户管理-居住区(村庄)Service接口
*
* @author zehong
* @date 2024-08-27
*/
public interface ITUserManageVillageService
{
/**
* 查询基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
* @return 基本信息维护-用户管理-居住区(村庄)
*/
public TUserManageVillage selectTUserManageVillageById(Long fVillageId);
/**
* 查询基本信息维护-用户管理-居住区(村庄)列表
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 基本信息维护-用户管理-居住区(村庄)集合
*/
public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 查询基本信息维护-用户管理-居住区(村庄)列表
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 基本信息维护-用户管理-居住区(村庄)集合
*/
public List<TUserManageVillage> exportTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 结果
*/
public int insertTUserManageVillage(TUserManageVillage tUserManageVillage);
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 结果
*/
public int updateTUserManageVillage(TUserManageVillage tUserManageVillage);
/**
* 批量删除基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageIds 需要删除的基本信息维护-用户管理-居住区(村庄)ID
* @return 结果
*/
public int deleteTUserManageVillageByIds(Long[] fVillageIds);
/**
* 删除基本信息维护-用户管理-居住区(村庄)信息
*
* @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
* @return 结果
*/
public int deleteTUserManageVillageById(Long fVillageId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TUserManageVillageMapper;
import com.zehong.system.domain.TUserManageVillage;
import com.zehong.system.service.ITUserManageVillageService;
/**
* 基本信息维护-用户管理-居住区(村庄)Service业务层处理
*
* @author zehong
* @date 2024-08-27
*/
@Service
public class TUserManageVillageServiceImpl implements ITUserManageVillageService
{
@Autowired
private TUserManageVillageMapper tUserManageVillageMapper;
/**
* 查询基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
* @return 基本信息维护-用户管理-居住区(村庄)
*/
@Override
public TUserManageVillage selectTUserManageVillageById(Long fVillageId)
{
return tUserManageVillageMapper.selectTUserManageVillageById(fVillageId);
}
/**
* 查询基本信息维护-用户管理-居住区(村庄)列表
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 基本信息维护-用户管理-居住区(村庄)
*/
@Override
public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
String deptId = user.getDeptId();
tUserManageVillage.setBeyondEnterpriseId(deptId);
return tUserManageVillageMapper.selectTUserManageVillageList(tUserManageVillage);
}
/**
* 查询基本信息维护-用户管理-居住区(村庄)导出
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 基本信息维护-用户管理-居住区(村庄)
*/
@Override
public List<TUserManageVillage> exportTUserManageVillageList(TUserManageVillage tUserManageVillage) {
SysUser user = SecurityUtils.getLoginUser().getUser();
String deptId = user.getDeptId();
tUserManageVillage.setBeyondEnterpriseId(deptId);
return tUserManageVillageMapper.exportUserManageVillageList(tUserManageVillage);
}
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 结果
*/
@Override
public int insertTUserManageVillage(TUserManageVillage tUserManageVillage)
{
return tUserManageVillageMapper.insertTUserManageVillage(tUserManageVillage);
}
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*
* @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
* @return 结果
*/
@Override
public int updateTUserManageVillage(TUserManageVillage tUserManageVillage)
{
return tUserManageVillageMapper.updateTUserManageVillage(tUserManageVillage);
}
/**
* 批量删除基本信息维护-用户管理-居住区(村庄)
*
* @param fVillageIds 需要删除的基本信息维护-用户管理-居住区(村庄)ID
* @return 结果
*/
@Override
public int deleteTUserManageVillageByIds(Long[] fVillageIds)
{
return tUserManageVillageMapper.deleteTUserManageVillageByIds(fVillageIds);
}
/**
* 删除基本信息维护-用户管理-居住区(村庄)信息
*
* @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
* @return 结果
*/
@Override
public int deleteTUserManageVillageById(Long fVillageId)
{
return tUserManageVillageMapper.deleteTUserManageVillageById(fVillageId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TUserManageVillageMapper">
<resultMap type="TUserManageVillage" id="TUserManageVillageResult">
<result property="fVillageId" column="f_village_id" />
<result property="fVillageName" column="f_village_name" />
<result property="fRegion" column="f_region" />
<result property="fTotalNumHouse" column="f_total_num_house" />
<result property="fPipeGasUsers" column="f_pipe_gas_users" />
<result property="fBottledGasUsers" column="f_bottled_gas_users" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="remarks" column="remarks" />
<result property="beyondEnterpriseId" column="f_beyond_enterprise_id" />
<result property="beyondEnterpriseName" column="enterprise_name" />
</resultMap>
<sql id="selectTUserManageVillageVo">
select village.f_village_id,
village.f_village_name,
village.f_region,
region.f_name as fRegionName,
village.f_total_num_house,
village.f_pipe_gas_users,
village.f_bottled_gas_users,
village.longitude,
village.latitude,
village.remarks,
village.f_beyond_enterprise_id,
enterprise.enterprise_name
from t_user_manage_village village
left join t_enterprise_info enterprise on village.f_beyond_enterprise_id = enterprise.enterprise_id
left join t_county_level_region region on village.f_region = region.f_id
</sql>
<!-- 导出封装-->
<resultMap type="TUserManageVillage" id="exportTUserManageVillageResult">
<result property="fVillageId" column="f_village_id" />
<result property="fVillageName" column="f_village_name" />
<result property="fRegion" column="f_region" />
<result property="fRegionName" column="fRegionName" />
<result property="fTotalNumHouse" column="f_total_num_house" />
<result property="fPipeGasUsers" column="f_pipe_gas_users" />
<result property="fBottledGasUsers" column="f_bottled_gas_users" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="remarks" column="remarks" />
<result property="beyondEnterpriseId" column="f_beyond_enterprise_id" />
<result property="beyondEnterpriseName" column="beyondEnterpriseName" />
</resultMap>
<sql id="exportTUserManageVillageVo">
select village.f_village_id,
village.f_village_name,
village.f_region,
region.f_name as fRegionName,
village.f_beyond_enterprise_id,
enterprise.enterprise_name as beyondEnterpriseName,
village.f_total_num_house,
village.f_pipe_gas_users,
village.f_bottled_gas_users,
village.longitude,
village.latitude,
village.remarks
from t_user_manage_village village
left join t_enterprise_info enterprise on village.f_beyond_enterprise_id = enterprise.enterprise_id
left join t_county_level_region region on village.f_region = region.f_id
</sql>
<!-- 导出封装结束-->
<select id="selectTUserManageVillageList" parameterType="TUserManageVillage" resultMap="TUserManageVillageResult">
<include refid="selectTUserManageVillageVo"/>
<where>
<if test="fVillageName != null and fVillageName != ''"> and f_village_name like concat('%', #{fVillageName}, '%')</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != '-2' and beyondEnterpriseId != ''"> and f_beyond_enterprise_id = #{beyondEnterpriseId} </if>
</where>
</select>
<select id="exportUserManageVillageList" parameterType="TUserManageVillage" resultMap="exportTUserManageVillageResult">
<include refid="exportTUserManageVillageVo"/>
<where>
<if test="fVillageName != null and fVillageName != ''"> and village.f_village_name like concat('%', #{fVillageName}, '%')</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != '-2' and beyondEnterpriseId != ''"> and f_beyond_enterprise_id = #{beyondEnterpriseId} </if>
</where>
</select>
<select id="selectTUserManageVillageById" parameterType="Long" resultMap="TUserManageVillageResult">
<include refid="selectTUserManageVillageVo"/>
where f_village_id = #{fVillageId}
</select>
<insert id="insertTUserManageVillage" parameterType="TUserManageVillage" useGeneratedKeys="true" keyProperty="fVillageId">
insert into t_user_manage_village
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fVillageName != null">f_village_name,</if>
<if test="fRegion != null">f_region,</if>
<if test="fTotalNumHouse != null">f_total_num_house,</if>
<if test="fPipeGasUsers != null">f_pipe_gas_users,</if>
<if test="fBottledGasUsers != null">f_bottled_gas_users,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="remarks != null">remarks,</if>
<if test="beyondEnterpriseId != null">f_beyond_enterprise_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fVillageName != null">#{fVillageName},</if>
<if test="fRegion != null">#{fRegion},</if>
<if test="fTotalNumHouse != null">#{fTotalNumHouse},</if>
<if test="fPipeGasUsers != null">#{fPipeGasUsers},</if>
<if test="fBottledGasUsers != null">#{fBottledGasUsers},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="remarks != null">#{remarks},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
</trim>
</insert>
<update id="updateTUserManageVillage" parameterType="TUserManageVillage">
update t_user_manage_village
<trim prefix="SET" suffixOverrides=",">
<if test="fVillageName != null">f_village_name = #{fVillageName},</if>
<if test="fRegion != null">f_region = #{fRegion},</if>
<if test="fTotalNumHouse != null">f_total_num_house = #{fTotalNumHouse},</if>
<if test="fPipeGasUsers != null">f_pipe_gas_users = #{fPipeGasUsers},</if>
<if test="fBottledGasUsers != null">f_bottled_gas_users = #{fBottledGasUsers},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="beyondEnterpriseId != null">f_beyond_enterprise_id = #{beyondEnterpriseId},</if>
</trim>
where f_village_id = #{fVillageId}
</update>
<delete id="deleteTUserManageVillageById" parameterType="Long">
delete from t_user_manage_village where f_village_id = #{fVillageId}
</delete>
<delete id="deleteTUserManageVillageByIds" parameterType="String">
delete from t_user_manage_village where f_village_id in
<foreach item="fVillageId" collection="array" open="(" separator="," close=")">
#{fVillageId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询基本信息维护-用户管理-居住区(村庄)列表
export function listVillage(query) {
return request({
url: '/system/village/list',
method: 'get',
params: query
})
}
// 查询基本信息维护-用户管理-居住区(村庄)详细
export function getVillage(fVillageId) {
return request({
url: '/system/village/' + fVillageId,
method: 'get'
})
}
// 新增基本信息维护-用户管理-居住区(村庄)
export function addVillage(data) {
return request({
url: '/system/village',
method: 'post',
data: data
})
}
// 修改基本信息维护-用户管理-居住区(村庄)
export function updateVillage(data) {
return request({
url: '/system/village',
method: 'put',
data: data
})
}
// 删除基本信息维护-用户管理-居住区(村庄)
export function delVillage(fVillageId) {
return request({
url: '/system/village/' + fVillageId,
method: 'delete'
})
}
// 导出基本信息维护-用户管理-居住区(村庄)
export function exportVillage(query) {
return request({
url: '/system/village/export',
method: 'get',
params: query
})
}
\ No newline at end of file
...@@ -24,7 +24,7 @@ $sidebarLightTitle: #001529; ...@@ -24,7 +24,7 @@ $sidebarLightTitle: #001529;
$subMenuBg:#1f2d3d; $subMenuBg:#1f2d3d;
$subMenuHover:#001528; $subMenuHover:#001528;
$sideBarWidth: 200px; $sideBarWidth: 220px;
// the :export directive is the magic sauce for webpack // the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="居住区(村庄)名称" prop="fVillageName">
<el-input
v-model="queryParams.fVillageName"
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="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="villageList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<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="fVillageName" >
<span slot-scope="scope" v-if="scope.row.fVillageName">{{scope.row.fVillageName}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="所在县" align="center" prop="fRegionName" >
<span slot-scope="scope" v-if="scope.row.fRegionName">{{scope.row.fRegionName}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="居民总户数" align="center" prop="fTotalNumHouse" >
<span slot-scope="scope" v-if="scope.row.fTotalNumHouse">{{scope.row.fTotalNumHouse}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="管道燃气用户数" align="center" prop="fPipeGasUsers" >
<span slot-scope="scope" v-if="scope.row.fPipeGasUsers">{{scope.row.fPipeGasUsers}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="瓶装燃气用户数" align="center" prop="fBottledGasUsers" >
<span slot-scope="scope" v-if="scope.row.fBottledGasUsers">{{scope.row.fBottledGasUsers}}</span>
<span v-else>-</span>
</el-table-column>
<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-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改基本信息维护-用户管理-居住区(村庄)对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col :span="11">
<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 enterpriseList" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="居住区(村庄)名称" prop="fVillageName">
<el-input v-model="form.fVillageName" placeholder="请输入居住区(村庄)名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="县级行政区" prop="fRegion">
<el-select
v-model="form.fRegion"
placeholder="请选择县级行政区"
style="width: 100%"
>
<el-option
v-for="county in countyInfo"
:key="county.fId"
:label="county.fName.trim()"
:value="county.fId"
/>
</el-select>
<!--<el-input v-model="form.fRegion" placeholder="请输入项目所在县级行政区ID" />-->
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="居民总户数" prop="fTotalNumHouse">
<el-input @input="fTotalNumHousefilterInput" v-model="form.fTotalNumHouse" placeholder="请输入居民总户数" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="管道燃气用户数" prop="fPipeGasUsers">
<el-input @input="fPipeGasUsersfilterInput" v-model="form.fPipeGasUsers" placeholder="请输入管道燃气用户数" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="瓶装燃气用户数" prop="fBottledGasUsers">
<el-input @input="fBottledGasUsersfilterInput" v-model="form.fBottledGasUsers" placeholder="请输入瓶装燃气用户数" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<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: 15px">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col>
<el-col :span="4" style="margin-left: 15px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
/>
</div>
</template>
<script>
import { listVillage, getVillage, delVillage, addVillage, updateVillage, exportVillage } from "@/api/regulation/userManagement/village";
import { selectTEnterprise} from "@/api/regulation/supervise";
import { getDefaultCountyList } from "@/api/area/county";
import GetPos from '@/components/GetPos';
export default {
name: "Village",
components: {
GetPos
},
data() {
return {
// 燃气企业下拉数据
enterpriseList: {},
countyInfo: [],
/**--------------地图使用数据---------------*/
dialogTableVisibles:false,
devicePos: [],
/**--------------地图使用数据---------------*/
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 基本信息维护-用户管理-居住区(村庄)表格数据
villageList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fVillageName: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
fVillageName: [
{ required: true, message: "请输入居住区(村庄)名称", trigger: "blur" },
],
fTotalNumHouse: [
{ required: true, message: "请输入居住总户数", trigger: "blur" },
],
}
};
},
created() {
this.getList();
this.getCountyInfo();
},
methods: {
fTotalNumHousefilterInput(value) {
this.form.fTotalNumHouse = value.replace(/[^\d.]/g, '').replace(/(\..*)\./g, '$1');
},
fPipeGasUsersfilterInput(value) {
this.form.fPipeGasUsers = value.replace(/[^\d.]/g, '').replace(/(\..*)\./g, '$1');
},
fBottledGasUsersfilterInput(value) {
this.form.fBottledGasUsers = value.replace(/[^\d.]/g, '').replace(/(\..*)\./g, '$1');
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
},
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
/** 查询基本信息维护-用户管理-居住区(村庄)列表 */
getList() {
this.loading = true;
listVillage(this.queryParams).then(response => {
this.villageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fVillageId: null,
fVillageName: null,
fRegion: null,
fTotalNumHouse: null,
fPipeGasUsers: null,
fBottledGasUsers: null,
longitude: null,
latitude: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fVillageId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.enterpriseList = response.data;
});
this.reset();
this.open = true;
this.title = "添加居住区(村庄)";
},
/** 修改按钮操作 */
handleUpdate(row) {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.enterpriseList = response.data;
});
this.reset();
const fVillageId = row.fVillageId || this.ids
getVillage(fVillageId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改居住区(村庄)";
this.devicePos = [response.data.longitude, response.data.latitude];
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fVillageId != null) {
updateVillage(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addVillage(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fVillageIds = row.fVillageId || this.ids;
this.$confirm('是否确认删除基本信息维护-用户管理-居住区(村庄)编号为"' + fVillageIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delVillage(fVillageIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有基本信息维护-用户管理-居住区(村庄)数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportVillage(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
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