(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6a71d768"],{"0eb1":function(e,t,a){},"5e18":function(e,t,a){"use strict";var i=a("0eb1");a.n(i).a},"8b88":function(e,t,a){"use strict";a.r(t);a("a4d3"),a("e01a"),a("4de4"),a("4160"),a("a630"),a("caad"),a("d81d"),a("b64b"),a("d3b7"),a("2532"),a("3ca3"),a("159b"),a("ddb0"),a("e260"),a("cca6"),a("e6cf"),a("96cf");var i=a("1da1"),n=a("5530"),l=a("dd85"),r=a("a86b"),o=[{key:"ticketCode",keyCn:"发票种类",type:"select",options:[{label:"收据",id:"30101"},{label:"形式发票",id:"60100"},{label:"增值税电子普通发票 ",id:"10102"},{label:"增值税专用发票",id:"10100"},{label:"增值税普通发票",id:"10101"},{label:"航空运输电子客票行程单",id:10506}],labelKey:"label",labelValue:"id",isAdd:!0},{key:"date",keyCn:"发票日期",type:"date",isRequired:!0},{key:"pretaxAmount",keyCn:"发票金额",type:"input"},{key:"tax",keyCn:"税额",type:"input"},{key:"total",keyCn:"总金额",type:"input"},{key:"currency",keyCn:"币种",type:"select",options:[{label:"AUD",id:"AUD"},{label:"BND",id:"BND"},{label:"CAD",id:"CAD"},{label:"CHF",id:"CHF"},{label:"CNY",id:"CNY"},{label:"DKK",id:"DKK"},{label:"EUR",id:"EUR"},{label:"GBP",id:"GBP"},{label:"HKD",id:"HKD"},{label:"IDR",id:"IDR"},{label:"INR",id:"INR"},{label:"JPY",id:"JPY"},{label:"KHR",id:"KHR"},{label:"KRW",id:"KRW"},{label:"LKR",id:"LKR"},{label:"MMK",id:"MMK"},{label:"MYR",id:"MYR"},{label:"NZD",id:"NZD"},{label:"PHP",id:"PHP"},{label:"SEK",id:"SEK"},{label:"SGD",id:"SGD"},{label:"THB",id:"THB"},{label:"TWD",id:"TWD"},{label:"USD",id:"USD"},{label:"VND",id:"VND"}],labelKey:"label",labelValue:"id"},{key:"buyer",keyCn:"购买方",type:"input"},{key:"buyerNo",keyCn:"购买方税号",type:"input"},{key:"number",keyCn:"发票号码",type:"input",isRequired:!0},{key:"seller",keyCn:"供应商",type:"input"},{key:"sellerNo",keyCn:"供应商税号",type:"input"},{key:"po",keyCn:"PO号码",type:"input"},{key:"desc",keyCn:"备注",type:"input"},{key:"orgId",keyCn:"组织",type:"select",options:[],labelKey:"name",labelValue:"id",isAdd:!0},{key:"invoiceType",keyCn:"发票类型",type:"select",options:[],labelKey:"name",labelValue:"id",isAdd:!0}],s=a("2f62"),c={name:"ElectronicInvoiceAdd",data:function(){return{isShowCreateDialog:!1,orderField:{status:0},formGroup:o,isHidden:!1,tableData:[],detailTableData:[],uploadDialog:!1,uploadOption:{},rate:0,formData:{},isSaved:!1}},computed:Object(n.a)({},Object(s.d)("user",["userInfo"])),components:{formComponent:r.a},mounted:function(){var e=this.$route.query.id;this.id=e,this.initOrgAndInvoiceOptions(),this.orderField.id=e,this.getAtta(this.id)},created:function(){this.attOptions=[{label:"发票或收据",value:"发票或收据"},{label:"销货清单",value:"销货清单"},{label:"合同",value:"合同"},{label:"订单",value:"订单"},{label:"验收单",value:"验收单"},{label:"其他",value:"其他"}]},methods:Object(n.a)(Object(n.a)({},Object(s.b)({getAttachmentList:"supplier/getAttachmentList",deleteAttachmentList:"supplier/deleteAttachmentList",queryORG:"supplier/queryORG",queryInvoiceList:"supplier/queryInvoiceList",queryOwners:"supplier/queryOwners"})),{},{handleRemoteSearch:function(e){var t=this;this.queryOwners(e).then((function(e){t.formGroup[t.formGroup.length-1].options=e.result}))},uploadAvater:function(e){var t=this,a=Object.assign({},this.uploadOption),i=a.type,n=a.description,l=new FormData;Array.from(e).forEach((function(e){l.append("files",e)})),l.append("invoiceId",this.id),l.append("type",i),l.append("description",n),this.$file.uploadFile(l,"api/manager/supplier/invoice-attachment",this.handleProgress).then((function(e){200==e.status&&(t.getAtta(),t.$message.success("导入文件成功!"),t.rate=0,t.uploadDialog=!1)})).catch((function(e){t.$message.error(e.message)}))},deleteAtta:function(e){var t=this;this.deleteAttachmentList(e.row.id).then((function(e){t.getAtta()})).catch((function(e){t.$message.error(e.message)}))},initOrgAndInvoiceOptions:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a,i,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=[e.queryORG(),e.queryInvoiceList()].map((function(e){return e.catch((function(e){}))})),t.next=3,Promise.all(a);case 3:i=t.sent,n=o.length,o[n-2].options=i[1].result,o[n-1].options=i[0].result;case 7:case"end":return t.stop()}}),t)})))()},previewAtta:function(e){var t=e.row.uri;window.open(t,"_blank")},handleProgress:function(e){this.rate=Math.floor(e.loaded/e.total*100)},getAtta:function(){var e=this;this.getAttachmentList(this.id).then((function(t){e.tableData=t.result}))},saveInvoice:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a,i,n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isSaved){t.next=5;break}return(a=Object.assign({},e.orderField)).owner=e.userInfo.id,Object(l.j)(a).then((function(t){e.$message.success(t.message),setTimeout((function(){e.goBack()}),50)})),t.abrupt("return");case 5:i=e.formGroup.filter((function(e){return 1==e.isRequired})),n=Object.keys(e.orderField),r=0;case 8:if(!(r