|
|
@@ -57,13 +57,13 @@
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<view class="tui-title ">送货</view>
|
|
|
- <button @tap="sendType=1" class="admin-button-com mini-btn" :class="sendType==1?'blue':'default'">自取</button>
|
|
|
- <button @tap="sendType=0" class="admin-button-com mini-btn" :class="sendType==0?'blue':'default'">配送</button>
|
|
|
+ <button @tap="sendType=1,freight=0,countAllPrices()" class="admin-button-com mini-btn" :class="sendType==1?'blue':'default'">自取</button>
|
|
|
+ <button @tap="sendType=0,freight=0" class="admin-button-com mini-btn" :class="sendType==0?'blue':'default'">配送</button>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell v-if="sendType == 0" class="line-cell" :hover="false" :arrow="false" >
|
|
|
<view class="tui-title ">运费</view>
|
|
|
- <input type="number" placeholder="留空免运费" v-model="freight" placeholder-class="tui-placeholder">
|
|
|
+ <input type="number" placeholder="留空免运费" v-model="freight" @input="countAllPrices()" placeholder-class="tui-placeholder">
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
@@ -73,6 +73,28 @@
|
|
|
{{ res.name }}
|
|
|
</button>
|
|
|
</tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title">总金额</view>
|
|
|
+ <text style="color: #3385FF" >{{ (Number(freight)+Number(allGoodsPrice)).toFixed(2) }}</text>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title">实收金额</view>
|
|
|
+ <view class="flex-space" style="width: 100%;">
|
|
|
+ <input style="border: 1px solid #eee;color: #3385FF;width: 60%;" type="number" @focus="realMoney='',discountIndex=0" v-model="realMoney" placeholder-class="tui-placeholder"/>
|
|
|
+ <picker style="border: 1px solid #eee;width: 30%;" @change="discountChange" :value="discountIndex" :range="discount">
|
|
|
+ <view class="flex-space">
|
|
|
+ <view class="uni-input">{{discount[discountIndex]}}</view>
|
|
|
+ <i class="iconfont iconxiangyou"></i>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title">优惠</view>
|
|
|
+ <text style="color: #3385FF">{{ ((Number(freight)+Number(allGoodsPrice)).toFixed(2) - realMoney).toFixed(2) }}</text>
|
|
|
+ </tui-list-cell>
|
|
|
|
|
|
|
|
|
<!-- <appFormSend :form.sync="form"> </appFormSend>-->
|
|
|
@@ -83,7 +105,7 @@
|
|
|
<view class="price-view">
|
|
|
<text class="price-title">收款</text>
|
|
|
<text class="price-number">
|
|
|
- ¥ <text class="large">{{ Number(freight)+Number(allGoodsPrice) }}</text>
|
|
|
+ ¥ <text class="large">{{ realMoney }}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
<button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
|
|
|
@@ -109,7 +131,7 @@ const formUtil = require("@/utils/formValidation.js");
|
|
|
import { createOrder,freight } from "@/api/order/index";
|
|
|
// import { freight } from "@/api/order";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
-
|
|
|
+import { copyObject } from "@/utils/util";
|
|
|
export default {
|
|
|
name: "BillingAffirm", // 开单确认
|
|
|
components: {
|
|
|
@@ -132,7 +154,10 @@ export default {
|
|
|
payType:1,//选中的-支付类型
|
|
|
clientInfo: '',//客户信息
|
|
|
showCustomer: false,
|
|
|
- sendType:1
|
|
|
+ realMoney: 0,
|
|
|
+ sendType:1,
|
|
|
+ discountIndex:0,
|
|
|
+ discount:['未打折','95折','9折','85折','8折','75折','7折','65折','6折']
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -147,6 +172,7 @@ export default {
|
|
|
title: this.getMerchantInfo.name
|
|
|
});
|
|
|
}
|
|
|
+ this.realMoney = this.allGoodsPrice.toFixed(2);
|
|
|
setTimeout(()=>{
|
|
|
this.payType = this.getDictionariesInfo.htPayWayOption[0].id;
|
|
|
},100)
|
|
|
@@ -156,6 +182,46 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
+ discountChange(e){
|
|
|
+ this.discountIndex = e.target.value;
|
|
|
+ let discount = 0;
|
|
|
+ let allGoodsPrice = this.allGoodsPrice.toFixed(2)
|
|
|
+ let allPrices = (Number(allGoodsPrice) + Number(this.freight)).toFixed(2);
|
|
|
+ switch (e.target.value) {
|
|
|
+ case '0':
|
|
|
+ discount = 0
|
|
|
+ break;
|
|
|
+ case '1':
|
|
|
+ discount = (allPrices - (allPrices * 0.95)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '2':
|
|
|
+ discount = (allPrices - (allPrices * 0.9)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '3':
|
|
|
+ discount = (allPrices - (allPrices * 0.85)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '4':
|
|
|
+ discount = (allPrices - (allPrices * 0.8)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '5':
|
|
|
+ discount = (allPrices - (allPrices * 0.75)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '6':
|
|
|
+ discount = (allPrices - (allPrices * 0.7)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '7':
|
|
|
+ discount = (allPrices - (allPrices * 0.65)).toFixed(2);
|
|
|
+ break;
|
|
|
+ case '8':
|
|
|
+ discount = (allPrices - (allPrices * 0.6)).toFixed(2);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.realMoney = (allPrices - discount).toFixed(2);
|
|
|
+ },
|
|
|
+ countAllPrices(){
|
|
|
+ let allPrices = this.allGoodsPrice.toFixed(2)
|
|
|
+ this.realMoney = (Number(allPrices) + Number(this.freight)).toFixed(2);
|
|
|
+ },
|
|
|
// 选取客户
|
|
|
changeCustomerFn(info) {
|
|
|
console.log("changeCustomerFn", info);
|
|
|
@@ -182,6 +248,7 @@ export default {
|
|
|
customId:this.clientInfo.id,// 客户
|
|
|
payWay:this.payType,//付款方式
|
|
|
sendType:this.sendType,//配送方式 0未知 1自取
|
|
|
+ realPrice: this.realMoney,
|
|
|
goodsInfo:JSON.stringify(product),//下单商品
|
|
|
};
|
|
|
let self = this;
|