|
|
@@ -4,46 +4,66 @@
|
|
|
<view class="select-item_box">
|
|
|
<view class="title">结账方式</view>
|
|
|
<view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('settleId',item.id)" v-for="item in returnWay" :class="[settleId===item.id?'active':'']"> {{item.name}} </view>
|
|
|
+ <view :key="item.id" @tap="changeType('hasPay',item.id)" v-for="item in hasPayList" :class="[form.hasPay===item.id?'active':'']"> {{item.name}} </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <template v-if="settleId!==3">
|
|
|
+ <template v-if="hasPay!==3">
|
|
|
<view class="select-item_box">
|
|
|
<view class="title">收款方式</view>
|
|
|
<view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('payId',item.id)" v-for="item in payWay" :class="[payId===item.id?'active':'']"> {{item.name}} </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="select-item_box">
|
|
|
- <view class="title">收款人</view>
|
|
|
- <view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('payUserId',item.id)" v-for="item in payUser" :class="[payUserId===item.id?'active':'']"> {{item.name}} </view>
|
|
|
+ <view :key="item.id" @tap="changeType('payWay',item.id)" v-for="item in payWayList" :class="[form.payWay===item.id?'active':'']"> {{item.name}} </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<view class="select-item_box">
|
|
|
<view class="title">打印小票</view>
|
|
|
<view class="item-list_box">
|
|
|
- <view :key="item.id" @tap="changeType('isPrint',item.id)" v-for="item in printOptions" :class="[isPrint===item.id?'active':'']"> {{item.name}} </view>
|
|
|
+ <view :key="item.id" @tap="changeType('isPrint',item.id)" v-for="item in needPrintList" :class="[form.needPrint===item.id?'active':'']"> {{item.name}} </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="select-item_box">
|
|
|
+ <view class="title">如需保存此组合,请输入名称:</view>
|
|
|
+ <view class="inpup_box">
|
|
|
+ <view><input type="text" v-model="form.groupName" name="groupName" /></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="select-item_box">
|
|
|
+ <view class="title">备注:</view>
|
|
|
+ <view class="inpup_box">
|
|
|
+ <view><input type="text" v-model="form.remark" name="remark" /></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="line"></view>
|
|
|
<view class="select-right">
|
|
|
- <AppInputAll v-model="totalShop.totalPrice" title="商品合计" disabled></AppInputAll>
|
|
|
- <AppInputAll v-model="freight" title="运费" @tap.native="changeEnterType('freight')" disabled placeholder="没有运费留空"></AppInputAll>
|
|
|
- <AppInputAll v-model="totalMoney" title="总金额" disabled placeholder="总金额"></AppInputAll>
|
|
|
- <AppInputAll v-model="proceeds" title="实收金额" @tap.native="changeEnterType('proceeds')" disabled placeholder="实收金额"></AppInputAll>
|
|
|
- <view class="shop-distoracn">优惠5</view>
|
|
|
- <view class="keyboard-body_box">
|
|
|
- <VKeyboard ref="keyboard" :digital="true" :disorderly="false" @typing="typing" @enter="enter"> </VKeyboard>
|
|
|
+
|
|
|
+ <view style="border-bottom: 1upx solid #ebedf0;height:35upx;font-size: 14upx;display:flex;align-items: center;justify-content:space-between;padding-right:10upx;">
|
|
|
+ <text>商品金额</text>
|
|
|
+ <text>¥<text>50</text></text>
|
|
|
+ </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;">
|
|
|
+ <text style="color:green;">运费</text>
|
|
|
+ <text>¥<text>50</text></text>
|
|
|
+ </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;">
|
|
|
+ <text>总金额</text>
|
|
|
+ <text>¥<text>50</text></text>
|
|
|
</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;">
|
|
|
+ <text style="color:green;">实收金额</text>
|
|
|
+ <text style="font-size: 10upx;color:green;">优惠¥<text>5</text></text>
|
|
|
+ <text>¥<text>50</text></text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="keyboard-body_box"> <VKeyboard ref="keyboard" :digital="true" :disorderly="false" @typing="typing" @enter="enter"> </VKeyboard> </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
import VKeyboard from '@/components/plugin/vKeyboard/VKeyboard.vue'
|
|
|
-import AppInputAll from '@/components/app_input_all'
|
|
|
export default {
|
|
|
name:'selectCustomer',
|
|
|
props:{
|
|
|
@@ -52,32 +72,36 @@ export default {
|
|
|
default:()=>{}
|
|
|
}
|
|
|
},
|
|
|
- components:{
|
|
|
- VKeyboard,
|
|
|
- AppInputAll
|
|
|
- },
|
|
|
+ components:{ VKeyboard },
|
|
|
computed:{
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- freight: '',
|
|
|
- settleId: 1,
|
|
|
- payId:1,
|
|
|
- payUserId:1,
|
|
|
- isPrint:1,
|
|
|
+ form:{
|
|
|
+ hasPay: 0,
|
|
|
+ payWay:0,
|
|
|
+ needPrint:1,
|
|
|
+ freight: '',
|
|
|
+ groupName:'',
|
|
|
+ remark:''
|
|
|
+ },
|
|
|
proceeds: '0',
|
|
|
- returnWay:[ { name:'扫码付款', id:0, }, { name:'已付款', id:1, }, { name:'待付款', id:2, } ],
|
|
|
- payWay:[ { name:'微信', id:0 }, { name:'支付宝', id:1 }, { name:'现金', id:4 }, { name:'银行卡', id:5 } ],
|
|
|
- payUser:[ { name:'收款码', id:0 }, { name:'微信客服1', id:1 }, { name:'微信客服2', id:2 },{ name:'微信客服3', id:3 },{ name:'微信客服4', id:4 } ],
|
|
|
+ hasPayList:[ { name:'待付款', id:0, }, { name:'已付款', id:1, }],
|
|
|
+ payWayList:[ { name:'微信', id:0 }, { name:'支付宝', id:1 }, { name:'现金', id:4 }, { name:'银行卡', id:5 } ],
|
|
|
currentInputType:'proceeds',
|
|
|
totalMoney: 0,
|
|
|
- printOptions:[ { name:'打印', id:1 }, { name:'不打印', id:2 } ]
|
|
|
+ needPrintList:[ { name:'打印', id:1 }, { name:'不打印', id:2 } ]
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.activeKeyboard();
|
|
|
this.updateTotal()
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ totalShop(){
|
|
|
+ this.updateTotal()
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
updateTotal(){
|
|
|
this.proceeds = this.totalShop.totalPrice
|
|
|
@@ -89,7 +113,6 @@ export default {
|
|
|
changeType(key, id){
|
|
|
this[key] = id
|
|
|
},
|
|
|
- //键盘方法
|
|
|
activeKeyboard() {
|
|
|
this.$refs.keyboard.activate();
|
|
|
},
|
|
|
@@ -98,8 +121,7 @@ export default {
|
|
|
if (this[this.currentInputType].length > 0) {
|
|
|
this[this.currentInputType] = this[this.currentInputType].substring(0, this[this.currentInputType].length - 1);
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ }else {
|
|
|
if(this[this.currentInputType]== 0 || this.$util.isEmpty(this[this.currentInputType])) {
|
|
|
this[this.currentInputType] = e.char
|
|
|
}else {
|
|
|
@@ -107,18 +129,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if(this[this.currentInputType] === 'freight') {
|
|
|
- this.updateTotal()
|
|
|
+ this.updateTotal()
|
|
|
}
|
|
|
},
|
|
|
enter() {
|
|
|
this.$emit('settleReturn')
|
|
|
},
|
|
|
- //键盘方法end
|
|
|
- },
|
|
|
- watch:{
|
|
|
- totalShop(){
|
|
|
- this.updateTotal()
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -127,36 +143,57 @@ export default {
|
|
|
background-color: #ffffff;
|
|
|
display: flex;
|
|
|
width:80vw;
|
|
|
- height: 90vh;
|
|
|
+ height: 95vh;
|
|
|
.select-left {
|
|
|
flex: 1;
|
|
|
padding: 10upx;
|
|
|
& .select-item_box {
|
|
|
& > .title {
|
|
|
font-size: 12upx;
|
|
|
+ text-align:left;
|
|
|
}
|
|
|
- & .item-list_box {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: flex-start;
|
|
|
- flex-wrap: wrap;
|
|
|
- padding: 8upx 0;
|
|
|
- & > view {
|
|
|
- width: 85upx;
|
|
|
- height: 30upx;
|
|
|
- text-align: center;
|
|
|
- line-height: 30upx;
|
|
|
- font-size: 12upx;
|
|
|
+ & .inpup_box{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 6upx 0;
|
|
|
+ & > view {
|
|
|
+ input{
|
|
|
+ width: 200upx;
|
|
|
+ height: 26upx;
|
|
|
+ text-align: left;
|
|
|
+ line-height: 26upx;
|
|
|
+ font-size: 13upx;
|
|
|
border: 1px solid #eee;
|
|
|
margin: 0 5upx 5upx 0;
|
|
|
color: #333333;
|
|
|
border-radius: 3upx;
|
|
|
- &.active {
|
|
|
- background-color: #468c71;
|
|
|
- color: #ffffff;
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & .item-list_box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 6upx 0;
|
|
|
+ & > view {
|
|
|
+ width: 85upx;
|
|
|
+ height: 30upx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 30upx;
|
|
|
+ font-size: 12upx;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ margin: 0 5upx 5upx 0;
|
|
|
+ color: #333333;
|
|
|
+ border-radius: 3upx;
|
|
|
+ &.active {
|
|
|
+ background-color: #468c71;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
& .line {
|