lilei 4 months ago
parent
commit
6af194886e

+ 18 - 9
pagesB/procureOrder/creatOrder.vue

@@ -39,14 +39,14 @@
 								<text class="price">¥{{Number(totalAmount).toFixed(2)}}</text>
 							</view>
 							<view class="product-price-item" v-if="showBalanceAuth&&subsidyAmount">
-								<view class="flex align_center" v-if="storeAccount">抵扣(余额:¥{{storeAccount.giveBalance}})</view>
+								<view class="flex align_center" v-if="storeAccount">抵扣(余额:¥{{Number(storeAccount.giveBalance).toFixed(2)}})</view>
 								<view class="flex align_center" v-if="!disKdk" @click="hasKdk=!hasKdk">
 									<uni-icons size="18" :type="hasKdk?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons> 
-									<text>¥{{subsidyAmount}}</text>
+									<text>¥{{Number(subsidyAmount).toFixed(2)}}</text>
 								</view>
 								<view class="flex align_center" v-else>
 									<uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons>
-									<text>¥{{subsidyAmount}}</text>
+									<text>¥{{Number(subsidyAmount).toFixed(2)}}</text>
 								</view>
 							</view>
 							<view class="product-price-item" v-if="totalDiscount">
@@ -63,7 +63,7 @@
 							</view>
 						</view>
 						<view style="margin-top: 10px;">
-							<payOptions v-model="payType" :hasBalancePay="hasBalancePay" :disableCz="disCzOption" :hasPay="shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
+							<payOptions v-model="payType" :hasBalancePay="showBalanceAuth" :disableCz="disCzOption" :hasPay="shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'" @change="payTypeChange" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
 						</view>
 					</view>
 				</scroll-view>
@@ -152,6 +152,9 @@
 		watch: {
 			hasBalancePay(v){
 				this.payType = v ? 0 : (this.hasPay ? 1 : 2)
+			},
+			disKdk(v){
+				this.hasKdk = !v
 			}
 		},
 		computed: {
@@ -179,12 +182,12 @@
 			storeAccount(){
 				return this.$store.state.vuex_storeAccount
 			},
-			// 禁用抵扣金额
+			// 禁用抵扣金额,选择线上支付时,禁用抵扣金额
 			disKdk(){
 				const kdk = this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
-				return !kdk
+				return !kdk||this.payType==2
 			},
-			// 禁用的支付选项
+			// 禁用的充值支付选项,合计金额大于充值余额禁用
 			disCzOption(){
 				const ta = this.hasKdk&&this.totalAmount?this.totalAmount-this.subsidyAmount:this.totalAmount
 				return ta>this.storeAccount.rechargeBalance
@@ -208,6 +211,12 @@
 			goBack(){
 				uni.navigateBack()
 			},
+			payTypeChange(v){
+				// 线下支付,不可使用抵扣金额
+				if(v==2){
+					this.hasKdk = false
+				}
+			},
 			// 去结算
 			settlement(){
 				if(this.totalAmount>0){
@@ -407,10 +416,10 @@
 						item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
 					})
 				})
-				// 总可抵扣金额有余额支付权限,且总抵扣金额小于等于抵扣余额
-				this.hasKdk = this.subsidyAmount>0&&this.storeAccount&&this.subsidyAmount<=this.storeAccount.giveBalance&&this.showBalanceAuth
 				// 默认支付方式
 				this.payType = this.hasBalancePay ? 0 : (this.hasPay ? 1 : 2)
+				// 总可抵扣金额有余额支付权限,且总抵扣金额小于等于抵扣余额,且支付方式不是线下支付
+				this.hasKdk = this.subsidyAmount>0&&this.storeAccount&&this.subsidyAmount<=this.storeAccount.giveBalance&&this.showBalanceAuth&&this.payType!=2
 			},
 		}
 	}

+ 5 - 2
pagesB/shopiing/productDetail.vue

@@ -323,6 +323,9 @@
 		watch: {
 			disCzOption(v){
 				this.payType = v ? (this.hasPay ? 1 : 2) : 0
+			},
+			disKdk(v){
+				this.hasKdk = !v
 			}
 		},
 		computed: {
@@ -370,7 +373,7 @@
 			// 是否禁用抵扣金额
 			disKdk(){
 				const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
-				return !kdk
+				return !kdk||this.payType==2
 			},
 			// 总金额
 			totalAmount(){
@@ -391,7 +394,7 @@
 			},
 			// 支付合计,结算金额
 			payAmount(){
-				return Number(this.totalAmount-(this.hasKdk&&this.detail&&this.detail.shopProductSubsidy?this.subsidyAmount:0)).toFixed(2)
+				return Number(this.totalAmount-(this.hasKdk&&!this.disKdk&&this.detail&&this.detail.shopProductSubsidy?this.subsidyAmount:0)).toFixed(2)
 			},
 			// 赠品数量
 			giftNum(){

+ 7 - 9
pagesB/transactionRecord/transactionRecord.vue

@@ -28,15 +28,15 @@
 					@click="toDetail(sitem)"
 			      >
 			        <view class="item-left">
-			          <text class="amount-label">{{tabType==0?'充值':'消费'}}</text>
-					  <text class="time" v-if="tabType==0">充值人:{{sitem.operatorName}}</text>
+			          <!-- <text class="amount-label">{{tabType==0?'充值':'消费'}}</text> -->
+					  <text class="time" v-if="tabType==0&&sitem.bizType!='ZERO'">充值人:{{sitem.operatorName}}</text>
 					  <text class="time" v-if="tabType==0">{{sitem.bizType=='ZERO'?'清零时间':'充值时间'}}:{{sitem.tradeDate}}</text>
 					  <text class="time" v-if="tabType==1&&sitem.bizType=='SALES'">{{sitem.finishFlag==1?'支付时间':'采购时间'}}:{{sitem.tradeDate}}</text>
 					  <text class="time" v-if="tabType==1&&sitem.bizType=='REFUND'">退款时间:{{sitem.tradeDate}}</text>
 			        </view>
 					<view class="amount">
-						<text :class="sitem.bizType=='ZERO'?'red':''" v-if="tabType==0">{{sitem.bizType=='ZERO'?'':'+'}}{{sitem.tradeAmount}}</text>
-						<text :class="sitem.bizType=='SALES'?'red':''" v-if="tabType==1">{{sitem.bizType=='SALES'?'':'+'}}{{sitem.tradeAmount}}</text>
+						<text :class="sitem.bizType=='ZERO'?'red':''" v-if="tabType==0">{{sitem.bizType=='ZERO'?'':'+'}}{{Number(sitem.tradeAmount).toFixed(2)}}</text>
+						<text :class="sitem.bizType=='SALES'?'red':''" v-if="tabType==1">{{sitem.bizType=='SALES'?'':'+'}}{{Number(sitem.tradeAmount).toFixed(2)}}</text>
 						<text style="font-size: 10px;margin-left:5px;"> 元</text>
 					</view>
 			      </view>
@@ -68,13 +68,12 @@ export default {
 	  pageSize: 10,
 	  list: [],
 	  total: 0,
-	  tabType:0,
+	  tabType:1,
 	  lastMoth:'',
 	  accountType: ''
     }
   },
   onLoad(opts){
-	this.tabType = opts.type
 	this.accountType = ['RECHARGE','GIVE'][opts.type]
 	uni.setNavigationBarTitle({
 		title: opts.type==0?'充值余额记录':'抵扣余额记录'
@@ -104,7 +103,7 @@ export default {
   methods: {
 	  // 跳转到订单详情页面
 	  toDetail(item){
-		  if(item.bizSn){
+		  if(item.bizSn&&item.bizType=='SALES'){
 			  uni.navigateTo({
 			  	url: "/pagesB/procureOrder/orderDetail?purchaseSn="+item.bizSn
 			  })
@@ -123,7 +122,7 @@ export default {
 		// 0 充值,1 消费
 		const params = {
 			storeSn:this.shelfInfo.storeSn,
-			bizTypeList:this.tabType==0 ? ['RECHARGE'] : ['SALES', 'REFUND'],
+			bizTypeList:this.tabType==0 ? ['RECHARGE','ZERO'] : ['SALES', 'REFUND'],
 			accountType: this.accountType
 		}
 	    xprhStoreAccountFlowPage({pageNo:this.pageNo,pageSize: this.pageSize,...params}).then(res => {
@@ -262,7 +261,6 @@ export default {
   .time {
     font-size: 12px;
     color: #999;
-	margin-top: 5px;
   }
 }
 </style>