From e6feac8e6ce2ea3c428d4307251634708b676c25 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 23 Aug 2023 17:03:23 +0700 Subject: page daftar pengiriman --- public/images/BOX(1).svg | 47 +++++ public/images/BOX_DELIVER_(1).svg | 72 +++++++ public/images/open-box(1).svg | 43 ++++ .../elements/Navbar/NavbarUserDropdown.jsx | 1 + src/lib/auth/components/Menu.jsx | 3 + src/lib/shipment/api/listShipment.js | 9 + src/lib/shipment/components/Shipments.jsx | 219 +++++++++++++++++++++ src/lib/treckingAwb/api/getManifest.js | 0 src/lib/treckingAwb/component/Manifest.jsx | 72 +++++++ src/pages/my/menu.jsx | 1 + src/pages/my/shipments/index.jsx | 29 +++ 11 files changed, 496 insertions(+) create mode 100644 public/images/BOX(1).svg create mode 100644 public/images/BOX_DELIVER_(1).svg create mode 100644 public/images/open-box(1).svg create mode 100644 src/lib/shipment/api/listShipment.js create mode 100644 src/lib/shipment/components/Shipments.jsx create mode 100644 src/lib/treckingAwb/api/getManifest.js create mode 100644 src/lib/treckingAwb/component/Manifest.jsx create mode 100644 src/pages/my/shipments/index.jsx diff --git a/public/images/BOX(1).svg b/public/images/BOX(1).svg new file mode 100644 index 00000000..61e41e62 --- /dev/null +++ b/public/images/BOX(1).svg @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/public/images/BOX_DELIVER_(1).svg b/public/images/BOX_DELIVER_(1).svg new file mode 100644 index 00000000..c4a9d809 --- /dev/null +++ b/public/images/BOX_DELIVER_(1).svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + diff --git a/public/images/open-box(1).svg b/public/images/open-box(1).svg new file mode 100644 index 00000000..f9dccef1 --- /dev/null +++ b/public/images/open-box(1).svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + diff --git a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx index 7848124c..075462e9 100644 --- a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx +++ b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx @@ -15,6 +15,7 @@ const NavbarUserDropdown = () => {
Daftar Quotation Daftar Transaksi + Daftar Pengiriman Invoice & Faktur Pajak Wishlist Daftar Alamat diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 386b817c..e54992be 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -15,6 +15,9 @@ const Menu = () => { Daftar Transaksi + + Daftar Pengiriman + Invoice & Faktur Pajak diff --git a/src/lib/shipment/api/listShipment.js b/src/lib/shipment/api/listShipment.js new file mode 100644 index 00000000..a9237b76 --- /dev/null +++ b/src/lib/shipment/api/listShipment.js @@ -0,0 +1,9 @@ +import odooApi from "@/core/api/odooApi"; +import { getAuth } from "@/core/utils/auth" + +export const listShipments = async ({query}) => { + const auth = getAuth() + const list = await odooApi('GET', `/api/v1/partner/${auth.partnerId}/stock-picking?${query}`) + + return list; +} diff --git a/src/lib/shipment/components/Shipments.jsx b/src/lib/shipment/components/Shipments.jsx new file mode 100644 index 00000000..eb14c77f --- /dev/null +++ b/src/lib/shipment/components/Shipments.jsx @@ -0,0 +1,219 @@ +import DesktopView from '@/core/components/views/DesktopView' +import MobileView from '@/core/components/views/MobileView' +import Menu from '@/lib/auth/components/Menu' +import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' +import ImageNext from 'next/image' +import { useRouter } from 'next/router' +import { useQuery } from 'react-query' +import _ from 'lodash-contrib' +import Spinner from '@/core/components/elements/Spinner/Spinner' +import Manifest from '@/lib/treckingAwb/component/Manifest' +import { useState } from 'react' + +const { listShipments } = require('../api/listShipment') + +const Shipments = () => { + const router = useRouter() + const { q = '', page = 1 } = router.query + + const limit = 15 + + const query = { + name: q, + offset: (page - 1) * limit, + limit + } + + const queryString = _.toQuery(query) + + const { data: shipments } = useQuery('shipments', () => listShipments({ query: queryString })) + const [ idAWB, setIdAWB ] = useState(null) + + const closePopup = () => { + setIdAWB(null) + } + + const handleSubmit = async () => {} + return ( + <> + +
+
+
+
+ +
+

Pending

+

99 {'>'}

+
+
+
+ +
+

Pengiriman

+

99 {'>'}

+
+
+
+ +
+

Selesai

+

99 {'>'}

+
+
+ +
+ setInputQuery(e.target.value)} + /> + +
+
+
+ +
+
+ +
+
+
+

Pengiriman

+ +
+
+

Pending

+
+
+ +
+
+

+ {shipments?.summary?.pendingCount} Pesanan +

+
+
+
Pengiriman
+
+
+ +
+
+

+ {shipments?.summary?.shipmentCount} Pesanan +

+
+
+
Pesanan Tiba
+
+
+ +
+
+

+ {shipments?.summary?.completedCount} Pesanan +

+
+
+
+
+
+

Detail Pengiriman

+
+ setInputQuery(e.target.value)} + /> + +
+
+ + + + + + + + + + + + + + {!shipments && ( + + + + )} + {shipments && shipments?.pickings?.length == 0 && ( + + + + )} + {shipments?.pickings.map((shipment) => ( + + + + + + + + + + ))} + +
TanggalNo. ResiNo. PengirimanSales OrderPurchase OrderExpedisiStatus
+
+ +
+
Tidak ada transaksi
{shipment.date || '-'}{shipment.trackingNumber || '-'}{shipment.name || '-'}{shipment.saleOrder.name || '-'}{shipment.saleOrder.clientOrderRef || '-'}{shipment.carrierName || '-'} + +
+
+
+
+ +
+ + ) +} + +export default Shipments diff --git a/src/lib/treckingAwb/api/getManifest.js b/src/lib/treckingAwb/api/getManifest.js new file mode 100644 index 00000000..e69de29b diff --git a/src/lib/treckingAwb/component/Manifest.jsx b/src/lib/treckingAwb/component/Manifest.jsx new file mode 100644 index 00000000..b8ad78c4 --- /dev/null +++ b/src/lib/treckingAwb/component/Manifest.jsx @@ -0,0 +1,72 @@ +import BottomPopup from '@/core/components/elements/Popup/BottomPopup' +import { useState } from 'react' + +const Manifest = ({ idAWB, closePopup }) => { + console.log('ini adalah', idAWB) + const airway = { + waybillNumber: '1234', + deliveryOrder: { + name: 'name', + carrier: 'carrier' + }, + manifests: [ + { + datetime: '12/12/2023', + description: 'ini descripsi' + } + ] + } + return ( + <> + +
+
+
No Pengiriman
+
{airway?.deliveryOrder?.name}
+
+
+
Kurir
+
{airway?.deliveryOrder?.carrier}
+
+
+
No Resi
+
{airway?.waybillNumber}
+
+
+ +
+
Status Pengiriman
+
    + {airway?.manifests?.map((manifest, index) => ( +
  1. +
    + +

    + {manifest.description} +

    +
  2. + ))} + {(!airway?.manifests || airway?.manifests?.length == 0) && ( +
    Belum ada pengiriman
    + )} +
+
+
+ + ) +} + +export default Manifest diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index c8e1e7e9..8d209fba 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -42,6 +42,7 @@ export default function Menu() {
Daftar Quotation Daftar Transaksi + Daftar Pengiriman Invoice & Faktur Pajak Wishlist
diff --git a/src/pages/my/shipments/index.jsx b/src/pages/my/shipments/index.jsx new file mode 100644 index 00000000..cb69c4e9 --- /dev/null +++ b/src/pages/my/shipments/index.jsx @@ -0,0 +1,29 @@ +import Seo from '@/core/components/Seo' +import AppLayout from '@/core/components/layouts/AppLayout' +import BasicLayout from '@/core/components/layouts/BasicLayout' +import DesktopView from '@/core/components/views/DesktopView' +import MobileView from '@/core/components/views/MobileView' +import IsAuth from '@/lib/auth/components/IsAuth' +import dynamic from 'next/dynamic' + +const ShipmentsComponent = dynamic(() => import('@/lib/shipment/components/Shipments')) + +export default function MyShipments() { + return ( + + + + + + + + + + + + + + + + ) +} -- cgit v1.2.3 From 60f0b9d33335719b15f60f4b99bd80a48b7da346 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 28 Aug 2023 16:55:26 +0700 Subject: add icon menu sidebar, add pagination --- public/images/icon/icon_daftar_alamat.svg | 21 +++ public/images/icon/icon_daftar_quotation.svg | 28 ++++ public/images/icon/icon_daftar_transaksi.svg | 36 +++++ public/images/icon/icon_invoice.svg | 39 +++++ public/images/icon/icon_layanan_pelanggan.svg | 20 +++ public/images/icon/icon_logout.svg | 19 +++ public/images/icon/icon_pengiriman.svg | 20 +++ public/images/icon/icon_profile.svg | 16 ++ public/images/icon/icon_wishlist.svg | 14 ++ src/lib/auth/components/Menu.jsx | 49 ++++-- src/lib/shipment/components/Shipments.jsx | 122 +++++++++++++-- src/lib/treckingAwb/api/getManifest.js | 9 ++ src/lib/treckingAwb/component/Manifest.jsx | 217 +++++++++++++++++++------- 13 files changed, 531 insertions(+), 79 deletions(-) create mode 100644 public/images/icon/icon_daftar_alamat.svg create mode 100644 public/images/icon/icon_daftar_quotation.svg create mode 100644 public/images/icon/icon_daftar_transaksi.svg create mode 100644 public/images/icon/icon_invoice.svg create mode 100644 public/images/icon/icon_layanan_pelanggan.svg create mode 100644 public/images/icon/icon_logout.svg create mode 100644 public/images/icon/icon_pengiriman.svg create mode 100644 public/images/icon/icon_profile.svg create mode 100644 public/images/icon/icon_wishlist.svg diff --git a/public/images/icon/icon_daftar_alamat.svg b/public/images/icon/icon_daftar_alamat.svg new file mode 100644 index 00000000..294f4e5e --- /dev/null +++ b/public/images/icon/icon_daftar_alamat.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/public/images/icon/icon_daftar_quotation.svg b/public/images/icon/icon_daftar_quotation.svg new file mode 100644 index 00000000..aab22634 --- /dev/null +++ b/public/images/icon/icon_daftar_quotation.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + diff --git a/public/images/icon/icon_daftar_transaksi.svg b/public/images/icon/icon_daftar_transaksi.svg new file mode 100644 index 00000000..cd4cfb67 --- /dev/null +++ b/public/images/icon/icon_daftar_transaksi.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff --git a/public/images/icon/icon_invoice.svg b/public/images/icon/icon_invoice.svg new file mode 100644 index 00000000..46a4b451 --- /dev/null +++ b/public/images/icon/icon_invoice.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + diff --git a/public/images/icon/icon_layanan_pelanggan.svg b/public/images/icon/icon_layanan_pelanggan.svg new file mode 100644 index 00000000..3e68e4e5 --- /dev/null +++ b/public/images/icon/icon_layanan_pelanggan.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/public/images/icon/icon_logout.svg b/public/images/icon/icon_logout.svg new file mode 100644 index 00000000..1e70b078 --- /dev/null +++ b/public/images/icon/icon_logout.svg @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/public/images/icon/icon_pengiriman.svg b/public/images/icon/icon_pengiriman.svg new file mode 100644 index 00000000..02d60867 --- /dev/null +++ b/public/images/icon/icon_pengiriman.svg @@ -0,0 +1,20 @@ + + + + + + + diff --git a/public/images/icon/icon_profile.svg b/public/images/icon/icon_profile.svg new file mode 100644 index 00000000..f6c9e3cf --- /dev/null +++ b/public/images/icon/icon_profile.svg @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/public/images/icon/icon_wishlist.svg b/public/images/icon/icon_wishlist.svg new file mode 100644 index 00000000..97b45cab --- /dev/null +++ b/public/images/icon/icon_wishlist.svg @@ -0,0 +1,14 @@ + + + + + + + diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index e54992be..939a0d5f 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -1,5 +1,6 @@ import Link from '@/core/components/elements/Link/Link' import { useRouter } from 'next/router' +import ImageNext from 'next/image' const Menu = () => { const router = useRouter() @@ -10,33 +11,61 @@ const Menu = () => {
Menu
- Daftar Quotation +
+ +

Daftar Quotation

+
- Daftar Transaksi +
+ +

Daftar Transaksi

+
- Daftar Pengiriman +
+ +

Daftar Pengiriman

+
- Invoice & Faktur Pajak +
+ +

Invoice & Faktur Pajak

+
- Wishlist +
+ +

Wishlist

+
-
Pusat Bantuan
- Layanan Pelanggan + +
+ +

Layanan Pelanggan

+
+
Pengaturan Akun
- Daftar Alamat +
+ +

Daftar Alamat

+
- Profil Saya +
+ +

Profil Saya

+
) diff --git a/src/lib/shipment/components/Shipments.jsx b/src/lib/shipment/components/Shipments.jsx index eb14c77f..d62afcb7 100644 --- a/src/lib/shipment/components/Shipments.jsx +++ b/src/lib/shipment/components/Shipments.jsx @@ -1,7 +1,7 @@ import DesktopView from '@/core/components/views/DesktopView' import MobileView from '@/core/components/views/MobileView' import Menu from '@/lib/auth/components/Menu' -import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' +import { EllipsisVerticalIcon, MagnifyingGlassIcon } from '@heroicons/react/24/outline' import ImageNext from 'next/image' import { useRouter } from 'next/router' import { useQuery } from 'react-query' @@ -9,6 +9,9 @@ import _ from 'lodash-contrib' import Spinner from '@/core/components/elements/Spinner/Spinner' import Manifest from '@/lib/treckingAwb/component/Manifest' import { useState } from 'react' +import Pagination from '@/core/components/elements/Pagination/Pagination' +import Link from 'next/link' +import TransactionStatusBadge from '@/lib/transaction/components/TransactionStatusBadge' const { listShipments } = require('../api/listShipment') @@ -19,21 +22,30 @@ const Shipments = () => { const limit = 15 const query = { - name: q, + q: q, offset: (page - 1) * limit, limit } - + console.log('ini query', query) + const [inputQuery, setInputQuery] = useState(q) const queryString = _.toQuery(query) const { data: shipments } = useQuery('shipments', () => listShipments({ query: queryString })) - const [ idAWB, setIdAWB ] = useState(null) + const [idAWB, setIdAWB] = useState(null) + + const pageCount = Math.ceil(shipments?.pickingTotal / limit) + let pageQuery = _.omit(query, ['limit', 'offset', 'context']) + pageQuery = _.pickBy(pageQuery, _.identity) + pageQuery = _.toQuery(pageQuery) const closePopup = () => { setIdAWB(null) } - const handleSubmit = async () => {} + const handleSubmit = async (e) => { + e.preventDefault() + router.push(`${router.pathname}?q=${inputQuery}`) + } return ( <> @@ -44,21 +56,30 @@ const Shipments = () => {

Pending

-

99 {'>'}

+

+ {' '} + {shipments?.summary?.pendingCount} {'>'} +

- +

Pengiriman

-

99 {'>'}

+

+ {' '} + {shipments?.summary?.shipmentCount} {'>'} +

Selesai

-

99 {'>'}

+

+ {' '} + {shipments?.summary?.shipmentCount} {'>'} +

@@ -67,14 +88,80 @@ const Shipments = () => { type='text' className='form-input' placeholder='Cari Pengiriman...' - value='' + value={inputQuery} onChange={(e) => setInputQuery(e.target.value)} /> + + {shipments?.pickings.map((shipment) => ( +
+
+
+

+ Kurir :{' '} + + {shipment.carrierName || '-'} + +

+

No. Resi : {shipment.trackingNumber || '-'}

+
+
+ {shipment?.delivered && ( +
+

Pesanan Tiba

+
+ )} + {!shipment?.delivered && ( +
+

Sedang Dikirim

+
+ )} +
+
+
+
+
+ No. Transaksi + +

{shipment.saleOrder.name}

+ + {shipment.date} +
+
+ +
+
+
+ +
+ ))} + + + +
@@ -155,7 +242,7 @@ const Shipments = () => { type='text' className='form-input' placeholder='Cari Pengiriman...' - value='' + value={inputQuery} onChange={(e) => setInputQuery(e.target.value)} /> @@ -207,10 +297,16 @@ const Shipments = () => { ))} +
- +
) diff --git a/src/lib/treckingAwb/api/getManifest.js b/src/lib/treckingAwb/api/getManifest.js index e69de29b..7d78a5f2 100644 --- a/src/lib/treckingAwb/api/getManifest.js +++ b/src/lib/treckingAwb/api/getManifest.js @@ -0,0 +1,9 @@ +const { default: odooApi } = require("@/core/api/odooApi") +const { getAuth } = require("@/core/utils/auth") + +export const getManifest = async ({id}) => { + const auth = getAuth() + const manifest = await odooApi('GET', `/api/v1/partner/${auth.partnerId}/stock-picking/${id}/tracking`) + + return manifest +} \ No newline at end of file diff --git a/src/lib/treckingAwb/component/Manifest.jsx b/src/lib/treckingAwb/component/Manifest.jsx index b8ad78c4..185a9d55 100644 --- a/src/lib/treckingAwb/component/Manifest.jsx +++ b/src/lib/treckingAwb/component/Manifest.jsx @@ -1,70 +1,175 @@ +import odooApi from '@/core/api/odooApi' import BottomPopup from '@/core/components/elements/Popup/BottomPopup' -import { useState } from 'react' +import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner' +import { getAuth } from '@/core/utils/auth' +import { useEffect, useState } from 'react' +import { toast } from 'react-hot-toast' +import ImageNext from 'next/image' const Manifest = ({ idAWB, closePopup }) => { - console.log('ini adalah', idAWB) - const airway = { - waybillNumber: '1234', - deliveryOrder: { - name: 'name', - carrier: 'carrier' - }, - manifests: [ - { - datetime: '12/12/2023', - description: 'ini descripsi' - } + const [manifests, setManifests] = useState(null) + const [isLoading, setIsLoading] = useState(false) + + const formatCustomDate = (date) => { + const months = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec' ] + + const parts = date.split(' ') // Pisahkan tanggal dan waktu + const [datePart, timePart] = parts + const [yyyy, mm, dd] = datePart.split('-') + const [hh, min] = timePart.split(':') + + const monthAbbreviation = months[parseInt(mm, 10) - 1] + + return `${dd} ${monthAbbreviation} ${hh}:${min}` + } + + const getManifest = async () => { + setIsLoading(true) + const auth = getAuth() + const list = await odooApi( + 'GET', + `/api/v1/partner/${auth.partnerId}/stock-picking/${idAWB}/tracking` + ) + setManifests(list) + setIsLoading(false) + } + + useEffect(() => { + if (idAWB) { + getManifest() + } else { + setManifests(null) + } + }, [idAWB]) + + const [copied, setCopied] = useState(false) + + const handleCopyClick = () => { + const textToCopy = manifests?.waybillNumber + navigator.clipboard.writeText(textToCopy) + setCopied(true) + toast.success('No Resi Berhasil di Copy') + setTimeout(() => setCopied(false), 2000) // Reset copied state after 2 seconds } + return ( <> - -
-
-
No Pengiriman
-
{airway?.deliveryOrder?.name}
+ {isLoading && ( + +
Mohon Tunggu
+
+
-
-
Kurir
-
{airway?.deliveryOrder?.carrier}
+ + )} + {!isLoading && ( + +
+

Status Pesanan

+ {manifests?.delivered && ( +
+

Pesanan Tiba

+
+ )} + {!manifests?.delivered && ( +
+

Sedang Dikirim

+
+ )}
-
-
No Resi
-
{airway?.waybillNumber}
+
+

+ Estimasi tiba pada ({manifests?.eta}) +

+

+ Dikirim Menggunakan{' '} + {manifests?.deliveryOrder.carrier} +

+ {manifests?.waybillNumber && ( +
+

No. Resi

+
+

{manifests?.waybillNumber}

+ +
+
+ )}
-
+
+
+
    + {manifests?.manifests?.map((manifest, index) => ( + <> +
  1. + {manifests.delivered == true && index == 0 ? ( +
    + +
    + ) : ( +
    + )} + {manifests.delivered != true && ( +
    + )} -
    -
    Status Pengiriman
    -
      - {airway?.manifests?.map((manifest, index) => ( -
    1. -
      - -

      - {manifest.description} -

      -
    2. - ))} - {(!airway?.manifests || airway?.manifests?.length == 0) && ( -
      Belum ada pengiriman
      - )} -
    -
    - + + {manifests.delivered == true && index == 0 && ( +

    Sudah Sampai

    + )} +

    {manifest.description}

    +
  2. + + ))} +
+
+
+ )} ) } -- cgit v1.2.3 From 0dab223d410e1c6011bfb4e1e850dfe566c8d044 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 29 Aug 2023 14:11:23 +0700 Subject: add params etd di checkout --- public/images/BOX_DELIVERY_GREEN.svg | 71 +++++++++++++++++++++++++++++++ src/lib/checkout/components/Checkout.jsx | 18 ++++++++ src/lib/shipment/components/Shipments.jsx | 4 +- src/pages/my/menu.jsx | 53 ++++++++++++++++++++--- 4 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 public/images/BOX_DELIVERY_GREEN.svg diff --git a/public/images/BOX_DELIVERY_GREEN.svg b/public/images/BOX_DELIVERY_GREEN.svg new file mode 100644 index 00000000..45ae81c4 --- /dev/null +++ b/public/images/BOX_DELIVERY_GREEN.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index afb94c10..0eb05345 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -297,10 +297,12 @@ const Checkout = () => { order_line: JSON.stringify(productOrder), delivery_amount: biayaKirim, carrier_id: selectedCarrierId, + estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, voucher: activeVoucher, type: 'sale_order' } + if (query) { data.source = 'buy' } @@ -1444,6 +1446,22 @@ function calculateEstimatedArrival(duration) { return '' } +function splitDuration(duration){ + if (duration) { + let estimationDate = null + if (duration.includes('-')){ + estimationDate = duration.split('-') + estimationDate = parseInt(estimationDate[1]) + }else{ + estimationDate = parseInt(duration) + } + + return estimationDate + } + + return '' +} + const extractDuration = (text) => { const matches = text.match(/\d+(?:-\d+)?/g) diff --git a/src/lib/shipment/components/Shipments.jsx b/src/lib/shipment/components/Shipments.jsx index d62afcb7..c9d3e627 100644 --- a/src/lib/shipment/components/Shipments.jsx +++ b/src/lib/shipment/components/Shipments.jsx @@ -144,8 +144,8 @@ const Shipments = () => { onClick={() => setIdAWB(shipment.id)} className='flex items-center mt-1 gap-x-1 min-w-full' > - -

+ +

{shipment.lastManifest.description}

{'>'}

diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 8d209fba..124c87c9 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -6,6 +6,7 @@ import { deleteAuth } from '@/core/utils/auth' import IsAuth from '@/lib/auth/components/IsAuth' import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid' import { useRouter } from 'next/router' +import ImageNext from 'next/image' export default function Menu() { const auth = useAuth() @@ -40,11 +41,38 @@ export default function Menu() { Aktivitas Pembelian
- Daftar Quotation - Daftar Transaksi - Daftar Pengiriman - Invoice & Faktur Pajak - Wishlist + + {' '} +
+ +

Daftar Quotation

+
+
+ +
+ +

Daftar Transaksi

+
+
+ +
+ +

Daftar Pengiriman

+
+
+ + {' '} +
+ +

Invoice & Faktur Pajak

+
+
+ +
+ +

Wishlist

+
+
@@ -52,7 +80,13 @@ export default function Menu() { Pusat Bantuan
- Layanan Pelanggan + + {' '} +
+ +

Layanan Pelanggan

+
+
@@ -60,7 +94,12 @@ export default function Menu() { Pengaturan Akun
- Daftar Alamat + +
+ +

Daftar Alamat

+
+
-- cgit v1.2.3 From a08c6f9a773732c959e440dbcc653a6e80045e81 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 30 Aug 2023 15:29:52 +0700 Subject: change popup tracking history di page daftart transaksi dan quotation --- src/lib/transaction/components/Transaction.jsx | 53 ++++++++++++++++---------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 74f3dbd5..82eb1775 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -21,6 +21,7 @@ import Image from '@/core/components/elements/Image/Image' import { createSlug } from '@/core/utils/slug' import toTitleCase from '@/core/utils/toTitleCase' import useAirwayBill from '../hooks/useAirwayBill' +import Manifest from '@/lib/treckingAwb/component/Manifest' const Transaction = ({ id }) => { const { transaction } = useTransaction({ id }) @@ -31,6 +32,7 @@ const Transaction = ({ id }) => { const poNumber = useRef(null) const poFile = useRef(null) const [uploadPo, setUploadPo] = useState(false) + const [idAWB, setIdAWB] = useState(null) const openUploadPo = () => setUploadPo(true) const closeUploadPo = () => setUploadPo(false) const submitUploadPo = async () => { @@ -110,6 +112,10 @@ const Transaction = ({ id }) => { ) } + const closePopup = () => { + setIdAWB(null) + } + return ( transaction.data?.name && ( <> @@ -158,6 +164,7 @@ const Transaction = ({ id }) => {
+
@@ -179,26 +186,28 @@ const Transaction = ({ id }) => {
Pengiriman
- {queryAirwayBill.data?.airways?.map((airway) => ( + {transaction?.data?.pickings?.map((airway) => ( ))}
- {!queryAirwayBill?.data?.airways && ( + {transaction?.data?.pickings == 0 && (
Belum ada pengiriman
)}
@@ -368,27 +377,29 @@ const Transaction = ({ id }) => {
Pengiriman
-
- {queryAirwayBill.data?.airways?.map((airway) => ( +
+ {transaction?.data?.pickings?.map((airway) => ( ))}
- {!queryAirwayBill.data?.airways && ( + {transaction?.data?.pickings.length == 0 && (
Belum ada pengiriman
)} @@ -514,7 +525,7 @@ const Transaction = ({ id }) => {
- {queryAirwayBill.data?.airways?.map((airway) => ( + {/* {queryAirwayBill.data?.airways?.map((airway) => ( {
- ))} + ))} */} ) ) -- cgit v1.2.3