调试申请开票的时候开票信息不存在的情况

This commit is contained in:
qiaomu 2024-05-06 17:27:21 +08:00
parent 2a6447e292
commit 45cb065d6f
4 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import { getInvoiceInfoDetail } from "../../service/invoice";
import { getInvoiceInfoDetail, downloadInvoice } from "../../service/invoice";
import request from '../../utils/request'
const { OK } = request;
// pages/invoiceInfo/index.js
Page({
@ -32,13 +33,14 @@ Page({
},
download() {
// console.log('---------')
const that = this;
wx.showActionSheet({
itemList: ['发票XML文件下载', '发票PDF文件下载'],
async success(res) {
console.log('res', res.tapIndex)
const { code, message, data } = await downloadInvoice(this.data.id, res.tapIndex);
const { code, message, data } = await downloadInvoice(that.data.id, res.tapIndex);
if (code !== OK) {
}
}
})

View File

@ -24,7 +24,13 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { tab } = options;
if (isNaN(Number(tab))) {
return
}
this.setData({
active: Number(tab)
})
},
/**

View File

@ -39,6 +39,8 @@ Page({
wx.showModal({
title: '提示',
content: '当前公司没用开票信息,请先前往开票信息页面编辑开票信息',
confirmText: '前往编辑',
cancelText: '取消',
complete: (res) => {
if (res.cancel) {
wx.navigateBack()
@ -56,6 +58,8 @@ Page({
wx.showModal({
title: '提示',
content: '当前公司没用开票信息,请联系管理员编辑完开票信息之后再开票',
showCancel: false,
confirmText: '返回',
complete: (res) => {
if (res.cancel) {
wx.navigateBack()

View File

@ -44,5 +44,5 @@ export const makeInvoice = async function(data) {
// 下载发票文件
export const downloadInvoice = async function(id, type) {
return await POST(`/wx/downloadInvoice/${id}?type=${type}`,);
return await GET(`/wx/downloadInvoice/${id}?type=${type}`,);
}