Преглед изворни кода

宝时快上-新增库位类型背景和说明、增加换一换入参key

zhaohuanhuan пре 6 дана
родитељ
комит
9a2b56e89b

+ 50 - 1
src/views/inbound/putaway/components/LocationList.vue

@@ -10,7 +10,12 @@
       </tr>
       </thead>
       <tbody>
-      <tr v-for="(item, index) in props.locationList" :key="index" v-if="props.locationList.length>0">
+      <tr
+        v-for="(item, index) in props.locationList"
+        :key="index"
+        v-if="props.locationList.length>0"
+        :class="item.displayType && `display-type--${item.displayType.toLowerCase()}`"
+      >
         <td>{{ legacy ? item.location : item.locationId }}</td>
         <td>{{ legacy ? (locationType[item.type] || item.type) : (locationType[item.locationUsage] || item.locationUsage) }}</td>
         <td>{{ legacy ? (item.quantity || 0) : (item.qty || 0) }}</td>
@@ -23,6 +28,11 @@
       </tr>
       </tbody>
     </table>
+    <div v-if="!legacy" class="display-type-legend">
+      <span v-for="item in displayTypeLegend" :key="item.type" class="legend-item">
+        <i :class="['legend-color', `display-type--${item.type}`]"></i>{{ item.label }}
+      </span>
+    </div>
   </div>
 </template>
 <script setup lang="ts">
@@ -47,6 +57,13 @@ const props = defineProps({
   locationList: Array,
   legacy: { type: Boolean, default: false },
 })
+
+// 展示类型:FORCE 强制、OPTIONAL 可选、INVENTORY 在库
+const displayTypeLegend = [
+  { type: 'force', label: '强制' },
+  { type: 'optional', label: '可选' },
+  { type: 'inventory', label: '在库' },
+]
 </script>
 <style scoped lang="sass">
 .move-stock-list
@@ -82,4 +99,36 @@ const props = defineProps({
   .task-table-bin tbody
     background: #cde7ff
 
+  .display-type--force
+    background-color: #81c784
+
+  .display-type--optional
+    background-color: #fff
+
+  .display-type--inventory
+    background-color: #d8d8d8
+
+  .display-type-legend
+    display: flex
+    justify-content: flex-end
+    align-items: center
+    gap: 10px
+    margin-top: 4px
+    padding-right: 2px
+    font-size: 11px
+    color: #999
+    line-height: 1
+
+    .legend-item
+      display: inline-flex
+      align-items: center
+      gap: 3px
+
+    .legend-color
+      display: inline-block
+      width: 10px
+      height: 10px
+      border: 1px solid #ccc
+      flex-shrink: 0
+
 </style>

+ 6 - 2
src/views/inbound/putaway/task/index.vue

@@ -642,10 +642,14 @@ const _getRecommendedLocation = async (item, options = {}) => {
   const uniqueLocationIds = fromChangeLocation ? getExcludedLocationIds(excludedLocations.value) : undefined
   try {
     const total = barcodeQuantity(barcodeActiveList.value)
-    const params = { warehouse, lotNum: lotNumber, owner, sku, qty: total, lotAtt08 }
+    const statisticsKey=barcodeActiveList.value[0].taskNo+'_'+barcodeActiveList.value[0].lotNumber
+    const params = { warehouse, lotNum: lotNumber, owner, sku, qty: total, lotAtt08}
     if (locationType.value) params.locationUse = locationType.value
     if (options.changeTypeName) params.locationType = options.changeTypeName
-    if (fromChangeLocation && uniqueLocationIds) params.excludedLocations = uniqueLocationIds
+    if (fromChangeLocation && uniqueLocationIds) {
+      params.excludedLocations = uniqueLocationIds
+      params.statisticsKey=statisticsKey
+    }
     const res = await getRecommendedLocationNew(params)
     if (res.data) {
       forbidForcePutaway.value = res.data.forbidForcePutaway // 货主策略:是否禁止强制上架