|
|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
- <div class="mobile-invoice mobile-content mobile-content-long vendor-invoice">
|
|
|
+ <div class="mobile-invoice mobile-content mobile-content-long vendor-invoice" :class="{'invoice-record': switchType == 'record'}" @click="showFilterInvoiceType = false">
|
|
|
<div class="switch-head">
|
|
|
<div class="com-switch-head">
|
|
|
- <span class="active com-switch-item inline-block">买家开票申请</span>
|
|
|
- <span class="com-switch-item inline-block">开票记录</span>
|
|
|
+ <span class="com-switch-item inline-block" :class="{active: switchType == 'apply'}" @click="setSwitchType('apply')">买家开票申请</span>
|
|
|
+ <span class="com-switch-item inline-block" :class="{active: switchType == 'record'}" @click="setSwitchType('record')">开票记录</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mi-remind-area">
|
|
|
+ <div class="mi-remind-area" v-if="switchType == 'apply'">
|
|
|
<p class="title">温馨提示</p>
|
|
|
<p class="content">
|
|
|
<span class="inline-block">1、</span>
|
|
|
@@ -22,29 +22,29 @@
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="search-content mi-search-content">
|
|
|
- <input type="text" placeholder="订单号/发票抬头/收票人/联系电话">
|
|
|
- <span><i class="iconfont icon-sousuo"></i></span>
|
|
|
+ <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="订单号/发票抬头/收票人/联系电话">
|
|
|
+ <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
|
|
|
</div>
|
|
|
<div class="mi-list-content">
|
|
|
<div class="mi-lc-filters clearfix">
|
|
|
- <div class="com-select-wrap fr">类型
|
|
|
- <ul class="select-list">
|
|
|
- <li>普票</li>
|
|
|
- <li>专票</li>
|
|
|
+ <div class="com-select-wrap fr" @click.stop="showFilterInvoiceType = !showFilterInvoiceType">{{filterParams.invoicetype === 1206 ? '普票' : filterParams.invoicetype === 1205 ? '专票' : '类型'}}
|
|
|
+ <ul class="select-list" v-show="showFilterInvoiceType">
|
|
|
+ <li @click.stop="setInvoiceType(1206)">普票</li>
|
|
|
+ <li @click.stop="setInvoiceType(1205)">专票</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <ul class="mi-list">
|
|
|
+ <ul class="mi-list" v-if="invoiceList.length">
|
|
|
<li v-for="inv in invoiceList" @click.stop="setActive(inv)" :class="{active: inv.$active}">
|
|
|
<div class="line">
|
|
|
<span class="inline-block title">
|
|
|
<label class="bottom-modal-check mobile-cart-check" :class="{active: inv.$active}">
|
|
|
- <input type="checkbox">
|
|
|
+ <!--<input type="checkbox">-->
|
|
|
</label>
|
|
|
类型:
|
|
|
</span>
|
|
|
<span class="inline-block content">
|
|
|
- <i class="inv" :class="{'spec-inv' : inv.type === 1205}">{{inv.type === 1206 ? '普票' : '专票'}}</i>
|
|
|
+ <i class="inv" :class="{'spec-inv' : inv.invoicetype === 1205}">{{inv.invoicetype === 1206 ? '普票' : '专票'}}</i>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="line">
|
|
|
@@ -58,8 +58,10 @@
|
|
|
订单号:
|
|
|
</span>
|
|
|
<span class="inline-block content">
|
|
|
- <template v-for="id in inv.orderidArr">
|
|
|
+ <template v-for="id in inv.orderids.split(',')">
|
|
|
+ <a class="link">
|
|
|
{{id}}
|
|
|
+ </a>
|
|
|
<br/>
|
|
|
</template>
|
|
|
</span>
|
|
|
@@ -96,20 +98,29 @@
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
+ <empty-status
|
|
|
+ :text="'暂无开票信息'"
|
|
|
+ :showLink="false"
|
|
|
+ v-else></empty-status>
|
|
|
</div>
|
|
|
- <div class="mi-fix-result">
|
|
|
+ <div class="mi-fix-result" v-if="invoiceList.length">
|
|
|
<label class="bottom-modal-check mobile-cart-check" :class="{active: allChecked}">
|
|
|
<input type="checkbox" @change="setActive()">
|
|
|
<span>全选</span>
|
|
|
</label>
|
|
|
- <button>确认开票</button>
|
|
|
+ <button @click="submit">确认开票</button>
|
|
|
</div>
|
|
|
<remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
|
|
|
<pull-up :searchMore="fetching" :allPage="invoices.data.totalPages" :page="page" @pullUpAction="onPullUp"></pull-up>
|
|
|
+ <remind-ope-modal :text="'点击【确认】系统将通知买家发票已寄出,否则请点击【取消】'"
|
|
|
+ :show="Boolean(operateIds)"
|
|
|
+ @closeAction="closeRemindOpe"
|
|
|
+ ></remind-ope-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { RemindBox, PullUp } from '~components/mobile/common'
|
|
|
+ import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
|
|
|
+ import { RemindOpeModal } from '~components/mobile/base'
|
|
|
export default {
|
|
|
layout: 'mobile',
|
|
|
middleware: 'authenticated',
|
|
|
@@ -120,12 +131,21 @@
|
|
|
invoiceList: [],
|
|
|
isChange: false,
|
|
|
page: 1,
|
|
|
- count: 10
|
|
|
+ count: 10,
|
|
|
+ filterParams: {
|
|
|
+ invoicetype: '',
|
|
|
+ keyword: ''
|
|
|
+ },
|
|
|
+ showFilterInvoiceType: false,
|
|
|
+ operateIds: null,
|
|
|
+ switchType: 'apply'
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
RemindBox,
|
|
|
- PullUp
|
|
|
+ PullUp,
|
|
|
+ RemindOpeModal,
|
|
|
+ EmptyStatus
|
|
|
},
|
|
|
fetch ({store}) {
|
|
|
return Promise.all([
|
|
|
@@ -142,7 +162,7 @@
|
|
|
}
|
|
|
let arr = this.baseUtils.deepCopy(val.content)
|
|
|
arr.forEach(item => {
|
|
|
- item.orderidArr = item.orderids.split(',')
|
|
|
+// item.orderidArr = item.orderids.split(',')
|
|
|
item.$active = false
|
|
|
})
|
|
|
this.invoiceList = [...this.invoiceList, ...arr]
|
|
|
@@ -177,6 +197,12 @@
|
|
|
this.remindText = str
|
|
|
this.timeoutCount++
|
|
|
},
|
|
|
+ initParams () {
|
|
|
+ this.page = 1
|
|
|
+ this.filterParams.invoicetype = null
|
|
|
+ this.filterParams.keyword = null
|
|
|
+ this.operateIds = null
|
|
|
+ },
|
|
|
setActive (inv) {
|
|
|
if (inv) {
|
|
|
inv.$active = !inv.$active
|
|
|
@@ -189,11 +215,62 @@
|
|
|
}
|
|
|
},
|
|
|
reloadList () {
|
|
|
- this.$store.dispatch('invoice/getInvoices', {count: this.count, page: this.page, role: 'SELLER', sorting: {'createTime': 'DESC'}, status: 101})
|
|
|
+ return this.$store.dispatch('invoice/getInvoices', {count: this.count, page: this.page, role: 'SELLER', sorting: {'createTime': 'DESC'}, status: this.switchType === 'record' ? 102 : 101, invoicetype: this.filterParams.invoicetype, keyword: this.filterParams.keyword})
|
|
|
},
|
|
|
onPullUp () {
|
|
|
this.page++
|
|
|
this.reloadList()
|
|
|
+ },
|
|
|
+ onFilter () {
|
|
|
+ this.isChange = true
|
|
|
+ this.page = 1
|
|
|
+ return this.reloadList()
|
|
|
+ },
|
|
|
+ setInvoiceType (type) {
|
|
|
+ this.filterParams.invoicetype = type
|
|
|
+ this.showFilterInvoiceType = false
|
|
|
+ this.onFilter()
|
|
|
+ },
|
|
|
+ submit () {
|
|
|
+ let arr = []
|
|
|
+ this.invoiceList.forEach(item => {
|
|
|
+ if (item.$active) {
|
|
|
+ arr.push(item.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (arr.length) {
|
|
|
+ this.operateIds = arr.join(',')
|
|
|
+ } else {
|
|
|
+ this.setRemindText('请先勾选开票申请')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ doSubmit () {
|
|
|
+ return this.$http.put(`/trade/billSubmit/${this.operateIds}`).then(res => {
|
|
|
+ if (res.data.length) {
|
|
|
+ this.setRemindText('开票成功')
|
|
|
+ this.initParams()
|
|
|
+ this.onFilter()
|
|
|
+ } else {
|
|
|
+ this.setRemindText('开票失败,请重试')
|
|
|
+ }
|
|
|
+ }, err => {
|
|
|
+ this.setRemindText(err.response.data || '开票失败,请重试')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeRemindOpe (flag) {
|
|
|
+ if (flag) {
|
|
|
+ this.doSubmit()
|
|
|
+ } else {
|
|
|
+ this.operateIds = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setSwitchType (type) {
|
|
|
+ this.initParams()
|
|
|
+ this.switchType = type
|
|
|
+ this.onFilter()
|
|
|
+// .then(() => {
|
|
|
+// this.switchType = type
|
|
|
+// })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -202,5 +279,8 @@
|
|
|
@import '~assets/scss/mobileInvoice';
|
|
|
.vendor-invoice {
|
|
|
margin-bottom: 2.3rem;
|
|
|
+ &.invoice-record {
|
|
|
+ margin-bottom: .98rem;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|