修改发票信息
This commit is contained in:
parent
3d13c3003a
commit
2a6447e292
|
@ -7,7 +7,8 @@ Page({
|
|||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
detail: {}
|
||||
detail: {},
|
||||
id: "",
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -19,14 +20,27 @@ Page({
|
|||
},
|
||||
async init(id) {
|
||||
const { code, message, data } = await getInvoiceInfoDetail(id)
|
||||
this.setData({ detail: data });
|
||||
this.setData({ detail: data, id });
|
||||
},
|
||||
handleBack() {
|
||||
wx.navigateBack()
|
||||
},
|
||||
jumpToDetail() {
|
||||
wx.redirectTo({
|
||||
url: '/pages/invoiceDetailContent/index',
|
||||
url: '/pages/invoiceDetailContent/index?id=' + this.data.id,
|
||||
})
|
||||
},
|
||||
download() {
|
||||
// console.log('---------')
|
||||
wx.showActionSheet({
|
||||
itemList: ['发票XML文件下载', '发票PDF文件下载'],
|
||||
async success(res) {
|
||||
console.log('res', res.tapIndex)
|
||||
const { code, message, data } = await downloadInvoice(this.data.id, res.tapIndex);
|
||||
if (code !== OK) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -52,12 +52,12 @@
|
|||
<navigator title="发票详细" canBack="{{true}}" bind:back="back" />
|
||||
<view class="wrapper">
|
||||
<view style="margin-top: 40rpx;"> 尊敬的客户,您好: </view>
|
||||
<view style="margin-top: 20rpx;"> 已经为您开具订单2222222222的发票,发票数量共计1张,如下: </view>
|
||||
<view style="margin-top: 20rpx;"> 发票类型:数电发票(电子发票),发票号码:54645654656556,您可以点击“发票XML文件下载”获取该发票XML文件,或者点击“发票PDF文件下载”获取该发票PDF文件; </view>
|
||||
<view style="margin-top: 20rpx;"> 已经为您开具订单{{detail.id}}的发票,发票数量共计1张,如下: </view>
|
||||
<view style="margin-top: 20rpx;"> 发票类型:数电发票(电子发票),发票号码:{{detail.number}},您可以点击“发票XML文件下载”获取该发票XML文件,或者点击“发票PDF文件下载”获取该发票PDF文件; </view>
|
||||
<view style="margin-top: 20rpx;"> 同时您也可以到预留的邮箱中查看下载发票。 </view>
|
||||
</view>
|
||||
|
||||
<view class="operate">
|
||||
<van-button type="info" style="flex: 1;" block> 下载 </van-button>
|
||||
<van-button type="info" style="flex: 1;" block bind:click="download"> 下载 </van-button>
|
||||
<van-button type="info" style="flex: 1;margin-left: 40rpx;" block bind:click="jumpToDetail"> 发票明细 </van-button>
|
||||
</view>
|
|
@ -19,6 +19,7 @@ Page({
|
|||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log('options', options)
|
||||
const { id } = options;
|
||||
this.getDetail(id)
|
||||
},
|
||||
|
|
|
@ -49,9 +49,10 @@ Component({
|
|||
scrollToLower() {
|
||||
loadingFunc(() => this.getList())
|
||||
},
|
||||
jumpToDetail() {
|
||||
jumpToDetail(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: '/pages/invoiceDetail/index',
|
||||
url: '/pages/invoiceDetail/index?id=' + id,
|
||||
})
|
||||
},
|
||||
jumpToDetailContent(e) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<view class="money"> ¥{{item.money}} </view>
|
||||
<view class="operate">
|
||||
<view style="margin-top: 20rpx; margin-bottom: 20rpx;">
|
||||
<van-button type="info" class="invoiceBtn" bind:click="submit" size="small" bind:click="jumpToDetail">发票</van-button>
|
||||
<van-button type="info" class="invoiceBtn" bind:click="submit" size="small" bind:click="jumpToDetail" data-id="{{item.id}}">发票</van-button>
|
||||
</view>
|
||||
<van-button type="info" class="detailBtn" bind:click="submit" size="small" bind:click="jumpToDetailContent" data-id="{{item.id}}">明细</van-button>
|
||||
</view>
|
||||
|
|
|
@ -45,7 +45,7 @@ Component({
|
|||
this.setData({ user: data });
|
||||
},
|
||||
changeEditType() {
|
||||
this.setData({ editType: 'edit', formData: this.data.detail })
|
||||
this.setData({ editType: 'edit', formData: {...this.data.detail, tenement: wx.getStorageSync('tenement')?.id} })
|
||||
},
|
||||
cancelEdit() {
|
||||
this.setData({ editType: 'detail', formData: {} })
|
||||
|
|
|
@ -33,6 +33,42 @@ Page({
|
|||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
if (!data?.tenement?.id || !data?.name) {
|
||||
const user = wx.getStorageSync('user')
|
||||
if (user.isAdmin) {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '当前公司没用开票信息,请先前往开票信息页面编辑开票信息',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
wx.navigateBack()
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
wx.redirectTo({
|
||||
url: '/pages/invoiceList/index?tab=2',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '当前公司没用开票信息,请联系管理员编辑完开票信息之后再开票',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
wx.navigateBack()
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
wx.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
this.setData({ detail: {...data, }, remark: data.remark })
|
||||
},
|
||||
changeRemark(e) {
|
||||
|
|
|
@ -40,4 +40,9 @@ export const getAlreadyInvoiceList = async function(page) {
|
|||
// 开票
|
||||
export const makeInvoice = async function(data) {
|
||||
return await POST(`/wx/invoice`, data);
|
||||
}
|
||||
|
||||
// 下载发票文件
|
||||
export const downloadInvoice = async function(id, type) {
|
||||
return await POST(`/wx/downloadInvoice/${id}?type=${type}`,);
|
||||
}
|
Loading…
Reference in New Issue
Block a user