Merge remote-tracking branch 'origin/main'

perf/export-docx
Lei OT 10 months ago
commit d26a0a94bd

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

@ -25,46 +25,40 @@
"Import": "Import", "Import": "Import",
"Export": "Export", "Export": "Export",
"Copy": "Copy", "Copy": "Copy",
"sureCancel": "Are you sure to cancel?", "sureCancel": "Are you sure to cancel?",
"sureDelete":"Are you sure to delete?", "sureDelete": "Are you sure to delete?",
"sureSubmit":"Are you sure to submit?", "sureSubmit": "Are you sure to submit?",
"Yes": "Yes", "Yes": "Yes",
"No": "No", "No": "No",
"Success": "Success", "Success": "Success",
"Failed": "Failed", "Failed": "Failed",
"All": "All", "All": "All",
"Table": { "Table": {
"Total": "Total {{total}} items" "Total": "Total {{total}} items"
}, },
"Login": "Login", "Login": "Login",
"Username": "Username", "Username": "Username",
"Realname": "Realname", "Realname": "Realname",
"Password": "Password", "Password": "Password",
"ChangePassword": "Change password", "ChangePassword": "Change password",
"Profile": "Profile", "Profile": "Profile",
"Logout": "Logout", "Logout": "Logout",
"LoginTimeout": "Login timeout", "LoginTimeout": "Login timeout",
"LoginTimeoutTip": "Please input your password", "LoginTimeoutTip": "Please input your password",
"userProfile": "User Profile", "userProfile": "User Profile",
"Telephone": "Telephone", "Telephone": "Telephone",
"Email": "Email address", "Email": "Email address",
"Address": "Address", "Address": "Address",
"Company": "Company", "Company": "Company",
"Department": "Department", "Department": "Department",
"datetime": { "datetime": {
"thisWeek": "This Week", "thisWeek": "This Week",
"lastWeek": "Last Week", "lastWeek": "Last Week",
"thisMonth": "This Month", "thisMonth": "This Month",
"lastMonth": "Last Month", "lastMonth": "Last Month",
"nextMonth": "Next Month",
"lastThreeMonth": "Last Three Month", "lastThreeMonth": "Last Three Month",
"nextThreeMonth": "Next Three Month",
"firstHalfYear": "First Half Year", "firstHalfYear": "First Half Year",
"latterHalfYear": "Latter Half Year", "latterHalfYear": "Latter Half Year",
"thisYear": "This Year" "thisYear": "This Year"
@ -101,5 +95,13 @@
"LoginFailed": "Incorrect password, Login failed.", "LoginFailed": "Incorrect password, Login failed.",
"UsernameIsEmpty": "Please input your username", "UsernameIsEmpty": "Please input your username",
"PasswordIsEmpty": "Please input your password" "PasswordIsEmpty": "Please input your password"
},
"invoiceStatus": {
"Status": "Status",
"Not_submitted": "Not submitted",
"Submitted": "Submitted",
"Travel_advisor_approved": "Travel advisor approved",
"Finance_Dept_arrproved": "Finance Dept arrproved",
"Paid": "Paid"
} }
} }

@ -25,46 +25,40 @@
"Import": "导入", "Import": "导入",
"Export": "导出", "Export": "导出",
"Copy": "复制", "Copy": "复制",
"sureCancel": "确定取消?", "sureCancel": "确定取消?",
"sureDelete":"确定删除?", "sureDelete": "确定删除?",
"sureSubmit":"确定提交?", "sureSubmit": "确定提交?",
"Yes": "是", "Yes": "是",
"No": "否", "No": "否",
"Success": "成功", "Success": "成功",
"Failed": "失败", "Failed": "失败",
"All": "所有", "All": "所有",
"Table": { "Table": {
"Total": "共 {{total}} 条" "Total": "共 {{total}} 条"
}, },
"Login": "登录", "Login": "登录",
"Username": "账号", "Username": "账号",
"Realname": "姓名", "Realname": "姓名",
"Password": "密码", "Password": "密码",
"ChangePassword": "修改密码", "ChangePassword": "修改密码",
"Profile": "账户中心", "Profile": "账户中心",
"Logout": "退出", "Logout": "退出",
"LoginTimeout": "登录超时", "LoginTimeout": "登录超时",
"LoginTimeoutTip": "请输入密码", "LoginTimeoutTip": "请输入密码",
"userProfile": "账号信息", "userProfile": "账号信息",
"Telephone": "联系电话", "Telephone": "联系电话",
"Email": "电子邮箱", "Email": "电子邮箱",
"Address": "公司地址", "Address": "公司地址",
"Company": "公司名称", "Company": "公司名称",
"Department": "部门", "Department": "部门",
"datetime": { "datetime": {
"thisWeek": "本周", "thisWeek": "本周",
"lastWeek": "上周", "lastWeek": "上周",
"thisMonth": "本月", "thisMonth": "本月",
"lastMonth": "上月", "lastMonth": "上月",
"nextMonth": "下月",
"lastThreeMonth": "前三个月", "lastThreeMonth": "前三个月",
"nextThreeMonth": "后三个月",
"firstHalfYear": "上半年", "firstHalfYear": "上半年",
"latterHalfYear": "下半年", "latterHalfYear": "下半年",
"thisYear": "今年" "thisYear": "今年"
@ -101,5 +95,13 @@
"LoginFailed": "密码错误,登陆失败。", "LoginFailed": "密码错误,登陆失败。",
"UsernameIsEmpty": "请输入账号", "UsernameIsEmpty": "请输入账号",
"PasswordIsEmpty": "请输入密码" "PasswordIsEmpty": "请输入密码"
},
"invoiceStatus": {
"Status": "审核状态",
"Not_submitted": "待提交",
"Submitted": "待审核",
"Travel_advisor_approved": "顾问已审核",
"Finance_Dept_arrproved": "财务已审核",
"Paid": "已打款"
} }
} }

@ -1,86 +1,84 @@
import { useEffect } from 'react'; import { useEffect } from "react";
import { Form, Input, Row, Col, Select, DatePicker, Space, Button, Checkbox } from 'antd'; import { Form, Input, Row, Col, Select, DatePicker, Space, Button, Checkbox } from "antd";
import { objectMapper, at } from '@/utils/commons'; import { objectMapper, at } from "@/utils/commons";
import { DATE_FORMAT, SMALL_DATETIME_FORMAT } from '@/config'; import { DATE_FORMAT, SMALL_DATETIME_FORMAT } from "@/config";
import useFormStore from '@/stores/Form'; import useFormStore from "@/stores/Form";
import { useDatePresets } from '@/hooks/useDatePresets'; import { useDatePresets } from "@/hooks/useDatePresets";
import { useTranslation } from 'react-i18next'; import { useTranslation } from "react-i18next";
import SearchInput from './SearchInput'; import SearchInput from "./SearchInput";
import AuditStateSelector from './AuditStateSelector'; import AuditStateSelector from "./AuditStateSelector";
import DeptSelector from './DeptSelector'; import DeptSelector from "./DeptSelector";
import ProductsTypesSelector from './ProductsTypesSelector'; import ProductsTypesSelector from "./ProductsTypesSelector";
import CitySelector from '@/components/CitySelector'; import CitySelector from "@/components/CitySelector";
import VendorSelector from '@/components/VendorSelector'; import VendorSelector from "@/components/VendorSelector";
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, formName, formLayout, loading, ...props }) => { const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, formName, formLayout, loading, ...props }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const presets = useDatePresets(); const presets = useDatePresets();
const [formValues, setFormValues] = useFormStore((state) => [state.formValues, state.setFormValues]); const [formValues, setFormValues] = useFormStore(state => [state.formValues, state.setFormValues]);
const [formValuesToSub, setFormValuesToSub] = useFormStore((state) => [state.formValuesToSub, state.setFormValuesToSub]); const [formValuesToSub, setFormValuesToSub] = useFormStore(state => [state.formValuesToSub, state.setFormValuesToSub]);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { sort, hides, shows, fieldProps, fieldComProps } = { const { sort, hides, shows, fieldProps, fieldComProps } = {
sort: '', sort: "",
// initialValue: '', // initialValue: '',
fieldProps: '', fieldProps: "",
fieldComProps: '', fieldComProps: "",
hides: [], hides: [],
shows: [], shows: [],
...props.fieldsConfig, ...props.fieldsConfig,
}; };
const readValues = { ...initialValue, ...formValues }; const readValues = { ...initialValue, ...formValues };
const formValuesMapper = (values) => { const formValuesMapper = values => {
const destinationObject = { const destinationObject = {
'keyword': { key: 'keyword', transform: (value) => value || '' }, keyword: { key: "keyword", transform: value => value || "" },
'username': { key: 'username', transform: (value) => value || '' }, username: { key: "username", transform: value => value || "" },
'referenceNo': { key: 'referenceNo', transform: (value) => value || '' }, referenceNo: { key: "referenceNo", transform: value => value || "" },
'dates': [ dates: [
{ key: 'startdate', transform: (arrVal) => (arrVal ? arrVal[0].format(DATE_FORMAT) : '') }, { key: "startdate", transform: arrVal => (arrVal ? arrVal[0].format(DATE_FORMAT) : "") },
{ key: 'enddate', transform: (arrVal) => (arrVal ? arrVal[1].format(DATE_FORMAT) : '') }, { key: "enddate", transform: arrVal => (arrVal ? arrVal[1].format(DATE_FORMAT) : "") },
{ key: 'starttime', transform: (arrVal) => (arrVal ? arrVal[0].format(DATE_FORMAT) : '') }, { key: "starttime", transform: arrVal => (arrVal ? arrVal[0].format(DATE_FORMAT) : "") },
{ key: 'endtime', transform: (arrVal) => (arrVal ? arrVal[1].format(SMALL_DATETIME_FORMAT) : '') }, { key: "endtime", transform: arrVal => (arrVal ? arrVal[1].format(SMALL_DATETIME_FORMAT) : "") },
], ],
'invoiceStatus': { key: 'invoiceStatus', transform: (value) => value?.value || value?.key || '', default: '' }, invoiceStatus: { key: "invoiceStatus", transform: value => value?.value || value?.key || "", default: "" },
'audit_state': { key: 'audit_state', transform: (value) => value?.value || value?.key || '', default: '' }, audit_state: { key: "audit_state", transform: value => value?.value || value?.key || "", default: "" },
'agency': { agency: {
key: 'agency', key: "agency",
transform: (value) => { transform: value => {
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? value.value : ''; return Array.isArray(value) ? value.map(ele => ele.key).join(",") : value ? value.value : "";
}, },
}, },
'year': [ year: [{ key: "year", transform: arrVal => (arrVal ? arrVal.format("YYYY") : "") }],
{ key: 'year', transform: (arrVal) => (arrVal ? arrVal.format('YYYY') : '') }, products_types: {
], key: "products_types",
'products_types': { transform: value => {
key: 'products_types', return Array.isArray(value) ? value.map(ele => ele.key).join(",") : value ? value.value : "";
transform: (value) => {
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? value.value : '';
}, },
}, },
'dept': { dept: {
key: 'dept', key: "dept",
transform: (value) => { transform: value => {
console.log(value); console.log(value);
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? value.value : ''; return Array.isArray(value) ? value.map(ele => ele.key).join(",") : value ? value.value : "";
}, },
}, },
'city': { city: {
key: 'city', key: "city",
transform: (value) => { transform: value => {
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? value.value : ''; return Array.isArray(value) ? value.map(ele => ele.key).join(",") : value ? value.value : "";
}, },
}, },
'unconfirmed': { key: 'unconfirmed', transform: (value) => value ? 1 : 0 }, unconfirmed: { key: "unconfirmed", transform: value => (value ? 1 : 0) },
}; };
let dest = {}; let dest = {};
const { dates, ...omittedValue } = values; const { dates, ...omittedValue } = values;
dest = { ...omittedValue, ...objectMapper(values, destinationObject) }; dest = { ...omittedValue, ...objectMapper(values, destinationObject) };
for (const key in dest) { for (const key in dest) {
if (Object.prototype.hasOwnProperty.call(dest, key)) { if (Object.prototype.hasOwnProperty.call(dest, key)) {
dest[key] = typeof dest[key] === 'string' ? (dest[key] || '').trim() : dest[key]; dest[key] = typeof dest[key] === "string" ? (dest[key] || "").trim() : dest[key];
} }
} }
// omit empty // omit empty
@ -93,21 +91,21 @@ const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, f
const dest = formValuesMapper(readValues); const dest = formValuesMapper(readValues);
setFormValuesToSub(dest); setFormValuesToSub(dest);
if (typeof onMounted === 'function') { if (typeof onMounted === "function") {
onMounted(dest) onMounted(dest);
} }
return () => {}; return () => {};
}, []); }, []);
const onFinish = (values) => { const onFinish = values => {
console.log('Received values of form, origin form value: \n', values); console.log("Received values of form, origin form value: \n", values);
const dest = formValuesMapper(values); const dest = formValuesMapper(values);
console.log('form value send to onSubmit:\n', dest); console.log("form value send to onSubmit:\n", dest);
const str = new URLSearchParams(dest).toString(); const str = new URLSearchParams(dest).toString();
setFormValues(values); setFormValues(values);
setFormValuesToSub(dest); setFormValuesToSub(dest);
if (typeof onSubmit === 'function') { if (typeof onSubmit === "function") {
onSubmit(null, dest, values, str); onSubmit(null, dest, values, str);
} }
}; };
@ -116,12 +114,11 @@ const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, f
form.setFieldsValue({ form.setFieldsValue({
// 'DateType': undefined, // 'DateType': undefined,
}); });
if (typeof onReset === 'function') { if (typeof onReset === "function") {
onReset(); onReset();
} }
}; };
const onValuesChange = (changedValues, allValues) => { const onValuesChange = (changedValues, allValues) => {
const dest = formValuesMapper(allValues); const dest = formValuesMapper(allValues);
setFormValues(allValues); setFormValues(allValues);
setFormValuesToSub(dest); setFormValuesToSub(dest);
@ -129,20 +126,20 @@ const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, f
}; };
const onFinishFailed = ({ values, errorFields }) => { const onFinishFailed = ({ values, errorFields }) => {
console.log('form validate failed', '\nform values:', values, '\nerrorFields', errorFields); console.log("form validate failed", "\nform values:", values, "\nerrorFields", errorFields);
}; };
return ( return (
<> <>
<Form form={form} layout={'horizontal'} name={formName || 'advanced_search'} className='orders-search-form' onFinish={onFinish} onValuesChange={onValuesChange} onFinishFailed={onFinishFailed} > <Form form={form} layout={"horizontal"} name={formName || "advanced_search"} className="orders-search-form" onFinish={onFinish} onValuesChange={onValuesChange} onFinishFailed={onFinishFailed}>
{/* <EditableContext.Provider value={form}> */} {/* <EditableContext.Provider value={form}> */}
<Row gutter={16}> <Row gutter={16}>
{getFields({ sort, initialValue: readValues, hides, shows, fieldProps, fieldComProps, form, presets, t })} {getFields({ sort, initialValue: readValues, hides, shows, fieldProps, fieldComProps, form, presets, t })}
{/* 'textAlign': 'right' */} {/* 'textAlign': 'right' */}
<Col flex='1 0 90px' className='flex justify-normal items-start' > <Col flex="1 0 90px" className="flex justify-normal items-start">
<Space align='center'> <Space align="center">
<Button size={'middle'} type='primary' htmlType='submit' loading={loading}> <Button size={"middle"} type="primary" htmlType="submit" loading={loading}>
{confirmText || t('Search')} {confirmText || t("Search")}
</Button> </Button>
{/* <Button size="small" onClick={onReset}> {/* <Button size="small" onClick={onReset}>
重置 重置
@ -171,72 +168,72 @@ function getFields(props) {
const customCol = col || 4; const customCol = col || 4;
const mdCol = customCol * 2; const mdCol = customCol * 2;
return { return {
'key': '', key: "",
sort, sort,
name, name,
render, render,
'hide': false, hide: false,
'col': { lg: { span: customCol }, md: { span: mdCol < 8 ? 10 : mdCol }, flex: mdCol < 8 ? '1 0' : '' }, col: { lg: { span: customCol }, md: { span: mdCol < 8 ? 10 : mdCol }, flex: mdCol < 8 ? "1 0" : "" },
}; };
}; };
let baseChildren = []; let baseChildren = [];
baseChildren = [ baseChildren = [
item( item(
'keyword', "keyword",
99, 99,
<Form.Item name='keyword' {...fieldProps.keyword}> <Form.Item name="keyword" {...fieldProps.keyword}>
<Input allowClear {...fieldComProps.keyword} /> <Input allowClear {...fieldComProps.keyword} />
</Form.Item>, </Form.Item>,
fieldProps?.keyword?.col || 6 fieldProps?.keyword?.col || 6
), ),
item( item(
'referenceNo', "referenceNo",
99, 99,
<Form.Item name='referenceNo' label={t('group:RefNo')} {...fieldProps.referenceNo}> <Form.Item name="referenceNo" label={t("group:RefNo")} {...fieldProps.referenceNo}>
<Input placeholder={t('group:RefNo')} allowClear /> <Input placeholder={t("group:RefNo")} allowClear />
</Form.Item>, </Form.Item>,
fieldProps?.referenceNo?.col || 6 fieldProps?.referenceNo?.col || 6
), ),
item( item(
'PNR', "PNR",
99, 99,
<Form.Item name='PNR' label='PNR'> <Form.Item name="PNR" label="PNR">
<Input placeholder={t('group:PNR')} allowClear /> <Input placeholder={t("group:PNR")} allowClear />
</Form.Item>, </Form.Item>,
fieldProps?.PNR?.col || 4 fieldProps?.PNR?.col || 4
), ),
item( item(
'invoiceStatus', "invoiceStatus",
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: t("invoiceStatus.Status") }}>
<Select <Select
labelInValue labelInValue
options={[ options={[
{ value: '0', label: 'Status' }, { value: "0", label: t("invoiceStatus.Status") },
{ value: '1', label: 'Not submitted' }, { value: "1", label: t("invoiceStatus.Not_submitted") },
{ value: '2', label: 'Submitted' }, { value: "2", label: t("invoiceStatus.Submitted") },
{ value: '3', label: 'Travel advisor approved' }, { value: "3", label: t("invoiceStatus.Travel_advisor_approved") },
{ value: '4', label: 'Finance Dept arrproved' }, { value: "4", label: t("invoiceStatus.Finance_Dept_arrproved") },
{ value: '5', label: 'Paid' }, { value: "5", label: t("invoiceStatus.Paid") },
]} ]}
/> />
</Form.Item>, </Form.Item>,
fieldProps?.invoiceStatus?.col || 3 fieldProps?.invoiceStatus?.col || 3
), ),
item( item(
'dates', "dates",
99, 99,
<Form.Item name={'dates'} label={t('group:ArrivalDate')} {...fieldProps.dates} initialValue={at(props, 'initialValue.dates')[0]}> <Form.Item name={"dates"} label={t("group:ArrivalDate")} {...fieldProps.dates} initialValue={at(props, "initialValue.dates")[0]}>
{/* <DatePickerCharts isform={true} {...fieldProps.dates} form={form} /> */} {/* <DatePickerCharts isform={true} {...fieldProps.dates} form={form} /> */}
<RangePicker allowClear={true} inputReadOnly={true} presets={presets} placeholder={['From', 'Thru']} {...fieldComProps.dates} /> <RangePicker allowClear={true} inputReadOnly={true} presets={presets} placeholder={["From", "Thru"]} {...fieldComProps.dates} />
</Form.Item>, </Form.Item>,
fieldProps?.dates?.col || midCol fieldProps?.dates?.col || midCol
), ),
item( item(
'username', "username",
99, 99,
<Form.Item name='username' label={t('account:username')} {...fieldProps.username}> <Form.Item name="username" label={t("account:username")} {...fieldProps.username}>
<Input placeholder={t('account:username')} allowClear /> <Input placeholder={t("account:username")} allowClear />
</Form.Item>, </Form.Item>,
fieldProps?.username?.col || 4 fieldProps?.username?.col || 4
), ),
@ -244,64 +241,64 @@ function getFields(props) {
* *
*/ */
item( item(
'year', "year",
99, 99,
<Form.Item name={'year'} label={t('products:UseYear')} {...fieldProps.year} initialValue={at(props, 'initialValue.year')[0]}> <Form.Item name={"year"} label={t("products:UseYear")} {...fieldProps.year} initialValue={at(props, "initialValue.year")[0]}>
<DatePicker picker='year' allowClear {...fieldComProps.year} /> <DatePicker picker="year" allowClear {...fieldComProps.year} />
</Form.Item>, </Form.Item>,
fieldProps?.year?.col || 3 fieldProps?.year?.col || 3
), ),
item( item(
'agency', "agency",
99, 99,
<Form.Item name='agency' label={t('products:Vendor')} {...fieldProps.agency} initialValue={at(props, 'initialValue.agency')[0]}> <Form.Item name="agency" label={t("products:Vendor")} {...fieldProps.agency} initialValue={at(props, "initialValue.agency")[0]}>
<VendorSelector {...fieldComProps.agency} /> <VendorSelector {...fieldComProps.agency} />
</Form.Item>, </Form.Item>,
fieldProps?.agency?.col || 6 fieldProps?.agency?.col || 6
), ),
item( item(
'audit_state', "audit_state",
99, 99,
<Form.Item name={`audit_state`} initialValue={at(props, 'initialValue.audit_state')[0] || { value: '', label: 'Status' }}> <Form.Item name={`audit_state`} initialValue={at(props, "initialValue.audit_state")[0] || { value: "", label: "Status" }}>
<AuditStateSelector {...fieldComProps.audit_state} /> <AuditStateSelector {...fieldComProps.audit_state} />
</Form.Item>, </Form.Item>,
fieldProps?.audit_state?.col || 3 fieldProps?.audit_state?.col || 3
), ),
item( item(
'products_types', "products_types",
99, 99,
<Form.Item name={`products_types`} label={t('products:ProductType')} {...fieldProps.products_types} initialValue={at(props, 'initialValue.products_types')[0] || undefined}> <Form.Item name={`products_types`} label={t("products:ProductType")} {...fieldProps.products_types} initialValue={at(props, "initialValue.products_types")[0] || undefined}>
<ProductsTypesSelector maxTagCount={1} {...fieldComProps.products_types} /> <ProductsTypesSelector maxTagCount={1} {...fieldComProps.products_types} />
</Form.Item>, </Form.Item>,
fieldProps?.products_types?.col || 6 fieldProps?.products_types?.col || 6
), ),
item( item(
'dept', "dept",
99, 99,
<Form.Item name={`dept`} label={t('products:Dept')} {...fieldProps.dept} initialValue={at(props, 'initialValue.dept')[0] || undefined}> <Form.Item name={`dept`} label={t("products:Dept")} {...fieldProps.dept} initialValue={at(props, "initialValue.dept")[0] || undefined}>
<DeptSelector {...fieldComProps.dept} /> <DeptSelector {...fieldComProps.dept} />
</Form.Item>, </Form.Item>,
fieldProps?.dept?.col || 6 fieldProps?.dept?.col || 6
), ),
item( item(
'city', "city",
99, 99,
<Form.Item name={`city`} label={t('products:City')} {...fieldProps.city} initialValue={at(props, 'initialValue.city')[0] || undefined}> <Form.Item name={`city`} label={t("products:City")} {...fieldProps.city} initialValue={at(props, "initialValue.city")[0] || undefined}>
<CitySelector {...fieldComProps.city} /> <CitySelector {...fieldComProps.city} />
</Form.Item>, </Form.Item>,
fieldProps?.city?.col || 4 fieldProps?.city?.col || 4
), ),
item( item(
'unconfirmed', "unconfirmed",
99, 99,
<Form.Item name={`unconfirmed`} valuePropName='checked' initialValue={at(props, 'initialValue.unconfirmed') || false}> <Form.Item name={`unconfirmed`} valuePropName="checked" initialValue={at(props, "initialValue.unconfirmed") || false}>
<Checkbox>{t('group:unconfirmed')}</Checkbox> <Checkbox>{t("group:unconfirmed")}</Checkbox>
</Form.Item>, </Form.Item>,
fieldProps?.unconfirmed?.col || 2 fieldProps?.unconfirmed?.col || 2
), ),
]; ];
baseChildren = baseChildren baseChildren = baseChildren
.map((x) => { .map(x => {
x.hide = false; x.hide = false;
if (props.sort === undefined) { if (props.sort === undefined) {
return x; return x;
@ -316,7 +313,7 @@ function getFields(props) {
} }
return x; return x;
}) })
.map((x) => { .map(x => {
if (props.hides.length === 0 && props.shows.length === 0) { if (props.hides.length === 0 && props.shows.length === 0) {
return x; return x;
} }
@ -327,7 +324,7 @@ function getFields(props) {
} }
return x; return x;
}) })
.filter((x) => !x.hide) .filter(x => !x.hide)
.sort((a, b) => { .sort((a, b) => {
return a.sort < b.sort ? -1 : 1; return a.sort < b.sort ? -1 : 1;
}); });
@ -336,7 +333,7 @@ function getFields(props) {
for (let i = 0; i < baseChildren.length; i++) { for (let i = 0; i < baseChildren.length; i++) {
let style = {}; // { padding: '0px 2px' }; let style = {}; // { padding: '0px 2px' };
style = i % 2 === 0 && baseChildren[i].col === 12 ? { ...style, ...leftStyle } : style; style = i % 2 === 0 && baseChildren[i].col === 12 ? { ...style, ...leftStyle } : style;
style = !baseChildren[i].hide ? { ...style, display: 'block' } : { ...style, display: 'none' }; style = !baseChildren[i].hide ? { ...style, display: "block" } : { ...style, display: "none" };
const Item = ( const Item = (
<Col key={String(i)} style={style} {...layoutProps} {...baseChildren[i].col}> <Col key={String(i)} style={style} {...layoutProps} {...baseChildren[i].col}>
{baseChildren[i].render} {baseChildren[i].render}

@ -1,7 +1,7 @@
export const PROJECT_NAME = "GHHub"; export const PROJECT_NAME = "GHHub";
// mode: test内部测试使用 // mode: test内部测试使用
export const HT_HOST = import.meta.env.MODE === 'test' ? 'http://202.103.68.144:890' : import.meta.env.PROD ? "https://p9axztuwd7x8a7.mycht.cn" : 'http://202.103.68.144:890' export const HT_HOST = import.meta.env.MODE === 'test' ? 'http://120.79.9.217:10024' : import.meta.env.PROD ? 'https://p9axztuwd7x8a7.mycht.cn' : 'http://202.103.68.144:890'
export const DATE_FORMAT = "YYYY-MM-DD"; export const DATE_FORMAT = "YYYY-MM-DD";

@ -25,10 +25,18 @@ export const useDatePresets = () => {
label: t("datetime.lastMonth"), label: t("datetime.lastMonth"),
value: [dayjs().subtract(1, "M").startOf("M"), dayjs().subtract(1, "M").endOf("M")], value: [dayjs().subtract(1, "M").startOf("M"), dayjs().subtract(1, "M").endOf("M")],
}, },
{
label: t("datetime.nextMonth"),
value: [dayjs().add(1, "M").startOf("M"), dayjs().add(1, "M").endOf("M")],
},
{ {
label: t("datetime.lastThreeMonth"), label: t("datetime.lastThreeMonth"),
value: [dayjs().subtract(2, "M").startOf("M"), dayjs().endOf("M")], value: [dayjs().subtract(2, "M").startOf("M"), dayjs().endOf("M")],
}, },
{
label: t("datetime.nextThreeMonth"),
value: [dayjs().startOf("M"), dayjs().add(3,"M").endOf("M")],
},
{ {
label: t("datetime.firstHalfYear"), label: t("datetime.firstHalfYear"),
value: [dayjs().startOf("y"), dayjs().endOf("y").subtract(6, "M")], value: [dayjs().startOf("y"), dayjs().endOf("y").subtract(6, "M")],

@ -29,6 +29,7 @@ import InvoicePaid from '@/views/invoice/Paid'
import InvoicePaidDetail from '@/views/invoice/PaidDetail' import InvoicePaidDetail from '@/views/invoice/PaidDetail'
import Airticket from '@/views/airticket/Index' import Airticket from '@/views/airticket/Index'
import AirticketPlan from '@/views/airticket/Plan' import AirticketPlan from '@/views/airticket/Plan'
import AirticketInvoice from '@/views/airticket/Invoice'
import { ThemeContext } from '@/stores/ThemeContext' import { ThemeContext } from '@/stores/ThemeContext'
import { usingStorage } from '@/hooks/usingStorage' import { usingStorage } from '@/hooks/usingStorage'
import useAuthStore from './stores/Auth' import useAuthStore from './stores/Auth'
@ -69,6 +70,7 @@ const initRouter = async () => {
{ path: 'invoice/paid/detail/:flid', element: <RequireAuth subject={PERM_OVERSEA} result={true}><InvoicePaidDetail /></RequireAuth>}, { path: 'invoice/paid/detail/:flid', element: <RequireAuth subject={PERM_OVERSEA} result={true}><InvoicePaidDetail /></RequireAuth>},
{ path: 'airticket',element: <RequireAuth subject={PERM_AIR_TICKET} result={true}><Airticket /></RequireAuth>}, { path: 'airticket',element: <RequireAuth subject={PERM_AIR_TICKET} result={true}><Airticket /></RequireAuth>},
{ path: 'airticket/plan/:coli_sn/:gri_sn',element:<RequireAuth subject={PERM_AIR_TICKET} result={true}><AirticketPlan /></RequireAuth>}, { path: 'airticket/plan/:coli_sn/:gri_sn',element:<RequireAuth subject={PERM_AIR_TICKET} result={true}><AirticketPlan /></RequireAuth>},
{ path: 'airticket/invoice',element:<RequireAuth subject={PERM_AIR_TICKET} result={true}><AirticketInvoice /></RequireAuth>},
{ 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>},

@ -10,6 +10,7 @@ const airTicketStore = create((set, get) => ({
setPlanList: planList => set({ planList }), setPlanList: planList => set({ planList }),
setPlanDetail: planDetail => set({ planDetail }), setPlanDetail: planDetail => set({ planDetail }),
setGuestList: guestList => set({ guestList }), setGuestList: guestList => set({ guestList }),
setVEIFlightBill: vEIFlightBill => set({ vEIFlightBill }),
async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd) { async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd) {
const { setLoading, setPlanList } = get(); const { setLoading, setPlanList } = get();
@ -68,15 +69,21 @@ const airTicketStore = create((set, get) => ({
const _result = errcode !== 0 ? [] : result; const _result = errcode !== 0 ? [] : result;
setGuestList(_result); setGuestList(_result);
}, },
// async getFlightCostList(CLF_SN) { //获取账单列表
// const searchParams = { async getVEIFlightBill(VEI_SN, GRI_Name, CheckStatus, FlightDate1, FlightDate2) {
// CLF_SN: CLF_SN, const { setVEIFlightBill } = get();
// }; const searchParams = {
// const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/Get_flight_cost`, searchParams); VEI_SN: VEI_SN,
// const _result = errcode !== 0 ? [] : result; GRI_Name: GRI_Name,
// console.log(_result); CheckStatus: CheckStatus,
// return _result; FlightDate1: FlightDate1,
// }, FlightDate2: FlightDate2,
};
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/GetVEIFlightBill`, searchParams);
const _result = errcode !== 0 ? [] : result;
console.log(_result);
setVEIFlightBill(_result);
},
async postFlightCost(values) { async postFlightCost(values) {
const formData = new FormData(); const formData = new FormData();
for (const [key, value] of Object.entries(values)) { for (const [key, value] of Object.entries(values)) {
@ -91,6 +98,15 @@ const airTicketStore = create((set, get) => ({
} }
}); });
}, },
async deleteFlightCost(CLC_SN) {
const searchParams = {
CLC_SN: CLC_SN,
};
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/Delete_flight_cost`, searchParams);
const _result = errcode !== 0 ? [] : result;
return _result;
},
})); }));
export default airTicketStore; export default airTicketStore;

@ -1,6 +1,6 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { Grid, Divider, Layout, Spin, Input, Col, Row, Space, List, Table } from "antd"; import { Grid, Divider, Layout, Spin, Input, Col, Row, Space, List, Table, Button } from "antd";
import { PhoneOutlined, CustomerServiceOutlined, AudioOutlined } from "@ant-design/icons"; import { PhoneOutlined, CustomerServiceOutlined, AudioOutlined,AuditOutlined } from "@ant-design/icons";
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom"; import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
import { isEmpty, formatColonTime } from "@/utils/commons"; import { isEmpty, formatColonTime } from "@/utils/commons";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -14,6 +14,7 @@ const planListColumns = [
title: "团名", title: "团名",
key: "GRI_No", key: "GRI_No",
dataIndex: "GRI_No", dataIndex: "GRI_No",
// sorter: (a, b) => b.GRI_No - a.GRI_No,
}, },
{ {
title: "组团人", title: "组团人",
@ -77,20 +78,17 @@ const planListColumns = [
]; ];
const Airticket = props => { const Airticket = props => {
const href = useHref();
const navigate = useNavigate(); const navigate = useNavigate();
const { phonenumber } = useParams();
const { travelAgencyId } = usingStorage(); const { travelAgencyId } = usingStorage();
const [getPlanList, planList, loading] = airTicketStore(state => [state.getPlanList, state.planList, state.loading]); const [getPlanList, planList, loading] = airTicketStore(state => [state.getPlanList, state.planList, state.loading]);
const [phone_number, setPhone_number] = useState(phonenumber);
const showTotal = total => `合计 ${total} `; const showTotal = total => `合计 ${total} `;
useEffect(() => {}, []); useEffect(() => {}, []);
const oncall = () => {};
return ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
<Row>
<Col md={20} lg={20} xxl={20}>
<SearchForm <SearchForm
initialValue={{ initialValue={{
dates: [dayjs().startOf("M"), dayjs().endOf("M")], dates: [dayjs().startOf("M"), dayjs().endOf("M")],
@ -99,13 +97,21 @@ const Airticket = props => {
shows: ["referenceNo", "dates"], shows: ["referenceNo", "dates"],
fieldProps: { fieldProps: {
referenceNo: { label: "搜索计划" }, referenceNo: { label: "搜索计划" },
dates: { label: "出发日期" }, dates: { label: "出发日期" ,col:8},
}, },
}} }}
onSubmit={(err, formVal, filedsVal) => { onSubmit={(err, formVal, filedsVal) => {
getPlanList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.endtime); getPlanList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.endtime);
}} }}
/> />
</Col>
<Col md={4} lg={4} xxl={4}>
<Button icon={<AuditOutlined />} onClick={() => navigate(`/airticket/invoice`)}>
报账
</Button>
</Col>
</Row>
<Row> <Row>
<Col md={24} lg={24} xxl={24}> <Col md={24} lg={24} xxl={24}>
<Table bordered={true} rowKey="id" columns={planListColumns} dataSource={planList} loading={loading} pagination={{ defaultPageSize: 20, showTotal: showTotal }} /> <Table bordered={true} rowKey="id" columns={planListColumns} dataSource={planList} loading={loading} pagination={{ defaultPageSize: 20, showTotal: showTotal }} />

@ -0,0 +1,151 @@
import { useState, useEffect } from "react";
import { Grid, Divider, Layout, Spin, Input, Col, Row, Space, Checkbox, Table, Button } from "antd";
import { PhoneOutlined, CustomerServiceOutlined, AudioOutlined, AuditOutlined } from "@ant-design/icons";
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
import { isEmpty, formatColonTime } from "@/utils/commons";
import dayjs from "dayjs";
import SearchForm from "@/components/SearchForm";
import BackBtn from "@/components/BackBtn";
import airTicketStore from "@/stores/Airticket";
import { usingStorage } from "@/hooks/usingStorage";
const Invoice = props => {
const navigate = useNavigate();
const { travelAgencyId } = usingStorage();
const [getVEIFlightBill, vEIFlightBill, loading] = airTicketStore(state => [state.getVEIFlightBill, state.vEIFlightBill, state.loading]);
const showTotal = total => `合计 ${total} `;
//
const totalFee = vEIFlightBill.reduce((acc, curr) => acc + curr.ServiceFee, 0);
const vEIFlightBillColumns = [
{
title: "团名",
key: "GRI_No",
dataIndex: "GRI_No",
render: (text, record) => `${record.GRI_No} ${record.WL}`,
},
{
title: "费用类型",
key: "CostType",
dataIndex: "CostType",
},
{
title: "手续费/费用",
children: [
{
title: totalFee,
dataIndex: "ServiceFee",
},
],
},
{
title: "出发日期",
key: "StartDate",
dataIndex: "StartDate",
sorter: (a, b) => {
const dateA = new Date(a.StartDate);
const dateB = new Date(b.StartDate);
return dateB.getTime() - dateA.getTime();
},
},
{
title: "城市",
key: "FromCity",
dataIndex: "FromCity",
render: (text, record) => (record.CostType == "出票" ? `${record.FromCity} - ${record.ToCity}` : "-"),
},
{
title: "航班",
key: "FlightNo",
dataIndex: "FlightNo",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "PNR",
key: "PNR",
dataIndex: "PNR",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "票号",
key: "TicketNo",
dataIndex: "TicketNo",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "机票类型",
key: "FlightType",
dataIndex: "FlightType",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "机票价格",
key: "Cost",
dataIndex: "Cost",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "折扣",
key: "Discount",
dataIndex: "Discount",
render: (text, record) => (record.CostType == "出票" ? text : "-"),
},
{
title: "备注",
key: "Memo",
dataIndex: "Memo",
},
{
title: "审核状态",
children: [
{
title: <Button type="link">全选</Button>,
dataIndex: "CheckStatus", //2
render: (text, record) => (record.CheckStatus < 2 ? <Checkbox>待提交</Checkbox> : record.CheckStatusName),
},
],
sorter: (a, b) => {
return b.CheckStatus - a.CheckStatus;
},
},
];
useEffect(() => {}, []);
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Row>
<Col md={20} lg={20} xxl={20}>
<SearchForm
initialValue={{
dates: [dayjs().startOf("M"), dayjs().endOf("M")],
}}
fieldsConfig={{
shows: ["referenceNo", "dates", "invoiceStatus"],
fieldProps: {
referenceNo: { label: "搜索计划" },
dates: { label: "出发日期", col: 8 },
},
}}
onSubmit={(err, formVal, filedsVal) => {
getVEIFlightBill(travelAgencyId, formVal.referenceNo, formVal.invoiceStatus, formVal.startdate, formVal.endtime);
}}
/>
</Col>
<Col md={4} lg={4} xxl={4}>
<BackBtn to={"/airticket"} />
</Col>
</Row>
<Row>
<Col md={24} lg={24} xxl={24}>
<Table bordered={true} rowKey="id" columns={vEIFlightBillColumns} dataSource={vEIFlightBill} loading={loading} pagination={{ defaultPageSize: 100, showTotal: showTotal }} />
</Col>
<Col md={24} lg={24} xxl={24}></Col>
</Row>
</Space>
);
};
export default Invoice;

@ -1,5 +1,5 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Typography } from "antd"; import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm } from "antd";
import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons"; import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons";
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom"; import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
import { isEmpty, formatColonTime } from "@/utils/commons"; import { isEmpty, formatColonTime } from "@/utils/commons";
@ -7,106 +7,41 @@ import { OFFICEWEBVIEWERURL } from "@/config";
import airTicketStore from "@/stores/Airticket"; import airTicketStore from "@/stores/Airticket";
import { usingStorage } from "@/hooks/usingStorage"; import { usingStorage } from "@/hooks/usingStorage";
import BackBtn from "@/components/BackBtn";
const AirticketPlan = props => { const AirticketPlan = props => {
const { coli_sn, gri_sn } = useParams(); const { coli_sn, gri_sn } = useParams();
const { travelAgencyId, loginToken } = usingStorage(); const { travelAgencyId, loginToken } = usingStorage();
const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, getFlightCostList, postFlightCost] = airTicketStore(state => [ const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, postFlightCost, deleteFlightCost] = airTicketStore(state => [
state.getPlanDetail, state.getPlanDetail,
state.planDetail, state.planDetail,
state.getGuestList, state.getGuestList,
state.guestList, state.guestList,
state.loading, state.loading,
state.postFlightDetail, state.postFlightDetail,
state.getFlightCostList,
state.postFlightCost, state.postFlightCost,
state.deleteFlightCost,
]); ]);
const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${gri_sn}&VEI_SN=${travelAgencyId}`; const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${gri_sn}&VEI_SN=${travelAgencyId}&token=${loginToken}`;
const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl); const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { notification } = App.useApp(); const { notification } = App.useApp();
//console.log(reservationPreviewUrl); //console.log(reservationPreviewUrl);
// //
const guestListColumns = [ const guestList_select = () => {
{
title: "姓名",
key: "MEI_Name",
dataIndex: "MEI_Name",
},
{
title: "证件类型",
key: "MEI_PassportType",
dataIndex: "MEI_PassportType",
},
{
title: "证件号",
key: "MEI_PassportNo",
dataIndex: "MEI_PassportNo",
},
{
title: "证件有效期",
key: "MEI_PassportValidDate",
dataIndex: "MEI_PassportValidDate",
},
{
title: "性别",
key: "MEI_Gender",
dataIndex: "MEI_Gender",
},
{
title: "年龄",
key: "MEI_age",
dataIndex: "MEI_age",
},
{
title: "国籍",
key: "MEI_Country",
dataIndex: "MEI_Country",
},
{
title: "票号",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "PNR",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "机票费用RMB含基建和税",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "折扣",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "手续费",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "机票类型(成人/儿童/婴儿)",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "操作",
key: "MEI_SN",
dataIndex: "MEI_SN",
render: (_, record) => {
return ( return (
<span> guestList &&
<Typography.Link onClick={() => showModal(record)}>编辑</Typography.Link> | <Typography.Link onClick={() => console.log("del")}>删除</Typography.Link> guestList.map(item => {
</span> return { label: `${item.MEI_Name} , ${item.MEI_PassportNo}`, value: `${item.MEI_Name} , ${item.MEI_PassportNo} , ${item.MEI_Country} , ${item.MEI_Gender} , ${item.MEI_age} , ${item.MEI_Birthday}` };
})
); );
}, };
},
]; const guestList_OnChange = value => {
console.log(value);
ticket_form.setFieldsValue({ Memo: `${value}` });
};
// //
const costListColumns = [ const costListColumns = [
@ -117,8 +52,8 @@ const AirticketPlan = props => {
}, },
{ {
title: "手续费/费用", title: "手续费/费用",
key: "Cost", key: "ServiceFee",
dataIndex: "Cost", dataIndex: "ServiceFee",
}, },
{ {
title: "PNR", title: "PNR",
@ -128,8 +63,8 @@ const AirticketPlan = props => {
}, },
{ {
title: "票号", title: "票号",
key: "FlightCost", key: "TicketNo",
dataIndex: "FlightCost", dataIndex: "TicketNo",
render: (text, record) => (record.CostType == "出票" ? text : "-"), render: (text, record) => (record.CostType == "出票" ? text : "-"),
}, },
{ {
@ -140,8 +75,8 @@ const AirticketPlan = props => {
}, },
{ {
title: "机票价格", title: "机票价格",
key: "FlightCost", key: "Cost",
dataIndex: "FlightCost", dataIndex: "Cost",
render: (text, record) => (record.CostType == "出票" ? text : "-"), render: (text, record) => (record.CostType == "出票" ? text : "-"),
}, },
{ {
@ -157,9 +92,20 @@ const AirticketPlan = props => {
}, },
{ {
title: "编辑", title: "编辑",
key: "CLF_SN", key: "CLC_SN",
dataIndex: "CLF_SN", dataIndex: "CLC_SN",
render: (text, record) => <a onClick={() => showModal(record)}>编辑</a>, render: (text, record) => (
<>
<Space>
<a onClick={() => showModal(record)}>编辑</a>
<Popconfirm title="删除" description="请确认是否删除?" onConfirm={() => handleDelete(record.CLC_SN)} okText="是" cancelText="否">
<Button danger type="link">
删除
</Button>
</Popconfirm>
</Space>
</>
),
}, },
]; ];
@ -228,7 +174,7 @@ const AirticketPlan = props => {
</Form.Item> </Form.Item>
<Form.Item label="出发"> <Form.Item label="出发">
<Space> <Space>
<Form.Item name="FromAirportCode" noStyle> <Form.Item name="FromAirport" noStyle>
<Input placeholder="机场" /> <Input placeholder="机场" />
</Form.Item> </Form.Item>
<Form.Item name="FromTerminal" noStyle> <Form.Item name="FromTerminal" noStyle>
@ -241,7 +187,7 @@ const AirticketPlan = props => {
</Form.Item> </Form.Item>
<Form.Item label="抵达"> <Form.Item label="抵达">
<Space> <Space>
<Form.Item name="ToAirportCode" noStyle> <Form.Item name="ToAirport" noStyle>
<Input placeholder="机场" /> <Input placeholder="机场" />
</Form.Item> </Form.Item>
<Form.Item name="ToTerminal" noStyle> <Form.Item name="ToTerminal" noStyle>
@ -300,7 +246,7 @@ const AirticketPlan = props => {
? planDetail.map(item => { ? planDetail.map(item => {
return { return {
key: item.id, key: item.id,
label: `${item.StartDate}`, label: `${item.StartDate} ${item.FlightNo}(${item.FromAirport}${item.FlightStart}-${item.ToAirport}${item.FlightEnd})(${item.FlightCabin})`,
children: <Airticket_form airInfo={item} />, children: <Airticket_form airInfo={item} />,
}; };
}) })
@ -314,7 +260,8 @@ const AirticketPlan = props => {
const showModal = ticket => { const showModal = ticket => {
setIsModalOpen(true); setIsModalOpen(true);
ticket.CostType == "出票" ? setisTicketType(true) : setisTicketType(false);// if (isEmpty(ticket.CostType)) ticket.CostType = "出票";
ticket.CostType == "出票" ? setisTicketType(true) : setisTicketType(false); //
ticket_form.setFieldsValue(ticket); ticket_form.setFieldsValue(ticket);
}; };
@ -357,6 +304,29 @@ const AirticketPlan = props => {
setIsModalOpen(false); setIsModalOpen(false);
}; };
const handleDelete = CLC_SN => {
deleteFlightCost(CLC_SN)
.then(() => {
notification.success({
message: `成功`,
description: "删除成功!",
placement: "top",
duration: 4,
icon: <LikeTwoTone />,
});
getPlanDetail(travelAgencyId, gri_sn);
})
.catch(() => {
notification.error({
message: `错误`,
description: "删除失败",
placement: "top",
duration: 4,
icon: <FrownTwoTone />,
});
});
};
const onChangeType = value => { const onChangeType = value => {
if (value == "出票") { if (value == "出票") {
setisTicketType(true); setisTicketType(true);
@ -413,7 +383,7 @@ const AirticketPlan = props => {
<Form.Item label="PNR" name="PNR"> <Form.Item label="PNR" name="PNR">
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label="票号" name="Cost"> <Form.Item label="票号" name="TicketNo">
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label="机票类型" name="FlightType"> <Form.Item label="机票类型" name="FlightType">
@ -437,8 +407,7 @@ const AirticketPlan = props => {
]} ]}
/> />
</Form.Item> </Form.Item>
<Form.Item label="机票价格" name="Cost">
<Form.Item label="机票价格" name="FlightCost">
<Input <Input
placeholder="含基建和税" placeholder="含基建和税"
prefix="¥" prefix="¥"
@ -454,32 +423,8 @@ const AirticketPlan = props => {
}} }}
/> />
</Form.Item> </Form.Item>
<Form.Item label="选择客人" name="MEI_Name66"> <Form.Item label="选择客人" name="MEI_Name66">
<Select <Select onChange={value => guestList_OnChange(value)} options={guestList_select()} />
style={{
width: 160,
}}
onChange={() => console.log("dsads")}
options={[
{
value: "",
label: "",
},
{
value: "jack",
label: "成人",
},
{
value: "lucy",
label: "儿童",
},
{
value: "Yiminghe",
label: "婴儿",
},
]}
/>
</Form.Item> </Form.Item>
</> </>
)} )}
@ -508,14 +453,20 @@ const AirticketPlan = props => {
useEffect(() => { useEffect(() => {
getPlanDetail(travelAgencyId, gri_sn); getPlanDetail(travelAgencyId, gri_sn);
getGuestList(travelAgencyId, coli_sn); getGuestList(coli_sn);
}, []); }, []);
return ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
<Row>
<Col md={20} lg={20} xxl={20}></Col>
<Col md={4} lg={4} xxl={4}>
<BackBtn to={"/airticket"} />
</Col>
</Row>
<Row> <Row>
<Col md={24} lg={24} xxl={24} style={{ height: "100%" }}> <Col md={24} lg={24} xxl={24} style={{ height: "100%" }}>
<iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl} style={{ width: "100%", height: "600px" }}></iframe> {/* <iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl} style={{ width: "100%", height: "600px" }}></iframe> */}
<Button type="link" target="_blank" href={reservationUrl}> <Button type="link" target="_blank" href={reservationUrl}>
下载 下载
</Button> </Button>

Loading…
Cancel
Save