Browse Source

发票管理

master
wanghongjun 2 years ago
parent
commit
38ed43f2d4
  1. 11
      api/order.js
  2. 4
      pages.json
  3. 284
      pages/user/billManage/index.vue

11
api/order.js

@ -10,7 +10,8 @@ const api = {
receipt: 'order/receipt',
pay: 'order/pay',
ordquery:'AgencyAddress/order/queryRrder' //订单查询
ordquery:'AgencyAddress/order/queryRrder', //订单查询
getTicket:'AgencyAddress/order/getTicket', //发票管理
}
// 当前用户待处理的订单数量
@ -54,4 +55,12 @@ export function ordquery(data){
"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"
}}
return request.post(api.ordquery,data,option)
}
// order query
export function getTicket(data){
let option={header:{
"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"
}}
return request.post(api.getTicket,data,option)
}

4
pages.json

@ -334,7 +334,9 @@
"style" :
{
"navigationBarTitleText" : "发票管理",
"enablePullDownRefresh" : false
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#1c223b",
"enablePullDownRefresh" : true
}
},
{

284
pages/user/billManage/index.vue

@ -0,0 +1,284 @@
<template>
<view class="container">
<!-- tab栏 -->
<u-tabs :list="tabs" :is-scroll="false" :barWidth="110" :current="curTab" active-color="#164b71" :duration="0.5" @change="onChangeTab" />
<!-- 订单列表 -->
<view class="order-list" v-if="list.length > 0">
<view class="order-item" v-for="(item, index) in list" :key="index">
<view class="item-top">
<view class="item-top-left">
<text class="order-time">订单号{{ item.batchcode }}</text>
</view>
<view class="item-top-right">
<text class="state-text">{{item.ticket_status}}</text>
</view>
</view>
<view class="goods-list" >
<!-- 商品信息 -->
<view class="goods-content">
<view class="goods-title">
<view class="twoline-hide">
<text class="twoline-hide-date">开票时间{{ item.tickettime }}</text>
</view>
<view class="twoline-hide">
<text class="twoline-hide-ticket">
发票编号{{ item.ticketid }}
</text>
</view>
<view class="twoline-hide">
<text class="twoline-hide-price">
开票金额 {{ item.ticketmoney }}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 空白提示 -->
<view v-else class="cate-right-cont">
<view class="empty-content">
<view class="empty-icon">
<image class="image" src="/static/empty.png" mode="widthFix"></image>
</view>
<view class="tips">暂无数据</view>
</view>
</view>
</view>
</template>
<script>
import * as OrderApi from '@/api/order'
import { checkLogin } from '@/core/app'
import Empty from '@/components/empty'
// tab
const tabs = [
{name: `全部发票`,value: 'all',key: 0},
{name: `未开票`,value: 'payment',key: 1},
{name: `开票中`,value: 'delivery',key: 2},
{name: `开票失败`,value: 'hasabort',key: 3},
{name: `已开票`,value: 'hasclosed',key: 5},
]
export default {
components: {
Empty
},
data() {
return {
//
options: { dataType: 'all' },
// tab
tabs,
//
curTab: 0,
//
list: [
{
batchcode: '12331231',
ticket_status: '开票中',
ticketmoney: '100.00',
tickettime: '2024-07-01 12:0:00',
ticketid: '41646455613131313',
},
{
batchcode: '12312321312',
ticket_status: '开票中',
ticketmoney: '100.00',
tickettime: '2024-07-01 12:0:00',
ticketid: '41646455613131313',
},
{
batchcode: '31221312312',
ticket_status: '开票中',
ticketmoney: '100.00',
tickettime: '2024-07-01 12:0:00',
ticketid: '41646455613131313',
},
],
// onShow
canReset: false,
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//
this.initCurTab(options)
// :
uni.$on('syncRefresh', canReset => {
this.canReset = canReset
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.canReset = false
},
/**
* 生命周期函数--监听页面的卸载
*/
onUnload() {
//
uni.$off('syncRefresh')
},
methods: {
//
initCurTab(options) {
//
this.isLogin = checkLogin()
if(!this.isLogin){
uni.navigateTo({
url:"/pages/login/index"
})
}
//
const app = this
if (options.dataType) {
const index = app.tabs.findIndex(item => item.value == options.dataType)
app.curTab = index > -1 ? index : 0
}
this.getOrderList()
},
//
getOrderList() {
const app = this
let isliCode = uni.getStorageSync("isliCode")
let data = {
user_isli: isliCode,
ticket_status: app.getTabValue(),
}
OrderApi.getTicket(data).then(result => {
if (result.resultCode === '00000000') {
app.list = result.data
app.initList(app.list)
}
})
},
//
initList(newList) {
newList.forEach(item => {
item.ticket_status = this.showStateText(item.ticket_status)
})
return newList
},
//
showStateText(state){
let state_txt="";
if(state=="1"){
state_txt="未开票"
}else if(state =="2" ){
state_txt="开票中"
} else if(state=="3"){
state_txt="已开票"
} else if(state == "4"){
state_txt="开票失败"
}else{
state_txt=state
}
return state_txt;
},
//
getTabValue() {
return this.tabs[this.curTab].key
},
//
onChangeTab(index) {
const app = this
//
app.curTab = index
app.getOrderList()
},
}
}
</script>
<style lang="scss" scoped>
//
.order-item {
margin: 20rpx auto 20rpx auto;
padding: 30rpx 30rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
}
//
.item-top {
display: flex;
justify-content: space-between;
font-size: 36rpx;
margin-bottom: 20rpx;
padding-bottom: 20rpx;
.order-time {
font-size: 34rpx;
}
.state-text {
color: #164b71;
}
}
//
.goods-list {
//
.goods-content {
margin-right: 10rpx;
font-size: 28rpx;
.goods-title {
.twoline-hide-date {
color: #9F9F9F;
}
.twoline-hide {
margin-top: 10rpx;
}
.twoline-hide-price{
color: #c3463b;
}
}
}
}
//
.cate-right-cont {
width: 100%;
display: flex;
flex-flow: row wrap;
align-content: flex-start;
padding-top: 15rpx;
.cate-two-box {
width: 100%;
padding: 0 10px;
}
//
.empty-content {
box-sizing: border-box;
width: 100%;
padding: 140rpx 50rpx;
text-align: center;
.tips {
font-size: 28rpx;
color: gray;
margin: 50rpx 0;
}
.empty-icon .image {
width: 280rpx;
}
}
}
</style>
Loading…
Cancel
Save