فهرست منبع

调整 -提现

zhengkaixin 2 سال پیش
والد
کامیت
0fae2b06ab

+ 18 - 0
apis/common.js

@@ -3,6 +3,24 @@ import request from '@/utils/request'
 import Qs from 'qs';
 
 
+export function findByCatalogName(formData) {
+	return request({
+		url: 'mobile/dataDictionary/findByCatalogName',
+		data: formData,
+		method: 'post',
+		
+	})
+}
+
+export function findByCatalogName2(formData) {
+	return request({
+		url: '/mobile/dataDictionary/findByCatalogName',
+		data: formData,
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		
+	})
+}
 export function getBannerInfo(formData) {
 	return request({
 		url: '/mobile/bannerInfo/getBannerInfo',

+ 15 - 0
apis/finance.js

@@ -14,6 +14,8 @@ export function findByOpenId(data) {
 	})
 }
 
+
+
 export function queryWithdrawInfo(data) {
 	var url='/mobile/roleSharing/queryWithdrawInfo';
 	return request({
@@ -48,6 +50,15 @@ export function getVerifyCode(tel) {
 		url: '/mobile/merchantUser/getVerifyCode'
 	})
 } 
+export function getWithdrawInfo(id) {
+	 
+	return request({
+		method: 'get',
+		jp_identity:"merchantUser",// 分润接口
+	
+		url: '/mobile/roleSharing/getWithdrawInfo/'+id
+	})
+} 
 
 
 
@@ -56,6 +67,10 @@ export function applyWithdraw(data) {
 	return request({
 		jp_identity:"merchantUser",// 分润接口
 		method: 'post',
+		header:{
+			'Content-Type':'application/json',
+			'X-Requested-With': 'XMLHttpRequest',
+		},
 		data: data,
 		url: url
 	})

+ 108 - 119
pagesFinance/user/applicationDetails.vue

@@ -9,65 +9,69 @@
 				<view class="withdraw-head">
 					<b>申请站点</b>
 					<span>
-						<view class="uni-input">51充电联盟玉桥充电站</view>
+						<view class="uni-input">{{info.stationName}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head">
 					<b>申请时间</b>
 					<span>
-						<view class="uni-input">2022-08-11 11:08</view>
+						<view class="uni-input">{{info.updateTime}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head">
 					<b>申请人身份</b>
 					<span>
-						<view class="uni-input">投资合伙人</view>
+						<view class="uni-input">{{info.shareProfitRoleName}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head">
 					<b>提现事由</b>
 					<span>
-						<view class="uni-input">物业方结算</view>
+						<view class="uni-input">{{info.applicationTypeText}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head">
 					<b>提现月份</b>
 					<span>
-						<view class="uni-input">2022年7月</view>
+						<view class="uni-input">{{info.applicationMonth}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head">
 					<b>审核进度</b>
 					<span>
-						<view class="uni-input" style="color: #FF7900;">待审核</view>
+						<view class="uni-input"  :class="{
+								 wsuccess:info.status=='1',
+								  werror:info.status=='2',
+								   werror2:info.status=='0'
+							 }" >{{info.statusText}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>充电分成</b>
 					<span>
-						<view class="uni-input">2601.62元</view>
+						<view class="uni-input">{{info.chargingProfitAmount}}元</view>
 					</span>
 				</view>
 			</view>
 
 			<view class="withdraw">
 				<view class="withdraw-head">
-					<b>电价</b>
+					<b>成本电价</b>
 					<span>
-						<view class="uni-input">0.7176元/度</view>
+						<view class="uni-input">{{info.electricityPrice}}元/度</view>
 					</span>
 				</view>
 
 				<view class="withdraw-head ">
 					<b>实际电量</b>
 					<span>
-						<view class="uni-input">3077.26度</view>
+						<view class="uni-input">{{info.electricQuantity}}度</view>
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>电费成本</b>
 					<span>
-						2216.14
+						{{info.electricityCost}}
 
 					</span>
 				</view>
@@ -76,19 +80,19 @@
 				<view class="withdraw-head ">
 					<b>充电分成比例</b>
 					<span>
-						<view class="uni-input">96.2%</view>
+						<view class="uni-input">{{info.chargingPercent}}%</view>
 					</span>
 				</view>
 				<view class="withdraw-head ">
 					<b>充电分成</b>
 					<span>
-						<view class="uni-input">2502.72元</view>
+						<view class="uni-input">{{info.chargingProfitAmount}}元</view>
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>充电服务收益</b>
 					<span>
-						<view class="uni-input">286.59元</view>
+						<view class="uni-input">{{info.chargingServiceProfitAmount}}元</view>
 					</span>
 				</view>
 
@@ -99,14 +103,14 @@
 				<view class="withdraw-head">
 					<b>包月卡分润笔数</b>
 					<span>
-						1
+						{{info.monthlyCardIncome}}
 
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>包月卡收益</b>
 					<span>
-						57.62
+						{{info.monthlyCardTotal}}
 
 					</span>
 				</view>
@@ -118,14 +122,14 @@
 				<view class="withdraw-head">
 					<b>合伙人总收入</b>
 					<span>
-						2560.35
+						{{info.totalIncome}}
 
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>合伙人总收益</b>
 					<span>
-						344.21
+						{{info.totalProfitAmount}}
 
 					</span>
 				</view>
@@ -137,19 +141,21 @@
 				<view class="withdraw-head ">
 					<b>是否开票</b>
 					<span>
-						<view class="uni-input">否</view>
+						<view class="uni-input">{{info.invoiceRequired?'是':''}}</view>
 					</span>
 				</view>
 				<view class="withdraw-head ">
 					<b>发票类型</b>
 					<span>
-						<view class="uni-input">收据</view>
+						<view class="uni-input" v-if="!info.invoiceType">无</view>
+						
+						<view class="uni-input" v-else>{{list1[info.invoiceType].name}}</view>
 					</span>
 				</view>
 <view class="withdraw-head border-n ">
 					<b>发票税率</b>
 					<span>
-						<view class="uni-input">6%</view>
+						<view class="uni-input">{{info.taxRate?info.taxRate+'%':''}}</view>
 					</span>
 				</view>
 
@@ -162,7 +168,7 @@
 				<view class="withdraw-head ">
 					<b class="asterisk">申请提现金额</b>
 					<span>
-						<view class="uni-input">2364.33元</view>
+						<view class="uni-input">{{info.applicationAmount}}元</view>
 					</span>
 
 				</view>
@@ -170,7 +176,7 @@
 					<b>大写金额</b>
 
 					<span>
-						<view class="uni-input">贰仟叁佰陆拾肆元叁角叁分</view>
+						<view class="uni-input">{{applicationAmountDX}}</view>
 					</span>
 
 				</view>
@@ -178,17 +184,17 @@
 			<view class="withdraw">
 				<view class="withdraw-head ">
 					<b class="asterisk">提现人收款户名</b>
-					<p class="infos">荆州市龙荣游乐管理有限公司</p>
+					<p class="infos">{{info.accountName}}</p>
 
 				</view>
 				<view class="withdraw-head ">
 					<b class="asterisk">提现人收款银行</b>
-					<p class="infos">湖北银行股份有限公司荆州集联支行</p>
+					<p class="infos">{{info.bankName}}</p>
 
 				</view>
 				<view class="withdraw-head border-n">
 					<b class="asterisk">提现人收款账号</b>
-					<p class="infos">130210120100010621</p>
+					<p class="infos">{{info.accountNo}}</p>
 				</view>
 
 			</view>
@@ -197,111 +203,57 @@
 
 
 		<template v-if="current==1">
-			<view class="details margin">
-				
-					<p>电费</p>
-					
-				<view class="withdraw">
-					<view class="withdraw-head ">
-						<b class="asterisk">金额</b>
-						<span >
-							<view class="uni-input">2364.33元</view>
-						</span>
-					
-					</view>
-					<view class="withdraw-head ">
-						<b class="asterisk">备注</b>
-						<span>
-							<view class="uni-input">无</view>
-						</span>
+			<view class="margin">
+				<view class="details "  v-for="(item,i) in detailList" :key="i">
 					
+						<p>{{item.itemName}}</p>
+						
+					<view class="withdraw"  >
+						<view class="withdraw-head ">
+							<b class="asterisk">金额</b>
+							<span >
+								<view class="uni-input">{{item.itemAmount}}元</view>
+							</span>
+						
+						</view>
+						<view class="withdraw-head ">
+							<b class="asterisk">备注</b>
+							<span>
+								<view class="uni-input">{{item.itemRemark?item.itemRemark:'无'}}</view>
+							</span>
+						
+						</view>
+						
 					</view>
-					
-				</view>
-
-			</view>
-			
-			<view class="details">
 				
-					<p>服务费分润</p>
-					
-				<view class="withdraw">
-					<view class="withdraw-head ">
-						<b class="asterisk">金额</b>
-						<span>
-							<view class="uni-input">44.33元</view>
-						</span>
-					
-					</view>
-					<view class="withdraw-head ">
-						<b class="asterisk">备注</b>
-						<span>
-							<view class="uni-input">无</view>
-						</span>
-					
-					</view>
-					
 				</view>
-			
 			</view>
-			<view class="details">
-				
-					<p>待停车收费</p>
-					
-				<view class="withdraw">
-					<view class="withdraw-head ">
-						<b class="asterisk">金额</b>
-						<span>
-							<view class="uni-input">434元</view>
-						</span>
-					
-					</view>
-					<view class="withdraw-head ">
-						<b class="asterisk">备注</b>
-						<span>
-							<view class="uni-input">无</view>
-						</span>
-					
-					</view>
-					
-				</view>
 			
-			</view>
-			<view class="details">
-				
-					<p>扣玉桥停车系统服务费</p>
-					
-				<view class="withdraw">
-					<view class="withdraw-head ">
-						<b class="asterisk">金额</b>
-						<span>
-							<view class="uni-input">-328.8元</view>
-						</span>
-					
-					</view>
-					<view class="withdraw-head ">
-						<b class="asterisk">备注</b>
-						<span>
-							<view class="uni-input">停车费10%</view>
-						</span>
-					
-					</view>
-					
-				</view>
 			
-			</view>
+			
 		</template>
 
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	import {
+	
+		DX
+	} from '@/utils'
 	export default {
 		data() {
 			return {
 				isPt: false,
-				info: {},
-
+			id:'',
+				detailList:[],
+				info: {
+					electricityPrice: '',
+					electricQuantity: '',
+					stationId: "",
+					applicationType: '1'
+				},
 				stationList: [],
 				stationObj: {},
 				current: 0, // tabs组件的current值,表示当前活动的tab选项
@@ -312,6 +264,9 @@
 				}, {
 					name: '专票',
 					value: "2"
+				}, {
+					name: '收据',
+					value: "3"
 				}],
 				list2: [{
 					name: '是',
@@ -330,9 +285,39 @@
 			}
 		},
 
-
+		onLoad(op){
+			if(op.id){
+				this.id=op.id
+				this.getInfo()
+			}
+		},computed: {
+			applicationAmountDX() {
+				if (this.info.applicationAmount) {
+					var c = DX(this.info.applicationAmount)
+					return c
+				} else {
+					return ''
+				}
+			},
+		},
 		methods: {
-
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.getWithdrawInfo(this.id).then((res) => {
+					
+					this.info=res.data.record
+					this.detailList=res.data.detailList
+					uni.hideLoading()
+				
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
 			change(index) {
 				this.current = index;
 			}
@@ -377,12 +362,16 @@
 		padding: 0px 16px 0 16px;
          
 		.withdraw-head {
-			padding: 16px 0;
-			border-bottom: 1px solid #E5E7E;
+			padding: 14px 0;
+			border-bottom: 1px solid #F2F2F2;
 
 			align-items: center;
 			position: relative;
-
+			
+			.wsuccess{color:#27b148 !important}
+			.werror{color:#FF6200 !important;}
+			.werror2{color:#1ba7f4 !important;}
+			
 			.unit {
 				position: absolute;
 				top: 34rpx;

+ 391 - 284
pagesFinance/user/applicationForWithdrawal.vue

@@ -30,7 +30,7 @@
 					<b class="asterisk"><text>*</text>提现事由</b>
 					<span>
 						<picker @change="bindPickerChange2" range-key="name" :range="applicationList">
-							<view class="uni-input">{{applicationList[info.applicationType].name}}<text
+							<view class="uni-input">{{info.applicationTypeText}}<text
 									class="iconfont more">
 									&#xe600;
 								</text></view>
@@ -51,10 +51,10 @@
 					</span>
 				</view>
 				<view class="withdraw-head ">
-					<b>充电分成</b><span>2601.62元</span>
+					<b>充电收入</b><span class="classFFF">{{info.chargingIncome}}元</span>
 				</view>
 				<view class="withdraw-head border-n">
-					<b>分润提现明细表</b><span class="download">
+					<b>分润提现明细表</b><span class="download"  @click="ckdownload" >
 						<u-icon name="download"></u-icon> 下载
 					</span>
 				</view>
@@ -62,10 +62,12 @@
 
 			<view class="withdraw">
 				<view class="withdraw-head">
-					<b class="asterisk"><text>*</text>电价</b>
+					<b class="asterisk"><text>*</text>成本电价</b>
 					<text class="unit" style="float: right;font-size: 16px;">元/度</text>
 					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" v-model="info.electricityPrice" placeholder="请填写价格" input-align="left"
+						<u-input height="20px" v-model="info.electricityPrice" 
+						maxlength="10"
+						placeholder="请填写电单价" input-align="left"
 							type="digit">
 
 						</u-input>
@@ -77,9 +79,9 @@
 				<view class="withdraw-head">
 					<b class="asterisk">预估电量</b>
 
-					<span class="withdraw-input" style="width: 63%;">
+					<span class="withdraw-input classFFF" style="width: 63%;">
 
-						3000.000
+						{{info.estimateElectricQuantity}}
 
 					</span>
 
@@ -88,7 +90,9 @@
 					<b class="asterisk"><text>*</text>实际电量</b>
 					<text class="unit" style="float: right;font-size: 16px;">度</text>
 					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" placeholder="请填写度数" v-model="info.electricQuantity" input-align="left"
+						<u-input height="20px" placeholder="请填写实际电量"
+						 maxlength="10"
+						 v-model="info.electricQuantity" input-align="left"
 							type="digit">
 
 						</u-input>
@@ -101,7 +105,7 @@
 					<b>电费成本</b>
 					<text class="unit" style="float: right;font-size: 16px;">元</text>
 					<span class="withdraw-input" style="width: 63%;">
-						<view v-show="electricityPriceX">{{electricityPriceX}}</view>
+						<view class="classFFF" v-show="electricityPriceX">{{electricityPriceX}}</view>
 						<view class="classFFF" v-show="!electricityPriceX">自动计算出结果</view>
 
 
@@ -115,22 +119,25 @@
 
 				<view class="withdraw-head">
 					<b>充电分成比例</b>
-					<span>
-						96.2%
+					<span  class="classFFF" >
+						{{info.chargingPercent}}%
 
 					</span>
 				</view>
 				<view class="withdraw-head">
 					<b>充电分成</b>
-					<span>
-						2502.72
+					<span  class="classFFF" >
+						{{info.chargingProfitAmount}}
 
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>充电服务收益</b>
 					<span>
-						286.59元
+						
+						<view class="classFFF" v-show="electricityPriceX">{{(info.chargingProfitAmount-electricityPriceX).toFixed(2)}}元</view>
+						<view class="classFFF" v-show="!electricityPriceX">自动计算出结果</view>
+						
 					</span>
 				</view>
 
@@ -139,15 +146,15 @@
 
 				<view class="withdraw-head">
 					<b>包月卡分润笔数</b>
-					<span>
-						1
+					<span  class="classFFF"  >
+						{{info.monthlyCardIncome}}
 
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>包月卡收益</b>
-					<span>
-						57.62
+					<span  class="classFFF" >
+						{{info.monthlyCardTotal}}
 
 					</span>
 				</view>
@@ -160,15 +167,15 @@
 
 				<view class="withdraw-head">
 					<b>合伙人总收入</b>
-					<span>
-						2560.35
+					<span  class="classFFF" >
+						{{info.totalIncome}}
 
 					</span>
 				</view>
 				<view class="withdraw-head border-n">
 					<b>合伙人总收益</b>
-					<span>
-						344.21
+					<span  class="classFFF" >
+						{{info.totalProfitAmount}}
 
 					</span>
 				</view>
@@ -179,10 +186,10 @@
 
 				<view class="withdraw-head">
 					<b>是否开票</b><span>
-						<u-radio-group>
+						<u-radio-group  v-model="info.invoiceRequired">
 
 							<u-radio v-for="(item, index) in list2" style="margin-right: 16px;" :key="index+'a'"
-								:name="item.value" :disabled="item.disabled" active-color="blue">
+								:name="item.value"  active-color="blue">
 
 								{{item.name}}
 
@@ -192,8 +199,10 @@
 					</span>
 				</view>
 				<view class="withdraw-head">
-					<b>发票类型</b><span>
-						<u-radio-group>
+					<b v-if="info.invoiceRequired!='1'">发票类型</b>
+					<b v-else class="asterisk"><text>*</text>发票类型</b>
+					<span>
+						<u-radio-group  v-model="info.invoiceType" >
 
 							<u-radio v-for="(item, index) in list1" :key="index+'a'" :name="item.value"
 								:disabled="item.disabled" active-color="blue">
@@ -205,11 +214,17 @@
 						</u-radio-group>
 					</span>
 				</view>
-				<view class="withdraw-head border-n">
-					<b class="asterisk"><text>*</text>发票税率</b>
+				<view class="withdraw-head border-n">
+					<b v-if="info.invoiceRequired!='1'">发票税率</b>
+					<b v-else class="asterisk"><text>*</text>发票税率</b>
+					
+				
 					<text style="float: right;font-size: 16px;">%</text>
 					<span class="withdraw-input" style="width: 58%;">
-						<u-input height="20px" placeholder="请输入开票税率" input-align="left" type="digit">
+						<u-input height="20px"  v-model="info.taxRate"
+						placeholder="请输入开票税率" input-align="left"
+						 maxlength="10"
+						 type="digit">
 						</u-input>
 					</span>
 
@@ -221,7 +236,7 @@
 					<b class="asterisk"><text>*</text>申请提现金额</b>
 					<text class="unit" style="float: right;font-size: 16px;">元</text>
 					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" v-model="info.applicationAmount" placeholder="请填写金额" input-align="left"
+						<u-input height="20px" v-model="info.applicationAmount" maxlength="10" placeholder="请填写金额" input-align="left"
 							type="digit">
 
 						</u-input>
@@ -235,244 +250,37 @@
 
 					<span class="withdraw-input" style="width: 63%;">
 
-						<view v-show="applicationAmountDX">{{applicationAmountDX}}</view>
+						<view  class="classFFF" v-show="applicationAmountDX">{{applicationAmountDX}}</view>
 						<view class="classFFF" v-show="!applicationAmountDX">自动转换</view>
 
 
 
 					</span>
-				</view>
-				<view class="withdraw-head">
-					<b class="asterisk"><text>*</text>提现事由</b>
-					<span>
-						<picker>
-							<view class="uni-input">物业方结算<text class="iconfont more">
-									&#xe600;
-								</text></view>
-						</picker>
-
-					</span>
-				</view>
-				<view class="withdraw-head">
-					<b class="asterisk"><text>*</text>提现月份</b>
-					<span>
-						<picker>
-							<view class="uni-input">2022年7月<text class="iconfont more">
-									&#xe600;
-								</text></view>
-						</picker>
-
-					</span>
-				</view>
-				<view class="withdraw-head ">
-					<b>充电分成</b><span>2601.62元</span>
-				</view>
-				<view class="withdraw-head border-n">
-					<b>分润提现明细表</b><span class="download">
-						<u-icon name="download"></u-icon> 下载
-					</span>
-				</view>
-			</view>
-
-			<view class="withdraw">
-				<view class="withdraw-head">
-					<b class="asterisk"><text>*</text>电单价</b>
-					<text class="unit" style="float: right;font-size: 16px;">元/度</text>
-					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" placeholder="请填写价格" input-align="left" type="digit">
-
-						</u-input>
-
-
-					</span>
-
-				</view>
-				<view class="withdraw-head">
-					<b class="asterisk">预估电量</b>
-
-					<span class="withdraw-input" style="width: 63%;">
-
-						3000.000度
-
-					</span>
-
-				</view>
-				<view class="withdraw-head">
-					<b class="asterisk"><text>*</text>实际电量</b>
-					<text class="unit" style="float: right;font-size: 16px;">度</text>
-					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" placeholder="请填写度数" input-align="left" type="digit">
-
-						</u-input>
-
-
-					</span>
-
-				</view>
-				<view class="withdraw-head border-n">
-					<b>电费成本</b>
-					<text class="unit" style="float: right;font-size: 16px;"></text>
-					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" placeholder="自动计算出结果" input-align="left" type="digit">
-
-						</u-input>
-
-
-					</span>
-
-				</view>
-
-			</view>
-			<view class="withdraw">
-
-				<view class="withdraw-head">
-					<b>充电分成比例</b>
-					<span>
-						96.2%
-
-					</span>
-				</view>
-				<view class="withdraw-head">
-					<b>充电分成</b>
-					<span>
-						2502.72元
-
-					</span>
-				</view>
-				<view class="withdraw-head border-n">
-					<b>充电服务收益</b>
-					<span>
-						286.59元
-					</span>
-				</view>
-
-			</view>
-			<view class="withdraw">
-
-				<view class="withdraw-head">
-					<b>包月卡分润笔数</b>
-					<span>
-						1笔
-
-					</span>
-				</view>
-				<view class="withdraw-head border-n">
-					<b>包月卡收益</b>
-					<span>
-						57.62元
-
-					</span>
-				</view>
-
-			</view>
-
-
-
-			<view class="withdraw">
-
-				<view class="withdraw-head">
-					<b>合伙人总收入</b>
-					<span>
-						2560.35元
-
-					</span>
-				</view>
-				<view class="withdraw-head border-n">
-					<b>合伙人总收益</b>
-					<span>
-						344.21元
-
-					</span>
-				</view>
-
-			</view>
-			<view class="withdraw">
-
-
-				<view class="withdraw-head">
-					<b>是否开票</b><span>
-						<u-radio-group>
-
-							<u-radio v-for="(item, index) in list2" style="margin-right: 16px;" :key="index+'a'"
-								:name="item.value" :disabled="item.disabled" active-color="blue">
-
-								{{item.name}}
-
-							</u-radio>
-
-						</u-radio-group>
-					</span>
-				</view>
-				<view class="withdraw-head">
-					<b>发票类型</b><span>
-						<u-radio-group>
-
-							<u-radio v-for="(item, index) in list1" :key="index+'a'" :name="item.value"
-								:disabled="item.disabled" active-color="blue">
-
-								{{item.name}}
-
-							</u-radio>
-
-						</u-radio-group>
-					</span>
-				</view>
-
-
-				<view class="withdraw-head border-n">
-					<b class="asterisk"><text>*</text>发票税率</b>
-					<text style="float: right;font-size: 16px;">%</text>
-					<span class="withdraw-input" style="width: 58%;">
-						<u-input height="20px" placeholder="请输入开票税率" input-align="left" type="digit">
-
-						</u-input>
-
-
-					</span>
-
-				</view>
-
+				</view>
+				
+			
 			</view>
-			<view class="withdraw">
-				<view class="withdraw-head ">
-					<b class="asterisk"><text>*</text>申请提现金额</b>
-					<text class="unit" style="float: right;font-size: 16px;">元</text>
-					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" placeholder="请填写金额" input-align="left" type="digit">
 
-						</u-input>
-
-
-					</span>
-
-				</view>
-				<view class="withdraw-head border-n">
-					<b>大写金额</b>
-
-					<span class="withdraw-input" style="width: 63%;">
-						<u-input height="20px" placeholder="自动转换" input-align="left" type="digit">
-
-						</u-input>
-
-
-					</span>
-
-				</view>
-			</view>
+		
 			<view class="withdraw">
 				<view class="withdraw-head ">
 					<b class="asterisk"><text>*</text>提现人收款户名</b>
-					<u-input class="textarea" type="textarea" placeholder="请填写收款户名" height="96" cursor-spacing="8" />
+					<u-input class="textarea" type="textarea" 
+					v-model="info.accountName"
+					placeholder="请填写收款户名" height="96" cursor-spacing="8" />
 
 				</view>
 				<view class="withdraw-head ">
 					<b class="asterisk"><text>*</text>提现人收款银行</b>
-					<u-input class="textarea" type="textarea" placeholder="请填写收款银行全称" height="96" cursor-spacing="8" />
+					<u-input class="textarea" type="textarea"
+					v-model="info.bankName"
+					 placeholder="请填写收款银行全称" height="96" cursor-spacing="8" />
 
 				</view>
 				<view class="withdraw-head border-n">
 					<b class="asterisk"><text>*</text>提现人收款账号</b>
-					<u-input class="textarea" type="textarea" placeholder="提现人收款账号" height="96" cursor-spacing="8" />
+					<u-input class="textarea" v-model="info.accountNo"
+					type="textarea" placeholder="提现人收款账号" height="96" cursor-spacing="8" />
 
 				</view>
 
@@ -481,16 +289,24 @@
 		</template>
 
 
-		<template v-if="current==1">
-			<view class="details">
+		<template v-if="current==1">
+			<view class="details withdrawHead" v-if="detailList.length&&info.applicationAmount">
+				申请提现金额:{{info.applicationAmount}}元<br/>
+				明细金额合计:<span :class="{
+					red:itemApplicationAmountSum>info.applicationAmount
+				}">{{itemApplicationAmountSum}}元</span>
+			</view>
+			<view class="details" v-for="(item,i) in detailList" :key="i" >
 				<view class="withdraw">
 					<view class="withdraw-head">
 						<b class="asterisk"><text>*</text>项目</b>
-						<text class="unit" style="float: right;font-size: 16px;">
+						<text class="unit" style="float: right;font-size: 16px;z-index: 99;"  @click="delItem(i)">
 							<i class="ri-indeterminate-circle-fill" style="color: red;font-size: 24px;"></i>
 						</text>
 						<span class="withdraw-input" style="width: 80%;">
-							<u-input height="20px" placeholder="请填写项目名称" input-align="left" type="digit">
+							<u-input height="20px" 
+							v-model="item.itemName"
+							placeholder="请填写项目名称" input-align="left" >
 
 							</u-input>
 
@@ -502,7 +318,11 @@
 						<b class="asterisk"><text>*</text>金额</b>
 						<text class="unit" style="float: right;font-size: 16px;">元</text>
 						<span class="withdraw-input" style="width: 80%;">
-							<u-input height="20px" placeholder="请填写价格" input-align="left" type="digit">
+							<u-input height="20px"
+							 v-model="item.itemAmount"
+							 placeholder="请填写价格"
+							  maxlength="10"
+							  input-align="left" type="digit">
 
 							</u-input>
 
@@ -514,7 +334,9 @@
 						<b>备注</b>
 
 						<span class="withdraw-input" style="width: 80%;">
-							<u-input height="20px" placeholder="请填写备注信息" input-align="left" type="digit">
+							<u-input height="20px"
+							 v-model="item.itemRemark"
+							 placeholder="请填写备注信息" input-align="left">
 
 							</u-input>
 
@@ -525,18 +347,20 @@
 				</view>
 
 			</view>
-			<view class="add"><i class="ri-add-circle-fill"></i><text>增加项目</text></view>
+			<view class="add" @click="addItem" ><i class="ri-add-circle-fill"></i><text>增加项目</text></view>
 		</template>
 		<view class="applyBtn">
-			<u-button class="save">保存草稿</u-button>
-			<u-button class="submit">提交申请单</u-button>
+			<u-button class="save" @click="submit(-1)">保存草稿</u-button>
+			<u-button class="submit" @click="submit(0)">提交申请单</u-button>
 		</view>
 	</view>
 </template>
 
 
 <script>
-	import * as API from '@/apis/finance.js'
+	import * as API from '@/apis/finance.js'
+	import * as API_common from '@/apis/common.js'
+	
 
 	import {
 		beforeTimeStamp,
@@ -546,8 +370,10 @@
 	} from '@/utils'
 	export default {
 		data() {
-			return {
-				isPt: false,
+			return {
+				id:'',
+				isPt: false,
+				detailList:[],
 				info: {
 					electricityPrice: '',
 					electricQuantity: '',
@@ -603,11 +429,15 @@
 				}, {
 					name: '提现明细'
 				}],
-
-
+				startTime:'',
+				endTime:'',
 			}
 		},
-
+		onLoad(op){
+			if(op.id){
+				this.id=op.id
+			}
+		},
 		onShow() {
 
 
@@ -619,7 +449,28 @@
 
 			this.getStationList()
 		},
-		computed: {
+		computed: {
+			itemApplicationAmountSum(){
+				if (this.info.applicationAmount&&this.detailList&&this.detailList.length) {
+					var applicationAmount=0;
+					for(var i in this.detailList){
+						var obj=this.detailList[i]
+						var itemAmount=obj.itemAmount?obj.itemAmount:0
+						applicationAmount+=parseFloat(itemAmount)
+					}
+					console.log(applicationAmount)
+					if(applicationAmount){
+						return applicationAmount
+					}else {
+						return '0'
+					}
+					
+					
+				}else{
+					return '0'
+				}
+				
+			},
 			applicationAmountDX() {
 				if (this.info.applicationAmount) {
 					var c = DX(this.info.applicationAmount)
@@ -635,7 +486,196 @@
 				return ''
 			}
 		},
-		methods: {
+		methods: {
+			addItem(){
+				this.detailList.push({})
+			},
+			delItem(i){
+				
+				this.detailList.splice(i,1)
+			},
+			submit(status){
+				if(status==0){
+					
+				//this.value=this.info.amount
+				if(!this.stationObj.id){
+						uni.showToast({
+							title: "请选择站点"
+						})
+				
+					return
+				}
+				if(!this.info.electricityPrice){
+						uni.showToast({
+							title: "请输入成本电价"
+						})
+				
+					return
+				}
+					
+					if(!this.info.electricQuantity){
+							uni.showToast({
+								title: "请输入实际电量"
+							})
+					
+						return
+					}
+					
+					if(this.info.invoiceRequired=="1"){
+						if(!this.info.invoiceType){
+								uni.showToast({
+									title: "请选择发票类型"
+								})
+						
+							return
+						}
+						if(!this.info.taxRate){
+								uni.showToast({
+									title: "请选择发票税率"
+								})
+						
+							return
+						}
+					}
+					
+					if(!this.info.applicationAmount){
+							uni.showToast({
+								title: "请输入申请提现金额"
+							})
+						return
+					}
+					
+					if(!this.info.accountName){
+							uni.showToast({
+								title: "请输入提现人收款户名"
+							})
+						return
+					}
+					if(!this.info.bankName){
+							uni.showToast({
+								title: "请输入提现人收款银行"
+							})
+						return
+					}
+					if(!this.info.accountNo){
+							uni.showToast({
+								title: "请输入提现人收款账号"
+							})
+						return
+					}
+					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==this.info.applicationAmount)){
+							uni.showToast({
+								title: `[申请提现金额]与[明细金额合计]不相等`
+							})
+							return
+						}
+					}
+					
+			}
+			if(this.info.invoiceRequired!=''){
+				this.info.invoiceRequired=this.info.invoiceRequired=='1'?true:false
+			}
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if(this.id){
+					this.info.id=this.id;
+				}
+				this.info.status=status;
+				
+				//var str=JSON.stringify();
+				API.applyWithdraw({
+					
+					record:this.info,
+					detailList:this.detailList
+				
+				}).then((res) => {
+					
+					this.id=res.data;
+					uni.hideLoading()
+					if(status==-1){
+						uni.showModal({
+							title:"提示",
+							content:"保存成功",
+							showCancel:false
+						})
+					}else{
+						uni.redirectTo({
+							url:"/pagesFinance/user/applyResult?value="+this.info.applicationAmount
+						})
+					}
+						
+					
+				}).catch(error => {
+					uni.hideLoading()
+					uni.showModal({
+						title:"提示",
+						content:error,
+						showCancel:false
+					})
+				})
+			},
+			 
+			ckdownload(){
+				//this.value=this.info.amount
+				if(!this.stationObj.id){
+						uni.showToast({
+							title: "请选择站点"
+						})
+				
+					return
+				}
+				
+				API.profitDetailsExcel({
+					stationId:this.stationObj.id,
+					yearMonth:this.queryTime,
+				
+				}).then((resDown) => {
+					// uni.downloadFile({
+					// 	url: resDown.data, //仅为示例,并非真实的资源
+					// 	success: (res) => {
+					// 		if (res.statusCode === 200) {
+					// 			console.log('下载成功');
+					// 		}
+					// 	}
+					// });
+					if(resDown.data){
+						window.location.href=resDown.data
+						
+					}else{
+						uni.showToast({
+							title:"无文件下载"
+						})
+					}
+				}).catch(error => {
+					
+					uni.showToast({
+						title:error
+					})
+				})
+				
+			},
+			
 			showTime(name) {
 				if (!name) {
 					return ''
@@ -644,17 +684,36 @@
 			},
 
 			queryWithdrawInfo() {
-				return;
+				 
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
-				})
+				})
+				
 				API.queryWithdrawInfo({
 					stationId: this.stationObj.id,
-					endTime: this.endTime
+					yearMonth: this.queryTime,
+					applicationType: this.info.applicationType
 				}).then((res) => {
-					this.info = res.data;
-					this.isPt = res.data.isPt;
+					this.info = res.data.record;
+					var detailList = res.data.detailList;
+					this.detailList=[];
+					
+					if(detailList==null){
+						detailList=[];
+					}
+					for(var i in detailList){
+						if(this.id){
+							this.detailList.push(detailList[i])
+						}else{
+							this.detailList.push({
+								itemName:detailList[i].itemName,
+								itemRemark:detailList[i].itemRemark,
+								itemAmount:'',
+							})
+						}
+					}
+					
 					uni.hideLoading()
 
 				}).catch(error => {
@@ -662,18 +721,61 @@
 						title: error
 					})
 				})
+			},
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.getWithdrawInfo(this.id).then((res) => {
+					
+					this.info=res.data.record
+					this.detailList=res.data.detailList
+					uni.hideLoading()
+				
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
 			},
 			getStationList() {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
-				})
-				API.stationList().then((res) => {
-					this.stationList = res.data.stationList;
-					if (this.stationList.length) {
-						this.stationObj = this.stationList[0];
-						this.queryWithdrawInfo()
-					}
+				})
+				API.stationList().then((res) => {
+					this.stationList = res.data.stationList;
+					
+						if (this.stationList.length) {
+							this.stationObj = this.stationList[0];
+							if(this.id){
+									this.getInfo()
+							}else{
+									this.queryWithdrawInfo()
+							}
+						
+						}
+					
+					
+					uni.hideLoading()
+				
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
+				API_common.findByCatalogName2({
+					catalogName:"提现类型"
+				}).then((res) => {
+					this.applicationList= res.data.dataDictionaryList;
+					// this.applicationList =dataDictionaryList.map((item)=>{
+					// 	return {
+					// 		name:item.name,
+					// 		value:item.value
+					// 	}
+					// })
 					uni.hideLoading()
 
 				}).catch(error => {
@@ -690,8 +792,7 @@
 				}
 			},
 			bindPickerChange2(e) {
-
-				this.info.applicationType = e.detail.value;
+				this.info.applicationType = this.applicationList[e.detail.value].value;
 				this.queryWithdrawInfo()
 			},
 			bindPickerChange3(e) {
@@ -724,7 +825,7 @@
 	}
 
 	.classFFF {
-		color: #a1a1a1;
+		color: #607d8b  !important;
 	}
 
 	.download {
@@ -756,7 +857,7 @@
 
 
 	}
-
+	
 	.withdraw {
 		margin-bottom: 8px;
 		background-color: #fff;
@@ -899,7 +1000,13 @@
 
 		}
 	}
-
+	.withdrawHead{
+		padding: 15px;
+		font-size: 14px;
+		.red{
+			color: red;
+		}
+	}
 	.details {
 		margin: 16px;
 		border-radius: 8px;

+ 1 - 1
pagesFinance/user/index.vue

@@ -31,7 +31,7 @@
 			<view class="userInfo-head"><p>可提现金额</p></view>
 			<view class="userInfo-main">
 				<h2>{{home.accountBalance.toFixed(2)}}元
-				<view class="withdraw"  v-if="info.status" @click="gotoUrl('pagesFinance/user/applicationForWithdrawal')" >
+				<view class="withdraw"  v-if="info.status" @click="gotoUrl('pagesFinance/user/withdrawRecord')" >
 					账户提现
 				</view>
 				</h2>

+ 43 - 15
pagesFinance/user/withdrawRecord.vue

@@ -10,22 +10,26 @@
 			:key="index" 
 			v-for="(item ,index) in list" >
 				<view class="detailed-time"  v-if="item.show">
-					<p>{{item.showtime}}</p>
+					<p>{{showTime(item.showtime)}}</p>
 					<p>共提现 {{showMap.get(item.showtime).toFixed(2)}}元</p>
 				</view>
-				<view class="detailed-item"  @click="gotoUrl('pagesFinance/user/applicationForWithdrawal?id='+item.id)" >
+				<view class="detailed-item"  @click="gotoItem(item)" >
 					<view class="detailed-item-name">
 						<view class="u-flex">
-							<h4>提现</h4>
-							 <span v-if="item.status==1" class="success">(提现成功)</span>
-							 <span v-if="item.status==0" class="error" >(待转账)</span>
-						<span v-if="item.status==2" >(已驳回)</span>
-						
+							<h4>{{item.applicationTypeText}}</h4>
+							 <span  :class="{
+								 success:item.status==1,
+								  error:item.status==2,
+								   error2:item.status==0
+							 }">({{item.statusText}})</span>
+							
 						</view>
-						<p>{{item.createTime}}</p>
+						<p>{{item.stationName}}</p>
 					</view>
 					<view class="detailed-item-num">
 						<h2>{{item.applicationAmount.toFixed(2)}}元</h2>
+						
+						<p>{{showTime2(info.createTime)}}</p>
 					</view>
 				</view>
 			
@@ -71,6 +75,25 @@
 			}
 		},
 		methods: {
+			showTime(name){
+				if(!name){
+					return ''
+				}
+				return name.replace('-','年')+'月';
+			},
+			showTime2(name){
+				if(!name){
+					return ''
+				}
+				return name.substring(5);
+			},
+			gotoItem(item){
+				if(item.status=='-1'){
+					this.gotoUrl('pagesFinance/user/applicationForWithdrawal?id='+item.id)
+				}else{
+					this.gotoUrl('pagesFinance/user/applicationDetails?id='+item.id)
+				}
+			},
 			getList() {
 			
 				uni.showLoading({
@@ -90,13 +113,14 @@
 					
 					var showMap=new Map()
 					this.list.forEach(item=>{
-						var ktime=item.createTime.split(" ")[0]
+						var ktime=item.applicationMonth;
+						
 						if(showMap.has(ktime)){
 							item.show=false;
-							var m=showMap.get(ktime)*100+item.applicationAmount*100;
-							showMap.set(ktime,m/100)
+							// var m=showMap.get(ktime)*100+item.applicationAmount*100;
+							// showMap.set(ktime,m/100)
 						}else{
-							showMap.set(ktime,item.applicationAmount)
+							showMap.set(ktime,item.totalApplicationAmount)
 							
 							item.show=true;
 							item.showtime=ktime;
@@ -139,25 +163,29 @@
 		padding: 10px 20px;
 		border-bottom: 1px solid #ededed;
 		.detailed-item-name{
+			font-size: 14px;
 			h4{
+				
 				font-weight: normal;
 			}
 			p{
 				font-size: 12px;
 				margin-top: 4px;
-				color:#A2A9B5;
+				color:#666;
 			}
 			span{
 				margin-left: 10px;
 			}
 			.success{color:#27b148}
 			.error{color:#FF6200;}
+			.error2{color:#1ba7f4;}
 		}
 		.detailed-item-num{
-			display: flex;
+			text-align: right;
 			align-items: center;
 			h2{
-				margin-right: 4px;
+				
+				
 			}
 		}
 	}