Commit abd2af98 by tdgiang

update code

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