mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
update
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
<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-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
||||
<div class="col">
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.account_no">
|
||||
<label>ALIPAY Account No.</label>
|
||||
<input type="text" class="form-control" v-model="parameters.account_no" :disabled="disabled">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.holder_name">
|
||||
<label>ALIPAY Account Holder Name</label>
|
||||
<input type="text" class="form-control" v-model="parameters.holder_name" @keyup="onlyChinese($event)" :disabled="disabled">
|
||||
</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')">{{disabled ? 'Change Recipient Account' : 'Cancel'}}</div>
|
||||
</div>
|
||||
<div class="col p-l-5" v-if="!disabled">
|
||||
<button class="btn btn-sm btn-success btn-block b-rad-none" @click="submitForm()">Add Account</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import FormHandler from '../../../general/mixins/formHandler';
|
||||
import { required, requiredIf } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
props : {
|
||||
company_id: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
closable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
country_id: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
serviceType: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
parameters: {
|
||||
company_id: this.company_id,
|
||||
account_type: 4,
|
||||
reference: '',
|
||||
bank_name: '-',
|
||||
holder_name: '',
|
||||
account_no: '',
|
||||
bank_branch: '',
|
||||
country_id: this.country_id,
|
||||
},
|
||||
englishTextWarning: false,
|
||||
confirmProceedEnglishText: false,
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
holder_name: {
|
||||
required
|
||||
},
|
||||
account_no: {
|
||||
required
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm(){
|
||||
this.parameters.account_type = 4;
|
||||
this.parameters.bank_name = '-';
|
||||
this.submit(route('api.bank.create'), 'post', this.section, true, false);
|
||||
},
|
||||
successHandler(response){
|
||||
this.type !== 2 ? this.closeModal() : this.$emit('createdBank', response.payload.data);
|
||||
this.formHandler();
|
||||
this.resetForm();
|
||||
},
|
||||
errorHandler(error){
|
||||
this.formHandler(error.message);
|
||||
},
|
||||
onlyChinese(event){
|
||||
let value = event.target.value,
|
||||
regex = /^[^~`!@#$%^&*()_+=[\]\{}|;':",.\/<>?a-zA-Z0-9-]+$/;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
this.englishTextWarning = false;
|
||||
if(regex.test(value) === false){
|
||||
this.englishTextWarning = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
mixins: [FormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user