场所与房屋关联表

main
hansha 2 years ago
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();
}
}

@ -1,17 +1,18 @@
package com.ruoyi.szxc.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* szxc_place_manage
*
* @author hs
* @date 2024-03-28
* @date 2024-03-29
*/
public class SzxcPlaceManage extends BaseEntity
{
@ -69,14 +70,6 @@ public class SzxcPlaceManage extends BaseEntity
@Excel(name = "营业执照")
private String yyzzPicture;
/** 关联房屋id */
@Excel(name = "关联房屋id")
private Long glfwId;
/** 关联房屋名称 */
@Excel(name = "关联房屋名称")
private String glfwName;
/** 部门id */
@Excel(name = "部门id")
private Long deptId;
@ -206,24 +199,6 @@ public class SzxcPlaceManage extends BaseEntity
{
return yyzzPicture;
}
public void setGlfwId(Long glfwId)
{
this.glfwId = glfwId;
}
public Long getGlfwId()
{
return glfwId;
}
public void setGlfwName(String glfwName)
{
this.glfwName = glfwName;
}
public String getGlfwName()
{
return glfwName;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
@ -255,29 +230,27 @@ public class SzxcPlaceManage extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("csName", getCsName())
.append("hyType", getHyType())
.append("csType", getCsType())
.append("csAddress", getCsAddress())
.append("employeeNum", getEmployeeNum())
.append("szyt", getSzyt())
.append("fwType", getFwType())
.append("frName", getFrName())
.append("clDate", getClDate())
.append("yyqx", getYyqx())
.append("tyshxyCode", getTyshxyCode())
.append("yyzzPicture", getYyzzPicture())
.append("glfwId", getGlfwId())
.append("glfwName", getGlfwName())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("deptId", getDeptId())
.append("deptName", getDeptName())
.append("userId", getUserId())
.toString();
.append("id", getId())
.append("csName", getCsName())
.append("hyType", getHyType())
.append("csType", getCsType())
.append("csAddress", getCsAddress())
.append("employeeNum", getEmployeeNum())
.append("szyt", getSzyt())
.append("fwType", getFwType())
.append("frName", getFrName())
.append("clDate", getClDate())
.append("yyqx", getYyqx())
.append("tyshxyCode", getTyshxyCode())
.append("yyzzPicture", getYyzzPicture())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("deptId", getDeptId())
.append("deptName", getDeptName())
.append("userId", getUserId())
.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>

@ -1,7 +1,7 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcPlaceManageMapper">
<resultMap type="SzxcPlaceManage" id="SzxcPlaceManageResult">
@ -18,8 +18,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="yyqx" column="yyqx" />
<result property="tyshxyCode" column="tyshxy_code" />
<result property="yyzzPicture" column="yyzz_picture" />
<result property="glfwId" column="glfw_id" />
<result property="glfwName" column="glfw_name" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -31,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSzxcPlaceManageVo">
select id, cs_name, hy_type, cs_type, cs_address, employee_num, szyt, fw_type, fr_name, cl_date, yyqx, tyshxy_code, yyzz_picture, glfw_id, glfw_name, remark, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_place_manage
select id, cs_name, hy_type, cs_type, cs_address, employee_num, szyt, fw_type, fr_name, cl_date, yyqx, tyshxy_code, yyzz_picture, remark, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_place_manage
</sql>
<select id="selectSzxcPlaceManageList" parameterType="SzxcPlaceManage" resultMap="SzxcPlaceManageResult">
@ -49,8 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yyqx != null and yyqx != ''"> and yyqx = #{yyqx}</if>
<if test="tyshxyCode != null and tyshxyCode != ''"> and tyshxy_code = #{tyshxyCode}</if>
<if test="yyzzPicture != null and yyzzPicture != ''"> and yyzz_picture = #{yyzzPicture}</if>
<if test="glfwId != null "> and glfw_id = #{glfwId}</if>
<if test="glfwName != null and glfwName != ''"> and glfw_name like concat('%', #{glfwName}, '%')</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if>
@ -77,8 +73,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yyqx != null">yyqx,</if>
<if test="tyshxyCode != null">tyshxy_code,</if>
<if test="yyzzPicture != null">yyzz_picture,</if>
<if test="glfwId != null">glfw_id,</if>
<if test="glfwName != null">glfw_name,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -87,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">dept_id,</if>
<if test="deptName != null">dept_name,</if>
<if test="userId != null">user_id,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="csName != null">#{csName},</if>
<if test="hyType != null">#{hyType},</if>
@ -101,8 +95,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yyqx != null">#{yyqx},</if>
<if test="tyshxyCode != null">#{tyshxyCode},</if>
<if test="yyzzPicture != null">#{yyzzPicture},</if>
<if test="glfwId != null">#{glfwId},</if>
<if test="glfwName != null">#{glfwName},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -111,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if>
<if test="userId != null">#{userId},</if>
</trim>
</trim>
</insert>
<update id="updateSzxcPlaceManage" parameterType="SzxcPlaceManage">
@ -129,8 +121,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yyqx != null">yyqx = #{yyqx},</if>
<if test="tyshxyCode != null">tyshxy_code = #{tyshxyCode},</if>
<if test="yyzzPicture != null">yyzz_picture = #{yyzzPicture},</if>
<if test="glfwId != null">glfw_id = #{glfwId},</if>
<if test="glfwName != null">glfw_name = #{glfwName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>

@ -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…
Cancel
Save