瀏覽代碼

fix:新增商品信息提示优化

maliang 1 月之前
父節點
當前提交
e1515db583

+ 1 - 1
jshERP-web/src/views/material/mixins/MaterialModalMixins.js

@@ -44,7 +44,7 @@ export const MaterialModalMixins = {
           let arr = res.data
           that.depotList = arr.map((item) => {
             return {
-              value: item.id + '',
+              value: item.id,
               text: item.depotName,
               title: item.depotName,
             }

+ 54 - 54
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -1419,9 +1419,9 @@ export default {
           formUnit = obj.basicUnit
         }
       }else{
-        formUnit = this.form.getFieldValue('unit')
+        formUnit = this.form.getFieldValue('unit')||''
       }
-      target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit } }])
+      target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit, supplierId: undefined, depotId: undefined } }])
     },
     onDeleted(value) {
       this.meDeleteIdList = value
@@ -1691,58 +1691,58 @@ export default {
         for (let i = 0; i < mArr.length; i++) {
           let mInfo = mArr[i]
           mInfo.commodityUnit = basicUnit
-          if (i === 0) {
-            // mInfo.commodityUnit = basicUnit
-            basicPurchaseDecimal = mInfo.purchaseDecimal
-            basicCommodityDecimal = mInfo.commodityDecimal
-            basicWholesaleDecimal = mInfo.wholesaleDecimal
-            basicLowDecimal = mInfo.lowDecimal
-          } else {
-            //副单位进行换算
-            // mInfo.commodityUnit = otherUnit
-            if (basicPurchaseDecimal) {
-              mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
-            }
-            if (basicCommodityDecimal) {
-              mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
-            }
-            if (basicWholesaleDecimal) {
-              mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
-            }
-            if (basicLowDecimal) {
-              mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
-            }
-            if (otherUnitTwo && i === 2) {
-              // mInfo.commodityUnit = otherUnitTwo
-              if (basicPurchaseDecimal) {
-                mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
-              }
-              if (basicCommodityDecimal) {
-                mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
-              }
-              if (basicWholesaleDecimal) {
-                mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
-              }
-              if (basicLowDecimal) {
-                mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
-              }
-            }
-            if (otherUnitThree && i === 3) {
-              // mInfo.commodityUnit = otherUnitThree
-              if (basicPurchaseDecimal) {
-                mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
-              }
-              if (basicCommodityDecimal) {
-                mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
-              }
-              if (basicWholesaleDecimal) {
-                mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
-              }
-              if (basicLowDecimal) {
-                mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
-              }
-            }
-          }
+          // if (i === 0) {
+          //   // mInfo.commodityUnit = basicUnit
+          //   basicPurchaseDecimal = mInfo.purchaseDecimal
+          //   basicCommodityDecimal = mInfo.commodityDecimal
+          //   basicWholesaleDecimal = mInfo.wholesaleDecimal
+          //   basicLowDecimal = mInfo.lowDecimal
+          // } else {
+          //   //副单位进行换算
+          //   // mInfo.commodityUnit = otherUnit
+          //   if (basicPurchaseDecimal) {
+          //     mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
+          //   }
+          //   if (basicCommodityDecimal) {
+          //     mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
+          //   }
+          //   if (basicWholesaleDecimal) {
+          //     mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
+          //   }
+          //   if (basicLowDecimal) {
+          //     mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
+          //   }
+          //   if (otherUnitTwo && i === 2) {
+          //     // mInfo.commodityUnit = otherUnitTwo
+          //     if (basicPurchaseDecimal) {
+          //       mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
+          //     }
+          //     if (basicCommodityDecimal) {
+          //       mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
+          //     }
+          //     if (basicWholesaleDecimal) {
+          //       mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
+          //     }
+          //     if (basicLowDecimal) {
+          //       mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
+          //     }
+          //   }
+          //   if (otherUnitThree && i === 3) {
+          //     // mInfo.commodityUnit = otherUnitThree
+          //     if (basicPurchaseDecimal) {
+          //       mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
+          //     }
+          //     if (basicCommodityDecimal) {
+          //       mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
+          //     }
+          //     if (basicWholesaleDecimal) {
+          //       mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
+          //     }
+          //     if (basicLowDecimal) {
+          //       mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
+          //     }
+          //   }
+          // }
         }
         this.meTable.dataSource = mArr
       })