zhengkaixin 1 年之前
父節點
當前提交
2aedddd8db

+ 8 - 0
pages.json

@@ -304,6 +304,14 @@
         		"navigationBarTitleText" : "",
         		"enablePullDownRefresh" : false
         	}
+        },
+        {
+        	"path" : "pages/invoiceManagement/applyMessage",
+        	"style" : 
+        	{
+        		"navigationBarTitleText" : "",
+        		"enablePullDownRefresh" : false
+        	}
         }
        
     ],

+ 35 - 6
pages/invoiceManagement/applyBilling.vue

@@ -10,12 +10,13 @@
 		</view>
 		<!-- 支付详情 -->
 		<view class="payment-infos">
-			<view class="item">
+			<view class="item"  v-if="false" >
 				<view class="item-title">
-					发票项目
+					发票类型
 				</view>
 				<view class="item-value">
-					2024年1月扣费发票
+					{{detail.type=='1'?'增值税专票':''}}{{detail.type=='2'?'增值税普票':''}}
+					
 				</view>
 				
 			</view>
@@ -43,20 +44,48 @@
 		<!-- 按钮 -->
 		<view class="btns">
 			<button class="btn1">完成</button>
-			<button class="btn2">查看发票详情</button>
+			<button class="btn2"  >查看发票详情</button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/invoiceApi.js'
+	
 	export default {
 		data() {
 			return {
-				
+				id:'',
+				detail:{}
 			}
 		},
+		onLoad(op){
+			this.id=op.id;
+			this.getInvoiceDetail()
+		},
 		methods: {
-			
+			gotoInfo2(){
+				uni.navigateBack()
+			},
+			gotoInfo(){
+				uni.redirectTo({
+					url:"/pages/invoiceManagement/invoiceDetails?id="+this.id
+				})
+			},
+			getInvoiceDetail(){
+				uni.showLoading({
+					mask:true,title:'加载中...'
+				})
+				API.invoiceDetail({
+					id:this.id
+				}).then((response) => {
+					uni.hideLoading();
+					
+				}).catch(error => {
+					uni.hideLoading();
+					
+				})
+			}
 		}
 	}
 </script>

+ 53 - 0
pages/invoiceManagement/applyMessage.vue

@@ -0,0 +1,53 @@
+<template>
+	<view>
+		<u-navbar title="开票说明"  title-color="#101010" ></u-navbar>
+		<view class="background">
+			<view class="main">
+				<p>1.月结发票:为已完全交清欠费用户出具的月消费账单发票。实缴发票:依据用户实际缴纳金额为用户开具的发票。发票金额不包括不能参与实销发票打印的费用,如:赠费等。</p>
+
+				<p>2.已经开具纸质发票的记录不能再开具电子发票。</p>
+
+				<p>3.每月1日0时至24时为系统出账期,为您提供相关查询服务延迟可能较长。月结发票将在系统出账后自动更新。</p>
+			
+			</view>
+		</view>
+	
+	</view> 
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.background{
+		position: relative;
+		height: 200px;
+		background: linear-gradient(180deg, rgba(203,234,255,1) 0%,rgba(203,234,255,0) 100%);
+		.main{
+			position: absolute;
+			top: 24rpx;
+			left: 32rpx;
+			right: 32rpx;
+			background-color: #fff;
+			border-radius: 8px;
+			padding: 40rpx 32rpx;
+			p{
+				line-height: 48rpx;
+				color: rgba(51,51,51,1);
+				font-size: 32rpx;
+			}
+		}
+	}
+ 
+ 
+</style>

+ 45 - 26
pages/invoiceManagement/invoiceDetails.vue

@@ -7,7 +7,7 @@
 					发票金额(元)
 				</view>
 				<view class="sum">
-					1000.00
+					{{detail.amount}}
 				</view>
 				<view class="state">
 					开票中
@@ -15,13 +15,12 @@
 				<view class="details">
 					<view class="item">
 						<view class="item-title">
-							开票项目
+							发票类型
 							
-						
-
 						</view>
 						<view class="item-value">
-							2024年1月扣费发票
+							{{detail.type=='1'?'增值税专票':''}}{{detail.type=='2'?'增值税普票':''}}
+							
 							
 							
 
@@ -29,12 +28,13 @@
 					</view>
 					<view class="item">
 						<view class="item-title">
-							发票类型
+							抬头类型
 							
 							
 						</view>
 						<view class="item-value">
-								企业单位
+								{{detail.headerType=='1'?'企业单位':''}}{{detail.headerType=='2'?'个人/非企业单位':''}}
+								
 								
 								
 						</view>
@@ -46,46 +46,42 @@
 							
 						</view>
 						<view class="item-value">
-							联通公司
+							{{detail.title}}
+							
 							
 							
 						</view>
 					</view>
-					<view class="item">
+					<view class="item" v-if="detail.companyTaxNo" >
 						<view class="item-title">
 							公司税号
 							
 							
 						</view>
 						<view class="item-value">
-							Y8521425210
+							{{detail.companyTaxNo}}
 							
 							
 						</view>
 					</view>
-					<view class="item">
+					<view class="item" v-if="detail.companyTelephone">
 						<view class="item-title">
 							手机号码
 							
-							
 						</view>
 						<view class="item-value">
-							15100001111
-							
+								{{detail.companyTelephone}}
 							
 						</view>
 					</view>
-					<view class="item">
+					<view class="item" v-if="detail.idCard">
 						<view class="item-title">
 							身份证号
 						</view>
 						<view class="item-value">
 					
-								420400200001011010
+									{{detail.idCard}}
 								
-								
-								
-					
 						</view>
 					</view>
 				</view>
@@ -93,7 +89,7 @@
 				<view class="details">
 					
 					
-					<view class="item">
+					<view class="item"  v-if="false" >
 						<view class="item-title">
 							申请单号
 						</view>
@@ -109,10 +105,10 @@
 							申请时间
 						</view>
 						<view class="item-value">
-							2023-08-20 10:29:00
+							{{detail.createTime}}
 						</view>
 					</view>
-					<view class="item">
+					<view class="item" v-if="false" >
 						<view class="item-title">
 							开票时间
 						</view>
@@ -124,21 +120,44 @@
 			</view>
 		</view>
 		<!-- 查看 -->
-		<button class="check">查看电子发票</button>
+		<button class="check" v-if="detail.image">查看电子发票</button>
 		<!-- 返回 -->
-		<button class="back">返回</button>
+		<button class="back" @click="goBack" >返回</button>
 	</view> 
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/invoiceApi.js'
+	
 	export default {
 		data() {
 			return {
-				
+				id:'',
+				detail:{}
 			}
 		},
+		onLoad(op){
+			this.id=op.id;
+			this.getInvoiceDetail()
+		},
 		methods: {
-			
+			goBack(){
+				uni.navigateBack()
+			},
+			getInvoiceDetail(){
+				uni.showLoading({
+					mask:true,title:'加载中...'
+				})
+				API.invoiceDetail({
+					id:this.id
+				}).then((response) => {
+					uni.hideLoading();
+					this.detail=response.data.invoiceInfo
+				}).catch(error => {
+					uni.hideLoading();
+					
+				})
+			}
 		}
 	}
 </script>

+ 25 - 14
pages/invoiceManagement/invoiceManagement.vue

@@ -11,7 +11,7 @@
 		</view>
 		<!-- 未开发票 -->
 		<view class="not-invioced" v-if="current==0">
-		<u-checkbox-group @change="selectOne" >
+		<u-checkbox-group @change="selectOne" style="width: 100%;" >
 
 			<view class="invoice-item" v-for="(item,i) in list1" :key="item" >
 				<view class="radio">
@@ -39,15 +39,20 @@
 		
 		<!-- 已开发票 -->
 		<view class="invoiced" v-if="current==1">
-			<view class="invoice-item"  >
+			<view class="invoice-item" v-for="(item,i) in list2"
+			 @click="gotoUrl('/pages/invoiceManagement/invoiceDetails?id='+item.id)"
+			 :key="i"  >
 				
 				<view class="infos">
 					<view class="title">
 						<view class="text">
-							2024年1月扣费发票
+							{{item.title}}
 						</view>
-						<view class="state">
-							开票中
+						<view class="state state2" :class="{
+							state:!item.image,
+							state2:item.image,
+						}" >
+							{{item.image?'已开票':'开票中'}}
 						</view>
 					</view>
 					<view class="item">
@@ -55,7 +60,7 @@
 							发票金额
 						</view>
 						<view class="value">
-							1000.00
+							{{item.amount}}
 							
 						
 
@@ -63,11 +68,10 @@
 					</view>
 					<view class="item">
 						<view class="name">
-							发票抬头
+							发票类型
 						</view>
 						<view class="value">
-							联通公司
-							
+							{{item.type=='1'?'增值税专票':''}}{{item.type=='2'?'增值税普票':''}}
 							
 						</view>
 					</view>
@@ -76,12 +80,12 @@
 							申请时间
 						</view>
 						<view class="value">
-							2024-02-07 16:00:00			
+							{{item.createTime}}		
 						</view>
 					</view>
 				</view>
 			</view>
-			<view class="invoice-item"  >
+			<!-- <view class="invoice-item"  >
 				
 				<view class="infos">
 					<view class="title">
@@ -122,7 +126,7 @@
 						</view>
 					</view>
 				</view>
-			</view>
+			</view> -->
 			<u-divider :isnone="list2.length==0"  v-if="list2.length==recordsTotal2" nonetext="没有找到相关内容"
 				border-color="#CFD2D5">已经到底了</u-divider>
 		</view>
@@ -232,7 +236,12 @@
 					return
 				}
 				uni.navigateTo({
-					url:"/pages/invoiceManagement/issueInvoice?ids="+this.sumCollection.join()
+					url:"/pages/invoiceManagement/issueInvoice?ids="+this.sumCollection.join(),
+					events: {
+						refreshData: () => {
+							this.init()
+						}
+					}
 				})
 				// uni.showLoading({
 				// 	mask:true,title:'加载中...'
@@ -315,9 +324,11 @@
 					status:1,
 					pageIndex: this.pageIndex,
 					pageSize: 20,
-				}).then((response) => {
+				}).then((res) => {
 					uni.hideLoading();
+					
 					//this.list2=response.data.data;
+					var list=[]
 					if (this.pageIndex == 1) {
 						list = res.data.data;
 					} else {

+ 42 - 2
pages/invoiceManagement/issueInvoice.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<u-navbar title="开具发票" title-color="#101010">
-			<view class="slot" slot="right">
+			<view class="slot" slot="right" @click="gotoUrl('/pages/invoiceManagement/applyMessage')" >
 				开票说明
 			</view>
 		</u-navbar>
@@ -85,7 +85,10 @@
 		</view>
 		<!-- 弹窗 -->
 		<view class="modal">
-			<u-modal v-model="show" :show-title="false" :show-cancel-button="true" cancel-text="返回修改"
+			<u-modal v-model="show" :show-title="false" :show-cancel-button="true"
+			 @confirm="submit"
+			 
+			 cancel-text="返回修改"
 				confirm-text="确认开票">
 				<view class="headline">
 					<p>发票开具成功后不可撤销</p>
@@ -140,6 +143,7 @@
 			return {
 				show: false,
 				ids:"",
+				totalPrice:0,
 				invoiceType:{
 					
 				}
@@ -147,9 +151,45 @@
 		},
 		onLoad(op	){
 			this.ids=op.ids
+			this.carhelp.set('select_invoice_title','')
 			this.openInvoiceByRecordIds();
 		},
+		onShow() {
+			var item=this.carhelp.get('select_invoice_title')
+			if(item){
+				this.invoiceType=item;
+				this.carhelp.set('select_invoice_title','')
+			}
+		},
 		methods: {
+			submit(){
+				if (!(this.invoiceType&&this.invoiceType.id)) {
+					uni.showToast({
+						icon: "none",
+						title: "请选择发票抬头",
+						
+					})
+					return;
+				}
+					uni.showLoading({
+						mask:true,title:'加载中...'
+					})
+					API.saveInvoiceByRecordIds({
+						recordIds:this.ids,
+						invoiceTypeId:this.invoiceType.id
+					}).then((response) => {
+						uni.hideLoading();
+						const eventChannel = this.getOpenerEventChannel();
+						eventChannel.emit('refreshData');
+						
+						uni.redirectTo({
+							url:"/pages/invoiceManagement/applyBilling?id="+response.data.id
+						})
+					}).catch(error => {
+						uni.hideLoading();
+						
+					})
+			},
 			openInvoiceByRecordIds(){
 				
 				uni.showLoading({

+ 7 - 6
pages/invoiceManagement/selectTitleManagement.vue

@@ -10,7 +10,7 @@
 					<image class="img" src="@/assets/img/riFill-building-fill.svg" mode=""></image>
 				
 			</view>
-			<view class="infos"  v-for="(item,i) in companyTypes" :key="i"   @click="selectInfo()" >
+			<view class="infos"  v-for="(item,i) in companyTypes" :key="i"   @click="selectInfo(item)" >
 				<view>
 					<view class="name">
 						{{item.title}}<view class="default" v-if="item.defaultHeader" >默认</view>
@@ -23,7 +23,7 @@
 					</view>
 				</view>
 				<view>
-					<u-icon name="edit-pen-fill"  ></u-icon>
+					<!-- <u-icon name="edit-pen-fill"  ></u-icon> -->
 					
 				</view>
 			</view>
@@ -36,14 +36,14 @@
 					<image class="img" src="@/assets/img/riFill-user-2-fill.svg" mode=""></image>
 				
 			</view>
-			<view class="infos" v-for="(item,i) in personTypes" :key="i"   @click="selectInfo()" >
+			<view class="infos" v-for="(item,i) in personTypes" :key="i"   @click="selectInfo(item)" >
 				<view>
 					<view class="name">
 						{{item.title}} <view class="default"  v-if="item.defaultHeader" >默认</view>
 					</view>
 				</view>
 				<view>
-					<u-icon name="edit-pen-fill"   ></u-icon>
+					<!-- <u-icon name="edit-pen-fill"   ></u-icon> -->
 				</view>
 			</view>
 		</view>
@@ -72,8 +72,9 @@
 			this.getInvoiceList()
 		},
 		methods: {
-			selectInfo(){
-				this.car
+			selectInfo(item){
+				this.carhelp.set('select_invoice_title',item)
+				uni.navigateBack()
 			},
 			addInfo(url) {
 				var url = url;