You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
11 KiB
1 line
11 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-invoice_manage"],{"0045":function(t,e,a){"use strict";a.r(e);var n=a("33aa"),i=a.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(o);e["default"]=i.a},"00ec":function(t,e,a){"use strict";a.r(e);var n=a("64b0"),i=a.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(o);e["default"]=i.a},"291a":function(t,e,a){var n=a("9098");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("967d").default;i("2fa82ad0",n,!0,{sourceMap:!1,shadowMode:!1})},"2fbc":function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"reservation-page"},[a("v-uni-view",{staticClass:"fixed-nav"},[a("NavBar",{attrs:{title:"发票管理"}})],1),a("v-uni-view",{staticClass:"content-area"},[t.invoiceList.length>0?t._l(t.invoiceList,(function(e){return a("v-uni-view",{key:e.id,staticClass:"invoice-card"},[a("v-uni-view",{staticClass:"invoice-header"},[a("v-uni-view",{staticClass:"status-tag pending"},[t._v("待开具")]),a("v-uni-view",{staticClass:"invoice-date"},[t._v(t._s(t.formatChinaDate(e.created_at)))])],1),a("v-uni-view",{staticClass:"invoice-title"},[t._v(t._s(e.direction_name))]),a("v-uni-view",{staticClass:"invoice-amount"},[t._v("¥"+t._s(e.price||0))]),a("v-uni-view",{staticClass:"invoice-batch"},[t._v("批次号:"+t._s(e.batch&&e.batch.name?e.batch.name:"-"))]),a("v-uni-view",{staticClass:"invoice-ship"},[t._v("船舶编号:"+t._s(e.ship?e.ship.ship_number:"-"))]),a("v-uni-view",{staticClass:"invoice-actions single-btn"},[a("v-uni-button",{staticClass:"invoice-detail-btn issue",on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.handleInvoiceAction(e)}}},[t._v(t._s(3===e.bill_status?"查看发票":"去开票"))])],1)],1)})):[a("v-uni-view",{staticClass:"empty-box"},[a("v-uni-image",{staticClass:"empty-img",attrs:{src:"/static/empty.png",mode:"aspectFit"}}),a("v-uni-view",{staticClass:"empty-text"},[t._v("暂无发票")])],1)],t.invoiceList.length>0?a("v-uni-view",{staticClass:"load-more"},[t.loading?a("v-uni-view",{staticClass:"loading-text"},[t._v("加载中...")]):t.hasMore?t._e():a("v-uni-view",{staticClass:"no-more-text"},[t._v("没有更多数据了")])],1):t._e()],2)],1)},i=[]},"30f7":function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},a("7a76"),a("c9b5")},"33aa":function(t,e,a){"use strict";a("6a54");var n=a("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(a("2634")),o=n(a("b7c7")),s=n(a("2fdc"));a("bf0f"),a("c223");var r=n(a("efbe")),c=a("25d7"),u=a("bd31"),d={name:"InvoiceManagePage",components:{NavBar:r.default},data:function(){return{invoiceList:[],page:1,lastPage:1,loading:!1,hasMore:!0}},onShow:function(){this.page=1,this.hasMore=!0,this.fetchInvoiceList(!0)},onPullDownRefresh:function(){this.page=1,this.hasMore=!0,this.fetchInvoiceList(!0).finally((function(){uni.stopPullDownRefresh()}))},onReachBottom:function(){this.hasMore&&!this.loading&&this.loadMore()},methods:{formatChinaDate:c.base.formatChinaDate,fetchInvoiceList:function(){var t=arguments,e=this;return(0,s.default)((0,i.default)().mark((function a(){var n,s,r,c;return(0,i.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=t.length>0&&void 0!==t[0]&&t[0],s=uni.getStorageSync("token"),s){a.next=4;break}return a.abrupt("return");case 4:if(!e.loading){a.next=6;break}return a.abrupt("return");case 6:return e.loading=!0,a.prev=7,a.next=10,new Promise((function(t,a){uni.request({url:"".concat(u.API.RESERVATION_LIST,"?token=").concat(s),method:"GET",data:{page:e.page,page_size:10,bill_status:4},success:t,fail:a})}));case 10:r=a.sent,r.data&&0===r.data.errcode?(c=r.data.data.data||[],e.lastPage=r.data.data.last_page||1,e.invoiceList=n?c:[].concat((0,o.default)(e.invoiceList),(0,o.default)(c)),e.hasMore=e.page<e.lastPage):uni.showToast({title:r.data.errmsg||"获取发票列表失败",icon:"none"}),a.next=18;break;case 14:a.prev=14,a.t0=a["catch"](7),console.error("获取发票列表失败:",a.t0),uni.showToast({title:"网络错误",icon:"none"});case 18:return a.prev=18,e.loading=!1,a.finish(18);case 21:case"end":return a.stop()}}),a,null,[[7,14,18,21]])})))()},loadMore:function(){this.hasMore&&!this.loading&&(this.page+=1,this.fetchInvoiceList(!1))},handleInvoiceAction:function(t){if(t)if(3!==t.bill_status)this.goInvoice(t);else{var e=t.bill||{},a=Array.isArray(e.billInfoList)?e.billInfoList:[],n=a[0]||{},i=n.pictureUrl||"";i?this.openExternalLink(i):uni.showToast({title:"暂无发票链接",icon:"none"})}},goInvoice:function(t){var e=this,a=uni.getStorageSync("token");a?t&&t.id?(uni.showLoading({title:"提交中..."}),uni.request({url:"".concat(u.API.GET_INVOICE),method:"GET",data:{reservation_id:t.id,token:a},success:function(t){if(uni.hideLoading(),t.data&&0===t.data.errcode){var a=t.data&&t.data.data,n=a&&a.bill,i=n&&n.billInfoList,o=Array.isArray(i)&&i.length>0?i[0].pictureUrl:"";uni.showToast({title:"开票申请已提交",icon:"success",duration:2e3,success:function(){o&&e.openExternalLink(o)}}),e.page=1,e.hasMore=!0,e.fetchInvoiceList(!0)}else uni.showToast({title:t.data&&t.data.errmsg||"提交失败",icon:"none"})},fail:function(){uni.hideLoading(),uni.showToast({title:"提交失败",icon:"none"})}})):uni.showToast({title:"订单信息缺失",icon:"none"}):uni.showToast({title:"请先登录",icon:"none"})},openExternalLink:function(t){t&&window.open(t,"_blank")}}};e.default=d},4076:function(t,e,a){"use strict";var n=a("709b"),i=a.n(n);i.a},4733:function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(Array.isArray(t))return(0,n.default)(t)};var n=function(t){return t&&t.__esModule?t:{default:t}}(a("8d0b"))},"561e":function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"nav-bar",style:{paddingTop:t.statusBarHeight+"px"}},[a("v-uni-view",{staticClass:"nav-content"},[a("v-uni-image",{staticClass:"back-btn",attrs:{src:"/static/back.png",mode:"aspectFit"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onBack.apply(void 0,arguments)}}}),a("v-uni-text",{staticClass:"nav-title"},[t._v(t._s(t.title))]),a("v-uni-view",{staticClass:"right-slot"},[t._t("right")],2)],1),t._t("default")],2)},i=[]},"64b0":function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={props:{title:{type:String,default:""}},data:function(){return{statusBarHeight:0}},mounted:function(){this.statusBarHeight=uni.getSystemInfoSync().statusBarHeight||0},methods:{onBack:function(){console.log("onBack"),uni.navigateBack()}}};e.default=n},"709b":function(t,e,a){var n=a("ddab");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("967d").default;i("26151de9",n,!0,{sourceMap:!1,shadowMode:!1})},7645:function(t,e,a){"use strict";var n=a("291a"),i=a.n(n);i.a},9098:function(t,e,a){var n=a("c86c");e=n(!1),e.push([t.i,".nav-bar[data-v-28453a18]{background:transparent}.nav-content[data-v-28453a18]{display:flex;align-items:center;justify-content:space-between;height:44px;padding:0 16px}.back-btn[data-v-28453a18]{width:16px;height:16px;display:flex;align-items:center;justify-content:center}.nav-title[data-v-28453a18]{font-size:16px;font-weight:400;color:#222;flex:1;text-align:center}.right-slot[data-v-28453a18]{min-width:24px}",""]),t.exports=e},a187:function(t,e,a){"use strict";a.r(e);var n=a("2fbc"),i=a("0045");for(var o in i)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(o);a("4076");var s=a("828b"),r=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,"6fa36e59",null,!1,n["a"],void 0);e["default"]=r.exports},b7c7:function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,n.default)(t)||(0,i.default)(t)||(0,o.default)(t)||(0,s.default)()};var n=r(a("4733")),i=r(a("d14d")),o=r(a("5d6b")),s=r(a("30f7"));function r(t){return t&&t.__esModule?t:{default:t}}},d14d:function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},a("01a2"),a("e39c"),a("bf0f"),a("844d"),a("18f7"),a("de6c"),a("08eb")},ddab:function(t,e,a){var n=a("c86c");e=n(!1),e.push([t.i,".reservation-page[data-v-6fa36e59]{background:linear-gradient(180deg,#eaf3ff,#f6faff);min-height:100vh;padding-bottom:%?40?%}.fixed-nav[data-v-6fa36e59]{position:fixed;top:0;left:0;right:0;z-index:100;background:linear-gradient(180deg,#cbe6ff,#f6faff);box-shadow:0 2px 8px rgba(0,0,0,.04)}.content-area[data-v-6fa36e59]{padding:%?220?% %?24?% %?24?% %?24?%}.invoice-card[data-v-6fa36e59]{background:#fff;border-radius:%?16?%;box-shadow:0 %?2?% %?8?% rgba(0,0,0,.04);padding:%?32?% %?28?%;margin-bottom:%?32?%;border:%?1?% solid #e5e5e5}.invoice-header[data-v-6fa36e59]{display:flex;justify-content:space-between;align-items:center;margin-bottom:%?16?%}.status-tag[data-v-6fa36e59]{padding:%?6?% %?24?%;border-radius:%?20?%;font-size:%?24?%;color:#fff}.status-tag.issued[data-v-6fa36e59]{background:#2ecc71}.status-tag.pending[data-v-6fa36e59]{background:#ffa940}.invoice-date[data-v-6fa36e59]{color:#888;font-size:%?24?%}.invoice-title[data-v-6fa36e59]{font-size:%?30?%;font-weight:700;margin-bottom:%?12?%}.invoice-amount[data-v-6fa36e59]{font-size:%?32?%;color:#222;font-weight:700;margin-bottom:%?8?%}.invoice-batch[data-v-6fa36e59]{font-size:%?24?%;color:#888;margin-bottom:%?8?%}.invoice-ship[data-v-6fa36e59]{font-size:%?24?%;color:#888;margin-bottom:%?16?%}.invoice-actions[data-v-6fa36e59]{display:flex;justify-content:flex-end}.invoice-actions.single-btn .invoice-detail-btn[data-v-6fa36e59]{flex:0 0 auto;width:153px}.invoice-detail-btn[data-v-6fa36e59]{background:#e4f3fe;color:#217aff;height:%?69?%;display:flex;align-items:center;justify-content:center;font-size:14px;margin-right:%?24?%;border-radius:4px;padding:8px 0;font-weight:500;border:none;outline:none}.invoice-detail-btn.issue[data-v-6fa36e59]{background:#217aff;color:#fff}.invoice-btn[data-v-6fa36e59]{display:none}.empty-box[data-v-6fa36e59]{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:%?120?%}.empty-img[data-v-6fa36e59]{width:%?320?%;height:%?320?%;margin-bottom:%?32?%}.empty-text[data-v-6fa36e59]{color:#888;font-size:%?28?%}.load-more[data-v-6fa36e59]{padding:%?30?% 0;text-align:center}.loading-text[data-v-6fa36e59]{color:#888;font-size:%?28?%}.no-more-text[data-v-6fa36e59]{color:#999;font-size:%?26?%}",""]),t.exports=e},efbe:function(t,e,a){"use strict";a.r(e);var n=a("561e"),i=a("00ec");for(var o in i)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(o);a("7645");var s=a("828b"),r=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,"28453a18",null,!1,n["a"],void 0);e["default"]=r.exports}}]); |