mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
fix/removeDeleteandAddBankStatus
This commit is contained in:
@@ -37,4 +37,10 @@ class SettingMalaysiaBankController extends Controller
|
|||||||
|
|
||||||
return response()->json(null, 204);
|
return response()->json(null, 204);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateStatus(string $id, SettingMalaysiaBank $malaysiaBank){
|
||||||
|
$currentRecord = SettingMalaysiaBank::where('id', $id)->first();
|
||||||
|
SettingMalaysiaBank::where('id', $id)->update(['active' => $currentRecord->active === 1 ? 0 : 1]);
|
||||||
|
return response()->json(SettingMalaysiaBank::all(), 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class SettingMalaysiaBank extends Model
|
class SettingMalaysiaBank extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = ['company_name','bank_name','acc_no','bank_address','swift','cnap','bank_branch'];
|
protected $fillable = ['company_name','bank_name','acc_no','bank_address','swift','cnap','bank_branch', 'active'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class AddNullableSettingMalaysiaBankTable extends Migration
|
|||||||
$table->string('swift')->nullable()->change();
|
$table->string('swift')->nullable()->change();
|
||||||
$table->string('cnap')->nullable()->change();
|
$table->string('cnap')->nullable()->change();
|
||||||
$table->string('bank_branch')->nullable()->change();
|
$table->string('bank_branch')->nullable()->change();
|
||||||
|
$table->integer('active')->default(1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class SettingBeneficiarySeeder extends Seeder
|
|||||||
'bank_address' => 'Jalan cyberjaya',
|
'bank_address' => 'Jalan cyberjaya',
|
||||||
'swift' => 'AB3333',
|
'swift' => 'AB3333',
|
||||||
'cnap' => 'CADSeed',
|
'cnap' => 'CADSeed',
|
||||||
'bank_branch' => 'cyberjaa
|
'bank_branch' => 'cyberjaya
|
||||||
'
|
'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
"vue-axios": "^2.1.1",
|
"vue-axios": "^2.1.1",
|
||||||
"vue-button-spinner": "^2.2.0",
|
"vue-button-spinner": "^2.2.0",
|
||||||
"vue-i18n": "^7.6.0",
|
"vue-i18n": "^7.6.0",
|
||||||
|
"vue-js-toggle-button": "^1.3.0",
|
||||||
"vue-loader": "^14.2.2",
|
"vue-loader": "^14.2.2",
|
||||||
"vue-loading-spinner": "^1.0.11",
|
"vue-loading-spinner": "^1.0.11",
|
||||||
"vue-meta": "^1.4.4",
|
"vue-meta": "^1.4.4",
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import App from '~/components/App'
|
|||||||
import ElementUI from 'element-ui'
|
import ElementUI from 'element-ui'
|
||||||
import 'element-ui/lib/theme-chalk/index.css'
|
import 'element-ui/lib/theme-chalk/index.css'
|
||||||
import locale from 'element-ui/lib/locale/lang/en'
|
import locale from 'element-ui/lib/locale/lang/en'
|
||||||
|
import ToggleButton from 'vue-js-toggle-button'
|
||||||
|
Vue.use(ToggleButton)
|
||||||
|
|
||||||
import '~/plugins'
|
import '~/plugins'
|
||||||
import '~/components'
|
import '~/components'
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
v-for="item in options_CIEF"
|
v-for="item in options_CIEF"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value"
|
||||||
|
:disabled="item.disabled === 0">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
v-for="item in options_CIEF"
|
v-for="item in options_CIEF"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value"
|
||||||
|
:disabled="item.disabled === 0">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -76,6 +78,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
value : item.id,
|
value : item.id,
|
||||||
label : item.company_name + " : " + item.bank_name + " : " + item.acc_no,
|
label : item.company_name + " : " + item.bank_name + " : " + item.acc_no,
|
||||||
|
disabled : item.active
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,15 +4,19 @@
|
|||||||
<el-table :data="tableData" border style="width: 100%">
|
<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="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="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="acc_no" label="Bank Account No" width="125px"></el-table-column>
|
||||||
<el-table-column prop="bank_address" label="Bank Address" width="111px"></el-table-column>
|
<el-table-column prop="bank_address" label="Bank Address" width="121px"></el-table-column>
|
||||||
<el-table-column prop="swift" label="SWIFT Code"></el-table-column>
|
<el-table-column prop="swift" label="SWIFT Code" width="101px"></el-table-column>
|
||||||
<el-table-column prop="cnap" label="CNAP" width="80px"></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 prop="bank_branch" label="Bank Branch" width="111px"></el-table-column>
|
||||||
<el-table-column label="Action">
|
<el-table-column label="Action">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" :loading="loading_btn" @click="PopOutEditMalaysiaBank(scope.$index)">Edit</el-button>
|
<div id="mobile-toggle" v-bind:class="{ active: showMobileMenu }" v-on:click="showMobileMenu = !showMobileMenu"><toggle-button :value="scope.row.active === 1 ? true : false"
|
||||||
<el-button type="text" size="small" :loading="loading_btn" @click="DeleteMalaysiaBank(tableData[scope.$index].id)">Delete</el-button>
|
color="#82C7EB"
|
||||||
|
:sync="true"
|
||||||
|
@change="UpdateBankStatus(scope.row.id)"
|
||||||
|
:labels="{checked: 'Active', unchecked: 'Inactive'}" :width="70"/></div>
|
||||||
|
<el-button type="text" size="small" :loading="loading_btn" @click="PopOutEditMalaysiaBank(scope.$index)">Edit Information</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table><br>
|
</el-table><br>
|
||||||
@@ -134,13 +138,14 @@
|
|||||||
swift : '',
|
swift : '',
|
||||||
cnap : '',
|
cnap : '',
|
||||||
bank_branch : '',
|
bank_branch : '',
|
||||||
|
|
||||||
},
|
},
|
||||||
EditDatadialogVisible: false,
|
EditDatadialogVisible: false,
|
||||||
DeleteAdddialogVisible: false,
|
|
||||||
AddDatadialogVisible: false,
|
AddDatadialogVisible: false,
|
||||||
DoneAddDatadialogVisible: false,
|
DoneAddDatadialogVisible: false,
|
||||||
DoneUpdateDatadialogVisible: false,
|
DoneUpdateDatadialogVisible: false,
|
||||||
currentEdit : -1,
|
currentEdit : -1,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
@@ -175,6 +180,24 @@
|
|||||||
this.ClearMalaysiaBankForm();
|
this.ClearMalaysiaBankForm();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
UpdateBankStatus : function(id){
|
||||||
|
this.loading_btn = true
|
||||||
|
axios.put('/api/setting-malaysia-bank/status/'+ id)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading_btn = false;
|
||||||
|
this.tableData = response.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.loading_btn = false
|
||||||
|
console.log(error);
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: 'Update Status fail',
|
||||||
|
type: 'error',
|
||||||
|
duration: 10000
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
UpdateTableData : function(){
|
UpdateTableData : function(){
|
||||||
this.loading_btn = true
|
this.loading_btn = true
|
||||||
axios.get('/api/setting-malaysia-bank', this.malaysiaBankForm)
|
axios.get('/api/setting-malaysia-bank', this.malaysiaBankForm)
|
||||||
@@ -195,31 +218,6 @@
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
DeleteMalaysiaBank : function(malaysiaBank_id){
|
|
||||||
this.loading_btn = true;
|
|
||||||
this.DeleteAdddialogVisible = true;
|
|
||||||
axios.delete('/api/setting-malaysia-bank/' + malaysiaBank_id)
|
|
||||||
.then((response) => {
|
|
||||||
this.UpdateTableData();
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: 'Data Deleted Successfully',
|
|
||||||
type: 'success',
|
|
||||||
duration: 5000
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
this.loading_btn = false;
|
|
||||||
console.log(error);
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: 'Delete data fail',
|
|
||||||
type: 'error',
|
|
||||||
duration: 10000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
EditMalaysiaBank : function(){
|
EditMalaysiaBank : function(){
|
||||||
this.loading_btn = true;
|
this.loading_btn = true;
|
||||||
this.EditDatadialogVisible = false;
|
this.EditDatadialogVisible = false;
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ Route::group(['middleware' => ['role:admin']], function() {
|
|||||||
Route::post('setting-malaysia-bank', 'SettingMalaysiaBankController@store');
|
Route::post('setting-malaysia-bank', 'SettingMalaysiaBankController@store');
|
||||||
Route::put('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@update');
|
Route::put('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@update');
|
||||||
Route::delete('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@delete');
|
Route::delete('setting-malaysia-bank/{malaysiaBank}', 'SettingMalaysiaBankController@delete');
|
||||||
|
Route::put('setting-malaysia-bank/status/{id}', 'SettingMalaysiaBankController@updateStatus');
|
||||||
|
|
||||||
Route::get('setting-marking', 'MarkingController@index');
|
Route::get('setting-marking', 'MarkingController@index');
|
||||||
Route::post('setting-marking', 'MarkingController@store');
|
Route::post('setting-marking', 'MarkingController@store');
|
||||||
|
|||||||
Reference in New Issue
Block a user