| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692 |
- <template>
- <div class="invoice-wrapper mobile-invoice">
- <div class="mobile-nav">
- <div class="mobile-header mobile-center-header">
- <a @click="goLastPage()"><i class="iconfont icon-fanhui"></i></a>
- <p>发票管理</p>
- <p class="en-name">
- <img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}
- </p>
- </div>
- </div>
- <div class="order-nav">
- <div class="active"><span>申请开票</span></div>
- <nuxt-link to="/mobile/center/user/invoice/invoiceRecord?status=101" tag="div"><span>待卖家开票</span></nuxt-link>
- <!--<div class="active"><span>待开票订单</span></div>-->
- <nuxt-link to="/mobile/center/user/invoice/invoiceRecord?status=102" tag=div><span>已开票</span></nuxt-link>
- </div>
- <div class="invoice-wrapper-el" id="invoicewrapperel">
- <div class="search-content mi-search-content">
- <input type="text" placeholder="卖家/订单号/收票人/联系电话" v-model="keyword">
- <span @click="searchMore()"><i class="iconfont icon-sousuo"></i></span>
- </div>
- <div class="mobile-invoice" >
- <div class="mi-remind-area" :class="{less: !showMoreRemind}" style="margin-bottom: 0.15rem;">
- <p class="title">温馨提示</p>
- <p class="content">
- <span class="inline-block">1、</span>
- <span class="inline-block">申请发票时默认将同一店铺的订单合并开一张发票,如需分开开票,请分别申请;</span>
- </p>
- <p class="content">
- <span class="inline-block">2、</span>
- <span class="inline-block">您只能对订单状态为<b>“交易完成”</b>,且已不能再发起售后的人民币交易订单进行补开发票;</span>
- </p>
- <p class="content">
- <span class="inline-block">3、</span>
- <span class="inline-block">发票金额为产品总金额且不含运费、积分、优惠卷、促销折扣等金额;</span>
- </p>
- <p class="content">
- <span class="inline-block">4、</span>
- <span class="inline-block">发票邮寄费用将由卖家承担。</span>
- </p>
- <p class="more" @click="showMoreRemind = !showMoreRemind">{{showMoreRemind ? '收起' : '查看更多'}}
- <i v-show="showMoreRemind" class="iconfont icon-shangshuangjiantou"></i>
- <i v-show="!showMoreRemind" class="iconfont icon-xiashuangjiantou"></i>
- </p>
- </div>
- <div class="mi-list-content">
- <ul class="mi-list" v-if="invoiceList.length > 0">
- <li v-for="inv in invoiceList" @click.stop="setActive(inv)" :class="{active: inv.$active}">
- <div class="line">
- <span class="inline-block">
- <label class="bottom-modal-check mobile-cart-check" :class="{active: inv.$active}">
- <!--<input type="checkbox">-->
- </label>
- <!--商家名称:-->
- </span>
- <span class="inline-block content" style="text-align: left;margin-left:0.1rem;color: #333;">{{getTime(inv.paytime)}}</span>
- <!--<span class="inline-block content" @click.stop="toShopdetails(inv)">{{inv.sellername}}</span>-->
- </div>
- <div class="line clearfix">
- <div class="pull-left =" style="width: 65%">
- <span class="inline-block">卖家:</span>
- <span class="inline-block overhiden" style="width: 3.2rem" @click.stop="toShopdetails(inv)">{{inv.sellername}}</span>
- </div>
- <div class="pull-left" style="width: 35%">
- <span class="inline-block">
- 金额:
- </span>
- <span class="inline-block pri overhiden" style="width: 1.3rem">¥{{inv.price}}</span>
- </div>
- <div style="clear:both"></div>
- <div style="margin-top: 0.26rem">
- <span class="inline-block">
- 订单号:
- </span>
- <span class="inline-block content" @click.stop="lookOrderDetail(inv)" style="text-align: left">
- {{inv.orderid}}
- </span>
- </div>
- </div>
- </li>
- </ul>
- <div class="com-none-state" v-if="invoiceList.length === 0" style="background:rgba(0,0,0,0)">
- <img src="/images/mobile/@2x/empty-collect.png">
- <p>抱歉,暂无发票消息</p>
- </div>
- </div>
- </div>
- </div>
- <div class="mobile-invoice">
- <div class="mi-fix-result" v-if="invoiceList.length > 0">
- <label class="bottom-modal-check mobile-cart-check" :class="{active: allChecked}">
- <input type="checkbox" @change="setActive()">
- <span>全选</span>
- </label>
- <button @click="applyInvoice()">申请开票</button>
- </div>
- </div>
- <mobile-footer></mobile-footer>
- <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
- <addinvoice
- :chooseItem="addItem"
- @addinvoiceBtn="addinvoiceFn"
- v-if="showAddinvoice"
- :joinType="joinType"
- ></addinvoice>
- <pull-up :fixId="'invoicewrapperel'" :searchMore="fetching" :allPage="invoices.data.totalPages" :page="page" @pullUpAction="onPullUp"></pull-up>
- <!-- 申请发票弹窗 -->
- <div class="mobile-modal" @touchmove="preventTouchMove($event)" v-show="showSend">
- <div class="applyinvoice_Alert" >
- <div class="applyinvoice_title">申请开票<span><i class="iconfont icon-guanbi1" @click="showSend = false"></i></span></div>
- <div ref="applyinvoiceAlert" class="scrollContent" >
- <div>
- <div class="applyinvoice-ul" v-if="invoiceArr.length > 0">
- <div class="addinvoice-focus clearfix">
- <div class="pull-left addinvoice-focus-name">发票类型:</div>
- <div class="pull-left clearfix">
- <div class="normal pull-left" style="margin-right: 0.2rem;" @click="chooseVoice('speci', 1205)" v-if="showSpeciBtn">
- <div class="icon" :class="waitinvoiceType === 'speci' ? 'active' : ''">
- <div class="icon-next"></div>
- </div>
- 增值税专票
- </div>
- <div class="normal pull-left" @click="chooseVoice('normal', 1206)" v-if="showNormalBtn">
- <div class="icon" :class="waitinvoiceType === 'normal' ? 'active' : ''">
- <div class="icon-next"></div>
- </div>
- 增值税普票
- </div>
- </div>
- </div>
- <div class="addinvoice-focus clearfix">
- <div class="pull-left addinvoice-focus-name">发票抬头:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.head}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" v-if="chooseItem.kind === 1205">
- <div class="pull-left addinvoice-focus-name">单位地址:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.companyAddress}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" v-if="chooseItem.kind === 1205">
- <div class="pull-left addinvoice-focus-name">单位电话:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.companyPhone}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" v-if="chooseItem.kind === 1205">
- <div class="pull-left addinvoice-focus-name">税务登记号:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.companyTaxNumber}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" v-if="chooseItem.kind === 1205">
- <div class="pull-left addinvoice-focus-name">开户银行:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.bankName}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" v-if="chooseItem.kind === 1205">
- <div class="pull-left addinvoice-focus-name">开户银行账号:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.bankAccount}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" >
- <div class="pull-left addinvoice-focus-name">收票人:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.name}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" >
- <div class="pull-left addinvoice-focus-name">联系电话:</div>
- <div class="pull-left clearfix overhiden" style="width: 5rem">
- {{chooseItem.telephone}}
- </div>
- </div>
- <div class="addinvoice-focus clearfix" >
- <div class="pull-left addinvoice-focus-name">收票地址:</div>
- <div class="pull-left clearfix">
- <p style="line-height:0.4rem">{{chooseItem.area}}</p>
- <!--<div class="pull-left clearfix overhiden" style="width: 5rem">-->
- <p style="line-height:0.4rem;width: 5rem" class='overhiden'>{{chooseItem.detailAddress}}</p>
- </div>
- </div>
- </div>
- <div class="applyinvoice-ul" v-else>
- <div class="addinvoice-focus clearfix">
- <div class="pull-left addinvoice-focus-name">暂无发票信息:</div>
- <div class="pull-left clearfix" @click="addInvoiceNew()" style="color: #3e82f5">
- <img src="/images/mobile/center/user/icon-rm-invoice.png"/>新增发票
- </div>
- </div>
- </div>
- <div class="applyinvoive_infotitle">共<a class="blue">{{applyObj.sellNameCount.length}}</a>个商家,<a class="blue">{{applyObj.orderNum}}</a>个订单,发票金额总计:<a class="red">¥{{applyObj.allPrice}}</a>元</div>
- <div class="applyinvoive_detailinfo">
- <div class="clearfix" v-for="info in applyObj.sellNameCount">
- <div class="pull-left">{{info.sellername}}</div>
- <div class="pull-right">金额:¥{{info.orderAllPrice}}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="applyinvoice_controll clearfix">
- <div @click="showSend = false" class="pull-left">取消</div>
- <div class="pull-right" @click="applyInvoiceFn()">确认</div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { EncryptionFilter } from '~utils/tools.js'
- import axios from '~plugins/axios'
- import { RemindBox, PullUp } from '~components/mobile/common'
- import { addinvoice } from '~components/mobile/center'
- import BScroll from 'better-scroll'
- import { MobileFooter } from '~components/mobile'
- export default {
- name: 'invoice-view',
- layout: 'mobile',
- middleware: 'authenticated',
- computed: {
- invoices () {
- return this.$store.state.invoice.data.Buyerinvoices
- },
- fetching () {
- return this.invoices.fetching
- },
- listActiveFlag () {
- let allChecked = true
- for (let i = 0; i < this.invoiceList.length; i++) {
- if (!this.invoiceList[i].$active) {
- allChecked = false
- break
- }
- }
- return allChecked
- },
- allChecked () {
- return this.invoiceList.length && this.listActiveFlag
- }
- },
- fetch ({store}) {
- return Promise.all([
- store.dispatch('invoice/getBuyerInvoices', {count: 10, keyword: '', page: 1, sorting: {'creattime': 'DESC'}, status: 520})
- ])
- },
- watch: {
- '$store.state.invoice.data.Buyerinvoices.data': {
- handler: function (val) {
- if (val && val.content) {
- if (this.isChange) {
- this.invoiceList = []
- this.isChange = false
- }
- let arr = this.baseUtils.deepCopy(val.content)
- arr.forEach(item => {
- item.$active = false
- })
- this.invoiceList = [...this.invoiceList, ...arr]
- }
- },
- immediate: true
- }
- },
- data() {
- return {
- waitinvoiceType: 'speci',
- showNormalBtn: true, // 是否显示普票按钮
- showSpeciBtn: true, // 是否显示专票按钮
- activeType: '',
- invoiceList: [], // 订单列表
- invoiceArr: [], // 当前用户发票数组
- collectResult: '',
- timeoutCount: 0,
- chooseItem: {}, // 当前选中的发票
- showAddinvoice: false, // 是否显示新增发票
- joinType: 'add', // 新增发票状态
- keyword: '',
- page: 1,
- showSend: false, // 是否显示发票申请
- applyObj: { // 申请发票对象
- sellNum: [],
- sellNameCount: []
- },
- addItem: {}, // 新增发票数组
- showMoreRemind: false
- }
- },
- async asyncData() {
- let { data } = await axios.get('/trade/bill/list')
- let showNormalBtn = data.find(item => {
- return item.kind === 1206
- })
- let showSpeciBtn = data.find(item => {
- return item.kind === 1205
- })
- let chooseItem = showSpeciBtn ? showSpeciBtn : showNormalBtn
- let waitinvoiceType = showSpeciBtn ? 'speci' : 'normal'
- return {
- invoiceArr: data,
- showNormalBtn: showNormalBtn ? true: false,
- showSpeciBtn: showSpeciBtn ? true : false,
- chooseItem: chooseItem,
- waitinvoiceType: waitinvoiceType
- }
- },
- methods: {
- getTime(Time) {
- return this.baseUtils.formatDate(new Date(Time), 'yyyy-MM-dd hh:mm:ss')
- },
- setActive (inv) {
- if (inv) {
- inv.$active = !inv.$active
- } else {
- // 先存储 否则会重新计算
- let flag = !this.allChecked
- this.invoiceList.forEach(item => {
- item.$active = flag
- })
- }
- },
- chooseVoice(str, num) {
- this.waitinvoiceType = str
- this.chooseItem = this.invoiceArr.find(obj => {
- return obj.kind === num
- })
- this._initScroll()
- },
- async addinvoiceFn(ty, item) {
- this.showAddinvoice = false
- if (ty) {
- let { data } = await axios.get('/trade/bill/list')
- let showNormalBtn = data.find(item => {
- return item.kind === 1206
- })
- let showSpeciBtn = data.find(item => {
- return item.kind === 1205
- })
- let chooseItem = showSpeciBtn ? showSpeciBtn : showNormalBtn
- let waitinvoiceType = showSpeciBtn ? 'speci' : 'normal'
- this.invoiceArr = data
- this.showNormalBtn = showNormalBtn ? true: false
- this.showSpeciBtn = showSpeciBtn ? true : false
- this.chooseItem = chooseItem
- this.waitinvoiceType = waitinvoiceType
- }
- this.showSend = true
- },
- setRemindText(str) {
- this.collectResult = str
- this.timeoutCount++
- },
- // 店铺详情页
- toShopdetails(item) {
- this.$router.push(`/mobile/shop/${item.storeid}`)
- },
- // 查看订单详情
- lookOrderDetail(item) {
- let id = EncryptionFilter(item.orderid)
- this.$router.push(`/mobile/order/details?uuid=${id}&type=buyer&paytype=${item.paytype}`)
- },
- // 申请开票
- applyInvoice() {
- let _arr = []
- let _orderNum = 0
- let _AllPice = 0
- let sellNameCount = []
- this.invoiceList.forEach(obj => {
- if (obj.$active === true) {
- _AllPice += obj.price
- _orderNum++
- let _find = _arr.find($it => {
- return $it.storeid === obj.storeid
- })
- if (_find) {
- _find.orderAllPrice += obj.price
- } else {
- obj.orderAllPrice = obj.price
- sellNameCount.push(obj)
- }
- _arr.push(obj)
- }
- })
- if (_arr.length === 0) {
- this.setRemindText('请勾选未开票订单')
- return
- }
- this.applyObj = {
- sellNum: _arr,
- orderNum: _orderNum,
- allPrice: _AllPice,
- sellNameCount: sellNameCount
- }
- this.showSend = true
- this._initScroll()
- },
- // 申请开票最后阶段
- applyInvoiceFn() {
- if (this.invoiceArr.length === 0) {
- this.setRemindText('请选择发票类型')
- return
- }
- let str = ''
- this.applyObj.sellNum.forEach(obj => {
- str === '' ? str += obj.orderid : str += ',' + obj.orderid
- })
- let json = {
- invoiceid: this.chooseItem.id,
- orderids: str
- }
- this.$http.post('/trade/billSubmit', json).then(res => {
- if (res.data instanceof Array) {
- this.setRemindText('申请成功')
- this.searchMore()
- this.showSend = false
- }
- })
- },
- reloadList () {
- this.$store.dispatch('invoice/getBuyerInvoices', {count: 10, page: this.page, keyword: this.keyword, sorting: {'creattime': 'DESC'}, status: 520})
- },
- searchMore() {
- this.isChange = true
- this.page = 1
- this.reloadList()
- },
- onPullUp () {
- this.page++
- this.reloadList()
- },
- _initScroll() {
- this.$nextTick(res => {
- if (!this.scroll) {
- this.scroll = new BScroll(this.$refs.applyinvoiceAlert, {click: true})
- } else {
- this.scroll.refresh()
- }
- })
- },
- addInvoiceNew() {
- this.showSend = false
- this.addItem = {}
- this.showAddinvoice = true
- }
- },
- components: {
- RemindBox,
- addinvoice,
- PullUp,
- MobileFooter
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '~assets/scss/mobileInvoice';
- @mixin overFlowHidden {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- @mixin lineHeight($value) {
- height: $value;
- line-height: $value;
- }
- .overhiden {
- @include overFlowHidden()
- }
- .invoice-wrapper {
- background: #f1f3f6;
- /*margin: 1.26rem 0 0 0;*/
- left: 0;
- bottom: 0;
- top: 0;
- right: 0;
- z-index: 11;
- /*padding: 0.82rem 0 1.04rem;*/
- /*height: calc(100vh - 1.26rem);*/
- position: absolute;
- width: 100%;
- .invoice-wrapper-el {
- margin: 2.08rem 0 0.98rem;
- height: calc(100vh - 1.26rem - 0.98rem - 1.06rem);
- overflow-y: scroll;
- padding-bottom: 0.98rem;
- }
- .mobile-header{
- position: fixed;
- top: 0;
- z-index: 10;
- width:100%;
- height: 1.26rem;
- line-height: 1.26rem;
- /*border-bottom:.01rem solid #ccc;*/
- background: #3e82f5;
- padding:0 .2rem 0 .1rem;
- color:#fff;
- }
- .mobile-header p{
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size:.36rem;
- text-align: center;
- width: 6rem;
- padding-left: 1rem;
- }
- .mobile-center-header p.en-name {
- font-size: .3rem;
- }
- .mobile-header a{
- font-size:.28rem;
- color:#fff;
- position: absolute;
- }
- .mobile-header a i{
- font-size: .48rem;
- margin-right: -.1rem;
- }
- .order-nav {
- background: #fff;
- -webkit-box-shadow: 0 1px 3px #ddd;
- -moz-box-shadow: 0 1px 3px #ddd;
- box-shadow: 0 1px 3px #ddd;
- position: fixed;
- width: 100%;
- top: 1.26rem;
- z-index: 10;
- div {
- height: 0.82rem;
- line-height: 0.82rem;
- display: inline-block;
- width: 33.3%;
- text-align: center;
- font-size: .28rem;
- color: #666;
- &.active span{
- color: #3f84f6;
- border-bottom: 0.04rem solid #3f84f6;
- padding-bottom: 0.2rem;
- }
- }
- }
- .mi-remind-area {
- /*margin-top: 0.24rem;*/
- background: #fff;
- }
- .mi-list-content .mi-list li {
- background: #fff;
- &:nth-child(1) {
- margin-top: 0;
- }
- }
- .mobile-invoice .mi-list-content .mi-list li .line .content {
- padding: 0;
- color: #3976f4;
- width: 67%;
- &.pri {
- color: #ee1111
- }
- }
- .mobile-invoice .mi-list-content .mi-list li .line .title {
- width: auto
- }
- .applyinvoice_Alert {
- background: #fff;
- position: fixed;
- bottom: 0rem;
- left: 0;
- width: 100%;
- border-top-left-radius: 5px;
- border-top-right-radius: 5px;
- padding-bottom: 0.2rem;
- .scrollContent {
- max-height: 6rem;
- overflow: hidden;
- }
- .applyinvoice_title {
- color: #333;
- font-size: 0.42rem;
- text-align: center;
- line-height: 1rem;
- font-weight: 600;
- position: relative;
- i {
- position: absolute;
- font-size: 16px;
- right: 0.2rem;
- }
- }
- .applyinvoice-ul {
- .addinvoice-focus {
- font-size: 0.28rem;
- color: #666;
- line-height: 0.6rem;
- margin: 0 0.2rem;
- img {
- width: 0.29rem;
- vertical-align: top;
- height: 0.33rem;
- margin-top: 0.12rem;
- margin-right: 0.04rem;
- }
- .addinvoice-focus-name {
- width: 2.1rem;
- }
- .normal {
- .icon {
- font-size: 0.28rem;
- color: #333;
- width: 0.5rem;
- height: 0.5rem;
- border-radius: 50%;
- border: 1px solid #dcdcdc;
- position: relative;
- display: inline-block;
- vertical-align: top;
- &.active .icon-next {
- background: #226ce7;
- width: 0.3rem;
- height: 0.3rem;
- border-radius: 50%;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate3d(-50%, -50%, 0);
- }
- }
- }
- }
- }
- .applyinvoive_infotitle {
- color: #333;
- font-size: 0.28rem;
- @include lineHeight(0.6rem);
- background: #e5e5e5;
- padding: 0 0.2rem;
- .blue {
- color: #3e82f5;
- }
- .red{
- max-width: 1.6rem;
- @include overFlowHidden();
- vertical-align: middle;
- display: inline-block;
- color: #f43938
- }
- }
- .applyinvoive_detailinfo {
- color: #333;
- font-size: 0.28rem;
- padding: 0.2rem;
- .clearfix {
- @include lineHeight(0.5rem);
- }
- .pull-left {
- width: 3.5rem;
- @include overFlowHidden()
- }
- .pull-right {
- width: 3.3rem;
- @include overFlowHidden()
- }
- }
- .applyinvoice_controll {
- padding: 0.2rem 0.3rem 0;
- border-top: 1px solid #dcdcdc;
- div {
- width: 3.29rem;
- @include lineHeight(0.77rem);
- color: #fff;
- font-size: 0.32rem;
- text-align: center;
- border-radius: 0.07rem;
- background: #bfbfbf;
- &:last-child {
- background: #3e82f5;
- }
- }
- }
- }
- }
- </style>
|