luohailiang 3 年之前
父節點
當前提交
f31b46392e

二進制
src/assets/icon-del.png


二進制
src/assets/icon-edit.png


+ 1 - 1
src/components/FileUpload/index.vue

@@ -97,7 +97,7 @@ export default defineComponent({
                     const { url: part_url, file_name } = data
                     const target = FILE_LIST.value.find(({ uid }) => uid === file.uid);
                     target.status = 1
-                    target.url = window.globalVariables.api + part_url
+                    target.url = part_url
                     target.part_url = part_url
                     target.name = file_name
                     handleSuccess()

+ 15 - 2
src/router/index.js

@@ -66,9 +66,22 @@ export const allRoutes = [
             meta: {title: "活动类别管理"},
         },{
             path: "/bjhd/hdlb",
-            name: "bjhd_hdlb",
-            component: () => import("@/views/bjhd/hdlb/index.vue"),
+            component: MainDefaultLayout,
             meta: {title: "活动列表"},
+            children:[{
+                path: "",
+                name: "bjhd_hdlb",
+                component: () => import("@/views/bjhd/hdlb/index.vue"),
+                meta: { title: "活动列表" },
+                props: true,
+            }, {
+                path: "hdxq/:id",
+                hidden: true,
+                name: "bjhd_hdlb_hdxq",
+                component: () => import("@/views/bjhd/hdlb/hdxq/index.vue"),
+                meta: { title: "活动详情" },
+                props: true,
+            }]
         },{
             path: "/bjhd/bmlb",
             name: "bjhd_bmlb",

+ 3 - 0
src/styles/mixin.scss

@@ -239,6 +239,9 @@ input[type=radio] {
 .color-18{
 	color: #646464;
 }
+.color-19{
+	color: #878787;
+}
 .color-white{
 	color: #fff;
 }

+ 23 - 0
src/views/bjhd/hdlb/api.js

@@ -52,8 +52,31 @@ export const hd_edit = (data = {}) =>
                 xdb_hdjssj: data.xdb_hdjssj,
                 xdb_cjr: data.xdb_cjr,
                 xdb_shr: data.xdb_shr,
+                xdb_hdzt: data.xdb_hdzt,
                 xdb_hddz: data.xdb_hddz,
                 xdb_hdms: data.xdb_hdms,
             }
         }
     })
+export const hd_del = (data = {}) =>
+    request({
+        url: '/xddy/dygl_bjhd/delete',
+        data: {
+            issubmit:'1',
+            xdb_id: data.xdb_id
+        }
+    })
+export const sign_add = (data = {}) =>
+    request({
+        url: '/xddy/dygl_hdbm/add',
+        data: {
+            issubmit:'1',
+            xddy_dygl_hdbm:{
+                xdh_xsxm: data.xdh_xsxm,
+                xdh_xsxh: data.xdh_xsxh,
+                xdh_sjhm: data.xdh_sjhm,
+                xdb_id: data.xdb_id,
+                xdb_hdmc: data.xdb_hdmc
+            }
+        }
+    })

+ 50 - 0
src/views/bjhd/hdlb/hdxq/api.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request';
+export const hd_detail = (data = {}) =>
+    request({
+        url: '/xddy/dygl_bjhd/detail',
+        data: {
+            xdb_id:data.xdb_id
+        }
+    })
+export const hd_comment_list = (data = {}) =>
+    request({
+        url: '/xddy/dygl_hdpl/index',
+        data: {
+            xdb_id:data.xdb_id,
+            page: data.page,
+            limit: data.limit
+        }
+    })
+export const hd_comment_add = (data = {}) =>
+    request({
+        url: '/xddy/dygl_hdpl/add',
+        data: {
+            issubmit:'1',
+            xddy_dygl_hdpl:{
+                xdh_plr:data.xdh_plr,
+                xdh_plnr:data.xdh_plnr,
+                xdb_id: data.xdb_id
+            }
+        }
+    })
+export const hd_comment_edit = (data = {}) =>
+    request({
+        url: '/xddy/dygl_hdpl/edit',
+        data: {
+            issubmit:'1',
+            xdh_id: data.xdh_id,
+            xddy_dygl_hdpl:{
+                xdh_plr:data.xdh_plr,
+                xdh_plnr:data.xdh_plnr,
+                xdb_id: data.xdb_id
+            }
+        }
+    })
+export const hd_comment_del = (data = {}) =>
+    request({
+        url: '/xddy/dygl_hdpl/delete',
+        data: {
+            issubmit:'1',
+            xdh_id: data.xdh_id,
+        }
+    })

+ 216 - 0
src/views/bjhd/hdlb/hdxq/index.vue

@@ -0,0 +1,216 @@
+<template>
+<div class="pb20">
+   <div class="p20 border-bottom-1">
+     <div class="d-flex">
+       <h3 class="font-size-18 flex-1 lh40">{{ac_detail.xdb_hdmc}}</h3>
+       <el-button type="primary">报名列表</el-button>
+     </div>
+     <h4 class="mt5 font-size-14 color-17">{{ac_detail.xdbh_name}}|{{ac_detail.xdb_bjmc}}</h4>
+     <h5 class="mt10 font-size-16">活动时间:{{ac_detail.xdb_hdkssj}} ~ {{ac_detail.xdb_hdjssj}}</h5>
+   </div>
+   <div class="p20 border-bottom-1">
+     <div class="font-size-16" v-html="ac_detail.xdb_hdms"></div>
+     <el-button class="mt20" type="primary" @click="newComment">评价</el-button>
+   </div>
+   <div class="p20">
+     <h3 class="font-size-16 color-2 mb10">评论({{commentList.length}})</h3>
+     <ul v-if="commentList.length >0" class="comment-list">
+       <li v-for="item in commentList">
+         <div class="d-flex">
+           <h3 class="font-size-14 color-17">评论人{{item.xdh_plr}}</h3>
+           <span class="ml15 hand icon-edit" @click="editComment(item)"></span>
+           <span class="ml15 hand icon-del" @click="delComment(item)"></span>
+         </div>
+         <div class="mt10 font-size-14">{{item.xdh_plnr}}</div>
+       </li>
+     </ul>
+     <h3 v-else class="font-size-16 color-19">暂无评论</h3>
+   </div>
+  <el-dialog title="评价" :visible.sync="commentDialogVisible" width="550px" v-loading="loading">
+    <el-form :model="commentForm" ref="commentForm" :rules="rules" label-width="100px">
+      <el-form-item label="评价描述:" prop="xdh_plnr">
+        <el-input
+            type="textarea"
+            :rows="3"
+            placeholder="请输入评论"
+            v-model="commentForm.xdh_plnr">
+        </el-input>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button @click="commentDialogVisible = false">取 消</el-button>
+      <el-button type="primary" @click="commentFormSubmit('commentForm')">确 定</el-button>
+    </div>
+  </el-dialog>
+
+</div>
+</template>
+
+<script>
+import {hd_detail,hd_comment_list,hd_comment_add,hd_comment_edit,hd_comment_del} from "./api";
+import { useUserStore } from "@/stores/user";
+const { real_name } = useUserStore();
+export default {
+  name: "index",
+  data() {
+    return {
+      xdb_id: '',
+      ac_detail:{},
+      commentList:[],
+      loading: false,
+      commentDialogVisible: false,
+      commentForm:{
+        xdh_id:'',
+        xdh_plnr:''
+      },
+      rules:{
+        xdh_plnr: [
+          {required: true, message: '请输入评价描述', trigger: 'blur'}
+        ],
+      },
+      isEdit: false
+    }
+  },
+  methods:{
+    getAcDetail() {
+      let data = {
+        xdb_id:this.xdb_id
+      }
+      hd_detail(data).then(res=>{
+        if(res.code == 1) {
+          this.ac_detail = res.data.one_info;
+        }
+      })
+    },
+    getCommentList() {
+      let data = {
+        xdb_id:this.xdb_id,
+        page:'1',
+        limit:'999'
+      }
+      hd_comment_list(data).then(res =>{
+        if(res.code == 1) {
+          this.commentList = res.data.page_data;
+        }
+      })
+    },
+    newComment() {
+      this.isEdit = false;
+      this.commentForm.xdh_plnr = '';
+      this.commentDialogVisible = true;
+    },
+    editComment(item) {
+      this.isEdit = true;
+      this.commentForm.xdh_id = item.xdh_id;
+      this.commentForm.xdh_plnr = item.xdh_plnr;
+      this.commentDialogVisible = true;
+    },
+    commentFormSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          let data = {
+            xdh_plr:real_name,
+            xdh_plnr:this.commentForm.xdh_plnr,
+            xdb_id: this.xdb_id
+          }
+          if(!this.isEdit) {
+            hd_comment_add(data).then(res =>{
+              this.loading = false;
+              if(res.code == 1) {
+                this.$message({
+                  message: "评论成功!",
+                  type: "success",
+                });
+                this.commentDialogVisible = false;
+                this.getCommentList();
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: "error",
+                });
+              }
+            });
+          } else {
+            data.xdh_id = this.commentForm.xdh_id;
+            hd_comment_edit(data).then(res =>{
+              this.loading = false
+              if(res.code == 1) {
+                this.$message({
+                  message: "评论编辑成功!",
+                  type: "success",
+                });
+                this.commentDialogVisible = false;
+                this.getCommentList();
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: "error",
+                });
+              }
+            })
+          }
+
+        }
+      })
+    },
+    delComment(item) {
+      this.$confirm('确定要删除评论?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let data = {
+          xdh_id:item.xdh_id
+        }
+        hd_comment_del(data).then(res =>{
+          if(res.code == 1) {
+            this.$message({
+              message: "评论删除成功!",
+              type: "success",
+            });
+            this.getCommentList();
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error",
+            });
+          }
+        })
+
+      }).catch(() => {});
+    }
+  },
+  mounted() {
+    if(this.$route.params.id != '') {
+      this.xdb_id = this.$route.params.id;
+      this.getAcDetail();
+      this.getCommentList();
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.comment-list{
+  width: 100%;
+  li{
+    width: 100%;
+    border-bottom: 1px solid #eee;
+    padding: 15px 0;
+  }
+}
+.icon-edit,
+.icon-del{
+  width: 18px;
+  height: 18px;
+}
+.icon-edit{
+  background: url("./src/assets/icon-edit.png") center no-repeat;
+  background-size: 18px 18px;
+}
+.icon-del{
+  background: url("./src/assets/icon-del.png") center no-repeat;
+  background-size: 18px 18px;
+}
+</style>

+ 170 - 18
src/views/bjhd/hdlb/index.vue

@@ -27,10 +27,10 @@
     </el-form>
     <div>
       <el-button type="primary" @click="createNew">发起活动</el-button>
-      <el-button type="primary">导出</el-button>
-      <el-button type="danger" :disabled="multipleSelection.length == 0">删除</el-button>
+      <el-button type="primary" @click="exportAc">导出</el-button>
+      <el-button type="danger" :disabled="multipleSelection.length == 0" @click="delAc">删除</el-button>
     </div>
-    <el-table :data="secondTable" v-loading="loading" tooltip-effect="dark" class="mt20" style="width: 100%">
+    <el-table :data="secondTable" v-loading="loading" tooltip-effect="dark" class="mt20" style="width: 100%" @selection-change="handleSelectionChange">
       <el-table-column
           type="selection"
           align="center"
@@ -47,7 +47,7 @@
           width="auto"
       >
         <template slot-scope="scope">
-          <h3 class="font-size-14 color-2 hand">{{ scope.row.xdb_hdmc }}</h3>
+          <h3 class="font-size-14 color-2 hand" @click="toDetail(scope.row.xdb_id)">{{ scope.row.xdb_hdmc }}</h3>
         </template>
       </el-table-column>
       <el-table-column
@@ -76,7 +76,7 @@
           label="活动状态"
           width="120">
         <template slot-scope="scope">
-          <span v-if="scope.row.xdb_hdzt_option_k == 1" class="text-grey">未审核</span>
+          <span v-if="scope.row.xdb_hdzt_option_k == 0 || scope.row.xdb_hdzt_option_k == 1" class="text-grey">未审核</span>
           <span v-if="scope.row.xdb_hdzt_option_k == 2" class="text-green">进行中</span>
           <span v-if="scope.row.xdb_hdzt_option_k == 3" class="text-green">已结束</span>
         </template>
@@ -90,12 +90,13 @@
         <template slot-scope="scope">
           <el-button
               type="text"
-              @click=""
+              @click="signDialogShow(scope.row)"
           >报名
           </el-button>
           <el-button
+              :disabled="scope.row.xdb_hdzt_option_k > 1"
               type="text"
-              @click=""
+              @click="auditAc(scope.row)"
           >审核
           </el-button>
           <el-button
@@ -105,8 +106,8 @@
           </el-button>
           <el-button
               type="text"
-              @click=""
-          >评价
+              @click="toDetail(scope.row.xdb_id)"
+          >详情
           </el-button>
         </template>
       </el-table-column>
@@ -124,7 +125,7 @@
           @current-change="handleCurrentChange"
       ></el-pagination>
     </footer>
-    <el-dialog :title="dialogTitle" :visible.sync="newDialogShow" width="550px" v-loading="loading">
+    <el-dialog :title="dialogTitle" :visible.sync="newDialogShow" width="750px" v-loading="loading">
       <el-form :model="newForm" ref="newForm" :rules="rules" label-width="100px">
         <el-form-item label="班级:" prop="xdb_bjmc">
           <el-input
@@ -167,12 +168,12 @@
           ></el-input>
         </el-form-item>
         <el-form-item label="活动描述:" prop="xdb_hdms">
-          <el-input
-              type="textarea"
-              :rows="2"
-              placeholder="请输入活动描述"
-              v-model="newForm.xdb_hdms">
-          </el-input>
+          <Tinymce
+              v-if="newDialogShow"
+              v-model="newForm.xdb_hdms"
+              :height="300"
+              :key="timestamp"
+          ></Tinymce>
         </el-form-item>
       </el-form>
       <div slot="footer">
@@ -180,11 +181,39 @@
         <el-button type="primary" @click="newFormSubmit('newForm')">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog title="报名" :visible.sync="signDialogVisible" width="550px" v-loading="loading">
+      <el-form :model="signForm" ref="signForm" :rules="rules" label-width="100px">
+        <el-form-item label="学生姓名:" prop="xdh_xsxm">
+          <el-input
+              v-model="signForm.xdh_xsxm"
+              placeholder="请输入学生姓名"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="学生学号:" prop="xdh_xsxh">
+          <el-input
+              v-model="signForm.xdh_xsxh"
+              placeholder="请输入学生学号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="手机号码:" prop="xdh_sjhm">
+          <el-input
+              v-model="signForm.xdh_sjhm"
+              placeholder="请输入手机号码"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="signDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="signFormSubmit('signForm')">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import {hd_list, hdlb_list,hd_add,hd_edit} from "./api";
+import {hd_list, hdlb_list,hd_add,hd_edit,hd_del,sign_add} from "./api";
+import Tinymce from "@/components/Tinymce/index.vue";
+import FileUpload from "@/components/FileUpload/index.vue";
 import { useUserStore } from "@/stores/user";
 const { token,real_name } = useUserStore();
 export default {
@@ -254,11 +283,33 @@ export default {
         ],
         xdb_shr:[
           {required: true, message: '请输入审核人', trigger: 'blur'}
-        ]
+        ],
+        xdh_xsxm:[
+          {required: true, message: '请输入学生姓名', trigger: 'blur'}
+        ],
+        xdh_xsxh:[
+          {required: true, message: '请输入学生学号', trigger: 'blur'}
+        ],
+        xdh_sjhm:[
+          {required: true, message: '请输入手机号码', trigger: 'blur'}
+        ],
       },
       newEdit: false,
+      signDialogVisible: false,
+      signForm:{
+        xdh_xsxm:'',
+        xdh_xsxh:'',
+        xdh_sjhm:'',
+        xdb_id:'',
+        xdb_hdmc:''
+      },
+      timestamp: Date.now(),
     }
   },
+  components: {
+    Tinymce,
+    FileUpload,
+  },
   methods: {
     getAllActivityType() {
       let data = {
@@ -390,6 +441,107 @@ export default {
            }
         }
       })
+    },
+    auditAc(item) {
+      this.loading = true;
+      let data = {
+        xdb_id:item.xdb_id,
+        xdb_hdzt:'2'
+      }
+      hd_edit(data).then(res =>{
+        this.loading = false
+        if(res.code == 1) {
+          this.$message({
+            message: "审核成功!",
+            type: "success",
+          });
+          this.loading = false;
+          this.getHdList();
+        } else {
+          this.$message({
+            message: res.msg,
+            type: "error",
+          });
+        }
+      })
+    },
+    signDialogShow(item) {
+       this.signForm.xdb_id = item.xdb_id;
+       this.signForm.xdb_hdmc = item.xdb_hdmc;
+       this.signForm.xdh_xsxm = '';
+       this.signForm.xdh_xsxh = '';
+       this.signForm.xdh_sjhm = '';
+       this.signDialogVisible = true;
+    },
+    signFormSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          let data = {
+            xdh_xsxm: this.signForm.xdh_xsxm,
+            xdh_xsxh: this.signForm.xdh_xsxh,
+            xdh_sjhm: this.signForm.xdh_sjhm,
+            xdb_id: this.signForm.xdb_id,
+            xdb_hdmc: this.signForm.xdb_hdmc
+          }
+          sign_add(data).then(res =>{
+            this.loading = false;
+            if(res.code == 1) {
+              this.$message({
+                message: "活动报名成功!",
+                type: "success",
+              });
+              this.signDialogVisible = false;
+              this.getHdList();
+            } else {
+              this.$message({
+                message: res.msg,
+                type: "error",
+              });
+            }
+          })
+        }
+      })
+    },
+    delAc() {
+      let del_arr = [];
+      for(let i in this.multipleSelection) {
+        del_arr.push(this.multipleSelection[i].xdb_id)
+      }
+      this.$confirm('确定要删除这些活动?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let data = {
+          xdb_id: del_arr
+        }
+        hd_del(data).then(res =>{
+          if(res.code == 1) {
+            this.$message({
+              message: "活动删除成功!",
+              type: "success",
+            });
+            this.getHdList();
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error",
+            });
+          }
+        })
+
+      }).catch(() => {});
+    },
+    exportAc() {
+      let link =
+          window.globalVariables.api +
+          "/xddy/dygl_bjhd/index?api=xls&page=1&limit=10000&token=" +
+          token;
+      window.open(link, "_self");
+    },
+    toDetail(id) {
+      this.$router.push({ name: 'bjhd_hdlb_hdxq', params: { id: id } })
     }
   },
   mounted() {