From 2960264b1680419f09528d432f22fe9326ad5547 Mon Sep 17 00:00:00 2001 From: "ajat91.sudrajat" Date: Tue, 28 Dec 2021 19:33:23 +0700 Subject: [PATCH] Config Menu Partner --- src/component/ProductComponent.js | 24 ++++++++++++++++++++++++ src/store/product.js | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/component/ProductComponent.js b/src/component/ProductComponent.js index 5038449..1e79010 100644 --- a/src/component/ProductComponent.js +++ b/src/component/ProductComponent.js @@ -79,6 +79,26 @@ export const ProductComponent = observer((props) => { currency: "IDR", }).format(text), }, + { + title: "Harga Jual", + dataIndex: "mark_up_price", + key: "mark_up_price", + render: (text) => + new Intl.NumberFormat("id-ID", { + style: "currency", + currency: "IDR", + }).format(text), + }, + { + title: "Harga", + dataIndex: "price", + key: "price", + render: (text) => + new Intl.NumberFormat("id-ID", { + style: "currency", + currency: "IDR", + }).format(text), + }, { title: "Supplier", dataIndex: "supplier_name", @@ -121,7 +141,11 @@ export const ProductComponent = observer((props) => { if (store.authentication.userData.role !== "Admin") columns.pop(); if (store.authentication.userData.role !== "Admin") delete columns[4]; if (store.authentication.userData.role !== "Admin") delete columns[2]; + if (store.authentication.userData.role !== "Admin") delete columns[3]; if (store.authentication.userData.role !== "Admin") delete columns[6]; + if (store.authentication.userData.role === "Admin") delete columns[3]; + if (store.authentication.userData.role === "Admin") delete columns[5]; + if (store.authentication.userData.role !== "Admin") delete columns[8]; const deleteData = async (id) => { try { diff --git a/src/store/product.js b/src/store/product.js index b7d6e7c..8bd3c91 100644 --- a/src/store/product.js +++ b/src/store/product.js @@ -40,7 +40,7 @@ export class Product { async getData() { try { const response = await http.get(`/product/all?supplier=${this.filterSupplier}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`); - //console.log(response) + console.log(response) this.data = response.body.data.map((item, idx) => { item.key = idx; return item