mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
gitignored autoload_classmap
removed setting-credit for post, delete and get one routes completed admin credit limit and time out update feature fixed drop down rate issue fixed the controller show and update issue
This commit is contained in:
@@ -16,6 +16,7 @@ npm-debug.log
|
||||
yarn-error.log
|
||||
.env
|
||||
vendor/composer/autoload_static.php
|
||||
vendor/composer/autoload_classmap.php
|
||||
package-lock.json
|
||||
*.lock
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ class SettingCreditController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return SettingCredit::all();
|
||||
$credit_setting = SettingCredit::latest()->first();
|
||||
return response()->json($credit_setting, 201);
|
||||
}
|
||||
|
||||
public function show(SettingCredit $credit)
|
||||
@@ -24,11 +25,12 @@ class SettingCreditController extends Controller
|
||||
return response()->json($credit, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, SettingCredit $credit)
|
||||
public function update(Request $request)
|
||||
{
|
||||
$credit->update($request->all());
|
||||
$credit_setting = SettingCredit::latest()->first();
|
||||
$credit_setting->update($request->all());
|
||||
|
||||
return response()->json($credit, 200);
|
||||
return response()->json($credit_setting, 200);
|
||||
}
|
||||
|
||||
public function delete(SettingCredit $credit)
|
||||
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
},
|
||||
getRate() {
|
||||
let $this = this
|
||||
axios.get('api/rate').then(response => {
|
||||
axios.get('/api/rate').then(response => {
|
||||
this.rate = response.data
|
||||
console.log(this.rate)
|
||||
})
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
}
|
||||
|
||||
console.log(newRate)
|
||||
axios.post('api/update-rate', newRate)
|
||||
axios.post('/api/update-rate', newRate)
|
||||
.then((response) => {
|
||||
this.loading = false
|
||||
this.rate = response.data
|
||||
|
||||
@@ -1,46 +1,74 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h4>Limitation</h4></span><br>
|
||||
<el-form :inline="true" align="center">
|
||||
<el-form-item>
|
||||
Time Limit for Customer to Upload Bank Slip :
|
||||
<el-input size="mini" style=width:7% ></el-input>Hours
|
||||
<el-input size="mini" style=width:7% ></el-input>Minutes
|
||||
<el-input size="mini" style=width:7% ></el-input>Seconds
|
||||
<el-button type="primary" size="mini" @click="TimeLimitDialogVisible = true">Update Time Limit</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog title="Time Limit" align="center" :visible.sync="TimeLimitDialogVisible" width="30%">
|
||||
<span>Time limit for customer bank slip submission is updated</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="TimeLimitDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="TimeLimitDialogVisible = false">OK</el-button>
|
||||
<div>
|
||||
<span align="center">
|
||||
<h4>User Credit Limit Setting</h4>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-form>
|
||||
<el-form-item align="center">
|
||||
Credit Limit for RMB :
|
||||
<el-input placeholder="Amount" size="mini" style=width:10%></el-input>
|
||||
<el-button type="primary" size="mini" @click="CreditLimitDialogVisible = true">Update Credit Limit</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog title="Credit Limit" align="center" :visible.sync="CreditLimitDialogVisible" width="30%">
|
||||
<span>Credit limit for Customer Booking is updated</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="CreditLimitDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="CreditLimitDialogVisible = false">OK</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<br>
|
||||
<el-form>
|
||||
<el-form-item align="center">
|
||||
Time Limit for Customer to Upload Bank Slip :
|
||||
<br>
|
||||
<el-input size="mini" v-model="credit_setting.time_limit" style=width:20%></el-input> Seconds
|
||||
</el-form-item>
|
||||
<el-form-item align="center">
|
||||
Credit Limit for RMB :
|
||||
<el-input placeholder="Amount" v-model="credit_setting.rmb_credit_limit" size="mini" style=width:10%></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item align="center">
|
||||
<el-button type="primary" align="center" :loading="loading_btn" size="primary" @click="updateCreditSetting">Update</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
TimeLimitDialogVisible: false,
|
||||
CreditLimitDialogVisible: false
|
||||
};
|
||||
},
|
||||
};
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
// TODO : update credit limit and timeout
|
||||
data() {
|
||||
return {
|
||||
loading_btn: false,
|
||||
credit_setting: {
|
||||
rmb_credit_limit: null,
|
||||
time_limit: null
|
||||
},
|
||||
TimeLimitDialogVisible: false,
|
||||
CreditLimitDialogVisible: false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getCreditSetting()
|
||||
},
|
||||
methods: {
|
||||
getCreditSetting() {
|
||||
axios.get('/api/setting-credit').then(response => {
|
||||
this.credit_setting = response.data
|
||||
})
|
||||
},
|
||||
updateCreditSetting (){
|
||||
this.loading_btn = true
|
||||
axios.put('/api/setting-credit', this.credit_setting)
|
||||
.then((response) => {
|
||||
this.loading_btn = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Success',
|
||||
type: 'success',
|
||||
duration: 5000
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading_btn = false
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Update failed, please contact support',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
+1
-4
@@ -70,10 +70,7 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
|
||||
|
||||
Route::get('setting-credit', 'SettingCreditController@index');
|
||||
Route::get('setting-credit/{credit}', 'SettingCreditController@show');
|
||||
Route::post('setting-credit', 'SettingCreditController@store');
|
||||
Route::put('setting-credit/{credit}', 'SettingCreditController@update');
|
||||
Route::delete('setting-credit/{credit}', 'SettingCreditController@delete');
|
||||
Route::put('setting-credit', 'SettingCreditController@update');
|
||||
|
||||
Route::get('setting-supplier', 'SettingSupplierController@index');
|
||||
Route::get('setting-supplier/{supplier}', 'SettingSupplierController@show');
|
||||
|
||||
-4304
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user