Răsfoiți Sursa

收银机支持使用余额支付

shish 11 luni în urmă
părinte
comite
c0d7d052b3

+ 7 - 2
hdPad/src/pages/home/cash.vue

@@ -24,7 +24,7 @@
 			<!-- 按钮操作 -->
 			<view class="open-box">
 				<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @showCustomPop="showCustomPop" @fastCreate="fastCreate" 
-				:customId.sync="customId" :reduceOrderId.sync="reduceOrderId" :reduceStock.sync="reduceStock" :customName.sync="customName" @changeProperty="changeProperty" @updateRightItem="updateRightItem"></consoleButton>
+				:customId.sync="customId" :reduceOrderId.sync="reduceOrderId" :balance.sync="balance" :reduceStock.sync="reduceStock" :customName.sync="customName" @changeProperty="changeProperty" @updateRightItem="updateRightItem"></consoleButton>
 			</view>
 		</view>
 
@@ -74,6 +74,7 @@ export default {
 			isLogin:2,
 			customId:0,
 			customName:'',
+			balance:0,
             currentJobType:'bill',
             currentJobId:0,
 			hasChooseCustomer:true,
@@ -120,10 +121,10 @@ export default {
 			this.isLogin = 0
 		}else{
 			this.isLogin = 1
-
 			if(this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0){
 				this.customId =  Number(this.getMyShopInfo.defaultCustomId)
 				this.customName = '快捷开单'
+				this.balance = 0
 			}
 		}
 	},
@@ -141,6 +142,7 @@ export default {
 			handler(newValue) {
 				this.customId = newValue.defaultCustomId && newValue.defaultCustomId > 0 ? Number(newValue.defaultCustomId):0
 				this.customName = '快捷开单'
+				this.balance = 0
 			}
 		}
 	},
@@ -149,6 +151,7 @@ export default {
 			this.$refs.myCustomRef.close()
 			this.customId = this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0 ? Number(this.getMyShopInfo.defaultCustomId):0
 			this.customName = '快捷开单'
+			this.balance = 0
 			this.$refs.rightItemRef.renewMyRightItem(this.customId)
 			this.beginRemind()
 		},
@@ -177,6 +180,7 @@ export default {
 			this.$refs.myCustomRef.close()
 			this.customId = Number(info.id)
 			this.customName = info.name
+			this.balance = Number(info.balance)>0 ? Number(info.balance) : 0
 			this.$refs.rightItemRef.renewMyRightItem(this.customId)
 			this.beginRemind()
 		},
@@ -205,6 +209,7 @@ export default {
 		updateRightItem(){
 			this.customId = this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0 ? Number(this.getMyShopInfo.defaultCustomId):0
 			this.customName = '快捷开单'
+			this.balance = 0
 			//要调用rightItemRef里的方法更新,不能这边直接请求product.js里方法更新,因为会造成扫码那块出问题,识别不到,关键词hzg_scan_right_item
 			this.$refs.rightItemRef.renewMyRightItem(this.customId)
 			this.getCustomData()

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

@@ -42,7 +42,7 @@
 
     <!-- 结算弹框 -->
     <uni-popup ref="settlePopRef" background-color="#fff" type="center" :animation="false">
-        <settlePop @settleCommit="settleCommit" @cancelSettle="cancelSettle" ref="settlePop" :settleOpenStatus.sync="settleOpenStatus"></settlePop>
+        <settlePop @settleCommit="settleCommit" @cancelSettle="cancelSettle" ref="settlePop" :settleOpenStatus.sync="settleOpenStatus" :balance.sync="balance"></settlePop>
     </uni-popup>
 
     <!-- 扫码付款 -->
@@ -116,6 +116,10 @@ export default {
 			type: Number,
 			default: 0
 		},
+		balance:{
+			type: Number,
+			default: 0
+		}
     },
     data(){
         return {

+ 11 - 2
hdPad/src/pages/home/components/customerList.vue

@@ -20,12 +20,13 @@
             <view @click="confirmCustom(item)" class="user-list-item_box" v-for="(item,index) in currentCustomList" :key="item.id">
               <view class="head-box">
                 <view class="name">{{item.name}}</view>
+                <view class="balance" v-if="Number(item.balance)>0">{{item.balance?parseFloat(item.balance):0}}</view>
               </view>
             </view>
 
     </view>
     <view class="search-container">
-        <input class="input-serach_box" v-model="searchUser" type="text" @focus="clearInput" @input="changSearch" placeholder-class="input-placeholder" placeholder="请输入客户名称"/>
+        <input class="input-serach_box" v-model="searchUser" type="text" @focus="clearInput" @input="changSearch" placeholder-class="input-placeholder" placeholder="客户名称"/>
         <view class="number-keyboard">
             <view class="number-key" v-for="num in [1,2,3,4,5,6,7,8,9,0]" :key="num" @click="inputNumber(num)">{{num}}</view>
             <view class="delete-key" @click="clearInput">清空</view>
@@ -154,9 +155,9 @@ export default {
       justify-content: center;
       & .head-box {
         display: flex;
+        flex-direction: column;
         font-size: 12upx;
         align-items: center;
-        margin-bottom: 15upxs;
         & .name {
           color:#3385FF;
           padding-left: 2upx;
@@ -164,6 +165,14 @@ export default {
           white-space:nowrap;
           width:82upx;
         }
+        & .balance {
+          color:#6e6e6e;
+          font-size: 10upx;
+          padding-left: 2upx;
+          overflow:hidden;
+          white-space:nowrap;
+          width:82upx;
+        }
         & > .img {
           width: 16upx;
           height: 16upx;

+ 4 - 0
hdPad/src/pages/home/components/orderInfo.vue

@@ -25,6 +25,10 @@
         <view><text class="left">开单人</text><text class="right">{{orderInfo.shopAdminName||''}}</text></view>
         <view><text class="left">订单号</text><text class="right">{{orderInfo.orderSn||''}}</text></view>
         <view><text class="left">状态</text><text class="right">{{getStatus(orderInfo.status)}}</text></view>
+
+        <view><text class="left">类型</text><text class="right">{{orderInfo.onlinePay == 1 ?'线下':'线上'}}</text></view>
+        <view><text class="left">方式</text><text class="right">{{orderInfo.payWay==0?'微信':orderInfo.payWay ==1?"支付宝":orderInfo.payWay==2?'余额':orderInfo.payWay==3?'欠款':orderInfo.payWay==4?'现金':'银行卡'}}</text></view>
+
         <view>
           <text class="left">创建时间</text>
           <text class="right">{{orderInfo.addTime ? orderInfo.addTime.substr(5,11):''}}</text>

+ 19 - 3
hdPad/src/pages/home/components/settlePop.vue

@@ -6,8 +6,8 @@
                 <view class="item-list_box">
                     <view :key="item.id" @tap="changeHasPay(item.id)" v-for="item in hasPayList" :class="[form.hasPay===item.id?'active':'']"> {{item.name}} </view>    
                 </view>
+                <view v-if="Number(balance)>Number(form.modifyPrice)" style="color:blue;font-size:13upx;font-weight:bold;margin-bottom:7upx;">客户余额 ¥{{balance?parseFloat(balance):0}},使用余额支付</view>
             </view>
-
             <view class="select-item_box" v-if="form.hasPay == 1">
                 <view class="title">请选择</view>
                 <view class="item-list_box">
@@ -152,7 +152,7 @@ export default {
                 dealPrice:0
             },
             proceeds: '0',
-            hasPayList:[ { name:'扫码', id:0, },{ name:'赊账', id:2, },{ name:'线下', id:1, }],
+            hasPayList:[ { name:'扫码', id:0, },{name:'余额',id:4},{ name:'赊账', id:2, },{ name:'线下', id:1, }],
             payWayList:[ { name:'线下微信', id:0 }, { name:'线下支付宝', id:1 },{name:'现金',id:4},{name:'银行卡',id:5} ],
             currentInputType:'proceeds',
             totalMoney: 0,
@@ -177,7 +177,11 @@ export default {
         settleOpenStatus:{
             type:Number,
             default:0
-        }
+        },
+		balance:{
+			type: Number,
+			default: 0
+		}
     },
     components:{ VKeyboard },
 	mixins: [productMins],
@@ -192,6 +196,7 @@ export default {
                 price = parseFloat(price.toFixed(2))
             }
             this.form.modifyPrice = price
+
             return price
         },
         diffPrice(){
@@ -220,6 +225,12 @@ export default {
                     this.form.sendCost = 0
                     this.form.labourCost = 0
                     this.form.dealPrice = 0
+
+                    //如果余额够使用余额支付
+                    if(Number(this.balance)>Number(this.form.modifyPrice)){
+                        this.changeHasPay(4)
+                    }
+
                 }
             },
             immediate:true
@@ -252,6 +263,11 @@ export default {
                 }
             }
         })
+
+        if(Number(this.balance)>Number(this.form.modifyPrice)){
+            this.changeHasPay(4)
+        }
+
     },
     methods: {
         confirmDiff(){