mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-22 13:54:17 +00:00
Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into too/registerpage
# Conflicts: # package-lock.json # vendor/composer/autoload_static.php
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
<el-popover placement="top" width="300" v-model="UpdateRatePopoverVisible">
|
||||
<div align="center">
|
||||
<p>Today's Rate</p>
|
||||
<p>X1 : Cash: {{x1_cash}} Cheque: {{x1_cheque}} BA: {{x1_ba}}</p>
|
||||
<p>X2 : Cash: {{x2_cash}} Cheque: {{x2_cheque}} BA: {{x2_ba}}</p>
|
||||
<p>X1 : Cash: {{rate.x1_cash}} Cheque: {{rate.x1_cheque}} BA: {{rate.x1_ba}}</p>
|
||||
<p>X2 : Cash: {{rate.x2_cash}} Cheque: {{rate.x2_cheque}} BA: {{rate.x2_ba}}</p>
|
||||
</div>
|
||||
<div style="text-align: center; margin: 0">
|
||||
<el-button type="primary" size="mini" @click="UpdateRatePopoverVisible = false; UpdateRateDialogVisible = true">Update rate</el-button>
|
||||
@@ -32,30 +32,26 @@
|
||||
<!-- <li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.upload-supplier-bank-slip' }" class="nav-link">{{ $t('Upload Supplier Bank Slip to System') }}</router-link></li> -->
|
||||
|
||||
</ul>
|
||||
<!-- update rate dialog start -->
|
||||
<el-dialog align="center" :visible.sync="UpdateRateDialogVisible" width="900px">
|
||||
<el-form :inline="true" align="center" ref="rateForm" :model="rateForm" :rules="rules">
|
||||
|
||||
<!-- update rate dialog -->
|
||||
<el-dialog align="center" :visible.sync="UpdateRateDialogVisible">
|
||||
<el-form :inline="true" align="center">
|
||||
<el-form-item>X1 :
|
||||
Cash : <el-input style=width:10% ></el-input>
|
||||
Cheque : <el-input style=width:10%></el-input>
|
||||
BA : <el-input style=width:10%></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form :inline="true" align="center">
|
||||
<el-form-item>X2 :
|
||||
Cash : <el-input style=width:10% ></el-input>
|
||||
Cheque : <el-input style=width:10%></el-input>
|
||||
BA : <el-input style=width:10%></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="x1_cash" >X1: Cash : <el-input v-model.number="rateForm.x1_cash" style=width:25% ></el-input></el-form-item>
|
||||
<el-form-item prop="x1_cheque" >Cheque : <el-input v-model.number="rateForm.x1_cheque" style=width:25%></el-input></el-form-item>
|
||||
<el-form-item prop="x1_ba">BA : <el-input v-model.number="rateForm.x1_ba" style=width:25%></el-input></el-form-item>
|
||||
<br>
|
||||
<el-form-item prop="x2_cash" >X2: Cash : <el-input v-model.number="rateForm.x2_cash" style=width:25% ></el-input></el-form-item>
|
||||
<el-form-item prop="x2_cheque" >Cheque : <el-input v-model.number="rateForm.x2_cheque" style=width:25%></el-input></el-form-item>
|
||||
<el-form-item prop="x2_ba" >BA : <el-input v-model.number="rateForm.x2_ba" style=width:25%></el-input></el-form-item>
|
||||
</el-form>
|
||||
<br>
|
||||
<div align="center">
|
||||
<el-button type="text" @click="UpdateRateDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="UpdateRateDialogVisible = false; DoneUpdateRateDialogVisible = true">Save</el-button>
|
||||
<el-button type="primary" @click="updateRate('rateForm'); UpdateRateDialogVisible = false; DoneUpdateRateDialogVisible = true" >Save</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- update rate dialog end -->
|
||||
</el-dialog>
|
||||
<!-- update rate dialog done -->
|
||||
|
||||
<el-dialog align="center" :visible.sync="DoneUpdateRateDialogVisible" width="30%">
|
||||
<span>Rate Successfully Updated</span><br><br>
|
||||
<div align="center">
|
||||
@@ -69,6 +65,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { loadMessages } from '~/plugins/i18n'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -76,13 +73,49 @@ export default {
|
||||
UpdateRatePopoverVisible: false,
|
||||
UpdateRateDialogVisible: false,
|
||||
DoneUpdateRateDialogVisible: false,
|
||||
x1_cash: '1.56',
|
||||
x1_cheque: '1.63',
|
||||
x1_ba: '1.66',
|
||||
x2_cash: '1.61',
|
||||
x2_cheque: '1.70',
|
||||
x2_ba: '1.72',
|
||||
};
|
||||
rate: {
|
||||
x1_ba: null,
|
||||
x1_cheque: null,
|
||||
x1_cash: null,
|
||||
x2_ba: null,
|
||||
x2_cash: null,
|
||||
x2_cheque: null,
|
||||
},
|
||||
rateForm: {
|
||||
x1_cash: '',
|
||||
x1_cheque: '',
|
||||
x1_ba: '',
|
||||
x1_cash: '',
|
||||
x1_cheque: '',
|
||||
x1_ba: '',
|
||||
},
|
||||
rules: {
|
||||
x1_cash: [
|
||||
{ required: true, message: 'Please input rate for X1 Cash', trigger: 'change'},
|
||||
{ type: 'number', message: 'Rate must be a number'}
|
||||
],
|
||||
x1_cheque: [
|
||||
{ required: true, message: 'Please input rate for X1 Cheque', trigger: 'change'},
|
||||
{ type: 'number', message: 'Rate must be a number'}
|
||||
],
|
||||
x1_ba: [
|
||||
{ required: true, message: 'Please input rate for X1 BA', trigger: 'change'},
|
||||
{ type: 'number', message: 'Rate must be a number'}
|
||||
],
|
||||
x2_cash: [
|
||||
{ required: true, message: 'Please input rate for X2 Cash', trigger: 'change'},
|
||||
{ type: 'number', message: 'Rate must be a number'}
|
||||
],
|
||||
x2_cheque: [
|
||||
{ required: true, message: 'Please input rate for X2 Cheque', trigger: 'change'},
|
||||
{ type: 'number', message: 'Rate must be a number'}
|
||||
],
|
||||
x2_ba: [
|
||||
{ required: true, message: 'Please input rate for X2 BA', trigger: 'change'},
|
||||
{ type: 'number', message: 'Rate must be a number'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: mapGetters({
|
||||
locale: 'lang/locale',
|
||||
@@ -91,6 +124,10 @@ export default {
|
||||
role: 'auth/role'
|
||||
}),
|
||||
|
||||
mounted () {
|
||||
this.getRate()
|
||||
},
|
||||
|
||||
methods: {
|
||||
setLocale (locale) {
|
||||
if (this.$i18n.locale !== locale) {
|
||||
@@ -98,7 +135,88 @@ export default {
|
||||
|
||||
this.$store.dispatch('lang/setLocale', { locale })
|
||||
}
|
||||
}
|
||||
},
|
||||
getRate() {
|
||||
let $this = this
|
||||
axios.get('api/rate').then(response => {
|
||||
this.rate = response.data
|
||||
console.log(this.rate)
|
||||
})
|
||||
},
|
||||
|
||||
createRate: function () {
|
||||
this.loading = true,
|
||||
this.dialogFormVisible1 = true
|
||||
let newRate = {
|
||||
x1_cash: this.rateForm.x1_cash,
|
||||
x1_cheque: this.rateForm.x1_cheque,
|
||||
x1_ba: this.rateForm.x1_ba,
|
||||
x2_cash: this.rateForm.x2_cash,
|
||||
x2_cheque: this.rateForm.x2_cheque,
|
||||
x2_ba: this.rateForm.x2_ba
|
||||
}
|
||||
|
||||
console.log(newRate)
|
||||
axios.post('api/update-rate', newRate)
|
||||
.then((response) => {
|
||||
this.loading = false
|
||||
this.rate = response.data
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Error : All rate must be inserted',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
updateRate(formName) {
|
||||
this.loading = true
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let newRate = {
|
||||
x1_cash: this.rateForm.x1_cash,
|
||||
x1_cheque: this.rateForm.x1_cheque,
|
||||
x1_ba: this.rateForm.x1_ba,
|
||||
x2_cash: this.rateForm.x2_cash,
|
||||
x2_cheque: this.rateForm.x2_cheque,
|
||||
x2_ba: this.rateForm.x2_ba,
|
||||
}
|
||||
|
||||
axios.post('/api/update-rate', newRate)
|
||||
.then((response) => {
|
||||
this.loading = false
|
||||
this.rate = response.data
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Error : All rate must be inserted',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.loading = false
|
||||
DoneUpdateRateDialogVisible = false
|
||||
UpdateRateDialogVisible = true
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please fill the form',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -131,7 +131,7 @@ var client = axios.create({
|
||||
methods:{
|
||||
CreateSupplier : function(){
|
||||
this.AddNewSupplierdialogVisible = false;
|
||||
client.post('api/setting-supplier', this.supplierForm)
|
||||
axios.post('/api/setting-supplier', this.supplierForm)
|
||||
.then((response) => {
|
||||
this.DoneAddSupplierdialogVisible = true;
|
||||
this.UpdateTableData();
|
||||
@@ -147,8 +147,9 @@ var client = axios.create({
|
||||
});
|
||||
},
|
||||
UpdateTableData : function(){
|
||||
client.get('api/setting-supplier', this.supplierForm)
|
||||
axios.get('/api/setting-supplier', this.supplierForm)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -163,7 +164,7 @@ var client = axios.create({
|
||||
},
|
||||
DeleteSupplier : function(supplier_id){
|
||||
this.DeleteSupplierdialogVisible = true;
|
||||
client.delete('api/setting-supplier/' + supplier_id)
|
||||
axios.delete('/api/setting-supplier/' + supplier_id)
|
||||
.then((response) => {
|
||||
this.UpdateTableData();
|
||||
})
|
||||
@@ -181,7 +182,7 @@ var client = axios.create({
|
||||
this.EditSupplierdialogVisible = false;
|
||||
this.DoneUpdateSupplierdialogVisible = true;
|
||||
|
||||
client.put('api/setting-supplier/' + this.currentEdit, this.supplierForm)
|
||||
axios.put('/api/setting-supplier/' + this.currentEdit, this.supplierForm)
|
||||
.then((response) => {
|
||||
this.UpdateTableData();
|
||||
})
|
||||
|
||||
Vendored
-4738
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user