debug: 搜索可以绑定的附加项目; 价格value改为adult_cost;

feature/price_manager
Lei OT 1 year ago
parent 4b77aa689e
commit 1534ce6979

@ -1,4 +1,5 @@
{ {
"ProductType": "ProductType",
"type": { "type": {
"Experience": "Experience", "Experience": "Experience",
"Car": "Transport Services", "Car": "Transport Services",

@ -1,4 +1,5 @@
{ {
"ProductType": "项目类型",
"type": { "type": {
"Experience": "综费", "Experience": "综费",
"Car": "车费", "Car": "车费",
@ -78,7 +79,7 @@
"GroupSize": "人等", "GroupSize": "人等",
"UseDates": "使用日期", "UseDates": "使用日期",
"Weekdays": "有效日/周X", "Weekdays": "周末",
"OnWeekdays": "周: ", "OnWeekdays": "周: ",
"Unlimited": "不限", "Unlimited": "不限",

@ -1,5 +1,7 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import useAuthStore from '@/stores/Auth';
import { PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT } from '@/config';
/** /**
* 产品管理 相关的预设数据 * 产品管理 相关的预设数据
@ -89,17 +91,26 @@ export const useProductsAuditStatesMapVal = (value) => {
/** /**
* @ignore * @ignore
*/ */
export const useProductsTypesFieldsets = (type, role) => { export const useProductsTypesFieldsets = (type) => {
const infoDefault = ['code', 'title']; const [isPermitted] = useAuthStore((state) => [state.isPermitted]);
const infoDefault = [['code'], ['title']];
const infoAdmin = ['remarks', 'dept', 'display_to_c']; const infoAdmin = ['remarks', 'dept', 'display_to_c'];
const infoTypesMap = { const infoTypesMap = {
'6': [], '6': [[],[]],
'B': ['city_id', 'km'], 'B': [['city_id', 'km'], []],
'J': ['description', 'city_id', 'recommends_rate', 'duration', 'display_to_c'], 'J': [['city_id', 'recommends_rate', 'duration', 'display_to_c'], ['description',]],
'Q': ['description', 'city_id', 'duration', ], 'Q': [['city_id', 'duration', ], ['description',]],
'D': ['description', 'city_id', 'recommends_rate','duration',], 'D': [['city_id', 'recommends_rate','duration',], ['description',]],
'7': ['description', 'city_id', 'recommends_rate', 'duration', 'display_to_c', 'open_weekdays'], // todo: 怎么是2个图 '7': [['city_id', 'recommends_rate', 'duration', 'display_to_c', 'open_weekdays'], ['description',]], // todo: 怎么是2个图
'C': ['description', 'city_id',], 'C': [['city_id',], ['description',]],
'8': [], // todo: ? '8': [[],[]], // todo: ?
}; };
}; const thisTypeFieldset = (_type) => {
const adminSet = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? infoAdmin : [];
return [
[...infoDefault[0], ...infoTypesMap[_type][0], ...adminSet],
[...infoDefault[1], ...infoTypesMap[_type][1]]
];
};
return thisTypeFieldset(type);
}

@ -86,8 +86,8 @@ const PriceTable = ({ dataSource, refresh }) => {
const columns = [ const columns = [
{ key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('Title'), onCell: (r, index) => ({ rowSpan: r.rowSpan }), render: (text, r) => text || r.lgc_details?.['2']?.title || '' }, { key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('Title'), onCell: (r, index) => ({ rowSpan: r.rowSpan }), render: (text, r) => text || r.lgc_details?.['2']?.title || '' },
{ key: 'adult', title: t('AgeType.Adult'), render: (_, { value, currency, unit_name }) => `${value} ${currency} / ${unit_name}` }, { key: 'adult', title: t('AgeType.Adult'), render: (_, { adult_cost, currency, unit_name }) => `${adult_cost} ${currency} / ${unit_name}` },
{ key: 'child', title: t('AgeType.Child'), render: (_, { value, currency, unit_name }) => `${value} ${currency} / ${unit_name}` }, { key: 'child', title: t('AgeType.Child'), render: (_, { child_cost, currency, unit_name }) => `${child_cost} ${currency} / ${unit_name}` },
// {key: 'price', title: t('Currency'), }, // {key: 'price', title: t('Currency'), },
// {key: 'currency', title: t('Currency'), }, // {key: 'currency', title: t('Currency'), },
// {key: 'unit', title: t('Unit'), }, // {key: 'unit', title: t('Unit'), },

@ -24,27 +24,26 @@ const NewAddonModal = ({ onPick, ...props }) => {
const { starttime, endtime, ...param } = copyObject; const { starttime, endtime, ...param } = copyObject;
setSearchLoading(true); setSearchLoading(true);
setSearchResult([]); setSearchResult([]);
const result = await getAgencyProductsAction({ ...param, audit_state: '1', travel_agency_id, use_year }); // debug: audit_state: '1',
const result = await getAgencyProductsAction({ ...param, audit_state: '0', travel_agency_id, use_year });
setSearchResult(result?.products || []); setSearchResult(result?.products || []);
setSearchLoading(false); setSearchLoading(false);
}; };
const handleAddExtras = async (item) => { const handleAddExtras = async (item) => {
// const success = await fetchBindOrder({ coli_sn, conversationid: currentConversationID });
// success ? message.success('') : message.error('');
// setOpen(false);
if (typeof onPick === 'function') { if (typeof onPick === 'function') {
onPick(item); onPick(item);
} }
}; };
// todo: // todo:
const searchResultColumns = [ const searchResultColumns = [
{ key: 'ptype', dataIndex: ['info', 'product_type_name'], width: '6rem', title: t('products:ProductType') },
{ key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('products:Title') }, { key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('products:Title') },
{ {
title: t('products:price'), title: t('products:price'),
dataIndex: ['quotation', '0', 'value'], dataIndex: ['quotation', '0', 'adult_cost'],
width: '10rem', width: '10rem',
render: (_, { quotation }) => `${quotation[0].value} ${quotation[0].currency} / ${quotation[0].unit_name}`, // todo: render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`, // todo:
}, },
{ {
key: 'action', key: 'action',
@ -143,7 +142,7 @@ const Extras = ({ productId, onChange, ...props }) => {
dataIndex: ['quotation', '0', 'value'], dataIndex: ['quotation', '0', 'value'],
width: '10rem', width: '10rem',
render: (_, { quotation }) => `${quotation[0].value} ${quotation[0].currency} / ${quotation[0].unit_name}`, // todo: render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`, // todo:
}, },
// { title: t('products:Types'), dataIndex: 'age_type', width: '40%', }, // { title: t('products:Types'), dataIndex: 'age_type', width: '40%', },
{ {

Loading…
Cancel
Save