浏览代码

页面调整

zhengkaixin 2 年之前
父节点
当前提交
9db7712772

+ 5 - 11
pagesFinance/user/index.vue

@@ -45,7 +45,8 @@
 			<view class="userInfo-main">
 				<h2>{{showNumJP(home.accountBalance)}}元 
 				
-							<view class="withdraw"   v-if="info.status&&(info.accountType!=3&&info.accountType!=1)"  @click="gotoUrl('pagesFinance/user/withdrawRecord')" >
+				 
+							<view class="withdraw"   v-if="info.status&&(info.accountType!=3&&info.accountType!=1)"  @click="gotoUrl('pagesFinance/user/withdrawal/withdrawRecord')" >
 								账户提现
 							</view>
 							
@@ -99,7 +100,7 @@
 					激活充电桩
 				</view>
 			</view>
-			<view class="item"  v-if="isWithdrawal&&info.accountType==2"  @click="gotoUrl('pagesFinance/user/withdrawal/businessList')">
+			<view class="item"  v-if="info.accountType==2"  @click="gotoUrl('pagesFinance/user/withdrawal/businessList')">
 				<view class="item-icon">
 					<img src="../../assets/img/riLine-file-list-3-line.svg" alt="">
 				</view>
@@ -107,14 +108,7 @@
 					收益核算
 				</view>		
 			</view>
-			<view class="item"  v-if="isWithdrawal" @click="gotoUrl('pagesFinance/user/withdrawal/withdrawRecord')">
-				<view class="item-icon">
-					<i data-v-7e5aa06e="" class="ri-todo-line"></i>
-				</view>
-				<view class="item-name">
-					提现记录(test)
-				</view>		
-			</view>
+		
 			
 			<view class="item"  v-if="info.accountType==3"  @click="gotoUrl('pagesFinance/user/withdrawal/cashoutList')">
 				<view class="item-icon"> <!--个人 -->
@@ -124,7 +118,7 @@
 					提现记录
 				</view>		
 			</view>
-			<view class="item" v-else @click="gotoUrl('pagesFinance/user/withdrawRecord')">
+			<view class="item" v-else @click="gotoUrl('pagesFinance/user/withdrawal/withdrawRecord')">
 				<view class="item-icon">
 					<i data-v-7e5aa06e="" class="ri-todo-line"></i>
 				</view>

+ 23 - 7
pagesFinance/user/withdrawal/applicationForWithdrawal.vue

@@ -2,7 +2,7 @@
 	<view>
 		<ujp-navbar title="申请提现"></ujp-navbar>
 		<businessView :onReadyId="id" @changetabs_app="changetabs" ></businessView>
-		<view v-if="tabindex==0&&info.status!=5" >
+		<view v-if="tabindex==0&&(info.status!=5||!userInfo.status)" >
 			
 			<view class="withdraw" v-if="info.applicationType!=3">
 				<view class="withdraw-head ">
@@ -47,7 +47,7 @@
 			</view>
 			
 		</view>
-		<view v-if="tabindex==0&&info.status==5" >
+		<view v-if="tabindex==0&&info.status==5&&userInfo.status" >
 			<view class="withdraw" v-if="info.applicationType!=3" >
 			
 			
@@ -168,17 +168,32 @@
 					value: "0"
 				}],
 				detailList:[],
+				userInfo:{},
 				
 			}
 		},
 
 		onLoad(op){
+			this.userInfo=this.carhelp.getPersonInfo("merchantUser")
+			
 			if(op.id){
 				this.id=op.id
 				this.getInfo()
+				this.uuid=op.uuid;
 			}
 		},computed: {
+			invoiceTypeName() {
+			
+				var info = this.list1.find(item => {
+					console.log(item.value == this.info.invoiceType)
+					return item.value == this.info.invoiceType
+				})
 			
+				if (info) {
+					return info.name
+				}
+				return ''
+			},
 		},
 		watch:{
 			
@@ -188,12 +203,7 @@
 		methods: {
 			submit(){
 				
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
 				
-				this.info.status=0;
 				
 				if(this.info.applicationType==3){
 					
@@ -237,6 +247,12 @@
 						return
 					}
 				}
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				this.info.status=0;
 				//var str=JSON.stringify();
 				API.applyWithdrawByAccounting({
 					

+ 83 - 45
pagesFinance/user/withdrawal/businessInfo.vue

@@ -697,50 +697,7 @@
 			submit(status){
 				this.info.isSecond=(this.isSecond?1:0)
 				 this.info.applicationMonth= this.thismonth
-				if(this.info.applicationType==1){
-					
-					if(this.detailList==null){
-						this.detailList=[];
-					}
-					var key=-1;
-					var obj={};
-					for(var i in this.detailList){
-						var obj=this.detailList[i]
-						
-						if(this.info.withdrawalType==0&&obj.itemName=="提成比例(自动生成)"){
-							key=i;
-						}
-						if(this.info.withdrawalType==1&&obj.itemName=="停车费(自动生成)"){
-							key=i;
-						}
-					}
-					if(this.info.withdrawalType==0){
-						var itemAmount=0;
-						if(this.electricityPriceX&&this.info.rewardProportion){
-							itemAmount=((this.info.chargingProfitAmount+this.info.monthlyCardIncome-this.electricityPriceX)*this.info.rewardProportion/100).toFixed(2);
-						}
-						var itemRemark=""
-						if(this.info.rewardProportion){
-							itemRemark="比例"+this.info.rewardProportion+"%"
-						}
-						obj={
-							itemName:"提成比例(自动生成)",
-							itemRemark:itemRemark,
-							itemAmount:itemAmount,
-						}
-					}else{
-						obj={
-							itemName:"停车费(自动生成)",
-							itemRemark:'',
-							itemAmount:this.info.parkingFee,
-						}
-					}
-					if(key==-1){
-						this.detailList.push(obj)
-					}else{
-						this.detailList[key]=(obj)
-					}
-				}
+				
 				
 				
 				if(status==5){
@@ -887,7 +844,83 @@
 						}
 					}
 					
-			}
+			}
+			if(this.info.applicationType==1){
+				
+				if(this.detailList==null){
+					this.detailList=[];
+				}
+				var key=-1;
+				var obj={};
+				for(var i in this.detailList){
+					var obj=this.detailList[i]
+					
+					if(this.info.withdrawalType==0&&obj.itemName=="提成比例(自动生成)"){
+						key=i;
+					}
+					if(this.info.withdrawalType==1&&obj.itemName=="停车费(自动生成)"){
+						key=i;
+					}
+				}
+				if(this.info.withdrawalType==0){
+					var itemAmount=0;
+					if(this.electricityPriceX&&this.info.rewardProportion){
+						itemAmount=((this.info.chargingProfitAmount+this.info.monthlyCardIncome-this.electricityPriceX)*this.info.rewardProportion/100).toFixed(2);
+					}
+					var itemRemark=""
+					if(this.info.rewardProportion){
+						itemRemark="比例"+this.info.rewardProportion+"%"
+					}
+					obj={
+						itemName:"提成比例(自动生成)",
+						itemRemark:itemRemark,
+						itemAmount:itemAmount,
+					}
+				}else{
+					obj={
+						itemName:"停车费(自动生成)",
+						itemRemark:'',
+						itemAmount:this.info.parkingFee,
+					}
+				}
+				if(key==-1){
+					this.detailList.push(obj)
+				}else{
+					this.detailList[key]=(obj)
+				}
+				
+				
+			}
+			if(status==5){
+				for(var i in this.detailList){
+						var obj=this.detailList[i]
+						
+						if(!obj.itemName){
+							uni.showToast({
+								title: `请填写提现明细中第${parseInt(i)+1}项的项目名称`
+							})
+							return
+						}
+						if(!obj.itemAmount){
+							uni.showToast({
+								title: `请填写提现明细[${obj.itemName}]项目的金额`
+							})
+							return
+						}
+					}
+					if(this.detailList&&this.detailList.length){
+						
+						
+						if(!(this.itemApplicationAmountSum==parseFloat(this.info.applicationAmount))){
+							uni.showToast({
+								title: `[申请提现金额]与[明细金额合计]不相等`
+							})
+							return
+						}
+					}
+					
+			}
+			
 			if(this.info.invoiceRequired!=''){
 				this.info.invoiceRequired=this.info.invoiceRequired=='1'?true:false
 			}
@@ -1012,6 +1045,11 @@
 					this.isReady=true;
 					this.info = res.data.record;
 					this.isSecond=	this.info.isSecond
+					for(var i in  this.stationList){
+						if(this.stationList[i].id==this.info.stationId){
+							this.stationObj = this.stationList[i];
+						}
+					}
 					this.id=this.info.id
 					if(!this.isSecond){
 						this.info.endTime=this.endTime;

+ 2 - 3
pagesFinance/user/withdrawal/businessList.vue

@@ -18,9 +18,8 @@
 						<view class="u-flex">
 							<h4>{{item.applicationTypeText}}</h4>
 							 <span  :class="{
-								 success:item.status==1,
-								  error:item.status==2,
-								   error2:item.status==5
+								 success:['5','0'].indexOf(item.status)>-1,
+								
 							 }">({{item.statusText}})</span>
 							
 						</view>

+ 2 - 2
pagesFinance/user/withdrawal/businessView.vue

@@ -12,12 +12,12 @@
 						<view class="uni-input">{{info.stationName}}</view>
 					</span>
 				</view>
-				<view class="withdraw-head">
+				<!-- <view class="withdraw-head">
 					<b>申请时间</b>
 					<span>
 						<view class="uni-input">{{info.updateTime}}</view>
 					</span>
-				</view>
+				</view> -->
 
 				<view class="withdraw-head">
 					<b>提现事由</b>

+ 1 - 1
pagesFinance/user/withdrawal/withdrawRecord.vue

@@ -18,7 +18,7 @@
 						<view class="u-flex">
 							<h4>{{item.applicationTypeText}}</h4>
 							 <span  :class="{
-								 success:item.status==1,
+								 success:item.status==5,
 								  error:item.status==2,
 								   error2:item.status==0
 							 }">({{item.statusText}})</span>