Perbaikan Menu Produk
This commit is contained in:
parent
ac78d8ab0b
commit
aed34857ee
|
@ -129,13 +129,15 @@ export const ProductComponent = observer((props) => {
|
|||
},
|
||||
];
|
||||
if (store.authentication.userData.role !== "Admin") columns.pop();
|
||||
if (store.authentication.userData.role === "Admin Partner") delete columns[2];
|
||||
//if (store.authentication.userData.role === "Admin Partner") delete columns[2];
|
||||
if (store.authentication.userData.role === "Admin Partner") delete columns[3];
|
||||
if (store.authentication.userData.role != "Admin Partner") delete columns[4];
|
||||
if (store.authentication.userData.role !== "Admin") delete columns[6];
|
||||
if (store.authentication.userData.role !== "Admin") delete columns[2];
|
||||
if (store.authentication.userData.role !== "Admin") delete columns[5];
|
||||
if (store.authentication.userData.role === "Admin Partner") delete columns[7];
|
||||
if (store.authentication.userData.role !== "Admin") delete columns[8];
|
||||
if (store.authentication.userData.role === "Admin Partner") delete columns[5];
|
||||
//if (store.authentication.userData.role === "Admin Partner") delete columns[5];
|
||||
|
||||
const deleteData = async (id) => {
|
||||
try {
|
||||
|
@ -288,7 +290,10 @@ export const ProductComponent = observer((props) => {
|
|||
bordered
|
||||
pagination={{
|
||||
pageSize: store.product.pageSize,
|
||||
total: store.product.total_data,
|
||||
total:
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? store.product.total_data_partner
|
||||
: store.product.total_data,
|
||||
current: store.product.page + 1,
|
||||
showSizeChanger: true,
|
||||
simple: false,
|
||||
|
|
|
@ -277,14 +277,14 @@ export const Product = observer(() => {
|
|||
required: true,
|
||||
message: "Please input Destination Number!",
|
||||
},
|
||||
{
|
||||
pattern: /^(?:\d*)$/,
|
||||
message: "Value should contain just number",
|
||||
},
|
||||
{
|
||||
pattern: /^[\d]{10,12}$/,
|
||||
message: "Value should be 10 - 12 character",
|
||||
},
|
||||
// {
|
||||
// pattern: /^(?:\d*)$/,
|
||||
// message: "Value should contain just number",
|
||||
// },
|
||||
// {
|
||||
// pattern: /^[\d]{1,12}$/,
|
||||
// message: "Value should be 1 - 12 character",
|
||||
// },
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
|
|
|
@ -6,6 +6,7 @@ export class Product {
|
|||
pageSize = 10
|
||||
data = [];
|
||||
total_data = 0;
|
||||
total_data_partner=0;
|
||||
filterSupplier = null;
|
||||
filterSubCategory = null;
|
||||
visibleModalProduct = false;
|
||||
|
@ -101,6 +102,7 @@ export class Product {
|
|||
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=10&sub-category=${id}`);
|
||||
console.log(response)
|
||||
this.dataProductPartner = response.body.data
|
||||
this.total_data_partner= response?.body?.count ?? 0
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user