Commit abd2af98 by tdgiang

update code

parent cafaf461
...@@ -104,6 +104,9 @@ export default { ...@@ -104,6 +104,9 @@ export default {
listRequest: `${root}/customerCare/list`, listRequest: `${root}/customerCare/list`,
updateStatusRequest: `${root}/customerCare/changeStatus`, updateStatusRequest: `${root}/customerCare/changeStatus`,
detailCustomerCare: `${root}/customerCare`, detailCustomerCare: `${root}/customerCare`,
//dropdown //dropdown
dropdownFuntions: `${root}/dropdown/function`, dropdownFuntions: `${root}/dropdown/function`,
dropdownPermission: `${root}/function/getFunctionTree`, dropdownPermission: `${root}/function/getFunctionTree`,
......
...@@ -99,19 +99,24 @@ export default function FormDialog({ onCreate }) { ...@@ -99,19 +99,24 @@ export default function FormDialog({ onCreate }) {
} }
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
if(state?.product_id && state?.name?.trim() && state?.code?.trim()){
let index=listProduct.findIndex(e=>e.id==state.product_id) let index=listProduct.findIndex(e=>e.id==state.product_id)
if(index!=-1){ if(index!=-1){
console.log(listProduct[index])
console.log("listProduct",listProduct)
console.log('state', state)
onCreate({...state,type,type_name:listProduct[index].type_name, product_name: listProduct[index].product_name}) onCreate({...state,type,type_name:listProduct[index].type_name, product_name: listProduct[index].product_name})
setOpen(false) setOpen(false)
setState({}) setState({})
setType() setType()
} }
}else{
toast.warning('Bạn chưa nhập đầy đủ thông tin', {
theme: 'colored',
})
}
} }
......
...@@ -77,7 +77,7 @@ function CustomerView(props) { ...@@ -77,7 +77,7 @@ function CustomerView(props) {
<TextField <TextField
variant="outlined" variant="outlined"
className="w-full" className="w-full"
label="Tên thành viên" label="Nhập từ khoá"
onChange={(e) => { onChange={(e) => {
const text = e.target.value const text = e.target.value
setTimeout(() => { setTimeout(() => {
......
...@@ -105,7 +105,7 @@ const SimpleForm = (props) => { ...@@ -105,7 +105,7 @@ const SimpleForm = (props) => {
} }
const onCreateField = (value) => { const onCreateField = (value) => {
if (value) { if (value && value.trim()) {
console.log('value', value) console.log('value', value)
if ( if (
listField.findIndex( listField.findIndex(
...@@ -722,7 +722,9 @@ const SimpleForm = (props) => { ...@@ -722,7 +722,9 @@ const SimpleForm = (props) => {
}} }}
color="inherit" color="inherit"
variant="contained" variant="contained"
onClick={() => {}} onClick={() => {
history.goBack()
}}
> >
<span className="capitalize">Quay li</span> <span className="capitalize">Quay li</span>
</Button> </Button>
......
...@@ -798,7 +798,9 @@ const SimpleForm = (props) => { ...@@ -798,7 +798,9 @@ const SimpleForm = (props) => {
}} }}
color="inherit" color="inherit"
variant="contained" variant="contained"
onClick={() => {}} onClick={() => {
history.goBack()
}}
> >
<span className="capitalize">Quay li</span> <span className="capitalize">Quay li</span>
</Button> </Button>
......
...@@ -643,7 +643,9 @@ const SimpleForm = (props) => { ...@@ -643,7 +643,9 @@ const SimpleForm = (props) => {
}} }}
color="inherit" color="inherit"
variant="contained" variant="contained"
onClick={() => {}} onClick={() => {
history.goBack()
}}
> >
<span className="capitalize">Quay li</span> <span className="capitalize">Quay li</span>
</Button> </Button>
......
...@@ -77,7 +77,7 @@ function CustomerView(props) { ...@@ -77,7 +77,7 @@ function CustomerView(props) {
<TextField <TextField
variant="outlined" variant="outlined"
className="w-full" className="w-full"
label="Tên pháp nhân" label="Nhập từ khoá"
onChange={(e) => { onChange={(e) => {
const text = e.target.value const text = e.target.value
setTimeout(() => { setTimeout(() => {
......
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