diff --git a/resources/assets/js/pages/settings/admin-china-bank.vue b/resources/assets/js/pages/settings/admin-china-bank.vue
index 29f8a00f..cf57765f 100644
--- a/resources/assets/js/pages/settings/admin-china-bank.vue
+++ b/resources/assets/js/pages/settings/admin-china-bank.vue
@@ -1,115 +1,263 @@
-
CIEF China Bank Details
-
-
-
-
-
-
-
-
-
-
- Edit
- Delete
-
-
-
-
- Add New Data
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cancel
- OK
-
-
-
-
- Data Added Successfully
-
- OK
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cancel
- Submit
-
-
-
-
- Data Updated Successfully
-
- OK
-
-
-
-
-
- Data Deleted
-
- OK
-
-
-
+
CIEF China Bank Details
+
+
+
+
+
+
+
+
+
+
+ Edit
+ Delete
+
+
+
+
+ Add New Data
+
+
+
+
+
+
+ {{ errors.first('company_name') }}
+
+
+
+ {{ errors.first('bank_name') }}
+
+
+
+ {{ errors.first('acc_no') }}
+
+
+
+ {{ errors.first('bank_address') }}
+
+
+
+ {{ errors.first('swift') }}
+
+
+
+ {{ errors.first('cnap') }}
+
+
+
+ {{ errors.first('bank_branch') }}
+
+
+
+ Cancel
+ OK
+
+
+
+
+ Data Added Successfully
+
+ OK
+
+
+
+
+
+
+
+
+ {{ errors.first('company_name') }}
+
+
+
+ {{ errors.first('bank_name') }}
+
+
+
+ {{ errors.first('acc_no') }}
+
+
+
+ {{ errors.first('bank_address') }}
+
+
+
+ {{ errors.first('swift') }}
+
+
+
+ {{ errors.first('cnap') }}
+
+
+
+ {{ errors.first('bank_branch') }}
+
+
+
+ Cancel
+ Submit
+
+
+
+
+ Data Updated Successfully
+
+ OK
+
+
+
+
+
+ Data Deleted
+
+ OK
+
+
+
\ No newline at end of file
+ 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;
+ console.log(this.beneficiariesForm);
+ 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;
+ }
+ }
+ }
+
+
+
diff --git a/resources/assets/js/pages/settings/admin-supplier.vue b/resources/assets/js/pages/settings/admin-supplier.vue
index dde1ae12..a2523b6c 100644
--- a/resources/assets/js/pages/settings/admin-supplier.vue
+++ b/resources/assets/js/pages/settings/admin-supplier.vue
@@ -15,7 +15,7 @@
- Add New Supplier
+ Add New Supplier
@@ -103,7 +103,7 @@