Commit ff0becda by tdgiang

update build

parent 422f6984
...@@ -351,6 +351,10 @@ ...@@ -351,6 +351,10 @@
"ERROR_PERMISSION_IS_EXIST":"Nhóm quyền đã tồn tại", "ERROR_PERMISSION_IS_EXIST":"Nhóm quyền đã tồn tại",
"ERROR_CODE_IS_EXISTS":"Mã code đã 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) => { ...@@ -71,9 +71,25 @@ const ToolNotificate = (props) => {
} }
} }
const getData = async () => { const getData = async (init) => {
props.showLoading() 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, text_search: searchDebount,
page_no: pageIndex + 1, page_no: pageIndex + 1,
page_size: pageSize, page_size: pageSize,
...@@ -83,8 +99,9 @@ const ToolNotificate = (props) => { ...@@ -83,8 +99,9 @@ const ToolNotificate = (props) => {
merchant_id: merchant, merchant_id: merchant,
status: status, status: status,
}) })
}
props.hideLoading() props.hideLoading()
console.log('res.data.data', res.data.data)
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setReport(res.data.data.data) setReport(res.data.data.data)
...@@ -105,8 +122,12 @@ const ToolNotificate = (props) => { ...@@ -105,8 +122,12 @@ const ToolNotificate = (props) => {
} }
useEffect(() => { useEffect(() => {
getData() getData(false)
}, [searchDebount, pageIndex, startDate, module, merchant, status]) }, [pageIndex])
useEffect(() => {
getData(true)
}, [searchDebount, startDate, module, merchant, status])
return ( return (
<LogAuth <LogAuth
......
...@@ -38,9 +38,26 @@ const ToolNotificate = (props) => { ...@@ -38,9 +38,26 @@ const ToolNotificate = (props) => {
setEndDate(end) setEndDate(end)
} }
const getData = async () => { const getData = async (init) => {
props.showLoading() 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, order_code: searchDebount,
applications, applications,
page_no: pageIndex + 1, page_no: pageIndex + 1,
...@@ -53,6 +70,8 @@ const ToolNotificate = (props) => { ...@@ -53,6 +70,8 @@ const ToolNotificate = (props) => {
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9', // gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
}) })
}
props.hideLoading() props.hideLoading()
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
const newList = res.data.data.data.map((e, i) => { const newList = res.data.data.data.map((e, i) => {
...@@ -72,8 +91,12 @@ const ToolNotificate = (props) => { ...@@ -72,8 +91,12 @@ const ToolNotificate = (props) => {
} }
useEffect(() => { useEffect(() => {
getData() getData(false)
}, [searchDebount, pageIndex, startDate, type, merchant, store]) }, [pageIndex])
useEffect(() => {
getData(true)
}, [searchDebount, startDate, type, merchant, store])
useEffect(() => { useEffect(() => {
if (merchant) { if (merchant) {
......
...@@ -50,16 +50,27 @@ const ToolNotificate = (props) => { ...@@ -50,16 +50,27 @@ const ToolNotificate = (props) => {
} }
} }
const getData = async () => { const getData = async (init) => {
props.showLoading() 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, code: searchDebount,
page_no: pageIndex + 1, page_no: pageIndex + 1,
page_size: pageSize, page_size: pageSize,
status, status,
type_id: type, type_id: type,
}) })
}
props.hideLoading() props.hideLoading()
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
...@@ -83,8 +94,12 @@ const ToolNotificate = (props) => { ...@@ -83,8 +94,12 @@ const ToolNotificate = (props) => {
} }
useEffect(() => { useEffect(() => {
getData() getData(false)
}, [searchDebount, pageIndex, status, type]) }, [pageIndex])
useEffect(() => {
getData(true)
}, [searchDebount, status, type])
const removeItem = async (id) => { const removeItem = async (id) => {
props.showLoading() props.showLoading()
......
...@@ -133,7 +133,7 @@ function TableList(props) { ...@@ -133,7 +133,7 @@ function TableList(props) {
width: 120, width: 120,
}} }}
> >
sn phm Hành động
</TableCell> </TableCell>
</TableRow> </TableRow>
</TableHead> </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