shish 2 lat temu
rodzic
commit
782581dee4
2 zmienionych plików z 12 dodań i 8 usunięć
  1. 6 4
      ghs/src/views/in/add.vue
  2. 6 4
      ghs/src/views/order/add.vue

+ 6 - 4
ghs/src/views/in/add.vue

@@ -32,7 +32,11 @@
         <el-table-column prop="name" label="名称" align="center"></el-table-column>
         <el-table-column prop="userPrice" label="单价" width="110" align="center"></el-table-column>
         <el-table-column prop="bigCount" label="数量" width="110" align="center"></el-table-column>
-        <el-table-column prop="sumPrice" label="金额" width="110" align="center"></el-table-column>
+        <el-table-column prop="sumPrice" label="金额" width="110" align="center">
+          <template slot-scope="scope">
+            ¥{{ parseFloat(Number(scope.row.userPrice)*Number(scope.row.bigCount).toFixed(2)) }}
+          </template>
+        </el-table-column>
 
         <el-table-column prop="ratioType" label="单位比" align="center" width="110">
           <template slot-scope="scope">
@@ -759,9 +763,7 @@ export default {
           this.customData.bigCount = parseFloat(this.customData.bigCount)
         }
       }
-      let sumPrice = Number(this.customData.userPrice)*Number(this.customData.bigCount)
-      sumPrice = parseFloat(sumPrice.toFixed(2))
-      currentItem = {...currentItem,bigCount:this.customData.bigCount,userPrice:this.customData.userPrice,smallCount:this.customData.smallCount,sumPrice:sumPrice}     
+      currentItem = {...currentItem,bigCount:this.customData.bigCount,userPrice:this.customData.userPrice,smallCount:this.customData.smallCount}     
       this.replaceItemFn(currentItem,1,'add')
       this.backToSearchItem();
     },

+ 6 - 4
ghs/src/views/order/add.vue

@@ -32,7 +32,11 @@
         <el-table-column prop="name" label="名称" align="center"></el-table-column>
         <el-table-column prop="userPrice" label="单价" width="110" align="center"></el-table-column>
         <el-table-column prop="bigCount" label="数量" width="110" align="center"></el-table-column>
-        <el-table-column prop="sumPrice" label="金额" width="110" align="center"></el-table-column>
+        <el-table-column prop="sumPrice" label="金额" width="110" align="center">
+          <template slot-scope="scope">
+            ¥{{ parseFloat(Number(scope.row.userPrice)*Number(scope.row.bigCount).toFixed(2)) }}
+          </template>
+        </el-table-column>
 
         <el-table-column prop="ratioType" label="单位比" align="center" width="110">
           <template slot-scope="scope">
@@ -705,9 +709,7 @@ export default {
           this.customData.bigCount = parseFloat(this.customData.bigCount)
         }
       }
-      let sumPrice = Number(this.customData.userPrice)*Number(this.customData.bigCount)
-      sumPrice = parseFloat(sumPrice.toFixed(2))
-      currentItem = {...currentItem,bigCount:this.customData.bigCount,userPrice:this.customData.userPrice,smallCount:this.customData.smallCount,sumPrice:sumPrice}     
+      currentItem = {...currentItem,bigCount:this.customData.bigCount,userPrice:this.customData.userPrice,smallCount:this.customData.smallCount}
       this.replaceItemFn(currentItem,1,'add')
       this.backToSearchItem();
     },