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

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 // pages/invoiceInfo/index.js
Page({ Page({
@ -32,11 +33,12 @@ Page({
}, },
download() { download() {
// console.log('---------') // console.log('---------')
const that = this;
wx.showActionSheet({ wx.showActionSheet({
itemList: ['发票XML文件下载', '发票PDF文件下载'], itemList: ['发票XML文件下载', '发票PDF文件下载'],
async success(res) { async success(res) {
console.log('res', res.tapIndex) 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) { if (code !== OK) {
} }

View File

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

View File

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

View File

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