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

main
Ycc 10 months ago
commit 1407d05f43

@ -66,7 +66,7 @@ export const delProductExtrasAction = async (body) => {
* @param {object} param { id, travel_agency_id, use_year }
*/
export const getAgencyProductExtrasAction = async (param) => {
const _param = { ...param, use_year: (param.use_year || '').replace('all', '') };
const _param = { ...param, use_year: String(param.use_year || '').replace('all', '') };
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/products_extras`, _param);
return errcode !== 0 ? [] : result;
};

@ -10,12 +10,15 @@ import RequireAuth from '@/components/RequireAuth';
import { PERM_PRODUCTS_MANAGEMENT } from '@/config';
import { useProductsTypesMapVal } from '@/hooks/useProductsSets';
import { usingStorage } from '@/hooks/usingStorage';
import useProductsStore from '@/stores/Products/Index';
const NewAddonModal = ({ onPick, ...props }) => {
const { travel_agency_id, use_year } = useParams();
// const { travel_agency_id, use_year } = useParams();
const { t } = useTranslation();
const { notification, message } = App.useApp();
const [{ travel_agency_id, use_year }] = useProductsStore((state) => [state.switchParams]);
const productsTypesMapVal = useProductsTypesMapVal();
const [open, setOpen] = useState(false);
@ -29,7 +32,7 @@ const NewAddonModal = ({ onPick, ...props }) => {
setSearchLoading(true);
setSearchResult([]);
const search_year = year || use_year;
const result = await searchPublishedProductsAction({ ...param, use_year: search_year, travel_agency_id, });
const result = await searchPublishedProductsAction({ ...param, use_year: search_year, travel_agency_id });
setSearchResult(result);
setSearchLoading(false);
};
@ -110,8 +113,9 @@ const Extras = ({ productId, onChange, ...props }) => {
const { t } = useTranslation();
const { notification, message } = App.useApp();
const { travel_agency_id, use_year } = useParams();
// const { travel_agency_id, use_year } = useParams();
const { travelAgencyId } = usingStorage();
const [{travel_agency_id, use_year}] = useProductsStore((state) => [state.switchParams]);
const [extrasData, setExtrasData] = useState([]);

@ -93,7 +93,7 @@ const ProductInfo = ({ ...props }) => {
}
}
// console.log(readyToSubInfo, "\n", mergedLgc);
// console.log('before save', '\n lgcEdits:', lgcEdits, '\n mergedLgc', mergedLgc);
// return false; // debug: 0
/** 提交保存 */
setLoading(true);

@ -49,7 +49,7 @@ const InfoForm = ({ onSubmit, onReset, onValuesChange, editablePerm, infoEditabl
setShowSave(infoEditable || priceEditable);
// setEditable(editable0);
return () => {};
}, [editingProduct?.info?.id, editablePerm, infoEditable, priceEditable]);
}, [editingProduct, editablePerm, infoEditable, priceEditable]);
const onFinish = (values) => {
console.log('Received values of form, origin form value: \n', values);
@ -250,19 +250,20 @@ function getFields(props) {
99,
<Form.Item name='recommends_rate' label={t('RecommendsRate')} {...fieldProps.recommends_rate} tooltip={t('FormTooltip.RecommendsRate')}>
{/* <Input placeholder={t('RecommendsRate')} allowClear /> */}
<Select
<InputNumber {...styleProps} {...editableProps('recommends_rate')} min={1} max={1000} />
{/* <Select
{...styleProps}
{...editableProps('recommends_rate')}
style={{ width: '100%' }}
labelInValue={false}
options={[
{ value: '1', label: 'Top 1' },
{ value: '2', label: 'Top 2' },
{ value: '3', label: 'Top 3' },
{ value: '4', label: '4' },
{ value: '5', label: '5' },
{ value: 1, label: 'Top 1' },
{ value: 2, label: 'Top 2' },
{ value: 3, label: 'Top 3' },
{ value: 4, label: '4' },
{ value: 5, label: '5' },
]}
/>
/> */}
</Form.Item>,
fieldProps?.recommends_rate?.col || midCol
),
@ -376,7 +377,7 @@ const formValuesMapper = (values) => {
],
'dept': { key: 'dept_id', transform: (value) => (typeof value === 'string' ? value : value?.value || value?.key || '') },
'open_weekdays': { key: 'open_weekdays', transform: (value) => (Array.isArray(value) ? value.join(',') : value) },
'recommends_rate': { key: 'recommends_rate', transform: (value) => (typeof value === 'string' ? value : value?.value || value?.key || '') },
// 'recommends_rate': { key: 'recommends_rate', transform: (value) => ((typeof value === 'string' || typeof value === 'number') ? value : value?.value || value?.key || '') },
// 'lgc_details': [
// {
// key: 'lgc_details',

@ -74,7 +74,7 @@ function Index() {
return <span className={stateCls}>{stateMapVal[`${r.audit_state_id}`]?.label}</span>;
},
},
{ title: t('products:AuditedBy'), key: 'audited_by', dataIndex: 'audited_by_name' },
{ title: t('products:AuditedBy'), key: 'audited_by', dataIndex: 'audited_by' },
{ title: t('products:AuditDate'), key: 'audit_date', dataIndex: 'audit_date' },
{
title: '',

Loading…
Cancel
Save