diff --git a/src/api/index/index.ts b/src/api/index/index.ts index 568c28fe..a5fa0101 100644 --- a/src/api/index/index.ts +++ b/src/api/index/index.ts @@ -185,7 +185,12 @@ export function getPlatformList(data?: Record) { } as any) } -export function getPrintPlatformTemplateList(data?: { platform_code?: string; express_code: string; shopId?: string | number; shop_id?: string | number }) { +export function getPrintPlatformTemplateList(data?: { + platform_code?: string + express_code: string + shopId?: string | number + shop_id?: string | number +}) { return request({ url: '/system', method: 'post', diff --git a/src/views/stock/stock/component/add.vue b/src/views/stock/stock/component/add.vue index bc5de488..b79c9d35 100644 --- a/src/views/stock/stock/component/add.vue +++ b/src/views/stock/stock/component/add.vue @@ -395,9 +395,9 @@ const validateItemCode = async (rule: any, value: any, callback: any) => { return } - const pattern = /^[A-Za-z0-9_-]+$/ + const pattern = /^[A-Za-z0-9_\-\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]+$/ if (!pattern.test(value)) { - itemCodeError.value = "商品编码只能包含字母、数字、下划线和短横线" + itemCodeError.value = "商品编码只能包含字母、数字、汉字、下划线和短横线" callback(new Error(itemCodeError.value)) return } diff --git a/src/views/stock/stock/component/info.vue b/src/views/stock/stock/component/info.vue index 44fab088..768eb2ef 100644 --- a/src/views/stock/stock/component/info.vue +++ b/src/views/stock/stock/component/info.vue @@ -595,11 +595,11 @@ const validateItemCode = async (rule: any, value: string, callback: any) => { return } - // 检查格式(字母、数字、下划线、短横线) - const pattern = /^[A-Za-z0-9_-]+$/ + // 检查格式(允许字母、数字、汉字、下划线、短横线) + const pattern = /^[A-Za-z0-9_\-\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]+$/ if (!pattern.test(value)) { - itemCodeError = "商品编码只能包含字母、数字、下划线和短横线" - callback(new Error('商品编码只能包含字母、数字、下划线和短横线')) + itemCodeError = "商品编码只能包含字母、数字、汉字、下划线和短横线" + callback(new Error('商品编码只能包含字母、数字、汉字、下划线和短横线')) return } diff --git a/src/views/system/setting/expressinterface/express-interface-config.ts b/src/views/system/setting/expressinterface/express-interface-config.ts index 8dfb7bb0..449f9e16 100644 --- a/src/views/system/setting/expressinterface/express-interface-config.ts +++ b/src/views/system/setting/expressinterface/express-interface-config.ts @@ -1,5 +1,5 @@ import pcasCodeData from 'china-division/dist/pcas-code.json' -import type { ExpressInterfaceCreateParams } from '@/api/setting.expressinterface/expressInterface' +import type { ExpressInterfaceCreateParams } from '@/api/setting.expressInterface/expressInterface' /** setting.expressInterface.list 单条记录字段顺序(与接口返回一致) */ export const expressInterfaceListFieldOrder = [ diff --git a/src/views/system/setting/expressinterface/index.vue b/src/views/system/setting/expressinterface/index.vue index c3032d3c..316702bc 100644 --- a/src/views/system/setting/expressinterface/index.vue +++ b/src/views/system/setting/expressinterface/index.vue @@ -493,7 +493,7 @@ import { expressInterfaceListByWarehousePlatformCode, expressInterfaceUpdate, getPrintPlatformList -} from '@/api/setting.expressinterface/expressInterface' +} from '@/api/setting.expressInterface/expressInterface' import { useUserStore } from '@/stores/modules/user' import { useSettingsStore } from '@/stores/modules/settings' import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane' @@ -612,7 +612,7 @@ const selectedShopId = ref(undefined) const useCustomExpressCode = ref(false) const printTemplateLoading = ref(false) const activeTemplateExpressCode = computed(() => - String(useCustomExpressCode.value ? formData.express_code : formData.sys_express_code).trim() + String(formData.sys_express_code || '').trim() ) const serviceValueMap = ref>({}) const shopExpressSitesMap = ref>({}) @@ -1080,7 +1080,7 @@ async function loadPlatformOptions() { } async function loadPrintPlatformTemplateOptions(sourceExpressCode?: string, sourcePlatformCode?: string, sourceShopId?: string | number) { - const expressCode = String(sourceExpressCode ?? activeTemplateExpressCode.value ?? '').trim().toUpperCase() + const expressCode = String(sourceExpressCode ?? formData.sys_express_code ?? '').trim().toUpperCase() if (!expressCode) { templateOptions.value = [] formData.template_url = '' @@ -1825,7 +1825,7 @@ async function openEdit(row: ExpressInterfaceRecord) { } ] } - await loadPrintPlatformTemplateOptions(activeTemplateExpressCode.value, formData.platform_code, selectedShopId.value ?? formData.shop_id) + await loadPrintPlatformTemplateOptions(formData.sys_express_code, formData.platform_code, selectedShopId.value ?? formData.shop_id) formRef.value?.clearValidate() } diff --git a/src/views/system/setting/shops/index.vue b/src/views/system/setting/shops/index.vue index 920d3936..b00b4850 100644 --- a/src/views/system/setting/shops/index.vue +++ b/src/views/system/setting/shops/index.vue @@ -153,7 +153,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import ScanBox from '@/components/ScanBox/index.vue' import UpperTable from '@/components/UpperTable/index.vue' -import { getPrintPlatformList } from '@/api/setting.expressinterface/expressInterface' +import { getPrintPlatformList } from '@/api/setting.expressInterface/expressInterface' import { getPlatformOauthLink } from '@/api/index/index' import { shopGetAuthorizeSessionKey,