linwenxin 11 mesi fa
parent
commit
9f302048b1

+ 6 - 5
src/packageAttachment/pages/applicationParts/applicationPartsForm.vue

@@ -133,7 +133,7 @@
                             src="/static/images/fittingsManagement/jianjian.png"
                             mode="aspectFill"
                           ></image>
-                          <text>{{ item.quantity }}</text>
+                          <text>{{ item.qty }}</text>
                           <image
                             @tap="setQty(item, 1)"
                             src="/static/images/fittingsManagement//jiajia.png"
@@ -148,7 +148,7 @@
                   合计:<text
                     >¥{{
                       [
-                        ...(form.itemList || []).map(item => Math.round(item.salesPrice * item.quantity * 100) / 100),
+                        ...(form.itemList || []).map(item => Math.round(item.salesPrice * item.qty * 100) / 100),
                         0
                       ].reduce((a, b) => {
                         return a + b
@@ -219,7 +219,8 @@ export default {
       var { id, ...item } = data
       this.form.itemList.push({
         ...item,
-        quantity: 1
+        newQty: item.qty,
+        qty: 1
       })
     })
   },
@@ -295,9 +296,9 @@ export default {
         .catch(() => {})
     },
     setQty(item, num) {
-      var n = Number(item.quantity) + Number(num)
+      var n = Number(item.qty) + Number(num)
       if (n > 0 && n <= item.newQty) {
-        item.quantity = n
+        item.qty = n
       } else if (num == -1) {
         uni.showModal({
           title: '提示',