Commit ff0becda by tdgiang

update build

parent 422f6984
......@@ -351,6 +351,10 @@
"ERROR_PERMISSION_IS_EXIST":"Nhóm quyền đã tồn tại",
"ERROR_CODE_IS_EXISTS":"Mã code đã tồn tại",
"ERROR_NAME_IS_EXISTS":"Tên sản phẩm đã tồn tại"
"ERROR_NAME_IS_EXISTS":"Tên sản phẩm đã tồn tại",
"ERROR_CODE_IS_EXITS":"Mã code đã tồn tại",
"ERROR_NAME_IS_EXITS":"Tên sản phẩm đã tồn tại"
}
......@@ -71,9 +71,25 @@ const ToolNotificate = (props) => {
}
}
const getData = async () => {
const getData = async (init) => {
props.showLoading()
const res = await listFee({
let res
if (init) {
setPageIndex(0)
res = await listFee({
text_search: searchDebount,
page_no: 0,
page_size: pageSize,
from_date: startDate ? convertDate(startDate) : null,
to_date: endDate ? convertDate(endDate) : null,
store_id: module,
merchant_id: merchant,
status: status,
})
} else {
res = await listFee({
text_search: searchDebount,
page_no: pageIndex + 1,
page_size: pageSize,
......@@ -83,8 +99,9 @@ const ToolNotificate = (props) => {
merchant_id: merchant,
status: status,
})
}
props.hideLoading()
console.log('res.data.data', res.data.data)
if (res.data.code == 200 && res.data.data) {
setReport(res.data.data.data)
......@@ -105,8 +122,12 @@ const ToolNotificate = (props) => {
}
useEffect(() => {
getData()
}, [searchDebount, pageIndex, startDate, module, merchant, status])
getData(false)
}, [pageIndex])
useEffect(() => {
getData(true)
}, [searchDebount, startDate, module, merchant, status])
return (
<LogAuth
......
......@@ -38,9 +38,26 @@ const ToolNotificate = (props) => {
setEndDate(end)
}
const getData = async () => {
const getData = async (init) => {
props.showLoading()
const res = await listTransaction({
let res
if (init) {
setPageIndex(0)
res = await listTransaction({
order_code: searchDebount,
applications,
page_no: 0,
page_size: pageSize,
from_date: startDate ? convertDate(startDate) : null,
to_date: endDate ? convertDate(endDate) : null,
type_code: type,
merchant_id: merchant,
store_id: store,
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
})
} else {
res = await listTransaction({
order_code: searchDebount,
applications,
page_no: pageIndex + 1,
......@@ -53,6 +70,8 @@ const ToolNotificate = (props) => {
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
})
}
props.hideLoading()
if (res.data.code == 200 && res.data.data) {
const newList = res.data.data.data.map((e, i) => {
......@@ -72,8 +91,12 @@ const ToolNotificate = (props) => {
}
useEffect(() => {
getData()
}, [searchDebount, pageIndex, startDate, type, merchant, store])
getData(false)
}, [pageIndex])
useEffect(() => {
getData(true)
}, [searchDebount, startDate, type, merchant, store])
useEffect(() => {
if (merchant) {
......
......@@ -50,16 +50,27 @@ const ToolNotificate = (props) => {
}
}
const getData = async () => {
const getData = async (init) => {
props.showLoading()
const res = await getListProduct({
let res
if (init) {
setPageIndex(0)
res = await getListProduct({
code: searchDebount,
page_no: 0,
page_size: pageSize,
status,
type_id: type,
})
} else {
res = await getListProduct({
code: searchDebount,
page_no: pageIndex + 1,
page_size: pageSize,
status,
type_id: type,
})
}
props.hideLoading()
if (res.data.code == 200 && res.data.data) {
......@@ -83,8 +94,12 @@ const ToolNotificate = (props) => {
}
useEffect(() => {
getData()
}, [searchDebount, pageIndex, status, type])
getData(false)
}, [pageIndex])
useEffect(() => {
getData(true)
}, [searchDebount, status, type])
const removeItem = async (id) => {
props.showLoading()
......
......@@ -133,7 +133,7 @@ function TableList(props) {
width: 120,
}}
>
sn phm
Hành động
</TableCell>
</TableRow>
</TableHead>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment