wuqing3 2 gadi atpakaļ
vecāks
revīzija
6093907df7

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 442 - 224
package-lock.json


+ 3 - 3
package.json

@@ -9,6 +9,8 @@
   },
   "dependencies": {
     "@riophae/vue-treeselect": "^0.4.0",
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^1.0.2",
     "axios": "^0.21.1",
     "core-js": "^3.6.5",
     "echarts": "^5.3.2",
@@ -19,9 +21,7 @@
     "vue-amap": "^0.5.10",
     "vue-echarts": "^6.0.2",
     "vue-router": "^3.2.0",
-
-    "vuex": "^3.4.0",
-    "wangeditor": "^4.7.12"
+    "vuex": "^3.4.0"
   },
   "devDependencies": {
     "@riophae/vue-treeselect": "^0.4.0",

+ 35 - 3
src/api/index.js

@@ -28,7 +28,7 @@ const instance = axios.create({
 instance.interceptors.request.use((config) => {
     config.headers['Accept'] = '';
     config.headers['X-Requested-With'] = 'XMLHttpRequest';
-    config.headers['Authorization'] = 'Bearer ' + localStorage.getItem('token');
+    config.headers['Authorization'] =  localStorage.getItem('token');
     return config;
 }, (error) => {
     return Promise.reject(error);
@@ -80,7 +80,7 @@ function fetch(ourl, params = {}, methods = 'post') {
         instance[methods](url, params).then(res => {
             if (res.code == 200 || res.code == 1) {
                 resolve(res)
-            } else if (res.code == 401) {
+            } else if (res.code == 401 || res.code == 201) {
                 router.push({name:'login'})
             } else {
                 Message.error(res.msg)
@@ -102,9 +102,10 @@ function fetchThrid(ourl, params = {}, methods = 'post') {
             url = ourl + '?' + qs.stringify(params);
         }
         instanceMusic[methods](url, params).then(res => {
+
             if (res.status == 1 || res.code == 0) {
                 resolve(res)
-            } else if (res.code == 401) {
+            } else if (res.code == 401 || res.code == 201) {
                 router.push({name:'login'})
             } else {
                 Message.error(res.msg)
@@ -136,6 +137,37 @@ export default {
     votes(params){
         return fetch('/votes/',params,"get")
     },
+    addVoteActivity(params) {
+        return fetch("/vote_activity/",params,"put");
+    },
+    editVoteActivity(params) {
+        return fetch("/vote_activity/",params,"post");
+    },
+    addVote(params){
+        return fetch('/vote/',params,"put")
+    },
+    editVote(params){
+        return fetch('/vote/',params,"post")
+    },
+    noticeList(params){
+        return fetch('/notices',params,"get")
+    },
+    addNotice(params){
+        return fetch('/notice',params,"put");
+    },
+    editNotice(params){
+        return fetch('/notice',params,"post");
+    },
+    getNoticeInfoById(params){
+        return fetch('/notice',params,"get");
+    },
+
+    getHouseRelations(params){
+        return fetch('/houseRelations',params,'get')
+    },
+    verifyHouseRelation(params){
+        return fetch('/houseRelation/verify',params,'put')
+    }
 
 
 

+ 22 - 1
src/components/searchForm.vue

@@ -18,6 +18,25 @@
         </el-select>
       </div>
 
+      <div class="label" v-if="keys.includes('type')">
+        <span class="name">类型:</span>
+        <el-select v-model="form.type" placeholder="请选择"  :clearable="true" class="input" size="small" style="width: 240px;">
+          <el-option value="1" label="公告"></el-option>
+          <el-option value="2" label="消息"></el-option>
+
+        </el-select>
+      </div>
+
+
+      <div class="label" v-if="keys.includes('state')">
+        <span class="name">状态:</span>
+        <el-select v-model="form.state" placeholder="请选择"  :clearable="true" class="input" size="small" style="width: 240px;">
+          <el-option value="1" label="审核"></el-option>
+          <el-option value="2" label="未审核"></el-option>
+
+        </el-select>
+      </div>
+
       <div class="label" v-if="keys.includes('optime')">
         <span class="name">投票时间:</span>
         <el-date-picker
@@ -48,7 +67,9 @@
 <script>
 let defaultForm = {
   key:"",
-  activityId:""
+  activityId:"",
+  type:'1',
+  state:'1'
 }
 export default {
   name: "searchForm",

+ 21 - 0
src/router/index.js

@@ -49,6 +49,27 @@ const routes = [
                 name:'voteActivityInfo',
                 component:() => import('@/views/vote/voteActivityInfo')
             },
+           {
+                path: '/notice',
+                name:'notice',
+                component:() => import('@/views/notice/index')
+            },
+           {
+                path: '/noticeInfo',
+                name:'noticeInfo',
+                component:() => import('@/views/notice/info')
+            },
+           {
+                path: '/verify',
+                name:'verify',
+                component:() => import('@/views/verify/index')
+            },
+
+            {
+                path: '/audio',
+                name:'audio',
+                component:() => import('@/views/verify/verify')
+            },
 
 
 

+ 25 - 3
src/views/login/index.vue

@@ -30,7 +30,8 @@
         <div class="title">验证码</div>
 
         <el-input class="codeInput" type="text" v-model="loginForm.securityCode"/>
-        <el-button type="success" @click="getSecurityCode" style="width: 100px;display: flex;justify-content: center;">获取验证码</el-button>
+        <el-button type="success" @click="getSecurityCode" style="width: 100px;display: flex;justify-content: center;" v-if="interval == false">获取验证码</el-button>
+        <el-button type="success" style="width: 100px;display: flex;justify-content: center;" v-if="interval == true">{{timeCount}} S</el-button>
       </div>
       <div class="floor">
         <el-button style="width: 100%" @click="handleLogin" type="success">登录</el-button>
@@ -49,6 +50,8 @@ export default {
   data: () => {
     return {
       step:0,
+      timeCount:60,
+      interval:false,
       loginForm: {
 
         securityCode: "",
@@ -59,15 +62,33 @@ export default {
     }
   },
   created() {
-    this.captchaImage();
+    // this.captchaImage();
+  },
+  watch:{
+    interval(v){
+      let that = this;
+      if(v){
+        let t1 = setInterval(() => {
+          that.timeCount = that.timeCount - 1;
+          if(that.timeCount == 0){
+            clearInterval(t1);
+            that.interval = false;
+
+          }
+        },1000)
+      }else{
+        this.timeCount = 60;
+      }
+    }
   },
   methods: {
 
     changeType(type){
+        // alert(type)
         this.loginForm.type = type;
         this.step = 1;
 
-
+        // alert(this.step)
     },
     getSecurityCode(){
       let mobile = this.loginForm.mobile;
@@ -79,6 +100,7 @@ export default {
         this.$api.verificationCode({
           mobile
         }).then(res => {
+          this.interval = true;
           console.log(res)
           this.loginForm.securityCode = res.content.verificationCode;
 

+ 9 - 4
src/views/main/modules/leftMenu.vue

@@ -2,7 +2,7 @@
   <div :class="['leftMenu',{collapsed:leftMenuCollapsed}]">
     <div class="logo" @click="goHome">
       <!--      <img :class="['logo-img',{'small-img':leftMenuCollapsed}]" src="../../../assets/logo.png" alt="">-->
-      <span v-if="!leftMenuCollapsed" class="title">TV STATION</span>
+      <span v-if="!leftMenuCollapsed" class="title">业委会管理系统</span>
     </div>
     <el-menu
         :unique-opened="true"
@@ -59,7 +59,7 @@ export default {
       menuList: [
         {
             icon:"",
-            title:'投票',
+            title:'基础操作',
             children:[
               {
                 name:'voteActivity',
@@ -67,9 +67,14 @@ export default {
                 title:'投票活动'
               },
               {
-                name:'vote',
+                name:'notice',
                 icon:"",
-                title:'表决事项'
+                title:'公告通知'
+              },
+              {
+                name:'verify',
+                icon:"",
+                title:'房产审核'
               },
             ]
         },

+ 6 - 14
src/views/main/modules/rx-header.vue

@@ -8,6 +8,7 @@
     <div class="avator-box">
 
       <i class="el-icon-bell" style="width: 25px;height: 25px;font-size: 25px;margin-right: 20px;"/>
+      <span style="color:red;" @click="logout">退出登录</span>
     </div>
   </div>
 </template>
@@ -22,19 +23,9 @@ export default {
 
   methods: {
 
-    getUserInfo(){
-      this.$api.getUserInfo().then(res=>{
-        this.$store.dispatch('setUserInfo',res.data.sysUser)
-      })
-    },
-    changeShop(){
-
-    },
-    getAuthShop(){
-      this.$api.getAuthShop().then(res=>{
-        this.$nextTick(()=>{
-          this.$refs.userBox.users = res.data
-        })
+    logout(){
+      this.$router.push({
+        name:"login"
       })
     },
     ...mapMutations(['CHANGECOLL']),
@@ -50,7 +41,7 @@ export default {
     },
   },
   mounted() {
-    this.getUserInfo()
+
   },
   computed: {
     ...mapGetters(['leftMenuCollapsed','userInfo']),
@@ -74,6 +65,7 @@ export default {
       url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
     }
   },
+
 }
 </script>
 

+ 244 - 0
src/views/notice/index.vue

@@ -0,0 +1,244 @@
+<template>
+    <div class="container">
+
+        <div class="card">
+
+            <searchForm :keys="['type']" ref="searchForm"
+                        @on-search="handleSearch">
+                <el-button type="primary" icon="el-icon-plus" plain size="small" @click="addNotice" >新增</el-button>
+            </searchForm>
+
+            <RxTable
+                    ref="rxTable"
+                    @sizeChange="changePageSize"
+                    @pageChange="changePage"
+
+                    :currentPage="pageInfo.page"
+                    :pageSize="pageInfo.pageSize"
+                    :page-count="listData.pageQuantity"
+                    :data="listData.list"
+                    :blank-col="true"
+                    :loading="loading"
+            >
+                <el-table-column
+                        :align="item.align || 'left'"
+                        :prop="item.prop"
+
+                        :label="item.label"
+                        :key="item.id"
+                        v-for="(item) in tableHeader"
+                        :show-overflow-tooltip="true"
+                        :width="item.width"
+                        :min-width="item.minWidth"
+                >
+                    <template slot-scope="scope">
+                        <div v-if="item.prop == 'flag'" style="height: 36px;">
+                            <el-image fit="fill" :src="scope.row[item.prop]" style="height: 36px;width: 80px;"></el-image>
+                        </div>
+
+                        <div v-else-if="item.prop == 'tvCounts'">
+                            <el-tag size="small" style="width: 50px;text-align: center;" @click="goTvList(scope.row)">{{scope.row[item.prop]}}</el-tag>
+                        </div>
+                        <span v-else>{{ scope.row[item.prop] || scope.row[item.prop] == 0 ? scope.row[item.prop] : '-' }} </span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" fixed="right" align="left" width="200">
+                    <template slot-scope="scope">
+                        <el-button type="text" icon="el-icon-search" @click="handleInfo(scope.row)">查看</el-button>
+                        <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑 </el-button>
+                    </template>
+                </el-table-column>
+            </RxTable>
+        </div>
+        <el-dialog
+                title="发布内容"
+                :visible.sync="dialogVisible"
+                width="1200px"
+                :lock-scroll="false">
+            <noticeForm ref="noticeForm" v-if="dialogVisible"></noticeForm>
+            <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisible = false">取 消</el-button>
+                    <el-button type="primary" @click="onSubmit('add')">确 定</el-button>
+                </span>
+        </el-dialog>
+        <el-dialog
+                title="编辑内容"
+                :visible.sync="dialogVisibleUpdate"
+                width="1200px"
+                :lock-scroll="false">
+            <noticeForm ref="noticeForm" v-if="dialogVisibleUpdate"></noticeForm>
+            <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisibleUpdate = false">取 消</el-button>
+                    <el-button type="primary" @click="onSubmit('edit')">确 定</el-button>
+                </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import searchForm from "@/components/searchForm";
+    import RxTable from "@/components/RxTable";
+    import noticeForm from "./module/noticeForm";
+
+
+    export default {
+        name: "index",
+        components: {
+            searchForm,
+            RxTable,
+            noticeForm
+        },
+        data() {
+            return {
+
+                searchParams: {},
+                loading: false,
+                dialogVisible: false,
+                tableHeader: [
+                    {
+                        prop: "title",
+                        label: "通知标题",
+                        width: "200"
+                    },
+                    {
+                        prop: "secondTitle",
+                        label: "副标题",
+                        width: "200"
+                    },
+                    {
+                        prop: "content",
+                        label: "内容",
+                        width: "300"
+                    },
+                    {
+                        prop: "publishTime",
+                        label: "发布时间",
+                        width: "120"
+                    },
+
+                ],
+                listData: {
+                    list: [],
+                    pageQuantity:0,
+                },
+                pageInfo: {
+                    pageNum: 1,
+                    pageCapacity: 10,
+                },
+                addVisible: false,
+                dialogVisibleUpdate: false,
+            }
+        },
+        methods: {
+            addNotice(){
+                this.dialogVisible = true;
+            },
+            handleInfo(row){
+                console.log(row)
+                this.$router_({
+                    name:"noticeInfo",
+                    title:"消息详情",
+                    canClose:true,
+                    params:{
+                        id:row.id
+                    }
+                })
+
+            },
+            handleEdit(row) {
+                console.log(row)
+                this.dialogVisibleUpdate = true;
+                this.$nextTick(() => {
+                    this.$refs.noticeForm.form = JSON.parse(JSON.stringify(row));
+                    // this.$refs.noticeForm.setContext();
+                })
+
+            },
+
+
+
+            onSubmit(type="add") {
+
+                this.$refs.noticeForm.getContent();
+
+                let form = JSON.parse(JSON.stringify(this.$refs.noticeForm.form));
+
+
+
+                console.log(type)
+
+
+                if(type =="add"){
+                    delete form.id;
+                    this.$api.addNotice(form).then(res => {
+                        this.$message.success("新增成功!");
+                        this.dialogVisible = false;
+                        this.handleSearch();
+                    })
+                }else{
+                    this.$api.editNotice(form).then(res => {
+                        this.$message.success("编辑成功!");
+                        this.dialogVisibleUpdate = false;
+                        this.handleSearch();
+                    })
+                }
+
+            },
+
+            goDeleteSelect() {
+
+            },
+            //搜索
+            handleSearch() {
+                this.pageInfo.pageNum = 1
+
+                this.noticeList()
+            },
+
+            //国家list
+            noticeList() {
+
+                let type = this.$refs.searchForm.form.type;
+                this.searchParams = {
+                    ...this.pageInfo,
+                    type
+                }
+
+                this.loading = true;
+
+                this.$api.noticeList(this.searchParams).then(res => {
+                    this.loading = false;
+                    console.log(res)
+                    this.listData.list = res.content.list
+
+                    this.listData.pageQuantity = res.content.pageQuantity;
+
+                })
+            },
+
+
+            changePageSize() {
+
+            },
+            changePage(page) {
+
+                this.pageInfo.pageNum = page
+                this.noticeList()
+            },
+
+        },
+        mounted() {
+            this.handleSearch()
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+    .container {
+        /*position: relative;*/
+
+        .btnBox {
+            margin-left: 20px;
+        }
+    }
+</style>

+ 85 - 0
src/views/notice/info.vue

@@ -0,0 +1,85 @@
+<template>
+    <div class="container">
+        <div class="card">
+            <div class="title">{{info.title}}</div>
+            <div class="secondTitle">{{info.secondTitle}}</div>
+            <div class="time">{{info.publishTime}}</div>
+
+            <div class="content" v-html="info.content"></div>
+
+        </div>
+
+    </div>
+</template>
+
+<script>
+
+    export default {
+        name: "info",
+        components:{
+
+        },
+        data(){
+            return {
+
+                searchParams: {},
+
+
+                info:{},
+                noticeId:''
+
+            }
+        },
+        methods:{
+
+            handleSearch(){
+                let noticeId = this.noticeId;
+                this.$api.getNoticeInfoById({
+                    noticeId,
+                }).then(res => {
+                    console.log(res)
+                    this.info = res.content;
+                })
+            }
+
+        },
+        mounted() {
+
+
+            this.noticeId= this.$route.params.id.toString();
+            this.handleSearch()
+
+
+
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+     .title{
+
+         text-align: center;
+         font-size: 24px;
+         color: #333;
+         font-weight: 700;
+     }
+     .secondTitle{
+         text-align: center;
+         font-size: 16px;
+         margin-top: 10px;
+         color: #666;
+         font-weight: 400;
+     }
+     .time {
+
+         text-align: center;
+         font-size: 14px;
+         margin-top: 10px;
+         color: #666;
+         font-weight: 400;
+
+     }
+     .content{
+         text-indent:2em;
+     }
+</style>

+ 85 - 0
src/views/notice/module/noticeForm.vue

@@ -0,0 +1,85 @@
+<template>
+    <div class="noticeForm">
+        <el-form ref="form" :model="form" label-width="100px">
+            <el-form-item label="通知类型">
+                <el-select v-model="form.type" placeholder="请选择"  :clearable="true" class="input" size="small" style="width: 240px;">
+                    <el-option :value="1" label="公告"></el-option>
+                    <el-option :value="2" label="消息"></el-option>
+
+                </el-select>
+            </el-form-item>
+
+            <el-form-item label="活动标题">
+                <el-input v-model="form.title" size="small" style="width: 240px;"></el-input>
+            </el-form-item>
+
+            <el-form-item label="活动副标题">
+                <el-input v-model="form.secondTitle" size="small" style="width: 240px;"></el-input>
+            </el-form-item>
+            <el-form-item label="内容">
+                <div style="border: 1px solid #ccc;">
+                    <Toolbar
+                            style="border-bottom: 1px solid #ccc"
+                            :editor="editor"
+                            :defaultConfig="toolbarConfig"
+                            :mode="mode"
+                    />
+                    <Editor
+                            style="height: 500px; overflow-y: hidden;"
+                            v-model="html"
+                            :defaultConfig="editorConfig"
+                            :mode="mode"
+                            @onCreated="onCreated"
+                    />
+                </div>
+            </el-form-item>
+        </el-form>
+
+
+    </div>
+
+</template>
+<style src="@wangeditor/editor/dist/css/style.css"></style>
+<script>
+    import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
+    export default {
+        name: "activityForm",
+        components:{
+            Editor,Toolbar
+        },
+        data(){
+            return {
+                editor: null,
+                html: '',
+                toolbarConfig: { },
+                editorConfig: { placeholder: '请输入内容...' },
+                mode: 'default', // or 'simple'
+                form:{
+                    id:"",
+                    title:"",secondTitle:'',content:""
+
+                },
+            }
+        },
+        methods:{
+            onCreated(editor) {
+                this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
+                this.setContext()
+            },
+
+
+            getContent(){
+                this.form.content = this.editor.getHtml();
+            },
+            setContext(){
+
+                this.html = this.form.content
+                this.editor.setHtml(this.form.content)
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 273 - 0
src/views/verify/index.vue

@@ -0,0 +1,273 @@
+<template>
+    <div class="container">
+
+        <div class="card">
+
+            <searchForm :keys="['state']" ref="searchForm"
+                        @on-search="handleSearch">
+                <el-button type="primary" icon="el-icon-plus" plain size="small" @click="addVoteActivity" >新增</el-button>
+            </searchForm>
+
+            <RxTable
+                    ref="rxTable"
+                    @sizeChange="changePageSize"
+                    @pageChange="changePage"
+
+                    :currentPage="pageInfo.page"
+                    :pageSize="pageInfo.pageSize"
+                    :page-count="listData.pageQuantity"
+                    :data="listData.list"
+                    :blank-col="true"
+                    :loading="loading"
+            >
+                <el-table-column
+                        :align="item.align || 'left'"
+                        :prop="item.prop"
+
+                        :label="item.label"
+                        :key="item.id"
+                        v-for="(item) in tableHeader"
+                        :show-overflow-tooltip="true"
+                        :width="item.width"
+                        :min-width="item.minWidth"
+                >
+                    <template slot-scope="scope">
+                        <div v-if="item.prop == 'certificateUrl'">
+                            <el-image fit="fill" :src="scope.row[item.prop]" style="height: 36px;width: 80px;"></el-image>
+                        </div>
+                        <div v-else-if="item.prop == 'state'">
+                              <span  style="color:red" v-if="scope.row.state == 2">审核 </span>
+                              <span style="color:green" v-if="scope.row.state == 1">审核通过 </span>
+                        </div>
+
+                        <span v-else>{{ scope.row[item.prop] || scope.row[item.prop] == 0 ? scope.row[item.prop] : '-' }} </span>
+
+
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" fixed="right" align="left" width="200">
+                    <template slot-scope="scope">
+                        <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.state == 2">审核 </el-button>
+
+                    </template>
+                </el-table-column>
+            </RxTable>
+        </div>
+
+        <el-dialog
+                title="审核"
+                :visible.sync="dialogVisible"
+                width="800px"
+                :lock-scroll="false">
+            <verify ref="verify"></verify>
+            <span slot="footer" class="dialog-footer">
+                    <el-button type="success" icon="el-icon-check" @click="handleAduit(1)">通过</el-button>
+                    <el-button type="danger" icon="el-icon-close" @click="handleAduit(2)">不通过</el-button>
+                </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import searchForm from "@/components/searchForm";
+    import RxTable from "@/components/RxTable";
+    import verify from "./verify";
+
+
+
+    export default {
+        name: "index",
+        components: {
+            searchForm,
+            RxTable,
+            verify
+
+        },
+        data() {
+            return {
+
+                searchParams: {},
+                loading: false,
+                dialogVisible: false,
+                tableHeader: [
+                    {
+                        prop: "certificateNo",
+                        label: "房产证编号",
+                        width: "300"
+                    },
+                    {
+                        prop: "realName",
+                        label: "名称",
+                        width: "300"
+                    },
+                    {
+                        prop: "certificateUrl",
+                        label: "图片",
+                        width: "120"
+                    },
+                    {
+                        prop: "state",
+                        label: "状态",
+                        width: "120"
+                    },
+
+                ],
+                listData: {
+                    list: [],
+                    pageQuantity:0,
+                },
+                pageInfo: {
+                    pageNum: 1,
+                    pageCapacity: 10,
+                },
+                addVisible: false,
+                dialogVisibleUpdate: false,
+            }
+        },
+        methods: {
+            handleAduit(state){
+                let {passportId,houseId} = this.$refs.verify.form;
+
+                let params = {
+                    passportId,
+                    houseId,
+                    state
+                }
+                this.$api.verifyHouseRelation(params).then(res => {
+                    console.log(res)
+                    this.$message.success("处理成功!");
+                    this.dialogVisible = false;
+                    this.handleSearch()
+                })
+            },
+            addVoteActivity(){
+                this.dialogVisible = true;
+            },
+            handleInfo(row){
+                console.log(row)
+                // this.$router_({
+                //     name:"voteActivityInfo",
+                //     title:"活动详情",
+                //     canClose:true,
+                //     params:{
+                //         ...row
+                //     }
+                // })
+                // this.$router.push({
+                //   name:"voteActivityInfo",
+                //   params:{
+                //     activityId:row.activityId
+                //   }
+                // })
+            },
+            handleEdit(row) {
+                console.log(row)
+                this.dialogVisible = true;
+
+                this.$nextTick(() => {
+                    this.$refs.verify.form = JSON.parse(JSON.stringify(row))
+                })
+                // this.$router_({
+                //     name:"audio",
+                //     title:"审核",
+                //     canClose:true,
+                //     params:{
+                //         ...row
+                //     }
+                // })
+
+            },
+
+            handleDelete(row){
+                this.$confirm('确认刪除, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+
+                })
+
+            },
+
+            onSubmit(type="add") {
+                let form = this.$refs.activityForm.form;
+
+                console.log(type)
+
+
+                if(type =="add"){
+                    this.$api.addVoteActivity(form).then(res => {
+                        this.$message.success("新增成功!");
+                        this.dialogVisible = false;
+                        this.handleSearch();
+                    })
+                }else{
+                    this.$api.editVoteActivity(form).then(res => {
+                        this.$message.success("编辑成功!");
+                        this.dialogVisibleUpdate = false;
+                        this.handleSearch();
+                    })
+                }
+
+            },
+
+            goDeleteSelect() {
+
+            },
+            //搜索
+            handleSearch() {
+                this.pageInfo.pageNum = 1
+
+
+
+                this.getHouseRelations()
+            },
+
+            //国家list
+            getHouseRelations() {
+                let state = this.$refs.searchForm.form.state;
+
+
+                this.searchParams = {
+                    ...this.pageInfo,
+                    state
+                }
+
+                this.loading = true;
+
+                this.$api.getHouseRelations(this.searchParams).then(res => {
+                    this.loading = false;
+                    console.log(res)
+                    this.listData.list = res.content.list;
+
+                    this.listData.pageQuantity = res.content.pageQuantity;
+
+                })
+            },
+
+
+            changePageSize() {
+
+            },
+            changePage(page) {
+
+                this.pageInfo.pageNum = page
+                this.voteList()
+            },
+
+        },
+        mounted() {
+            this.handleSearch()
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+    .container {
+        /*position: relative;*/
+
+        .btnBox {
+            margin-left: 20px;
+        }
+    }
+</style>

+ 70 - 0
src/views/verify/verify.vue

@@ -0,0 +1,70 @@
+<template>
+    <div class="container">
+        <div class="">
+            <div class="form">
+                <div class="form-item">
+                    <div class="label">房产证编号:</div>
+                    <div class="text"> {{form.certificateNo}}</div>
+                </div>
+                <div class="form-item">
+                    <div class="label">业主姓名:</div>
+                    <div class="text">{{form.realName}}</div>
+                </div>
+                <div class="form-item" >
+                    <div class="label">房产证照片:</div>
+                    <div class="text"><el-image :src="form.certificateUrl" alt="" /></div>
+                </div>
+
+
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    export default {
+        name: "verify",
+        data(){
+            return {
+                form:{
+                    certificateNo:"",
+                    certificateUrl:"",
+                    houseId:'',
+                    passportId:"",
+                    realName:"",
+                    state:""
+                }
+            }
+        },
+
+        mounted(){
+
+
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+    .form{
+        /*border:1px solid red;*/
+
+        .form-item{
+            /*border:1px solid red;*/
+
+            font-size: 18px;
+            margin-bottom: 15px;
+            .label{
+                //border:1px solid red;
+                text-align: right;
+
+                width: 120px;
+            }
+            .text{
+                //border:1px solid black;
+                /*width: 300px;*/
+
+            }
+
+        }
+    }
+</style>

+ 81 - 59
src/views/vote/index.vue

@@ -5,7 +5,7 @@
 
       <searchForm :keys="['key','optime']" ref="searchForm"
                   @on-search="handleSearch">
-        <el-button type="primary" icon="el-icon-plus" plain size="small" >新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" plain size="small" @click="addVoteActivity" >新增</el-button>
       </searchForm>
 
       <RxTable
@@ -44,52 +44,53 @@
         </el-table-column>
         <el-table-column label="操作" fixed="right" align="left" width="200">
           <template slot-scope="scope">
-                <el-button type="text" icon="el-icon-search" @click="handleInfo(scope.row)">查看</el-button>
+                <el-button type="text" icon="el-icon-search" @click="handleInfo(scope.row)">详情</el-button>
                 <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑 </el-button>
             <!--            <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">绑定微信-->
             <!--            </el-button>-->
-            <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
-            </el-button>
+<!--            <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除-->
+<!--            </el-button>-->
           </template>
         </el-table-column>
       </RxTable>
     </div>
-    <!--    <el-dialog-->
-    <!--        title="添加用户"-->
-    <!--        :visible.sync="dialogVisible"-->
-    <!--        width="600px"-->
-    <!--        :lock-scroll="false">-->
-    <!--      <userForm ref="userForm"></userForm>-->
-    <!--      <span slot="footer" class="dialog-footer">-->
-    <!--                <el-button @click="dialogVisible = false">取 消</el-button>-->
-    <!--                <el-button type="primary" @click="onSubmit">确 定</el-button>-->
-    <!--            </span>-->
-    <!--    </el-dialog>-->
-    <!--    <el-dialog-->
-    <!--        title="编辑角色"-->
-    <!--        :visible.sync="dialogVisibleUpdate"-->
-    <!--        width="600px"-->
-    <!--        :lock-scroll="false">-->
-    <!--      <userForm ref="userFormu"></userForm>-->
-    <!--      <span slot="footer" class="dialog-footer">-->
-    <!--                <el-button @click="dialogVisibleUpdate = false">取 消</el-button>-->
-    <!--                <el-button type="primary" @click="onSubmit">确 定</el-button>-->
-    <!--            </span>-->
-    <!--    </el-dialog>-->
+        <el-dialog
+            title="添加投票活动"
+            :visible.sync="dialogVisible"
+            width="600px"
+            :lock-scroll="false">
+          <activityForm ref="activityForm"></activityForm>
+          <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisible = false">取 消</el-button>
+                    <el-button type="primary" @click="onSubmit('add')">确 定</el-button>
+                </span>
+        </el-dialog>
+        <el-dialog
+            title="编辑投票活动"
+            :visible.sync="dialogVisibleUpdate"
+            width="600px"
+            :lock-scroll="false">
+          <activityForm ref="activityForm"></activityForm>
+          <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisibleUpdate = false">取 消</el-button>
+                    <el-button type="primary" @click="onSubmit('edit')">确 定</el-button>
+                </span>
+        </el-dialog>
   </div>
 </template>
 
 <script>
 import searchForm from "@/components/searchForm";
 import RxTable from "@/components/RxTable";
+import activityForm from "./module/activityForm";
 
 
 export default {
   name: "index",
   components: {
     searchForm,
-
     RxTable,
+    activityForm
   },
   data() {
     return {
@@ -133,6 +134,9 @@ export default {
     }
   },
   methods: {
+    addVoteActivity(){
+      this.dialogVisible = true;
+    },
     handleInfo(row){
       console.log(row)
       this.$router_({
@@ -143,14 +147,14 @@ export default {
             ...row
         }
       })
-        // this.$router.push({
-        //   name:"voteActivityInfo",
-        //   params:{
-        //     activityId:row.activityId
-        //   }
-        // })
+
     },
     handleEdit(row) {
+        console.log(row)
+        this.dialogVisibleUpdate = true;
+        this.$nextTick(() => {
+            this.$refs.activityForm.form = JSON.parse(JSON.stringify(row));
+        })
 
     },
 
@@ -165,13 +169,26 @@ export default {
 
     },
 
-    onSubmit() {
-      // let form = this.$refs.userForm.getParams();
-      // this.$api.addUser(form).then(res => {
-      //   this.$message.success("新增成功!");
-      //   this.dialogVisible = false;
-      //   this.handleSearch();
-      // })
+    onSubmit(type="add") {
+      let form = this.$refs.activityForm.form;
+
+      console.log(type)
+
+
+      if(type =="add"){
+          this.$api.addVoteActivity(form).then(res => {
+              this.$message.success("新增成功!");
+              this.dialogVisible = false;
+              this.handleSearch();
+          })
+      }else{
+           this.$api.editVoteActivity(form).then(res => {
+               this.$message.success("编辑成功!");
+               this.dialogVisibleUpdate = false;
+               this.handleSearch();
+           })
+      }
+
     },
 
     goDeleteSelect() {
@@ -181,31 +198,36 @@ export default {
     handleSearch() {
       this.pageInfo.pageNum = 1
 
-      let optime = this.$refs.searchForm.time1;
-
-      let startTime,
-          key,
-          endTime;
-      key = this.$refs.searchForm.form.key;
-
-      if(optime.length){
-        startTime = optime[0];
-        endTime = optime[1];
-      }
 
-      this.searchParams = {
-        startTime,
-        endTime,
-        key,
-        ...this.pageInfo
-      }
 
 
       this.voteList()
     },
 
-    //国家list
-    voteList(params) {
+
+    voteList() {
+        let optime = this.$refs.searchForm.time1;
+
+        let startTime,
+            key,
+            endTime;
+        key = this.$refs.searchForm.form.key;
+
+        if(optime.length){
+            startTime = optime[0];
+            endTime = optime[1];
+        }
+
+        this.searchParams = {
+            startTime,
+            endTime,
+            key,
+            ...this.pageInfo
+        }
+
+
+
+
       this.loading = true;
 
       this.$api.voteList(this.searchParams).then(res => {

+ 40 - 0
src/views/vote/module/activityForm.vue

@@ -0,0 +1,40 @@
+<template>
+    <el-form ref="form" :model="form" label-width="80px">
+        <el-form-item label="活动主题">
+            <el-input v-model="form.title"></el-input>
+        </el-form-item>
+
+        <el-form-item label="活动时间">
+            <el-col :span="11">
+                <el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" v-model="form.launchTime" style="width: 100%;"></el-date-picker>
+            </el-col>
+            <el-col class="line" :span="2">至</el-col>
+            <el-col :span="11">
+                <el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd"  placeholder="选择时间" v-model="form.deadline" style="width: 100%;"></el-date-picker>
+            </el-col>
+        </el-form-item>
+
+        <el-form-item label="活动详情">
+            <el-input type="textarea" v-model="form.content"></el-input>
+        </el-form-item>
+    </el-form>
+</template>
+
+<script>
+    export default {
+        name: "activityForm",
+        data(){
+            return {
+                form:{
+                    id:"",
+                    title:"",launchTime:'',deadline:"",content:'',
+
+                }
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 67 - 0
src/views/vote/module/voteForm.vue

@@ -0,0 +1,67 @@
+<template>
+    <div class="voteForm">
+        <el-form ref="form" :model="form" label-width="80px" class="">
+            <el-form-item label="表决议题">
+                <el-input v-model="form.title"></el-input>
+            </el-form-item>
+
+
+            <el-form-item label="表决详情">
+                <el-input type="textarea" v-model="form.content"></el-input>
+            </el-form-item>
+
+            <el-form-item label="表决选项" v-for="(item,index) in form.options" style="margin-top: 10px;">
+                <el-input  v-model="item.value"></el-input>
+                <el-button  type="danger" icon="el-icon-delete" plain  @click="delOption(index)"  :disabled="disable">删除</el-button>
+            </el-form-item>
+            <el-form-item>
+                <el-button  type="primary" icon="el-icon-plus" plain  @click="addOption" >新增</el-button>
+            </el-form-item>
+
+        </el-form>
+    </div>
+
+</template>
+
+<script>
+    export default {
+        name: "voteForm",
+        data(){
+            return {
+                form:{
+                    activityId:"",
+                    title:"",content:'',
+                    options:[
+                        {value:""},
+                        {value:""}
+                    ]
+                },
+
+            }
+        },
+        computed:{
+           disable(){
+
+               return this.form.options.length < 3?true:false;
+           }
+        },
+        methods:{
+            addOption(){
+                this.form.options.push({
+                    value:"",
+                })
+            },
+            delOption(index){
+                this.form.options.splice(index,1);
+            }
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+    .voteForm {
+        /deep/ .el-form-item__content{
+            display: flex;
+        }
+    }
+</style>

+ 8 - 9
src/views/vote/vote.vue

@@ -48,8 +48,7 @@
             </el-button>
             <!--            <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">绑定微信-->
             <!--            </el-button>-->
-            <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
-            </el-button>
+
           </template>
         </el-table-column>
       </RxTable>
@@ -98,14 +97,19 @@ export default {
       loading: false,
       dialogVisible: false,
       tableHeader: [
+        {
+          prop:"sequence",
+          label:"序列",
+          width: 100
+        },
         {
           prop: "title",
-          label: "活动主题",
+          label: "表决主题",
           width: "300"
         },
         {
           prop: "content",
-          label: "详情",
+          label: "表决详情",
           width: "300"
         },
         {
@@ -113,11 +117,6 @@ export default {
           label: "开始时间",
           width: "120"
         },
-        {
-          prop: "deadline",
-          label: "截止时间",
-          width: "120"
-        },
 
       ],
       listData: {

+ 110 - 21
src/views/vote/voteActivityInfo.vue

@@ -14,6 +14,7 @@
           <div class="form-item">
             <div class="label">活动时间:</div>
             <div class="text">{{form.launchTime}} - {{form.deadline}}</div>
+            <el-button style="position: absolute;right: 10px;" type="primary" icon="el-icon-plus" plain size="small" @click="addVote" >新增</el-button>
           </div>
         </div>
 
@@ -28,6 +29,19 @@
             :loading="loading"
             :showPagination="false"
         >
+
+
+          <el-table-column type="expand">
+            <template slot-scope="props">
+              <el-form label-position="left" class="demo-table-expand">
+                <el-form-item label="选项:" v-for="item in props.row.options" >
+                  <span>{{ item.value }}</span>
+                </el-form-item>
+
+              </el-form>
+            </template>
+          </el-table-column>
+
           <el-table-column
               :align="item.align || 'left'"
               :prop="item.prop"
@@ -57,21 +71,46 @@
               </el-button>
               <!--            <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">绑定微信-->
               <!--            </el-button>-->
-              <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
-              </el-button>
+<!--              <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除-->
+<!--              </el-button>-->
             </template>
           </el-table-column>
         </RxTable>
       </div>
+
+
+      <el-dialog
+              title="添加投票"
+              :visible.sync="dialogVisible"
+              width="600px"
+              :lock-scroll="false">
+        <voteForm ref="voteForm"></voteForm>
+        <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisible = false">取 消</el-button>
+                    <el-button type="primary" @click="onSubmit('add')">确 定</el-button>
+                </span>
+      </el-dialog>
+      <el-dialog
+              title="编辑投票活动"
+              :visible.sync="dialogVisibleUpdate"
+              width="600px"
+              :lock-scroll="false">
+        <voteForm ref="voteForm"></voteForm>
+        <span slot="footer" class="dialog-footer">
+                    <el-button @click="dialogVisibleUpdate = false">取 消</el-button>
+                    <el-button type="primary" @click="onSubmit('edit')">确 定</el-button>
+                </span>
+      </el-dialog>
     </div>
 </template>
 
 <script>
 import RxTable from "@/components/RxTable";
+import voteForm from "./module/voteForm";
 export default {
   name: "voteActivityInfo",
   components:{
-    RxTable
+    RxTable,voteForm
   },
   data(){
     return {
@@ -79,15 +118,21 @@ export default {
       searchParams: {},
       loading: false,
       dialogVisible: false,
+      dialogVisibleUpdate:false,
       tableHeader: [
+        {
+          prop:"sequence",
+          label:"序列",
+          width: 100
+        },
         {
           prop: "title",
-          label: "活动主题",
+          label: "表决主题",
           width: "300"
         },
         {
           prop: "content",
-          label: "详情",
+          label: "表决详情",
           width: "300"
         },
         {
@@ -95,11 +140,6 @@ export default {
           label: "开始时间",
           width: "120"
         },
-        {
-          prop: "deadline",
-          label: "截止时间",
-          width: "120"
-        },
 
       ],
       listData: {
@@ -107,19 +147,56 @@ export default {
         total: 0,
       },
 
-        form:{}
+        form:{},
+      activityId:"",
+
     }
   },
   methods:{
+    handleEdit(row){
+      console.log(row)
 
-
-  },
-  mounted() {
-
-     this.form = this.$route.params;
-      let activityId = this.$route.params.id.toString();
-
-
+      this.dialogVisibleUpdate = true;
+      this.$nextTick(() => {
+          this.$refs.voteForm.form = JSON.parse(JSON.stringify(row));
+      })
+    },
+    addVote(){
+        this.dialogVisible = true;
+
+    },
+    onSubmit(type="add"){
+
+      let form = JSON.parse(JSON.stringify(this.$refs.voteForm.form));
+
+
+
+      let arr = form.options.map(item =>{
+        return item.value;
+      });
+
+      form.options = arr;
+
+      if(type == "add"){
+         form.activityId = this.activityId;
+          this.$api.addVote(form).then(res => {
+            console.log(res);
+            this.$message.success("增加成功!");
+            this.dialogVisible = false;
+            this.handleSearch();
+          })
+      }else{
+        delete form.activityId;
+        this.$api.editVote(form).then(res => {
+          console.log(res);
+          this.$message.success("增加成功!");
+          this.dialogVisible = false;
+          this.handleSearch();
+        })
+      }
+    },
+    handleSearch(){
+      let activityId = this.activityId;
       this.$api.votes({
         activityId,
       }).then(res => {
@@ -127,6 +204,17 @@ export default {
         this.loading = false;
         this.listData.list = res.content;
       })
+    }
+
+  },
+  mounted() {
+
+     this.form = this.$route.params;
+    this.activityId= this.$route.params.id.toString();
+    this.handleSearch()
+
+
+
   }
 }
 </script>
@@ -136,7 +224,8 @@ export default {
       //display: flex;
       height: 200px;
       .form-item{
-          //border:1px solid red;
+        position: relative;
+
         font-size: 14px;
 
         .label{
@@ -153,4 +242,4 @@ export default {
 
       }
     }
-</style>
+</style>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels