Przeglądaj źródła

宝时丰收-兼容批次属性Double类型输入

zhaohuanhuan 2 tygodni temu
rodzic
commit
8a455cdc84
1 zmienionych plików z 16 dodań i 2 usunięć
  1. 16 2
      src/views/inbound/takeDelivery/task/index.vue

+ 16 - 2
src/views/inbound/takeDelivery/task/index.vue

@@ -316,7 +316,15 @@ const setBarcode = (code, type) => {
   if (inputBarcodeType.value === 'lot') {
     lotData.value.forEach((lot) => {
       if (lot.field == lotField.value) {
-        lot.mapping = code
+        if (lot.type == 'Double') {
+          if (isNaN(Number(code))) {
+            showToast('请输入正确的数值')
+            return
+          }
+          lot.mapping = Number(code)
+        }else{  
+          lot.mapping = code
+        }
       }
     })
     return
@@ -950,12 +958,18 @@ const onLot = (item) => {
     lotDateRef.value?.show(item.label, item.mapping)
     return
   }
-  if (item.type == 'String') {
+  if (item.type == 'String' ) {
     inputBarcodeType.value = 'lot'
     back.value = false
     inputBarcodeRef.value?.show('', `请扫描${item.label}`,'')
     return
   }
+  if (item.type == 'Double') {
+    inputBarcodeType.value = 'lot'
+    back.value = false
+    inputBarcodeRef.value?.show('', `请输入${item.label}`,'')
+    return
+  }
 }
 //设置质量状态
 const onSelectLotQuality=(qualityKey)=>{