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,18 +99,23 @@ export default function FormDialog({ onCreate }) { ...@@ -99,18 +99,23 @@ export default function FormDialog({ onCreate }) {
} }
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
let index=listProduct.findIndex(e=>e.id==state.product_id)
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}) if(state?.product_id && state?.name?.trim() && state?.code?.trim()){
setOpen(false) let index=listProduct.findIndex(e=>e.id==state.product_id)
setState({}) if(index!=-1){
setType() onCreate({...state,type,type_name:listProduct[index].type_name, product_name: listProduct[index].product_name})
} setOpen(false)
setState({})
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