|
@@ -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>
|
|
|
+
|