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

@ -12,8 +12,9 @@
<view class="item"> <view class="item">
<view class="l">发票类型</view> <view class="l">发票类型</view>
<view class="r"> <view class="r">
<picker :value="index" :range="array" @change="bindPickerChange"> <picker :value="arrayIndex" :range="array" @change="bindPickerChange">
<view class="lx">{{index==-1?'请选择':array[index]}}</view> <view class="lx" style="color: #888;" v-if="!arrayName">请选择发票类型</view>
<view class="lx" v-else>{{arrayName}}</view>
</picker> </picker>
</view> </view>
</view> </view>
@ -86,10 +87,9 @@
content: "确认您的发票信息无误后再提交", content: "确认您的发票信息无误后再提交",
show: true, show: true,
toggleIndex: true, toggleIndex: true,
index: -1, arrayIndex: 0,
arrayName: '',
array: ['普通增值税发票'], array: ['普通增值税发票'],
index1: -1,
array1: [],
tabIndex: 2, tabIndex: 2,
orderDetail: '', orderDetail: '',
obj: { obj: {
@ -110,17 +110,18 @@
this.orderDetail = uni.getStorageSync("orderInfor"); this.orderDetail = uni.getStorageSync("orderInfor");
if (op.source == 1) { if (op.source == 1) {
let detail = op.detail ? JSON.parse(op.detail) : ''; let detail = op.detail ? JSON.parse(op.detail) : '';
app.index = detail.type == 1 ? 0 : 1; app.arrayIndex = detail.type - 1;
app.tabIndex = detail.source app.arrayName = app.array[app.arrayIndex]
app.tabIndex = detail.source == 0 ? 1 : 2
app.obj = detail app.obj = detail
} }
console.log(app.obj,this.orderDetail) console.log(app.obj, this.orderDetail)
}, },
methods: { methods: {
// //
toDetail(canReset = false) { toDetail(canReset = false) {
const app = this const app = this
if (app.index == -1) { if (!app.arrayName) {
uni.showToast({ uni.showToast({
title: '请选择发票类型', title: '请选择发票类型',
icon: 'none', icon: 'none',
@ -148,9 +149,8 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
if (result.data.length > 0) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/invoice/detail?id=" + result.data.list[0].id url: "/pages/invoice/indexset"
}) })
} else { } else {
uni.showToast({ uni.showToast({
@ -159,13 +159,6 @@
duration: 2000 duration: 2000
}) })
} }
} else {
uni.showToast({
title: result.message,
icon: 'none',
duration: 2000
})
}
}) })
// : // :
@ -185,13 +178,15 @@
}, },
tabItem(i) { tabItem(i) {
this.tabIndex = i; this.tabIndex = i;
}, },
toggleItem(i) { toggleItem(i) {
this.toggleIndex = !this.toggleIndex; this.toggleIndex = !this.toggleIndex;
this.pamres.invoiceUnit = this.toggleIndex this.pamres.invoiceUnit = this.toggleIndex
}, },
bindPickerChange(e) { bindPickerChange(e) {
this.index = e.detail.value; this.arrayIndex = e.detail.value;
this.arrayName = this.array[e.detail.value]
}, },
bindPickerChange1() { bindPickerChange1() {
uni.navigateTo({ uni.navigateTo({

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

Loading…
Cancel
Save