From 1ba1b90dcde6dc3c82362ffd73a766c9b111e0e9 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Sat, 06 Jan 2024 15:43:22 +0800
Subject: [PATCH] 议事限制人员
---
src/views/article/publicSignUp.vue | 65
src/views/article/discussionManage.vue | 27
src/views/article/components/publicSignUpChild.vue | 680 +++++++---------
src/views/userHouse/houseList.vue | 1461 ++++++++++++++++++------------------
src/views/article/components/discussionManageChild.vue | 146 +++
src/api/discuss/publicDiscuss.js | 7
6 files changed, 1,243 insertions(+), 1,143 deletions(-)
diff --git a/src/api/discuss/publicDiscuss.js b/src/api/discuss/publicDiscuss.js
index f954578..0834159 100644
--- a/src/api/discuss/publicDiscuss.js
+++ b/src/api/discuss/publicDiscuss.js
@@ -12,12 +12,12 @@
})
}
-export const getDetailPd = (id) => {
+export const getDetailPd = (params) => {
return request({
url: '/api/public_discuss/publicDiscuss/detail',
method: 'get',
params: {
- id
+ ...params,
}
})
}
@@ -46,5 +46,4 @@
method: 'post',
data: row
})
-}
-
+}
\ No newline at end of file
diff --git a/src/views/article/components/discussionManageChild.vue b/src/views/article/components/discussionManageChild.vue
index e6cd35e..daa6662 100644
--- a/src/views/article/components/discussionManageChild.vue
+++ b/src/views/article/components/discussionManageChild.vue
@@ -1,7 +1,7 @@
<template>
<div>
- <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="80%" :before-close="handleClose">
+ <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="60%" :before-close="handleClose">
<avue-form ref="DisCussFrom" :option="option" v-model="disCussFrom" @submit="handleSubmit"></avue-form>
</el-dialog>
</div>
@@ -28,6 +28,13 @@
import {
getDictionary
} from '@/api/system/dict'
+
+ import {
+ getList as getHouseholdList,
+ getDetatils as getHouseholdDetail
+ } from "@/api/userHouse/list/houseHold"
+
+
export default {
data() {
@@ -78,27 +85,24 @@
searchMenuSpan: 3,
menuWidth: 500,
column: [{
- label: 'ID',
- prop: 'id',
- searchSpan: 4,
- display: false,
- },
- {
label: '标题',
prop: 'title',
searchSpan: 4,
+ span: 6,
},
{
label: '参与人数',
prop: 'topsCount',
searchSpan: 4,
display: false,
+ span: 6,
},
{
label: '开启投票',
prop: 'openFlag',
type: 'radio',
button: true,
+ span: 6,
value: 0,
dicData: [{
label: '开启',
@@ -117,6 +121,7 @@
prop: 'voteRestrictions',
type: 'radio',
button: true,
+ span: 6,
dicData: [{
label: '一人一票',
value: 0
@@ -135,6 +140,7 @@
prop: 'signatureFlag',
type: 'radio',
button: true,
+ span: 6,
dicData: [{
label: '不需要',
value: 0
@@ -153,6 +159,7 @@
prop: 'appointUser',
type: 'radio',
button: true,
+ span: 6,
dicData: [{
label: '不限制',
value: 0
@@ -168,7 +175,103 @@
value: 0
},
{
+ label: "选择用户",
+ prop: "userIds",
+ hide: true,
+ // type: "table",
+ display: false,
+ span: 6,
+ // labelWidth: 120,
+ searchSpan: 4,
+ search: true,
+ children: {
+ border: true,
+ height: 400,
+ searchShow: true,
+ searchMenuSpan: 6,
+ submitText: "确定",
+ column: [{
+ label: "姓名",
+ prop: "name",
+ search: true,
+ searchSpan: 4,
+ rules: [{
+ required: true,
+ message: "请输入姓名",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "联系方式",
+ prop: "phoneNumber",
+ search: true,
+ searchSpan: 4,
+ rules: [{
+ required: true,
+ message: "请输入联系方式",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "地址",
+ search: true,
+ searchSpan: 8,
+ prop: "currentAddress",
+ display: false
+ },
+ ],
+ },
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
+ },
+ formatter: (row) => {
+ this.form.phoneNumber = row.phoneNumber
+ return row.name
+ },
+ onLoad: ({
+ page,
+ value,
+ data
+ }, callback) => {
+ //首次加载去查询对应的值
+ if (value) {
+ getHouseholdDetail(value).then(res => {
+ var resData = res.data.data
+ // 查询对应行数据
+ callback(resData)
+ return
+ })
+ }
+ if (page) {
+ this.loading = true
+ var params = {
+ ...data,
+ townStreetCode: "361102005"
+ }
+ getHouseholdList(page.currentPage, page.pageSize, Object.assign(params)).then(res => {
+ const resData = res.data.data
+ var total = resData.total
+ var data = resData.records
+ this.loading = false
+ this.selectionClear()
+ //分页查询信息
+ callback({
+ total: total,
+ data: data
+ })
+ })
+ }
+ },
+ props: {
+ label: 'name',
+ value: 'id'
+ }
+ },
+ {
label: "截止时间",
+ span: 6,
prop: "endTime",
type: "datetime",
format: "yyyy-MM-dd hh:mm:ss",
@@ -192,6 +295,32 @@
},
mounted() {
+ },
+ watch: {
+ 'disCussFrom.appointUser': {
+ handler(newData) {
+ const column = this.findObject(this.option.column, "userIds");
+ if (newData == 1) {
+ column.display = true
+ } else {
+ column.display = false
+ }
+ },
+ },
+ "disCussFrom.userIds": {
+ // form是表单或者表格绑定的数据集,v-model='form'
+ handler(val) {
+ this.$nextTick(() => {
+ console.log(this.$refs, 66666)
+ // getHouseholdDetail(val).then(res => {
+ // const data = res.data.data
+ // this.form.phoneNumber = data.phoneNumber
+ // this.form.currentAddress = data.currentAddress
+ // })
+ })
+ },
+ immediate: true,
+ },
},
computed: {
...mapGetters(["permission"]),
@@ -232,7 +361,6 @@
handleClose() {
this.dialogVisibles = false
- this.disCussFrom = {}
this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
console.log(this.$refs, 90999)
@@ -258,4 +386,4 @@
.el-pagination {
margin-top: 20px;
}
-</style>
+</style>
\ No newline at end of file
diff --git a/src/views/article/components/publicSignUpChild.vue b/src/views/article/components/publicSignUpChild.vue
index c7d0590..aa1d301 100644
--- a/src/views/article/components/publicSignUpChild.vue
+++ b/src/views/article/components/publicSignUpChild.vue
@@ -1,12 +1,10 @@
<template>
- <basicContainer>
- <avue-crud :data="data" ref="crud" :table-loading="loading" @current-change="currentChange"
+ <!-- <basicContainer> -->
+ <!-- <avue-crud :data="data" ref="crud" :table-loading="loading" @current-change="currentChange"
@search-change="searchChange" @search-reset="searchReset" @size-change="sizeChange" :option="option"
v-model="data" :page="page" @selection-change="selectionChange" @row-del="rowDel"
@refresh-change="refreshChange" @on-load="onLoad">
<template slot="menuLeft">
- <!-- <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 除
- </el-button> -->
<el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete"
@click="handleDelete">批量删除
</el-button>
@@ -20,398 +18,352 @@
参与用户
</el-button>
</template>
- </avue-crud>
+ </avue-crud> -->
- <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
+ <!-- <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
<avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm">
</avue-form>
- </el-dialog>
+ </el-dialog> -->
- <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="50%" :before-close="userHandleClose">
- <!-- <span slot="title" class="dialog-footer">
- {{discussForm.ontitle}}
- </span> -->
- <avue-crud :data="dataUser" :page="pageUser" :option="option1" @on-load="getUser"></avue-crud>
- </el-dialog>
+ <div>
+ <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="50%" :before-close="userHandleClose">
+ <avue-crud ref="DataUser" :option="option1" v-model="dataUser" :page="pageUser"></avue-crud>
+ </el-dialog>
+ </div>
- </basicContainer>
+ <!-- </basicContainer> -->
</template>
<script>
-import {
+ import {
getListPd,
getDetailPd,
addPd,
updatePd,
removePd,
-} from "@/api/discuss/publicDiscuss"
-import {
+ } from "@/api/discuss/publicDiscuss"
+ import {
getPageUser,
-} from "@/api/discuss/userPublicEnroll"
-import option from "@/option/discuss/publicDiscuss"
-import {
+ } from "@/api/discuss/userPublicEnroll"
+ import option from "@/option/discuss/publicDiscuss"
+ import {
mapGetters
-} from "vuex"
-import {
+ } from "vuex"
+ import {
getDictionary
-} from '@/api/system/dict'
+ } from '@/api/system/dict'
-export default {
- data () {
- return {
- option1: {
- menu: false,
- addBtn: false,
- column: [{
- label: '姓名',
- prop: 'name'
- }, {
- label: '头像',
- prop: 'avatar'
- }, {
- label: '手机',
- prop: 'phone'
- }, {
- width: 220,
- overHidden: true,
- label: '小区名称',
- prop: 'aoiName'
- }, {
- label: '地址',
- prop: 'addressName'
- }, {
- label: '时间',
- prop: 'createTime'
- }]
- },
- discussForm: {
- ontitle: '',
- title: '',
- openFlag: 0,
- numberRestrictions: 0,
- voteRestrictions: 0,
- userRestrictions: 0,
- endTime: '',
- articleId: '',
- createTime: '',
- updateTime: '',
- deleteFlag: '',
- repeatVote: 0,
- voteNumberPublic: 0,
- appointUser: '',
- userIds: '',
- eventType: 1,
- },
- optionEnroll: {
- column: [{
- label: "",
- type: 'title',
- prop: "title",
- span: 24,
- row: true,
- offset: 2,
- styles: {
- fontSize: '24px'
- }
- }, {
- labelWidth: 100,
- label: '开启',
- prop: 'openFlag',
- type: 'radio',
- button: true,
- row: true,
- offset: 6,
- dicData: [{
- label: '开启',
- value: 0
- }, {
- label: '不开启',
- value: 1
- }]
- },
- {
- labelWidth: 100,
- label: '开启投票',
- prop: 'openFlag',
- type: 'radio',
- button: true,
- row: true,
- offset: 6,
- dicData: [{
- label: '开启',
- value: 0
- }, {
- label: '不开启',
- value: 1
- }]
- },
- {
- label: "截止时间",
- row: true,
- offset: 6,
- prop: "endTime",
- type: "datetime",
- format: "yyyy-MM-dd hh:mm:ss",
- valueFormat: "timestamp",
- },
- ]
- },
- dialogVisibles: false,
- dialogVisiblesUser: false,
- // 弹框标题
- title: '',
- // 是否展示弹框
- box: false,
- // 是否显示查询
- search: true,
- // 加载中
- loading: true,
- // 是否为查看模式
- view: false,
- // 查询信息
- query: {},
- // 分页信息
- page: {
- pageSize: 10,
- pageSizes: [10, 20, 30, 50, 100],
- currentPage: 1,
- total: 0
- },
+ export default {
+ data() {
+ return {
+ option1: {
+ menu: false,
+ addBtn: false,
+ column: [{
+ label: '姓名',
+ prop: 'name'
+ }, {
+ label: '头像',
+ prop: 'avatar'
+ }, {
+ label: '手机',
+ prop: 'phone'
+ }, {
+ width: 220,
+ overHidden: true,
+ label: '小区名称',
+ prop: 'aoiName'
+ }, {
+ label: '地址',
+ prop: 'addressName'
+ }, {
+ label: '时间',
+ prop: 'createTime'
+ }]
+ },
+ discussForm: {
+ ontitle: '',
+ title: '',
+ openFlag: 0,
+ numberRestrictions: 0,
+ voteRestrictions: 0,
+ userRestrictions: 0,
+ endTime: '',
+ articleId: '',
+ createTime: '',
+ updateTime: '',
+ deleteFlag: '',
+ repeatVote: 0,
+ voteNumberPublic: 0,
+ appointUser: '',
+ userIds: '',
+ eventType: 1,
+ },
- // 分页信息
- pageUser: {
- pageSize: 10,
- pageSizes: [10, 20, 30, 50, 100],
- currentPage: 1,
- total: 0
+ dialogVisibles: false,
+ dialogVisiblesUser: false,
+ // 弹框标题
+ title: '',
+ // 是否展示弹框
+ box: false,
+ // 是否显示查询
+ search: true,
+ // 加载中
+ loading: true,
+ // 是否为查看模式
+ view: false,
+ // 查询信息
+ query: {},
+ // 分页信息
+ page: {
+ pageSize: 10,
+ pageSizes: [10, 20, 30, 50, 100],
+ currentPage: 1,
+ total: 0
+ },
+
+ // 分页信息
+ pageUser: {
+ pageSize: 10,
+ pageSizes: [10, 20, 30, 50, 100],
+ currentPage: 1,
+ total: 0
+ },
+ // 表单数据
+ form: {},
+ // 选择行
+ selectionList: [],
+ // 表单配置
+ option: {
+ selection: true,
+ height: "auto",
+ calcHeight: 54,
+ align: 'center',
+ menuAlign: 'center',
+ addBtn: false,
+ editBtn: false,
+ searchMenuSpan: 3,
+ searchBtn: true,
+ menuWidth: 500,
+ column: [{
+ label: 'ID',
+ prop: 'id',
+ searchSpan: 4,
+ // search: true,
},
- // 表单数据
- form: {},
- // 选择行
- selectionList: [],
- // 表单配置
- option: {
- selection: true,
- height: "auto",
- calcHeight: 54,
- align: 'center',
- menuAlign: 'center',
- addBtn: false,
- editBtn: false,
- searchMenuSpan: 3,
- searchBtn: true,
- menuWidth: 500,
- column: [{
- label: 'ID',
- prop: 'id',
- searchSpan: 4,
- // search: true,
- },
- {
- label: '标题',
- prop: 'title',
- searchSpan: 4,
- search: true,
- },
- {
- label: '参与人数',
- prop: 'enrollCount',
- searchSpan: 4,
- search: true,
- },
- {
- label: '截止时间',
- prop: 'endTime',
- searchSpan: 4,
- search: true,
- }
- ]
+ {
+ label: '标题',
+ prop: 'title',
+ searchSpan: 4,
+ search: true,
},
- // 表单列表
- data: [],
- dataUser: [],
- }
+ {
+ label: '参与人数',
+ prop: 'enrollCount',
+ searchSpan: 4,
+ search: true,
+ },
+ {
+ label: '截止时间',
+ prop: 'endTime',
+ searchSpan: 4,
+ search: true,
+ }
+ ]
+ },
+ // 表单列表
+ data: [],
+ dataUser: [],
+ }
},
- mounted () {
- // this.init();
- // this.onLoad(this.page);
+ mounted() {
+ // this.init();
+ // this.onLoad(this.page);
},
computed: {
- ...mapGetters(["permission"]),
- ids () {
- let ids = []
- this.selectionList.forEach(ele => {
- ids.push(ele.id)
- })
- return ids.join(",")
- }
+ ...mapGetters(["permission"]),
+ ids() {
+ let ids = []
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id)
+ })
+ return ids.join(",")
+ }
},
methods: {
- init (data) {
- this.houseCode = data.houseCode
- this.onLoad(this.page)
- },
- getUser (page, params = {}) {
- getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data
- this.pageUser.total = data.total
- this.dataUser = data.records
- this.loading = false
- this.selectionClear()
- })
- },
- userHandleClose () {
- this.dialogVisiblesUser = false
- },
- openUser (row) {
- this.dialogVisiblesUser = true
- this.getUser(this.pageUser, params = {})
- },
- openDilog (row, type) {
- this.dialogVisibles = true
- this.discussForm = row
- let times = new Date(row.endTime).getTime()
- this.discussForm.endTime = times
- console.table(this.discussForm)
- if (type == 0) {
- this.discussForm.ontitle = '公益报名'
- } else {
- this.discussForm.ontitle = '创建议题'
- }
- },
+ init(data) {
+ this.houseCode = data.houseCode
+ this.onLoad(this.page)
+ },
+ getUser(page, params) {
+ getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ const data = res.data.data
+ this.pageUser.total = data.total
+ this.dataUser = data.records
+ this.loading = false
+ // this.selectionClear()
+ })
+ },
+ userHandleClose() {
+ this.dialogVisiblesUser = false
+ this.dataUser = []
+ // this.$refs.DataUser && this.$refs.DataUser.resetForm()
+ // console.log(this.$refs, 90999)
+ },
- searchHide () {
- this.search = !this.search
- },
- searchChange () {
- this.onLoad(this.page)
- },
- searchReset () {
- this.query = {}
- this.page.currentPage = 1
- this.onLoad(this.page)
- },
- handleSubmit (form, done) {
- done()
- if (!this.discussForm.id) {
- addPd(this.discussForm).then(() => {
- this.dialogVisibles = false
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- })
- } else {
- updatePd(this.discussForm).then(() => {
- this.dialogVisibles = false
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- })
- }
- },
- handleAdd () {
- this.title = '新增'
- this.form = {}
- this.box = true
- },
- handleEdit (row) {
- this.title = '编辑'
- this.box = true
- getDetailPd(row.id).then(res => {
- this.form = res.data.data
- })
- },
- handleView (row) {
- this.title = '查看'
- this.view = true
- this.box = true
- getDetailPd(row.id).then(res => {
- this.form = res.data.data
- })
- },
- handleDelete () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据")
- return
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return removePd(this.ids)
- })
- .then(() => {
- this.selectionClear()
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- })
- },
- rowDel (row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- })
- },
- beforeClose (done) {
- done()
- this.form = {}
- this.view = false
- },
- selectionChange (list) {
- this.selectionList = list
- },
- selectionClear () {
- this.selectionList = []
- // this.$refs.table.clearSelection();
- },
- currentChange (currentPage) {
- this.page.currentPage = currentPage
- this.onLoad(this.page)
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize
- this.onLoad(this.page)
- },
- onLoad (page, params = {
- eventType: 0
- }) {
- this.loading = true
- getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data
- this.page.total = data.total
- this.data = data.records
- this.loading = false
- this.selectionClear()
- })
+ openUser(row) {
+ this.dialogVisiblesUser = true
+ let params = {
+ articleId: row.id
}
+ this.getUser(this.pageUser, params)
+ },
+
+ openDilog(row, type) {
+ this.dialogVisibles = true
+ this.discussForm = row
+ let times = new Date(row.endTime).getTime()
+ this.discussForm.endTime = times
+ console.table(this.discussForm)
+ if (type == 0) {
+ this.discussForm.ontitle = '公益报名'
+ } else {
+ this.discussForm.ontitle = '创建议题'
+ }
+ },
+
+ searchHide() {
+ this.search = !this.search
+ },
+ searchChange() {
+ this.onLoad(this.page)
+ },
+ searchReset() {
+ this.query = {}
+ this.page.currentPage = 1
+ this.onLoad(this.page)
+ },
+ handleSubmit(form, done) {
+ done()
+ if (!this.discussForm.id) {
+ addPd(this.discussForm).then(() => {
+ this.dialogVisibles = false
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ })
+ } else {
+ updatePd(this.discussForm).then(() => {
+ this.dialogVisibles = false
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ })
+ }
+ },
+ handleAdd() {
+ this.title = '新增'
+ this.form = {}
+ this.box = true
+ },
+ handleEdit(row) {
+ this.title = '编辑'
+ this.box = true
+ getDetailPd(row.id).then(res => {
+ this.form = res.data.data
+ })
+ },
+ handleView(row) {
+ this.title = '查看'
+ this.view = true
+ this.box = true
+ getDetailPd(row.id).then(res => {
+ this.form = res.data.data
+ })
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据")
+ return
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return removePd(this.ids)
+ })
+ .then(() => {
+ this.selectionClear()
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ })
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ })
+ },
+ beforeClose(done) {
+ done()
+ this.form = {}
+ this.view = false
+ },
+ selectionChange(list) {
+ this.selectionList = list
+ },
+ selectionClear() {
+ this.selectionList = []
+ // this.$refs.table.clearSelection();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage
+ this.onLoad(this.page)
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize
+ this.onLoad(this.page)
+ },
+ onLoad(page, params = {
+ eventType: 0
+ }) {
+ this.loading = true
+ getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ const data = res.data.data
+ this.page.total = data.total
+ this.data = data.records
+ this.loading = false
+ this.selectionClear()
+ })
+ }
}
-}
+ }
</script>
<style lang="scss" scoped>
-.el-pagination {
+ .el-pagination {
margin-top: 20px;
-}
+ }
</style>
\ No newline at end of file
diff --git a/src/views/article/discussionManage.vue b/src/views/article/discussionManage.vue
index c96e9aa..737a857 100644
--- a/src/views/article/discussionManage.vue
+++ b/src/views/article/discussionManage.vue
@@ -149,6 +149,7 @@
prop: "articleList",
span: 24,
minRows: 2,
+ tags: true,
type: "tree",
multiple: true,
dicData: [],
@@ -203,6 +204,30 @@
type: "date",
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd HH:mm:ss",
+ },
+ {
+ label: "发布状态",
+ prop: "publish",
+ searchSpan: 3,
+ width: 80,
+ value: "0",
+ slot: true,
+ search: true,
+ type: "select",
+ rules: [{
+ required: true,
+ message: "请选择发布状态",
+ trigger: "blur",
+ }, ],
+ dicData: [{
+ label: "未发布",
+ value: "0",
+ },
+ {
+ label: "已发布",
+ value: "1",
+ }
+ ],
},
{
span: 24,
@@ -701,4 +726,4 @@
.avue-upload__icon {
line-height: 6;
}
-</style>
+</style>
\ No newline at end of file
diff --git a/src/views/article/publicSignUp.vue b/src/views/article/publicSignUp.vue
index 100e00c..98cc4a8 100644
--- a/src/views/article/publicSignUp.vue
+++ b/src/views/article/publicSignUp.vue
@@ -10,10 +10,10 @@
</template>
<template slot-scope="{type,size,row }" slot="menu">
- <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row,0)">
+ <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row)">
公益报名
</el-button>
- <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row, 1)">
+ <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row)">
参与用户
</el-button>
<el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
@@ -39,22 +39,14 @@
</template>
</avue-crud>
+ <publicSignUpChild ref="publicSignUpChild"></publicSignUpChild>
+
<el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
<span slot="title" class="dialog-footer">
{{discussForm.ontitle}}
</span>
- <!-- <div id="" v-if="discussForm.eventType == 1">
- <avue-form @submit="handleSubmit" :option="optionDiscuss" v-model="discussForm"></avue-form>
- </div> -->
-
- <div id="">
- <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm">
- </avue-form>
- </div>
+ <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm"></avue-form>
</el-dialog>
-
-
-
</basic-container>
</template>
@@ -74,7 +66,7 @@
removePd,
updatePd,
addPd,
- getNoticePd,
+ getDetailPd,
upcommentPd
} from "@/api/discuss/publicDiscuss";
@@ -112,7 +104,7 @@
voteNumberPublic: 0,
appointUser: '',
userIds: '',
- eventType: 1,
+ eventType: 0,
},
dialogVisibles: false,
form: {},
@@ -141,7 +133,7 @@
excelBtn: true,
dialogClickModal: false,
column: [{
- label: "资讯标题",
+ label: "文章标题",
prop: "title",
span: 24,
row: true,
@@ -149,12 +141,12 @@
search: true,
rules: [{
required: true,
- message: "请输入资讯标题",
+ message: "请输入文章标题",
trigger: "blur",
}, ],
},
{
- label: "资讯封面",
+ label: "文章封面",
prop: "url",
// align:'center',
width: 80,
@@ -169,7 +161,7 @@
span: 24,
},
{
- label: "资讯范围",
+ label: "文章范围",
prop: "articleList",
span: 12,
minRows: 2,
@@ -179,7 +171,7 @@
dicData: [],
rules: [{
required: true,
- message: "请选择资讯范围",
+ message: "请选择文章范围",
trigger: "blur",
}, ],
props: {
@@ -189,7 +181,7 @@
hide: true,
},
{
- label: "资讯类型",
+ label: "文章类型",
prop: "type",
searchSpan: 3,
width: 80,
@@ -199,7 +191,7 @@
type: "select",
rules: [{
required: true,
- message: "请选择资讯类型",
+ message: "请选择文章类型",
trigger: "blur",
}, ],
dicData: [{
@@ -274,7 +266,7 @@
],
},
{
- label: "资讯内容",
+ label: "文章内容",
prop: "content",
component: "AvueUeditor",
options: {
@@ -349,8 +341,8 @@
offset: 6,
prop: "endTime",
type: "datetime",
- format: "yyyy-MM-dd hh:mm:ss",
- valueFormat: "timestamp",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
rules: [{
required: true,
message: "请选截止时间",
@@ -406,16 +398,27 @@
},
methods: {
+
+ openUserPopup(row) {
+ this.$refs.publicSignUpChild.openUser(row)
+ },
+
openDilog(row, type) {
this.dialogVisibles = true
this.discussForm.eventType = type
this.discussForm.articleId = row.id
this.discussForm.title = row.title
- if (type == 0) {
- this.discussForm.ontitle = '公益报名'
- } else {
- this.discussForm.ontitle = '创建议题'
- }
+ this.discussForm.ontitle = '公益报名'
+ this.getpunlicDiscussDetail(row)
+ },
+
+ getpunlicDiscussDetail(row) {
+ getDetailPd({
+ articleId: row.id
+ }).then((res) => {
+ let data = res.data.data
+ this.discussForm = data;
+ });
},
handleSubmit(form, done) {
@@ -708,4 +711,4 @@
.avue-upload__icon {
line-height: 6;
}
-</style>
+</style>
\ No newline at end of file
diff --git a/src/views/userHouse/houseList.vue b/src/views/userHouse/houseList.vue
index fe280c0..c4b5769 100644
--- a/src/views/userHouse/houseList.vue
+++ b/src/views/userHouse/houseList.vue
@@ -1,795 +1,788 @@
<template>
- <el-row>
- <el-col :span="24">
- <basic-container>
- <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
- v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate"
- @row-save="rowSave" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange"
- @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
- @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
- <template slot="menuLeft">
- <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete"
- @click="handleDelete">删 除
- </el-button>
- <el-button type="success" size="small" plain v-if="userInfo.role_name.includes('admin')"
- icon="el-icon-upload2" @click="handleImport">导入
- </el-button>
- <el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin')"
- icon="el-icon-download" @click="handleExport">导出
- </el-button>
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
- v-if="permission.househould_manager" @click="handleHouseholdManager(scope.row)">住户管理
- </el-button>
- <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
- v-if="permission.househould_manager" @click="manageLabel(scope.row)">标签
- </el-button>
- </template>
+ <el-row>
+ <el-col :span="24">
+ <basic-container>
+ <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
+ v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
+ :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
+ @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+ @refresh-change="refreshChange" @on-load="onLoad">
+ <template slot="menuLeft">
+ <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete"
+ @click="handleDelete">删 除
+ </el-button>
+ <el-button type="success" size="small" plain v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-upload2" @click="handleImport">导入
+ </el-button>
+ <el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-download" @click="handleExport">导出
+ </el-button>
+ </template>
+ <template slot-scope="scope" slot="menu">
+ <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
+ @click="handleHouseholdManager(scope.row)">住户管理
+ </el-button>
+ <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
+ @click="manageLabel(scope.row)">标签
+ </el-button>
+ </template>
- <template slot-scope="{row}" slot="tenantName">
- <el-tag>{{ row.tenantName }}</el-tag>
- </template>
- <template slot-scope="{row}" slot="roleName">
- <el-tag>{{ row.roleName }}</el-tag>
- </template>
- <template slot-scope="{row}" slot="deptName">
- <el-tag>{{ row.deptName }}</el-tag>
- </template>
- <template slot-scope="{row}" slot="userTypeName">
- <el-tag>{{ row.userTypeName }}</el-tag>
- </template>
+ <template slot-scope="{row}" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{row}" slot="roleName">
+ <el-tag>{{ row.roleName }}</el-tag>
+ </template>
+ <template slot-scope="{row}" slot="deptName">
+ <el-tag>{{ row.deptName }}</el-tag>
+ </template>
+ <template slot-scope="{row}" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
- <template slot-scope="{row}" slot="phone">
- <el-button type="text" @click="showStringDispose(row, 'phoneflag')">
- {{ textDispose(row, 'phoneflag', 'phone') }}
- </el-button>
- </template>
+ <template slot-scope="{row}" slot="phone">
+ <el-button type="text" @click="showStringDispose(row, 'phoneflag')">
+ {{ textDispose(row, 'phoneflag', 'phone') }}
+ </el-button>
+ </template>
- <template slot-scope="{row}" slot="userHouseLabelVOList">
- {{ labelDispose(row.userHouseLabelVOList) }}
- </template>
- </avue-crud>
- <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px">
+ <template slot-scope="{row}" slot="userHouseLabelVOList">
+ {{ labelDispose(row.userHouseLabelVOList) }}
+ </template>
+ </avue-crud>
+ <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px">
- <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id"
- ref="treeRole" :default-checked-keys="roleTreeObj" :props="props">
- </el-tree>
+ <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole"
+ :default-checked-keys="roleTreeObj" :props="props">
+ </el-tree>
- <span slot="footer" class="dialog-footer">
- <el-button @click="roleBox = false">取 消</el-button>
- <el-button type="primary" @click="submitRole">确 定</el-button>
- </span>
- </el-dialog>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="roleBox = false">取 消</el-button>
+ <el-button type="primary" @click="submitRole">确 定</el-button>
+ </span>
+ </el-dialog>
- <el-dialog title="标签管理" append-to-body :visible.sync="labelFlag" center width="600px">
- <div id="" class="grid-container2">
- <div class="grid-item" :style="{ backgroundColor: item.color }" v-for="(item, index) in labelData"
- :key="index" @click="changLabel(item)">
- {{ item.name }}
- </div>
- </div>
- <!-- <span slot="footer" class="dialog-footer">
+ <el-dialog title="标签管理" append-to-body :visible.sync="labelFlag" center width="600px">
+ <div id="" class="grid-container2">
+ <div class="grid-item" :style="{ backgroundColor: item.color }" v-for="(item, index) in labelData"
+ :key="index" @click="changLabel(item)">
+ {{ item.name }}
+ </div>
+ </div>
+ <!-- <span slot="footer" class="dialog-footer">
<el-button @click="labelFlag = false">取 消</el-button>
<el-button type="primary" @click="submitRole">确 定</el-button>
</span> -->
- </el-dialog>
+ </el-dialog>
- <el-dialog :title="'编辑标签 ' + currentLabel.name" append-to-body :visible.sync="editLabelFlge"
- width="655px">
- <avue-form :option="labelOption" v-model="labelForm" :submit="onsubmit">
- </avue-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editLabelFlge = false">取 消</el-button>
- <el-button type="primary" @click="onsubmit">确 定</el-button>
- </span>
- </el-dialog>
+ <el-dialog :title="'编辑标签 ' + currentLabel.name" append-to-body :visible.sync="editLabelFlge" width="655px">
+ <avue-form :option="labelOption" v-model="labelForm" :submit="onsubmit">
+ </avue-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="editLabelFlge = false">取 消</el-button>
+ <el-button type="primary" @click="onsubmit">确 定</el-button>
+ </span>
+ </el-dialog>
- <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
- <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary" @click="handleTemplate">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- </el-dialog>
+ <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
+ <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
- <el-dialog title="住户管理" append-to-body :visible.sync="householdManagerVisible" width="70%" height="60%">
- <householdManager ref="householdManager" />
- </el-dialog>
- </basic-container>
- </el-col>
- </el-row>
+ <el-dialog title="住户管理" append-to-body :visible.sync="householdManagerVisible" width="70%" height="60%">
+ <householdManager ref="householdManager" />
+ </el-dialog>
+ </basic-container>
+ </el-col>
+ </el-row>
</template>
<script>
-import {
+ import {
getList,
remove,
add,
update,
getDetatil,
getDetatils
-} from "@/api/userHouse/list/house.js"
-import {
+ } from "@/api/userHouse/list/house.js"
+ import {
removeHouseholdLabel,
saveOrUpdateHouseholdLabel
-} from "@/api/userHouse/list/userHouseList.js"
-import {
+ } from "@/api/userHouse/list/userHouseList.js"
+ import {
getLabelList,
-} from '@/api/label/label'
-import {
+ } from '@/api/label/label'
+ import {
exportBlob
-} from "@/api/common"
-import {
+ } from "@/api/common"
+ import {
mapGetters
-} from "vuex"
-import website from '@/config/website'
-import {
+ } from "vuex"
+ import website from '@/config/website'
+ import {
getToken
-} from '@/util/auth'
-import {
+ } from '@/util/auth'
+ import {
downloadXls
-} from "@/util/util"
-import {
+ } from "@/util/util"
+ import {
dateNow
-} from "@/util/date"
-import NProgress from 'nprogress'
-import 'nprogress/nprogress.css'
-import func from "@/util/func"
-import householdManager from "./components/householdManager"
-import Qs from "qs"
-export default {
+ } from "@/util/date"
+ import NProgress from 'nprogress'
+ import 'nprogress/nprogress.css'
+ import func from "@/util/func"
+ import householdManager from "./components/householdManager"
+ import Qs from "qs"
+ export default {
components: {
- householdManager
+ householdManager
},
- data () {
- return {
- labelData: [],
- labelForm: {},
- userHouseLabelVOList: [],
- currentLabel: {},
- labelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [{
- label: '级别',
- prop: 'color',
- type: 'radio',
- button: true,
- row: true,
- dicData: [{
- label: '撤销',
- value: '#EBEDF0'
- }, {
- label: '绿',
- value: '#30D17C'
- }, {
- label: '黄',
- value: '#FFB42B'
- }, {
- label: '红',
- value: '#EA1F1F'
- }],
- rules: [{
- required: true,
- message: "请选择",
- trigger: "blur"
- }]
- }, {
- row: true,
- label: '备注',
- prop: 'remark',
- type: 'input'
- }]
+ data() {
+ return {
+ labelData: [],
+ labelForm: {},
+ userHouseLabelVOList: [],
+ currentLabel: {},
+ labelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [{
+ label: '级别',
+ prop: 'color',
+ type: 'radio',
+ button: true,
+ row: true,
+ dicData: [{
+ label: '撤销',
+ value: '#EBEDF0'
+ }, {
+ label: '绿',
+ value: '#30D17C'
+ }, {
+ label: '黄',
+ value: '#FFB42B'
+ }, {
+ label: '红',
+ value: '#EA1F1F'
+ }],
+ rules: [{
+ required: true,
+ message: "请选择",
+ trigger: "blur"
+ }]
+ }, {
+ row: true,
+ label: '备注',
+ prop: 'remark',
+ type: 'input'
+ }]
+ },
+ editLabelFlge: false,
+ labelFlag: false,
+ householdManagerVisible: false,
+ form: {},
+ search: {},
+ excelBox: false,
+ selectionList: [],
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
+ },
+ option: {
+ height: 'auto',
+ calcHeight: 80,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 3,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ dialogType: 'drawer',
+ dialogClickModal: false,
+ menuWidth: 340,
+ column: [{
+ label: "房屋编号",
+ prop: "houseCode",
+ width: 180,
+ hide: true,
+ display: false
},
- editLabelFlge: false,
- labelFlag: false,
- householdManagerVisible: false,
- form: {},
- search: {},
- excelBox: false,
- selectionList: [],
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
+ {
+ label: "地址",
+ prop: "address",
+ width: 180,
+ display: false
},
- option: {
- height: 'auto',
- calcHeight: 80,
- tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- border: true,
- index: true,
- selection: true,
- viewBtn: true,
- dialogType: 'drawer',
- dialogClickModal: false,
- menuWidth: 340,
- column: [
- {
- label: "房屋编号",
- prop: "houseCode",
- width: 180,
- hide: true,
- display: false
- },
- {
- label: "地址",
- prop: "address",
- width: 180,
- display: false
- },
- {
- hide: true,
- parent: false,
- label: "小区名称",
- prop: "districtCode",
- type: 'tree',
- dicUrl: `/api/blade-district/district/getDistrictTree`,
- props: {
- label: "name",
- value: "id"
- },
- defaultExpandedKeys: ["361102003"],
- span: 12,
- width: 220,
- overHidden: true,
- },
-
- {
- width: 220,
- overHidden: true,
- label: '小区名称',
- parent: false,
- prop: "districtName",
- searchSpan: 4,
- display: false,
- search: true,
- },
-
- {
- width: 110,
- label: "所属街道",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- prop: "townStreetName",
- search: true,
- searchSpan: 4
- },
-
- {
- width: 156,
- overHidden: true,
- label: "所属社区",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- prop: "neiName",
- search: true,
- searchSpan: 4,
- rules: [{
- required: true,
- message: "请选择所属社区",
- trigger: "blur",
- }],
- },
-
- {
- hide: true,
- parent: false,
- label: "所属社区",
- prop: "neiCode",
- search: false,
- type: "tree",
- dicUrl: "/api/blade-system/region/tree",
- props: {
- label: "name",
- value: "id",
- },
- cascader: ["gridId"],
- rules: [
- {
- required: true,
- message: "请选择所属社区",
- trigger: "blur",
- },
- ],
- },
-
- {
- width: 110,
- overHidden: true,
- label: "所属网格",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- prop: "gridName",
- rules: [{
- required: true,
- message: "请选择所属网格",
- trigger: "blur",
- }],
- },
-
- {
- hide: true,
- label: "所属网格",
- prop: "gridId",
- type: "tree",
- cell: true,
- props: {
- label: "gridName",
- value: "id",
- },
- dicUrl:
- "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
- rules: [
- {
- required: true,
- message: "请选择所属网格",
- trigger: "blur",
- },
- ],
- },
-
- {
- label: "房屋照片",
- prop: "imageUrls",
- width: 80,
- type: "upload",
- listType: "picture-card",
- dataType: "string",
- multiple: true,
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- span: 24,
- },
-
- {
- width: 110,
- label: "电话",
- prop: "phone",
- slot: true,
- },
- {
- label: "幢",
- prop: "building",
- },
- {
- label: "单元",
- prop: "unit",
- },
- {
- label: "室",
- prop: "room",
- },
- {
- label: "楼层",
- prop: "floor",
- type: "number",
- rules: [{
- required: true,
- message: "请输入楼层",
- trigger: "blur",
- },],
- },
- {
- label: "面积",
- prop: "area",
- type: "number",
- },
- {
- label: "物业费",
- prop: "propertyPrice",
- type: "number",
- },
- {
- label: "服务到期",
- prop: "serviceDue",
- type: "datetime",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- },
- {
- width: 210,
- label: "标签",
- prop: "userHouseLabelVOList",
- display: false
- },
- ]
+ {
+ hide: true,
+ parent: false,
+ label: "小区名称",
+ prop: "districtCode",
+ type: 'tree',
+ dicUrl: `/api/blade-district/district/getDistrictTree`,
+ props: {
+ label: "name",
+ value: "id"
+ },
+ defaultExpandedKeys: ["361102003"],
+ span: 12,
+ width: 220,
+ overHidden: true,
},
- data: [],
- excelForm: {},
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [{
- label: '模板上传',
- prop: 'excelFile',
- type: 'upload',
- drag: true,
- loadText: '模板上传中,请稍等',
- span: 24,
- propsHttp: {
- res: 'data'
- },
- tip: '请上传 .xls,.xlsx 标准格式文件',
- action: "/api/blade-system/user/import-user"
+
+ {
+ width: 220,
+ overHidden: true,
+ label: '小区名称',
+ parent: false,
+ prop: "districtName",
+ searchSpan: 4,
+ display: false,
+ search: true,
+ },
+
+ {
+ width: 110,
+ label: "所属街道",
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ prop: "townStreetName",
+ search: true,
+ searchSpan: 4
+ },
+
+ {
+ width: 156,
+ overHidden: true,
+ label: "所属社区",
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ prop: "neiName",
+ search: true,
+ searchSpan: 4,
+ rules: [{
+ required: true,
+ message: "请选择所属社区",
+ trigger: "blur",
+ }],
+ },
+
+ {
+ hide: true,
+ parent: false,
+ label: "所属社区",
+ prop: "neiCode",
+ search: false,
+ type: "tree",
+ dicUrl: "/api/blade-system/region/tree",
+ props: {
+ label: "name",
+ value: "id",
+ },
+ cascader: ["gridId"],
+ rules: [{
+ required: true,
+ message: "请选择所属社区",
+ trigger: "blur",
+ }, ],
+ },
+
+ {
+ width: 110,
+ overHidden: true,
+ label: "所属网格",
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ prop: "gridName",
+ rules: [{
+ required: true,
+ message: "请选择所属网格",
+ trigger: "blur",
+ }],
+ },
+
+ {
+ hide: true,
+ label: "所属网格",
+ prop: "gridId",
+ type: "tree",
+ cell: true,
+ props: {
+ label: "gridName",
+ value: "id",
+ },
+ dicUrl: "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
+ rules: [{
+ required: true,
+ message: "请选择所属网格",
+ trigger: "blur",
+ }, ],
+ },
+
+ {
+ label: "房屋照片",
+ prop: "imageUrls",
+ width: 80,
+ type: "upload",
+ listType: "picture-card",
+ dataType: "string",
+ multiple: true,
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ span: 24,
+ },
+
+ {
+ width: 110,
+ label: "电话",
+ prop: "phone",
+ slot: true,
+ },
+ {
+ label: "幢",
+ prop: "building",
+ },
+ {
+ label: "单元",
+ prop: "unit",
+ },
+ {
+ label: "室",
+ prop: "room",
+ },
+ {
+ label: "楼层",
+ prop: "floor",
+ type: "number",
+ rules: [{
+ required: true,
+ message: "请输入楼层",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "面积",
+ prop: "area",
+ type: "number",
+ },
+ {
+ label: "物业费",
+ prop: "propertyPrice",
+ type: "number",
+ },
+ {
+ label: "服务到期",
+ prop: "serviceDue",
+ type: "datetime",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ },
+ {
+ width: 210,
+ label: "标签",
+ prop: "userHouseLabelVOList",
+ display: false
+ },
+ ]
+ },
+ data: [],
+ excelForm: {},
+ excelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [{
+ label: '模板上传',
+ prop: 'excelFile',
+ type: 'upload',
+ drag: true,
+ loadText: '模板上传中,请稍等',
+ span: 24,
+ propsHttp: {
+ res: 'data'
+ },
+ tip: '请上传 .xls,.xlsx 标准格式文件',
+ action: "/api/blade-system/user/import-user"
+ },
+ {
+ label: "数据覆盖",
+ prop: "isCovered",
+ type: "switch",
+ align: "center",
+ width: 80,
+ dicData: [{
+ label: "否",
+ value: 0
},
{
- label: "数据覆盖",
- prop: "isCovered",
- type: "switch",
- align: "center",
- width: 80,
- dicData: [{
- label: "否",
- value: 0
- },
- {
- label: "是",
- value: 1
- }
- ],
- value: 0,
- slot: true,
- rules: [{
- required: true,
- message: "请选择是否覆盖",
- trigger: "blur"
- }]
- },
- {
- label: '模板下载',
- prop: 'excelTemplate',
- formslot: true,
- span: 24,
+ label: "是",
+ value: 1
}
- ]
+ ],
+ value: 0,
+ slot: true,
+ rules: [{
+ required: true,
+ message: "请选择是否覆盖",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: '模板下载',
+ prop: 'excelTemplate',
+ formslot: true,
+ span: 24,
}
+ ]
}
+ }
},
watch: {},
computed: {
- ...mapGetters(["userInfo", "permission"]),
- permissionList () {
- return {
- addBtn: this.vaildData(this.permission.house_add, true),
- viewBtn: this.vaildData(this.permission.house_view, true),
- delBtn: this.vaildData(this.permission.house_delete, true),
- editBtn: this.vaildData(this.permission.house_edit, true)
- }
- },
-
- textDispose () {
- return (row, flag, type) => {
- if (row[flag] || row[type] == null) {
- return row[type]
- } else {
- if (type == 'idCard') {
- return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
- } else {
- return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
- }
- }
- }
- },
-
- labelDispose () {
- return (list) => {
- return list.map(item => item.labelName).join(',')
- }
+ ...mapGetters(["userInfo", "permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.house_add, true),
+ viewBtn: this.vaildData(this.permission.house_view, true),
+ delBtn: this.vaildData(this.permission.house_delete, true),
+ editBtn: this.vaildData(this.permission.house_edit, true)
}
+ },
+
+ textDispose() {
+ return (row, flag, type) => {
+ if (row[flag] || row[type] == null) {
+ return row[type]
+ } else {
+ if (type == 'idCard') {
+ return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+ } else {
+ return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+ }
+ }
+ }
+ },
+
+ labelDispose() {
+ return (list) => {
+ return list.map(item => item.labelName).join(',')
+ }
+ }
},
- mounted () { },
+ mounted() {},
methods: {
- onsubmit () {
- if (this.labelForm.color === '#EBEDF0') {
- let params = {
- householdId: this.currentRow.id,
- labelId: this.currentLabel.id
- }
- removeHouseholdLabel(params).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- this.editLabelFlge = false
- this.manageLabel(this.currentRow)
- this.loading = false
- })
- } else {
- this.labelForm.houseCode = this.currentRow.houseCode
- this.labelForm.householdId = this.currentRow.id
- this.labelForm.labelId = this.currentLabel.id
- this.labelForm.lableType = 2
- saveOrUpdateHouseholdLabel(this.labelForm).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- this.editLabelFlge = false
- this.manageLabel(this.currentRow)
- this.loading = false
- })
- }
- },
-
- changLabel (item) {
- this.editLabelFlge = true
- this.currentLabel = item
- this.labelForm.color = item.color
- this.labelForm.remark = item.remark
- },
- manageLabel (item) {
- this.loading = true
- this.currentRow = item
- this.labelFlag = true
- let params = {
- parentId: 1001
- }
- // 查询标签
- getLabelList(Object.assign(params)).then(res => {
- const data = res.data.data
- // 查询详情
- getDetatils({
- houseCode: item.houseCode
- }).then(res => {
- if (res.data.data) {
- this.userHouseLabelVOList = res.data.data.userHouseLabelVOList
- this.loading = false
- // 将细类放到一起
- data.forEach(f => {
- if (this.userHouseLabelVOList.length > 0) {
- this.userHouseLabelVOList.forEach(h => {
- if (Number(f.id) == h.labelId) {
- f['color'] = h.color
- f['remark'] = h.remark
- }
- })
- }
- })
- }
- this.labelData = data
- this.loading = false
- })
+ onsubmit() {
+ if (this.labelForm.color === '#EBEDF0') {
+ let params = {
+ householdId: this.currentRow.id,
+ labelId: this.currentLabel.id
+ }
+ removeHouseholdLabel(params).then(res => {
+ this.$message({
+ type: "success",
+ message: "操作成功!"
})
- },
- handleHouseholdManager (row) {
- var that = this
- this.householdManagerVisible = true
- this.$nextTick(() => {
- that.$refs.householdManager.init(row)
+ this.editLabelFlge = false
+ this.manageLabel(this.currentRow)
+ this.loading = false
+ })
+ } else {
+ this.labelForm.houseCode = this.currentRow.houseCode
+ this.labelForm.householdId = this.currentRow.id
+ this.labelForm.labelId = this.currentLabel.id
+ this.labelForm.lableType = 2
+ saveOrUpdateHouseholdLabel(this.labelForm).then(res => {
+ this.$message({
+ type: "success",
+ message: "操作成功!"
})
- },
- rowSave (row, done, loading) {
- if (row.imageUrls.length > 0) {
- var urls = []
- var split = row.imageUrls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.imageUrls = urls.join(",")
- }
-
- add(row).then(() => {
- this.initFlag = false
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- done()
- }, error => {
- window.console.log(error)
- loading()
- })
- },
- rowUpdate (row, index, done, loading) {
- if (row.imageUrls.length > 0) {
- var urls = []
- var split = row.imageUrls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.imageUrls = urls.join(",")
- }
-
- update(row).then(() => {
- this.initFlag = false
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- done()
- }, error => {
- window.console.log(error)
- loading()
- })
- },
- rowDel (row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- })
- },
- searchReset () {
- this.query = {}
- this.treeDeptId = ''
- this.onLoad(this.page)
- },
- searchChange (params, done) {
- this.query = params
- this.page.currentPage = 1
- this.onLoad(this.page, params)
- done()
- },
- selectionChange (list) {
- this.selectionList = list
- },
- selectionClear () {
- this.selectionList = []
- this.$refs.crud.toggleSelection()
- },
- handleDelete () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据")
- return
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!"
- })
- this.$refs.crud.toggleSelection()
- })
- },
- handleImport () {
- this.excelBox = true
- },
- uploadAfter (res, done, loading, column) {
- window.console.log(column)
- this.excelBox = false
- this.refreshChange()
- done()
- },
- handleExport () {
- this.$confirm("是否导出房屋数据?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- NProgress.start()
- var data = {
- ...this.query
- }
- data = Qs.stringify(data)
- exportBlob(
- `/api/blade-house/house/export-house?${this.website.tokenHeader}=${getToken()}&` + data
- ).then(res => {
- downloadXls(res.data, `房屋数据表${dateNow()}.xlsx`)
- NProgress.done()
- })
- })
- },
- handleTemplate () {
- exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
- downloadXls(res.data, "房屋数据模板.xlsx")
- })
- },
- beforeOpen (done, type) {
- if (["edit", "view"].includes(type)) {
- getDetatil({
- id: this.form.id
- }).then(res => {
- this.form = res.data.data
-
- if (this.form.imageUrls) {
- if (this.form.imageUrls.length > 0) {
- var urls = []
- var names = this.form.imageUrls.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
- })
- this.form.imageUrls = urls.join(",")
- }
- }
- })
- }
- this.initFlag = true
- done()
- },
- currentChange (currentPage) {
- this.page.currentPage = currentPage
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize
- },
- refreshChange () {
- this.onLoad(this.page, this.query)
- },
- onLoad (page, params = {}) {
- this.loading = true
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = {
- ...res.data.data,
- records: res.data.data.records.map(item => {
- if (item.imageUrls) {
- if (item.imageUrls.length > 0) {
- var urls = []
- var names = item.imageUrls.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
- })
- item.imageUrls = urls.join(",")
- }
- }
-
- return {
- ...item,
- 'phoneflag': false,
- }
- })
- }
- this.page.total = data.total
- this.data = data.records
- this.loading = false
- this.selectionClear()
- })
- },
- showStringDispose (row, type) {
- row[type] = !row[type]
+ this.editLabelFlge = false
+ this.manageLabel(this.currentRow)
+ this.loading = false
+ })
}
+ },
+
+ changLabel(item) {
+ this.editLabelFlge = true
+ this.currentLabel = item
+ this.labelForm.color = item.color
+ this.labelForm.remark = item.remark
+ },
+ manageLabel(item) {
+ this.loading = true
+ this.currentRow = item
+ this.labelFlag = true
+ let params = {
+ parentId: 1001
+ }
+ // 查询标签
+ getLabelList(Object.assign(params)).then(res => {
+ const data = res.data.data
+ // 查询详情
+ getDetatils({
+ houseCode: item.houseCode
+ }).then(res => {
+ if (res.data.data) {
+ this.userHouseLabelVOList = res.data.data.userHouseLabelVOList
+ this.loading = false
+ // 将细类放到一起
+ data.forEach(f => {
+ if (this.userHouseLabelVOList.length > 0) {
+ this.userHouseLabelVOList.forEach(h => {
+ if (Number(f.id) == h.labelId) {
+ f['color'] = h.color
+ f['remark'] = h.remark
+ }
+ })
+ }
+ })
+ }
+ this.labelData = data
+ this.loading = false
+ })
+ })
+ },
+ handleHouseholdManager(row) {
+ var that = this
+ this.householdManagerVisible = true
+ this.$nextTick(() => {
+ that.$refs.householdManager.init(row)
+ })
+ },
+ rowSave(row, done, loading) {
+ if (row.imageUrls.length > 0) {
+ var urls = []
+ var split = row.imageUrls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.imageUrls = urls.join(",")
+ }
+
+ add(row).then(() => {
+ this.initFlag = false
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ done()
+ }, error => {
+ window.console.log(error)
+ loading()
+ })
+ },
+ rowUpdate(row, index, done, loading) {
+ if (row.imageUrls.length > 0) {
+ var urls = []
+ var split = row.imageUrls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.imageUrls = urls.join(",")
+ }
+
+ update(row).then(() => {
+ this.initFlag = false
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ done()
+ }, error => {
+ window.console.log(error)
+ loading()
+ })
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ })
+ },
+ searchReset() {
+ this.query = {}
+ this.treeDeptId = ''
+ this.onLoad(this.page)
+ },
+ searchChange(params, done) {
+ this.query = params
+ this.page.currentPage = 1
+ this.onLoad(this.page, params)
+ done()
+ },
+ selectionChange(list) {
+ this.selectionList = list
+ },
+ selectionClear() {
+ this.selectionList = []
+ this.$refs.crud.toggleSelection()
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据")
+ return
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ this.$refs.crud.toggleSelection()
+ })
+ },
+ handleImport() {
+ this.excelBox = true
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column)
+ this.excelBox = false
+ this.refreshChange()
+ done()
+ },
+ handleExport() {
+ this.$confirm("是否导出房屋数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ }).then(() => {
+ NProgress.start()
+ var data = {
+ ...this.query
+ }
+ data = Qs.stringify(data)
+ exportBlob(
+ `/api/blade-house/house/export-house?${this.website.tokenHeader}=${getToken()}&` + data
+ ).then(res => {
+ downloadXls(res.data, `房屋数据表${dateNow()}.xlsx`)
+ NProgress.done()
+ })
+ })
+ },
+ handleTemplate() {
+ exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
+ downloadXls(res.data, "房屋数据模板.xlsx")
+ })
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetatil({
+ id: this.form.id
+ }).then(res => {
+ this.form = res.data.data
+
+ if (this.form.imageUrls) {
+ if (this.form.imageUrls.length > 0) {
+ var urls = []
+ var names = this.form.imageUrls.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ this.form.imageUrls = urls.join(",")
+ }
+ }
+ })
+ }
+ this.initFlag = true
+ done()
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query)
+ },
+ onLoad(page, params = {}) {
+ this.loading = true
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ const data = {
+ ...res.data.data,
+ records: res.data.data.records.map(item => {
+ if (item.imageUrls) {
+ if (item.imageUrls.length > 0) {
+ var urls = []
+ var names = item.imageUrls.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ item.imageUrls = urls.join(",")
+ }
+ }
+
+ return {
+ ...item,
+ 'phoneflag': false,
+ }
+ })
+ }
+ this.page.total = data.total
+ this.data = data.records
+ this.loading = false
+ this.selectionClear()
+ })
+ },
+ showStringDispose(row, type) {
+ row[type] = !row[type]
+ }
}
-}
+ }
</script>
<style>
-.box {
+ .box {
height: 800px;
-}
+ }
-.el-scrollbar {
+ .el-scrollbar {
height: 100%;
-}
+ }
-.box .el-scrollbar__wrap {
+ .box .el-scrollbar__wrap {
overflow: scroll;
-}
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3