diff --git a/ruoyi-ui/src/views/szxc/csmanage/index.vue b/ruoyi-ui/src/views/szxc/csmanage/index.vue index 62da8b0..ea44ee5 100644 --- a/ruoyi-ui/src/views/szxc/csmanage/index.vue +++ b/ruoyi-ui/src/views/szxc/csmanage/index.vue @@ -190,6 +190,7 @@ 场所员工 场所负责人 + 关联房屋 @@ -406,6 +407,75 @@ + + + + 新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -413,6 +483,8 @@ import { listCsmanage, getCsmanage, delCsmanage, addCsmanage, updateCsmanage } from "@/api/szxc/csmanage"; import { listEmplyees } from "@/api/szxc/emplyees"; import { listResponse } from "@/api/szxc/response"; +import { listCs_fw, getCs_fw, delCs_fw, addCs_fw, updateCs_fw } from "@/api/szxc/cs_fw"; +import { listHouseinfo } from "@/api/szxc/houseinfo"; import { deptTreeSelect } from "@/api/system/user"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; @@ -492,7 +564,46 @@ export default { // 选中信息 selectedRow: null, }, - }; + // 场所房屋关联信息 + csfw: { + visible: false, + // 遮罩层 + loading: false, + // 查询列表 + list: [], + // 选中信息 + selectedRow: null, + // 弹出框 + open: false, + // 弹出层标题 + title: '', + // 表单参数 + form: {}, + // 表单校验 + rules: { + cardNum: [ + {required: true, message: "银行卡号不能为空", trigger: "blur"} + ], + }, + }, + // 房屋信息 + fwxx: { + visible: false, + // 遮罩层 + loading: false, + // 总条数 + total: 0, + // 查询参数 + queryParams:{ + pageNum: 1, + pageSize: 10 + }, + // 查询列表 + list: [], + // 选中数据 + selectRow: null + }, + } }, created() { this.getList(); @@ -634,6 +745,9 @@ export default { case "handleFzr": this.handleFzr(row); break; + case "handleFw": + this.handleFw(row); + break; default: break; } @@ -670,6 +784,95 @@ export default { this.csfzr.list = response.rows }); }, + // 场所房屋信息 + handleFw(row){ + this.csfw.selectedRow = row + this.csfw.visible = true; + this.getlistCs_fw() + }, + /** 查询场所房屋关联列表 */ + getlistCs_fw() { + this.csfw.loading = true; + listCs_fw(this.queryParams).then(response => { + this.csfw.list = response.rows; + this.csfw.total = response.total; + this.csfw.loading = false; + }); + }, + // 添加房屋 + csfwAdd(){ + this.resetForm("csfwForm"); + this.csfw.form = { + id: null, + csId: this.csfw.selectedRow.id, + fwId: null, + fwName: null + }; + this.csfw.title = '添加房屋'; + this.csfw.open = true; + }, + /** 修改房屋按钮操作 */ + csfwUpdate(row) { + this.csfw.form = row; + this.csfw.title = '修改房屋'; + this.csfw.open = true; + }, + /** 删除房屋按钮操作 */ + csfwDelete(row) { + this.$modal.confirm('是否确认删除房屋为【"' + row.fwName + '"】的数据项?').then(function() { + return delCs_fw(row.id); + }).then(() => { + this.getlistCs_fw(); + this.$modal.msgSuccess("删除成功"); + }).catch(() => {}); + }, + // 添加提交房屋 + csfwSubmit(){ + this.$refs["csfwForm"].validate(valid => { + if (valid) { + if (this.csfw.form.id != null) { + updateCs_fw(this.csfw.form).then(response => { + this.$modal.msgSuccess("修改成功"); + this.csfw.open = false; + this.getlistCs_fw(); + }); + } else { + this.csfw.form.defaultCard = '1' + addCs_fw(this.csfw.form).then(response => { + this.$modal.msgSuccess("新增成功"); + this.csfw.open = false; + this.getlistCs_fw(); + }); + } + } + }); + }, + // 点击选择房屋 + fwxxSelect(){ + this.fwxx.visible = true; + this.getlistHouseinfo() + }, + /** 查询房屋信息列表 */ + getlistHouseinfo() { + this.fwxx.loading = true; + listHouseinfo(this.fwxx.queryParams).then(response => { + this.fwxx.list = response.rows; + this.fwxx.total = response.total; + this.fwxx.loading = false; + }); + }, + // 房屋信息查询 + fwxxQuery(){ + this.fwxx.queryParams.pageNum = 1; + this.getlistHouseinfo(); + }, + // 房屋选择 选中数据 + fwxxDblclick(row) { + this.fwxx.selectRow = row; + this.csfw.form.fwId = row.id; + this.csfw.form.fwName = row.houseName; + this.fwxx.visible = false + }, } };