fix timezone issue. Add refresh rate button. Add success message for all refresh button. Fix typo in user step 4

This commit is contained in:
weiweitoo
2018-07-18 15:38:06 +08:00
parent a35c07a794
commit 812040a433
9 changed files with 73 additions and 45 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ return [
|
*/
'timezone' => 'UTC',
'timezone' => 'Asia/Singapore',
/*
|--------------------------------------------------------------------------
@@ -34,20 +34,20 @@
</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">
<el-form :inline="true" align="center" ref="rate" :model="rate" :rules="rules">
<el-form-item prop="x1_cash" >X1: &nbsp;&nbsp;&nbsp;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>
<el-form-item prop="x1_cash" >X1: &nbsp;&nbsp;&nbsp;Cash : <el-input v-model.number="rate.x1_cash" style=width:25% ></el-input></el-form-item>
<el-form-item prop="x1_cheque" >Cheque : <el-input v-model.number="rate.x1_cheque" style=width:25%></el-input></el-form-item>
<el-form-item prop="x1_ba">BA : <el-input v-model.number="rate.x1_ba" style=width:25%></el-input></el-form-item>
<br>
<el-form-item prop="x2_cash" >X2: &nbsp;&nbsp;&nbsp;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-item prop="x2_cash" >X2: &nbsp;&nbsp;&nbsp;Cash : <el-input v-model.number="rate.x2_cash" style=width:25% ></el-input></el-form-item>
<el-form-item prop="x2_cheque" >Cheque : <el-input v-model.number="rate.x2_cheque" style=width:25%></el-input></el-form-item>
<el-form-item prop="x2_ba" >BA : <el-input v-model.number="rate.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="updateRate('rateForm'); UpdateRateDialogVisible = false; DoneUpdateRateDialogVisible = true" >Save</el-button>
<el-button type="primary" @click="updateRate('rate'); UpdateRateDialogVisible = false; DoneUpdateRateDialogVisible = true" >Save</el-button>
</div>
</el-dialog>
<!-- update rate dialog done -->
@@ -74,21 +74,13 @@ export default {
UpdateRateDialogVisible: false,
DoneUpdateRateDialogVisible: false,
rate: {
x1_ba: null,
x1_cheque: null,
x1_cash: null,
x2_ba: null,
x2_cash: null,
x2_cheque: null,
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'},
@@ -123,11 +115,9 @@ export default {
user: 'auth/user',
role: 'auth/role'
}),
mounted () {
this.getRate()
mounted () {
this.getRate();
},
methods: {
setLocale (locale) {
if (this.$i18n.locale !== locale) {
@@ -140,10 +130,9 @@ export default {
let $this = this
axios.get('/api/rate').then(response => {
this.rate = response.data
console.log(this.rate)
console.log(this.rate);
})
},
createRate: function () {
this.loading = true,
this.dialogFormVisible1 = true
@@ -179,12 +168,12 @@ export default {
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,
x1_cash: this.rate.x1_cash,
x1_cheque: this.rate.x1_cheque,
x1_ba: this.rate.x1_ba,
x2_cash: this.rate.x2_cash,
x2_cheque: this.rate.x2_cheque,
x2_ba: this.rate.x2_ba,
}
axios.post('/api/update-rate', newRate)
@@ -5,7 +5,7 @@
<div align="center">
<h4 style="margin-top:5%;"></h4>
<br>
<h5> Supplier Report</h5>
<h5>Supplier Report</h5>
<br>
<!-- <el-button type="primary" @click="$router.go(-1)">Go Back</el-button> -->
</div>
@@ -206,6 +206,7 @@
<!-- upload image -->
<el-upload class="upload-demo" :action="'/api/booking/' + booking_id + '/upload-china-bankslip'" :on-preview="handlePreview"
accept=".jpeg, .jpg, .png, .bmp, .doc, .docx, .xls, .xlsx, .pdf"
:on-remove="handleRemove" :multiple="false" list-type="picture">
<el-button size="small" type="primary">Click to upload</el-button>
<div slot="tip" class="el-upload__tip">jpg/png files with a size less than 3 MB</div>
@@ -371,7 +372,6 @@
duration: 10000
})
})
} else {
this.loading_btn = false
this.$message({
@@ -193,6 +193,7 @@
<el-upload :action="'/api/booking/' + booking_id + '/upload-invoice'" :on-exceed="handleExceed" :on-preview="handlePreview"
:on-remove="handleRemove"
:on-error="uploadError"
accept=".jpeg, .jpg, .png, .bmp, .doc, .docx, .xls, .xlsx, .pdf"
class="upload-demo"
drag
multiple>
+13 -2
View File
@@ -62,14 +62,25 @@ export default {
}
},
mounted () {
this.RefreshBooking()
this.getBooking()
},
methods: {
getBooking() {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data
})
},
RefreshBooking() {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data
console.log(this.bookingTable);
this.$message({
showClose: true,
message: 'Booking is updated',
type: 'success',
duration: 5000
})
})
},
filterTag (value, row) {
@@ -3,7 +3,7 @@
<progress-track v-model="status"/>
<div align="center">
<h4 style="margin-top:5%;">Bankin Slip Aprroved <br><br> Transfer In Progress</h4>
<h4 style="margin-top:5%;">Bankin Slip Approved <br><br> Transfer In Progress</h4>
<br>
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
</div>
@@ -57,6 +57,7 @@
<!-- upload image -->
<el-upload :action="'/api/booking/' + booking_id + '/upload-user-bankslip'" :on-preview="handlePictureCardPreview" :on-remove="handleRemove"
accept=".jpeg, .jpg, .png, .bmp, .doc, .docx, .xls, .xlsx, .pdf"
list-type="picture-card" align="center">
<i class="el-icon-plus" />
</el-upload>
+31 -5
View File
@@ -23,6 +23,10 @@
</el-col>
</el-row>
<!-- Input-Amount-end -->
<div align="right">
<el-button icon="el-icon-refresh" type="primary" size="mini" @click="refreshRate()">Refresh Rate</el-button></div>
<hr>
<!-- Rate-Display -->
<br>
@@ -388,16 +392,15 @@ export default {
}
},
mounted () {
this.getBooking()
this.RefreshBooking()
this.getRate()
this.getBooking();
this.initBooking();
this.getRate();
},
methods: {
getRate(){
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data.data
$this.makePagination(response.data)
})
},
@@ -405,13 +408,36 @@ export default {
let $this = this
axios.get('api/rate').then(response => {
this.rate = response.data
console.log(this.rate)
})
},
refreshRate() {
let $this = this
axios.get('api/rate').then(response => {
this.rate = response.data
this.$message({
showClose: true,
message: 'Rate is updated',
type: 'success',
duration: 5000
})
})
},
initBooking() {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data.data
})
},
RefreshBooking() {
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data.data
this.$message({
showClose: true,
message: 'Booking is updated',
type: 'success',
duration: 5000
})
})
},
makePagination(data){