shuishen
2023-12-19 18d7cbdad9465e731f43248e1d47c91d39630f63
业委会及其他
2 files modified
2 files added
492 ■■■■ changed files
src/api/owners_committee/index.js 23 ●●●●● patch | view | raw | blame | history
src/views/article/article.vue 275 ●●●● patch | view | raw | blame | history
src/views/gzll/owners_committee.vue 192 ●●●●● patch | view | raw | blame | history
src/views/userHouse/houseHoldList.vue 2 ●●● patch | view | raw | blame | history
src/api/owners_committee/index.js
New file
@@ -0,0 +1,23 @@
/*
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-19 15:47:25
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-12-19 19:15:52
 * @FilePath: \jczz_web\src\api\owners_committee\index.js
 * @Description:
 *
 * Copyright (c) 2023 by shuishen, All Rights Reserved.
 */
import request from "@/router/axios";
export const getList = (current, size, params) => {
  return request({
    url: "/api/blade-ownersCommittee/ownersCommittee/page",
    method: "get",
    params: {
      ...params,
      current,
      size,
    },
  });
};
src/views/article/article.vue
@@ -1,16 +1,18 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @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 size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 除
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
                    除
        </el-button>
        <el-button size="small" icon="el-icon-s-order" plain @click="kqcomment">开启评论
                <!-- <el-button size="small" icon="el-icon-s-order" plain @click="kqcomment">开启评论
        </el-button>
        <el-button size="small" icon="el-icon-s-release" plain @click="gbcomment">关闭评论
        </el-button>
        </el-button> -->
      </template>
      <template slot-scope="{type,size,row }" slot="menu">
@@ -20,10 +22,12 @@
        <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row,1)">
          创建议题
        </el-button>
        <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
                <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type"
                    @click.stop="updateFb(row)">
          撤销
        </el-button>
        <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)">
                <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type"
                    @click.stop="updateFb(row)">
          发布
        </el-button>
      </template>
@@ -36,14 +40,11 @@
      </template>
      <template slot-scope="{ row }" slot="iscomment">
        <el-tag>{{
          row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭"
          }}
        </el-tag>
                <el-switch @change="iscommentInput($event, row)" v-model="row.iscomment" :active-value="'1'"
                    :inactive-value="'0'" active-color="#13ce66" inactive-color="#ccc">
                </el-switch>
      </template>
    </avue-crud>
    <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose">
      <span slot="title" class="dialog-footer">
@@ -58,10 +59,6 @@
        </avue-form>
      </div>
    </el-dialog>
  </basic-container>
</template>
@@ -73,7 +70,7 @@
    add,
    getNotice,
    upcomment
  } from "@/api/article/article";
} from "@/api/article/article"
  import {
    getListPd,
@@ -82,18 +79,18 @@
    addPd,
    getNoticePd,
    upcommentPd
  } from "@/api/discuss/publicDiscuss";
} from "@/api/discuss/publicDiscuss"
  import website from '@/config/website';
import website from '@/config/website'
  import {
    getDistrictTree
  } from "@/api/district/index";
} from "@/api/district/index"
  import {
    mapGetters
  } from "vuex";
} from "vuex"
  export default {
    data() {
@@ -134,7 +131,7 @@
          tip: false,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 450,
                menuWidth: 240,
          border: false,
          //stripe:true,
          index: true,
@@ -272,7 +269,9 @@
              prop: "iscomment",
              width: 80,
              slot: true,
              type: "select",
                    type: "switch",
                    activeColor: "#13ce66",
                    inactiveColor: "#ccc",
              dicData: [{
                  label: "关闭",
                  value: "0",
@@ -426,26 +425,26 @@
          ]
        },
        districtTree: [],
      };
        }
    },
    watch: {
      "form.articleType": {
        handler(val) {
          if (val) {
            var videoUrl = this.findObject(this.option.column, "videoUrl");
            var content = this.findObject(this.option.column, "content");
                    var videoUrl = this.findObject(this.option.column, "videoUrl")
                    var content = this.findObject(this.option.column, "content")
            if (val.indexOf('ksp') != -1) {
              videoUrl.display = true;
              content.display = false;
                        videoUrl.display = true
                        content.display = false
              videoUrl.rules = [{
                required: false,
                message: "请选择视频",
                trigger: "blur",
              }, ];
                        },]
            } else {
              videoUrl.display = false;
              content.display = true;
              videoUrl.rules = "";
                        videoUrl.display = false
                        content.display = true
                        videoUrl.rules = ""
            }
          }
        },
@@ -460,17 +459,25 @@
          viewBtn: this.vaildData(this.permission.article_view, true),
          delBtn: this.vaildData(this.permission.article_delete, true),
          editBtn: this.vaildData(this.permission.article_edit, true),
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
                ids.push(ele.id)
            })
            return ids.join(",")
        }
    },
    methods: {
        iscommentInput (e, data) {
            upcomment(data.id, e).then(() => {
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
            })
        },
      openDilog(row, type) {
        this.dialogVisibles = true
@@ -485,25 +492,25 @@
      },
      handleSubmit(form, done) {
        done();
            done()
        addPd(form).then(
          () => {
            this.$message({
              type: "success",
              message: "操作成功!",
            });
                    })
            this.dialogVisibles = false
            done();
                    done()
          },
          (error) => {
            window.console.log(error);
                    window.console.log(error)
            // loading();
          }
        );
            )
      },
      handleClose(done) {
        done();
            done()
        // this.$confirm('确认关闭?')
        //   .then(_ => {
        //     done();
@@ -512,41 +519,41 @@
      },
      rowSave(row, done, loading) {
        if (row.videoUrl.length == 0) {
          row.videoUrl = "";
                row.videoUrl = ""
        }
        row.userid = this.userInfo.user_id;
            row.userid = this.userInfo.user_id
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",");
                var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/");
                    var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
        }
        add(row).then(
          () => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
                    })
                    done()
          },
          (error) => {
            window.console.log(error);
            loading();
                    window.console.log(error)
                    loading()
          }
        );
            )
      },
      rowUpdate(row, index, done, loading) {
        row.articleRange = JSON.stringify(row.articleList)
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",");
                var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/");
                    var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
@@ -554,18 +561,18 @@
        update(row).then(
          () => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
                    })
                    done()
          },
          (error) => {
            window.console.log(error);
            loading();
                    window.console.log(error)
                    loading()
          }
        );
            )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -574,37 +581,37 @@
            type: "warning",
          })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
@@ -612,16 +619,16 @@
            type: "warning",
          })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
@@ -630,83 +637,83 @@
            // data.forEach(item=>{
            if (data.url.length > 0) {
              var urls = []
              var names = data.url.split(",");
                        var names = data.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              data.url = urls.join(",")
            }
            // })
            this.form = data;
          });
                    this.form = data
                })
        }
        // con
        done();
            done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {
          dateTime
        } = this.query;
            } = this.query
        let values = {
          ...params,
        };
            }
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          };
          values.dateTime = null;
                }
                values.dateTime = null
        }
        values.type = 0
        this.loading = true;
            this.loading = true
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
          this.data.forEach(item => {
            if (item.url.length > 0) {
              var urls = []
              var names = item.url.split(",");
                        var names = item.url.split(",")
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              item.url = urls.join(",")
            }
          })
          this.loading = false;
          this.selectionClear();
        });
                this.loading = false
                this.selectionClear()
            })
        getDistrictTree(params = {}).then((res) => {
          const data = res.data.data;
          this.districtTree = data;
          const column = this.findObject(this.option.column, "articleList");
          column.dicData = res.data.data;
          this.loading = false;
        });
                const data = res.data.data
                this.districtTree = data
                const column = this.findObject(this.option.column, "articleList")
                column.dicData = res.data.data
                this.loading = false
            })
      },
      updateFb(row) {
        if (row.publish == "0") {
          row.publish = "1";
                row.publish = "1"
        } else {
          row.publish = "0";
                row.publish = "0"
        }
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",");
                var split = row.url.split(",")
          split.forEach(url => {
            var names = url.split("jczz/");
                    var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.url = urls.join(",")
@@ -714,63 +721,63 @@
        update(row).then(
          () => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
                    })
                    done()
          },
          (error) => {
            window.console.log(error);
            loading();
                    window.console.log(error)
                    loading()
          }
        );
            )
      },
      kqcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "1");
                return upcomment(this.ids, "1")
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      gbcomment() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据开启评论?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            return upcomment(this.ids, "0");
                return upcomment(this.ids, "0")
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      }
    },
  };
}
</script>
<style>
src/views/gzll/owners_committee.vue
New file
@@ -0,0 +1,192 @@
<!-- 走访日志 -->
<template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form"
            :permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
        </avue-crud>
    </basic-container>
</template>
<script>
import { getList } from "@/api/owners_committee"
import { mapGetters } from "vuex"
import website from '@/config/website'
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            datetime: "",
            selectionList: [],
            option: {
                menu: false,
                addBtn: false,
                border: true,
                index: false,
                selection: false,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                searchShow: true,
                searchMenuSpan: 3,
                //stripe:true,
                viewBtn: true,
                excelBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "业委会名称",
                        labelWidth: 116,
                        prop: "name",
                        search: true
                    },
                    {
                        label: "小区名称",
                        prop: "areaName",
                        search: true
                    },
                    {
                        label: "开始时间",
                        prop: "startTime",
                        type: "date",
                        format: "yyyy-MM-dd HH:mm:ss",
                        valueFormat: "yyyy-MM-dd HH:mm:ss",
                        rules: [
                            {
                                required: true,
                                message: "请输入走访时间",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        label: "总人数",
                        prop: "peopleTotal",
                    },
                    {
                        label: "手机号",
                        prop: "mobile",
                    },
                    {
                        label: "地址",
                        prop: "location",
                    },
                    {
                        label: "经度",
                        prop: "longitude",
                    },
                    {
                        label: "纬度",
                        prop: "latitude",
                    },
                    {
                        label: "图片",
                        prop: "imageUrl",
                        type: "upload",
                        labelWidth: 120,
                        width: 80,
                        listType: "picture-img",
                        action: "/api/blade-resource/oss/endpoint/put-file",
                        propsHttp: {
                            res: "data",
                            name: 'name',
                            url: "link",
                        },
                        span: 24,
                    },
                ],
            },
            data: [],
        }
    },
    watch: {
    },
    computed: {
        ...mapGetters(["permission", "userInfo"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
                viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
                delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
                editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach((ele) => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    methods: {
        searchReset () {
            this.query = {}
            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()
        },
        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
                this.page.total = data.total
                this.data = data.records.map(item => {
                    if (item.imageUrl && item.imageUrl.length > 0) {
                        var urls = []
                        var names = item.imageUrl.split(",")
                        names.forEach(name => {
                            urls.push(website.minioUrl + name)
                        })
                        item.imageUrl = urls.join(",")
                    }
                    return item
                })
                this.loading = false
                this.selectionClear()
            })
        }
    },
}
</script>
<style>
.avue-upload__icon {
    line-height: 6;
}
</style>
src/views/userHouse/houseHoldList.vue
@@ -355,7 +355,7 @@
        textDispose () {
            return (row, flag, type) => {
                if (row[flag]) {
                if (row[flag] || row[type] == null) {
                    return row[type]
                } else {
                    if (type == 'idCard') {