Commit abf185df by wuqian
parents e8ccbd0f f87ebd18
......@@ -392,8 +392,20 @@ watch(
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
].filter((el) => el.url)
} else {
arr =
typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = Array.isArray(d.imageAry)
? d.imageAry
: typeof d.imageAry === 'string'
? (() => {
try {
const parsed = JSON.parse(d.imageAry)
return parsed
} catch {
return [{ url: d.imageAry }]
}
})()
: [d.imageAry]?.filter?.((v) => v != null) || []
// arr =
// typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = arr.concat([
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
])
......@@ -591,7 +603,10 @@ const trackcodeInput = async () => {
// AAAB_60527128-9_1_JMSC250121017 新版示例
const regex = /^[A-Z]{4}_/ //是否以四个大写字母加下划线开头
if (regex.test(orderNumber)) {
orderNumber = orderNumber.split('_')[0] + "-"+ orderNumber.split('_')[orderNumber.split('_').length - 1]
orderNumber =
orderNumber.split('_')[0] +
'-' +
orderNumber.split('_')[orderNumber.split('_').length - 1]
}
try {
const res = await getSubOrderBySubOrderNumber(orderNumber)
......@@ -612,7 +627,20 @@ const trackcodeInput = async () => {
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
].filter((el) => el.url)
} else {
arr = typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = Array.isArray(d.imageAry)
? d.imageAry
: typeof d.imageAry === 'string'
? (() => {
try {
const parsed = JSON.parse(d.imageAry)
return parsed
} catch {
return [{ url: d.imageAry }]
}
})()
: [d.imageAry]?.filter?.((v) => v != null) || []
// arr = typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = arr.concat([
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
])
......
......@@ -1449,7 +1449,20 @@ const openDetail = async (id: number) => {
const res = await getOrderDetail(id)
if (res.code == 200) {
if (res.data.imageAry) {
res.data.imageAry = JSON.parse(res.data.imageAry as string)
const newarr = res.data.imageAry
res.data.imageAry = Array.isArray(newarr)
? newarr
: typeof newarr === 'string'
? (() => {
try {
const parsed = JSON.parse(newarr)
return parsed
} catch {
return [{ url: newarr }]
}
})()
: [newarr]?.filter?.((v) => v != null) || []
// res.data.imageAry = JSON.parse(res.data.imageAry as string)
}
detailData.value = res.data || {}
detailVisible.value = true
......@@ -1457,6 +1470,8 @@ const openDetail = async (id: number) => {
fastType.value = 0
}
} catch (e) {
console.log(e)
//showError(e)
}
}
......@@ -1691,7 +1706,7 @@ const [searchForm] = useValue<SearchForm>({
userMark: '',
customizedQuantity: '',
order: 'desc',
platform:''
platform: '',
})
const tableColumns = computed<CustomColumn<CardOrderData[]>>(() => {
return [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment