Bläddra i källkod

按时间选择, 完善

zhengkaixin 10 månader sedan
förälder
incheckning
72ff92893d

+ 2 - 0
apis/invoiceApi.js

@@ -36,6 +36,7 @@ export function invoiceTypeDetail(data) {
 	return request({
 		method: 'post',
 		 		data: data,
+				timeout: 60000,
 		url: '/mobile/merchantInvoice/invoiceTypeDetail'
 	})
 }
@@ -52,6 +53,7 @@ export function saveInvoice(data) {
 	return request({
 		method: 'post',
 		 		data: data,
+				timeout: 60000,
 		url: '/mobile/merchantInvoice/saveInvoice'
 	})
 }

+ 2 - 2
components/u-double-picker.vue

@@ -160,7 +160,7 @@ export default {
 			type: String,
 			default: ''
 		},
-		defaultTime2: {
+		defaultTimeB: {
 			type: String,
 			default: ''
 		},
@@ -335,7 +335,7 @@ export default {
 		initTimeValue() {
 			// 格式化时间,在IE浏览器(uni不存在此情况),无法识别日期间的"-"间隔符号
 			let fdate = this.defaultTime.replace(/\-/g, '/');
-			let fdate2 = this.defaultTime2.replace(/\-/g, '/');
+			let fdate2 = this.defaultTimeB.replace(/\-/g, '/');
 			 
 			fdate2 = fdate2 && fdate2.indexOf('/') == -1 ? `2020/01/01 ${fdate2}` : fdate2;
 			fdate = fdate && fdate.indexOf('/') == -1 ? `2020/01/01 ${fdate}` : fdate;

+ 196 - 27
pagesFinance/MyInvoice/invoiceManagement.vue

@@ -3,7 +3,45 @@
 		<ujp-navbar title="我的发票">
 			<text class="management" @click="gotoUrl('pagesFinance/MyInvoice/invoiceTitleManagement')">抬头管理</text>
 		</ujp-navbar>
-	
+	
+<!-- 弹窗 -->
+		<view class="modal">
+
+			<u-modal v-model="showTime"  title="按时间开票" @confirm="confirmmodal"
+				:show-cancel-button="true" confirm-text="去开票" cancel-text="取消">
+				<u-picker v-model="showTimePicker"
+				 @confirm="confirmTimePicker"
+				 mode="time" :params="params" ></u-picker>
+				
+				<view class="infos">
+					
+					<view class="item">
+						<view class="name">
+							开始时间
+						</view>
+						<view class="content" @click="TimeKey='A',showTimePicker=true">
+							{{defaultTimeA?defaultTimeA:'请选择开始时间'}}
+							<u-icon name="arrow-right"></u-icon>
+						</view>
+					</view>
+					<view class="item">
+						<view class="name">
+							结束时间
+						</view>
+						<view class="content"  @click="TimeKey='B',showTimePicker=true">
+							{{defaultTimeB?defaultTimeB:'请选择结束时间'}}
+							<u-icon name="arrow-right"></u-icon>
+						</view>
+					</view>
+					
+					
+				</view>
+
+
+			</u-modal>
+		
+		</view>
+	 
 			<u-tabs  inactive-color="#888888" active-color="#101010" :list="list" :is-scroll="true"
 					:current="current" @change="change"></u-tabs>
 	
@@ -14,7 +52,7 @@
 			</view>
 
 <!-- 未开票 -->
-      <view class="not-invoiced" v-show="current==0">
+      <view class="not-invoiced" v-show="current==0">
 		  
         <view class="not-invoiced-item flex" v-for="(item,index) in list[0].list" :key="index">
 			<view class="radio">
@@ -41,17 +79,15 @@
 		
       	
 		<view class="bottom">
-			<view class="radio">
-				<u-checkbox v-model="allck" @change="allckBtn"></u-checkbox>
-			</view>
-			<view class="check-all">
-				全选
-			</view>
+			<u-button type="info" @click="showsheet=true" v-if="list[0].list.length" shape="primary">更多方式</u-button>
+			
 			<view class="total">
 				<p class="total-price">共<text style="color: #FF7300;" >{{sumActualFee.toFixed(2)}}元</text></p>
 				<p class="order">{{selectcount}}个订单</p>
 			</view>
-			<u-button type="success" @click="submit()" shape="circle">去开票</u-button>
+			<u-button type="primary" @click="submit()" >去开票</u-button>
+			<u-action-sheet :list="listsheet" @click="clicksheet" v-model="showsheet"></u-action-sheet>
+
 		</view>
       </view>
 	  <!-- 已开票 -->
@@ -87,8 +123,12 @@
 
 <script>
 	import * as API from '@/apis/invoiceApi.js'
+	import udoublepicker from '@/components/u-double-picker.vue'
 	
-	export default {
+	export default {
+		components: {
+			udoublepicker
+		},
 		data() {
 			return {
 				id:"",
@@ -107,9 +147,27 @@
 					list:[],
 				}],
 				current: 0,
-				personInfo:{},
-				description:"游客模式下需要补全手机号信息,点击前往",
-				
+				personInfo:{},
+			
+				listsheet:[ {
+					text: '全部开票' 
+				}, {
+					text: '按时间选择' 
+				}],
+					showTime:false,
+				showsheet:false,
+					showTimePicker:false,
+				TimeKey:"",
+				defaultTimeA:'',
+				defaultTimeB:'',
+				params: {
+									year: true,
+									month: true,
+									day: true,
+									hour: false,
+									minute: false,
+									second: false
+				},
 			}
 		},
 		onReachBottom() {
@@ -175,7 +233,51 @@
 			}
 		},
 		 
-		methods: {
+		methods: {
+			confirmmodal(){
+				if(!this.defaultTimeA){
+					uni.showToast({
+						title:"请选择开始时间"
+					})
+					this.showTime=true
+					return
+				}
+				if(!this.defaultTimeB){
+					uni.showToast({
+						title:"请选择结束时间"
+					})
+					this.showTime=true
+					return
+				}
+				if(this.defaultTimeA>this.defaultTimeB){
+					uni.showToast({
+						title:"结束时间需要大于开始时间"
+					})
+					this.showTime=true
+					return
+				}
+				uni.navigateTo({
+					url:'/pagesFinance/MyInvoice/issueInvoice?startDate='+this.defaultTimeA+'&endDate='+this.defaultTimeB+'&id='+this.id,
+					events: {
+						refreshData: () => {
+							this.init()
+						}
+					}
+				})
+				
+			},
+			confirmTimePicker(e){
+				console.log(e)
+				var time=e.year+'-'+e.month+'-'+e.day
+				
+				
+				if(this.TimeKey=='A'){
+					this.defaultTimeA=time
+				}
+				if(this.TimeKey=='B'){
+					this.defaultTimeB=time
+				}
+			},
 			alerttipsCk(){
 				uni.redirectTo({
 					url:"/pagesFinance/login/login?jpcode2=invoice"
@@ -268,6 +370,10 @@
 				this.current = index;
 				var list =this.list[this.current].list
 				this.getlist(true);
+			},
+			init() {
+				
+				this.getList(true)
 			},
 			submit(id){
 				
@@ -282,8 +388,33 @@
 				}
 				
 				uni.navigateTo({
-					url:'/pagesFinance/MyInvoice/issueInvoice?ids='+id
+					url:'/pagesFinance/MyInvoice/issueInvoice?ids='+id+'&id='+this.id,
+					events: {
+						refreshData: () => {
+							this.init()
+						}
+					}
 				})
+			},
+			clicksheet(index){
+				if(index==0){
+					uni.navigateTo({
+						url:'/pagesFinance/MyInvoice/issueInvoice?saveAll=1'+'&id='+this.id,
+						events: {
+							refreshData: () => {
+								this.init()
+							}
+						}
+					})
+				}else{
+					this.showTime=true
+					
+				}
+			},
+			
+			submit1(){
+				
+				
 			}
 				
 		},
@@ -402,34 +533,32 @@
 	
 	.bottom{
 		width: 100%;
-		padding: 14px 13px;
+		padding: 28rpx ;
 		background-color: rgba(255, 255, 255, 100);
 		position: fixed;
 		bottom: 0;
 		left: 0;
-		display: flex;
+		display: flex;
+		 /deep/.u-btn{
+			margin: 0 16rpx;
+		}
 		.check-all{
-			font-size: 16px;
-			margin: auto 5px;
+			font-size: 32rpx;
+			margin: auto 10rpx;
 		}
 		.total{
 			flex: 1;
 			// margin-left: 80px;
 			text-align: right;
 			.total-price{
-				font-size:16px
+				font-size:32rpx
 			}
 			.order{
-				font-size: 12px;
+				font-size: 24rpx;
 				
 			}
 		}
-		/deep/.u-btn{
-			width: 27.7%;
-			line-height: 40px;
-			font-size: 18px;
-			margin-left:20px;
-		}
+		
 	}
 	.invoice{
 		color: rgba(255, 97, 0, 100) !important;
@@ -440,5 +569,45 @@
 	.tips{
 		color: rgba(153, 153, 153, 100);
 		text-align: center;
+	}
+	
+	
+	// 弹窗
+	.modal {
+		background-color: #101010;
+	
+		.title {
+	
+			line-height: 20px;
+			padding: 18px 52px;
+			background-image: linear-gradient(rgb(0, 217, 115), #00A457);
+			color: #fff;
+			text-align: center;
+	
+		}
+	
+		.infos {
+			padding: 20px 14px;
+	
+			.item {
+				white-space: pre;
+				line-height: 28px;
+				display: flex;
+				justify-content: space-between;
+				color: #666666;
+				font-size: 16px
+				
+			}
+			.content{
+				color: #000;
+			}
+			.hint {
+				color: rgba(238, 49, 56, 100);
+				margin-top: 16px;
+	
+				font-size: 14px
+			}
+		}
+	
 	}
 </style>

+ 33 - 9
pagesFinance/MyInvoice/issueInvoice.vue

@@ -6,7 +6,7 @@
 		<view class="invioice-info">
 			<p class="title">发票信息</p>
 			<u-cell-group>
-				<u-cell-item title="发票金额" :arrow="false"> <text style="color:#ff3d00;">{{obj.totalPrice.toFixed(2)}}元</text></u-cell-item>
+				<u-cell-item title="发票金额" :arrow="false"> <text style="color:#ff3d00;">{{obj.totalPrice}}元</text></u-cell-item>
 				<u-cell-item title="抬头类型" :arrow="false">
 					<view v-if="!selectObj.title">请选择发票</view>
 					<view v-else-if="selectObj.headerType==1">企业单位</view>
@@ -55,7 +55,7 @@
 							发票金额
 						</view>
 						<view class="content">
-							{{obj.totalPrice.toFixed(2)}}元
+							{{obj.totalPrice}}元
 						</view>
 					</view>
 					<view class="hint">
@@ -94,7 +94,10 @@
 				show: false,
 				selectObj:{},
 				obj:{},
-				
+				id:"",
+				saveAll:"",
+				startDate:"",
+				endDate:"",
 			};
 		},
 		onShow() {
@@ -102,11 +105,22 @@
 			
 		},
 		onLoad(op) {
-			
+			if(op.id){
+				this.id=op.id;
+			}
 			if(op.ids){
 				this.ids=op.ids;
-				//this.getInfo()
 			}
+			if(op.saveAll){
+				this.saveAll=op.saveAll;
+			}
+			
+			if(op.startDate){
+				this.saveAll=1;
+				this.startDate=op.startDate;
+				this.endDate=op.endDate;
+			}
+			this.getInfo()
 		},
 		
 		methods: {
@@ -117,11 +131,16 @@
 				})
 				
 				API.saveInvoice({
+					entAccountId:this.id,
 					recordIds:this.ids,
-					invoiceTypeId:this.selectObj.id
+					saveAll:this.saveAll,
+					invoiceTypeId:this.selectObj.id,
+					startDate:this.startDate,
+					endDate:this.endDate,
 				}).then((res) => {
 					
-					
+					const eventChannel = this.getOpenerEventChannel();
+					eventChannel.emit('refreshData');
 				
 					uni.hideLoading()
 					uni.redirectTo({
@@ -141,8 +160,13 @@
 				})
 				
 				API.invoiceTypeDefalut({
-					recordIds:this.ids
+					entAccountId:this.id,
+					recordIds:this.ids,
+					saveAll:this.saveAll,
+					startDate:this.startDate,
+					endDate:this.endDate,
 				}).then((res) => {
+					
 					uni.hideLoading()
 					this.selectObj=res.data.invoiceType
 					if(!res.data.invoiceType){
@@ -209,7 +233,7 @@
 		position: absolute;
 		right: 16px;
 		color: rgba(51, 51, 51, 100);
-font-size: 12px
+		font-size: 12px
 	}
 
 	.invioice-info {

+ 24 - 0
pagesFinance/user/index.vue

@@ -140,6 +140,8 @@
 				</view>
 				
 			</view>
+			
+			
 			<view class="item"  @click="gotoUrl('pagesFinance/user/stationsListLine')">
 				<view class="item-icon">
 					<i class="ri-webcam-line"></i>
@@ -149,6 +151,8 @@
 				</view>
 				
 			</view>
+			
+			
 			</template>
 			<view class="item" 
 			 v-for="(item,i) in vipPlatformList" :key="i" v-if="!item.entAccountId" 
@@ -237,6 +241,26 @@
 						</view>
 						
 					</view>
+					
+					<view class="item" @click="gotoUrl('pagesFinance/MyInvoice/settlement?id='+item.entAccountId)">
+						<view class="item-icon">
+							<img src="../../assets/img/riLine-checkbox-multiple-line.svg" alt="">
+						</view>
+						<view class="item-name">
+							财务结算
+						</view>
+						
+					</view>
+					<view class="item" @click="gotoUrl('pagesFinance/MyInvoice/invoiceManagement?id='+item.entAccountId)">
+						<view class="item-icon">
+							<img src="../../assets/img/riLine-ticket-2-line.svg" alt="">
+						</view>
+						<view class="item-name">
+							企业开票
+						</view>
+						
+					</view>
+					
 					</view>
 			</template>
 		</view>