require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["shop/pages/Invoice-application/Invoice-application"],{514:function(t,e,n){"use strict";(function(t,e){var i=n(4);n(30);i(n(25));var o=i(n(515));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},515:function(t,e,n){"use strict";n.r(e);var i=n(516),o=n(518);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n(520);var r,s=n(41),c=Object(s["default"])(o["default"],i["render"],i["staticRenderFns"],!1,null,"2503450a",null,!1,i["components"],r);c.options.__file="shop/pages/Invoice-application/Invoice-application.vue",e["default"]=c.exports},516:function(t,e,n){"use strict";n.r(e);var i=n(517);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},517:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return o})),n.d(e,"staticRenderFns",(function(){return r})),n.d(e,"recyclableRender",(function(){return a})),n.d(e,"components",(function(){return i}));try{i={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,561))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,570))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var t=this,e=t.$createElement,n=(t._self._c,"apply"===t.currentTab?t.__map(t.applyList,(function(e,n){var i=t.__get_orig(e),o=((e.estimatedAmount||0)/100).toFixed(2);return{$orig:i,g0:o}})):null),i="apply"!==t.currentTab?t.__map(t.historyList,(function(e,n){var i=t.__get_orig(e),o=((e.invoiceAmount||0)/100).toFixed(2),a=e.actions&&e.actions.length;return{$orig:i,g1:o,g2:a}})):null,o=t.__map(t.tabs,(function(e,n){var i=t.__get_orig(e),o=t.getTabIcon(e),a=o?t.getTabIcon(e):null;return{$orig:i,m0:o,m1:a}}));t._isMounted||(t.e0=function(e){t.email=""},t.e1=function(e,n){var i=arguments[arguments.length-1].currentTarget.dataset,o=i.eventParams||i["event-params"];n=o.tab;t.currentTab=n.value}),t.$mp.data=Object.assign({},{$root:{l0:n,l1:i,l2:o}})},a=!1,r=[];o._withStripped=!0},518:function(t,e,n){"use strict";n.r(e);var i=n(519),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},519:function(t,e,n){"use strict";(function(t){var i=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n(34)),a=i(n(18)),r=i(n(36)),s={data:function(){return{currentTab:"apply",keyword:"",showEmailPopup:!1,email:"",currentInvoiceRecordId:"",currentYear:"近一年",tabs:[{label:"开票",value:"apply",icon:"/shop/static/icon/nav_kaipiao@2x.png",activeIcon:"/shop/static/icon/nav_kaipiao_sel@2x.png"},{label:"开票历史",value:"history",icon:"/shop/static/icon/nav_lishi@2x.png",activeIcon:"/shop/static/icon/nav_lishi_sel@2x.png"}],applyList:[],page:1,capacity:10,isRequest:!0,historyPage:1,historyCapacity:10,historyIsRequest:!0,historyList:[]}},watch:{currentTab:function(){"apply"===this.currentTab?(this.page=1,this.applyList=[],this.isRequest=!0,this.getApplyList()):"history"===this.currentTab&&(this.historyPage=1,this.historyList=[],this.historyIsRequest=!0,this.getHistoryList())}},onLoad:function(){this.getApplyList()},onReachBottom:function(){"apply"===this.currentTab?this.getApplyList():"history"===this.currentTab&&this.getHistoryList()},methods:{getApplyList:function(){var t=this;return(0,r.default)(o.default.mark((function e(){var n,i;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isRequest){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.$u.api.myOrderPage({capacity:t.capacity,page:t.page,model:{invoiceStatus:1,keyword:t.keyword}});case 4:n=e.sent,200===n.code&&(i=n.data.records||[],i.forEach((function(t){t.detailList&&t.detailList.length>0&&(t.goodsText=t.detailList.map((function(t){return t.luggageName+"*"+t.num})).join("、"))})),t.applyList=[].concat((0,a.default)(t.applyList),(0,a.default)(i)),t.page++,n.data.total<=t.applyList.length&&(t.isRequest=!1));case 6:case"end":return e.stop()}}),e)})))()},getHistoryList:function(){var t=this;return(0,r.default)(o.default.mark((function e(){var n,i;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.historyIsRequest){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.$u.api.invoicePage({page:t.historyPage,capacity:t.historyCapacity,model:{orderNo:t.keyword}});case 4:n=e.sent,200===n.code&&(i=n.data.records||[],i.forEach((function(t){1===t.status&&(t.actions=[{text:"发送至邮箱",primary:!0}])})),t.historyList=[].concat((0,a.default)(t.historyList),(0,a.default)(i)),t.historyPage++,n.data.total<=t.historyList.length&&(t.historyIsRequest=!1));case 6:case"end":return e.stop()}}),e)})))()},handleSearch:function(){this.historyPage=1,this.historyList=[],this.historyIsRequest=!0,this.getHistoryList()},getTabIcon:function(t){return this.currentTab===t.value?t.activeIcon:t.icon},goInvoiceRequest:function(e){var n=[];e&&e.id&&n.push("id=".concat(e.id)),e&&e.code&&n.push("orderNo=".concat(e.code)),e&&e.estimatedAmount&&n.push("invoiceAmount=".concat(((e.estimatedAmount||0)/100).toFixed(2)));var i=n.length?"?".concat(n.join("&")):"";t.navigateTo({url:"/shop/pages/Invoice-request/Invoice-request".concat(i)})},handleAction:function(t,e){if("发送至邮箱"===t.text)return this.currentInvoiceRecordId=e.id,void(this.showEmailPopup=!0);"申请开票"===t.text&&this.goInvoiceRequest()},closeEmailPopup:function(){this.showEmailPopup=!1},confirmSendEmail:function(){var e=this;return(0,r.default)(o.default.mark((function n(){var i;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.email){n.next=3;break}return t.showToast({title:"请输入邮箱",icon:"none"}),n.abrupt("return");case 3:return n.next=5,e.$u.api.sendEmail({email:e.email,invoiceRecordId:e.currentInvoiceRecordId});case 5:i=n.sent,200===i.code&&(t.showToast({title:"发送成功",icon:"success"}),e.showEmailPopup=!1,e.email="");case 7:case"end":return n.stop()}}),n)})))()}}};e.default=s}).call(this,n(2)["default"])},520:function(t,e,n){"use strict";n.r(e);var i=n(521),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},521:function(t,e,n){}},[[514,"common/runtime","common/vendor"]]]);
|