From 7cce92adead83c279ea918d093e476493e0822f2 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Thu, 24 Jul 2025 16:16:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=B7=E6=A0=BC=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=EF=BC=9A'WPI=5FSN=20'WPP=5FVEI=5FSN'?= 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,