Commit 0ac19812 by tdgiang

update build

parent a18e4537
...@@ -18,7 +18,7 @@ import GasStationRoutes from './views/GasStation/GasStationRoutes' ...@@ -18,7 +18,7 @@ import GasStationRoutes from './views/GasStation/GasStationRoutes'
import ListRequestRoutes from './views/ListRequest/routes' import ListRequestRoutes from './views/ListRequest/routes'
import SignUp from './views/SignUp/routes' import SignUp from './views/SignUp/routes'
import InvoiceSupplier from './views/InvoiceSupplier/routes' import InvoiceSupplier from './views/InvoiceSupplier/routes'
// import Package from './views/package/routers' import Package from './views/package/routers'
import NccRouter from './views/Ncc/router' import NccRouter from './views/Ncc/router'
import LandingpageRouter from './views/landingpage/router' import LandingpageRouter from './views/landingpage/router'
......
...@@ -2,8 +2,15 @@ ...@@ -2,8 +2,15 @@
//const root = 'https://apigw.petropos.vn/api' //const root = 'https://apigw.petropos.vn/api'
//const root = 'http://dcvf.tasvietnam.vn:9986/api' //const root = 'http://dcvf.tasvietnam.vn:9986/api'
//const root = 'https://apigw-v2.petropos.vn/api' //const root = 'https://apigw-v2.petropos.vn/api'
//v2
//const root = 'https://apitest-v2.petropos.vn/api'
//v3
const root = 'https://apitest.petropos.vn/api' const root = 'https://apitest.petropos.vn/api'
//const root = 'http://petropos-api.tasvietnam.vn/api'
export default { export default {
//Dang nhap,thong tin ca nhan //Dang nhap,thong tin ca nhan
urlLogin: `${root}/auth/adminLogin`, urlLogin: `${root}/auth/adminLogin`,
......
...@@ -91,43 +91,43 @@ const SimpleForm = (props) => { ...@@ -91,43 +91,43 @@ const SimpleForm = (props) => {
const handleSubmit = async (event) => { const handleSubmit = async (event) => {
const newValue = trimObject(state) const newValue = trimObject(state)
if (listChecked.length > 0) { if (listChecked.length > 0) {
if (image) { // if (image) {
const newList = listChecked.map((e) => { const newList = listChecked.map((e) => {
return { action_id: e } return { action_id: e }
}) })
props.showLoading() props.showLoading()
const res = await createEmployee({ const res = await createEmployee({
...newValue, ...newValue,
user_group_id: role, user_group_id: role,
userPermissions: newList, userPermissions: newList,
avatar: image, avatar: image,
status: 1, status: 1,
}) })
console.log(res) console.log(res)
props.hideLoading() props.hideLoading()
if (res.data.code == 200) {
history.push('/employee')
if (res.data.code == 200) { if (res.data.code == 200) {
history.push('/employee') toast.success('Tạo nhân viên thành công!', {
if (res.data.code == 200) {
toast.success('Tạo nhân viên thành công!', {
theme: 'colored',
})
}
} else {
toast.error(t(res.data.error), {
theme: 'colored', theme: 'colored',
}) })
} }
} else { } else {
toast.warning('Bạn chưa chọn ảnh đại diện cho nhân viên!', { toast.error(t(res.data.error), {
theme: 'colored', theme: 'colored',
}) })
} }
} else { } else {
toast.warning('Bạn chưa thêm quyền cho nhân viên!', { toast.warning('Bạn chưa chọn ảnh đại diện cho nhân viên!', {
theme: 'colored', theme: 'colored',
}) })
} }
// } else {
// toast.warning('Bạn chưa thêm quyền cho nhân viên!', {
// theme: 'colored',
// })
// }
} }
const handleChange = (event) => { const handleChange = (event) => {
......
...@@ -128,42 +128,42 @@ const SimpleForm = (props) => { ...@@ -128,42 +128,42 @@ const SimpleForm = (props) => {
const handleSubmit = async (event) => { const handleSubmit = async (event) => {
const newValue = trimObject(state) const newValue = trimObject(state)
if (listChecked.length > 0) { if (listChecked.length > 0) {
if (image) { // if (image) {
const newList = listChecked.map((e) => { const newList = listChecked.map((e) => {
return { action_id: e } return { action_id: e }
}) })
props.showLoading() props.showLoading()
const res = await updateEmployee({ const res = await updateEmployee({
...newValue, ...newValue,
user_group_id: role, user_group_id: role,
userPermissions: newList, userPermissions: newList,
avatar: image, avatar: image,
}) })
console.log(res) console.log(res)
props.hideLoading() props.hideLoading()
if (res.data.code == 200) {
history.push('/employee')
if (res.data.code == 200) { if (res.data.code == 200) {
history.push('/employee') toast.success('Cập nhật nhân viên thành công!', {
if (res.data.code == 200) {
toast.success('Cập nhật nhân viên thành công!', {
theme: 'colored',
})
}
} else {
toast.error(t(res.data.error), {
theme: 'colored', theme: 'colored',
}) })
} }
} else { } else {
toast.warning('Bạn chưa chọn ảnh đại diện cho nhân viên!', { toast.error(t(res.data.error), {
theme: 'colored', theme: 'colored',
}) })
} }
} else { } else {
toast.warning('Bạn chưa thêm quyền cho nhân viên!', { toast.warning('Bạn chưa chọn ảnh đại diện cho nhân viên!', {
theme: 'colored', theme: 'colored',
}) })
} }
// } else {
// toast.warning('Bạn chưa thêm quyền cho nhân viên!', {
// theme: 'colored',
// })
// }
} }
const handleChange = (event) => { const handleChange = (event) => {
......
...@@ -73,6 +73,9 @@ const SimpleForm = (props) => { ...@@ -73,6 +73,9 @@ const SimpleForm = (props) => {
const res = await createGasStation({ const res = await createGasStation({
...newValue, ...newValue,
gas_fields: listField, gas_fields: listField,
account: newValue?.account,
user_name: newValue?.user_name,
password: newValue?.password,
}) })
props.hideLoading() props.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
......
...@@ -109,6 +109,10 @@ const SimpleForm = (props) => { ...@@ -109,6 +109,10 @@ const SimpleForm = (props) => {
gas_fields: listField, gas_fields: listField,
store_code: newValue?.store_code, store_code: newValue?.store_code,
queue_name: newValue?.queue_name, queue_name: newValue?.queue_name,
account: newValue?.account,
user_name: newValue?.user_name,
password: newValue?.password,
}) })
props.hideLoading() props.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
......
...@@ -54,14 +54,14 @@ const ToolNotificate = (props) => { ...@@ -54,14 +54,14 @@ const ToolNotificate = (props) => {
if (isInit) { if (isInit) {
setPageIndex(0) setPageIndex(0)
res = await getListSupplier({ res = await getListSupplier({
fuel_name: searchDebount, supp_name: searchDebount,
page_no: 0, page_no: 0,
page_size: pageSize, page_size: pageSize,
status, status,
}) })
} else { } else {
res = await getListSupplier({ res = await getListSupplier({
fuel_name: searchDebount, supp_name: searchDebount,
page_no: pageIndex + 1, page_no: pageIndex + 1,
page_size: pageSize, page_size: pageSize,
status, status,
......
...@@ -30,7 +30,7 @@ const dataLine = [ ...@@ -30,7 +30,7 @@ const dataLine = [
}, },
{ {
id: 3, id: 3,
textLeft: "Sản phẩm mới", textLeft: 'Sản phẩm mới',
textRight: 'Hợp đồng', textRight: 'Hợp đồng',
data: [820, 932, 1901, 934, 1290, 1330, 120], data: [820, 932, 1901, 934, 1290, 1330, 120],
bg: 'yellow', bg: 'yellow',
......
...@@ -31,9 +31,9 @@ const SimpleForm = (props) => { ...@@ -31,9 +31,9 @@ const SimpleForm = (props) => {
props.hideLoading() props.hideLoading()
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setState({ setState({
...res.data.data, ...res.data.data?.data,
status_name: status_name:
res.data.data.status == 1 res.data.data?.data.status == 1
? 'Đã thanh toán' ? 'Đã thanh toán'
: 'Chưa thanh toán', : 'Chưa thanh toán',
}) })
......
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