main
fanfan 7 months ago
parent 50fb92ff7b
commit 204751135b
  1. 37
      pages/invoice/edit.vue
  2. 33
      pages/invoice/editset.vue

@ -12,8 +12,9 @@
<view class="item">
<view class="l">发票类型</view>
<view class="r">
<picker :value="index" :range="array" @change="bindPickerChange">
<view class="lx">{{index==-1?'请选择':array[index]}}</view>
<picker :value="arrayIndex" :range="array" @change="bindPickerChange">
<view class="lx" style="color: #888;" v-if="!arrayName">请选择发票类型</view>
<view class="lx" v-else>{{arrayName}}</view>
</picker>
</view>
</view>
@ -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({

@ -1,20 +1,13 @@
<template>
<view class="invoice">
<!-- <view class="invoice-goods" v-if="sourcePage==0 && orderDetail">
<view class="b" v-if="orderDetail">
<view class="r">订单编号{{orderDetail.order_no}}<text @click="handleCopy(orderDetail.order_no)">复制</text>
</view>
<view class="r">开票金额{{orderDetail.pay_price}}</view>
</view>
</view> -->
<view class="invoice-info">
<view class="b">
<view class="item">
<view class="l">发票类型</view>
<view class="r">
<picker :value="index" :range="array" @change="bindPickerChange">
<view class="lx" style="color: #888;" v-if="index == -1">请选择发票类型</view>
<view class="lx" v-else>{{ array[index] }}</view>
<picker :value="arrayIndex" :range="array" @change="bindPickerChange">
<view class="lx" style="color: #888;" v-if="!arrayName">请选择发票类型</view>
<view class="lx" v-else>{{arrayName}}</view>
</picker>
</view>
</view>
@ -87,7 +80,8 @@
content: "确认您的发票信息无误后再提交",
show: true,
toggleIndex: true,
index: -1,
arrayIndex: 0,
arrayName: '',
array: ['普通增值税发票'],
tabIndex: 1,
sourcePage: 0,
@ -109,9 +103,10 @@
onLoad(op) {
if (op.detailObj && op.detailObj != 'null') {
let end = JSON.parse(op.detailObj)
this.index = -1
this.arrayIndex = end.type - 1;
this.arrayName = this.array[this.arrayIndex]
if (end.source == 1) {
this.tabIndex = 1
this.tabIndex = end.source
} else {
this.tabIndex = 2
}
@ -130,8 +125,7 @@
},
async addInvoice(canReset = false) {
const app = this
console.log(app.index,app.obj.source)
if (app.index == -1) {
if (!app.arrayName) {
uni.showToast({
title: '请选择发票类型',
icon: 'none',
@ -165,7 +159,7 @@
icon: 'none',
duration: 2000
})
app.index = -1
app.arrayIndex = 0
app.tabIndex = 1
app.obj = app.$options.data().obj;
uni.redirectTo({
@ -175,7 +169,7 @@
},
async editeInvoice() {
const app = this
if (app.index == -1) {
if (!app.arrayName) {
uni.showToast({
title: '请选择发票类型',
icon: 'none',
@ -209,7 +203,7 @@
icon: 'none',
duration: 2000
})
app.index = -1
app.arrayIndex = 0
app.tabIndex = 1
app.obj = app.$options.data().obj;
uni.redirectTo({
@ -242,7 +236,8 @@
this.toggleIndex = !this.toggleIndex;
},
bindPickerChange(e) {
this.index = e.detail.value;
this.arrayIndex = e.detail.value;
this.arrayName = this.array[e.detail.value]
},
bindPickerChange1() {
uni.navigateTo({

Loading…
Cancel
Save