asd26269546 1 rok temu
rodzic
commit
979824bf63

+ 12 - 3
src/views/salesMange/shipmentMange/packing/index.vue

@@ -98,6 +98,7 @@
                     :precision="2"
                     :controls="false"
                     :min="0"
+                    @change='computeBomVolume'
                     onmousewheel="return false;"></el-input-number>
                 </el-form-item>
               </el-col>
@@ -110,6 +111,7 @@
                     :precision="2"
                     :controls="false"
                     :min="0"
+                    @change='computeBomVolume'
                     onmousewheel="return false;"></el-input-number>
                 </el-form-item>
               </el-col>
@@ -122,13 +124,14 @@
                     :precision="2"
                     :controls="false"
                     :min="0"
+                    @change='computeBomVolume'
                     onmousewheel="return false;"></el-input-number>
                 </el-form-item>
               </el-col>
             </el-form-item>
             <el-form-item label="体积" required>
               <el-input-number
-                v-model="boxFormData.bomVolume"
+                :model-value="boxFormData.bomVolume"
                 placeholder="请输入"
                 :precision="4"
                 :controls="false"
@@ -305,6 +308,13 @@ const sourceList = ref({
   },
 });
 
+
+const computeBomVolume = () => {
+  if(boxFormData.value.boxLong && boxFormData.value.boxWide && boxFormData.value.boxHigh) {
+    boxFormData.value.bomVolume = (boxFormData.value.boxLong * boxFormData.value.boxWide * boxFormData.value.boxHigh) / 1000000
+  }
+}
+
 const openDtlUpdata = (index) => {
   boxFormType = 'updata'
   boxIndex.value = index;
@@ -395,7 +405,7 @@ const openDtlModal = () => {
 const boxIndex = ref(0);
 
 const packDetailProductListPush = (index) => {
-  if(encasementType.value == '1') {
+  if(encasementType.value == '2') {
     boxFormData.value.packDetailGoodsList.push({
       remark:null,
       unit:null,
@@ -424,7 +434,6 @@ const submitBox = () => {
         ElMessage.error("请添加产品");
         return;
       }
-      alert('通过')
       for (let i = 0; i < boxFormData.value.packDetailProductList.length; i++) {
         const item = boxFormData.value.packDetailProductList[i];
         if (item.quantity == null) {