首页新增跳转用电查询

This commit is contained in:
2024-05-07 08:45:49 +08:00
parent 63cb2f8250
commit 9fddb955ce
4 changed files with 51 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
import { getInvoiceInfo, makeInvoice } from "../../service/invoice"
import { alertInfo, alertSuccess } from "../../utils/index";
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request
@@ -91,14 +91,22 @@ Page({
},
async onSubmit() {
const {ids = [], remark } = this.data;
const tenement = wx.getStorageSync('tenement')
const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("开票成功,未完")
loadingFunc(async() => {
const {ids = [], remark } = this.data;
const tenement = wx.getStorageSync('tenement')
const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("操作成功")
setTimeout(() => {
wx.redirectTo({
url: '/pages/invoiceList/index?tab=1',
})
}, 500)
})
},
changeShow() {
this.setData({ show: true })