shish 4 лет назад
Родитель
Сommit
2b6e37ba4a
1 измененных файлов с 21 добавлено и 24 удалено
  1. 21 24
      ghsApp/src/admin/billing/affirm.vue

+ 21 - 24
ghsApp/src/admin/billing/affirm.vue

@@ -66,13 +66,13 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">配送方式</view>
-            <button @tap="courier(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">自取</button>
-            <button @click="courier(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">配送</button>
+            <button @tap="setSendType(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">自取</button>
+            <button @click="setSendType(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">配送</button>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1" >
             <view class="tui-title">运费</view>
-            <input @blur="sendCostBlur" type="number" placeholder="请填写,留空免运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
+            <input type="number" placeholder="请填写,留空免运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -101,12 +101,6 @@
             <button @tap="form.needPrint = 2" class="admin-button-com mini-btn" :class="form.needPrint == 2? 'blue' : 'default'">不打</button>
           </tui-list-cell>
 
-          <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
-            <view class="tui-title">总金额</view>
-            <text style="color: #3385FF" v-if="form.sendType == 1">{{	parseFloat((allPrice + Number(form.sendCost)).toFixed(2)) }}</text>
-            <text style="color: #3385FF" v-else >{{ parseFloat(allPrice.toFixed(2)) }}</text>
-          </tui-list-cell>
-
           <!--
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="customInfo.discount && customInfo.discount < 1" >
             <view class="tui-title">优惠</view>
@@ -116,11 +110,19 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
             <view class="tui-title">
-              <text>最终金额</text>  
+              <text>合计金额</text>  
             </view>
             <text style="color: #3385FF">{{parseFloat(finalPrice)}}</text>
           </tui-list-cell>
 
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+            <view v-if="form.debt == 1" class="tui-title">应收金额</view>
+            <view v-else class="tui-title">实收金额</view>
+            <input style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;" type="number" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
+            <text v-if="modifyPrice > 0 && modifyPrice > finalPrice" style="font-size:25upx;margin-left:20upx;color:red;">人工资材费 ¥{{parseFloat((modifyPrice-finalPrice).toFixed(2))}}</text>
+            <text v-if="modifyPrice > 0 && modifyPrice < finalPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((finalPrice-modifyPrice).toFixed(2))}}</text>
+          </tui-list-cell>
+
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">备注</view>
 						<textarea style="height: 100upx" v-model="form.remark" placeholder="选填" />
@@ -134,7 +136,7 @@
     <view class="under-bar">
       <view class="price-view">
         <text class="price-title" v-if="isBilling">
-          <text>最终金额</text>
+          <text>实际金额</text>
         </text>
         <text class="price-title" v-else>金额</text>
         <text class="price-number">¥<text class="large">{{ finalPrice }}</text></text>
@@ -203,14 +205,14 @@ export default {
         needPrint:1,//订单生成时打印订单1需要2不需要
         hasPay:0
       },
-      money: "",
       showCustomer: false,
       customInfo:{discount:1},
       customData: { bigCount: 0, smallCount: 0, userPrice: 0 },
       isAddModel:false,
       checkStock:true,
 			xjData:{},
-			xjDataInfo:{}
+			xjDataInfo:{},
+      modifyPrice:''
     };
   },
   onLoad (option) {
@@ -226,7 +228,7 @@ export default {
     }
     
     //默认自取
-    this.courier(2);
+    this.setSendType(2);
 
     if(Number(option.customId) > 0){
       this.form.customId = option.customId
@@ -251,7 +253,9 @@ export default {
     finalPrice(){
       let totalPrice = this.allPrice.toFixed(2)
       let finalPrice = (Number(totalPrice) + Number(this.form.sendCost)).toFixed(2)
-      return parseFloat(finalPrice)
+      let currentPrice = parseFloat(finalPrice)
+      this.modifyPrice = currentPrice 
+      return currentPrice
     }
   },
   methods: {
@@ -277,17 +281,10 @@ export default {
     setPayWay(payWay){
       this.form.payWay = payWay
     },
-    courier (type) {
+    setSendType (type) {
       this.form.sendType = type;
       if (type === 2) {
         this.form.sendCost = "";
-      } else if(type == 1){
-        this.form.sendCost = this.money;
-      }
-    },
-    sendCostBlur () {
-      if (this.form.sendType === 1) {
-        this.money = this.form.sendCost;
       }
     },
     _getDet () {
@@ -371,7 +368,7 @@ export default {
         formData.sendCost = "";
       }
       let Fn = createOrder
-      let params = {...formData,modifyPrice: this.finalPrice,newVersion:1};
+      let params = {...formData,modifyPrice: this.modifyPrice,newVersion:1};
       if(this.option.orderId && this.option.orderId > 0){
         Fn = updateOrder
         params = {...params,id:this.option.orderId}