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,20 +71,37 @@ const ToolNotificate = (props) => { ...@@ -71,20 +71,37 @@ const ToolNotificate = (props) => {
} }
} }
const getData = async () => { const getData = async (init) => {
props.showLoading() props.showLoading()
const res = await listFee({
text_search: searchDebount, let res
page_no: pageIndex + 1,
page_size: pageSize, if (init) {
from_date: startDate ? convertDate(startDate) : null, setPageIndex(0)
to_date: endDate ? convertDate(endDate) : null, res = await listFee({
store_id: module, text_search: searchDebount,
merchant_id: merchant, page_no: 0,
status: status, 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,
from_date: startDate ? convertDate(startDate) : null,
to_date: endDate ? convertDate(endDate) : null,
store_id: module,
merchant_id: merchant,
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,21 +38,40 @@ const ToolNotificate = (props) => { ...@@ -38,21 +38,40 @@ const ToolNotificate = (props) => {
setEndDate(end) setEndDate(end)
} }
const getData = async () => { const getData = async (init) => {
props.showLoading() props.showLoading()
const res = await listTransaction({ let res
order_code: searchDebount, if (init) {
applications, setPageIndex(0)
page_no: pageIndex + 1, res = await listTransaction({
page_size: pageSize, order_code: searchDebount,
from_date: startDate ? convertDate(startDate) : null, applications,
to_date: endDate ? convertDate(endDate) : null, page_no: 0,
type_code: type, page_size: pageSize,
merchant_id: merchant, from_date: startDate ? convertDate(startDate) : null,
store_id: store, to_date: endDate ? convertDate(endDate) : null,
type_code: type,
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9', 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,
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',
})
}
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
code: searchDebount, if (init) {
page_no: pageIndex + 1, setPageIndex(0)
page_size: pageSize, res = await getListProduct({
status, code: searchDebount,
type_id: type, 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() 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