sunlupeng 1 ano atrás
pai
commit
e7df65e2c5
2 arquivos alterados com 87 adições e 0 exclusões
  1. 1 0
      src/router/index.js
  2. 86 0
      src/views/content/yearLottoNotice.vue

+ 1 - 0
src/router/index.js

@@ -375,6 +375,7 @@ export const asyncRouterMap = [
       icon: 'language'
     },
     children: [
+      { path: 'yearLottoNotice', component: _import('content/yearLottoNotice'), name: 'yearLottoNotice', meta: { title: '年会抽奖规则', noCache: true }},
       { path: 'bannerManage', component: _import('content/banner'), name: 'bannerManage', meta: { title: 'Banner管理', noCache: true }},
       { path: 'schoolInfo', component: _import('content/index'), name: 'schoolInfo', meta: { title: '公司动态', noCache: true }},
       { path: 'newsCenter', component: _import('content/newsCenter'), name: 'newsCenter', meta: { title: '新闻中心', noCache: true }},

+ 86 - 0
src/views/content/yearLottoNotice.vue

@@ -0,0 +1,86 @@
+<template>
+    <div class="app-container calendar-list-container" style="padding-bottom: 80px;">
+        <el-form v-loading="loading" :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="100px" style='width: 85%; margin-left:50px;'>
+         <el-form-item  label="标题" prop="title">
+              <el-input v-model="dataForm.title"></el-input>
+            </el-form-item>
+            <el-form-item
+              style="width: 100%"
+              label="内容"
+              prop="content"
+            >
+              <tinymce v-model="dataForm.content" ref="tinymce"></tinymce>
+            </el-form-item>
+  
+        </el-form>
+        <el-button style="float: right;margin-right: 120px;" type="primary" @click="updateData">修改</el-button>
+    
+        
+    </div>
+   
+  </template>
+  
+  <style>
+    
+  </style>
+  
+  
+  <script>
+   import {goodsExchangeRulesDetail, updateGoodsExchangeRules} from "@/api/goodsManage";
+    import waves from "@/directive/waves"; // 水波纹指令
+    import Tinymce from '@/components/Tinymce'
+    export default {
+    name: 'goodsExchangeRules',
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+      return {
+        dataForm: {
+          type:'yearLottoNotice',
+          title: '',
+          content: "",
+        },
+        loading: false,
+        rules: {
+            title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
+            content: [{ required: true, message: "积分规则不能为空", trigger: "blur" }],
+        },
+      }
+    },
+    created() {
+        this.getDetail();
+    },
+    methods: {
+    
+      getDetail() {
+          this.loading = true
+          goodsExchangeRulesDetail({noticeType:'yearLottoNotice '}).then(response => {
+            this.dataForm.title = response.data.data.title;
+            this.dataForm.content = response.data.data.content;
+            this.dataForm.id = response.data.data.id;
+            this.loading = false;
+          }).catch(() => {})
+      },
+      updateData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true;
+            updateGoodsExchangeRules(this.dataForm).then(() => {
+              this.loading = false;
+                this.$notify({
+                  title: '成功',
+                  message: '更新成功',
+                  type: 'success',
+                  duration: 2000
+                })
+                this.getDetail();
+              }) 
+          }
+        })
+      },
+  
+      
+    }
+  }
+  </script>
+