shish 4 tahun lalu
induk
melakukan
8f4a634d22

+ 8 - 1
hdApp/src/admin/order/detail.vue

@@ -98,6 +98,13 @@
               <view class="label">单号:</view>
               <view class="value">{{ orderInfo.orderSn||'' }}</view>
             </view>
+            <view class="msg-list">
+              <view class="label">支付:</view>
+              <view class="value">
+                {{ orderInfo.payWay == 0 ? '微信支付':orderInfo.payWay==1?'支付宝':orderInfo.payWay==4?'现金':orderInfo.payWay==5 ?'银行卡':'其它'}}
+                <text v-if="Number(orderInfo.mainPay)>0 && Number(orderInfo.cash)>0">(现金付了¥{{ orderInfo.cash ? parseFloat(orderInfo.cash) : 0 }})</text>
+              </view>
+            </view>
             <view class="msg-list">
               <view class="label">时间:</view>
               <view class="value">{{ orderInfo.addTime ? orderInfo.addTime.substr(5,11) : ''}}</view>
@@ -124,7 +131,7 @@
               <view style="color: #3385ff;margin-left:50upx;" @click="pageTo({url: '/admin/order/refundList',query: {orderSn: orderInfo.orderSn}})">退款记录</view>
             </view>
             <view class="msg-list">
-              <view class="label">实:</view>
+              <view class="label">实:</view>
               <view class="value">¥{{ orderInfo.realPrice ? parseFloat(orderInfo.realPrice) : 0 }}</view>
             </view>
 

+ 1 - 1
hdPad/src/pages/home/components/console.vue

@@ -141,7 +141,7 @@ export default {
 		confirmSelectPrice(params){
 			uni.showLoading({mask:true})
 			//isCashier=1时收银台播放 总金额139元,请扫码付款
-			createOrder({orderName:params.name,lsGoodsPrice:params.price,modifyPrice:params.price,isCashier:1,hasPay:params.hasPay,payWay:params.payWay}).then(res=>{
+			createOrder({orderName:params.name,lsGoodsPrice:params.price,modifyPrice:params.price,isCashier:1,cash:params.cash}).then(res=>{
 				uni.hideLoading()
 				if(res.code == 1){
 					if(res.data.status == 1){

+ 61 - 26
hdPad/src/pages/home/components/selectPrice.vue

@@ -1,22 +1,27 @@
 <template>
     <view class="boardset-flowert">
         <view class="flower-input_box">
-
             <view class="flower-open_box">
                 <view @tap="checkCurrent(1)">
-                    <view class="desc">收款金额</view>
+                    <view class="desc">订单金额</view>
                     <div class="flower-unit_box">
                         <text :class="{selected:checkType == 1}">{{price}}</text>
                     </div>
                 </view>
             </view>
             <input class="goods-name" v-model="name" placeholder="商品名称(选填)" placeholder-class="grey-color" />
-
-            <view class="pay-style">
-                <button :class="[hasPay===0?'selected':'']" @click="changeWay(0)">扫码</button>
-                <button :class="[hasPay===1?'selected':'']" @click="changeWay(1)">现金</button>
+            <view class="flower-open_box">
+                <view @tap="checkCurrent(2)">
+                    <view class="desc">
+                        收现金
+                        <text v-if="Number(zl)>0" style="color:green;margin-left:3upx;">找零 {{zl}}</text>
+                        <text style="color:red;margin-left:3upx;" v-if="Number(zl)<0">还差 {{-zl}}</text>
+                    </view>
+                    <div class="flower-unit_box">
+                        <text :class="{selected:checkType == 2}">{{cash}}</text>
+                    </div>
+                </view>
             </view>
-
         </view>
         <view class="keyboard-body_box">
          <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
@@ -31,22 +36,30 @@ export default {
     data() {
         return {
             price:0,
-            //0未全选 1全选
             checkType:1,
+            fillType:1,
             name:'',
-            hasPay:0,
-            payWay:4
+            cash:0
         };
     },
     mounted(){
         this.activeKeyboard()
     },
+    computed:{
+        zl(){
+            let amount = 0
+            if(Number(this.cash) > 0 && Number(this.price) > 0){
+                amount = Number(this.cash) - Number(this.price)
+                amount = parseFloat(amount.toFixed(2))
+            }
+            return Number(amount)
+        }
+    },
     methods: {
-        changeWay(val){
-            this.hasPay = val
-        },
         checkCurrent(n){
-            this.checkType = 1
+            this.$util.hitVoice()
+            this.checkType = n
+            this.fillType = n
         },
         cancel(){
             this.$util.hitVoice()
@@ -57,18 +70,40 @@ export default {
         },
         typing(e) {
             if (e.backspace) {
-                if(this.checkType == 1){
-                    this.price = ''
-                }else{
-                    if (this.price.length > 0) {
-                        this.price = this.price.substring(0, this.price.length - 1)
+                if(this.fillType == 1){
+                    if(this.checkType == 1){
+                        this.price = ''
+                    }else{
+                        if (this.price.length > 0) {
+                            this.price = this.price.substring(0, this.price.length - 1)   
+                        }
                     }
-                }
+                }else if(this.fillType == 2){
+                    if(this.checkType == 2){
+                        this.cash = ''
+                    }else{
+                        if (this.cash.length > 0) {
+                            this.cash = this.cash.substring(0, this.cash.length - 1)   
+                        }
+                    }
+                }else{
+
+                }                
             }else {
-                if(this.$util.isEmpty(this.price) || this.checkType == 1) {
-                    this.price = e.char
-                }else {
-                    this.price += e.char;
+                if(this.fillType == 1){
+                    if(this.$util.isEmpty(this.price) || this.checkType == 1) {
+                        this.price = e.char
+                    }else {
+                        this.price += e.char
+                    }
+                }else if(this.fillType == 2){
+                    if(this.$util.isEmpty(this.cash) || this.checkType == 2) {
+                        this.cash = e.char
+                    }else {
+                        this.cash += e.char
+                    }
+                }else{
+
                 }
             }
             this.checkType = 0
@@ -78,7 +113,7 @@ export default {
                 this.$msg('请填写金额')
                 return
             }
-            this.$emit('confirmSelectPrice', {price:this.price,name:this.name,hasPay:this.hasPay,payWay:this.payWay})
+            this.$emit('confirmSelectPrice', {price:Number(this.price),name:this.name,cash:Number(this.cash)})
         }
     }
 }
@@ -139,7 +174,7 @@ export default {
         .goods-name{
             border:1upx solid #EEEEEE;
             width:150upx;
-            margin:20upx auto 0 auto;
+            margin:10upx auto 0 auto;
             height:30upx;
             font-size:15upx;
             text-align:center;