Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!54
This commit is contained in:
commit
e7045fbfbd
|
@ -129,13 +129,15 @@ export const ProductComponent = observer((props) => {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (store.authentication.userData.role !== "Admin") columns.pop();
|
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[3];
|
||||||
if (store.authentication.userData.role != "Admin Partner") delete columns[4];
|
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[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 Partner") delete columns[7];
|
||||||
if (store.authentication.userData.role !== "Admin") delete columns[8];
|
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) => {
|
const deleteData = async (id) => {
|
||||||
try {
|
try {
|
||||||
|
@ -288,7 +290,10 @@ export const ProductComponent = observer((props) => {
|
||||||
bordered
|
bordered
|
||||||
pagination={{
|
pagination={{
|
||||||
pageSize: store.product.pageSize,
|
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,
|
current: store.product.page + 1,
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
simple: false,
|
simple: false,
|
||||||
|
|
|
@ -233,7 +233,7 @@ export const SubcategoryComponent = observer((props) => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical">
|
<Form form={form} layout="vertical">
|
||||||
{!idData && (
|
{idData === "" && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="code"
|
name="code"
|
||||||
label="Code"
|
label="Code"
|
||||||
|
|
|
@ -277,14 +277,14 @@ export const Product = observer(() => {
|
||||||
required: true,
|
required: true,
|
||||||
message: "Please input Destination Number!",
|
message: "Please input Destination Number!",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
pattern: /^(?:\d*)$/,
|
// pattern: /^(?:\d*)$/,
|
||||||
message: "Value should contain just number",
|
// message: "Value should contain just number",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
pattern: /^[\d]{10,12}$/,
|
// pattern: /^[\d]{1,12}$/,
|
||||||
message: "Value should be 10 - 12 character",
|
// message: "Value should be 1 - 12 character",
|
||||||
},
|
// },
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
|
|
|
@ -6,6 +6,7 @@ export class Product {
|
||||||
pageSize = 10
|
pageSize = 10
|
||||||
data = [];
|
data = [];
|
||||||
total_data = 0;
|
total_data = 0;
|
||||||
|
total_data_partner=0;
|
||||||
filterSupplier = null;
|
filterSupplier = null;
|
||||||
filterSubCategory = null;
|
filterSubCategory = null;
|
||||||
visibleModalProduct = false;
|
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}`);
|
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=10&sub-category=${id}`);
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.dataProductPartner = response.body.data
|
this.dataProductPartner = response.body.data
|
||||||
|
this.total_data_partner= response?.body?.count ?? 0
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user