select id cawangan
This commit is contained in:
@@ -3,7 +3,26 @@
|
||||
<h6><button class="badge m-2 btn-secondary" @click="forceRerender">Reload Component <i class="bi bi-arrow-down"></i></button></h6>
|
||||
<!-- <router-view {{Modal}}><button class="btn btn-primary">sdsd</button></router-view> -->
|
||||
<!-- <Modal /> -->
|
||||
<div class="container">
|
||||
<button
|
||||
class="btn btn-secondary float-start"
|
||||
style="margin: 5px"
|
||||
onclick="history.back()"
|
||||
>
|
||||
Kembali <i class="bi bi-backspace-fill"></i>
|
||||
</button>
|
||||
<h1>Senarai <i class="bi bi-card-list"></i></h1>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="basic-addon3">Pilih Cawangan</span>
|
||||
<select class="form-select" @change="pilihCawangan($event)">
|
||||
<option v-for="data in cawangan" :key="data.id">{{data.caw_name}}</option>
|
||||
<input type="hidden" >
|
||||
</select>
|
||||
<!-- <button @click="selectCawangan(test)" type="submit" class="btn btn-primary">Cari</button> -->
|
||||
</div>
|
||||
<Senarai :key="componentKey"/>
|
||||
</div>
|
||||
<Footer />
|
||||
</template>
|
||||
|
||||
@@ -22,6 +41,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
componentKey: 0,
|
||||
cawangan: "",
|
||||
selectCawangan: "",
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -30,10 +51,34 @@ export default {
|
||||
Senarai,
|
||||
// Modal,
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIdCawangan();
|
||||
},
|
||||
methods: {
|
||||
forceRerender() {
|
||||
this.componentKey += 1;
|
||||
},
|
||||
pilihCawangan(e) {
|
||||
|
||||
let test = e.target.value;
|
||||
console.log(test);
|
||||
|
||||
},
|
||||
getIdCawangan() {
|
||||
axios
|
||||
.get("/listcawlelongtoday", {
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
this.cawangan = response.data.lelong
|
||||
console.log(response.data.lelong);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
},
|
||||
// data() {
|
||||
// return {
|
||||
|
||||
@@ -7,40 +7,10 @@
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="container">
|
||||
<button
|
||||
class="btn btn-secondary float-start"
|
||||
style="margin: 5px"
|
||||
onclick="history.back()"
|
||||
>
|
||||
Kembali <i class="bi bi-backspace-fill"></i>
|
||||
</button>
|
||||
<h1>Senarai <i class="bi bi-card-list"></i></h1>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="basic-addon3">Pilih Cawangan</span>
|
||||
<select class="form-select" v-model="cawangan">
|
||||
<option selected value="1">Ar-Rahn Kota Bharu 2</option>
|
||||
<!-- <option v-for="sag in sags" :key="sag.id" value="sag.id">Two</option> -->
|
||||
<!-- <option value="3">Three</option> -->
|
||||
</select>
|
||||
<button type="submit" class="btn btn-primary">Cari</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div v-else class="row">
|
||||
<div class="col-9">
|
||||
<div class="container">
|
||||
<div class="d-flex">
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text">Sort By</span>
|
||||
<button class="btn btn-outline-primary" checked>Default</button>
|
||||
<button class="btn btn-outline-primary">
|
||||
Ascending Harga Bida
|
||||
</button>
|
||||
<button class="btn btn-outline-primary">
|
||||
Descending Harga Bida
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row clearfix">
|
||||
<div
|
||||
v-for="sag in sags"
|
||||
@@ -256,7 +226,7 @@
|
||||
</div>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -276,7 +246,6 @@ export default {
|
||||
loading: false,
|
||||
tambahabError: false,
|
||||
errors: [],
|
||||
cawangan: "1",
|
||||
lelong_details: [],
|
||||
sags: [],
|
||||
norujukan: "",
|
||||
@@ -320,6 +289,7 @@ export default {
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.lelong_details = response.data[0];
|
||||
this.response = response.data[0].lelongbid;
|
||||
this.sags = this.response;
|
||||
@@ -424,15 +394,15 @@ export default {
|
||||
// // console.log(element.lelongbid_id);
|
||||
// });
|
||||
|
||||
console.log(this.sags);
|
||||
console.log(this.allCarts);
|
||||
// console.log(this.sags);
|
||||
// console.log(this.allCarts);
|
||||
|
||||
// let newArray = [].concat(this.sags, this.allCarts);
|
||||
let newArray = [...this.sags, ...this.allCarts];
|
||||
|
||||
let set = new Set(newArray);
|
||||
|
||||
console.log(newArray);
|
||||
// console.log(newArray);
|
||||
// console.log(set);
|
||||
|
||||
this.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user