From 7cce92adead83c279ea918d093e476493e0822f2 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Thu, 24 Jul 2025 16:16:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?perf:=20=E4=BB=B7=E6=A0=BC=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=E5=AF=B9=E6=AF=94=EF=BC=9A'WPI=5FSN=20'WPP=5FVEI=5FSN?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: 增加多城市 FormItem --- src/hooks/useProductsSets.js | 2 +- src/stores/Products/Index.js | 5 +++-- src/views/products/Detail/ProductInfoForm.jsx | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/hooks/useProductsSets.js b/src/hooks/useProductsSets.js index c291cbf..c063c58 100644 --- a/src/hooks/useProductsSets.js +++ b/src/hooks/useProductsSets.js @@ -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'] : []; diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index 64ef53c..294e4fe 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -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,7 +369,8 @@ 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 diff --git a/src/views/products/Detail/ProductInfoForm.jsx b/src/views/products/Detail/ProductInfoForm.jsx index 1df2fd8..3c10dba 100644 --- a/src/views/products/Detail/ProductInfoForm.jsx +++ b/src/views/products/Detail/ProductInfoForm.jsx @@ -223,14 +223,6 @@ function getFields(props) { , fieldProps?.city?.col || midCol ), - item( - 'city_list', - 99, - - - , - fieldProps?.city_list?.col || midCol - ), item( 'dept', 99, @@ -248,6 +240,14 @@ function getFields(props) { , fieldProps?.duration?.col || midCol ), + item( + 'city_list', + 99, + + + , + fieldProps?.city_list?.col || midCol + ), item( 'km', 99, From 12208202ad18d64e4fc056eb10188105befb3b17 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Thu, 24 Jul 2025 16:17:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E5=9F=8E=E5=B8=82=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MultiCitySelector.jsx | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/components/MultiCitySelector.jsx diff --git a/src/components/MultiCitySelector.jsx b/src/components/MultiCitySelector.jsx new file mode 100644 index 0000000..3851f87 --- /dev/null +++ b/src/components/MultiCitySelector.jsx @@ -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 ( + <> + + + ); +}; +export default MultiCitySelector; From 6da10d620084d98d03c476c68b6ecc2066e7ad10 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Thu, 24 Jul 2025 16:40:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?perf:=20=E4=BB=B7=E6=A0=BC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BF=9D=E5=AD=98=E4=B8=8A=E6=AC=A1=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Products/Index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index 294e4fe..8d3fdab 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -376,7 +376,7 @@ export const useProductsStore = create( const hasChanged = preValue !== value if (hasChanged) { - changedObject[key] = value + changedObject[key] = preValue } }