1
This commit is contained in:
parent
8e984512d1
commit
79a872dea7
@ -185,7 +185,12 @@ export function getPlatformList(data?: Record<string, unknown>) {
|
||||
} 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',
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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 = [
|
||||
|
||||
@ -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<number | string | undefined>(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<Record<string, any>>({})
|
||||
const shopExpressSitesMap = ref<Record<string, SiteOption[]>>({})
|
||||
@ -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()
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user