Просмотр исходного кода

收货-组合商品唯一码校验

zhaohuanhuan 2 дней назад
Родитель
Сommit
c475928965
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      src/views/inbound/takeDelivery/task/index.vue

+ 12 - 0
src/views/inbound/takeDelivery/task/index.vue

@@ -487,6 +487,18 @@ async function resolvePanpassScan(code) {
       uniqueCode: code,
       customer: customerId,
     })
+    const newPsId = String(res?.data?.data?.newPsId ?? '').trim()
+    if (newPsId) {
+      const expected = barcodeToUpperCase(newPsId)
+      const match = [asnInfo.value.barcode, asnInfo.value.barcode2, asnInfo.value.sku, uniqueCodeRef.value?.uniqueBarcode]
+        .filter(Boolean)
+        .some((c) => barcodeToUpperCase(String(c)) === expected)
+      if (!match) {
+        showNotify({ type: 'danger', duration: 3000, message: `商品条码不一致:${newPsId},请检查` })
+        scanError()
+        return null
+      }
+    }
     const childCodes = parsePanpassChildCodes(res)
     if (!childCodes?.length) {
       const uniqueRegExp = uniqueRuleMap.value['sku']