添加按团状态和出票状态筛选

main
Ycc 9 months ago
parent b82c7ef7cb
commit 4baf742268

@ -1,12 +0,0 @@
import { Select } from 'antd';
import { useProductsAuditStates } from '@/hooks/useProductsSets';
const AuditStateSelector = ({ ...props }) => {
const states = useProductsAuditStates();
return (
<>
<Select labelInValue allowClear options={states} {...props}/>
</>
);
};
export default AuditStateSelector;

@ -7,7 +7,6 @@ import { useDatePresets } from "@/hooks/useDatePresets";
import { useTranslation } from "react-i18next";
import SearchInput from "./SearchInput";
import AuditStateSelector from "./AuditStateSelector";
import DeptSelector from "./DeptSelector";
import ProductsTypesSelector from "./ProductsTypesSelector";
import CitySelector from "@/components/CitySelector";
@ -71,6 +70,8 @@ const SearchForm = ({ initialValue, onSubmit, onReset, onMounted, confirmText, f
return Array.isArray(value) ? value.map(ele => ele.key).join(",") : value ? value.value : "";
},
},
plan_state: { key: "plan_state", transform: value => value?.value || value?.key || "", default: "" },
airticket_state: { key: "airticket_state", transform: value => value?.value || value?.key || "", default: "" },
unconfirmed: { key: "unconfirmed", transform: value => (value ? 1 : 0) },
};
let dest = {};
@ -179,7 +180,7 @@ function getFields(props) {
let baseChildren = [];
baseChildren = [
item(
"keyword",
"keyword", //
99,
<Form.Item name="keyword" {...fieldProps.keyword}>
<Input allowClear {...fieldComProps.keyword} />
@ -187,7 +188,7 @@ function getFields(props) {
fieldProps?.keyword?.col || 6
),
item(
"referenceNo",
"referenceNo", //
99,
<Form.Item name="referenceNo" label={t("group:RefNo")} {...fieldProps.referenceNo}>
<Input placeholder={t("group:RefNo")} allowClear />
@ -195,7 +196,7 @@ function getFields(props) {
fieldProps?.referenceNo?.col || 6
),
item(
"PNR",
"PNR", //PNR
99,
<Form.Item name="PNR" label="PNR">
<Input placeholder={t("group:PNR")} allowClear />
@ -203,7 +204,7 @@ function getFields(props) {
fieldProps?.PNR?.col || 4
),
item(
"invoiceStatus",
"invoiceStatus", //
99,
<Form.Item name={`invoiceStatus`} initialValue={at(props, "initialValue.invoiceStatus")[0] || { value: "0", label: t("invoiceStatus.Status") }}>
<Select
@ -221,7 +222,7 @@ function getFields(props) {
fieldProps?.invoiceStatus?.col || 3
),
item(
"dates",
"dates", //
99,
<Form.Item name={"dates"} label={t("group:ArrivalDate")} {...fieldProps.dates} initialValue={at(props, "initialValue.dates")[0]}>
{/* <DatePickerCharts isform={true} {...fieldProps.dates} form={form} /> */}
@ -230,7 +231,7 @@ function getFields(props) {
fieldProps?.dates?.col || midCol
),
item(
"username",
"username", //
99,
<Form.Item name="username" label={t("account:username")} {...fieldProps.username}>
<Input placeholder={t("account:username")} allowClear />
@ -241,7 +242,7 @@ function getFields(props) {
*
*/
item(
"year",
"year", //
99,
<Form.Item name={"year"} label={t("products:UseYear")} {...fieldProps.year} initialValue={at(props, "initialValue.year")[0]}>
<DatePicker picker="year" allowClear {...fieldComProps.year} />
@ -249,7 +250,7 @@ function getFields(props) {
fieldProps?.year?.col || 3
),
item(
"agency",
"agency", //
99,
<Form.Item name="agency" label={t("products:Vendor")} {...fieldProps.agency} initialValue={at(props, "initialValue.agency")[0]}>
<VendorSelector {...fieldComProps.agency} />
@ -257,15 +258,40 @@ function getFields(props) {
fieldProps?.agency?.col || 6
),
item(
"audit_state",
"airticket_state", //-1 0 1
99,
<Form.Item name={`audit_state`} initialValue={at(props, "initialValue.audit_state")[0] || { value: "", label: "Status" }}>
<AuditStateSelector {...fieldComProps.audit_state} />
<Form.Item name="airticket_state" label="出票状态" initialValue={at(props, "initialValue.airticket_state")[0] || { value: "-1", label: "所有" }}>
<Select
labelInValue
options={[
{ value: "-1", label: "所有" },
{ value: "0", label: "未出票" },
{ value: "1", label: "已出票" },
]}
/>
</Form.Item>,
fieldProps?.audit_state?.col || 3
fieldProps?.airticket_state?.col || 4
),
item(
"products_types",
"plan_state", //-1 0123
99,
<Form.Item name="plan_state" label="计划状态" initialValue={at(props, "initialValue.plan_state")[0] || { value: "-1", label: "所有" }}>
<Select
labelInValue
options={[
{ value: "-1", label: "所有" },
{ value: "0", label: "新计划" },
{ value: "1", label: "已确认" },
{ value: "2", label: "有变更" },
{ value: "3", label: "已取消" },
]}
/>
</Form.Item>,
fieldProps?.plan_state?.col || 4
),
item(
"products_types", //
99,
<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} />
@ -273,7 +299,7 @@ function getFields(props) {
fieldProps?.products_types?.col || 6
),
item(
"dept",
"dept", //
99,
<Form.Item name={`dept`} label={t("products:Dept")} {...fieldProps.dept} initialValue={at(props, "initialValue.dept")[0] || undefined}>
<DeptSelector {...fieldComProps.dept} />
@ -281,7 +307,7 @@ function getFields(props) {
fieldProps?.dept?.col || 6
),
item(
"city",
"city", //
99,
<Form.Item name={`city`} label={t("products:City")} {...fieldProps.city} initialValue={at(props, "initialValue.city")[0] || undefined}>
<CitySelector {...fieldComProps.city} />
@ -289,7 +315,7 @@ function getFields(props) {
fieldProps?.city?.col || 4
),
item(
"unconfirmed",
"unconfirmed", //
99,
<Form.Item name={`unconfirmed`} valuePropName="checked" initialValue={at(props, "initialValue.unconfirmed") || false}>
<Checkbox>{t("group:unconfirmed")}</Checkbox>

@ -14,7 +14,7 @@ const airTicketStore = create((set, get) => ({
setVeiPlanChangeTxt: veiPlanChangeTxt => set({ veiPlanChangeTxt }),
setAirPortList: airPortList => set({ airPortList }),
async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd) {
async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd,plan_state,airticket_state) {
const { setLoading, setPlanList } = get();
setLoading(true);
const searchParams = {
@ -22,6 +22,8 @@ const airTicketStore = create((set, get) => ({
FlightDate1: TimeStart,
FlightDate2: TimeEnd,
GRI_Name: GRI_Name,
FlightStatus: plan_state,
TicketIssued: airticket_state,
};
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/GetFlightPlan`, searchParams);

@ -91,7 +91,7 @@ const Airticket = props => {
const showTotal = total => `合计 ${total} `;
useEffect(() => {
getPlanList(travelAgencyId, "", dayjs().startOf("M").format(DATE_FORMAT), dayjs().add(3,"M").endOf("M").format(DATE_FORMAT));
getPlanList(travelAgencyId, "", dayjs().startOf("M").format(DATE_FORMAT), dayjs().add(3, "M").endOf("M").format(DATE_FORMAT),'-1','-1');
}, []);
return (
@ -100,17 +100,17 @@ const Airticket = props => {
<Col md={20} lg={20} xxl={20}>
<SearchForm
initialValue={{
dates: [dayjs().startOf("M"), dayjs().add(3,"M").endOf("M")],
dates: [dayjs().startOf("M"), dayjs().add(3, "M").endOf("M")],
}}
fieldsConfig={{
shows: ["referenceNo", "dates"],
shows: ["referenceNo", "dates", "airticket_state", "plan_state"],
fieldProps: {
referenceNo: { label: "搜索计划" },
dates: { label: "出发日期", col: 8 },
},
}}
onSubmit={(err, formVal, filedsVal) => {
getPlanList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.endtime);
getPlanList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.endtime, formVal.plan_state, formVal.airticket_state);
}}
/>
</Col>

@ -215,7 +215,7 @@ const AirticketPlan = props => {
<Form.Item name="FromAirport" noStyle rules={[{ required: true, message: "请输入出发机场!" }]}>
<Select
showSearch
placeholder="机场"
placeholder="出发机场"
style={{
minWidth: 160,
}}
@ -230,7 +230,7 @@ const AirticketPlan = props => {
<Form.Item name="ToAirport" noStyle rules={[{ required: true, message: "请输入抵达机场!" }]}>
<Select
showSearch
placeholder="机场"
placeholder="抵达机场"
style={{
minWidth: 160,
}}

@ -12,7 +12,6 @@ import RequireAuth from '@/components/RequireAuth';
import { PERM_PRODUCTS_OFFER_AUDIT, PERM_PRODUCTS_OFFER_PUT } from '@/config';
import dayjs from 'dayjs';
import VendorSelector from '@/components/VendorSelector';
import AuditStateSelector from '@/components/AuditStateSelector';
import { usingStorage } from '@/hooks/usingStorage';
import AgencyContract from '../Print/AgencyContract_v0903';
@ -161,8 +160,6 @@ const Header = ({ refresh, ...props }) => {
)}
<Divider type={'vertical'} />
<Select options={yearOptions} variant={'borderless'} className='w-24' size='large' value={pickYear} onChange={handleYearChange} />
<Divider type={'vertical'} />
<AuditStateSelector variant={'borderless'} className='w-32' size='large' value={pickAuditState} onChange={handleAuditStateChange} />
{/* <Divider type={'vertical'} />
{(use_year || '').replace('all', '')} */}
<Button onClick={() => refresh(param)} type='text' className='text-primary round-none' icon={<ReloadOutlined />} />

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save