|
|
@ -62,6 +62,8 @@ const PriceTable = ({ dataSource, refresh }) => {
|
|
|
|
const { message, notification } = App.useApp();
|
|
|
|
const { message, notification } = App.useApp();
|
|
|
|
const stateMapVal = useProductsAuditStatesMapVal();
|
|
|
|
const stateMapVal = useProductsAuditStatesMapVal();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(dataSource);
|
|
|
|
|
|
|
|
|
|
|
|
const handleAuditPriceItem = (state, row) => {
|
|
|
|
const handleAuditPriceItem = (state, row) => {
|
|
|
|
postProductsQuoteAuditAction(state, { id: row.id, travel_agency_id: activeAgency.travel_agency_id })
|
|
|
|
postProductsQuoteAuditAction(state, { id: row.id, travel_agency_id: activeAgency.travel_agency_id })
|
|
|
|
.then((json) => {
|
|
|
|
.then((json) => {
|
|
|
@ -83,7 +85,7 @@ const PriceTable = ({ dataSource, refresh }) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
const columns = [
|
|
|
|
{ key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('Title'), onCell: (r, index) => ({ rowSpan: r.rowSpan }) },
|
|
|
|
{ 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: (_, { value, currency, unit_name }) => `${value} ${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: (_, { value, currency, unit_name }) => `${value} ${currency} / ${unit_name}` },
|
|
|
|
// {key: 'price', title: t('Currency'), },
|
|
|
|
// {key: 'price', title: t('Currency'), },
|
|
|
@ -135,16 +137,33 @@ const TypesPanels = (props) => {
|
|
|
|
const [activeKey, setActiveKey] = useState([]);
|
|
|
|
const [activeKey, setActiveKey] = useState([]);
|
|
|
|
const [showTypes, setShowTypes] = useState([]);
|
|
|
|
const [showTypes, setShowTypes] = useState([]);
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
// 只显示有产品的类型; 展开产品的价格表, 合并名称列
|
|
|
|
// 只显示有产品的类型; 展开产品的价格表, 合并名称列; 转化为价格主表, 携带产品属性信息
|
|
|
|
const hasDataTypes = Object.keys(agencyProducts);
|
|
|
|
const hasDataTypes = Object.keys(agencyProducts);
|
|
|
|
const _show = productsTypes
|
|
|
|
const _show = productsTypes
|
|
|
|
.filter((kk) => hasDataTypes.includes(kk.value))
|
|
|
|
.filter((kk) => hasDataTypes.includes(kk.value))
|
|
|
|
.map((ele) => ({
|
|
|
|
.map((ele) => ({
|
|
|
|
...ele,
|
|
|
|
...ele,
|
|
|
|
|
|
|
|
extra: t('Table.Total', { total: agencyProducts[ele.value].length }),
|
|
|
|
children: (
|
|
|
|
children: (
|
|
|
|
<PriceTable
|
|
|
|
<PriceTable
|
|
|
|
// loading={loading}
|
|
|
|
// loading={loading}
|
|
|
|
dataSource={agencyProducts[ele.value].reduce((r, c) => r.concat(c.quotation.map((q, i) => ({ ...q, weekdays: q.weekdays.split(',').filter(Boolean).map(w => t(`weekdaysShort.${w}`)).join(', '), info: c.info, rowSpan: i === 0 ? c.quotation.length : 0 }))), [])}
|
|
|
|
dataSource={agencyProducts[ele.value].reduce(
|
|
|
|
|
|
|
|
(r, c) =>
|
|
|
|
|
|
|
|
r.concat(
|
|
|
|
|
|
|
|
c.quotation.map((q, i) => ({
|
|
|
|
|
|
|
|
...q,
|
|
|
|
|
|
|
|
weekdays: q.weekdays
|
|
|
|
|
|
|
|
.split(',')
|
|
|
|
|
|
|
|
.filter(Boolean)
|
|
|
|
|
|
|
|
.map((w) => t(`weekdaysShort.${w}`))
|
|
|
|
|
|
|
|
.join(', '),
|
|
|
|
|
|
|
|
info: c.info,
|
|
|
|
|
|
|
|
lgc_details: c.lgc_details.reduce((rlgc, clgc) => ({...r, [clgc.lgc]: clgc}), {}),
|
|
|
|
|
|
|
|
rowSpan: i === 0 ? c.quotation.length : 0,
|
|
|
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
[]
|
|
|
|
|
|
|
|
)}
|
|
|
|
refresh={props.refresh}
|
|
|
|
refresh={props.refresh}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
),
|
|
|
|