|
@@ -4,21 +4,21 @@
|
|
|
<view class="select-item_box">
|
|
<view class="select-item_box">
|
|
|
<view class="title">结账方式</view>
|
|
<view class="title">结账方式</view>
|
|
|
<view class="item-list_box">
|
|
<view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('hasPay',item.id)" v-for="item in hasPayList" :class="[form.hasPay===item.id?'active':'']"> {{item.name}} </view>
|
|
|
|
|
|
|
+ <view :key="item.id" @tap="changeHasPay(item.id)" v-for="item in hasPayList" :class="[form.hasPay===item.id?'active':'']"> {{item.name}} </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <template v-if="hasPay!==3">
|
|
|
|
|
|
|
+ <template>
|
|
|
<view class="select-item_box">
|
|
<view class="select-item_box">
|
|
|
<view class="title">收款方式</view>
|
|
<view class="title">收款方式</view>
|
|
|
<view class="item-list_box">
|
|
<view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('payWay',item.id)" v-for="item in payWayList" :class="[form.payWay===item.id?'active':'']"> {{item.name}} </view>
|
|
|
|
|
|
|
+ <view :key="item.id" @tap="changePayWay(item.id)" v-for="item in payWayList" :class="[form.payWay===item.id?'active':'']"> {{item.name}} </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<view class="select-item_box">
|
|
<view class="select-item_box">
|
|
|
<view class="title">打印小票</view>
|
|
<view class="title">打印小票</view>
|
|
|
<view class="item-list_box">
|
|
<view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('isPrint',item.id)" v-for="item in needPrintList" :class="[form.needPrint===item.id?'active':'']"> {{item.name}} </view>
|
|
|
|
|
|
|
+ <view :key="item.id" @tap="changeNeedPrint(item.id)" v-for="item in needPrintList" :class="[form.needPrint===item.id?'active':'']"> {{item.name}} </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="select-item_box">
|
|
<view class="select-item_box">
|
|
@@ -37,33 +37,36 @@
|
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
|
<view class="select-right">
|
|
<view class="select-right">
|
|
|
|
|
|
|
|
- <view style="border-bottom: 1upx solid #ebedf0;height:35upx;font-size: 14upx;display:flex;align-items: center;justify-content:space-between;padding-right:10upx;">
|
|
|
|
|
|
|
+ <view class="input-list">
|
|
|
<text>商品金额</text>
|
|
<text>商品金额</text>
|
|
|
- <text>¥<text>50</text></text>
|
|
|
|
|
|
|
+ <text>¥<text>{{allPrice}}</text></text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view style="border-bottom: 1upx solid #ebedf0;height:35upx;font-size: 14upx;display:flex;align-items: center;justify-content:space-between;padding-right:10upx;">
|
|
|
|
|
|
|
+ <view class="input-list" @click.stop="changeCheck(1)">
|
|
|
<text style="color:green;">运费</text>
|
|
<text style="color:green;">运费</text>
|
|
|
- <text>¥<text>50</text></text>
|
|
|
|
|
|
|
+ <text>¥<text :class="{selected:checkType == 1}">{{form.sendCost}}</text></text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view style="border-bottom: 1upx solid #ebedf0;height:35upx;font-size: 14upx;display:flex;align-items: center;justify-content:space-between;padding-right:10upx;">
|
|
|
|
|
|
|
+ <view class="input-list">
|
|
|
<text>总金额</text>
|
|
<text>总金额</text>
|
|
|
- <text>¥<text>50</text></text>
|
|
|
|
|
|
|
+ <text>¥<text>{{totalPrice}}</text></text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view style="border-bottom: 1upx solid #ebedf0;height:35upx;font-size: 14upx;display:flex;align-items: center;justify-content:space-between;margin-bottom:10upx;padding-right:10upx;">
|
|
|
|
|
|
|
+ <view class="input-list input-bottom" @click.stop="changeCheck(0)">
|
|
|
<text style="color:green;">实收金额</text>
|
|
<text style="color:green;">实收金额</text>
|
|
|
- <text style="font-size: 10upx;color:green;">优惠¥<text>5</text></text>
|
|
|
|
|
- <text>¥<text>50</text></text>
|
|
|
|
|
|
|
+ <text style="font-size: 10upx;color:green;" v-if="diffPrice > 0">优惠¥<text>{{diffPrice}}</text></text>
|
|
|
|
|
+ <text style="font-size: 10upx;color:green;" v-if="diffPrice < 0">人工包装费¥<text>{{Math.abs(diffPrice)}}</text></text>
|
|
|
|
|
+ <text>¥<text :class="{selected:checkType == 0}">{{form.modifyPrice}}</text></text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="keyboard-body_box"> <VKeyboard ref="keyboard" :digital="true" :disorderly="false" @typing="typing" @enter="enter"> </VKeyboard> </view>
|
|
<view class="keyboard-body_box"> <VKeyboard ref="keyboard" :digital="true" :disorderly="false" @typing="typing" @enter="enter"> </VKeyboard> </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import VKeyboard from '@/components/plugin/vKeyboard/VKeyboard.vue'
|
|
import VKeyboard from '@/components/plugin/vKeyboard/VKeyboard.vue'
|
|
|
|
|
+import productMins from "@/mixins/product";
|
|
|
export default {
|
|
export default {
|
|
|
name:'selectCustomer',
|
|
name:'selectCustomer',
|
|
|
props:{
|
|
props:{
|
|
@@ -73,17 +76,37 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components:{ VKeyboard },
|
|
components:{ VKeyboard },
|
|
|
|
|
+ mixins: [productMins],
|
|
|
computed:{
|
|
computed:{
|
|
|
|
|
+ totalPrice(){
|
|
|
|
|
+ let price = Number(this.allPrice)+Number(this.form.sendCost)
|
|
|
|
|
+ price = parseFloat(price.toFixed(2))
|
|
|
|
|
+
|
|
|
|
|
+ this.form.modifyPrice = price
|
|
|
|
|
+
|
|
|
|
|
+ return price
|
|
|
|
|
+ },
|
|
|
|
|
+ diffPrice(){
|
|
|
|
|
+ let price = Number(this.totalPrice) - Number(this.form.modifyPrice)
|
|
|
|
|
+ price = parseFloat(price.toFixed(2))
|
|
|
|
|
+ return price
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ //全选类型 0 实收金额全选 1 运费全选 2 没有任何全选
|
|
|
|
|
+ checkType:0,
|
|
|
|
|
+ //输入类型 0 实收金额 1 运费
|
|
|
|
|
+ fillType:0,
|
|
|
form:{
|
|
form:{
|
|
|
hasPay: 0,
|
|
hasPay: 0,
|
|
|
payWay:0,
|
|
payWay:0,
|
|
|
needPrint:1,
|
|
needPrint:1,
|
|
|
freight: '',
|
|
freight: '',
|
|
|
groupName:'',
|
|
groupName:'',
|
|
|
- remark:''
|
|
|
|
|
|
|
+ remark:'',
|
|
|
|
|
+ sendCost:0,
|
|
|
|
|
+ modifyPrice:0
|
|
|
},
|
|
},
|
|
|
proceeds: '0',
|
|
proceeds: '0',
|
|
|
hasPayList:[ { name:'待付款', id:0, }, { name:'已付款', id:1, }],
|
|
hasPayList:[ { name:'待付款', id:0, }, { name:'已付款', id:1, }],
|
|
@@ -94,46 +117,65 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
- this.activeKeyboard();
|
|
|
|
|
- this.updateTotal()
|
|
|
|
|
|
|
+ this.activeKeyboard()
|
|
|
},
|
|
},
|
|
|
watch:{
|
|
watch:{
|
|
|
- totalShop(){
|
|
|
|
|
- this.updateTotal()
|
|
|
|
|
- }
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- updateTotal(){
|
|
|
|
|
- this.proceeds = this.totalShop.totalPrice
|
|
|
|
|
- this.totalMoney = (+this.totalShop.totalPrice) + (this.$util.isEmpty(this.freight)?0: +this.freight)
|
|
|
|
|
|
|
+ changeNeedPrint(val){
|
|
|
|
|
+ this.form.needPrint = val
|
|
|
},
|
|
},
|
|
|
- changeEnterType(type){
|
|
|
|
|
- this.currentInputType = type
|
|
|
|
|
|
|
+ changePayWay(val){
|
|
|
|
|
+ this.form.payWay = val
|
|
|
},
|
|
},
|
|
|
- changeType(key, id){
|
|
|
|
|
- this[key] = id
|
|
|
|
|
|
|
+ changeHasPay(val){
|
|
|
|
|
+ this.form.hasPay = val
|
|
|
},
|
|
},
|
|
|
- activeKeyboard() {
|
|
|
|
|
- this.$refs.keyboard.activate();
|
|
|
|
|
|
|
+ changeCheck(val){
|
|
|
|
|
+ this.checkType = val
|
|
|
|
|
+ this.fillType = val
|
|
|
},
|
|
},
|
|
|
typing(e) {
|
|
typing(e) {
|
|
|
if (e.backspace) {
|
|
if (e.backspace) {
|
|
|
- if (this[this.currentInputType].length > 0) {
|
|
|
|
|
- this[this.currentInputType] = this[this.currentInputType].substring(0, this[this.currentInputType].length - 1);
|
|
|
|
|
|
|
+ if(this.fillType == 0){
|
|
|
|
|
+ if(this.checkType == 0){
|
|
|
|
|
+ this.form.modifyPrice = ''
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if (this.form.modifyPrice.length > 0) {
|
|
|
|
|
+ this.form.modifyPrice = this.form.modifyPrice.substring(0, this.form.modifyPrice.length - 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(this.checkType == 1){
|
|
|
|
|
+ this.form.sendCost = ''
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if (this.form.sendCost.length > 0) {
|
|
|
|
|
+ this.form.sendCost = this.form.sendCost.substring(0, this.form.sendCost.length - 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}else {
|
|
}else {
|
|
|
- if(this[this.currentInputType]== 0 || this.$util.isEmpty(this[this.currentInputType])) {
|
|
|
|
|
- this[this.currentInputType] = e.char
|
|
|
|
|
- }else {
|
|
|
|
|
- this[this.currentInputType] += e.char;
|
|
|
|
|
|
|
+ if(this.fillType == 0){
|
|
|
|
|
+ if(this.$util.isEmpty(this.form.modifyPrice) || this.checkType == 0) {
|
|
|
|
|
+ this.form.modifyPrice = e.char
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.form.modifyPrice += e.char;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(this.$util.isEmpty(this.form.sendCost) || this.checkType == 1) {
|
|
|
|
|
+ this.form.sendCost = e.char
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.form.sendCost += e.char
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(this[this.currentInputType] === 'freight') {
|
|
|
|
|
- this.updateTotal()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.checkType = 2
|
|
|
|
|
+ },
|
|
|
|
|
+ activeKeyboard() {
|
|
|
|
|
+ this.$refs.keyboard.activate();
|
|
|
},
|
|
},
|
|
|
enter() {
|
|
enter() {
|
|
|
- this.$emit('settleReturn')
|
|
|
|
|
|
|
+ this.$emit('settleCommit',this.form)
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -205,6 +247,22 @@ export default {
|
|
|
padding: 10upx;
|
|
padding: 10upx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
+ & .input-list{
|
|
|
|
|
+ border-bottom: 1upx solid #ebedf0;
|
|
|
|
|
+ height:35upx;
|
|
|
|
|
+ font-size: 14upx;
|
|
|
|
|
+ display:flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content:space-between;
|
|
|
|
|
+ padding-right:10upx;
|
|
|
|
|
+ .selected{
|
|
|
|
|
+ background:blue;
|
|
|
|
|
+ color:white;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ & .input-bottom{
|
|
|
|
|
+ margin-bottom:10upx;
|
|
|
|
|
+ }
|
|
|
& .shop-distoracn {
|
|
& .shop-distoracn {
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
font-size: 14upx;
|
|
font-size: 14upx;
|