fix profile ui, senarai
This commit is contained in:
+1
-98
@@ -21,7 +21,7 @@
|
||||
</select>
|
||||
<!-- <button @click="selectCawangan(test)" type="submit" class="btn btn-primary">Cari</button> -->
|
||||
</div>
|
||||
<Senarai :key="componentKey"/>
|
||||
<Senarai :key="componentKey" cawangan="1"/>
|
||||
</div>
|
||||
<Footer />
|
||||
</template>
|
||||
@@ -80,102 +80,5 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
// data() {
|
||||
// return {
|
||||
// v$: useVuelidate(),
|
||||
// loading: false,
|
||||
// tambahabError: false,
|
||||
// errors: [],
|
||||
// cawangan: "1",
|
||||
// lelong_details: [],
|
||||
// sags: [],
|
||||
// norujukan: "",
|
||||
// marhuns: "",
|
||||
// form: {
|
||||
// user_id: localStorage.getItem("id"),
|
||||
// lelongbid_id: "",
|
||||
// test: "",
|
||||
// hargabida: "",
|
||||
// },
|
||||
// myModal: null,
|
||||
// cuba: "",
|
||||
// // hargabida2: 2 + " this.form.test",
|
||||
// };
|
||||
// },
|
||||
// validations: {
|
||||
// cuba: {
|
||||
// required,
|
||||
// minLength: minLength(3),
|
||||
// },
|
||||
// },
|
||||
// computed: {
|
||||
// numberSag() {
|
||||
// return this.sags.length;
|
||||
// },
|
||||
// },
|
||||
// mounted: function () {
|
||||
// this.liveData();
|
||||
// },
|
||||
// methods: {
|
||||
// liveData() {
|
||||
// this.loading = true;
|
||||
// axios
|
||||
// .get("/lelongDetails/cawangan", {
|
||||
// headers: {
|
||||
// Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
// },
|
||||
// params: {
|
||||
// caw_id: "3",
|
||||
// },
|
||||
// })
|
||||
// .then((response) => {
|
||||
// this.lelong_details = response.data[0];
|
||||
// // console.log(this.lelong_details);
|
||||
// this.response = response.data[0].lelongbid;
|
||||
// this.sags = this.response;
|
||||
// this.loading = false;
|
||||
// // this.form.hargabida = this.form.test + 1;
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.log(error);
|
||||
// this.lelong_details = [null];
|
||||
// // this.loading = false;
|
||||
// });
|
||||
// },
|
||||
// clickModal(norujukan) {
|
||||
// this.norujukan = norujukan;
|
||||
// this.marhuns = this.norujukan.lelongbidmarhun;
|
||||
// this.form.lelongbid_id = this.norujukan.id;
|
||||
// this.form.test = 1;
|
||||
// this.form.hargabida =
|
||||
// parseFloat(this.form.test) + parseFloat(this.norujukan.hargaasas);
|
||||
// },
|
||||
// calcTotal() {
|
||||
// this.form.hargabida =
|
||||
// parseFloat(this.form.test) + parseFloat(this.norujukan.hargaasas);
|
||||
// // console.log(this.norujukan);
|
||||
// // console.log(value);
|
||||
// },
|
||||
|
||||
// addToCart() {
|
||||
// axios
|
||||
// .post("/addToCart", this.form, {
|
||||
// headers: {
|
||||
// Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
// },
|
||||
// })
|
||||
// .then((response) => {
|
||||
// console.log(response);
|
||||
// // this.$forceUpdate();
|
||||
// // location.reload();
|
||||
// // this.liveData();
|
||||
// // this.myModal._isShown == false;
|
||||
// // call Cart component to refresh
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.log(error);
|
||||
// });
|
||||
// },
|
||||
// },
|
||||
};
|
||||
</script>
|
||||
@@ -26,7 +26,7 @@
|
||||
alt="profile photo"
|
||||
style="width: 225px; height: 230px"
|
||||
/>
|
||||
<div>
|
||||
<div v-if="this.status">
|
||||
<div class="row justify-content-center mt-4 mb-1">
|
||||
<div class="col-2 text_border text-start" style="border: none">
|
||||
Nama
|
||||
@@ -51,7 +51,24 @@
|
||||
</div>
|
||||
<div class="col-5 text_border">{{ data.notelbimbit }}</div>
|
||||
</div>
|
||||
<div class="row justify-content-center mb-1">
|
||||
<div class="col-2 text_border text-start" style="border: none">
|
||||
Front IC
|
||||
</div>
|
||||
<div class="col-5 text_border" style="height: 200px">
|
||||
{{ data.filename }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center mb-1">
|
||||
<div class="col-2 text_border text-start" style="border: none">
|
||||
Rear IC
|
||||
</div>
|
||||
<div class="col-5 text_border" style="height: 200px">
|
||||
{{ data_2.filename }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>Tiada Data</div>
|
||||
</div>
|
||||
<!-- <div class="card-footer">
|
||||
<p>*Sila hubungi *** jika terdapat masalah</p>
|
||||
@@ -75,7 +92,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
loading: false
|
||||
data_2: [],
|
||||
loading: false,
|
||||
status: false,
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -91,14 +110,20 @@ export default {
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
this.data = response.data[0];
|
||||
// this.total_hargabida = response.data[0].total_hargabida;
|
||||
console.log(response);
|
||||
this.loading=false;
|
||||
// this.loading = false;
|
||||
if (response.data.success == true) {
|
||||
this.status = true;
|
||||
this.data = response.data.message[0];
|
||||
this.data_2 = response.data.message[1];
|
||||
this.loading = false;
|
||||
} else {
|
||||
this.status = false;
|
||||
console.log(response.data.message);
|
||||
this.loading = false;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
alert(error);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<p>{{cawangan}}</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="row">
|
||||
@@ -240,6 +241,9 @@ export default {
|
||||
components: {
|
||||
Senarai,
|
||||
},
|
||||
props: [
|
||||
'cawangan'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
v$: useVuelidate(),
|
||||
@@ -258,8 +262,7 @@ export default {
|
||||
hargabida: "",
|
||||
},
|
||||
myModal: null,
|
||||
cuba: "",
|
||||
ngeteh: [],
|
||||
cuba: this.cawangan,
|
||||
};
|
||||
},
|
||||
validations() {
|
||||
@@ -285,7 +288,7 @@ export default {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
params: {
|
||||
caw_id: "3",
|
||||
caw_id: localStorage.getItem('lelong_id'),
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -293,118 +296,6 @@ export default {
|
||||
this.lelong_details = response.data[0];
|
||||
this.response = response.data[0].lelongbid;
|
||||
this.sags = this.response;
|
||||
this.ngeteh = this.allCarts;
|
||||
|
||||
// console.log(this.sags);
|
||||
// console.log(this.allCarts);
|
||||
|
||||
// this.sags.forEach(function (element) {
|
||||
// var test = ["103"];
|
||||
// if (element.id == test) {
|
||||
// console.log("existed");
|
||||
// }
|
||||
// // console.log(element.id);
|
||||
// });
|
||||
|
||||
let nathaliaPals = [
|
||||
"Ernest",
|
||||
"Jack",
|
||||
"Peter",
|
||||
"Miley",
|
||||
"Sally",
|
||||
"Xavier",
|
||||
];
|
||||
let johnPals = ["Jesus", "Ernest", "Joe", "Peter", "James", "Monica"];
|
||||
let commonPals = [];
|
||||
|
||||
nathaliaPals.forEach((pal) => {
|
||||
if (johnPals.includes(pal)) {
|
||||
return commonPals.push(pal);
|
||||
}
|
||||
});
|
||||
// console.log(commonPals);
|
||||
|
||||
let existed = [];
|
||||
|
||||
// console.log(this.allCarts);
|
||||
this.sags.forEach((exist) => {
|
||||
if (this.ngeteh.includes(exist.id)) {
|
||||
return existed.push(pal);
|
||||
}
|
||||
});
|
||||
// console.log(existed);
|
||||
|
||||
var array1 = new Array("a", "b", "c", "d", "e", "f");
|
||||
var array2 = new Array("c", "e");
|
||||
// console.log(array1);
|
||||
// console.log(this.sags);
|
||||
// console.log(this.allCarts);
|
||||
|
||||
for (var i = 0; i < array2.length; i++) {
|
||||
var arrlen = array1.length;
|
||||
for (var j = 0; j < arrlen; j++) {
|
||||
if (array2[i] == array1[j]) {
|
||||
array1 = array1.slice(0, j).concat(array1.slice(j + 1, arrlen));
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(array1);
|
||||
|
||||
var array1 = new Array("a", "b", "c", "d", "e", "f");
|
||||
var array2 = new Array("c", "e");
|
||||
|
||||
for (var i = 0; i < array2.length; i++) {
|
||||
var arrlen = array1.length;
|
||||
for (var j = 0; j < arrlen; j++) {
|
||||
if (array2[i] == array1[j]) {
|
||||
array1 = array1.slice(0, j).concat(array1.slice(j + 1, arrlen));
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(array1);
|
||||
|
||||
const propertyNames = Object.keys(this.sags);
|
||||
|
||||
const preference = {
|
||||
ethnicity: {
|
||||
value: "Gurung",
|
||||
rank: "asa",
|
||||
},
|
||||
occupation: {
|
||||
value: "Banker",
|
||||
rank: "ss",
|
||||
},
|
||||
};
|
||||
|
||||
const preferenceRank = {};
|
||||
for (const [key, { rank }] of Object.entries(preference)) {
|
||||
preferenceRank[rank] = key;
|
||||
}
|
||||
|
||||
// console.log(preferenceRank);
|
||||
// console.log(this.sags);
|
||||
// console.log(propertyNames);
|
||||
// console.log(nathaliaPals);
|
||||
|
||||
// this.allCarts.forEach(function (element) {
|
||||
// if (element.lelongbid_id == norujukan.id) {
|
||||
// } else {
|
||||
// }
|
||||
|
||||
// // console.log(element.lelongbid_id);
|
||||
// });
|
||||
|
||||
// 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(set);
|
||||
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
Reference in New Issue
Block a user