123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <template>
- <div>
- <common @asynCallBack="asynCallBack"></common>
- <top-header :pageTitle="pageTitle"></top-header>
- <div class="mui-content margin60">
- <form class="mui-input-group vongi-send">
- <div class="mui-input-row">
- <label>通知标题</label>
- <input type="text" v-model="addForm.title" placeholder="请输入标题">
- </div>
- <textarea-check v-model="addForm.content" :max="1000" :placeholder="'请填写内容,最多可输入1000字'"></textarea-check>
- </form>
- </div>
- <div class="fyy-footer">
- <div class="bindfyy-btn">
- <button type="submit" class="mui-btn mui-btn-primary " @click="submit">发送</button></div>
- </div>
- <loading :visible="isLoading"></loading>
- </div>
- </template>
- <script>
- import * as API_Notice from '@/apis/Common/notice'
- import Common from '$project/components/Common.vue'
- import Loading from '$project/components/Loading.vue'
- import TopHeader from '$project/components/TopHeader.vue'
- import TextareaCheck from '$project/components/TextareaCheck.vue'
- import {
- mapGetters,
- mapMutations
- } from 'vuex'
- export default {
- name: 'CommonNoticeSend',
- components: {
- Common,
- Loading,
- TopHeader,
- TextareaCheck
- },
- data() {
- return {
- pageTitle: '发送通知',
- isLoading: false,
- addForm: {
- title: '',
- content: '',
- },
- detail: {},
- }
- },
- created() {
- },
- methods: {
- //表单校验
- checkForm() {
- if (!this.addForm.title) {
- mui.toast('请输入通知标题');
- return false;
- } else if (!this.addForm.content) {
- mui.toast('请输入通知内容');
- return false;
- } else {
- return true;
- }
- },
- //提交
- submit() {
- if (this.checkForm()) {
- this.isLoading = true;
- API_Notice.sendMessage(this.addForm).then(response => {
- this.isLoading = false;
- mui.toast("发送成功");
- //跳转首页
- this.$router.push({
- name: 'Master',
- query: {}
- })
- }).catch(error => {
- this.isLoading = false;
- mui.toast(error);
- })
- }
- },
- asynCallBack() {
- },
- },
- mounted() {
- },
- destroyed() {},
- computed: {
- }
- }
- </script>
- <style scoped src="$project/assets/css/xpwyfyy.css"></style>
- <style src="$project/assets/css/iconfont.css"></style>
- <style scoped>
- </style>
|