Commit 4602fd47 authored by qipeng's avatar qipeng

开发票

parent a37e46a9
...@@ -25,19 +25,19 @@ ...@@ -25,19 +25,19 @@
<input class="uni-input inputBox-inputStyle" v-model="uploadMes.buyerName" placeholder="填写发票抬头" /> <input class="uni-input inputBox-inputStyle" v-model="uploadMes.buyerName" placeholder="填写发票抬头" />
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn" v-if="uploadMes.headType==1">
<view class="listIn-name">公司税号<text>*</text></view> <view class="listIn-name">公司税号<text>*</text></view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<input class="uni-input inputBox-inputStyle" v-model="uploadMes.taxNumber" placeholder="填写纳税人识别码(必填)" /> <input class="uni-input inputBox-inputStyle" v-model="uploadMes.taxNumber" placeholder="填写纳税人识别码(必填)" />
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn" v-if="uploadMes.headType==1">
<view class="listIn-name">地址电话</view> <view class="listIn-name">地址电话</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<input class="uni-input inputBox-inputStyle" v-model="uploadMes.buyerAddress" placeholder="填写企业注册地址、电话" /> <input class="uni-input inputBox-inputStyle" v-model="uploadMes.buyerAddress" placeholder="填写企业注册地址、电话" />
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn" v-if="uploadMes.headType==1">
<view class="listIn-name">开户行及账号</view> <view class="listIn-name">开户行及账号</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<input class="uni-input inputBox-inputStyle" v-model="uploadMes.bankAccount" placeholder="填写开户行及账号" /> <input class="uni-input inputBox-inputStyle" v-model="uploadMes.bankAccount" placeholder="填写开户行及账号" />
...@@ -71,33 +71,23 @@ ...@@ -71,33 +71,23 @@
<view class="label-name">发票金额</view> <view class="label-name">发票金额</view>
<view class="label-money"> <view class="label-money">
<text>¥</text> <text>¥</text>
30.00 {{checkOrderMoney}}
</view> </view>
</view> </view>
<view class="application-listOrder"> <view class="application-listOrder" v-for="(item,index) in uploadMes.orderVoList" :key="index">
<view class="listOrder-title"> <view class="listOrder-title">
<view class="title-name">长江索道 (索道南站单程)</view> <view class="title-name">{{item.merchantName}}({{item.productName}})</view>
<view class="title-money">¥20.00</view> <view class="title-money">¥{{item.orderMoney.toFixed(2)}}</view>
</view> </view>
<view class="listOrder-message"> <view class="listOrder-message">
<view class="message-timer">游玩时间: 2025-02-20</view> <view class="message-timer">游玩时间: {{item.playDate}}</view>
<view class="message-buyNum">购买数量: 1张</view> <view class="message-buyNum">购买数量: {{item.orderNum}}</view>
</view>
</view>
<view class="application-listOrder">
<view class="listOrder-title">
<view class="title-name">长江索道 (索道南站单程)</view>
<view class="title-money">¥20.00</view>
</view>
<view class="listOrder-message">
<view class="message-timer">游玩时间: 2025-02-20</view>
<view class="message-buyNum">购买数量: 1张</view>
</view> </view>
</view> </view>
</view> </view>
<!--底部提交按钮--> <!--底部提交按钮-->
<view class="application-btnCase"> <view class="application-btnCase">
<view class="btnCase-btn">提交电子发票</view> <view class="btnCase-btn" @click="uploadIssueInvoice()">提交电子发票</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -120,6 +110,7 @@ export default { ...@@ -120,6 +110,7 @@ export default {
uploadMes:{ uploadMes:{
companyId:'', companyId:'',
merchantId:'', merchantId:'',
merchantName:'',
openid:'', openid:'',
phone:'', phone:'',
headType:'',//抬头类型0个人1企业 headType:'',//抬头类型0个人1企业
...@@ -132,18 +123,30 @@ export default { ...@@ -132,18 +123,30 @@ export default {
note:'',//备注 note:'',//备注
bankAccount:'',//银行账号 bankAccount:'',//银行账号
orderVoList:[], orderVoList:[],
} },
checkOrderMoney:0,//总价
} }
}, },
onLoad(option) { onLoad(option) {
this.uploadMes.merchantId = option.merchantId this.uploadMes.merchantId = option.merchantId
this.uploadMes.companyId = option.companyId this.uploadMes.companyId = option.companyId
this.uploadMes.orderVoList = JSON.parse(option.checkMessage) this.uploadMes.orderVoList = JSON.parse(option.checkMessage)
this.uploadMes.openid = uni.getStorageSync('openid') this.uploadMes.openid = uni.getStorageSync('openid')
this.uploadMes.phone = this.uploadMes.orderVoList[0].ticketPhone this.uploadMes.phone = this.uploadMes.orderVoList[0].ticketPhone
this.uploadMes.merchantName = this.uploadMes.orderVoList[0].merchantName
this.checkOrderMoney = 0
this.uploadMes.orderVoList.forEach(item=>{
item.createDate = item.orderTime//订单创建日期
item.openid = this.uploadMes.openid
item.orderId = item.id//订单id
item.phone = item.ticketPhone//ticketPhone 联系电话
item.buyNumber = item.orderNum//购买数量
this.checkOrderMoney+=item.orderMoney
})
this.checkOrderMoney = this.checkOrderMoney.toFixed(2)
}, },
methods: { methods: {
radioChange(){//点击radio radioChange(evt){//点击radio
for (let i = 0; i < this.riseList.length; i++) { for (let i = 0; i < this.riseList.length; i++) {
if (this.riseList[i].value === evt.detail.value) { if (this.riseList[i].value === evt.detail.value) {
this.uploadMes.headType = i this.uploadMes.headType = i
...@@ -151,6 +154,41 @@ export default { ...@@ -151,6 +154,41 @@ export default {
} }
} }
}, },
uploadIssueInvoice(){//申请开发票
if(this.uploadMes.buyerName==''){
uni.showToast({
title: '发票抬头不可为空',
icon: 'none'
})
return false
}
if(this.uploadMes.headType==1&&this.uploadMes.taxNumber){
uni.showToast({
title: '公司税号不可为空',
icon: 'none'
})
return false
}
if(this.uploadMes.emailAddress==''){
uni.showToast({
title: '电子邮箱不可为空',
icon: 'none'
})
return false
}
this.$request('wechatUser/invoice/issueInvoice',this.uploadMes).then((res)=>{
if(res.code=='00'){
uni.navigateTo({
url: '/pages/my/electronicInvoice/submitSuccessfully/submitSuccessfully?merchantId='+this.uploadMes.merchantId+'&companyId='+this.uploadMes.companyId+'&search='+this.uploadMes.phone
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
} }
} }
</script> </script>
......
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
title: '请选择需要开票的订单', title: '请选择需要开票的订单',
icon: 'none' icon: 'none'
}) })
return false
} }
checkMessage = JSON.stringify(checkMessage) checkMessage = JSON.stringify(checkMessage)
uni.navigateTo({ uni.navigateTo({
......
<template> <template>
<view class="productBigBox"> <view class="productBigBox">
<!--开票列表--> <!--开票列表-->
<view class="billing-record" v-for="(item,index) in tableDate" :key="index" @click="tableDateCheckFun(index)"> <view class="billing-record" v-for="(item,index) in tableDate" :key="index" @click="toInvoiceDetails(index)">
<view class="record-title"> <view class="record-title">
<view class="title-message"> <view class="title-message">
<view class="message-timer">{{item.timer}}</view> <view class="message-timer">{{item.createTime}}</view>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
<view class="title-subject"> <view class="title-subject">
<view class="subject-name">{{item.name}}</view> <view class="subject-name">{{item.merchantName}}({{item.productName}})</view>
<view class="subject-money"> <view class="subject-money">
<text>¥</text> <text>¥</text>
{{item.money}} {{item.invoicePrice}}
</view> </view>
</view> </view>
</view> </view>
<view class="record-bottom"> <view class="record-bottom">
<view class="bottom-name" v-if="item.onType==0">开票中</view> <view class="bottom-name" v-if="item.invoiceStatus==1">开票中</view>
<view class="bottom-name bottom-name2" v-else>已开票</view> <view class="bottom-name bottom-name2" v-else-if="item.invoiceStatus==2">已开票</view>
<view class="bottom-btnCase"> <view class="bottom-name" v-if="item.invoiceStatus==3">开票失败</view>
<!-- <view class="bottom-btnCase">
<view class="bottom-btn">催一催</view> <view class="bottom-btn">催一催</view>
<view class="bottom-btn bottom-btn2">已催促</view> <view class="bottom-btn bottom-btn2">已催促</view>
</view> -->
<view class="bottom-btnCase">
<view class="bottom-btn">查看详情</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -31,36 +35,57 @@ ...@@ -31,36 +35,57 @@
export default { export default {
data() { data() {
return { return {
merchantId:'',
companyId:'',
phone:'',
orderId:'',
openid:'',
tableDate:[ tableDate:[
{
name:'长江索道 (索道南站单程)',
timer:'2025-02-20 11.20',
money:'20.00',
onType:'0'
},
{
name:'长江索道 (索道南站单程)',
timer:'2025-02-21 11.20',
money:'21.00',
onType:'0'
},
{
name:'长江索道 (索道南站单程)',
timer:'2025-02-22 11.20',
money:'22.00',
onType:'1'
}
],//列表内容 ],//列表内容
pageIndex:1,//当前页 pageIndex:1,//当前页
pageTotal:0,//总条数 pageTotal:0,//总条数
} }
}, },
onLoad(option) { onLoad(option) {
this.merchantId = option.merchantId
this.companyId = option.companyId
if(option.search.length==11){//当为11位则是电话 大于11为则为订单
this.phone = option.search
}else{
this.orderId = option.search
}
this.openid = uni.getStorageSync('openid')
this.getData()
}, },
methods: { methods: {
getData(){//列表加载 getData(){//列表加载
console.log('加载了') var data = {
merchantId: this.merchantId,
companyId: this.companyId,
phone: this.phone,
openid: this.openid,
pageIndex: this.pageIndex,
pageSize:20,
}
this.$request('wechatUser/invoice/loadInvoicePage',data).then((res)=>{
if(res.code=='00'){
res.data.list.forEach((item,index)=>{
item.invoicePrice = Number(item.invoicePrice).toFixed(2)
this.tableDate.push(item)
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
toInvoiceDetails(index){//跳转详情
var recordId = this.tableDate[index].recordId
uni.navigateTo({
url: '/pages/my/electronicInvoice/invoiceDetails/invoiceDetails?recordId='+recordId
})
}, },
}, },
onReachBottom(){//上拉加载 onReachBottom(){//上拉加载
......
...@@ -8,44 +8,45 @@ ...@@ -8,44 +8,45 @@
<view class="application-listIn"> <view class="application-listIn">
<view class="listIn-name">开票状态</view> <view class="listIn-name">开票状态</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view v-if="invoiceStatus==0" class="inputBox-text inputBox-textOrange">开票中</view> <view v-if="arrForm.invoiceStatus==1" class="inputBox-text inputBox-textOrange">开票中</view>
<view v-else class="inputBox-text inputBox-textGreen">已开票</view> <view v-if="arrForm.invoiceStatus==2" class="inputBox-text inputBox-textGreen">已开票</view>
<view v-if="arrForm.invoiceStatus==3" class="inputBox-text inputBox-textOrange">开票失败</view>
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn">
<view class="listIn-name">发票抬头</view> <view class="listIn-name">发票抬头</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">重庆胖丁信息技术有限公司</view> <view class="inputBox-text">{{arrForm.buyerName}}</view>
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn" v-if="arrForm.headType==1">
<view class="listIn-name">税号</view> <view class="listIn-name">税号</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">91500107MA603ANH7B</view> <view class="inputBox-text">{{arrForm.taxNumber}}</view>
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn" v-if="arrForm.headType==1">
<view class="listIn-name">地址电话</view> <view class="listIn-name">地址</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">重庆市沙坪坝区上桥金桥路28号</view> <view class="inputBox-text">{{arrForm.buyerAddress}}</view>
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn" v-if="arrForm.headType==1">
<view class="listIn-name">开户行及账号</view> <view class="listIn-name">开户行及账号</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">1239 1580 5010 301</view> <view class="inputBox-text">{{arrForm.bankAccount}}</view>
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn">
<view class="listIn-name">提交时间</view> <view class="listIn-name">提交时间</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">2025-2-20 11:11</view> <view class="inputBox-text">{{arrForm.createTime}}</view>
</view> </view>
</view> </view>
<view class="application-listIn"> <view class="application-listIn">
<view class="listIn-name">发票金额</view> <view class="listIn-name">发票金额</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">¥<text>20.00</text></view> <view class="inputBox-text">¥<text>{{arrForm.invoicePrice}}</text></view>
</view> </view>
</view> </view>
</view> </view>
...@@ -57,8 +58,8 @@ ...@@ -57,8 +58,8 @@
<view class="application-listIn"> <view class="application-listIn">
<view class="listIn-name">电子邮箱</view> <view class="listIn-name">电子邮箱</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">1260707304@qq.com</view> <view class="inputBox-text">{{arrForm.emailAddress}}</view>
<view class="inputBox-toEm" v-if="invoiceStatus==1">已发送</view> <view class="inputBox-toEm" v-if="arrForm.invoiceStatus==2">已发送</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -70,16 +71,16 @@ ...@@ -70,16 +71,16 @@
<view class="application-listIn"> <view class="application-listIn">
<view class="listIn-name">提供方</view> <view class="listIn-name">提供方</view>
<view class="listIn-inputBox"> <view class="listIn-inputBox">
<view class="inputBox-text">索道分公司提供发票</view> <view class="inputBox-text">{{arrForm.merchantName}}</view>
</view> </view>
</view> </view>
</view> </view>
<!--底部提交按钮--> <!--底部提交按钮-->
<view class="application-btnCase"> <view class="application-btnCase" v-if="arrForm.invoiceStatus==2">
<view class="btnCase-btn" v-if="invoiceStatus==0">催一催</view> <!-- <view class="btnCase-btn">催一催</view> -->
<view class="btnCase-btnList" v-else> <view class="btnCase-btnList">
<view class="btnList-style">发票下载</view> <view class="btnList-style" @click="downLoadImg(arrForm.pdfUrl)">发票下载</view>
<view class="btnList-style btnList-styleOrange">申请重开发票</view> <!-- <view class="btnList-style btnList-styleOrange">申请重开发票</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -90,13 +91,69 @@ export default { ...@@ -90,13 +91,69 @@ export default {
data() { data() {
return { return {
invoiceStatus:1, invoiceStatus:1,
recordId:'',
arrForm:{},
} }
}, },
onLoad(option) { onLoad(option) {
this.recordId = option.recordId
this.loadInvoiceInfoFun()
}, },
methods: { methods: {
loadInvoiceInfoFun(){//详情加载
var data = {
recordId:this.recordId
}
this.$request('wechatUser/invoice/loadInvoiceInfo',data).then((res)=>{
if(res.code=='00'){
this.arrForm = res.data
this.arrForm.invoicePrice = Number(this.arrForm.invoicePrice).toFixed(2)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
downLoadImg(imgUrl){
uni.showLoading({
title: '下载中',
mask: true
})
let fileName = new Date().getTime()
uni.downloadFile({ //下载文件资源到本地
url:imgUrl,
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.pdf', //filePath指定文件下载后存储的路径,wx.env.USER_DATA_PATH,时间戳为文件名
success: res => { //下载到本地成功
if(res.statusCode==200){
let filePath = res.filePath
uni.saveImageToPhotosAlbum({ //保存图片到系统相册。
filePath,
success: file => { //保存成功
uni.showToast({
title: '下载成功',
icon: 'success',
mask: true
})
},
fail: err => {
uni.hideLoading()
this.getPermissions(err)
}
})
}
},
fail: err => { //下载失败
uni.hideLoading()
uni.showToast({
title: '下载失败',
icon: 'none',
mask: true
})
}
})
},
}, },
} }
</script> </script>
...@@ -199,7 +256,8 @@ export default { ...@@ -199,7 +256,8 @@ export default {
justify-content: space-between; justify-content: space-between;
padding: 0 24rpx; padding: 0 24rpx;
.btnList-style{ .btnList-style{
width: 340rpx; //width: 340rpx;
width: 100%;
height: 88rpx; height: 88rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 50rpx; border-radius: 50rpx;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<image class="argument-img" src="/pages/my/static/electronicInvoice/enterIcon.png"></image> <image class="argument-img" src="/pages/my/static/electronicInvoice/enterIcon.png"></image>
<view class="argument-message">提交成功</view> <view class="argument-message">提交成功</view>
<view class="argument-text">由索道分公司为你开具电子发票, 预计在24小时内完成, 请耐心等待</view> <view class="argument-text">由索道分公司为你开具电子发票, 预计在24小时内完成, 请耐心等待</view>
<view class="argument-btn">查看发票进度</view> <view class="argument-btn" @click="toBillingRecord()">查看发票进度</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -13,14 +13,22 @@ ...@@ -13,14 +13,22 @@
export default { export default {
data() { data() {
return { return {
merchantId:'',
companyId:'',
search:'',
} }
}, },
onLoad(option) { onLoad(option) {
this.merchantId = option.merchantId
this.companyId = option.companyId
this.search = option.search
}, },
methods: { methods: {
toBillingRecord(){//跳转开票记录
uni.navigateTo({
url: '/pages/my/electronicInvoice/billingRecord/billingRecord?merchantId='+this.merchantId+'&companyId='+this.companyId+'&search='+this.search
})
},
}, },
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment