Ver Fonte

出货通知调整

lxf há 1 ano atrás
pai
commit
0e0248193e
1 ficheiros alterados com 33 adições e 4 exclusões
  1. 33 4
      src/views/salesMange/shipmentMange/packing/index.vue

+ 33 - 4
src/views/salesMange/shipmentMange/packing/index.vue

@@ -279,7 +279,7 @@
         <div style="border: 1px solid black">
           <div style="display: flex; width: 100%">
             <div style="width: 50%; border-right: 1px solid black; padding-left: 4px">
-              <div style="padding: 8px 0; width: 100%;" v-html="getStyle(packDetail.remark)"></div>
+              <div style="padding: 8px 0; width: 100%" v-html="getStyle(packDetail.remark)"></div>
             </div>
             <div style="width: 50%; padding-left: 4px">
               <div style="font-weight: 700">总箱数</div>
@@ -313,13 +313,28 @@
           <tbody v-if="packDetail.packDetailList && packDetail.packDetailList.length > 0">
             <template v-for="(item, index) in packDetail.packDetailList">
               <tr v-for="(row, indexTwo) in item.packDetailProductLists" :key="indexTwo">
-                <td style="text-align: center; width: 10%">{{ row.remark }}</td>
+                <td style="text-align: center; width: 10%">{{ row.productName }}</td>
                 <td style="text-align: center; width: 10%">{{ row.contractCode }}</td>
                 <td style="text-align: center; width: 10%">{{ row.supplierName }}</td>
-                <td style="text-align: center; width: 10%"></td>
+                <td style="text-align: center; width: 10%; padding: 2px">
+                  <div style="display: flex; align-items: center; justify-content: center">
+                    <img
+                      :src="row.productImgUrl"
+                      style="
+                        cursor: pointer;
+                        border-radius: 5px;
+                        max-width: calc(100% - 4px);
+                        max-height: 60px;
+                        object-fit: contain;
+                        object-position: 50% 50%;
+                        background: #fff;
+                      "
+                      @click="openFile(row.productImgUrl)" />
+                  </div>
+                </td>
                 <td style="text-align: center; width: 10%">{{ row.quantity }}</td>
                 <td style="text-align: center; width: 10%" v-if="indexTwo === 0" :rowspan="item.packDetailProductLists.length">{{ item.packQuantity }}</td>
-                <td style="text-align: center; width: 10%" v-if="indexTwo === 0" :rowspan="item.packDetailProductLists.length">{{ item.packQuantity }}</td>
+                <td style="text-align: center; width: 10%" v-if="indexTwo === 0" :rowspan="item.packDetailProductLists.length">{{ computeQuantity(item) }}</td>
                 <td style="text-align: center; width: 10%" v-if="indexTwo === 0" :rowspan="item.packDetailProductLists.length">{{ item.netWeight }}</td>
                 <td style="text-align: center; width: 10%" v-if="indexTwo === 0" :rowspan="item.packDetailProductLists.length">{{ item.roughWeight }}</td>
                 <td style="text-align: center; width: 10%" v-if="indexTwo === 0" :rowspan="item.packDetailProductLists.length">{{ item.bomVolume }}</td>
@@ -929,6 +944,20 @@ const printObj = ref({
   extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
   extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
 });
+const openFile = (path) => {
+  window.open(path);
+};
+const computeQuantity = (item) => {
+  let num = 0;
+  if (item.packDetailProductLists && item.packDetailProductLists.length > 0) {
+    for (let i = 0; i < item.packDetailProductLists.length; i++) {
+      if (item.packQuantity && item.packDetailProductLists[i].quantity) {
+        num = Number(Math.round(num + item.packQuantity * item.packDetailProductLists[i].quantity));
+      }
+    }
+  }
+  return num;
+};
 </script>
 
 <style lang="scss" scoped>