parent
d6f5c7e318
commit
45764b415d
@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.szxc.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
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.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcCsFw;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcCsFwService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场所房屋关联Controller
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/szxc/cs_fw")
|
||||||
|
public class SzxcCsFwController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISzxcCsFwService szxcCsFwService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:cs_fw:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SzxcCsFw> list = szxcCsFwService.selectSzxcCsFwList(szxcCsFw);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出场所房屋关联列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:cs_fw:export')")
|
||||||
|
@Log(title = "场所房屋关联", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
List<SzxcCsFw> list = szxcCsFwService.selectSzxcCsFwList(szxcCsFw);
|
||||||
|
ExcelUtil<SzxcCsFw> util = new ExcelUtil<SzxcCsFw>(SzxcCsFw.class);
|
||||||
|
util.exportExcel(response, list, "场所房屋关联数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取场所房屋关联详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:cs_fw:query')")
|
||||||
|
@GetMapping(value = "/{csId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("csId") Long csId)
|
||||||
|
{
|
||||||
|
return success(szxcCsFwService.selectSzxcCsFwByCsId(csId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增场所房屋关联
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:cs_fw:add')")
|
||||||
|
@Log(title = "场所房屋关联", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
return toAjax(szxcCsFwService.insertSzxcCsFw(szxcCsFw));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改场所房屋关联
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:cs_fw:edit')")
|
||||||
|
@Log(title = "场所房屋关联", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
return toAjax(szxcCsFwService.updateSzxcCsFw(szxcCsFw));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除场所房屋关联
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:cs_fw:remove')")
|
||||||
|
@Log(title = "场所房屋关联", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{csIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] csIds)
|
||||||
|
{
|
||||||
|
return toAjax(szxcCsFwService.deleteSzxcCsFwByCsIds(csIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.szxc.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场所房屋关联对象 szxc_cs_fw
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
public class SzxcCsFw extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 场所id */
|
||||||
|
private Long csId;
|
||||||
|
|
||||||
|
/** 房屋id */
|
||||||
|
private Long fwId;
|
||||||
|
|
||||||
|
public void setCsId(Long csId)
|
||||||
|
{
|
||||||
|
this.csId = csId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCsId()
|
||||||
|
{
|
||||||
|
return csId;
|
||||||
|
}
|
||||||
|
public void setFwId(Long fwId)
|
||||||
|
{
|
||||||
|
this.fwId = fwId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFwId()
|
||||||
|
{
|
||||||
|
return fwId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("csId", getCsId())
|
||||||
|
.append("fwId", getFwId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.szxc.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.szxc.domain.SzxcCsFw;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场所房屋关联Mapper接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
public interface SzxcCsFwMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csId 场所房屋关联主键
|
||||||
|
* @return 场所房屋关联
|
||||||
|
*/
|
||||||
|
public SzxcCsFw selectSzxcCsFwByCsId(Long csId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联列表
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 场所房屋关联集合
|
||||||
|
*/
|
||||||
|
public List<SzxcCsFw> selectSzxcCsFwList(SzxcCsFw szxcCsFw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增场所房屋关联
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSzxcCsFw(SzxcCsFw szxcCsFw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改场所房屋关联
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSzxcCsFw(SzxcCsFw szxcCsFw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csId 场所房屋关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcCsFwByCsId(Long csId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcCsFwByCsIds(Long[] csIds);
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.szxc.service;
|
||||||
|
|
||||||
|
import com.ruoyi.szxc.domain.SzxcCsFw;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场所房屋关联Service接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
public interface ISzxcCsFwService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csId 场所房屋关联主键
|
||||||
|
* @return 场所房屋关联
|
||||||
|
*/
|
||||||
|
public SzxcCsFw selectSzxcCsFwByCsId(Long csId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联列表
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 场所房屋关联集合
|
||||||
|
*/
|
||||||
|
public List<SzxcCsFw> selectSzxcCsFwList(SzxcCsFw szxcCsFw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增场所房屋关联
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSzxcCsFw(SzxcCsFw szxcCsFw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改场所房屋关联
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSzxcCsFw(SzxcCsFw szxcCsFw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csIds 需要删除的场所房屋关联主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcCsFwByCsIds(Long[] csIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除场所房屋关联信息
|
||||||
|
*
|
||||||
|
* @param csId 场所房屋关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcCsFwByCsId(Long csId);
|
||||||
|
}
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
package com.ruoyi.szxc.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.szxc.domain.SzxcCsFw;
|
||||||
|
import com.ruoyi.szxc.mapper.SzxcCsFwMapper;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcCsFwService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场所房屋关联Service业务层处理
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SzxcCsFwServiceImpl implements ISzxcCsFwService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SzxcCsFwMapper szxcCsFwMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csId 场所房屋关联主键
|
||||||
|
* @return 场所房屋关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SzxcCsFw selectSzxcCsFwByCsId(Long csId)
|
||||||
|
{
|
||||||
|
return szxcCsFwMapper.selectSzxcCsFwByCsId(csId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询场所房屋关联列表
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 场所房屋关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SzxcCsFw> selectSzxcCsFwList(SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
return szxcCsFwMapper.selectSzxcCsFwList(szxcCsFw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增场所房屋关联
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSzxcCsFw(SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
return szxcCsFwMapper.insertSzxcCsFw(szxcCsFw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改场所房屋关联
|
||||||
|
*
|
||||||
|
* @param szxcCsFw 场所房屋关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSzxcCsFw(SzxcCsFw szxcCsFw)
|
||||||
|
{
|
||||||
|
return szxcCsFwMapper.updateSzxcCsFw(szxcCsFw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除场所房屋关联
|
||||||
|
*
|
||||||
|
* @param csIds 需要删除的场所房屋关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcCsFwByCsIds(Long[] csIds)
|
||||||
|
{
|
||||||
|
return szxcCsFwMapper.deleteSzxcCsFwByCsIds(csIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除场所房屋关联信息
|
||||||
|
*
|
||||||
|
* @param csId 场所房屋关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcCsFwByCsId(Long csId)
|
||||||
|
{
|
||||||
|
return szxcCsFwMapper.deleteSzxcCsFwByCsId(csId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ruoyi.szxc.mapper.SzxcCsFwMapper">
|
||||||
|
|
||||||
|
<resultMap type="SzxcCsFw" id="SzxcCsFwResult">
|
||||||
|
<result property="csId" column="cs_id" />
|
||||||
|
<result property="fwId" column="fw_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSzxcCsFwVo">
|
||||||
|
select cs_id, fw_id from szxc_cs_fw
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSzxcCsFwList" parameterType="SzxcCsFw" resultMap="SzxcCsFwResult">
|
||||||
|
<include refid="selectSzxcCsFwVo"/>
|
||||||
|
<where>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSzxcCsFwByCsId" parameterType="Long" resultMap="SzxcCsFwResult">
|
||||||
|
<include refid="selectSzxcCsFwVo"/>
|
||||||
|
where cs_id = #{csId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSzxcCsFw" parameterType="SzxcCsFw">
|
||||||
|
insert into szxc_cs_fw
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="csId != null">cs_id,</if>
|
||||||
|
<if test="fwId != null">fw_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="csId != null">#{csId},</if>
|
||||||
|
<if test="fwId != null">#{fwId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSzxcCsFw" parameterType="SzxcCsFw">
|
||||||
|
update szxc_cs_fw
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="fwId != null">fw_id = #{fwId},</if>
|
||||||
|
</trim>
|
||||||
|
where cs_id = #{csId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSzxcCsFwByCsId" parameterType="Long">
|
||||||
|
delete from szxc_cs_fw where cs_id = #{csId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSzxcCsFwByCsIds" parameterType="String">
|
||||||
|
delete from szxc_cs_fw where cs_id in
|
||||||
|
<foreach item="csId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{csId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询场所房屋关联列表
|
||||||
|
export function listCs_fw(query) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/cs_fw/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询场所房屋关联详细
|
||||||
|
export function getCs_fw(csId) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/cs_fw/' + csId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增场所房屋关联
|
||||||
|
export function addCs_fw(data) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/cs_fw',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改场所房屋关联
|
||||||
|
export function updateCs_fw(data) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/cs_fw',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除场所房屋关联
|
||||||
|
export function delCs_fw(csId) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/cs_fw/' + csId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -0,0 +1,233 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<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"
|
||||||
|
v-hasPermi="['szxc:cs_fw: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="['szxc:cs_fw: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="['szxc:cs_fw:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['szxc:cs_fw:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="cs_fwList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="场所id" align="center" prop="csId" />
|
||||||
|
<el-table-column label="房屋id" align="center" prop="fwId" />
|
||||||
|
<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)"
|
||||||
|
v-hasPermi="['szxc:cs_fw:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['szxc:cs_fw:remove']"
|
||||||
|
>删除</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="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listCs_fw, getCs_fw, delCs_fw, addCs_fw, updateCs_fw } from "@/api/szxc/cs_fw";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Cs_fw",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 场所房屋关联表格数据
|
||||||
|
cs_fwList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询场所房屋关联列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listCs_fw(this.queryParams).then(response => {
|
||||||
|
this.cs_fwList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
csId: null,
|
||||||
|
fwId: 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.csId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加场所房屋关联";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const csId = row.csId || this.ids
|
||||||
|
getCs_fw(csId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改场所房屋关联";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.csId != null) {
|
||||||
|
updateCs_fw(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCs_fw(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const csIds = row.csId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除场所房屋关联编号为"' + csIds + '"的数据项?').then(function() {
|
||||||
|
return delCs_fw(csIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('szxc/cs_fw/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `cs_fw_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in new issue