This commit is contained in:
hafifierahman
2022-07-04 10:47:15 +08:00
parent 6520c41caa
commit 01bcfd83b9
+22 -6
View File
@@ -2,9 +2,13 @@
<div v-if="arraybakilelong.length > 0" class="relative bg-white overflow-x-auto shadow-md sm:rounded-lg px-8 py-6">
<div class="flex justify-between">
<div class="p-4">
<h1 class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-br from-gray-500 to-gray-700">JUMLAH = RM {{ this.totalbaki }}</h1>
</div>
<div class="p-4">
<button @click.prevent="proseswtd" class="border border-yellow-300 text-white bg-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Proses WTD</button>
</div>
<div class="p-4">
<button @click.prevent="callparentload" class="border border-yellow-600 text-white bg-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300">Kembali</button>
<button @click.prevent="blockwtd" class="border border-yellow-600 text-white bg-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300">Seterusnya</button>
@@ -16,7 +20,7 @@
<tr>
<th scope="col" class="p-4">
<div class="flex items-center">
<input id="checkbox-all-search" @click="selectAll" v-model="allSelected" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
<input id="checkbox-all-search" :readonly="boolblocksag == true" @click="selectAll" v-model="allSelected" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
<label for="checkbox-all-search" class="sr-only">checkbox</label>
</div>
</th>
@@ -38,7 +42,7 @@
<tr v-for="(bl,i) in arraybakilelong" :key="i" class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<td class="w-4 p-4">
<div class="flex items-center">
<input :id="bl.norujukan" :value="bl.norujukan" type="checkbox" v-model="selectedNorujukan" @change="select($event)" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
<input :id="bl.norujukan" :readonly="boolblocksag == true" :value="bl.norujukan" type="checkbox" v-model="selectedNorujukan" @change="select($event)" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
</div>
</td>
<th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
@@ -73,6 +77,7 @@ export default {
arraybakilelong: [],
selectedNorujukan: [],
allSelected: false,
boolblocksag: false
}
},
props: ['bakilelong'],
@@ -133,24 +138,35 @@ export default {
confirmButtonText: 'Yes'
}).then((result) => {
if (result.isConfirmed) {
this.axios.post(ref.$hostname + '/admin/wtd/insert', {
kodcaw: cawangan,
norujukan: ref.selectedNorujukan
}).then(response => {
if (response.data === 'success') {
Swal.fire(
'Nyah Padam!',
'Berjaya dipadamkan!',
this.$swal(
'Berjaya!',
'Berjaya block senarai SAG!',
'success'
)
this.boolblocksag = true;
}
});
}
})
},
proseswtd: function () {
this.axios.post(ref.$hostname + '/admin/wtd/process', {
kodcaw: cawangan,
norujukan: ref.selectedNorujukan
}).then(response => {
});
}
}
}