shish 1 gadu atpakaļ
vecāks
revīzija
0030f1d252
2 mainītis faili ar 13 papildinājumiem un 4 dzēšanām
  1. 4 3
      ghsApp/src/admin/billing/affirm.vue
  2. 9 1
      ghsApp/src/mixins/product.js

+ 4 - 3
ghsApp/src/admin/billing/affirm.vue

@@ -50,9 +50,10 @@
               <view class="operate-view" v-if="isScanEnv" @click="removeFromSave(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
               <view class="operate-view" v-else @click="gobackEvent" style="font-size:33upx;font-weight:bold;"><text class="iconfont icongouwuche" style="margin-right:5upx;"></text>返回修改</view>
               <view class="describe-view">
-                共<text style="color:red;">{{ selectList.length }}种</text>,
+                共<text>{{ selectList.length }}种</text>,
                 <text v-if="Number(totalItemNum.big)>0">{{totalItemNum.big?parseFloat(totalItemNum.big):0}}扎</text>
-                <text v-if="Number(totalItemNum.small)>0">{{totalItemNum.small?parseFloat(totalItemNum.small):0}}支</text>,{{ allCount.weight }}公斤,<text class="price">¥{{ allPrice }}</text>
+                <text v-if="Number(totalItemNum.small)>0">{{totalItemNum.small?parseFloat(totalItemNum.small):0}}支</text>,{{ allCount.weight }}公斤<text>,¥{{ allPrice }}</text>
+                <text v-if="Number(allCount.cost)>0 && (Number(allPrice)-Number(allCount.cost))>0">,利润 ¥{{ parseFloat((Number(allPrice)-Number(allCount.cost)).toFixed(2)) }}</text>
               </view>
             </view>
             <view class="summary-bar">
@@ -817,7 +818,7 @@ export default {
           display: flex;
           align-items: center;
           color: #333;
-          font-size: 29upx;
+          font-size: 28upx;
           font-weight:bold;
           .price {
             margin-left:8upx;

+ 9 - 1
ghsApp/src/mixins/product.js

@@ -83,6 +83,7 @@ export default {
 			let bigLength = 0;
 			let smallLength = 0;
 			let weight = 0
+			let cost = 0
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					bigLength += Number(item.bigCount)
@@ -90,11 +91,18 @@ export default {
 					let thisWeight = item.weight ? item.weight : 0
 					let currentWeight = Number(thisWeight)*Number(item.bigCount)
 					weight = Number(weight) + Number(currentWeight)
+
+					let thisCost = item.cost ? item.cost : 0
+					let currentCost = Number(thisCost)*Number(item.bigCount)
+					cost = Number(currentCost) + Number(currentCost)
 				}
 				weight = weight.toFixed(2)
 				weight = parseFloat(weight)
+
+				cost = cost.toFixed(2)
+				cost = parseFloat(cost)
 			}
-			return {bigLength:bigLength,smallLength:smallLength,weight:weight};
+			return {bigLength:bigLength,smallLength:smallLength,weight:weight,cost:cost};
 		},
 		//当前选中商品列表中是否有没有库存的商品
 		hasNoStock() {