Merge remote-tracking branch 'origin/dev/2025b' into dev/2025b

dev/2025b
Lei OT 2 months ago
commit f60e97b455

@ -0,0 +1,29 @@
import { createContext, useEffect, useState } from 'react';
import {} from 'antd';
import SearchInput from './SearchInput';
import { fetchJSON } from '@/utils/request';
import { HT_HOST } from '@/config';
import { useTranslation } from 'react-i18next';
//
export const fetchCityList = async (q) => {
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/search_cities`, { q });
return errcode !== 0 ? [] : result;
};
const MultiCitySelector = ({ ...props }) => {
const { t } = useTranslation();
return (
<>
<SearchInput
placeholder={t('products:City')}
mode={null}
maxTagCount={0}
{...props}
fetchOptions={fetchCityList}
map={{ city_name: 'label', city_id: 'value' }}
/>
</>
);
};
export default MultiCitySelector;

@ -100,7 +100,7 @@ export const useProductsAuditStatesMapVal = (value) => {
*/
export const useProductsTypesFieldsets = (type) => {
const [isPermitted] = useAuthStore((state) => [state.isPermitted]);
const infoDefault = [['city'], ['title']];
const infoDefault = [['city', 'city_list'], ['title']];
const infoAdmin = ['title', 'product_title', 'code', 'remarks', 'dept']; // 'display_to_c'
const infoDisplay = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? ['display_to_c', 'sort_order'] : [];
const infoRecDisplay = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? ['recommends_rate'] : [];

@ -329,7 +329,7 @@ export const useProductsStore = create(
weekdays: definition.weekend.join(','),
WPI_SN: editingProduct.info.id,
WPP_VEI_SN: activeAgency.travel_agency_id,
lastedit_changed: '',
lastedit_changed: {},
audit_state_id: -1,
key: generateId(),
fresh: false
@ -369,13 +369,14 @@ export const useProductsStore = create(
if (prevQuotation.key === formValues.key) {
const changedObject = {}
for (const [key, value] of Object.entries(formValues)) {
if (key === 'use_dates' || key === 'id' || key === 'key' || key === 'weekdayList') continue
if (key === 'use_dates' || key === 'id' || key === 'key' || key === 'weekdayList'
|| key === 'WPI_SN' || key === 'WPP_VEI_SN') continue
const preValue = prevQuotation[key]
const hasChanged = preValue !== value
if (hasChanged) {
changedObject[key] = value
changedObject[key] = preValue
}
}

@ -223,14 +223,6 @@ function getFields(props) {
</Form.Item>,
fieldProps?.city?.col || midCol
),
item(
'city_list',
99,
<Form.Item name='city_list' label={t('City')} {...fieldProps.city} rules={[{ required: true }]} tooltip={t('FormTooltip.City')}>
<CitySelector {...styleProps} {...editableProps('city_list')} placeholder={t('FormTooltip.City')} />
</Form.Item>,
fieldProps?.city_list?.col || midCol
),
item(
'dept',
99,
@ -248,6 +240,14 @@ function getFields(props) {
</Form.Item>,
fieldProps?.duration?.col || midCol
),
item(
'city_list',
99,
<Form.Item name='city_list' label={t('多城市')} tooltip={t('把产品绑定到多个城市')}>
<CitySelector {...styleProps} {...editableProps('city_list')} />
</Form.Item>,
fieldProps?.city_list?.col || midCol
),
item(
'km',
99,

Loading…
Cancel
Save