Commit e3979dae by qinjianhui

fix: 根据生产单号前缀判断 orderFrom,替代从 localStorage 读取 countryCode

parent a06f0c24
...@@ -78,12 +78,18 @@ const playAudio = (key: AudioKey, message?: string) => { ...@@ -78,12 +78,18 @@ const playAudio = (key: AudioKey, message?: string) => {
console.error(`No audio found for key: ${key}`) console.error(`No audio found for key: ${key}`)
} }
} }
const getOrderFrom = (factorySubOrderNumber: string): string => {
if (/^CN/i.test(factorySubOrderNumber)) return 'CN'
if (/^US/i.test(factorySubOrderNumber)) return 'US'
if (/^OP/i.test(factorySubOrderNumber)) return 'NEWP'
return ''
}
const getPrintData = async () => { const getPrintData = async () => {
if(!searchData.value) return if(!searchData.value) return
const user = JSON.parse(localStorage.getItem('user') || '{}') const orderFrom = getOrderFrom(searchData.value.factorySubOrderNumber || '')
const data = await printProductionQrCode( const data = await printProductionQrCode(
searchData.value.id, searchData.value.id,
user.factory?.countryCode.toLowerCase(), orderFrom,
) )
// const path = 'http://10.168.1.209/local_files/factory' + data.message // const path = 'http://10.168.1.209/local_files/factory' + data.message
const path = filePath + data.message const path = filePath + data.message
......
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