发票细节

main
fanfan 12 months ago
parent 8e095ce99e
commit f974b8c26b
  1. 16
      api/invoice.js
  2. 76
      pages/invoice/edit.vue
  3. 33
      pages/invoice/editset.vue
  4. 26
      pages/invoice/index.vue
  5. 2
      pages/invoice/list.vue
  6. 23
      pages/order/detail.vue
  7. 4
      pages/order/index.vue

@ -15,17 +15,11 @@ const api = {
export const invoicingDelNew = (data) => { export const invoicingDelNew = (data) => {
return request.get(api.invoicingDelNew,data) return request.get(api.invoicingDelNew,data)
} }
export const invoicingEdit = (orderGoodsId, data) => { export const invoicingEdit = (data) => {
return request.post(api.invoicingEdit, { return request.post(api.invoicingEdit,data)
orderGoodsId, }
form: data export const invoicingAdd = (data) => {
}) return request.post(api.invoicingAdd,data)
}
export const invoicingAdd = (orderGoodsId, data) => {
return request.post(api.invoicingAdd, {
orderGoodsId,
form: data
})
} }
export const addInvoicing = (data) => { export const addInvoicing = (data) => {
return request.post(api.addInvoicing,data) return request.post(api.addInvoicing,data)

@ -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;

@ -75,9 +75,6 @@
提交 提交
</view> </view>
</view> </view>
<!-- <u-modal v-model="show" :content="content" :show-cancel-button="true" :show-title="false"
confirm-color="#F55349"></u-modal> -->
</view> </view>
</template> </template>
@ -92,7 +89,7 @@ export default {
toggleIndex: true, toggleIndex: true,
index: null, index: null,
array: ['普通增值税发票'], array: ['普通增值税发票'],
tabIndex: null, tabIndex: 1,
sourcePage: 0, sourcePage: 0,
orderDetail: '', orderDetail: '',
orderId: '', orderId: '',
@ -120,18 +117,6 @@ export default {
} }
this.obj = end this.obj = end
} }
// let app = this;
// app.orderId = op.orderId
// app.sourcePage = op.source == 1 ? op.source : 0
// 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) : '';
// app.index = detail.type == 1 ? 0 : 1;
// app.tabIndex = detail.source
// app.obj = detail
// }
}, },
methods: { methods: {
@ -180,8 +165,11 @@ export default {
duration: 2000 duration: 2000
}) })
app.index = null app.index = null
app.tabIndex =null app.tabIndex = 1
app.obj = app.$options.data().obj app.obj = app.$options.data().obj;
uni.redirectTo({
url: "/pages/invoice/index"
})
} }
}, },
async editeInvoice() { async editeInvoice() {
@ -221,8 +209,11 @@ export default {
duration: 2000 duration: 2000
}) })
app.index = null app.index = null
app.tabIndex =null app.tabIndex = 1
app.obj = app.$options.data().obj app.obj = app.$options.data().obj;
uni.redirectTo({
url: "/pages/invoice/index"
})
} }
}, },
@ -254,7 +245,7 @@ export default {
}, },
bindPickerChange1() { bindPickerChange1() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/invoice/index?orderId=" + this.orderId + '&order=' + (app.orderDetail ? JSON.stringify(app.orderDetail) : '') url: "/pages/invoice/index"
}) })
} }
} }

@ -3,9 +3,9 @@
<view class="invoice-bd"> <view class="invoice-bd">
<view class="item" :class="tabIndex == index?'item-on':''" v-for="(item,index) in invoicList" :key="index"> <view class="item" :class="tabIndex == index?'item-on':''" v-for="(item,index) in invoicList" :key="index">
<view class="hd"> <view class="hd">
<view class="l" @click="toDetail(item.id)"> <view class="l" @click="toDetail(item.id,item)">
<view class="a"> <view class="a">
<text>单位</text>{{item.header}} <text>{{item.source==2?'单位':'个人'}}</text>{{item.header}}
</view> </view>
<view class="b"> <view class="b">
<text>税号</text>{{item.duty_no}} <text>税号</text>{{item.duty_no}}
@ -15,12 +15,11 @@
</view> </view>
<view class="bd"> <view class="bd">
<view class="c" @click.stop="selectItem(index,item.id)"> <view class="c" @click.stop="selectItem(index,item.id)">
<image v-if="tabIndex == i" src="/static/invoice/select-on.png"></image> <u-icon :name="tabMo == index?'checkmark-circle-fill':'checkmark-circle'" :color="tabMo == index?'#E02E24':'#999'" customStyle="margin-right:6rpx" size="45"></u-icon>
<image v-else src="/static/invoice/select.png"></image> {{tabMo == index?'已设为默认':'设为默认'}}
{{tabIndex == i?'已设为默认':'设为默认'}}
</view> </view>
<view class="d"> <view class="d">
<text @click.stop="toDetail(item.id)">编辑</text> <text @click.stop="toDetail(item.id,item)">编辑</text>
<text @click.stop="onDel(item.id)">删除</text> <text @click.stop="onDel(item.id)">删除</text>
</view> </view>
</view> </view>
@ -43,11 +42,10 @@
isShow: true, isShow: true,
invoicList: [], invoicList: [],
orderId: '', orderId: '',
order: '' tabMo:0
}; };
}, },
onLoad(op) { onLoad(op) {
this.order = op.order ? JSON.parse(op.order) : '';
this.orderId = op.orderId this.orderId = op.orderId
this.getMyInvoicing() this.getMyInvoicing()
}, },
@ -80,18 +78,16 @@
}) })
}, },
selectItem(i, Id) { selectItem(i, Id) {
this.tabIndex = i this.tabMo = i
}, },
onUse(item) { onUse(item) {
uni.navigateTo({ uni.redirectTo({
url: "/pages/invoice/edit?detail=" + JSON.stringify(item) + '&source=' + 1 + '&orderId=' + this url: "/pages/invoice/edit?detail=" + JSON.stringify(item) + '&source=' + 1 + '&orderId=' + this.orderId
.orderId + '&order=' + (this.order ? JSON.stringify(this.order) : '')
.orderId
}) })
}, },
toDetail(id) { toDetail(id,item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/invoice/editset?id=" + id url: "/pages/invoice/editset?id=" + id+'&detailObj='+JSON.stringify(item)
}) })
}, },
onAddInvoice() { onAddInvoice() {

@ -74,7 +74,7 @@
methods: { methods: {
toEdit(item) { toEdit(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/invoice/edit?detail=" + JSON.stringify(item) + '&source=' + 2 url: "/pages/invoice/editset?id=" + item.id
}) })
}, },
onTab(e) { onTab(e) {

@ -61,7 +61,8 @@
<view class="name">{{ order.to_store_time }}</view> <view class="name">{{ order.to_store_time }}</view>
</view> </view>
</view> </view>
<view class="conRight" @click="openCode" v-if="order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_type == DeliveryTypeEnum.EXTRACT.value"> <view class="conRight" @click="openCode"
v-if="order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_type == DeliveryTypeEnum.EXTRACT.value">
<view class="code"> <view class="code">
核销码 核销码
</view> </view>
@ -144,13 +145,10 @@
{{ order.total_num }}件商品实付款<text>{{ order.pay_price?Number(order.pay_price):order.pay_price }}</text> {{ order.total_num }}件商品实付款<text>{{ order.pay_price?Number(order.pay_price):order.pay_price }}</text>
</view> </view>
<view class="line" <view class="line"
v-if="order.order_status == OrderStatusEnum.NORMAL.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value" v-if="order.order_status == OrderStatusEnum.NORMAL.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value">
>
</view> </view>
<view class="cancel" @click="onCancel(order.order_id)" <view class="cancel" @click="onCancel(order.order_id)"
v-if="order.order_status == OrderStatusEnum.NORMAL.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value" v-if="order.order_status == OrderStatusEnum.NORMAL.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value">
>
取消订单 取消订单
</view> </view>
</view> </view>
@ -296,7 +294,8 @@
v-if="order.pay_status == PayStatusEnum.PENDING.value &&order.order_status == OrderStatusEnum.NORMAL.value"> v-if="order.pay_status == PayStatusEnum.PENDING.value &&order.order_status == OrderStatusEnum.NORMAL.value">
立即支付 立即支付
</view> </view>
<view class="buyAgain" @click="onQrcodeImage(order.order_id)" v-if="order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_type == DeliveryTypeEnum.EXTRACT.value"> <view class="buyAgain" @click="onQrcodeImage(order.order_id)"
v-if="order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_type == DeliveryTypeEnum.EXTRACT.value">
核销码 核销码
</view> </view>
<view class="buyAgain" @click="handleTargetExpress(order.order_id)" <view class="buyAgain" @click="handleTargetExpress(order.order_id)"
@ -322,8 +321,7 @@
评价 评价
</view> --> </view> -->
<view class="buyAgain" v-if="userInfo.user_type == 40" @click="onCopyOrderInfo(order.copy_text)" <view class="buyAgain" v-if="userInfo.user_type == 40" @click="onCopyOrderInfo(order.copy_text)"
style="width: 200rpx;color:#fff;background: linear-gradient( 180deg, #FD5D06 0%, #F3211A 100%);" style="width: 200rpx;color:#fff;background: linear-gradient( 180deg, #FD5D06 0%, #F3211A 100%);">
>
复制订单详情 复制订单详情
</view> </view>
</view> </view>
@ -584,10 +582,9 @@
}, },
// //
onInvoicing(orderId) { onInvoicing(orderId) {
uni.setStorageSync("orderInfor", order);
uni.navigateTo({ uni.navigateTo({
url: '/pages/invoice/edit?orderId=' + orderId + '&source=' + 0 + "&order=" + JSON.stringify( url: '/pages/invoice/edit?orderId=' + orderId
this
.order)
}) })
}, },
// //
@ -1225,6 +1222,7 @@
.callShop { .callShop {
position: relative; position: relative;
image { image {
width: 26rpx; width: 26rpx;
height: 26rpx; height: 26rpx;
@ -1236,6 +1234,7 @@
font-weight: 400; font-weight: 400;
color: #1E1E1E; color: #1E1E1E;
line-height: 34rpx; line-height: 34rpx;
button { button {
width: 100%; width: 100%;
height: 100%; height: 100%;

@ -416,9 +416,9 @@
}, },
// //
onInvoicing(orderId, order) { onInvoicing(orderId, order) {
uni.setStorageSync("orderInfor", order);
uni.navigateTo({ uni.navigateTo({
url: '/pages/invoice/edit?orderId=' + orderId + '&source=' + 0 + "&order=" + JSON.stringify( url: '/pages/invoice/edit?orderId=' + orderId
order)
}) })
}, },
// 退 // 退

Loading…
Cancel
Save