瀏覽代碼

收货-批次信息设置判断调整2

zhaohuanhuan 3 周之前
父節點
當前提交
8cdf8fd494
共有 1 個文件被更改,包括 15 次插入6 次删除
  1. 15 6
      src/views/inbound/takeDelivery/task/index.vue

+ 15 - 6
src/views/inbound/takeDelivery/task/index.vue

@@ -102,7 +102,7 @@
               <span class="custom-title">{{ item.label }}</span>
             </template>
             <template #value>
-              <div>{{ item.mapping }}</div>
+              <div>{{ lotMap[item.mapping] ||  item.mapping }} </div>
             </template>
           </van-cell>
         </van-cell-group>
@@ -145,7 +145,7 @@
     v-model:show="lotQualityTrueFalseBy"
     cancel-text="取消"
     close-on-click-action
-    description="请选择质量状态"
+    :description="'请选择'+lotTitle"
   >
     <van-cell-group>
       <van-cell v-for="(value,key) in lotQualityMap" @click="onSelectLotQuality(key)">
@@ -193,7 +193,7 @@ try {
 }
 const warehouse = store.warehouse
 //开单任务号
-const taskNo = ref('BSSH20260318000003')
+const taskNo = ref('')
 //容器号
 const containerNo = ref('')
 //商品条码
@@ -305,7 +305,7 @@ const setBarcode = (code, type) => {
     closeLoading()
   })
 }
-setBarcode('BSSH20260318000003')
+// setBarcode('BSSH20260318000003')
 
 const switchTask = () => {
   inputBarcodeType.value = 'switchTask'
@@ -320,6 +320,7 @@ const asnInfo = ref({})
 const reset = () => {
   asnInfo.value = {}
   lotData.value = []
+  lotMap.value={}
   searchCount.value = ''
   searchBarcode.value = ''
   oldSearchBarcode.value = ''
@@ -345,6 +346,7 @@ const onAsnCancel = () => {
   if (searchBarcode.value === '' || (oldSearchBarcode.value.length != searchBarcode.value.length && oldSearchBarcode.value != '')) {
     asnInfo.value = {}
     lotData.value = []
+    lotMap.value={}
     searchCount.value = ''
   }
 }
@@ -450,6 +452,7 @@ const _handlerScan = (code) => {
         if (asnDetailsList.value.length > 1) {
           asnInfo.value = {}
           lotData.value = []
+          lotMap.value={}
           searchCount.value = ''
           uniqueCodeList.value = []
           asnDetailsTrueFalseBy.value = true
@@ -542,6 +545,7 @@ const setAttribute = (data) => {
 
 // 批次属性
 const lotData = ref([])
+const lotMap = ref({})
 const _getProductLot = (item) => {
   const params = { warehouse: item.warehouse, owner: item.customerId, barcode: item.sku }
   getProductLot(params).then(res => {
@@ -550,8 +554,12 @@ const _getProductLot = (item) => {
       if (lotField.startsWith('lotAtt') && lotField.length === 8) {
         lot.mapping = item[lotField]
       }
+      if(lot.format){
+        const format =JSON.parse(lot.format)
+        lotMap.value= {...lotMap.value, ...format }
+      }
     })
-    lotData.value = res.data
+    lotData.value = res.data.filter(item => item.lotAttFlag!='隐藏')
     _calculateShelfLife(item, lotData.value)
   })
 }
@@ -578,8 +586,9 @@ const lotField = ref('')
 const lotDateRef = ref(null)
 const lotQualityTrueFalseBy=ref(false)
 const lotQualityMap=ref({})
+const lotTitle=ref('质量状态')
 const onLot = (item) => {
-  console.log(item,"item")
+  lotTitle.value=item.label
   lotField.value = item.field
   if (item.field == 'lotAtt05' ) return
   if (item.type == 'Enum' ){