|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="invoice"> |
|
|
|
<view class="invoice"> |
|
|
|
<view class="invoice-goods" v-if="sourcePage==0 && orderDetail"> |
|
|
|
<view class="invoice-goods" v-if="orderDetail"> |
|
|
|
<view class="b" v-if="orderDetail"> |
|
|
|
<view class="b" v-if="orderDetail"> |
|
|
|
<view class="r">订单编号:{{orderDetail.order_no}}<text @click="handleCopy(orderDetail.order_no)">复制</text> |
|
|
|
<view class="r">订单编号:{{orderDetail.order_no}}<text @click="handleCopy(orderDetail.order_no)">复制</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -24,7 +24,7 @@ |
|
|
|
<view class="li" :class="tabIndex == 2?'li-on':''" @click="tabItem(2)">单位</view> |
|
|
|
<view class="li" :class="tabIndex == 2?'li-on':''" @click="tabItem(2)">单位</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="item" v-if="tabIndex == 1"> |
|
|
|
<view class="l">发票抬头:</view> |
|
|
|
<view class="l">发票抬头:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="text" v-model="obj.header" placeholder="请输入个人姓名" /> |
|
|
|
<input type="text" v-model="obj.header" placeholder="请输入个人姓名" /> |
|
|
@ -33,14 +33,14 @@ |
|
|
|
<view class="item" v-if="tabIndex == 2"> |
|
|
|
<view class="item" v-if="tabIndex == 2"> |
|
|
|
<view class="l">发票抬头:</view> |
|
|
|
<view class="l">发票抬头:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="text" v-model="array1[index1]" placeholder="请输入单位名称" /> |
|
|
|
<input type="text" disabled v-model="obj.header" placeholder="单位名称" /> |
|
|
|
<view class="tt" @click="bindPickerChange1" style="color: rgb(58, 134, 255;">选择发票抬头</view> |
|
|
|
<view class="tt" @click="bindPickerChange1" style="color: rgb(58, 134, 255;">选择发票抬头</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item" v-if="tabIndex == 2"> |
|
|
|
<view class="item" v-if="tabIndex == 2"> |
|
|
|
<view class="l">单位税号:</view> |
|
|
|
<view class="l">单位税号:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="text" v-model="obj.duty_no" placeholder="请输入纳税人识别号" /> |
|
|
|
<input type="text" v-model="obj.duty_no" disabled placeholder="纳税人识别号" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -53,31 +53,31 @@ |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
|
<view class="l">开户银行:</view> |
|
|
|
<view class="l">开户银行:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="text" v-model="obj.bank_name" placeholder="请输入开户银行名称" /> |
|
|
|
<input type="text" disabled v-model="obj.bank_name" placeholder="开户银行名称" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
|
<view class="l">银行账号:</view> |
|
|
|
<view class="l">银行账号:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="number" v-model="obj.bank_no" placeholder="请输入银行账号" /> |
|
|
|
<input type="number" disabled v-model="obj.bank_no" placeholder="银行账号" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
|
<view class="l">单位地址:</view> |
|
|
|
<view class="l">单位地址:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="text" v-model="obj.address" placeholder="请输入单位地址" /> |
|
|
|
<input type="text" disabled v-model="obj.address" placeholder="单位地址" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
|
<view class="l">单位电话:</view> |
|
|
|
<view class="l">单位电话:</view> |
|
|
|
<view class="r"> |
|
|
|
<view class="r"> |
|
|
|
<input type="number" v-model="obj.phone" placeholder="请输入单位电话" /> |
|
|
|
<input type="number" disabled v-model="obj.phone" placeholder="单位电话" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="invoice-fd" @click="toDetail()"> |
|
|
|
<view class="invoice-fd" @click="toDetail()"> |
|
|
|
{{(sourcePage==0 ||sourcePage==1)?'申请发票':'编辑发票'}} |
|
|
|
申请发票 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-modal v-model="show" :content="content" :show-cancel-button="true" :show-title="false" |
|
|
|
<u-modal v-model="show" :content="content" :show-cancel-button="true" :show-title="false" |
|
|
|
confirm-color="#F55349"></u-modal> |
|
|
|
confirm-color="#F55349"></u-modal> |
|
|
@ -97,9 +97,7 @@ |
|
|
|
index1: -1, |
|
|
|
index1: -1, |
|
|
|
array1: [], |
|
|
|
array1: [], |
|
|
|
tabIndex: 2, |
|
|
|
tabIndex: 2, |
|
|
|
sourcePage: 0, |
|
|
|
|
|
|
|
orderDetail: '', |
|
|
|
orderDetail: '', |
|
|
|
orderId: '', |
|
|
|
|
|
|
|
obj: { |
|
|
|
obj: { |
|
|
|
header: '', |
|
|
|
header: '', |
|
|
|
gongsi: '', |
|
|
|
gongsi: '', |
|
|
@ -111,23 +109,18 @@ |
|
|
|
type: '', |
|
|
|
type: '', |
|
|
|
source: 2 |
|
|
|
source: 2 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(op) { |
|
|
|
onLoad(op) { |
|
|
|
let app = this; |
|
|
|
let app = this; |
|
|
|
app.orderId = op.orderId |
|
|
|
this.orderDetail = uni.getStorageSync("orderInfor"); |
|
|
|
app.sourcePage = op.source == 1 ? op.source : 0 |
|
|
|
if (op.source == 1) { |
|
|
|
if (op.source == 0) { |
|
|
|
|
|
|
|
app.orderDetail = op.order ? JSON.parse(op.order) : ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (op.source == 2 || 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.index = detail.type == 1 ? 0 : 1; |
|
|
|
app.tabIndex = detail.source |
|
|
|
app.tabIndex = detail.source |
|
|
|
app.obj = detail |
|
|
|
app.obj = detail |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(app.obj,this.orderDetail) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 获取当前订单信息 |
|
|
|
// 获取当前订单信息 |
|
|
@ -143,43 +136,18 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
if (!app.obj.header) { |
|
|
|
if (!app.obj.header) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入抬头', |
|
|
|
title: '请选择发票抬头', |
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (app.tabIndex == 2 && !app.obj.duty_no) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '请输入抬头', |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
app.isLoading = true; |
|
|
|
app.isLoading = true; |
|
|
|
if (app.tabIndex == 1) { |
|
|
|
let parames = { |
|
|
|
app.obj.gongsi = ''; |
|
|
|
order_id: app.orderDetail.order_id, |
|
|
|
app.obj.duty_no = ''; |
|
|
|
invoice_id: app.obj.id |
|
|
|
app.obj.bank_name = ''; |
|
|
|
} |
|
|
|
app.obj.bank_no = ''; |
|
|
|
InvoiceApi.invoicingAdd(parames).then(result => { |
|
|
|
app.obj.address = ''; |
|
|
|
|
|
|
|
app.obj.phone = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
app.obj.type = app.index == 0 ? 1 : 2; |
|
|
|
|
|
|
|
app.obj.source = app.tabIndex; |
|
|
|
|
|
|
|
let url = '' |
|
|
|
|
|
|
|
if (app.sourcePage == 0) { //开票addInvoicing editInvoicing invoicingAdd |
|
|
|
|
|
|
|
url = InvoiceApi.invoicingAdd(app.orderId, app.obj) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (app.sourcePage == 1) { //我的开票使用某一个开票 |
|
|
|
|
|
|
|
app.obj.invoice_id = app.obj.id; //选择 |
|
|
|
|
|
|
|
url = InvoiceApi.invoicingAdd(app.orderId, app.obj) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (app.sourcePage == 2) { //申请记录 修改抬头 |
|
|
|
|
|
|
|
url = InvoiceApi.invoicingEdit(app.orderId, app.obj) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
url.then(result => { |
|
|
|
|
|
|
|
if (result.status == 200) { |
|
|
|
if (result.status == 200) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: result.message, |
|
|
|
title: result.message, |
|
|
@ -221,11 +189,6 @@ |
|
|
|
}) => app.$toast('复制失败 ' + errMsg) |
|
|
|
}) => app.$toast('复制失败 ' + errMsg) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交信息 |
|
|
|
|
|
|
|
handleInvoice() { |
|
|
|
|
|
|
|
const app = this |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onClose() {}, |
|
|
|
|
|
|
|
tabItem(i) { |
|
|
|
tabItem(i) { |
|
|
|
this.tabIndex = i; |
|
|
|
this.tabIndex = i; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -238,7 +201,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
bindPickerChange1() { |
|
|
|
bindPickerChange1() { |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/pages/invoice/index?orderId=" + this.orderId +'&order='+(this.orderDetail?JSON.stringify(this.orderDetail):'') |
|
|
|
url: "/pages/invoice/index" |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -249,6 +212,7 @@ |
|
|
|
page { |
|
|
|
page { |
|
|
|
margin-bottom: 50rpx; |
|
|
|
margin-bottom: 50rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.invoice { |
|
|
|
.invoice { |
|
|
|
&-goods { |
|
|
|
&-goods { |
|
|
|
padding: 0 20rpx 0 40rpx; |
|
|
|
padding: 0 20rpx 0 40rpx; |
|
|
|