From 7b08280693ee949b3b2408866be1909d66070fca Mon Sep 17 00:00:00 2001 From: Amir Date: Thu, 25 Aug 2022 10:37:14 +0800 Subject: [PATCH] add marhun_desc, fix harga bidaan input --- src/components/bid-record/BidRecordList.vue | 2 - src/components/cart/CartListNew.vue | 65 +++++++++++---------- src/components/list/ListItem.vue | 56 +++++++++--------- 3 files changed, 63 insertions(+), 60 deletions(-) diff --git a/src/components/bid-record/BidRecordList.vue b/src/components/bid-record/BidRecordList.vue index 24bec67..b4bf918 100644 --- a/src/components/bid-record/BidRecordList.vue +++ b/src/components/bid-record/BidRecordList.vue @@ -117,7 +117,6 @@ Jenis Karat Berat - Nota Harga Asas @@ -130,7 +129,6 @@ {{ marhun.marhun }} {{ marhun.karat }} {{ marhun.berat }}g - {{ marhun.nota }} RM{{ marhun.hargaasas }} diff --git a/src/components/cart/CartListNew.vue b/src/components/cart/CartListNew.vue index a98d619..b67ec5c 100644 --- a/src/components/cart/CartListNew.vue +++ b/src/components/cart/CartListNew.vue @@ -342,7 +342,7 @@
Jumlah Harga Asas (A)
@@ -358,35 +358,9 @@
-
-
- -
-
-
- RM - -
-
-
-
-
- *Minimum tambahan harga bida adalah RM1. -
-
- *Gandaan ringgit sahaja dibenarkan. -
-
-
-
- +
@@ -395,10 +369,36 @@ type="text" class="form-control" v-model="jumlahBidaan" + v-on:keyup="calcDiff()" + /> +
+
+
+
+
+ +
+
+
+ RM +
+
+
+
+ *Minimum beza harga adalah RM1. +
+
+ *Gandaan ringgit sahaja dibenarkan. +
+
+
@@ -662,7 +662,7 @@ export default { openModal(value) { this.theSurat = value; this.tambahanBidaan = value.hargabida - value.hargaasas; - this.jumlahBidaan = value.hargabida; + this.jumlahBidaan = parseFloat(value.hargabida); this.hargaAsas = value.hargaasas; }, deleteItem(value) { @@ -694,6 +694,10 @@ export default { this.jumlahBidaan = parseFloat(this.hargaAsas) + parseFloat(this.tambahanBidaan); }, + calcDiff() { + this.tambahanBidaan = + parseFloat(this.jumlahBidaan) - parseFloat(this.hargaAsas); + }, updateItem(value) { this.v$.$validate(); if (!this.v$.$error) { @@ -721,7 +725,6 @@ export default { }, bidderSelectBidItem() { if (this.isSuccess == true) { - this.$refs.daftarBidaanClose.click(); this.loading = true; axios .post("/bidder/biditem", this.formRegisterBid, { @@ -730,11 +733,13 @@ export default { }, }) .then((response) => { + this.$refs.daftarBidaanClose.click(); this.loading = false; console.log(response); this.$emit("reloadComponent"); }) .catch((error) => { + this.$refs.daftarBidaanClose.click(); this.loading = false; console.log(error); }); diff --git a/src/components/list/ListItem.vue b/src/components/list/ListItem.vue index 63d5d96..218c485 100644 --- a/src/components/list/ListItem.vue +++ b/src/components/list/ListItem.vue @@ -8,7 +8,7 @@ -
+
@@ -132,15 +132,13 @@ Jenis Marhun Karat Berat - Nota Harga Asas {{ index + 1 }} - {{ marhun.marhun }} + {{ marhun.marhun_desc }} {{ marhun.karat }} {{ marhun.berat }}g - {{ marhun.nota }} RM{{ marhun.hargaasas }} @@ -153,7 +151,7 @@
Jumlah Harga Asas (A)
@@ -169,9 +167,25 @@
+
+
+ +
+
+
+ RM + +
+
+
- +
@@ -181,7 +195,7 @@ type="text" id="tambahanbida" class="form-control" - @keyup="calcTotal()" + disabled />
@@ -193,7 +207,7 @@ v-if="v$.tambahan.$error" >
- *Minimum tambahan harga bida adalah RM1. + *Minimum beza harga adalah RM1.
*Gandaan ringgit sahaja dibenarkan. @@ -202,22 +216,6 @@
-
-
- -
-
-
- RM - -
-
-
@@ -338,15 +336,17 @@ export default { this.norujukan = norujukan; this.marhuns = this.norujukan.lelongbidmarhun; this.form.lelongbid_id = this.norujukan.id; - this.tambahan = ''; - this.form.hargabida = - // parseFloat(this.tambahan) + parseFloat(this.norujukan.hargaasas); - parseFloat(this.norujukan.hargaasas); + this.tambahan = ""; + this.form.hargabida = ""; }, calcTotal() { this.form.hargabida = parseFloat(this.tambahan) + parseFloat(this.norujukan.hargaasas); }, + calcDiff() { + this.tambahan = + parseFloat(this.form.hargabida) - parseFloat(this.norujukan.hargaasas); + }, addToCart() { this.v$.$validate();