Merge branch 'main' of github.com:hainatravel/GHHub

perf/export-docx
黄文强@HWQ-PC 12 months ago
commit a0f81d26aa

@ -1,6 +1,7 @@
{
"ArrivalDate": "Arrival Date",
"RefNo": "Reference number",
"unconfirmed": "Unconfirmed",
"Pax": "Pax",
"Status": "Status",
"City": "City",

@ -1,6 +1,7 @@
{
"ArrivalDate": "抵达日期",
"RefNo": "团号",
"unconfirmed": "未确认",
"Pax": "人数",
"Status": "状态",
"City": "城市",
@ -11,6 +12,5 @@
"ConfirmationDate": "确认日期",
"ConfirmationDetails": "确认信息",
"PNR": "旅客订座记录",
"#": "#"
}

@ -1,5 +1,5 @@
import { useEffect } from 'react';
import { Form, Input, Row, Col, Select, DatePicker, Space, Button } from 'antd';
import { Form, Input, Row, Col, Select, DatePicker, Space, Button, Checkbox } from 'antd';
import { objectMapper, at } from '@/utils/commons';
import { DATE_FORMAT, SMALL_DATETIME_FORMAT } from '@/config';
import useFormStore from '@/stores/Form';
@ -301,6 +301,14 @@ function getFields(props) {
</Form.Item>,
fieldProps?.dept?.col || 6
),
item(
'unconfirmed',
99,
<Form.Item name={`unconfirmed`} valuePropName='checked' initialValue={at(props, 'initialValue.unconfirmed') || false}>
<Checkbox>{t('group:unconfirmed')}</Checkbox>
</Form.Item>,
fieldProps?.unconfirmed?.col || 2
),
];
baseChildren = baseChildren
.map((x) => {

@ -75,10 +75,10 @@ export const useProductsAuditStates = () => {
useEffect(() => {
const newData = [
{ key: '-1', value: '-1', label: t('products:auditState.New'), color: 'gray-500' },
{ key: '-1', value: '-1', label: t('products:auditState.New'), color: 'muted' },
{ key: '0', value: '0', label: t('products:auditState.Pending'), color: '' },
{ key: '2', value: '2', label: t('products:auditState.Approved'), color: 'primary' },
{ key: '3', value: '3', label: t('products:auditState.Rejected'), color: 'red-500' },
{ key: '3', value: '3', label: t('products:auditState.Rejected'), color: 'danger' },
{ key: '1', value: '1', label: t('products:auditState.Published'), color: 'primary' },
// ELSE 未知
];

@ -1,6 +1,6 @@
import { create } from 'zustand'
import { fetchJSON, postForm } from '@/utils/request'
import { isEmpty } from '@/utils/commons'
import { isEmpty, isNotEmpty } from '@/utils/commons'
import { HT_HOST } from "@/config"
import { usingStorage } from '@/hooks/usingStorage'
@ -139,16 +139,19 @@ const useAccountStore = create((set, get) => ({
},
searchAccountByCriteria: async (formValues) => {
let travel_agency_ids = null
if (isNotEmpty(formValues.agency)) {
travel_agency_ids = formValues.agency.map((ele) => ele.key).join(',')
}
const searchParams = {
username: formValues.username,
realname: formValues.realname,
travel_agency_ids: travel_agency_ids,
lgc: 2
}
const resultArray = await fetchAccountList(searchParams)
console.info(resultArray)
const mapAccoutList = resultArray.map((r) => {
return {
accountId: r.wu_id,

@ -91,17 +91,18 @@ const useReservationStore = create((set, get) => ({
}))
},
fetchReservationList: (formVal, current=1) => {
fetchReservationList: (formValues, current=1) => {
const { travelAgencyId } = usingStorage()
const { reservationPage } = get()
// 设置为 0后端会重新计算总数当跳转第 X 页时可用原来的总数。
const totalNum = current == 1 ? 0 : reservationPage.total;
const totalNum = current == 1 ? 0 : reservationPage.total
const notConfirmValue = formValues.notConfirm ? 1 : 0
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/GetPlanSearchList')
.append('VEI_SN', travelAgencyId)
.append('GroupNo', formVal.referenceNo)
.append('DateStart', formVal.startdate)
.append('DateEnd', formVal.enddate)
.append('NotConfirm', '')//status)// Todo: 待解决
.append('GroupNo', formValues.referenceNo)
.append('DateStart', formValues.startdate)
.append('DateEnd', formValues.enddate)
.append('NotConfirm', notConfirmValue)
.append('TotalNum', totalNum)
.append('PageSize', reservationPage.size)
.append('PageIndex', current)

@ -17,7 +17,7 @@ import useAuthStore from '@/stores/Auth'
import { useThemeContext } from '@/stores/ThemeContext'
import { usingStorage } from '@/hooks/usingStorage'
import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET } from '@/config'
import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT } from '@/config'
const { Header, Content, Footer } = Layout;
const { Title } = Typography;
@ -38,7 +38,6 @@ function App() {
const noticeUnRead = useNoticeStore((state) => state.noticeUnRead)
const href = useHref()
const navigate = useNavigate()
const location = useLocation()
// /p...
const needToLogin = href !== '/login' && isEmpty(loginToken)
@ -118,7 +117,7 @@ function App() {
isPermitted(PERM_OVERSEA) ? { key: 'feedback', label: <Link to='/feedback'>{t('menu.Feedback')}</Link> } : null,
isPermitted(PERM_OVERSEA) ? { key: 'report', label: <Link to='/report'>{t('menu.Report')}</Link> } : null,
isPermitted(PERM_AIR_TICKET) ? { key: 'airticket', label: <Link to='/airticket'>{t('menu.Airticket')}</Link> } : null,
{ key: 'products', label: <Link to='/products'>{t('menu.Products')}</Link> },
isPermitted(PERM_PRODUCTS_MANAGEMENT) ? { key: 'products', label: <Link to='/products'>{t('menu.Products')}</Link> } : null,
{
key: 'notice',
label: (

@ -40,14 +40,15 @@ function Login() {
return (
<Row justify='center' align='middle' className='min-h-96'>
<Form
name='basic'
name='login'
layout='vertical'
form={form}
size='large'
labelCol={{
span: 8,
}}
wrapperCol={{
span: 16,
span: 24,
}}
className='max-w-xl'
initialValues={{
@ -82,10 +83,6 @@ function Login() {
<Input.Password />
</Form.Item>
<Form.Item
wrapperCol={{
offset: 8,
span: 16,
}}
>
<Button type='primary' htmlType='submit' className='w-full'>
{t('Login')}

@ -1,21 +1,17 @@
import { Outlet } from 'react-router-dom'
import { Layout, ConfigProvider, theme, Typography, Row, Col, App as AntApp } from 'antd'
import { Layout, ConfigProvider, theme, Row, Col, App as AntApp } from 'antd'
import 'antd/dist/reset.css'
import AppLogo from '@/assets/logo-gh.png'
import { useThemeContext } from '@/stores/ThemeContext'
import Language from '../i18n/LanguageSwitcher'
import { BUILD_VERSION, } from '@/config';
const { Title } = Typography
const { Header, Content, Footer } = Layout
function Standlone() {
const { colorPrimary } = useThemeContext()
const {
token: { colorBgContainer },
} = theme.useToken()
return (
<ConfigProvider
theme={{
@ -28,10 +24,10 @@ function Standlone() {
<Layout className='min-h-screen'>
<Header className='sticky top-0 z-10 w-full'>
<Row gutter={{ md: 24 }} justify='center'>
<Col span={4}>
<Col span={2}>
<img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' />
</Col>
<Col span={18}><h1 className='text-white'>Global Highlights Hub</h1></Col>
<Col span={5}><h1 className='text-white text-center'>Global Highlights Hub</h1></Col>
<Col span={2}>
<Language />
</Col>
@ -40,7 +36,7 @@ function Standlone() {
<Content className='p-6 m-0 min-h-72 bg-white'>
<Outlet />
</Content>
<Footer></Footer>
<Footer>China Highlights International Travel Service Co., LTD, Version: {BUILD_VERSION}</Footer>
</Layout>
</AntApp>
</ConfigProvider>

@ -324,12 +324,13 @@ function Management() {
<Title level={3}>{t('account:accountList')}</Title>
<SearchForm
fieldsConfig={{
shows: ['username', 'realname'],
shows: ['username', 'realname', 'agency'],
fieldProps: {
username: { label: t('account:username') },
realname: { label: t('account:realname') },
agency: { label: t('account:travelAgency') },
},
sort: { username: 1, realname: 2},
sort: { username: 1, realname: 2, agency: 3},
}}
onSubmit={() => {
handelAccountSearch()

@ -98,7 +98,7 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
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: 'child', title: t('AgeType.Child'), render: (_, { child_cost, currency, unit_id, unit_name }) => `${child_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` },
// {key: 'unit', title: t('Unit'), },

@ -43,19 +43,19 @@ const NewAddonModal = ({ onPick, ...props }) => {
const searchResultColumns = [
{ key: 'ptype', dataIndex: ['info', 'product_type_id'], width: '6rem', title: t('products:ProductType'), render: (text, r) => productsTypesMapVal[text].label },
{ key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('products:Title') },
{
title: t('products:price'),
dataIndex: ['quotation', '0', 'adult_cost'],
width: '10rem',
render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`,
},
// {
// title: t('products:price'),
// dataIndex: ['quotation', '0', 'adult_cost'],
// width: '10rem',
// render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`,
// },
{
key: 'action',
title: '',
width: 150,
render: (_, record) => (
<Button className='text-primary' onClick={() => handleAddExtras(record)}>
附加此项目
绑定此项目
</Button>
),
},
@ -141,13 +141,13 @@ const Extras = ({ productId, onChange, ...props }) => {
const columns = [
{ title: t('products:Title'), dataIndex: ['info', 'title'], width: '16rem', },
{
title: t('products:Offer'),
dataIndex: ['quotation', '0', 'value'],
width: '10rem',
// {
// title: t('products:Offer'),
// dataIndex: ['quotation', '0', 'value'],
// width: '10rem',
render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`, // todo:
},
// render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`,
// },
// { title: t('products:Types'), dataIndex: 'age_type', width: '40%', },
{
title: '',

@ -201,8 +201,9 @@ function Newest() {
<Space direction='vertical' className='w-full'>
<Title level={3}></Title>
<SearchForm
initialValue={{unconfirmed: true}}
fieldsConfig={{
shows: ['referenceNo', 'dates'],
shows: ['referenceNo', 'dates', 'unconfirmed'],
fieldProps: {
dates: { label: t('group:ArrivalDate') },
},

@ -7,6 +7,8 @@ export default {
colors: {
...colors,
'primary': '#00b96b',
'danger': '#ef4444',
'muted': '#6b7280',
},
extend: {},
},

Loading…
Cancel
Save