修改批量录入界面功能

perf/export-docx
黄文强@HWQ-PC 1 year ago
commit f77bcf4288

@ -11,8 +11,12 @@ Global Highlights Hub 海外供应商平台
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
npm version premajor --no-git-tag-version npm version premajor --no-git-tag-version
npm version prerelease --no-git-tag-version 1.0.0 -> 2.0.0-0
--preid beta | alpha | rc
npm version prerelease --preid beta --no-git-tag-version
2.0.0-0 -> 2.0.0-1 -> 2.0.0-2 ..n -> 2.0.0-n
npm version patch --no-git-tag-version npm version patch --no-git-tag-version
2.0.0-n -> 2.0.0
"push:tag": "npm version patch && git.exe push --progress "origin" main:main" "push:tag": "npm version patch && git.exe push --progress "origin" main:main"
"push:tag": "npm version patch && git push origin master" "push:tag": "npm version patch && git push origin master"

@ -1,7 +1,7 @@
{ {
"name": "global-highlights-hub", "name": "global-highlights-hub",
"private": true, "private": true,
"version": "2.0.0-0", "version": "2.0.0-alpha.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

@ -13,7 +13,7 @@
"EditComponents": { "EditComponents": {
"info": "Product Information", "info": "Product Information",
"Quotation": "Quotation", "Quotation": "Quotation",
"Extras": "Add-on" "Extras": "Components"
}, },
"auditState": { "auditState": {
"New": "New", "New": "New",
@ -49,7 +49,7 @@
"KM": "KM", "KM": "KM",
"RecommendsRate": "RecommendsRate", "RecommendsRate": "RecommendsRate",
"OpenWeekdays": "Open Weekdays", "OpenWeekdays": "Open Weekdays",
"DisplayToC": "DisplayToC", "DisplayToC": "Display To C",
"Dept": "Dept", "Dept": "Dept",
"productProject": "Product project", "productProject": "Product project",
@ -94,18 +94,22 @@
"Child": "Child" "Child": "Child"
}, },
"save":"save",
"edit":"edit",
"delete":"delete",
"cancel":"cancel",
"sureCancel":"Sure you want to cancel?",
"sureDelete":"Sure you want to delete?",
"CopyFormMsg": { "CopyFormMsg": {
"requiredVendor": "Please pick a target vendor", "requiredVendor": "Please pick a target vendor",
"requiredTypes": "Please select product types", "requiredTypes": "Please select product types",
"requiredDept": "Please pick a owner department" "requiredDept": "Please pick a owner department"
}, },
"quotationTable": {
"Adult": "Adult",
"Child": "Child",
"Currency": "Currency",
"Unit": "Unit",
"GroupSize": "Group Size",
"UseDates": "Use Dates",
"Operation": "Operation",
"Weekdays": "Weekdays"
},
"#": "#" "#": "#"
} }

@ -13,7 +13,7 @@
"EditComponents": { "EditComponents": {
"info": "产品信息", "info": "产品信息",
"Quotation": "报价", "Quotation": "报价",
"Extras": "附加项目" "Extras": "绑定项目"
}, },
"auditState": { "auditState": {
"New": "新增", "New": "新增",
@ -95,18 +95,22 @@
"Child": "儿童" "Child": "儿童"
}, },
"save":"保存",
"edit":"编辑",
"delete":"删除",
"cancel":"取消",
"sureCancel": "确定取消?",
"sureDelete":"确定删除?",
"CopyFormMsg": { "CopyFormMsg": {
"requiredVendor": "请选择目标供应商", "requiredVendor": "请选择目标供应商",
"requiredTypes": "请选择产品类型", "requiredTypes": "请选择产品类型",
"requiredDept": "请选择所属小组" "requiredDept": "请选择所属小组"
}, },
"quotationTable": {
"Adult": "成人",
"Child": "儿童",
"Currency": "币种",
"Unit": "类型",
"GroupSize": "人等",
"UseDates": "使用日期",
"Weekdays": "周末",
"Operation": "Operation"
},
"#": "#" "#": "#"
} }

@ -39,7 +39,6 @@ export const DeptSelector = ({show_all, isLeaf,...props}) => {
<div> <div>
<Select <Select
mode={props.mode} mode={props.mode}
style={{ width: '100%' }}
placeholder="选择小组" placeholder="选择小组"
labelInValue labelInValue
maxTagCount={1} maxTagCount={1}

@ -213,7 +213,6 @@ function getFields(props) {
99, 99,
<Form.Item name={`invoiceStatus`} initialValue={at(props, 'initialValue.invoiceStatus')[0] || { value: '0', label: 'Status' }}> <Form.Item name={`invoiceStatus`} initialValue={at(props, 'initialValue.invoiceStatus')[0] || { value: '0', label: 'Status' }}>
<Select <Select
style={{ width: '100%' }}
labelInValue labelInValue
options={[ options={[
{ value: '0', label: 'Status' }, { value: '0', label: 'Status' },

@ -72,6 +72,7 @@ const initRouter = async () => {
{ path: "products",element: <RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsManage /></RequireAuth>}, { path: "products",element: <RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsManage /></RequireAuth>},
{ path: "products/:travel_agency_id/:use_year/:audit_state/audit",element:<RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsAudit /></RequireAuth>}, { path: "products/:travel_agency_id/:use_year/:audit_state/audit",element:<RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsAudit /></RequireAuth>},
{ path: "products/:travel_agency_id/:use_year/:audit_state/edit",element:<RequireAuth subject={PERM_PRODUCTS_OFFER_PUT} result={true}><ProductsDetail /></RequireAuth>}, { path: "products/:travel_agency_id/:use_year/:audit_state/edit",element:<RequireAuth subject={PERM_PRODUCTS_OFFER_PUT} result={true}><ProductsDetail /></RequireAuth>},
{ path: "products/edit",element:<RequireAuth subject={PERM_PRODUCTS_OFFER_PUT} result={true}><ProductsDetail /></RequireAuth>},
] ]
}, },
{ {

@ -3,7 +3,7 @@ import { PROJECT_NAME } from '@/config';
export const loadPageSpy = (title) => { export const loadPageSpy = (title) => {
if (window.$pageSpy) return if (import.meta.env.DEV || window.$pageSpy) return
const PageSpySrc = [ const PageSpySrc = [
'https://page-spy.mycht.cn/page-spy/index.min.js', 'https://page-spy.mycht.cn/page-spy/index.min.js',

@ -88,6 +88,7 @@ const initialState = {
agencyList: [], agencyList: [],
activeAgency: {}, activeAgency: {},
agencyProducts: {}, agencyProducts: {},
editingProduct: {},
}; };
export const useProductsStore = create( export const useProductsStore = create(
devtools((set, get) => ({ devtools((set, get) => ({
@ -100,6 +101,7 @@ export const useProductsStore = create(
setAgencyList: (agencyList) => set({ agencyList }), setAgencyList: (agencyList) => set({ agencyList }),
setActiveAgency: (activeAgency) => set({ activeAgency }), setActiveAgency: (activeAgency) => set({ activeAgency }),
setAgencyProducts: (agencyProducts) => set({ agencyProducts }), setAgencyProducts: (agencyProducts) => set({ agencyProducts }),
setEditingProduct: (editingProduct) => set({ editingProduct }),
reset: () => set(initialState), reset: () => set(initialState),

@ -58,7 +58,9 @@ const Header = ({ title, agency, refresh, ...props }) => {
const PriceTable = ({ productType, dataSource, refresh }) => { const PriceTable = ({ productType, dataSource, refresh }) => {
const { t } = useTranslation('products'); const { t } = useTranslation('products');
const { travel_agency_id, use_year, audit_state } = useParams();
const [loading, activeAgency] = useProductsStore((state) => [state.loading, state.activeAgency]); const [loading, activeAgency] = useProductsStore((state) => [state.loading, state.activeAgency]);
const [setEditingProduct] = useProductsStore((state) => [state.setEditingProduct]);
const { message, notification } = App.useApp(); const { message, notification } = App.useApp();
const stateMapVal = useProductsAuditStatesMapVal(); const stateMapVal = useProductsAuditStatesMapVal();
@ -92,7 +94,10 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
}; };
const columns = [ const columns = [
{ key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('Title'), onCell: (r, index) => ({ rowSpan: r.rowSpan, }), className: 'bg-white', render: (text, r) => text || r.lgc_details?.['2']?.title || r.lgc_details?.['1']?.title || '' }, { key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('Title'), onCell: (r, index) => ({ rowSpan: r.rowSpan, }), className: 'bg-white', render: (text, r) => {
const title = text || r.lgc_details?.['2']?.title || r.lgc_details?.['1']?.title || '';
return <Link to={`/products/${travel_agency_id}/${use_year}/${audit_state}/edit`} onClick={() => setEditingProduct(r.info)}>{title}</Link>;
} },
...(productType === 'B' ? [{ key: 'km', dataIndex: ['info', 'km'], title: t('KM')}] : []), ...(productType === 'B' ? [{ key: 'km', dataIndex: ['info', 'km'], title: t('KM')}] : []),
{ key: 'adult', title: t('AgeType.Adult'), render: (_, { adult_cost, currency, unit_id, unit_name }) => `${adult_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` }, { key: 'adult', title: t('AgeType.Adult'), render: (_, { adult_cost, currency, unit_id, unit_name }) => `${adult_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` },
{ key: 'child', title: t('AgeType.Child'), render: (_, { child_cost, currency, unit_id, unit_name }) => `${child_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` }, { key: 'child', title: t('AgeType.Child'), render: (_, { child_cost, currency, unit_id, unit_name }) => `${child_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` },
@ -114,11 +119,12 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
key: 'state', key: 'state',
title: t('State'), title: t('State'),
render: (_, r) => { render: (_, r) => {
return <span className={`text-${stateMapVal[`${r.audit_state_id}`]?.color}`}>{stateMapVal[`${r.audit_state_id}`]?.label}</span>; const stateCls = `text-${stateMapVal[`${r.audit_state_id}`]?.color} `;
return <span className={stateCls}>{stateMapVal[`${r.audit_state_id}`]?.label}</span>;
}, },
}, },
{ {
title: '价格审核', title: '',
key: 'action', key: 'action',
render: (_, r) => render: (_, r) =>
r.audit_state_id <= 0 ? ( r.audit_state_id <= 0 ? (

@ -8,6 +8,7 @@ import { useProductsTypes } from '@/hooks/useProductsSets';
import Extras from './Detail/Extras'; import Extras from './Detail/Extras';
import { groupBy } from '@/utils/commons'; import { groupBy } from '@/utils/commons';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import useProductsStore from '@/stores/Products/Index';
import { useHTLanguageSets } from '@/hooks/useHTLanguageSets'; import { useHTLanguageSets } from '@/hooks/useHTLanguageSets';
import { useDefaultLgc } from '@/i18n/LanguageSwitcher'; import { useDefaultLgc } from '@/i18n/LanguageSwitcher';
import BatchImportPrice from './Detail/BatchImportPrice1'; import BatchImportPrice from './Detail/BatchImportPrice1';
@ -37,6 +38,7 @@ function Detail() {
const HTLanguageSets = useHTLanguageSets(); const HTLanguageSets = useHTLanguageSets();
const { Search } = Input; const { Search } = Input;
const [editingProduct, setEditingProduct] = useProductsStore((state) => [state.editingProduct, state.setEditingProduct]);
const [expandedKeys, setExpandedKeys] = useState([]); const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState(''); const [searchValue, setSearchValue] = useState('');
@ -51,53 +53,53 @@ function Detail() {
const productProject = { const productProject = {
"6": [], "6": [],
"B": [ "B": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code'), nameKey: 'products:Code' },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' },
{ code: "km", name: t('products:KM') }, { code: "km", name: t('products:KM'), nameKey: 'products:KM' },
{ code: "remarks", name: t('products:Remarks') } { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' }
], ],
"J": [ "J": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code'), nameKey: 'products:Code' },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' },
{ code: "recommends_rate", name: t('products:recommendationRate') }, { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' },
{ code: "duration", name: t('products:Duration') }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' },
{ code: "dept_name", name: t('products:Dept') }, { code: "dept_name", name: t('products:Dept'), nameKey: 'products:Dept' },
{ code: "display_to_c", name: t('products:DisplayToC') }, { code: "display_to_c", name: t('products:DisplayToC'), nameKey: 'products:DisplayToC' },
{ code: "remarks", name: t('products:Remarks') }, { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' },
], ],
"Q": [ "Q": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code'), nameKey: 'products:Code' },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' },
{ code: "recommends_rate", name: t('products:recommendationRate') }, { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' },
{ code: "duration", name: t('products:Duration') }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' },
{ code: "dept_name", name: t('products:Dept') }, { code: "dept_name", name: t('products:Dept'), nameKey: 'products:Dept' },
{ code: "display_to_c", name: t('products:DisplayToC') }, { code: "display_to_c", name: t('products:DisplayToC'), nameKey: 'products:DisplayToC' },
{ code: "remarks", name: t('products:Remarks') }, { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' },
], ],
"D": [ "D": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code'), nameKey: 'products:Code' },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' },
{ code: "recommends_rate", name: t('products:recommendationRate') }, { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' },
{ code: "duration", name: t('products:Duration') }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' },
{ code: "dept_name", name: t('products:Dept') }, { code: "dept_name", name: t('products:Dept'), nameKey: 'products:Dept' },
{ code: "display_to_c", name: t('products:DisplayToC') }, { code: "display_to_c", name: t('products:DisplayToC'), nameKey: 'products:DisplayToC' },
{ code: "remarks", name: t('products:Remarks') }, { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' },
], ],
"7": [ "7": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code'), nameKey: 'products:Code' },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' },
{ code: "recommends_rate", name: t('products:recommendationRate') }, { code: "recommends_rate", name: t('products:recommendationRate'), nameKey: 'products:recommendationRate' },
{ code: "duration", name: t('products:Duration') }, { code: "duration", name: t('products:Duration'), nameKey: 'products:Duration' },
{ code: "open_weekdays", name: t('products:OpenWeekdays') }, { code: "open_weekdays", name: t('products:OpenWeekdays'), nameKey: 'products:OpenWeekdays' },
{ code: "remarks", name: t('products:Remarks') }, { code: "remarks", name: t('products:Remarks'), nameKey: 'products:Remarks' },
], ],
"8": [ "8": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code') },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City') },
], ],
"R": [ "R": [
{ code: "code", name: t('products:Code') }, { code: "code", name: t('products:Code'), nameKey: 'products:Code' },
{ code: "city_name", name: t('products:City') }, { code: "city_name", name: t('products:City'), nameKey: 'products:City' },
] ]
} }
const [selectedCategory, setSelectedCategory] = useState(productProject.B); const [selectedCategory, setSelectedCategory] = useState(productProject.B);
@ -128,10 +130,12 @@ function Detail() {
children: (productsData[type.value] || []).map(product => ({ children: (productsData[type.value] || []).map(product => ({
title: product.info.title, title: product.info.title,
key: `${type.value}-${product.info.id}`, key: `${type.value}-${product.info.id}`,
_raw: product,
})) }))
})); }));
}; };
const treeData = generateTreeData(productsTypes, groupedProducts); const treeData = generateTreeData(productsTypes, groupedProducts);
console.log("treeData", treeData) console.log("treeData", treeData)
setTreeData(treeData); setTreeData(treeData);
@ -444,14 +448,16 @@ function Detail() {
const editable = isEditing(record); const editable = isEditing(record);
return editable ? ( return editable ? (
<span> <span>
<a href="#!" onClick={() => handleSave(record.id)} style={{ marginRight: 8 }}>{t('products:save')}</a> {/* <a href="#!" onClick={() => handleSave(record.id)} style={{ marginRight: 8 }}>{t('Save')}</a> */}
<Popconfirm title={t('products:sureCancel')} onConfirm={cancel}><a>{t('products:cancel')}</a></Popconfirm> <Button type="link" onClick={() => handleSave(record.id)}>{t('Save')}</Button>
<Button type="link" onClick={cancel}>{t('Cancel')}</Button>
{/* <Popconfirm title={t('sureCancel')} onConfirm={cancel}><a>{t('Cancel')}</a></Popconfirm> */}
</span> </span>
) : ( ) : (
<span> <span>
<a disabled={editingid !== ''} onClick={() => edit(record)} style={{ marginRight: 8 }}>{t('products:edit')}</a> <a disabled={editingid !== ''} onClick={() => edit(record)} style={{ marginRight: 8 }}>{t('Edit')}</a>
<Popconfirm title={t('products:sureDelete')} onConfirm={() => handleDelete(record.id)}> <Popconfirm title={t('sureDelete')} onConfirm={() => handleDelete(record.id)}>
<a>{t('products:delete')}</a> <a>{t('Delete')}</a>
</Popconfirm> </Popconfirm>
</span> </span>
); );
@ -559,6 +565,8 @@ function Detail() {
setRemainderLanguage(HTLanguageSets.filter(item => item.key !== language.toString())) setRemainderLanguage(HTLanguageSets.filter(item => item.key !== language.toString()))
setEditingProduct(node._raw);
let initialQuotationData = null; let initialQuotationData = null;
let infoData = null; let infoData = null;
let lgcDetailsData = null; let lgcDetailsData = null;
@ -616,8 +624,8 @@ function Detail() {
return ( return (
<div> <div>
<Row> <Row>
<Col span={6}> <Col span={6} className=' relative'>
<Card style={{ width: "20%", position: "fixed", maxHeight: "80vh", overflowY: "auto" }}> <Card className='w-[inherit] fixed overflow-y-auto max-h-[80vh]'>
<Search style={{ marginBottom: 8 }} placeholder="Search" onChange={onChange} /> <Search style={{ marginBottom: 8 }} placeholder="Search" onChange={onChange} />
<Tree <Tree
onSelect={handleNodeSelect} onSelect={handleNodeSelect}
@ -633,18 +641,19 @@ function Detail() {
<Col span={18}> <Col span={18}>
<Form form={form} name="control-hooks" onFinish={onSave}> <Form form={form} name="control-hooks" onFinish={onSave}>
<Card <Card
style={{ width: "80%" }} // style={{ width: "80%" }}
title={ title={
<Breadcrumb items={[ <Breadcrumb items={[
{ title: <Link to={'/'}>供应商</Link> }, // { title: <Link to={'/'}></Link> },
{ title: <Link to={'/products'}>综费</Link> }, { title: <Link to={'/products'}>综费</Link> },
{ title: '文章列表' } { title: editingProduct?.info?.title || t('New') }
]} /> ]} />
} }
> >
<h2>{t('products:productProject')}</h2> <h2>{t('products:EditComponents.info')}</h2>
<Row gutter={16}> <Row gutter={16}>
{selectedCategory.map((item, index) => ( {selectedCategory.map((item, index) => (
<Col span={8} id={index} key={`${item.code}-${index}`}> <Col span={8} id={index} key={`${item.code}-${index}`}>
<Form.Item name={['info', item.code]} label={item.name}> <Form.Item name={['info', item.code]} label={item.name}>
{item.code === "duration" ? ( {item.code === "duration" ? (
@ -667,6 +676,7 @@ function Detail() {
<div> <div>
{tags.map(tag => ( {tags.map(tag => (
<Tag <Tag
key={tag}
id={tag} id={tag}
onClick={() => handleTagClick(tag)} onClick={() => handleTagClick(tag)}
color={tag === selectedTag ? 'blue' : undefined} color={tag === selectedTag ? 'blue' : undefined}
@ -711,12 +721,12 @@ function Detail() {
/> />
</Form.Item> </Form.Item>
</Card> </Card>
</Card> {/* </Card> */}
<Card style={{ width: "80%" }}> {/* <Card style={{ width: "80%" }}> */}
<h2>{t('products:supplierQuotation')}</h2> <h2>{t('products:supplierQuotation')}</h2>
<Form.Item name="quotation"> <Form.Item name="quotation">
<Table <Table rowKey={'id'}
components={{ body: { cell: EditableCell } }} components={{ body: { cell: EditableCell } }}
bordered bordered
dataSource={quotation} dataSource={quotation}
@ -730,20 +740,20 @@ function Detail() {
<Button onClick={handleBatchImport} type="primary" style={{ marginBottom: 16 }}>批量添加</Button> <Button onClick={handleBatchImport} type="primary" style={{ marginBottom: 16 }}>批量添加</Button>
</Form.Item> </Form.Item>
</Card>
<Card style={{ width: "80%" }}>
<Extras productId={2} />
</Card>
<Button type="primary" htmlType="submit" style={{ marginTop: 16, float: "right", marginRight: "20%" }}> <Button type="primary" htmlType="submit" style={{ marginTop: 16, float: "right", marginRight: "20%" }}>
{t('products:save')} {t('Save')}
</Button> </Button>
<Button type="primary" htmlType="submit" style={{ marginTop: 16, float: "right", marginRight: "5%" }}> <Button type="primary" htmlType="submit" style={{ marginTop: 16, float: "right", marginRight: "5%" }}>
提交审核 提交审核
</Button> </Button>
</Card>
</Form> </Form>
{/* <Card style={{ width: "80%" }}> */}
<Extras productId={2} />
{/* </Card> */}
</Col> </Col>
</Row> </Row>

@ -1,4 +1,4 @@
import { useEffect, useState } from 'react'; import { useEffect, useState, useSyncExternalStore } from 'react';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { App, Table, Button, Modal, Popconfirm } from 'antd'; import { App, Table, Button, Modal, Popconfirm } from 'antd';
@ -24,11 +24,12 @@ const NewAddonModal = ({ onPick, ...props }) => {
const onSearchProducts = async (values) => { const onSearchProducts = async (values) => {
const copyObject = cloneDeep(values); const copyObject = cloneDeep(values);
const { starttime, endtime, ...param } = copyObject; const { starttime, endtime, year, ...param } = copyObject;
setSearchLoading(true); setSearchLoading(true);
setSearchResult([]); setSearchResult([]);
// debug: audit_state: '1', // debug: audit_state: '1',
const result = await getAgencyProductsAction({ ...param, audit_state: '0', travel_agency_id, use_year }); const search_year = year || use_year;
const result = await getAgencyProductsAction({ ...param, travel_agency_id, use_year: search_year, audit_state: '0', });
setSearchResult(result?.products || []); setSearchResult(result?.products || []);
setSearchLoading(false); setSearchLoading(false);
}; };
@ -71,7 +72,7 @@ const NewAddonModal = ({ onPick, ...props }) => {
<Modal width={'95%'} style={{ top: 20 }} open={open} title={'添加附加'} footer={false} onCancel={() => setOpen(false)} destroyOnClose> <Modal width={'95%'} style={{ top: 20 }} open={open} title={'添加附加'} footer={false} onCancel={() => setOpen(false)} destroyOnClose>
<SearchForm <SearchForm
fieldsConfig={{ fieldsConfig={{
shows: ['dates', 'year', 'keyword'], shows: [ 'year', 'keyword'], // 'dates',
fieldProps: { fieldProps: {
dates: { label: t('products:CreateDate') }, dates: { label: t('products:CreateDate') },
keyword: { label: t('products:Title'), col: 4 }, keyword: { label: t('products:Title'), col: 4 },

@ -77,6 +77,7 @@ function Index() {
agency: { col: 4 }, agency: { col: 4 },
dates: { label: t('products:CreateDate') }, dates: { label: t('products:CreateDate') },
keyword: { label: t('products:Title'), col: 4 }, keyword: { label: t('products:Title'), col: 4 },
year: { col: 4 },
}, },
sort: { agency: 1, audit_state: 2, keyword: 100 }, sort: { agency: 1, audit_state: 2, keyword: 100 },
}} }}

Loading…
Cancel
Save