From 204751135bf6729eb613871d21069fe506d96d78 Mon Sep 17 00:00:00 2001 From: fanfan Date: Wed, 17 Apr 2024 10:52:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/invoice/edit.vue | 37 ++++++++++++++++--------------------- pages/invoice/editset.vue | 33 ++++++++++++++------------------- 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/pages/invoice/edit.vue b/pages/invoice/edit.vue index c9b7461..368471b 100644 --- a/pages/invoice/edit.vue +++ b/pages/invoice/edit.vue @@ -12,8 +12,9 @@ 发票类型: - - {{index==-1?'请选择':array[index]}} + + 请选择发票类型 + {{arrayName}} @@ -86,10 +87,9 @@ content: "确认您的发票信息无误后再提交", show: true, toggleIndex: true, - index: -1, + arrayIndex: 0, + arrayName: '', array: ['普通增值税发票'], - index1: -1, - array1: [], tabIndex: 2, orderDetail: '', obj: { @@ -110,17 +110,18 @@ this.orderDetail = uni.getStorageSync("orderInfor"); if (op.source == 1) { let detail = op.detail ? JSON.parse(op.detail) : ''; - app.index = detail.type == 1 ? 0 : 1; - app.tabIndex = detail.source + app.arrayIndex = detail.type - 1; + app.arrayName = app.array[app.arrayIndex] + app.tabIndex = detail.source == 0 ? 1 : 2 app.obj = detail } - console.log(app.obj,this.orderDetail) + console.log(app.obj, this.orderDetail) }, methods: { // 获取当前订单信息 toDetail(canReset = false) { const app = this - if (app.index == -1) { + if (!app.arrayName) { uni.showToast({ title: '请选择发票类型', icon: 'none', @@ -148,17 +149,9 @@ icon: 'none', duration: 2000 }) - if (result.data.length > 0) { - uni.navigateTo({ - url: "/pages/invoice/detail?id=" + result.data.list[0].id - }) - } else { - uni.showToast({ - title: result.message, - icon: 'none', - duration: 2000 - }) - } + uni.navigateTo({ + url: "/pages/invoice/indexset" + }) } else { uni.showToast({ title: result.message, @@ -185,13 +178,15 @@ }, tabItem(i) { this.tabIndex = i; + }, toggleItem(i) { this.toggleIndex = !this.toggleIndex; this.pamres.invoiceUnit = this.toggleIndex }, bindPickerChange(e) { - this.index = e.detail.value; + this.arrayIndex = e.detail.value; + this.arrayName = this.array[e.detail.value] }, bindPickerChange1() { uni.navigateTo({ diff --git a/pages/invoice/editset.vue b/pages/invoice/editset.vue index f8928b4..939a1b1 100644 --- a/pages/invoice/editset.vue +++ b/pages/invoice/editset.vue @@ -1,20 +1,13 @@