diff --git a/src/components/SearchForm.jsx b/src/components/SearchForm.jsx index 89b79b9..54174ff 100644 --- a/src/components/SearchForm.jsx +++ b/src/components/SearchForm.jsx @@ -15,7 +15,7 @@ import VendorSelector from '@/components/VendorSelector'; const { RangePicker } = DatePicker; -const SearchForm = ({ initialValue, onSubmit, onReset, confirmText, formName, formLayout, loading, ...props }) => { +const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, formName, formLayout, loading, ...props }) => { const { t } = useTranslation(); const presets = useDatePresets(); const [formValues, setFormValues] = useFormStore((state) => [state.formValues, state.setFormValues]); @@ -89,8 +89,14 @@ const SearchForm = ({ initialValue, onSubmit, onReset, confirmText, formName, fo }; useEffect(() => { - const dest = formValuesMapper(formValues); + setFormValues(readValues); + const dest = formValuesMapper(readValues); setFormValuesToSub(dest); + + if (typeof onMounted === 'function') { + onMounted(dest) + } + return () => {}; }, []); diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index 365ea7a..2fd935c 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -95,6 +95,11 @@ export const postProductsAuditAction = async (auditState, infoRow) => { // return errcode !== 0 ? {} : result; }; +export const postProductsSave = async (products) => { + const { errcode, result } = await postJSON(`${HT_HOST}/Service_BaseInfoWeb/agency_product_save`, products); + return { errcode, result }; +} + const initialState = { loading: false, searchValues: {}, diff --git a/src/views/products/Detail.jsx b/src/views/products/Detail.jsx index 669ce1d..fdaaf95 100644 --- a/src/views/products/Detail.jsx +++ b/src/views/products/Detail.jsx @@ -1,22 +1,26 @@ -import React, { useState, useEffect, useRef, useMemo } from 'react'; -import { Button, Card, Col, Row, Breadcrumb, Table, Popconfirm, Form, Input, InputNumber, Tag, Modal, Select, Tree, FloatButton, DatePicker, Spin, message } from 'antd'; +import React, { useState, useEffect } from 'react'; +import { Tooltip, Button, Card, Col, Row, Breadcrumb, Table, Popconfirm, Form, Input, InputNumber, Tag, Modal, Select, Tree, FloatButton, DatePicker, Spin, message } from 'antd'; import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { useProductsTypes } from '@/hooks/useProductsSets'; +import { useProductsTypes, useProductsAuditStatesMapVal } from '@/hooks/useProductsSets'; import Extras from './Detail/Extras'; import { useParams } from 'react-router-dom'; import useProductsStore from '@/stores/Products/Index'; +import postProductsSave from '@/stores/Products/Index'; import { useHTLanguageSets } from '@/hooks/useHTLanguageSets'; import { useDefaultLgc } from '@/i18n/LanguageSwitcher'; import BatchImportPrice from './Detail/BatchImportPrice'; import dayjs from 'dayjs'; -import { PlusCircleFilled } from '@ant-design/icons'; +import { PlusCircleFilled, FileAddOutlined, ExportOutlined } from '@ant-design/icons'; import { DeptSelector } from '@/components/DeptSelector'; import { useDatePresets } from '@/hooks/useDatePresets'; import CitySelector from '@/components/CitySelector'; import { HT_HOST } from '@/config'; -import { postJSON } from '@/utils/request'; +import { postJSON, postForm } from '@/utils/request'; +import RequireAuth from '@/components/RequireAuth' +import { PERM_ROLE_NEW } from '@/config' import { create } from 'zustand'; +import { PERM_PRODUCTS_MANAGEMENT } from '@/config'; function Detail() { const { t } = useTranslation(); const [form] = Form.useForm(); @@ -35,8 +39,7 @@ function Detail() { const [quotation, setQuotation] = useState(null); const [lgc_details, setLgc_details] = useState(null); const [languageLabel, setLanguageLabel] = useState(null); - const [infoDataForId, setInfoDataForId] = useState(null); - const { travel_agency_id } = useParams(); + const { travel_agency_id, audit_state, use_year } = useParams(); const { language } = useDefaultLgc(); const HTLanguageSets = useHTLanguageSets(); const { Search } = Input; @@ -53,17 +56,18 @@ function Detail() { const [addProductType, setAddProductType] = useState(''); const [addproductName, setAddProductName] = useState(''); const [dataFetched, setDataFetched] = useState(false); // 添加一个标志位 - const [selectedNodeKey, setSelectedNodeKey] = useState(null); const [selectedDays, setSelectedDays] = useState([]); const [weekdays, setWeekdays] = useState([]); const [info, setInfo] = useState(); const travel_agency_name = activeAgency.travel_agency_name; + const audit_state_id = activeAgency.audit_state_id; + let isCanEditable = !(audit_state_id === 1 || audit_state_id === 3 || audit_state_id === -1) const [currentQuotationRecord, setCurrentQuotationRecord] = useState({ use_dates_start: null, use_dates_end: null }); const formatDate = (date) => (date ? dayjs(date) : null); - + const stateMapVal = useProductsAuditStatesMapVal(); const startDate = currentQuotationRecord.use_dates_start && dayjs(currentQuotationRecord.use_dates_start).isValid() ? formatDate(currentQuotationRecord.use_dates_start) @@ -80,7 +84,6 @@ function Detail() { const days = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ]; - const productProject = { "6": [ { code: "code", name: t('products:Code'), nameKey: 'products:Code' }, @@ -90,42 +93,162 @@ function Detail() { { code: "code", name: t('products:Code'), nameKey: 'products:Code' }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' }, { code: "km", name: t('products:KM'), nameKey: 'products:KM' }, - { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' } + { + code: "remarks", + name: ( + + {t('products:Remarks')} + + ), + nameKey: 'products:Remarks', + }, ], "J": [ { code: "code", name: t('products:Code'), nameKey: 'products:Code' }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' }, - { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' }, + { + code: "recommends_rate", + name: ( + + {t('products:recommendationRate')} + + ), + nameKey: 'products:recommendationRate', + }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' }, - { code: "dept_name", name: t('products:Dept'), nameKey: 'products:Dept' }, - { code: "display_to_c", name: t('products:DisplayToC'), nameKey: 'products:DisplayToC' }, - { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' }, + { + code: "dept_name", + name: ( + + {t('products:Dept')} + + ), + nameKey: 'products:Dept', + }, + { + code: "display_to_c", + name: ( + + {t('products:DisplayToC')} + + ), + nameKey: 'products:DisplayToC', + }, + { + code: "remarks", + name: ( + + {t('products:Remarks')} + + ), + nameKey: 'products:Remarks', + }, ], "Q": [ { code: "code", name: t('products:Code'), nameKey: 'products:Code' }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' }, - { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' }, + { + code: "recommends_rate", + name: ( + + {t('products:recommendationRate')} + + ), + nameKey: 'products:recommendationRate', + }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' }, - { code: "dept_name", name: t('products:Dept'), nameKey: 'products:Dept' }, - { code: "display_to_c", name: t('products:DisplayToC'), nameKey: 'products:DisplayToC' }, - { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' }, + { + code: "dept_name", + name: ( + + {t('products:Dept')} + + ), + nameKey: 'products:Dept', + }, + { + code: "display_to_c", + name: ( + + {t('products:DisplayToC')} + + ), + nameKey: 'products:DisplayToC', + }, + { + code: "remarks", + name: ( + + {t('products:Remarks')} + + ), + nameKey: 'products:Remarks', + }, ], "D": [ { code: "code", name: t('products:Code'), nameKey: 'products:Code' }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' }, - { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' }, + { + code: "recommends_rate", + name: ( + + {t('products:recommendationRate')} + + ), + nameKey: 'products:recommendationRate', + }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' }, - { code: "dept_name", name: t('products:Dept'), nameKey: 'products:Dept' }, - { code: "display_to_c", name: t('products:DisplayToC'), nameKey: 'products:DisplayToC' }, - { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' }, + { + code: "dept_name", + name: ( + + {t('products:Dept')} + + ), + nameKey: 'products:Dept', + }, + { + code: "display_to_c", + name: ( + + {t('products:DisplayToC')} + + ), + nameKey: 'products:DisplayToC', + }, + { + code: "remarks", + name: ( + + {t('products:Remarks')} + + ), + nameKey: 'products:Remarks', + }, ], "7": [ { code: "code", name: t('products:Code'), nameKey: 'products:Code' }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' }, - { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' }, + { + code: "recommends_rate", + name: ( + + {t('products:recommendationRate')} + + ), + nameKey: 'products:recommendationRate', + }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' }, { code: "open_weekdays", name: t('products:OpenWeekdays'), nameKey: 'products:OpenWeekdays' }, - { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' }, + { + code: "remarks", + name: ( + + {t('products:Remarks')} + + ), + nameKey: 'products:Remarks', + }, ], "8": [ { code: "code", name: t('products:Code') }, @@ -136,7 +259,7 @@ function Detail() { { code: "city_name", name: t('products:City'), nameKey: 'products:City' }, ] } - const [selectedCategory, setSelectedCategory] = useState(productProject.B); + const [selectedCategory, setSelectedCategory] = useState([]); useEffect(() => { setLanguageStatus(language); @@ -169,10 +292,11 @@ function Detail() { }; const tempExpandedKeys = productsTypes.map(item => item.key) const treeData = generateTreeData(productsTypes, agencyProducts); + setDataFetched(true); // 设置标志位为 true,表示数据已获取 setTreeData(treeData); setExpandedKeys(tempExpandedKeys); - console.log("agencyProducts", agencyProducts) + console.log("stateMapVal", stateMapVal); setProductsData(agencyProducts); setDefaultData(treeData); setDataList(flattenTreeData(treeData)); @@ -182,7 +306,37 @@ function Detail() { fetchData(); }, [agencyProducts, dataFetched]); - + // useEffect(()=>{ + // // if(editingProduct && treeData){ + + // editingProductQuotation(); + // // } + + // },[treeData,editingProduct]) + + // const editingProductQuotation = () => { + // console.log("editingProduct",editingProduct) + // const editingProductID = editingProduct.id; + // let stopProgram = false; + // for (const element of treeData) { + // if (stopProgram) { + // return; + // } + // const childList = element.children; + // for (const product of childList) { + // const childrenID = product.key.split('-')[1]; + // console.log("childrenID",childrenID); + // console.log("editingProductID",editingProductID); + // if (editingProductID == childrenID) { + // console.log("AAAAAAAAAA"); + // console.log("product",product); + // stopProgram = true; + // handleNodeSelect(product); + // break; + // } + // } + // } + // } const flattenTreeData = (tree) => { let flatList = []; const flatten = (nodes) => { @@ -197,6 +351,17 @@ function Detail() { return flatList; }; + // const ProductsSave = async (products) => { + // await postProductsSave(products) + // .then((json)=> { + // if (json.errcode === 0) { + // message.success("保存成功"); + // }else{ + // message.error("保存失败") + // } + // }) + // } + const getParentKey = (key, tree) => { let parentKey; for (let i = 0; i < tree.length; i++) { @@ -257,9 +422,6 @@ function Detail() { setCurrentQuotationRecord(record); }; - const cancel = () => { - setEditingid(''); - }; const handleDelete = (index) => { const newData = [...quotation]; @@ -295,6 +457,8 @@ function Detail() { tempKey: Math.random() }; setQuotation([...quotation, newData]); + const index = [...quotation, newData].length - 1 + edit(newData, index); }; const handleBatchImport = () => { @@ -376,22 +540,38 @@ function Detail() { { title: t('products:Weekdays'), dataIndex: 'weekdays', width: '10%' }, - { + ]; + + // 根据条件判断是否要添加操作列 + if (!isCanEditable) { + columns.push({ title: t('products:operation'), dataIndex: 'operation', render: (_, record, index) => { + const canEdit = record.audit_state_id === -1; return ( - edit(record, index)} style={{ marginRight: 8 }}>{t('Edit')} - handleDelete(index)}> - {t('Delete')} - + {canEdit ? ( + edit(record, index)} style={{ marginRight: 8 }}>{t('Edit')} + ) : ( + {t('Edit')} + )} + {canEdit ? ( + handleDelete(index)}> + {t('Delete')} + + ) : ( + {t('Delete')} + )} - ) - }, - }, + ); + } + }); + } + + + - ]; const handleTagClick = (tag) => { @@ -451,10 +631,10 @@ function Detail() { // 更新整个 lgc_details 对象 const updatedLgcDetails = { ...lgc_details, - [languageStatus]: { - ...lgc_details[languageStatus], - [field]: value, - lgc: languageStatus.toString(), + [languageStatus]: { + ...lgc_details[languageStatus], + [field]: value, + lgc: languageStatus.toString(), id: lgc_details[languageStatus]?.id || '' } }; @@ -477,9 +657,9 @@ function Detail() { //树组件方法 const handleNodeSelect = (_, { node }) => { + console.log("node",node) setSelectedNodeid(node.key); const fatherKey = node.key.split('-')[0]; - setSelectedNodeKey(fatherKey); setSelectedCategory(productProject[fatherKey]); setTags([languageLabel]); // 如果点击的是同一个节点,不做任何操作 @@ -490,23 +670,20 @@ function Detail() { setLanguageLabel(languageLabelRefresh); setSelectedTag(languageLabelRefresh); setRemainderLanguage(HTLanguageSets.filter(item => item.key !== language.toString())); - setEditingProduct(node._raw); + // setEditingProduct(node._raw); if (!node._raw.info.id) { let infoData = node._raw.info; setInfo(node._raw.info); - console.log("node._raw",node._raw) - console.log("没有id"); const newLgcDetails = node._raw.lgc_details const fatherKey = node.key.split('-')[0]; setSelectedNodeid(node.key); - setSelectedNodeKey(fatherKey); form.setFieldsValue({ info: { id: infoData.id || "", title: infoData.title || "", code: infoData.code || "", type: infoData.product_type_id || "", - audit_state:"-1", + audit_state: "-1", create_date: infoData.create_date || "", created_by: infoData.created_by || "", travel_agency_id: travel_agency_id || "", @@ -524,7 +701,7 @@ function Detail() { city_id: infoData.city_id || "", // product_type_name: infoData.product_type_name || "", // dept_name: infoData.dept_name || "", - + }, lgc_details: { lgc: language, @@ -548,9 +725,6 @@ function Detail() { }]) return } else { - - - let initialQuotationData = null; let infoData = null; let lgcDetailsData = null; @@ -576,7 +750,7 @@ function Detail() { }; delete updatedObject.unit_name; delete updatedObject.unit_id; - delete updatedObject.audit_state_id; + // delete updatedObject.audit_state_id; delete updatedObject.audit_state_name; return updatedObject; }); @@ -593,9 +767,6 @@ function Detail() { }); } - if (node._raw.info.id) { - setInfoDataForId(infoData.id) - } setLgc_details(newLgcDetails); @@ -651,12 +822,11 @@ function Detail() { } }); } - - } }; + //新增产品 const handelAddProduct = () => { // 找到对应的产品类型节点 const productTypeNode = treeData.find(item => item.key === addProductType); @@ -711,8 +881,7 @@ function Detail() { return item; }); // 更新 treeData - setEditingProduct(null) - console.log("newTreeData", newTreeData); + // setEditingProduct(null); setTreeData(newTreeData); let tempProductDataList = productsData[addProductType]; @@ -725,62 +894,39 @@ function Detail() { setAddProductVisible(false); } - // let tempProductDataList = productsData[addProductType]; - - // //初始化产品数据 - // const newProduct = { - // info: { - // code: 'addProduct' - // }, - // quotation: [], - // lgc_details: [] - // } - // tempProductDataList.push(newProduct); - // const newProductsData = { - // ...productsData, // 假设使用了展开运算符来复制现有数组 - // [addProductType]: tempProductDataList - // }; - // setProductsData(newProductsData); - // setAddProductVisible(false); - // }; - - const renderFormItem = (item) => { switch (item.code) { case "duration": - return ; + return ; case "display_to_c": return ( - 在计划显示,不在报价信显示 计划和报价信都要显示 计划和报价信都不用显示 ); case "dept_name": - return ; + return ; case "city_name": - return ; + return ; default: - return ; + return ; } }; + //保存产品 const onSave = async (values) => { let tempInfo - console.log("values", values) - console.log("info", info) if (info.id === "") { tempInfo = { ...info, ...values.info, city_name: values.info.city_name.label, - audit_state:"-1" + audit_state: "-1" } delete tempInfo.product_type_name; delete tempInfo.dept_name; - - console.log("新增") let tempQuotation = quotation.map(element => { const updateData = { @@ -790,18 +936,17 @@ function Detail() { delete updateData.tempKey return updateData }) - let tempLgc_details = [{...lgc_details}] - console.log("tempLgc_details",tempLgc_details) + let tempLgc_details = [{ ...lgc_details }] const tempData = { travel_agency_id, info: tempInfo, quotation: tempQuotation, lgc_details: Object.values(lgc_details) }; - console.log("tempData",tempData); + console.log("tempData", tempData); const { errcode, result } = await postJSON(`${HT_HOST}/Service_BaseInfoWeb/agency_product_save`, tempData); - console.log("result",result) + console.log("result", result); if (errcode === 0) { message.success("保存成功"); setDataFetched(false); @@ -809,14 +954,18 @@ function Detail() { message.error(`保存失败: ${result}`); } return - } else { - tempInfo = { - ...info, - ...values.info, - audit_state: "-1" - } } + + + + tempInfo = { + ...info, + ...values.info, + audit_state: "-1" + } + + console.log("tempInfo", tempInfo) let tempQuotation = quotation.map(element => { @@ -836,8 +985,8 @@ function Detail() { }; console.log("tempData", tempData) + // const { errcode, result } = await postProductsSave(tempData); const { errcode, result } = await postJSON(`${HT_HOST}/Service_BaseInfoWeb/agency_product_save`, tempData); - if (errcode === 0) { message.success("保存成功"); setDataFetched(false); @@ -937,12 +1086,14 @@ function Detail() { handleChange('title', e.target.value)} + disabled={isCanEditable} /> handleChange('description', e.target.value)} + disabled={isCanEditable} /> {/* */} @@ -956,145 +1107,159 @@ function Detail() { dataSource={quotation} columns={columns} rowClassName="editable-row" - pagination={{ onChange: cancel }} + // pagination={{ onChange: cancel }} /> - - - + } + + { + !isCanEditable && + + } - + */} {/* */} {/* */} - } onClick={() => setAddProductVisible(true)} /> - - - { - ( - setBatchImportPriceVisible(false)} - width="80%" - > - - - ) - } + {/* } onClick={() => setAddProductVisible(true)} /> */} - { - ( - setAddProductVisible(false)} + } > -

选择产品类别

- - - -

新增产品名称

- setAddProductName(e.target.value)} - /> -
- ) - } + + } onClick={() => setAddProductVisible(true)} /> + + + } onClick={async () => { + const formData = new FormData(); + formData.append('use_year', use_year); + formData.append('travel_agency_id', travel_agency_id); + const { errcode, result } = await postForm(`${HT_HOST}/Service_BaseInfoWeb/agency_submit`, formData); + console.log("errcode", errcode); + console.log("result", result); + }} /> + + + + - { - ( - -

成人价

- setCurrentQuotationRecord({ ...currentQuotationRecord, adult_cost: e })} /> -

儿童价

- setCurrentQuotationRecord({ ...currentQuotationRecord, child_cost: e })} /> -

币种

- -

类型

- - -

人等

- - setCurrentQuotationRecord({ ...currentQuotationRecord, group_size_min: e })} - style={{ width: '50%', marginRight: '10px' }} - /> - - - setCurrentQuotationRecord({ ...currentQuotationRecord, group_size_max: e })} - style={{ width: '50%', marginLeft: '10px' }} - /> - -

有效期

- { - setCurrentQuotationRecord({ - ...currentQuotationRecord, - use_dates_start: dates[0], - use_dates_end: dates[1] - }); - }} - /> -

周末

- {days.map((day, index) => ( - - ))} + setBatchImportPriceVisible(false)} + width="80%" + > + + + + setAddProductVisible(false)} + > +

选择产品类别

+ + -
+

新增产品名称

+ setAddProductName(e.target.value)} + /> +
+ + +

成人价

+ setCurrentQuotationRecord({ ...currentQuotationRecord, adult_cost: e })} /> +

儿童价

+ setCurrentQuotationRecord({ ...currentQuotationRecord, child_cost: e })} /> +

币种

+ +

类型

+ - ) - } +

人等

+ + setCurrentQuotationRecord({ ...currentQuotationRecord, group_size_min: e })} + style={{ width: '50%', marginRight: '10px' }} + /> + - + setCurrentQuotationRecord({ ...currentQuotationRecord, group_size_max: e })} + style={{ width: '50%', marginLeft: '10px' }} + /> + +

有效期

+ { + setCurrentQuotationRecord({ + ...currentQuotationRecord, + use_dates_start: dates[0], + use_dates_end: dates[1] + }); + }} + /> +

周末

+ {days.map((day, index) => ( + + ))} +
); diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index 9a02816..c6e4279 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -96,7 +96,6 @@ function Newest() { const [guideSelectOptions, setGuideSelectOptions] = useState([]) const formValuesToSub = useFormStore((state) => state.formValuesToSub) - const [fetchAllGuideList, fetchReservationList, reservationList, reservationPage, cityList, selectReservation, getCityListByReservationId, setupCityGuide, updateReservationGuide] = useReservationStore((state) => [state.fetchAllGuideList, state.fetchReservationList, state.reservationList, state.reservationPage, state.cityList, state.selectReservation, state.getCityListByReservationId, state.setupCityGuide, state.updateReservationGuide]) @@ -104,13 +103,9 @@ function Newest() { const { notification } = App.useApp() useEffect (() => { - if (location.search !== '?back') { - // 第一页,未确认计划 - onSearchClick(1, 1) - } fetchAllGuideList() .then((guideList) => { - const selectOptions = guideList.map((data, index) => { + const selectOptions = guideList.map((data) => { return { value: data.guideId, label: data.guideName @@ -137,6 +132,7 @@ function Newest() { setDataLoading(false); }) } + const handleOk = () => { updateReservationGuide() .finally(() => { @@ -144,15 +140,18 @@ function Newest() { setDataLoading(false); }) } + const handleCancel = () => { setIsModalOpen(false); setDataLoading(false); } // 默认重新搜索第一页,所有状态的计划 - const onSearchClick = (current=1, status=null) => { + const searchReservation = (submitValues, current=1) => { setDataLoading(true) - fetchReservationList(formValuesToSub, current) + console.info('onSearchClick') + console.info(submitValues) + fetchReservationList(submitValues, current) .catch(ex => { notification.error({ message: `Notification`, @@ -208,20 +207,11 @@ function Newest() { dates: { label: t('group:ArrivalDate') }, }, }} - onSubmit={(err, formVal, filedsVal) => { - setDataLoading(true) - fetchReservationList(formVal) - .catch(ex => { - notification.error({ - message: 'Notification', - description: ex.message, - placement: 'top', - duration: 4, - }) - }) - .finally(() => { - setDataLoading(false) - }) + onMounted={(initialValue) => { + searchReservation(initialValue) + }} + onSubmit={() => { + searchReservation(formValuesToSub) }} /> @@ -238,7 +228,9 @@ function Newest() { total: reservationPage.total, simple: true }} - onChange={(pagination) => {onSearchClick(pagination.current)}} + onChange={(pagination) => { + searchReservation(formValuesToSub, pagination.current) + }} columns={reservationListColumns} dataSource={reservationList} />