mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
128 lines
5.2 KiB
Vue
128 lines
5.2 KiB
Vue
<template>
|
|
<div class="row">
|
|
<div class="col">
|
|
<loading-component style="height: 50px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading(section)"></loading-component>
|
|
<div class="row" v-show="!$store.getters.isLoading(section)">
|
|
<div class="col">
|
|
<div class="row m-b-20">
|
|
<div class="col">
|
|
<h6 class="all-caps m-b-5 bold no-margin">{{this.data?"Update":"Create"}} Announcement</h6>
|
|
</div>
|
|
</div>
|
|
<div class="row m-b-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
|
<div class="col">
|
|
<small class="bold fs-14 scalled scalled text-danger">{{error}}</small>
|
|
</div>
|
|
</div>
|
|
<div class="row m-b-10">
|
|
<div class="col">
|
|
<validation-wrapper-component :validator="$v.parameters.title">
|
|
<label>Title</label>
|
|
<input type="text" class="form-control" v-model="parameters.title">
|
|
</validation-wrapper-component>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col">
|
|
<validation-wrapper-component :validator="$v.parameters.description">
|
|
<label>Message</label>
|
|
<textarea class="form-control h-75" v-model="parameters.description" rows="20"></textarea>
|
|
</validation-wrapper-component>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row m-b-20">
|
|
<div class="col-6">
|
|
<validation-wrapper-component :validator="$v.parameters.starting_on">
|
|
<label>Start Date</label>
|
|
<input type="date" v-model="parameters.starting_on">
|
|
</validation-wrapper-component>
|
|
</div>
|
|
<div class="col-6">
|
|
<validation-wrapper-component :validator="$v.parameters.ending_on">
|
|
<label>End Date</label>
|
|
<input type="date" v-model="parameters.ending_on">
|
|
</validation-wrapper-component>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col p-r-5">
|
|
<div class="btn btn-sm btn-default bg-master-lightest btn-block b-rad-none" :data-dismiss="closable ? 'modal' : ''" @click="$emit('close')">Cancel</div>
|
|
</div>
|
|
<div class="col p-l-5">
|
|
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submitForm()">{{this.data?"Update":"Create"}}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
|
import { required, requiredIf } from "vuelidate/lib/validators";
|
|
export default {
|
|
props : {
|
|
closable: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
country_id: {
|
|
type: Number,
|
|
default: 1
|
|
}
|
|
},
|
|
data(){
|
|
return {
|
|
parameters: {
|
|
starting_on:'',
|
|
ending_on:'',
|
|
// segment_id: '',
|
|
title: '',
|
|
description: '',
|
|
}
|
|
}
|
|
},
|
|
validations: {
|
|
parameters: {
|
|
title: {
|
|
required
|
|
},
|
|
description: {
|
|
required
|
|
},
|
|
// segment_id: {
|
|
// required
|
|
// },
|
|
starting_on:{
|
|
required
|
|
},
|
|
ending_on:{
|
|
required
|
|
},
|
|
}
|
|
},
|
|
computed:{
|
|
|
|
},
|
|
created(){
|
|
console.log("lado form");
|
|
},
|
|
methods: {
|
|
submitForm(){
|
|
//this.submit(route('api.announcement.create'), 'post', this.section, true, false);
|
|
this.submit((this.data ? this.route('api.announcement.update', this.data.id) : this.route('api.announcement.create')), (this.data ? 'put' : 'post'), this.section, true, false)
|
|
},
|
|
// successHandler(response){
|
|
// this.closeModal();
|
|
// //this.formHandler();
|
|
// this.resetForm();
|
|
// },
|
|
// errorHandler(error){
|
|
// this.formHandler(error.message);
|
|
// }
|
|
},
|
|
mixins: [ModalFormHandler],
|
|
|
|
}
|
|
</script> |