mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
Showing Completed Orders Task Done
This commit is contained in:
@@ -16,4 +16,8 @@ npm-debug.log
|
||||
yarn-error.log
|
||||
.env
|
||||
vendor/composer/autoload_static.php
|
||||
vendor/composer/autoload_classmap.php
|
||||
package-lock.json
|
||||
*.lock
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -7,7 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Booking extends Model
|
||||
{
|
||||
// protected $guarded = [];
|
||||
protected $hidden = array('user_id',
|
||||
protected $hidden = array( "user",
|
||||
"user_id",
|
||||
"rate_id",
|
||||
"rmb_book_amount",
|
||||
"rmb_book_pay_method",
|
||||
@@ -29,7 +30,7 @@ class Booking extends Model
|
||||
public $timestamps = true;
|
||||
|
||||
public function user(){
|
||||
return $this->belongsTo('app\User');
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function supplierBooking(){
|
||||
|
||||
@@ -46,7 +46,8 @@ class RegisterController extends Controller
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|max:255',
|
||||
'name' => 'required|name|max:255',
|
||||
'marking' => 'required|max:255|unique:markings',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|min:6|confirmed',
|
||||
]);
|
||||
@@ -61,21 +62,27 @@ class RegisterController extends Controller
|
||||
protected function create(Request $data)
|
||||
{
|
||||
$marking = Marking::Where('email',$data['email'])->first();
|
||||
|
||||
if(!$marking){
|
||||
return response()->json('Access Denied', 401);
|
||||
return response()->json(["message"=>"Marking does not exist, please contact sales team to get one"], 400);
|
||||
}
|
||||
if($marking->marking != $data['marking']){
|
||||
return response()->json('Wrong Marking', 400);
|
||||
return response()->json(["message"=>"Incorrect marking"], 400);
|
||||
}
|
||||
|
||||
if(User::Where('email',$data['email'])->first()){
|
||||
return response()->json(["message"=>"Email already exist in the system"], 400);
|
||||
}
|
||||
|
||||
$role = Role::where('name','=','member')->first();
|
||||
$user = new User();
|
||||
$user->name = $data['name'];
|
||||
$user->email = $data['email'];
|
||||
$user->marking = $marking->marking;
|
||||
$user->password = bcrypt($data['password']);
|
||||
|
||||
$user->save();
|
||||
$user->attachRole($role);
|
||||
|
||||
return response()->json($user, 201);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,11 @@ class BookingController extends Controller
|
||||
|
||||
public function index(){
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
$bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id', $user->id)
|
||||
->orderby('updated_at','desc')
|
||||
->paginate(10);
|
||||
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
@@ -42,7 +41,7 @@ class BookingController extends Controller
|
||||
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/7)";
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
@@ -69,15 +68,15 @@ class BookingController extends Controller
|
||||
default:
|
||||
$status_desc = "";
|
||||
}
|
||||
$booking->status_desc = $status_desc;
|
||||
$booking->marking = $booking->user->marking;
|
||||
}
|
||||
|
||||
|
||||
return $bookings;
|
||||
}
|
||||
|
||||
public function adminIndex(){
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
$bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->orderby('updated_at','desc')
|
||||
->get();
|
||||
|
||||
@@ -126,7 +125,8 @@ class BookingController extends Controller
|
||||
break;
|
||||
default:
|
||||
$status_desc = "";
|
||||
}
|
||||
}
|
||||
$booking->marking = $booking->user->marking;
|
||||
$booking->status_desc = $status_desc;
|
||||
}
|
||||
return $bookings;
|
||||
@@ -169,6 +169,7 @@ class BookingController extends Controller
|
||||
$time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit;
|
||||
$difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
$booking->marking = $booking->user->marking;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
@@ -214,6 +215,7 @@ class BookingController extends Controller
|
||||
$time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit;
|
||||
$difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
$booking->marking = $booking->user->marking;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
@@ -350,7 +352,7 @@ class BookingController extends Controller
|
||||
|
||||
return response()->json(['book_id'=>$book_id],200);
|
||||
}
|
||||
//upload
|
||||
|
||||
public function uploadbankslip(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
@@ -410,8 +412,7 @@ class BookingController extends Controller
|
||||
}
|
||||
else {
|
||||
return response()->json(['message' => 'No file detected'], 400);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function updateBankSlipAmount(Request $request, $id){
|
||||
@@ -487,7 +488,6 @@ class BookingController extends Controller
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
|
||||
public function showPurchaseOrder($id){
|
||||
$booking = Booking::where('id',$id)->first();
|
||||
@@ -526,6 +526,7 @@ class BookingController extends Controller
|
||||
$term = $request->input('term');
|
||||
$china_beneficiary = $request->input('china_beneficiary');
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
$marking = $user = Auth::user()->marking;
|
||||
|
||||
$creditLimit = SettingCredit::orderby('updated_at','desc')->first();
|
||||
|
||||
@@ -536,9 +537,7 @@ class BookingController extends Controller
|
||||
if($amount > $creditLimit->rmb_credit_limit){
|
||||
return response()->json(["message" => "Exceed credit limit, please contact our sales team for larger quantitiy"], 400);
|
||||
}
|
||||
|
||||
// TODO : get marking
|
||||
$marking = "123X";
|
||||
|
||||
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
@@ -656,7 +655,7 @@ class BookingController extends Controller
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
//upload
|
||||
|
||||
public function uploadInvoice(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('id',$id)->first();
|
||||
@@ -756,10 +755,9 @@ class BookingController extends Controller
|
||||
|
||||
public function adminShowCompletedOrders()
|
||||
{
|
||||
$bookings = Booking::select('id', 'company_name','company_address','created_at', 'rmb_book_amount', 'admin_status')
|
||||
->where('admin_status', 1)
|
||||
$bookings = Booking::select('id', 'company_name','company_address','created_at','rate','amount', 'rmb_book_amount', 'admin_status')
|
||||
->where('admin_status', 7)
|
||||
->orderBy('id', 'desc')
|
||||
->take(10)
|
||||
->get();
|
||||
|
||||
foreach ($bookings as $booking) {
|
||||
@@ -767,6 +765,8 @@ class BookingController extends Controller
|
||||
$booking->company_name;
|
||||
$booking->company_address;
|
||||
$booking->created_at;
|
||||
$booking->rate;
|
||||
$booking->amount;
|
||||
$booking->rmb_book_amount;
|
||||
$booking->admin_status;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\SettingActiveBank;
|
||||
|
||||
class SettingActiveBankController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$active_bank_setting = SettingActiveBank::latest()->first();
|
||||
return response()->json($active_bank_setting, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
if($active_bank_setting = SettingActiveBank::latest()->first())
|
||||
$active_bank_setting->update($request->all());
|
||||
else
|
||||
$active_bank_setting = SettingActiveBank::create($request->all());
|
||||
|
||||
return response()->json($active_bank_setting, 200);
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\SettingMalaysiaBank;
|
||||
|
||||
class SettingMalaysiaBankController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return SettingMalaysiaBank::all();
|
||||
}
|
||||
|
||||
public function show(SettingMalaysiaBank $malaysiaBank)
|
||||
{
|
||||
return $malaysiaBank;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$malaysiaBank = SettingMalaysiaBank::create($request->all());
|
||||
|
||||
return response()->json($malaysiaBank, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, SettingMalaysiaBank $malaysiaBank)
|
||||
{
|
||||
$malaysiaBank->update($request->all());
|
||||
|
||||
return response()->json($malaysiaBank, 200);
|
||||
}
|
||||
|
||||
public function delete(SettingMalaysiaBank $malaysiaBank)
|
||||
{
|
||||
$malaysiaBank->delete();
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SettingActiveBank extends Model
|
||||
{
|
||||
protected $fillable = ['x1_bank_id','x2_bank_id','beneficiary_id'];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SettingMalaysiaBank extends Model
|
||||
{
|
||||
protected $fillable = ['company_name','bank_name','acc_no','bank_address','swift','cnap','bank_branch'];
|
||||
}
|
||||
+2
-2
@@ -29,7 +29,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
'password', 'remember_token'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
return [];
|
||||
}
|
||||
|
||||
public function booking(){
|
||||
public function bookings(){
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
|
||||
Generated
-5352
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(Model::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(Model::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
];
|
||||
});
|
||||
@@ -21,5 +21,6 @@ $factory->define(App\User::class, function (Faker $faker) {
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'password' => $password ?: $password = bcrypt('secret'),
|
||||
'remember_token' => str_random(10),
|
||||
'marking' => $faker->name,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreateSettingBeneficiariesTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->string('company_name');
|
||||
$table->string('bank_name');
|
||||
$table->string('acc_no');
|
||||
$table->string('acc_no')->unique();
|
||||
$table->string('bank_address');
|
||||
$table->string('swift');
|
||||
$table->string('cnap');
|
||||
|
||||
@@ -19,7 +19,6 @@ class CreateUserBankSlipsTable extends Migration
|
||||
$table->string('bankslip_url')->nullable();
|
||||
$table->double('transfer_amount')->nullable();
|
||||
$table->string('cust_marking')->nullable();
|
||||
|
||||
$table->integer('book_id')->unsigned();
|
||||
$table->foreign('book_id')->references('id')->on('bookings');
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveUserInUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNameInUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('name');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateNameToNullableInUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
$table->string('name')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddMarkingToUserTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function($table)
|
||||
{
|
||||
$table->string('marking');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateSettingMalaysiaBankTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('setting_malaysia_banks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('company_name');
|
||||
$table->string('bank_name');
|
||||
$table->string('acc_no')->unique();
|
||||
$table->string('bank_address');
|
||||
$table->string('swift');
|
||||
$table->string('cnap');
|
||||
$table->string('bank_branch');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('setting_malaysia_banks');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNullableSettingMalaysiaBankTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('setting_malaysia_banks', function(Blueprint $table) {
|
||||
$table->string('company_name')->nullable()->change();
|
||||
$table->string('bank_name')->nullable()->change();
|
||||
$table->string('acc_no')->nullable()->change();
|
||||
$table->string('bank_address')->nullable()->change();
|
||||
$table->string('swift')->nullable()->change();
|
||||
$table->string('cnap')->nullable()->change();
|
||||
$table->string('bank_branch')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateSettingActiveBankTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('setting_active_banks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('x1_bank_id')->unique();
|
||||
$table->string('x2_bank_id')->unique();
|
||||
$table->string('beneficiary_id')->unique();
|
||||
$table->foreign('x1_bank_id')
|
||||
->references('acc_no')->on('setting_malaysia_banks')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('x2_bank_id')
|
||||
->references('acc_no')->on('setting_malaysia_banks')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('beneficiary_id')
|
||||
->references('acc_no')->on('setting_beneficiaries')
|
||||
->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('setting_active_banks');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ChangeForeignkeyTypeInActivebankTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('setting_active_banks', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('setting_active_banks_x1_bank_id_foreign');
|
||||
$table->foreign('x1_bank_id')
|
||||
->references('acc_no')->on('setting_malaysia_banks');
|
||||
|
||||
$table->dropForeign('setting_active_banks_x2_bank_id_foreign');
|
||||
$table->foreign('x2_bank_id')
|
||||
->references('acc_no')->on('setting_malaysia_banks');
|
||||
|
||||
$table->dropForeign('setting_active_banks_beneficiary_id_foreign');
|
||||
$table->foreign('beneficiary_id')
|
||||
->references('acc_no')->on('setting_beneficiaries');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNotNullableSettingMalaysiaBankTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('setting_malaysia_banks', function(Blueprint $table) {
|
||||
$table->string('company_name')->nullable(false)->change();
|
||||
$table->string('bank_name')->nullable(false)->change();
|
||||
$table->string('acc_no')->nullable()->change(); // reference key at select active bank
|
||||
$table->string('bank_address')->nullable(false)->change();
|
||||
$table->string('swift')->nullable(false)->change();
|
||||
$table->string('cnap')->nullable(false)->change();
|
||||
$table->string('bank_branch')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class BookTableSeeder extends Seeder
|
||||
'rate_id' => $rate->id,
|
||||
'user_id' => $user->id,
|
||||
'status' => 2,
|
||||
'admin_status' => 1,
|
||||
'admin_status' => 2,
|
||||
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,8 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$this->call(UsersTableSeeder::class);
|
||||
$this->call(RolesAndPermissionsSeeder::class);
|
||||
$this->call(UserRoleSeeder::class);
|
||||
@@ -19,5 +21,11 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(BookTableSeeder::class);
|
||||
$this->call(SettingCreditSeeder::class);
|
||||
$this->call(SuppliersTableSeeder::class);
|
||||
$this->call(MarkingSeeder::class);
|
||||
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
|
||||
$this->call(SettingMalaysiaBankSeeder::class);
|
||||
$this->call(SettingBeneficiaresSeeder::class);
|
||||
$this->call(SettingActiveBankSeeder::class);
|
||||
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class MarkingSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('markings')->truncate();
|
||||
DB::table('markings')->insert([
|
||||
'marking' => 'hehe',
|
||||
'email' => 'hehe@gmail.com'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingActiveBankSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_active_banks')->truncate();
|
||||
DB::table('setting_active_banks')->insert([
|
||||
'x1_bank_id' => 'malaysiaacc01',
|
||||
'x2_bank_id' => 'malaysiaacc02',
|
||||
'beneficiary_id' => '123456789'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingBeneficiaresSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_beneficiaries')->truncate();
|
||||
DB::table('setting_beneficiaries')->insert([
|
||||
'company_name' => 'CIEF2',
|
||||
'bank_name' => 'Mayban222k',
|
||||
'acc_no' => '5555555',
|
||||
'bank_address' => 'Jalan putrajaya',
|
||||
'swift' => 'ABC122223',
|
||||
'cnap' => 'CED232224',
|
||||
'bank_branch' => 'Putra'
|
||||
]);
|
||||
DB::table('setting_beneficiaries')->insert([
|
||||
'company_name' => 'Bota',
|
||||
'bank_name' => 'CIMB',
|
||||
'acc_no' => '123456789',
|
||||
'bank_address' => 'Jalan cyberjaya',
|
||||
'swift' => 'AB3333',
|
||||
'cnap' => 'CADSeed',
|
||||
'bank_branch' => 'cyberjaa
|
||||
'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingMalaysiaBankSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_active_banks')->truncate();
|
||||
DB::table('setting_malaysia_banks')->truncate();
|
||||
DB::table('setting_malaysia_banks')->insert([
|
||||
'company_name' => 'CIEF',
|
||||
'bank_name' => 'Maybank',
|
||||
'acc_no' => 'malaysiaacc01',
|
||||
'bank_address' => 'Jalan putrajaya',
|
||||
'swift' => 'ABC123',
|
||||
'cnap' => 'CED234',
|
||||
'bank_branch' => 'Putra'
|
||||
]);
|
||||
DB::table('setting_malaysia_banks')->insert([
|
||||
'company_name' => 'CIEF',
|
||||
'bank_name' => 'Maybank',
|
||||
'acc_no' => 'malaysiaacc02',
|
||||
'bank_address' => 'Jalan putrajaya',
|
||||
'swift' => 'ABC123',
|
||||
'cnap' => 'CED234',
|
||||
'bank_branch' => 'Putra'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,8 @@ class UsersTableSeeder extends Seeder
|
||||
DB::table('users')->delete();
|
||||
|
||||
$users = array(
|
||||
['name' => 'User', 'email' => 'user@example.com', 'password' => Hash::make('secret')],
|
||||
['name' => 'Admin', 'email' => 'admin@example.com', 'password' => Hash::make('secret')],
|
||||
['name' => 'User', 'marking'=> 'X9', 'email' => 'user@example.com', 'password' => Hash::make('secret')],
|
||||
['name' => 'Admin', 'marking'=> 'X10', 'email' => 'admin@example.com', 'password' => Hash::make('secret')],
|
||||
);
|
||||
|
||||
foreach ($users as $user)
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
"vue": "^2.5.16",
|
||||
"vue-axios": "^2.1.1",
|
||||
"vue-i18n": "^7.6.0",
|
||||
"vue-loader": "14.2.2",
|
||||
"vue-loader": "^14.2.2",
|
||||
"vue-meta": "^1.4.4",
|
||||
"vue-router": "^3.0.1",
|
||||
"vuex": "^3.0.1",
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false">
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="Feature">
|
||||
<directory suffix="Test.php">./tests/Feature</directory>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"/js/lang-zh-CN.c0da3973e52421a8cfe5.js": "/js/lang-zh-CN.c0da3973e52421a8cfe5.js",
|
||||
"/js/lang-es.f4a1a5b4a30e92527b46.js": "/js/lang-es.f4a1a5b4a30e92527b46.js",
|
||||
"/js/lang-en.0f790217417404ecc662.js": "/js/lang-en.0f790217417404ecc662.js",
|
||||
"/js/lang-zh-CN.489521629fd49ac7628e.js": "/js/lang-zh-CN.489521629fd49ac7628e.js",
|
||||
"/js/lang-es.459dcb868aa54d488979.js": "/js/lang-es.459dcb868aa54d488979.js",
|
||||
"/js/lang-en.31386792460363b93c17.js": "/js/lang-en.31386792460363b93c17.js",
|
||||
"/js/app.js": "/js/app.js",
|
||||
"/css/app.css": "/css/app.css"
|
||||
}
|
||||
@@ -11,7 +11,25 @@ import '~/plugins'
|
||||
import '~/components'
|
||||
|
||||
import VeeValidate from 'vee-validate';
|
||||
Vue.use(VeeValidate);
|
||||
const config = {
|
||||
errorBagName: 'errors', // change if property conflicts.
|
||||
fieldsBagName: 'fields',
|
||||
delay: 0,
|
||||
// locale: 'zh_CN',
|
||||
strict: true,
|
||||
enableAutoClasses: false,
|
||||
classNames: {
|
||||
touched: 'touched', // the control has been blurred
|
||||
untouched: 'untouched', // the control hasn't been blurred
|
||||
valid: 'valid', // model is valid
|
||||
invalid: 'invalid', // model is invalid
|
||||
pristine: 'pristine', // control has not been interacted with
|
||||
dirty: 'dirty' // control has been interacted with
|
||||
},
|
||||
events: 'blur',
|
||||
inject: true
|
||||
};
|
||||
Vue.use(VeeValidate, config);
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -1,29 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<div align="right">
|
||||
<el-button icon="el-icon-refresh" type="primary" size="mini" @click="RefreshCompletedOrders()">Refresh</el-button>
|
||||
</div>
|
||||
<span align="center"><h2>Completed Orders</h2></span><br>
|
||||
<!--<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column prop="order_no" label="Order No" sortable></el-table-column>
|
||||
<el-table-column prop="cust_marking" label="Customer Marking" sortable></el-table-column>
|
||||
<el-table-column prop="order_date" label="Order Date" sortable></el-table-column>
|
||||
<el-table-column prop="transfer_amount" label="Transfer Amount (RMB)" sortable></el-table-column>
|
||||
<el-table-column prop="status" label="Status"></el-table-column>
|
||||
</el-table>-->
|
||||
<br><br>
|
||||
<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column label="Order No" prop="id"></el-table-column>
|
||||
<div>
|
||||
<div align="right">
|
||||
<el-button icon="el-icon-refresh" type="primary" size="mini" @click="RefreshCompletedOrders()">Refresh</el-button>
|
||||
</div>
|
||||
<h1 align="center">Completed Orders</h1>
|
||||
<el-table :data="tableData" stripe height="500" style="width: 100%">
|
||||
<el-table-column label="Order No" prop="id" sortable></el-table-column>
|
||||
<el-table-column label="Company Name" prop="company_name"></el-table-column>
|
||||
<el-table-column label="Company Address" prop="company_address"></el-table-column>
|
||||
<el-table-column label="Order Date" prop="created_at"></el-table-column>
|
||||
<el-table-column label="Transfer Amount (RMB)" prop="rmb_book_amount"></el-table-column>
|
||||
<el-table-column label="Order Date" prop="created_at" sortable></el-table-column>
|
||||
<el-table-column label="Rate" prop="rate" sortable></el-table-column>
|
||||
<el-table-column label="Amount" prop="amount" sortable></el-table-column>
|
||||
<el-table-column label="Transfer Amount (RMB)" prop="rmb_book_amount" sortable></el-table-column>
|
||||
<el-table-column label="Status" prop="admin_status"></el-table-column>
|
||||
</el-table>
|
||||
<div align="right">
|
||||
<el-pagination background layout="prev, pager, next" :total="30"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<el-button slot-scope="scope" type="text" @click="(event) => { BookingStatus(scope.row.admin_status, scope.row.id) }"> {{ scope.row.id }}</el-button>
|
||||
</el-table-column>
|
||||
<el-table-column label="DateTime" prop="created_at" width="180" sortable/>
|
||||
<el-table-column :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" :filter-method="filterHandler" label="Term" prop="term" width="100"/> -->
|
||||
<el-table-column label="Marking" width="120" prop="marking" />
|
||||
<el-table-column :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" :filter-method="filterHandler" label="Term" prop="term" width="100"/>
|
||||
<el-table-column label="Rate" width="74" prop="rate" />
|
||||
<el-table-column label="Amount" prop="amount" justify="center" width="110" />
|
||||
<el-table-column :filters="[{text: 'RMB', value: 'RMB'}, {text: 'USD', value: 'USD'}]" :filter-method="filterHandler" label="Transfer Amount"
|
||||
|
||||
@@ -1,107 +1,165 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-lg-8 m-auto">
|
||||
<card :title="$t('register')">
|
||||
<form @submit.prevent="register" @keydown="form.onKeydown($event)">
|
||||
<!-- Name -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('name') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input v-model="form.name" :class="{ 'is-invalid': form.errors.has('name') }" class="form-control" type="text" name="name">
|
||||
<has-error :form="form" field="name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8 m-auto">
|
||||
<card :title="$t('register')">
|
||||
<form @submit.prevent="register" @keydown="form.onKeydown($event)">
|
||||
<!-- Marking -->
|
||||
<div class="form-group row" :class="{'has-error': errors.has('marking') }">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('Marking') }}</label>
|
||||
<div class="col-md-7">
|
||||
<el-input v-model="form.marking" v-validate="'required|max:255'" type="text" name="marking" placeholder="Marking Number">
|
||||
</el-input>
|
||||
<span class="text-danger" v-if="errors.has('marking')">{{ errors.first('marking') }}<br/></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('email') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input v-model="form.email" :class="{ 'is-invalid': form.errors.has('email') }" class="form-control" type="email" name="email">
|
||||
<has-error :form="form" field="email"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Email -->
|
||||
<div class="form-group row" :class="{'has-error': errors.has('email') }">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('email') }}</label>
|
||||
<div class="col-md-7">
|
||||
<el-input v-model="form.email" v-validate="'required|max:255'" type="email" name="email" placeholder="Email">
|
||||
</el-input>
|
||||
<span class="text-danger" v-if="errors.has('email')">{{ errors.first('email') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Password -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('password') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input v-model="form.password" :class="{ 'is-invalid': form.errors.has('password') }" class="form-control" type="password" name="password">
|
||||
<has-error :form="form" field="password"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Password -->
|
||||
<div class="form-group row" :class="{'has-error': errors.has('password') }">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('password') }}</label>
|
||||
<div class="col-md-7">
|
||||
<el-input v-if="password_visible" v-model="form.password" v-validate="'required|min:6|max:255'" type="text" name="password" placeholder="Password">
|
||||
<template slot="append">
|
||||
<el-button type="primary" @click="password_visible = !password_visible"><i class="fas fa-eye"></i></el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-input v-else v-model="form.password" v-validate="'required|min:6|max:255'" type="password" name="password" placeholder="Password">
|
||||
<template slot="append">
|
||||
<el-button type="primary" @click="password_visible = !password_visible"><i class="fas fa-eye-slash"></i></el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<span class="text-danger" v-if="errors.has('password')">{{ errors.first('password') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Password Confirmation -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('confirm_password') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input v-model="form.password_confirmation" :class="{ 'is-invalid': form.errors.has('password_confirmation') }" class="form-control" type="password" name="password_confirmation">
|
||||
<has-error :form="form" field="password_confirmation"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Password Confirmation -->
|
||||
<div class="form-group row" :class="{'has-error': errors.has('confirm_password') }">
|
||||
<label class="col-md-3 col-form-label text-md-right">{{ $t('confirm_password') }}</label>
|
||||
<div class="col-md-7">
|
||||
<el-input v-if="password_confirmation_visible" v-model="form.password_confirmation" v-validate="'required|min:6|max:255'" type="text" name="password_confirmation" placeholder="Confirm Password">
|
||||
<template slot="append">
|
||||
<el-button type="primary" @click="password_confirmation_visible = !password_confirmation_visible"><i class="fas fa-eye"></i></el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-input v-else v-model="form.password_confirmation" v-validate="'required|min:6|max:255'" type="password" name="password_confirmation" placeholder="Confirm Password">
|
||||
<template slot="append">
|
||||
<el-button type="primary" @click="password_confirmation_visible = !password_confirmation_visible"><i class="fas fa-eye-slash"></i></el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<span class="text-danger" v-if="errors.has('password_confirmation')">{{ errors.first('password_confirmation') }}<br/></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7 offset-md-3 d-flex">
|
||||
<!-- Submit Button -->
|
||||
<v-button :loading="form.busy">
|
||||
{{ $t('register') }}
|
||||
</v-button>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-7 offset-md-3 d-flex">
|
||||
<!-- Submit Button -->
|
||||
<v-button :loading="form.busy" :disabled="errors.any() || form.password=='' || form.password_confirmation=='' || form.email=='' || form.marking=='' ? true : false">
|
||||
{{ $t('register') }}
|
||||
</v-button>
|
||||
|
||||
<!-- GitHub Register Button -->
|
||||
<login-with-github/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</card>
|
||||
</div>
|
||||
</div>
|
||||
<!-- GitHub Register Button -->
|
||||
<login-with-github/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Form from 'vform'
|
||||
import LoginWithGithub from '~/components/LoginWithGithub'
|
||||
import store from '~/store'
|
||||
import Vue from 'vue'
|
||||
import VeeValidate from 'vee-validate';
|
||||
Vue.use(VeeValidate);
|
||||
|
||||
export default {
|
||||
middleware: 'guest',
|
||||
middleware: 'guest',
|
||||
|
||||
components: {
|
||||
LoginWithGithub
|
||||
},
|
||||
components: {
|
||||
LoginWithGithub
|
||||
},
|
||||
|
||||
metaInfo () {
|
||||
return { title: this.$t('register') }
|
||||
},
|
||||
metaInfo () {
|
||||
return { title: this.$t('register') }
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
form: new Form({
|
||||
name: '',
|
||||
email: '',
|
||||
password: '',
|
||||
password_confirmation: ''
|
||||
})
|
||||
}),
|
||||
data: () => ({
|
||||
form: new Form({
|
||||
marking:'',
|
||||
email: '',
|
||||
password: '',
|
||||
password_confirmation: ''
|
||||
}),
|
||||
email : '',
|
||||
password_visible : false,
|
||||
password_confirmation_visible : false
|
||||
}),
|
||||
|
||||
methods: {
|
||||
async register () {
|
||||
// Register the user.
|
||||
const { data } = await this.form.post('/api/register')
|
||||
|
||||
// Log in the user.
|
||||
const { data: { token } } = await this.form.post('/api/login')
|
||||
methods: {
|
||||
async register () {
|
||||
var token
|
||||
var data
|
||||
// Register the user.
|
||||
await this.form.post('/api/register')
|
||||
.then( (response) => {
|
||||
data = response.data
|
||||
this.$message({
|
||||
message: "Success. Logging in..",
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
.catch( (error) => {
|
||||
console.log(error)
|
||||
this.$message({
|
||||
message: error.response.data.message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
// Save the token.
|
||||
this.$store.dispatch('auth/saveToken', { token })
|
||||
|
||||
await this.form.post('/api/login')
|
||||
.then( (response) => {
|
||||
console.log(response.data)
|
||||
token = response.data.token
|
||||
})
|
||||
.catch( (error) => {
|
||||
console.log(error)
|
||||
this.$message({
|
||||
message: error.response.data.message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
// Update the user.
|
||||
await this.$store.dispatch('auth/updateUser', { user: data })
|
||||
console.log(token)
|
||||
// Save the token.
|
||||
this.$store.dispatch('auth/saveToken', { token } )
|
||||
|
||||
// Redirect home.
|
||||
if (store.getters['auth/user'].role === 'admin') {
|
||||
this.$router.push({ name: 'admin.home' })
|
||||
} else {
|
||||
this.$router.push({ name: 'home' })
|
||||
}
|
||||
}
|
||||
}
|
||||
// Update the user.
|
||||
await this.$store.dispatch('auth/updateUser', { user: data })
|
||||
|
||||
// Redirect home.
|
||||
if (store.getters['auth/user'].role === 'admin') {
|
||||
this.$router.push({ name: 'admin.home' })
|
||||
} else {
|
||||
this.$router.push({ name: 'home' })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
<div class="cell">{{ booking_details.marking }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
|
||||
@@ -3,30 +3,157 @@
|
||||
<span align="center"><h4>Bank Setting</h4></span><br>
|
||||
<el-form :inline="true">
|
||||
<el-form-item>
|
||||
Active CIEF bank account for today :
|
||||
X1 : <el-select size="mini">
|
||||
<el-option>Maybank</el-option>
|
||||
<el-option>Affinbank</el-option>
|
||||
<el-option>Bank Islam</el-option>
|
||||
</el-select>
|
||||
X2 : <el-select size="mini">
|
||||
<el-option>Maybank</el-option>
|
||||
<el-option>Affinbank</el-option>
|
||||
<el-option>Bank Islam</el-option>
|
||||
Active CIEF bank account for today :
|
||||
X1 :
|
||||
<el-select v-model="active_bank_setting.x1_bank_id" size="mini">
|
||||
<el-option
|
||||
v-for="item in options_CIEF"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" size="mini">Update</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form :inline="true">
|
||||
<el-form-item>
|
||||
Active CIEF China Beneficiary Account for Today :
|
||||
<el-select size="mini">
|
||||
<el-option>Bank of China</el-option>
|
||||
<el-option>China Bank</el-option>
|
||||
<el-option>Bank</el-option>
|
||||
X2 :
|
||||
<el-select v-model="active_bank_setting.x2_bank_id" size="mini">
|
||||
<el-option
|
||||
v-for="item in options_CIEF"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" size="mini">Update</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
Active CIEF China Beneficiary Account for Today :
|
||||
<el-select v-model="active_bank_setting.beneficiary_id" size="mini">
|
||||
<el-option
|
||||
v-for="item in options_china_bank"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" :loading="loading_btn" @click="EditActiveBankSetting">Update</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script type="text/javascript">
|
||||
var axios = require('axios');
|
||||
var client = axios.create({
|
||||
baseURL: 'http://localhost:8000'
|
||||
});
|
||||
|
||||
export default {
|
||||
// TODO : update credit limit and timeout
|
||||
data() {
|
||||
return {
|
||||
options_CIEF: [],
|
||||
options_china_bank: [],
|
||||
active_bank_setting : {
|
||||
x1_bank_id: null,
|
||||
x2_bank_id: null,
|
||||
beneficiary_id: null
|
||||
},
|
||||
loading_btn: false
|
||||
};
|
||||
},
|
||||
beforeMount(){
|
||||
this.UpdateMalaysiaBankOption();
|
||||
this.UpdateChinaBankOption();
|
||||
this.UpdateActiveBankSetting();
|
||||
},
|
||||
methods :{
|
||||
UpdateMalaysiaBankOption : function(){
|
||||
var malaysiaBankData;
|
||||
client.get('api/setting-malaysia-bank')
|
||||
.then((response) => {
|
||||
malaysiaBankData = response.data;
|
||||
this.options_CIEF = malaysiaBankData.map(function(item){
|
||||
return {
|
||||
value : item.acc_no,
|
||||
label : item.acc_no,
|
||||
};
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Fetch data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
UpdateChinaBankOption : function(){
|
||||
var chinaBankData;
|
||||
client.get('api/setting-beneficiary')
|
||||
.then((response) => {
|
||||
chinaBankData = response.data;
|
||||
this.options_china_bank = chinaBankData.map(function(item){
|
||||
return {
|
||||
value : item.acc_no,
|
||||
label : item.acc_no,
|
||||
};
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Fetch data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
UpdateActiveBankSetting : function(){
|
||||
client.get('api/setting-active-bank')
|
||||
.then((response) => {
|
||||
this.active_bank_setting = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Fetch data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
EditActiveBankSetting : function(){
|
||||
this.loading_btn = true;
|
||||
client.put('/api/setting-active-bank', this.active_bank_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,115 +1,262 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h4>CIEF China Bank Details</h4></span><br>
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
<el-table-column prop="comp_name" label="Company Name" width="90px"></el-table-column>
|
||||
<el-table-column prop="bank_name" label="Bank Name"></el-table-column>
|
||||
<el-table-column prop="bank_acc_no" label="Bank Account No" width="115px"></el-table-column>
|
||||
<el-table-column prop="bank_address" label="Bank Address" width="111px"></el-table-column>
|
||||
<el-table-column prop="swift_code" label="SWIFT Code"></el-table-column>
|
||||
<el-table-column prop="cnap" label="CNAP" width="80px"></el-table-column>
|
||||
<el-table-column prop="bank_branch" label="Bank Branch"></el-table-column>
|
||||
<el-table-column label="Action">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="EditDatadialogVisible = true">Edit</el-button>
|
||||
<el-button type="text" size="small" @click="DeleteAdddialogVisible = true">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table><br>
|
||||
<div align="right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="AddDatadialogVisible = true">Add New Data</el-button>
|
||||
</div>
|
||||
<!-- popup add new data -->
|
||||
<el-dialog title="Add New Data" align="center" :visible.sync="AddDatadialogVisible" width="40%">
|
||||
<el-form :label-position="right" label-width="150px">
|
||||
<el-form-item label="Company Name"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Name"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Account No"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Address"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="SWIFT Code"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="CNAP"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Branch"><el-input></el-input></el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="AddDatadialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="AddDatadialogVisible = false; DoneAddDatadialogVisible = true">OK</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
* Please key in the data in Chinese
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneAddDatadialogVisible" width="30%">
|
||||
<span>Data Added Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneAddDatadialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup add new data end -->
|
||||
<!-- popup edit data -->
|
||||
<el-dialog title="Edit Data" align="center" :visible.sync="EditDatadialogVisible" width="40%">
|
||||
<el-form :label-position="right" label-width="150px">
|
||||
<el-form-item label="Company Name"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Name"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Account No"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Address"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="SWIFT Code"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="CNAP"><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Bank Branch"><el-input></el-input></el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="EditDatadialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="EditDatadialogVisible = false; DoneUpdateDatadialogVisible = true">Submit</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
* Please key in the data in Chinese
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneUpdateDatadialogVisible" width="30%">
|
||||
<span>Data Updated Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneUpdateDatadialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup edit data end -->
|
||||
<!-- popup delete -->
|
||||
<el-dialog align="center" :visible.sync="DeleteAdddialogVisible" width="30%">
|
||||
<span>Data Deleted</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DeleteAdddialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup delete end -->
|
||||
<span align="center"><h4>CIEF China Bank Details</h4></span><br>
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
<el-table-column prop="company_name" label="Company Name" width="90px"></el-table-column>
|
||||
<el-table-column prop="bank_name" label="Bank Name"></el-table-column>
|
||||
<el-table-column prop="acc_no" label="Bank Account No" width="115px"></el-table-column>
|
||||
<el-table-column prop="bank_address" label="Bank Address" width="111px"></el-table-column>
|
||||
<el-table-column prop="swift" label="SWIFT Code"></el-table-column>
|
||||
<el-table-column prop="cnap" label="CNAP" width="80px"></el-table-column>
|
||||
<el-table-column prop="bank_branch" label="Bank Branch"></el-table-column>
|
||||
<el-table-column label="Action">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="PopOutEditBeneficiaries(scope.$index)">Edit</el-button>
|
||||
<el-button type="text" size="small" @click="DeleteBeneficiaries(tableData[scope.$index].id)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table><br>
|
||||
<div align="right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="PopOutAddBeneficiaries">Add New Data</el-button>
|
||||
</div>
|
||||
<!-- popup add new data -->
|
||||
<el-dialog title="Add New Data" align="center" :visible.sync="AddDatadialogVisible" width="40%">
|
||||
<el-form label-width="150px">
|
||||
<el-form-item label="Company Name" :class="{'has-error': errors.has('company_name') }">
|
||||
<el-input v-model="beneficiariesForm.company_name" v-validate="'required|max:191'" name="company_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('company_name')">{{ errors.first('company_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Name" :class="{'has-error': errors.has('bank_name') }">
|
||||
<el-input v-model="beneficiariesForm.bank_name" v-validate="'required|max:191'" name="bank_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_name')">{{ errors.first('bank_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Account No" :class="{'has-error': errors.has('acc_no') }">
|
||||
<el-input v-model="beneficiariesForm.acc_no" v-validate="'required|max:191'" name="acc_no"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('acc_no')">{{ errors.first('acc_no') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Address" :class="{'has-error': errors.has('bank_address') }">
|
||||
<el-input v-model="beneficiariesForm.bank_address" v-validate="'required|max:191'" name="bank_address"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_address')">{{ errors.first('bank_address') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="SWIFT Code" :class="{'has-error': errors.has('swift') }">
|
||||
<el-input v-model="beneficiariesForm.swift" v-validate="'required|max:191'" name="swift"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('swift')">{{ errors.first('swift') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="CNAP" :class="{'has-error': errors.has('cnap') }">
|
||||
<el-input v-model="beneficiariesForm.cnap" v-validate="'required|max:191'" name="cnap" ></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('cnap')">{{ errors.first('cnap') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Branch" :class="{'has-error': errors.has('bank_branch') }">
|
||||
<el-input v-model="beneficiariesForm.bank_branch" v-validate="'required|max:191'" name="bank_branch"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_branch')">{{ errors.first('bank_branch') }}<br/></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="AddDatadialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="CreateBeneficiaries" :disabled="errors.any() || beneficiariesForm.company_name=='' || beneficiariesForm.bank_name=='' || beneficiariesForm.acc_no=='' || beneficiariesForm.bank_address=='' || beneficiariesForm.swift =='' || beneficiariesForm.cnap=='' || beneficiariesForm.bank_branch=='' ? true : false">OK</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
* Please key in the data in Chinese
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneAddDatadialogVisible" width="30%">
|
||||
<span>Data Added Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneAddDatadialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup add new data end -->
|
||||
<!-- popup edit data -->
|
||||
<el-dialog title="Edit Data" align="center" :visible.sync="EditDatadialogVisible" width="40%">
|
||||
<el-form label-width="150px">
|
||||
<el-form-item label="Company Name" :class="{'has-error': errors.has('company_name') }">
|
||||
<el-input v-model="beneficiariesForm.company_name" v-validate="'required|max:191'" name="company_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('company_name')">{{ errors.first('company_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Name" :class="{'has-error': errors.has('bank_name') }">
|
||||
<el-input v-model="beneficiariesForm.bank_name" v-validate="'required|max:191'" name="bank_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_name')">{{ errors.first('bank_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Account No" :class="{'has-error': errors.has('acc_no') }">
|
||||
<el-input v-model="beneficiariesForm.acc_no" v-validate="'required|max:191'" name="acc_no"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('acc_no')">{{ errors.first('acc_no') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Address" :class="{'has-error': errors.has('bank_address') }">
|
||||
<el-input v-model="beneficiariesForm.bank_address" v-validate="'required|max:191'" name="bank_address"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_address')">{{ errors.first('bank_address') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="SWIFT Code" :class="{'has-error': errors.has('swift') }">
|
||||
<el-input v-model="beneficiariesForm.swift" v-validate="'required|max:191'" name="swift"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('swift')">{{ errors.first('swift') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="CNAP" :class="{'has-error': errors.has('cnap') }">
|
||||
<el-input v-model="beneficiariesForm.cnap" v-validate="'required|max:191'" name="cnap" ></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('cnap')">{{ errors.first('cnap') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Branch" :class="{'has-error': errors.has('bank_branch') }">
|
||||
<el-input v-model="beneficiariesForm.bank_branch" v-validate="'required|max:191'" name="bank_branch"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_branch')">{{ errors.first('bank_branch') }}<br/></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="EditDatadialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="EditBeneficiaries" :disabled="errors.any() || beneficiariesForm.company_name=='' || beneficiariesForm.bank_name=='' || beneficiariesForm.acc_no=='' || beneficiariesForm.bank_address=='' || beneficiariesForm.swift =='' || beneficiariesForm.cnap=='' || beneficiariesForm.bank_branch=='' ? true : false">Submit</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
* Please key in the data in Chinese
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneUpdateDatadialogVisible" width="30%">
|
||||
<span>Data Updated Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneUpdateDatadialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup edit data end -->
|
||||
<!-- popup delete -->
|
||||
<el-dialog align="center" :visible.sync="DeleteAdddialogVisible" width="30%">
|
||||
<span>Data Deleted</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DeleteAdddialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup delete end -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
comp_name: 'CIEF Worldwide',
|
||||
bank_name: 'Myabank',
|
||||
bank_acc_no: '6725137521',
|
||||
bank_address: 'Cyberjaya',
|
||||
swift_code: '2376abc',
|
||||
cnap: 'ghi123',
|
||||
bank_branch: 'Klang'
|
||||
}, {
|
||||
comp_name: 'DPulze',
|
||||
bank_name: 'AFFbank',
|
||||
bank_acc_no: '246891247',
|
||||
bank_address: 'Putrajaya',
|
||||
swift_code: 'qwe4567',
|
||||
cnap: '7890po',
|
||||
bank_branch: 'Jawa'
|
||||
}],
|
||||
chinaBankForm : [],
|
||||
EditDatadialogVisible: false,
|
||||
DeleteAdddialogVisible: false,
|
||||
AddDatadialogVisible: false,
|
||||
DoneAddDatadialogVisible: false,
|
||||
DoneUpdateDatadialogVisible: false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
var axios = require('axios');
|
||||
var client = axios.create({
|
||||
baseURL: 'http://localhost:8000'
|
||||
});
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
beneficiariesForm : {
|
||||
company_name : '',
|
||||
bank_name : '',
|
||||
acc_no : '',
|
||||
bank_address : '',
|
||||
swift : '',
|
||||
cnap : '',
|
||||
bank_branch : '',
|
||||
},
|
||||
EditDatadialogVisible: false,
|
||||
DeleteAdddialogVisible: false,
|
||||
AddDatadialogVisible: false,
|
||||
DoneAddDatadialogVisible: false,
|
||||
DoneUpdateDatadialogVisible: false,
|
||||
currentEdit : -1,
|
||||
}
|
||||
},
|
||||
beforeMount(){
|
||||
this.UpdateTableData();
|
||||
},
|
||||
methods: {
|
||||
CreateBeneficiaries : function(){
|
||||
this.AddDatadialogVisible = false;
|
||||
client.post('api/setting-beneficiary', this.beneficiariesForm)
|
||||
.then((response) => {
|
||||
this.DoneAddDatadialogVisible = true;
|
||||
this.ClearBeneficiariesForm();
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Create Fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
this.ClearBeneficiariesForm();
|
||||
});
|
||||
},
|
||||
UpdateTableData : function(){
|
||||
client.get('api/setting-beneficiary', this.beneficiariesForm)
|
||||
.then((response) => {
|
||||
this.tableData = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Fetch data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
})
|
||||
},
|
||||
DeleteBeneficiaries : function(beneficiaries_id){
|
||||
this.DeleteAdddialogVisible = true;
|
||||
client.delete('api/setting-beneficiary/' + beneficiaries_id)
|
||||
.then((response) => {
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Delete data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
EditBeneficiaries : function(){
|
||||
this.EditDatadialogVisible = false;
|
||||
this.DoneUpdateDatadialogVisible = true;
|
||||
|
||||
client.put('api/setting-beneficiary/' + this.currentEdit, this.beneficiariesForm)
|
||||
.then((response) => {
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Update Fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
PopOutAddBeneficiaries : function(){
|
||||
this.AddDatadialogVisible = true;
|
||||
this.ClearBeneficiariesForm();
|
||||
},
|
||||
PopOutEditBeneficiaries : function(tableDataRow){
|
||||
this.EditDatadialogVisible = true;
|
||||
this.FillupBeneficiariesForm(tableDataRow);
|
||||
this.currentEdit = this.tableData[tableDataRow].id;
|
||||
},
|
||||
ClearBeneficiariesForm : function(){
|
||||
this.beneficiariesForm.company_name = '';
|
||||
this.beneficiariesForm.bank_name = '';
|
||||
this.beneficiariesForm.acc_no = '';
|
||||
this.beneficiariesForm.bank_address = '';
|
||||
this.beneficiariesForm.swift = '';
|
||||
this.beneficiariesForm.cnap = '';
|
||||
this.beneficiariesForm.bank_branch = '';
|
||||
},
|
||||
FillupBeneficiariesForm : function(tableDataRow){
|
||||
this.beneficiariesForm.company_name = this.tableData[tableDataRow].company_name;
|
||||
this.beneficiariesForm.bank_name = this.tableData[tableDataRow].bank_name;
|
||||
this.beneficiariesForm.acc_no = this.tableData[tableDataRow].acc_no;
|
||||
this.beneficiariesForm.bank_address = this.tableData[tableDataRow].bank_address;
|
||||
this.beneficiariesForm.swift = this.tableData[tableDataRow].swift;
|
||||
this.beneficiariesForm.cnap = this.tableData[tableDataRow].cnap;
|
||||
this.beneficiariesForm.bank_branch = this.tableData[tableDataRow].bank_branch;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.error-message{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,46 +1,83 @@
|
||||
<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: {
|
||||
ValidateAll : function(){
|
||||
var working;
|
||||
this.$validator.validateAll().then((result) => {
|
||||
working = result;
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
getCreditSetting() {
|
||||
axios.get('/api/setting-credit').then(response => {
|
||||
this.credit_setting = response.data
|
||||
})
|
||||
},
|
||||
updateCreditSetting (){
|
||||
if(this.ValidateAll())
|
||||
return;
|
||||
|
||||
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>
|
||||
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h4>Malaysia Bank Details</h4></span><br>
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
<el-table-column prop="company_name" label="Company Name" width="90px"></el-table-column>
|
||||
<el-table-column prop="bank_name" label="Bank Name"></el-table-column>
|
||||
<el-table-column prop="acc_no" label="Bank Account No" width="115px"></el-table-column>
|
||||
<el-table-column prop="bank_address" label="Bank Address" width="111px"></el-table-column>
|
||||
<el-table-column prop="swift" label="SWIFT Code"></el-table-column>
|
||||
<el-table-column prop="cnap" label="CNAP" width="80px"></el-table-column>
|
||||
<el-table-column prop="bank_branch" label="Bank Branch"></el-table-column>
|
||||
<el-table-column label="Action">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="PopOutEditMalaysiaBank(scope.$index)">Edit</el-button>
|
||||
<el-button type="text" size="small" @click="DeleteMalaysiaBank(tableData[scope.$index].id)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table><br>
|
||||
<div align="right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="PopOutAddMalaysiaBank">Add New Data</el-button>
|
||||
</div>
|
||||
<!-- popup add new data -->
|
||||
<el-dialog title="Add New Data" align="center" :visible.sync="AddDatadialogVisible" width="40%">
|
||||
<el-form label-width="150px">
|
||||
<el-form-item label="Company Name" :class="{'has-error': errors.has('company_name') }">
|
||||
<el-input v-model="malaysiaBankForm.company_name" v-validate="'required|max:191'" name="company_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('company_name')">{{ errors.first('company_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Name" :class="{'has-error': errors.has('bank_name') }">
|
||||
<el-input v-model="malaysiaBankForm.bank_name" v-validate="'required|max:191'" name="bank_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_name')">{{ errors.first('bank_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Account No" :class="{'has-error': errors.has('acc_no') }">
|
||||
<el-input v-model="malaysiaBankForm.acc_no" v-validate="'required|max:191'" name="acc_no"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('acc_no')">{{ errors.first('acc_no') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Address" :class="{'has-error': errors.has('bank_address') }">
|
||||
<el-input v-model="malaysiaBankForm.bank_address" v-validate="'required|max:191'" name="bank_address"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_address')">{{ errors.first('bank_address') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="SWIFT Code" :class="{'has-error': errors.has('swift') }">
|
||||
<el-input v-model="malaysiaBankForm.swift" v-validate="'required|max:191'" name="swift"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('swift')">{{ errors.first('swift') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="CNAP" :class="{'has-error': errors.has('cnap') }">
|
||||
<el-input v-model="malaysiaBankForm.cnap" v-validate="'required|max:191'" name="cnap" ></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('cnap')">{{ errors.first('cnap') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Branch" :class="{'has-error': errors.has('bank_branch') }">
|
||||
<el-input v-model="malaysiaBankForm.bank_branch" v-validate="'required|max:191'" name="bank_branch"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_branch')">{{ errors.first('bank_branch') }}<br/></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="AddDatadialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="CreateMalaysiaBank" :disabled="errors.any() || malaysiaBankForm.company_name=='' || malaysiaBankForm.bank_name=='' || malaysiaBankForm.acc_no=='' || malaysiaBankForm.bank_address=='' || malaysiaBankForm.swift =='' || malaysiaBankForm.cnap=='' || malaysiaBankForm.bank_branch=='' ? true : false">OK</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
* Please key in the data in Chinese
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneAddDatadialogVisible" width="30%">
|
||||
<span>Data Added Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneAddDatadialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup add new data end -->
|
||||
<!-- popup edit data -->
|
||||
<el-dialog title="Edit Data" align="center" :visible.sync="EditDatadialogVisible" width="40%">
|
||||
<el-form label-width="150px">
|
||||
<el-form-item label="Company Name" :class="{'has-error': errors.has('company_name') }">
|
||||
<el-input v-model="malaysiaBankForm.company_name" v-validate="'required|max:191'" name="company_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('company_name')">{{ errors.first('company_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Name" :class="{'has-error': errors.has('bank_name') }">
|
||||
<el-input v-model="malaysiaBankForm.bank_name" v-validate="'required|max:191'" name="bank_name"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_name')">{{ errors.first('bank_name') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Account No" :class="{'has-error': errors.has('acc_no') }">
|
||||
<el-input v-model="malaysiaBankForm.acc_no" v-validate="'required|max:191'" name="acc_no"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('acc_no')">{{ errors.first('acc_no') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Address" :class="{'has-error': errors.has('bank_address') }">
|
||||
<el-input v-model="malaysiaBankForm.bank_address" v-validate="'required|max:191'" name="bank_address"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_address')">{{ errors.first('bank_address') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="SWIFT Code" :class="{'has-error': errors.has('swift') }">
|
||||
<el-input v-model="malaysiaBankForm.swift" v-validate="'required|max:191'" name="swift"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('swift')">{{ errors.first('swift') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="CNAP" :class="{'has-error': errors.has('cnap') }">
|
||||
<el-input v-model="malaysiaBankForm.cnap" v-validate="'required|max:191'" name="cnap" ></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('cnap')">{{ errors.first('cnap') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Bank Branch" :class="{'has-error': errors.has('bank_branch') }">
|
||||
<el-input v-model="malaysiaBankForm.bank_branch" v-validate="'required|max:191'" name="bank_branch"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('bank_branch')">{{ errors.first('bank_branch') }}<br/></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="EditDatadialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="EditMalaysiaBank" :disabled="errors.any() || malaysiaBankForm.company_name=='' || malaysiaBankForm.bank_name=='' || malaysiaBankForm.acc_no=='' || malaysiaBankForm.bank_address=='' || malaysiaBankForm.swift =='' || malaysiaBankForm.cnap=='' || malaysiaBankForm.bank_branch=='' ? true : false">Submit</el-button>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
* Please key in the data in Chinese
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneUpdateDatadialogVisible" width="30%">
|
||||
<span>Data Updated Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneUpdateDatadialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup edit data end -->
|
||||
<!-- popup delete -->
|
||||
<el-dialog align="center" :visible.sync="DeleteAdddialogVisible" width="30%">
|
||||
<span>Data Deleted</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DeleteAdddialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup delete end -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var axios = require('axios');
|
||||
var client = axios.create({
|
||||
baseURL: 'http://localhost:8000'
|
||||
});
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
malaysiaBankForm : {
|
||||
company_name : '',
|
||||
bank_name : '',
|
||||
acc_no : '',
|
||||
bank_address : '',
|
||||
swift : '',
|
||||
cnap : '',
|
||||
bank_branch : '',
|
||||
},
|
||||
EditDatadialogVisible: false,
|
||||
DeleteAdddialogVisible: false,
|
||||
AddDatadialogVisible: false,
|
||||
DoneAddDatadialogVisible: false,
|
||||
DoneUpdateDatadialogVisible: false,
|
||||
currentEdit : -1,
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.UpdateTableData();
|
||||
},
|
||||
methods: {
|
||||
CreateMalaysiaBank : function(){
|
||||
this.AddDatadialogVisible = false;
|
||||
client.post('api/setting-malaysia-bank', this.malaysiaBankForm)
|
||||
.then((response) => {
|
||||
this.DoneAddDatadialogVisible = true;
|
||||
this.ClearMalaysiaBankForm();
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Create Fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
this.ClearMalaysiaBankForm();
|
||||
});
|
||||
},
|
||||
UpdateTableData : function(){
|
||||
client.get('api/setting-malaysia-bank', this.malaysiaBankForm)
|
||||
.then((response) => {
|
||||
this.tableData = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Fetch data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
})
|
||||
},
|
||||
DeleteMalaysiaBank : function(malaysiaBank_id){
|
||||
this.DeleteAdddialogVisible = true;
|
||||
client.delete('api/setting-malaysia-bank/' + malaysiaBank_id)
|
||||
.then((response) => {
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Delete data fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
EditMalaysiaBank : function(){
|
||||
this.EditDatadialogVisible = false;
|
||||
this.DoneUpdateDatadialogVisible = true;
|
||||
client.put('api/setting-malaysia-bank/' + this.currentEdit, this.malaysiaBankForm)
|
||||
.then((response) => {
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Update Fail',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
});
|
||||
},
|
||||
PopOutAddMalaysiaBank : function(){
|
||||
this.AddDatadialogVisible = true;
|
||||
this.ClearMalaysiaBankForm();
|
||||
this.$validator.validateAll();
|
||||
console.log(this.errors.count());
|
||||
},
|
||||
PopOutEditMalaysiaBank : function(tableDataRow){
|
||||
this.EditDatadialogVisible = true;
|
||||
this.FillupMalaysiaBankForm(tableDataRow);
|
||||
this.currentEdit = this.tableData[tableDataRow].id;
|
||||
},
|
||||
ClearMalaysiaBankForm : function(){
|
||||
this.malaysiaBankForm.company_name = '';
|
||||
this.malaysiaBankForm.bank_name = '';
|
||||
this.malaysiaBankForm.acc_no = '';
|
||||
this.malaysiaBankForm.bank_address = '';
|
||||
this.malaysiaBankForm.swift = '';
|
||||
this.malaysiaBankForm.cnap = '';
|
||||
this.malaysiaBankForm.bank_branch = '';
|
||||
},
|
||||
FillupMalaysiaBankForm : function(tableDataRow){
|
||||
this.malaysiaBankForm.company_name = this.tableData[tableDataRow].company_name;
|
||||
this.malaysiaBankForm.bank_name = this.tableData[tableDataRow].bank_name;
|
||||
this.malaysiaBankForm.acc_no = this.tableData[tableDataRow].acc_no;
|
||||
this.malaysiaBankForm.bank_address = this.tableData[tableDataRow].bank_address;
|
||||
this.malaysiaBankForm.swift = this.tableData[tableDataRow].swift;
|
||||
this.malaysiaBankForm.cnap = this.tableData[tableDataRow].cnap;
|
||||
this.malaysiaBankForm.bank_branch = this.tableData[tableDataRow].bank_branch;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.error-message{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h4>Marking Setting</h4></span><br>
|
||||
<el-form label-width="150px">
|
||||
<el-form-item label="Marking" :class="{'has-error': errors.has('marking') }">
|
||||
<el-input v-model="markingForm.marking" v-validate="'required|max:255'" name="marking"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('marking')">{{ errors.first('marking') }}<br/></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="Email" :class="{'has-error': errors.has('email') }">
|
||||
<el-input v-model="markingForm.email" v-validate="'required|email|max:255'" name="email"></el-input>
|
||||
<span class="error-message text-danger" v-if="errors.has('email')">{{ errors.first('email') }}<br/></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div align="right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="CreateMarking" :disabled="errors.any() || markingForm.email=='' || markingForm.marking=='' ? true : false">Add New Data</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var axios = require('axios');
|
||||
var client = axios.create({
|
||||
baseURL: 'http://localhost:8000'
|
||||
});
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading_btn: false,
|
||||
markingForm : {
|
||||
marking : '',
|
||||
email : '',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
CreateMarking : function(){
|
||||
client.post('api/setting-marking', this.markingForm)
|
||||
.then((response) => {
|
||||
this.loading_btn = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Success',
|
||||
type: 'success',
|
||||
duration: 5000
|
||||
});
|
||||
this.ClearMarkingForm();
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading_btn = false
|
||||
console.log(error);
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Update failed, please contact support',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
this.ClearMarkingForm();
|
||||
});
|
||||
},
|
||||
ClearMarkingForm : function(){
|
||||
this.markingForm.marking = '';
|
||||
this.markingForm.email = '';
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.error-message{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</el-table-column>
|
||||
</el-table><br>
|
||||
<div align="right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="AddNewSupplierdialogVisible = true">Add New Supplier</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="PopOutAddSupplier">Add New Supplier</el-button>
|
||||
</div>
|
||||
<!-- popup add new supplier -->
|
||||
<el-dialog title="Add New Supplier" align="center" :visible.sync="AddNewSupplierdialogVisible" width="40%">
|
||||
@@ -43,7 +43,7 @@
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="AddNewSupplierdialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="CreateSupplier">OK</el-button>
|
||||
<el-button type="primary" @click="CreateSupplier" :disabled="errors.any() || supplierForm.company_name=='' || supplierForm.supplier_reg_no=='' || supplierForm.gst_no=='' || supplierForm.bank_name=='' || supplierForm.acc_no =='' ? true : false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneAddSupplierdialogVisible" width="30%">
|
||||
@@ -79,13 +79,13 @@
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button @click="EditSupplierdialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="EditSupplier">OK</el-button>
|
||||
<el-button type="primary" @click="EditSupplier" :disabled="errors.any() || supplierForm.company_name=='' || supplierForm.supplier_reg_no=='' || supplierForm.gst_no=='' || supplierForm.bank_name=='' || supplierForm.acc_no =='' ? true : false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog align="center" :visible.sync="DoneUpdateSupplierdialogVisible" width="30%">
|
||||
<span>Supplier's Details Updated Successfully</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneUpdateSupplierdialogVisible = false">OK</el-button>
|
||||
<el-button type="primary" @click="DoneUpdateSupplierdialogVisible = false" >OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup edit supplier end -->
|
||||
@@ -103,7 +103,7 @@
|
||||
<script>
|
||||
var axios = require('axios');
|
||||
var client = axios.create({
|
||||
baseURL: 'http://localhost:8000'
|
||||
baseURL: 'http://localhost:8000'
|
||||
});
|
||||
|
||||
export default {
|
||||
@@ -131,10 +131,10 @@ 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.ClearSupplierForm();
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
@@ -144,14 +144,13 @@ var client = axios.create({
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
this.ClearSupplierForm();
|
||||
});
|
||||
},
|
||||
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;
|
||||
this.UpdateTableData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
@@ -165,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();
|
||||
})
|
||||
@@ -183,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();
|
||||
})
|
||||
@@ -197,10 +196,14 @@ var client = axios.create({
|
||||
});
|
||||
})
|
||||
},
|
||||
PopOutEditSupplier : function(supplier_id){
|
||||
PopOutAddSupplier : function(){
|
||||
this.AddNewSupplierdialogVisible = true;
|
||||
this.ClearSupplierForm();
|
||||
},
|
||||
PopOutEditSupplier : function(tableDataRow){
|
||||
this.EditSupplierdialogVisible = true;
|
||||
this.FillupSupplierForm(supplier_id);
|
||||
this.currentEdit = this.tableData[supplier_id].id;
|
||||
this.FillupSupplierForm(tableDataRow);
|
||||
this.currentEdit = this.tableData[tableDataRow].id;
|
||||
},
|
||||
ClearSupplierForm : function(){
|
||||
this.supplierForm.company_name = '';
|
||||
@@ -209,12 +212,12 @@ var client = axios.create({
|
||||
this.supplierForm.bank_name = '';
|
||||
this.supplierForm.acc_no = '';
|
||||
},
|
||||
FillupSupplierForm : function(supplier_id){
|
||||
this.supplierForm.company_name = this.tableData[supplier_id].company_name;
|
||||
this.supplierForm.supplier_reg_no = this.tableData[supplier_id].supplier_reg_no;
|
||||
this.supplierForm.gst_no = this.tableData[supplier_id].gst_no;
|
||||
this.supplierForm.bank_name = this.tableData[supplier_id].bank_name;
|
||||
this.supplierForm.acc_no = this.tableData[supplier_id].acc_no;
|
||||
FillupSupplierForm : function(tableDataRow){
|
||||
this.supplierForm.company_name = this.tableData[tableDataRow].company_name;
|
||||
this.supplierForm.supplier_reg_no = this.tableData[tableDataRow].supplier_reg_no;
|
||||
this.supplierForm.gst_no = this.tableData[tableDataRow].gst_no;
|
||||
this.supplierForm.bank_name = this.tableData[tableDataRow].bank_name;
|
||||
this.supplierForm.acc_no = this.tableData[tableDataRow].acc_no;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,4 +227,4 @@ var client = axios.create({
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -62,12 +62,24 @@
|
||||
route: 'settings.admin-china-bank',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
icon: 'flag',
|
||||
name: this.$t('CIEF Malaysia Bank'),
|
||||
route: 'settings.admin-malaysia-bank',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
icon: 'building',
|
||||
name: this.$t('Bank Setting'),
|
||||
route: 'settings.admin-bank-setting',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
icon: 'building',
|
||||
name: this.$t('Marking Setting'),
|
||||
route: 'settings.admin-marking-setting',
|
||||
role: 'admin'
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ const SettingsPassword = () => import('~/pages/settings/password').then(m => m.d
|
||||
const SettingsAdminSupplier = () => import('~/pages/settings/admin-supplier').then(m => m.default || m)
|
||||
const SettingsAdminCreditSetting = () => import('~/pages/settings/admin-credit-setting').then(m => m.default || m)
|
||||
const SettingsAdminChinaBank = () => import('~/pages/settings/admin-china-bank').then(m => m.default || m)
|
||||
const SettingsAdminMalaysiaBank = () => import('~/pages/settings/admin-malaysia-bank').then(m => m.default || m)
|
||||
const SettingsAdminBankSetting = () => import('~/pages/settings/admin-bank-setting').then(m => m.default || m)
|
||||
const SettingsAdminMarkingSetting = () => import('~/pages/settings/admin-marking-setting').then(m => m.default || m)
|
||||
|
||||
// Booking
|
||||
const Upload = () => import('~/pages/booking/uploadUserBankSlip').then(m => m.default || m)
|
||||
@@ -55,7 +57,9 @@ export default [
|
||||
{ path: 'admin-supplier', name: 'settings.admin-supplier', component: SettingsAdminSupplier },
|
||||
{ path: 'admin-credit-setting', name: 'settings.admin-credit-setting', component: SettingsAdminCreditSetting },
|
||||
{ path: 'admin-china-bank', name: 'settings.admin-china-bank', component: SettingsAdminChinaBank },
|
||||
{ path: 'admin-bank-setting', name: 'settings.admin-bank-setting', component: SettingsAdminBankSetting }
|
||||
{ path: 'admin-malaysia-bank', name: 'settings.admin-malaysia-bank', component: SettingsAdminMalaysiaBank },
|
||||
{ path: 'admin-bank-setting', name: 'settings.admin-bank-setting', component: SettingsAdminBankSetting },
|
||||
{ path: 'admin-marking-setting', name: 'settings.admin-marking-setting', component: SettingsAdminMarkingSetting }
|
||||
] },
|
||||
|
||||
// Booking
|
||||
|
||||
@@ -57,7 +57,6 @@ export const actions = {
|
||||
async fetchUser ({ commit }) {
|
||||
try {
|
||||
const { data } = await axios.get('/api/user')
|
||||
|
||||
commit(types.FETCH_USER_SUCCESS, { user: data })
|
||||
} catch (e) {
|
||||
commit(types.FETCH_USER_FAILURE)
|
||||
|
||||
+31
-29
@@ -29,21 +29,21 @@ Route::group(['middleware' => 'auth:api'], function () {
|
||||
Route::post('logout', 'Auth\LoginController@logout');
|
||||
|
||||
/*Route for the booking */
|
||||
Route::get('/booking/{book_id}', 'BookingController@show');
|
||||
Route::put('/booking/{book_id}', 'BookingController@update');
|
||||
Route::delete('/booking/{book_id}', 'BookingController@delete');
|
||||
Route::post('/booking', 'BookingController@store');
|
||||
Route::post('/booking/calculation', 'BookingController@calculation');
|
||||
Route::post('/booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::post('/booking/{id}/upload-user-bankslip', 'BookingController@uploadbankslip');
|
||||
Route::post('/booking/{id}/upload-po', 'BookingController@uploadPurchaseOrder');
|
||||
Route::post('/booking/{id}/confirm-po', 'BookingController@confirmPurchaseOrder');
|
||||
Route::patch('/booking/{id}/bankslip-amount', 'BookingController@updateBankSlipAmount');
|
||||
Route::get('booking/{book_id}', 'BookingController@show');
|
||||
Route::put('booking/{book_id}', 'BookingController@update');
|
||||
Route::delete('booking/{book_id}', 'BookingController@delete');
|
||||
Route::post('booking', 'BookingController@store');
|
||||
Route::post('booking/calculation', 'BookingController@calculation');
|
||||
Route::post('booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::post('booking/{id}/upload-user-bankslip', 'BookingController@uploadbankslip');
|
||||
Route::post('booking/{id}/upload-po', 'BookingController@uploadPurchaseOrder');
|
||||
Route::post('booking/{id}/confirm-po', 'BookingController@confirmPurchaseOrder');
|
||||
Route::patch('booking/{id}/bankslip-amount', 'BookingController@updateBankSlipAmount');
|
||||
Route::post('booking/{book_id}/reject-bank-slip','BookingController@rejectBankSlip');
|
||||
Route::post('booking/{book_id}/approve-bank-slip','BookingController@approveBankSlip');
|
||||
Route::post('booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::get('/booking', 'BookingController@index');
|
||||
Route::get('/user', 'UserController@show');
|
||||
Route::get('user', 'UserController@show');
|
||||
Route::patch('settings/profile', 'Settings\ProfileController@update');
|
||||
Route::patch('settings/password', 'Settings\PasswordController@update');
|
||||
});
|
||||
@@ -66,14 +66,12 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::put('update-rate/{rate}', 'RateController@update');
|
||||
Route::delete('update-rate/{rate}', 'RateController@delete');
|
||||
Route::get('update-rate', 'RateController@index');
|
||||
|
||||
|
||||
|
||||
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-active-bank', 'SettingActiveBankController@index');
|
||||
Route::put('setting-active-bank', 'SettingActiveBankController@update');
|
||||
|
||||
Route::get('setting-supplier', 'SettingSupplierController@index');
|
||||
Route::get('setting-supplier/{supplier}', 'SettingSupplierController@show');
|
||||
@@ -87,26 +85,30 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::put('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@update');
|
||||
Route::delete('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@delete');
|
||||
|
||||
Route::get('marking', 'MarkingController@index');
|
||||
Route::post('marking', 'MarkingController@store');
|
||||
Route::get('marking/{beneficiary}', 'MarkingController@show');
|
||||
Route::put('marking/{beneficiary}', 'MarkingController@update');
|
||||
Route::delete('marking/{beneficiary}', 'MarkingController@delete');
|
||||
Route::get('setting-malaysia-bank', 'SettingMalaysiaBankController@index');
|
||||
Route::get('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@show');
|
||||
Route::post('setting-malaysia-bank', 'SettingMalaysiaBankController@store');
|
||||
Route::put('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@update');
|
||||
Route::delete('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@delete');
|
||||
|
||||
Route::get('setting-marking', 'MarkingController@index');
|
||||
Route::post('setting-marking', 'MarkingController@store');
|
||||
Route::get('setting-marking/{beneficiary}', 'MarkingController@show');
|
||||
Route::put('setting-marking/{beneficiary}', 'MarkingController@update');
|
||||
Route::delete('setting-marking/{beneficiary}', 'MarkingController@delete');
|
||||
|
||||
Route::get('supplier-booking', 'BookingSupplierController@index');
|
||||
Route::get('supplier-booking/{id}', 'BookingSupplierController@show');
|
||||
Route::post('supplier-booking', 'BookingSupplierController@store');
|
||||
Route::put('supplier-booking/{id}', 'BookingSupplierController@update');
|
||||
Route::post('/booking/{id}/confirm-supplier', 'BookingController@confirmSupplier');
|
||||
Route::post('booking/{id}/confirm-supplier', 'BookingController@confirmSupplier');
|
||||
|
||||
Route::post('/booking/{id}/upload-china-bankslip','ChinaBankSlipController@store');
|
||||
Route::patch('/booking/{id}/update-china-bankslip','ChinaBankSlipController@update');
|
||||
Route::get('/booking/{id}/po', 'BookingController@showPurchaseOrder');
|
||||
Route::post('booking/{id}/upload-china-bankslip','ChinaBankSlipController@store');
|
||||
Route::patch('booking/{id}/update-china-bankslip','ChinaBankSlipController@update');
|
||||
Route::get('booking/{id}/po', 'BookingController@showPurchaseOrder');
|
||||
Route::post('booking/{id}/upload-invoice', 'BookingController@uploadInvoice');
|
||||
Route::post('booking/{id}/confirm-invoice', 'BookingController@confirmInvoice');
|
||||
|
||||
Route::get('admin/complete-order', 'BookingController@adminShowCompletedOrders');
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
@@ -13,8 +13,8 @@ class LoginTest extends TestCase
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->withoutExceptionHandling();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
@@ -35,7 +35,7 @@ class LoginTest extends TestCase
|
||||
$this->actingAs($this->user)
|
||||
->getJson('/api/user')
|
||||
->assertSuccessful()
|
||||
->assertJsonStructure(['id', 'name', 'email']);
|
||||
->assertJsonStructure(['id', 'name', 'email', 'marking']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
|
||||
@@ -22,13 +22,12 @@ class RegisterTest extends TestCase
|
||||
public function can_register()
|
||||
{
|
||||
$this->postJson('/api/register', [
|
||||
'name' => 'Test User',
|
||||
'email' => $this->marking->email,
|
||||
'password' => 'secret',
|
||||
'password_confirmation' => 'secret',
|
||||
'marking' => $this->marking->marking
|
||||
])
|
||||
->assertSuccessful()
|
||||
->assertJsonStructure(['id', 'name', 'email']);
|
||||
->assertJsonStructure(['id','email']);
|
||||
}
|
||||
}
|
||||
|
||||
-4337
File diff suppressed because it is too large
Load Diff
Vendored
+8
@@ -451,8 +451,10 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'App\\Http\\Controllers\\HomeController' => __DIR__ . '/../..' . '/app/Http/Controllers/HomeController.php',
|
||||
'App\\Http\\Controllers\\MarkingController' => __DIR__ . '/../..' . '/app/Http/Controllers/MarkingController.php',
|
||||
'App\\Http\\Controllers\\RateController' => __DIR__ . '/../..' . '/app/Http/Controllers/RateController.php',
|
||||
'App\\Http\\Controllers\\SettingActiveBankController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingActiveBankController.php',
|
||||
'App\\Http\\Controllers\\SettingBeneficiaryController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingBeneficiaryController.php',
|
||||
'App\\Http\\Controllers\\SettingCreditController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingCreditController.php',
|
||||
'App\\Http\\Controllers\\SettingMalaysiaBankController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingMalaysiaBankController.php',
|
||||
'App\\Http\\Controllers\\SettingSupplierController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingSupplierController.php',
|
||||
'App\\Http\\Controllers\\Settings\\PasswordController' => __DIR__ . '/../..' . '/app/Http/Controllers/Settings/PasswordController.php',
|
||||
'App\\Http\\Controllers\\Settings\\ProfileController' => __DIR__ . '/../..' . '/app/Http/Controllers/Settings/ProfileController.php',
|
||||
@@ -479,8 +481,10 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'App\\PurchaseOrder' => __DIR__ . '/../..' . '/app/PurchaseOrder.php',
|
||||
'App\\Rate' => __DIR__ . '/../..' . '/app/Rate.php',
|
||||
'App\\Role' => __DIR__ . '/../..' . '/app/Role.php',
|
||||
'App\\SettingActiveBank' => __DIR__ . '/../..' . '/app/SettingActiveBank.php',
|
||||
'App\\SettingBeneficiary' => __DIR__ . '/../..' . '/app/SettingBeneficiary.php',
|
||||
'App\\SettingCredit' => __DIR__ . '/../..' . '/app/SettingCredit.php',
|
||||
'App\\SettingMalaysiaBank' => __DIR__ . '/../..' . '/app/SettingMalaysiaBank.php',
|
||||
'App\\SettingSupplier' => __DIR__ . '/../..' . '/app/SettingSupplier.php',
|
||||
'App\\SupplierBooking' => __DIR__ . '/../..' . '/app/SupplierBooking.php',
|
||||
'App\\SupplierBookingItem' => __DIR__ . '/../..' . '/app/SupplierBookingItem.php',
|
||||
@@ -2734,6 +2738,7 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'League\\OAuth1\\Client\\Signature\\PlainTextSignature' => __DIR__ . '/..' . '/league/oauth1-client/src/Client/Signature/PlainTextSignature.php',
|
||||
'League\\OAuth1\\Client\\Signature\\Signature' => __DIR__ . '/..' . '/league/oauth1-client/src/Client/Signature/Signature.php',
|
||||
'League\\OAuth1\\Client\\Signature\\SignatureInterface' => __DIR__ . '/..' . '/league/oauth1-client/src/Client/Signature/SignatureInterface.php',
|
||||
'MarkingSeeder' => __DIR__ . '/../..' . '/database/seeds/MarkingSeeder.php',
|
||||
'Mockery' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery.php',
|
||||
'Mockery\\Adapter\\Phpunit\\MockeryPHPUnitIntegration' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php',
|
||||
'Mockery\\Adapter\\Phpunit\\MockeryTestCase' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php',
|
||||
@@ -3978,7 +3983,10 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'SebastianBergmann\\Timer\\RuntimeException' => __DIR__ . '/..' . '/phpunit/php-timer/src/RuntimeException.php',
|
||||
'SebastianBergmann\\Timer\\Timer' => __DIR__ . '/..' . '/phpunit/php-timer/src/Timer.php',
|
||||
'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php',
|
||||
'SettingActiveBankSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingActiveBankSeeder.php',
|
||||
'SettingBeneficiaresSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingBeneficiaresSeeder.php',
|
||||
'SettingCreditSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingCreditSeeder.php',
|
||||
'SettingMalaysiaBankSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingMalaysiaBankSeeder.php',
|
||||
'SuppliersTableSeeder' => __DIR__ . '/../..' . '/database/seeds/SuppliersTableSeeder.php',
|
||||
'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php',
|
||||
'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
|
||||
|
||||
Reference in New Issue
Block a user