(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2a5bed8a"],{"0d3c":function(e,t,a){"use strict";var n=a("f66c");a.n(n).a},"1def":function(e,t,a){},"307d":function(e,t,a){"use strict";(function(t){function a(e){return(e+"===".slice((e.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/")}function n(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}e.exports={unescape:a,escape:n,encode:function(e,a){return n(t.from(e,a||"utf8").toString("base64"))},decode:function(e,n){return t.from(a(e),"base64").toString(n||"utf8")}}}).call(this,a("b639").Buffer)},"59c8":function(e,t,a){},"5b2b":function(e,t,a){"use strict";var n=a("2b0e");t.a=new n.default},"5b88":function(e,t,a){"use strict";var n=a("1def");a.n(n).a},"5c9b":function(e,t,a){},"5dfc":function(e,t,a){"use strict";var n=a("59c8");a.n(n).a},"6d77":function(e,t,a){"use strict";var n=a("ae02");a.n(n).a},7627:function(e,t,a){"use strict";var n=a("5c9b");a.n(n).a},"7eb6":function(e,t,a){"use strict";var n={name:"img-preview",props:{imgItem:{type:Object}},created:function(){},data:function(){return{}}},i=(a("5dfc"),a("2877")),l=Object(i.a)(n,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"img-preview"},[t("div",{staticClass:"ticketAllocate-right d-flex flex-direction"},[t("div",{staticClass:"cursor c-fff w100 d-flex a-center j-center img-title"},[this._t("title")],2),t("div",{staticClass:"flex-1 d-flex a-center j-fe img-container"},[this._t("image")],2),t("div",{staticClass:"cursor img-tips c-fff w100 d-flex a-center j-fe p-right-2"},[this._t("date")],2),t("div",{staticClass:" img-footer mainColor cursor c-fff w100 d-flex a-center j-center downloadYU"},[this._t("footer")],2)])])}),[],!1,null,"66fde0f3",null);t.a=l.exports},"90fe":function(e,t,a){},ae02:function(e,t,a){},b00e:function(e,t,a){"use strict";var n=a("f8ce");a.n(n).a},b242:function(e,t,a){"use strict";var n=a("90fe");a.n(n).a},cad7:function(e,t,a){},dbcd:function(e,t,a){"use strict";a.r(t);a("c740"),a("4160"),a("d81d"),a("a434"),a("159b"),a("cca6"),a("96cf");var n=a("1da1"),i=a("5530"),l=(a("ac1f"),a("466d"),a("1276"),a("5b2b")),r={name:"title-tab",data:function(){return{activetabs:0,statusStr:this.$route.query.statusStr||"",statusList:[{label:"待处理",value:0},{label:"待审核",value:1},{label:"未发送",value:2},{label:"已完成",value:3}]}},props:{isCollapse:{type:Boolean,default:!1}},created:function(){if("财务审核"==this.statusStr)return this.handleTabsChange(1),this.statusList.shift();"已完成"==this.statusStr&&this.handleTabsChange(3)},methods:{handleTabsChange:function(e){this.activetabs=e,l.a.$emit("tab-change",e)}}},s=(a("b242"),a("2877")),o=Object(s.a)(r,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tabs"},e._l(e.statusList,(function(t,n){return a("div",{directives:[{name:"show",rawName:"v-show",value:!e.isCollapse,expression:"!isCollapse"}],key:n,staticClass:"tab-item",class:{tabActive:e.activetabs==t.value},attrs:{label:t.label,name:t.value},on:{click:function(a){return e.handleTabsChange(t.value)}}},[a("span",[e._v(" "+e._s(t.label))])])})),0)}),[],!1,null,"6dd15a1e",null).exports,c={name:"collapse",props:["title","isCollapse","isShowCollapse"],data:function(){return{}}},u=(a("5b88"),{name:"MatchLeft",data:function(){return{queryInfo:{keywords:""},currentClick:null,isCollapse:!1,isShowCollapse:!0}},components:{titleTabs:o,collapse:Object(s.a)(c,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{class:[e.isShowCollapse?"collapseLeft":"collapseRight"],attrs:{title:e.title},on:{click:function(t){return e.$emit("click")}}},[a("i",{class:[e.isCollapse?"el-icon-s-unfold":"el-icon-s-fold"]})])}),[],!1,null,"696753ba",null).exports},inject:["SUPPLIER"],props:["invoiceMatchLeft","loading"],beforeDestroy:function(){clearTimeout(this.timeId)},watch:{invoiceMatchLeft:function(){this.invoiceMatchLeft.length<=10&&(this.currentClick=0),this.$emit("getDetail",this.invoiceMatchLeft[this.currentClick])}},methods:{handleSearch:function(){var e=this.queryInfo.keywords;this.$emit("blur",{keywords:e})},handleCollapse:function(){this.isShowCollapse=!this.isShowCollapse,this.isCollapse=!this.isCollapse},filterPersen:function(e){e>100&&(e=100);var t=(e+="").split(".")[1]||"",a=e.split(".")[0]+"";return t&&t.length>2&&(t="."+t.substring(0,2)),parseFloat(a+t)},handleScroll:function(e){var t=this;clearTimeout(this.timeId),this.timeId=setTimeout((function(){var a=t.$refs.match.offsetHeight;e.target.scrollHeight-e.target.scrollTop-500&&(e.scrollTop=0)},handlerBackSearch:function(){this.$router.push({name:"Pending",query:{statusFlag:!0}})},handleInvoiceClick:function(e,t){this.currentClick=e,this.$emit("getDetail",t)}},created:function(){var e=this;l.a.$on("tab-change",(function(){e.backTop(),e.currentClick=null})),this.statusList=[{label:"待处理",id:1,color:"#666"},{label:"待审核",id:2,color:"#00cc33"},{label:"已完成",id:3,color:"#00cc33"}]},mounted:function(){}}),d=(a("7627"),a("e932"),Object(s.a)(u,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"match_invoiceList p1 p-relative",class:{isCollapse:e.isCollapse}},[a("collapse",{attrs:{title:e.isCollapse?"展开":"折叠",isCollapse:e.isCollapse,isShowCollapse:e.isShowCollapse},on:{click:e.handleCollapse}}),a("div",{directives:[{name:"show",rawName:"v-show",value:!e.isCollapse,expression:"!isCollapse"}],staticClass:" d-flex w100 "},[a("title-tabs",{attrs:{isCollapse:e.isCollapse}})],1),a("div",{directives:[{name:"show",rawName:"v-show",value:!e.isCollapse,expression:"!isCollapse"}],staticClass:"match-input d-flex a-center"},[a("el-input",{directives:[{name:"show",rawName:"v-show",value:!e.isCollapse,expression:"!isCollapse"}],staticClass:"flex-1",attrs:{placeholder:"请输入关键字查询"},model:{value:e.queryInfo.keywords,callback:function(t){e.$set(e.queryInfo,"keywords",t)},expression:"queryInfo.keywords"}}),a("text-button",{directives:[{name:"show",rawName:"v-show",value:e.isShowCollapse,expression:"isShowCollapse"}],staticClass:"m-left-1",on:{click:e.handleSearch}},[a("i",{staticClass:"el-icon-search"})]),a("div",{directives:[{name:"show",rawName:"v-show",value:e.isShowCollapse,expression:"isShowCollapse"}],staticClass:"search cursor",on:{click:e.handlerBackSearch}},[e._v(" 重新搜索 ")])],1),a("div",{ref:"match",staticClass:"match-invoiceItems",attrs:{id:"mIT"},on:{scroll:e.handleScroll}},e._l(e.invoiceMatchLeft,(function(t,n){return a("div",{key:n,staticClass:"invoiceItem cursor",class:{alreadyClick:e.currentClick==n},on:{click:function(a){return e.handleInvoiceClick(n,t)}}},[a("div",{staticClass:"item-header d-flex a-center "},[a("div",{staticClass:"item-left"},[a("span",{staticClass:"f-700",attrs:{title:"发票号码"}},[e._v(e._s(t.number))])]),a("div",{staticClass:"item-code"},[a("span",{attrs:{title:"发票代码"}},[e._v(" "+e._s(t.code)+" ")])]),a("div",{staticClass:"item-progress"},[a("el-progress",{attrs:{"text-inside":!0,"stroke-width":16,percentage:e.filterPersen(t.percent),color:e.currentClick==n?"#3080fb":"#0cd4a7"}})],1)]),a("div",{staticClass:"item-content"},[a("div",{staticClass:"item-itemtop j-sb d-flex"},[a("div",[a("span",{directives:[{name:"color",rawName:"v-color",value:"#909399",expression:"'#909399'"}]},[e._v("日 期:")]),a("span",[e._v(e._s(t.date))])]),a("div",[a("span",{directives:[{name:"color",rawName:"v-color",value:"#909399",expression:"'#909399'"}]},[e._v("税前金额:")]),a("span",{staticClass:"text-color f-700"},[e._v(e._s(t.pretaxAmount))])])]),a("div",{staticClass:"item-itemtop j-sb d-flex"},[a("div",[a("span",{directives:[{name:"color",rawName:"v-color",value:"#909399",expression:"'#909399'"}]},[e._v(" 税 额:")]),a("span",{staticClass:"text-color"},[e._v(e._s(t.tax))])]),a("div",[a("span",{directives:[{name:"color",rawName:"v-color",value:"#909399",expression:"'#909399'"}]},[e._v("含税金额:")]),a("span",{staticClass:"text-color f-700"},[e._v(e._s(t.total))])])]),a("div",{staticClass:"item-itemmain"},[a("span",{directives:[{name:"color",rawName:"v-color",value:"#909399",expression:"'#909399'"}]},[e._v("采购:")]),e._v(" "+e._s(t.buyer)+" ")]),a("div",{staticClass:"item-itembottom"},[a("span",{directives:[{name:"color",rawName:"v-color",value:"#909399",expression:"'#909399'"}]},[e._v("供应商:")]),e._v(" "+e._s(t.seller)+" ")])])])})),0)],1)}),[],!1,null,"4c47b321",null).exports),p={name:"TabLog",data:function(){return{keywords:""}},props:{logData:{type:Array}},methods:{queryLog:function(){this.$emit("queryLog",this.keywords)}}},h=Object(s.a)(p,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"p1"},[a("div",{staticClass:"d-flex m-bottom-2"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.keywords,expression:"keywords"}],staticClass:"p-left-1",staticStyle:{border:"1px solid #eee","border-radius":"4px"},attrs:{type:"text"},domProps:{value:e.keywords},on:{input:function(t){t.target.composing||(e.keywords=t.target.value)}}}),a("el-button",{staticClass:"m-left-1",on:{click:e.queryLog}},[e._v("查询")])],1),a("el-table",{staticStyle:{width:"80%"},attrs:{data:e.logData,height:"250",border:""}},[a("el-table-column",{attrs:{align:"center",prop:"createTime",label:"操作时间",width:"200"}}),a("el-table-column",{attrs:{align:"center",prop:"operatorUser",label:"操作人",width:"200"}}),a("el-table-column",{attrs:{prop:"reason",label:"描述"}})],1)],1)}),[],!1,null,"179325ec",null).exports,f=(a("a4d3"),a("e01a"),a("a630"),a("3ca3"),a("c7f0")),m={name:"Attachment",data:function(){return{uploadDialog:!1,uploadOption:{invoiceId:null,files:[],type:"",description:""}}},props:{attachmentData:{type:Array},fieldGroup:{type:Object,default:function(){}}},created:function(){this.attOptions=[{label:"销货清单",value:"销货清单"},{label:"合同",value:"合同"},{label:"订单",value:"订单"},{label:"验收单",value:"验收单"},{label:"其他",value:"其他"}]},methods:{previewAtta:function(e){var t=e.row.uri;window.open(t,"_blank")},handleUploadAttachment:function(e){var t=this,a=Object.assign({},this.uploadOption),n=a.type,i=a.description,l=new FormData;Array.from(e).forEach((function(e){l.append("files",e)})),l.append("invoiceId",this.fieldGroup.id),l.append("type",n),l.append("description",i),this.$file.uploadFile(l,"api/manager/supplier/invoice-attachment").then((function(e){200==e.status&&(t.$message.success("导入文件成功!"),t.uploadDialog=!1,t.$emit("updateAttachMent"))})).catch((function(e){t.$message.error(e.message)}))},addAttachment:function(){this.$refs.attachment.click()},deleteTableColumnData:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$confirm("是否删除当前附件","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:if("confirm"==a.sent)try{t.$emit("deleteAttachMent",e.row.id)}catch(e){t.$message.error("删除失败,请重试!")}a.next=10;break;case 7:a.prev=7,a.t0=a.catch(0);case 10:case"end":return a.stop()}}),a,null,[[0,7]])})))()}},components:{Upload:f.a}},g=Object(s.a)(m,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"p1"},[a("div",{staticClass:"d-flex a-center m-bottom-1"},[a("FeesButton",{attrs:{text:"添加附件"},on:{buttonClick:function(t){e.uploadDialog=!0}}})],1),a("el-dialog",{attrs:{visible:e.uploadDialog,title:"上传附件"},on:{"update:visible":function(t){e.uploadDialog=t}}},[a("div",{staticClass:"d-flex a-center m-bottom-2"},[a("div",{staticStyle:{"text-align":"right"}},[e._v("附件类型:")]),a("el-select",{staticClass:"flex-1",attrs:{placeholder:"请选择"},model:{value:e.uploadOption.type,callback:function(t){e.$set(e.uploadOption,"type",t)},expression:"uploadOption.type"}},e._l(e.attOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("div",{staticClass:"d-flex a-center m-bottom-2"},[a("div",{staticStyle:{"text-align":"right"}},[e._v("附件说明:")]),a("el-input",{staticClass:"flex-1",attrs:{type:"textarea"},model:{value:e.uploadOption.description,callback:function(t){e.$set(e.uploadOption,"description",t)},expression:"uploadOption.description"}})],1),a("Upload",{attrs:{title:"导入"},on:{change:e.handleUploadAttachment}})],1),a("el-table",{staticStyle:{width:"60%"},attrs:{data:e.attachmentData,border:""}},[a("el-table-column",{attrs:{prop:"date",label:"Actions",width:"180",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"text-color cursor",on:{click:function(a){return e.previewAtta(t)}}},[e._v("预览/下载")]),a("span",{staticClass:"c-red m-left-2 cursor",on:{click:function(a){return e.deleteTableColumnData(t)}}},[e._v("删除")])]}}])}),a("el-table-column",{attrs:{prop:"type",label:"附件类型",align:"center"}}),a("el-table-column",{attrs:{prop:"description",label:"说明",align:"center"}}),a("el-table-column",{attrs:{prop:"uploadTime",label:"上传日期",align:"center"}}),a("el-table-column",{attrs:{prop:"uploadUserName",label:"上传人",align:"center"}})],1)],1)}),[],!1,null,"e7b76712",null).exports,b=a("dd85"),v={name:"Detail",data:function(){return{lineMatchDialog:!1,expendData:[],lineData:[],isEdit:!1,tabCurrentIndex:null,isShow:!0,level:3,singleData:{afterPrice:"",prePrice:"",containsTax:!1,reason:""},dialogFormVisible:!1,ifShowButton:!0,currenStatus:0,statusStr:this.$route.query.statusStr||"",prdMateName:"",dialogVisible:!1,rowData:{},oldData:{},copyOrderData:[]}},props:{tableData:{type:Array,default:function(){return[]}},priceLogData:{type:Array,default:function(){return[]}},orderData:{type:Array,default:function(){return[]}},fieldGroup:{type:Object},expandId:{type:Array},loading:{type:Boolean},requestEnd:{type:Boolean}},created:function(){var e=this;"财务审核"==this.statusStr&&(this.ifShowButton=!1,this.currenStatus=1),"已完成"==this.statusStr&&(this.ifShowButton=!1,this.currenStatus=3),l.a.$on("tab-change",(function(t){e.ifShowButton=0===t,e.currenStatus=t})),this.filterList=[{label:"金额/数量+物料匹配",id:3},{label:"金额/数量匹配",id:2},{label:"物料匹配",id:1},{label:"显示全部",id:4}]},mounted:function(){var e=this;this.$nextTick((function(){for(var e=document.getElementsByClassName("el-table__expand-icon"),t=0;tthis.copyOrderData[t].unUsedQuantity||""==e)&&(this.$message.warning("修改金额大于初始值,已重置"),this.orderData[t].unUsedQuantity=this.copyOrderData[t].unUsedQuantity);break;case 0:(parseInt(e)>this.copyOrderData[t].unUsedAmount||""==e)&&(this.$message.warning("修改金额大于初始值,已重置"),this.orderData[t].unUsedAmount=this.copyOrderData[t].unUsedAmount)}this.isEdit=!1},handleUnitExchange:function(){this.$emit("unitexchange")},handlerOperate:function(e){this.$emit("handleOperate",e,this)},handleHideShow:function(){this.$emit("hiden")},handlePriceShow:function(e){this.$emit("logPrice",e.itemId,e.priceHasUpdated)},cancelUpdate:function(){this.singleData={afterPrice:"",prePrice:"",containsTax:!1,reason:""},this.dialogFormVisible=!1},updatePrice:function(){if(""===this.singleData.afterPrice)return this.$message.warning("请填写价格!");this.$emit("updatePrice",this.singleData)},handleSubRowClick:function(e,t){var a=e.id,n=e.itemId,i=e.invoiceId,l=e.taxRate,r=e.price;this.singleData=Object.assign(this.singleData,{prePrice:r,id:a,itemId:n,invoiceId:i,taxRate:l,containsTax:!1,pIndex:t.$index}),this.dialogFormVisible=!0},handleClick:function(e){this.isEdit=!0,this.tabCurrentIndex=e.$index},cancelMatch:function(){this.lineMatchDialog=!1,this.rowData=null,this.level=3},handleChooseThis:function(){this.chooses&&0!=this.chooses.length||this.$message.error("请先进行勾选!"),this.$emit("confirmMatch",this.rowData,this.chooses,this)},handleSelectionThese:function(e){this.chooses=e},handleShowAll:function(e){this.level=e,this.$emit("match",this.rowData,this.level,this.lineData[0].unUsedAmount,this.lineData[0].unUsedQuantity)},allSearch:function(){this.$emit("searmatch",this.rowData,this.level,this.prdMateName,this.lineData[0].unUsedAmount,this.lineData[0].unUsedQuantity)},startMatch:function(e){if(!this.ifShowButton)return this.$message.warning("待审核状态下无法匹配!");this.rowData=e,this.$emit("match",e,3,e.unUsedAmount,e.unUsedQuantity),this.lineData=[e],this.lineMatchDialog=!0},virtualMatch:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.dialogVisible=!0;case 2:case"end":return e.stop()}}),e)})))()},virtualMatchConfirm:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var a,n,i,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a0?"#3399cc":"red"}},[e._v(e._s(e._f("priceFormat")(n.total,n.total)))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"taxRate",label:"税率"}}),a("el-table-column",{attrs:{align:"right",prop:"tax",label:"税额","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v(" "+e._s(e._f("priceFormat")(a.tax,a.tax))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{align:"right","header-align":"center",prop:"deductionAmount",label:"折扣金额"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v(" "+e._s(e._f("priceFormat")(a.deductionAmount,a.deductionAmount))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{align:"right","header-align":"center",prop:"deductionTax",label:"折扣税额"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v(" "+e._s(e._f("priceFormat")(a.deductionTax,a.deductionTax))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"matchingStatusName",label:"状态"}})],1)]:void 0}}],null,!0)}),a("el-table-column",{attrs:{label:"Actions",align:"center",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{staticClass:"cursor text-color",on:{click:function(t){return e.startMatch(n)}}},[e._v("匹配")])]}}])}),a("el-table-column",{attrs:{type:"index",width:"150",label:"序号",align:"center"}}),a("el-table-column",{attrs:{align:"center",prop:"name",label:"产品名称",width:"240"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{attrs:{title:n.name}},[e._v(" "+e._s(n.name))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"specification",label:"规格"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{attrs:{title:n.specification}},[e._v(e._s(n.specification))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"unit",label:"单位"}}),a("el-table-column",{attrs:{align:"center",prop:"quantity",label:"数量"}}),a("el-table-column",{attrs:{prop:"price",label:"单价",align:"right","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("priceFormat")(t.row.price,t.row.price))+" ")]}}])}),a("el-table-column",{attrs:{align:"right","header-align":"center",prop:"total",label:"发票金额"}}),a("el-table-column",{attrs:{prop:"unUsedAmount",label:"剩余匹配金额","header-align":"center",align:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{style:{color:0===n.unUsedAmount?"#17c917":"red"}},[e._v(e._s(e._f("priceFormat")(n.unUsedAmount,n.unUsedAmount)))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"taxRate",label:"税率"}}),a("el-table-column",{attrs:{align:"right","header-align":"center",prop:"tax",label:"税额"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("priceFormat")(t.row.tax,t.row.tax))+" ")]}}])}),a("el-table-column",{attrs:{align:"right","header-align":"center",prop:"deductionAmount",label:"折扣金额"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{style:{color:n.deductionAmount>0?"#3399cc":"#e19b9b"},attrs:{title:n.deductionAmount}},[e._v(e._s(e._f("priceFormat")(n.deductionAmount,n.deductionAmount))+" ")])]}}])}),a("el-table-column",{attrs:{align:"right",prop:"deductionTax",label:"折扣税额","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{style:{color:n.deductionTax>0?"#3399cc":"#e19b9b"}},[e._v(e._s(e._f("priceFormat")(n.deductionTax,n.deductionTax))+" ")])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"difference",label:"差异"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{style:{color:0==n.difference?"green":"red"}},[e._v(" "+e._s(n.difference)+" ")])]}}])})],1),a("el-dialog",{attrs:{title:"提示",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("span",[e._v("确定进行虚拟物料匹配?")]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.virtualMatchConfirm}},[e._v("确 定")])],1)])],1)}),[],!1,null,null,null).exports),y=(a("99af"),a("caad"),a("a15b"),a("13d5"),a("a9e3"),a("2532"),a("2f62")),x=[{key:"date",keyCn:"开票日期",isRequired:!0,type:"date"},{key:"currency",keyCn:"币种",isRequired:!0,type:"input"},{key:"pretaxAmount",keyCn:"发票金额",isRequired:!0,type:"input"},{key:"tax",keyCn:"税额",isRequired:!0,type:"input"},{key:"buyer",keyCn:"采购方",isRequired:!0,type:"input"},{key:"buyerNo",keyCn:"采购方税号",isRequired:!0,type:"input"},{key:"code",keyCn:"发票代码",isRequired:!0,type:"input"},{key:"number",keyCn:"发票号码",isRequired:!0,type:"input"},{key:"seller",keyCn:"供应商",isRequired:!0,type:"input"},{key:"sellerNo",keyCn:"供应商税号",isRequired:!0,type:"input"},{key:"invoiceType",keyCn:"采购类型",isRequired:!0,type:"input"},{key:"orgName",keyCn:"采购组织",isRequired:!0,type:"input"},{key:"remark",keyCn:"备注说明",isRequired:!0,type:"input"}],C={name:"Ticket",components:{imgPreview:a("7eb6").a},data:function(){return{loading:!0,inputSearch:"",formField:x,oneBillDialog:!1,innerVisibleDialog:!1,oneStep:1,orderLineList:[],billDetailList:[],poList:[],hasChooseLineData:[],po:"",currenStatus:0,showAll:3,isDiscountMatch:!0,total:0,detailTotal:0,queryInfo:{pageNum:1,pageSize:10,orderNo:null},detailInfo:{pageNum:1,pageSize:10,orderNo:null},statusStr:this.$route.query.statusStr||""}},computed:{isSwitched:{get:function(){return Boolean(this.fieldGroup.matchType)},set:function(e){this.$emit("switchChanged",Number(e))}}},props:{fieldGroup:{type:Object,default:function(){return{}}}},watch:{fieldGroup:function(e){e.id&&this.showPo(e.id)}},created:function(){var e=this;l.a.$on("tab-change",(function(t){e.currenStatus=t})),"已完成"==this.statusStr&&(this.currenStatus=3),this.filterList=[{label:"金额/数量+物料匹配",id:3},{label:"金额/数量匹配",id:2},{label:"物料匹配",id:1},{label:"显示全部",id:4}]},methods:Object(i.a)(Object(i.a)({},Object(y.b)({getOrderLineList:"supplier/getOrderLineList",getOrderLineDetail:"supplier/getOrderLineDetail",getHasAdd:"supplier/getHasAdd",putPo:"supplier/putPo",queryPo:"supplier/queryPo"})),{},{handlePriceChange:function(e){this.$emit("priceChange",Number(e))},handleSwitchChange:function(e){this.$emit("switchChanged",Number(e))},handlerOperate:function(e){this.$emit("handleOperate",e,this)},showPo:function(e){var t=this,a={invoiceId:e};this.queryPo(a).then((function(e){t.po=e.result.orderNo})).catch((function(e){t.$message.warning(e.message)}))},handlerConfirmBillChoose:function(){var e=this,t=this.hasChooseLineData.reduce((function(e,t){return e.push(t.orderNo),e}),[]).join(",");if(t){var a=this.fieldGroup.id;this.putPo({invoiceId:a,supplierCode:this.hasChooseLineData[0].supplierCode,orderNo:t}).then((function(t){e.showPo(e.fieldGroup.id),e.$message.success(t.message),e.oneBillDialog=!1,e.poList=[],e.hasChooseLineData=[]})).catch((function(t){e.$message.error(t.message)}))}else this.$message.warning("请先匹配单据!")},confirmChoosePO:function(){if(!this.poList||0==this.poList.length)return this.$message.warning("请先进行勾选!");this.hasChooseLineData=this.poList,this.$message.success("当前选择单据成功!"),this.oneStep=1},handleSelectionChange:function(e){this.poList=this.poList.concat(e)},handlerDetail:function(e){var t=this;this.detailInfo.orderNo=e,this.getOrderLineDetail(this.detailInfo).then((function(e){t.innerVisibleDialog=!0,t.billDetailList=e.result.list,t.detailTotal=e.result.total})).catch((function(e){t.$message.error(e.message)}))},handlerDetailCurrentChange:function(e){this.detailInfo.pageNum=e,this.handlerDetail(this.detailInfo.orderNo)},handlerDetailSizeChange:function(e){this.detailInfo.pageSize=e,this.handlerDetail(this.detailInfo.orderNo)},handleDeleteBill:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function a(){var n,i,l,r,s;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$confirm("是否删除当前单据","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 2:if("confirm"==a.sent)try{-1!=(n=t.hasChooseLineData.findIndex((function(t){return t.orderNo==e.orderNo})))&&(t.hasChooseLineData.splice(n,1),i=t.hasChooseLineData.map((function(e){return e.orderNo})).join(","),l=t.fieldGroup,r=l.code,s=l.id,t.putPo({invoiceId:s,supplierCode:r,orderNo:i}).then((function(e){t.showPo(t.fieldGroup.id)}))),t.$message.success("删除成功")}catch(e){t.$message.error("删除失败,请重试!")}case 4:case"end":return a.stop()}}),a)})))()},dataSend:function(){this.$message.success("数据发送成功!")},handleShowAll:function(e){this.showAll=e,this.handleRelationBill(this.showAll)},allSearch:function(){this.queryInfo.orderNo=this.inputSearch,this.handleRelationBill(this.showAll)},handleRelationBill:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;this.loading=!0;var a=Object(i.a)({invoiceId:this.fieldGroup.id,all:t},this.queryInfo);this.getOrderLineList(a).then((function(t){e.oneStep=2;var a=[],n=(e.hasChooseLineData||[]).map((function(e){return e.orderNo}));(t.result.list||[]).map((function(e){n.includes(e.orderNo)||a.push(e)})),e.orderLineList=a,e.loading=!1,e.total=t.result.total})).catch((function(t){e.$message.warning(t.message)}))},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.handleRelationBill(this.showAll)},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.handleRelationBill(this.showAll)},handleChooseClose:function(){this.inputSearch="",this.queryInfo.orderNo="",this.oneStep=1,this.oneBillDialog=!1,this.showAll=!1,this.orderLineList=[]},handleChooseOneBill:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getHasAdd(e.fieldGroup.id);case 2:200==(a=t.sent).status?(e.hasChooseLineData=a.result,e.poList=a.result,e.oneBillDialog=!0):e.$message.error(a.message);case 4:case"end":return t.stop()}}),t)})))()}})},k=(a("0d3c"),a("e396"),Object(s.a)(C,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"d-flex p1 h100"},[a("div",{staticClass:"ticketAllocate-left"},[e.fieldGroup.id?a("div",{staticClass:"d-flex a-center"},[a("FeesButton",{directives:[{name:"show",rawName:"v-show",value:0==e.currenStatus,expression:"currenStatus == 0"}],attrs:{text:"选择单据"},on:{buttonClick:e.handleChooseOneBill}}),a("FeesButton",{directives:[{name:"show",rawName:"v-show",value:0==e.currenStatus,expression:"currenStatus == 0"}],attrs:{text:"一键智能匹配"},on:{buttonClick:function(t){return e.handlerOperate("ALL")}}}),a("FeesButton",{directives:[{name:"show",rawName:"v-show",value:2==e.currenStatus,expression:"currenStatus == 2"}],attrs:{icon:"el-icon-position",text:"重新发送"},on:{buttonClick:function(t){return e.handlerOperate("RESEND")}}}),a("div",{staticClass:"m-right"},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.isSwitched,callback:function(t){e.isSwitched=t},expression:"isSwitched"}},[a("el-option",{attrs:{label:"数量匹配",value:!0}}),a("el-option",{attrs:{label:"金额匹配",value:!1,disabled:1===e.fieldGroup.priceType}})],1),a("el-select",{attrs:{placeholder:"价格类型"},on:{change:e.handlePriceChange},model:{value:e.fieldGroup.priceType,callback:function(t){e.$set(e.fieldGroup,"priceType",t)},expression:"fieldGroup.priceType"}},[a("el-option",{attrs:{label:"折后价格",value:1}}),a("el-option",{attrs:{label:"折前价格",value:0,disabled:0===e.fieldGroup.matchType}})],1)],1)],1):e._e(),a("div",{staticClass:"ticketAllocate-tooltip"},[a("span",{staticClass:"f-700"},[e._v(" # ")]),a("div",[e._v(e._s(e.po))])]),a("div",{staticClass:"ticketAllocate-input"},e._l(e.formField,(function(t,n){return a("div",{key:n,staticClass:"formField",class:{isRequired:t.isRequired}},[a("label",{attrs:{for:t.key}},[e._v(e._s(t.keyCn))]),a("div",{staticClass:"m-top-1"},[a("el-input",{attrs:{id:t.key,type:"text",disabled:""},model:{value:e.fieldGroup[t.key],callback:function(a){e.$set(e.fieldGroup,t.key,a)},expression:"fieldGroup[item.key]"}})],1)])})),0)]),a("div",{staticClass:"ticketAllocate-right d-flex flex-direction"},[a("imgPreview",{staticClass:"w100 h100",staticStyle:{margin:"0 !important"},attrs:{imgItem:{}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.fieldGroup.ticketCodeStr)+" ")]},proxy:!0},{key:"image",fn:function(){return[a("el-image",{attrs:{src:e.fieldGroup.downloadUri,"preview-src-list":[e.fieldGroup.downloadUri]}})]},proxy:!0},{key:"date",fn:function(){return[e._v(" 已上载:"+e._s(e.fieldGroup.date)+" ")]},proxy:!0}])})],1),a("el-dialog",{attrs:{title:1==e.oneStep?"选择单据":"单据匹配发票",visible:e.oneBillDialog,"before-close":e.handleChooseClose,width:"50vw"},on:{"update:visible":function(t){e.oneBillDialog=t}}},[a("el-dialog",{attrs:{width:"80%",title:"单据明细",visible:e.innerVisibleDialog,"append-to-body":""},on:{"update:visible":function(t){e.innerVisibleDialog=t}}},[a("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:e.billDetailList,border:""}},[a("el-table-column",{attrs:{align:"center",prop:"supplierCode",width:"100",label:"供应商代码"}}),a("el-table-column",{attrs:{align:"center",prop:"receiveNo",label:"ID"}}),a("el-table-column",{attrs:{align:"center",prop:"orderNo",label:"订单编号",width:"160"}}),a("el-table-column",{attrs:{align:"center",prop:"lineNum",label:"行",width:"60"}}),a("el-table-column",{attrs:{align:"center",prop:"goods",label:"货物",width:"240"}}),a("el-table-column",{attrs:{align:"center",prop:"goodsNum",label:"数量"}}),a("el-table-column",{attrs:{align:"center",prop:"receivedNum",label:"收货"}}),a("el-table-column",{attrs:{align:"center",prop:"matchNum",label:"可匹配"}}),a("el-table-column",{attrs:{align:"right",prop:"unitPrice",label:"单价","header-align":"center"}}),a("el-table-column",{attrs:{align:"right",prop:"amount","header-align":"center",label:"金额"}}),a("el-table-column",{attrs:{align:"center",prop:"source",label:"来源"}})],1),a("el-pagination",{staticClass:"b",attrs:{background:"","current-page":e.detailInfo.pageNum,"page-size":e.detailInfo.pageSize,"page-sizes":[10,20,30,50],layout:" prev, pager, next,total, sizes, jumper",total:e.detailTotal},on:{"size-change":e.handlerDetailSizeChange,"current-change":e.handlerDetailCurrentChange,"update:currentPage":function(t){return e.$set(e.detailInfo,"pageNum",t)},"update:current-page":function(t){return e.$set(e.detailInfo,"pageNum",t)}}})],1),a("div",{directives:[{name:"show",rawName:"v-show",value:1==e.oneStep,expression:"oneStep == 1"}]},[a("div",{staticClass:"d-flex a-center m-bottom-1"},[a("FeesButton",{attrs:{text:"关联单据"},on:{buttonClick:function(t){return e.handleShowAll(3)}}})],1),a("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:e.hasChooseLineData,border:""}},[a("el-table-column",{attrs:{align:"center",prop:"orderNo",label:"单据号(PO号)"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{staticClass:"text-color"},[e._v(e._s(n.orderNo))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"supplierCode",label:"供应商"}}),a("el-table-column",{attrs:{align:"right",prop:"amount",label:"单据金额","header-align":"center"}}),a("el-table-column",{attrs:{align:"right",prop:"unUsedAmount",label:"未配金额","header-align":"center"}}),a("el-table-column",{attrs:{prop:"name",label:"Actions",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"text-color cursor",on:{click:function(a){return e.handleDeleteBill(t.row)}}},[e._v("移除")])]}}])})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.oneStep,expression:"oneStep == 2"}]},[a("div",{staticClass:"d-flex a-center m-bottom-1 showAll"},e._l(e.filterList,(function(t,n){return a("text-button",{key:n,staticClass:"m-left-1",attrs:{color:e.showAll==t.id?"#3399cc":"#000"}},[a("span",{staticClass:"w100",staticStyle:{display:"inline-block"},on:{click:function(a){return e.handleShowAll(t.id)}}},[e._v(e._s(t.label))])])})),1),a("div",{staticClass:"elTable"},[a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.inputSearch,callback:function(t){e.inputSearch=t},expression:"inputSearch"}}),a("el-button",{attrs:{size:"small"},on:{click:e.allSearch}},[e._v("搜索")])],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:e.orderLineList,border:"","element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.8)","max-height":"400"},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",align:"center",width:"55",label:"序号"}}),a("el-table-column",{attrs:{align:"center",prop:"supplierCode",label:"供应商"}}),a("el-table-column",{attrs:{align:"center",prop:"orderNo",label:"单据号"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{staticClass:"text-color"},[e._v(e._s(n.orderNo))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"orderDate",label:"单据日期"}}),a("el-table-column",{attrs:{align:"center",prop:"amount",label:"收货金额"}}),a("el-table-column",{attrs:{align:"center",prop:"unUsedAmount",label:"相关未配金额"}}),a("el-table-column",{attrs:{prop:"name",label:"Actions",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{staticClass:"text-color cursor",on:{click:function(t){return e.handlerDetail(n.orderNo)}}},[e._v("明细")])]}}])})],1),a("el-pagination",{staticClass:"b",attrs:{background:"","current-page":e.queryInfo.pageNum,"page-size":e.queryInfo.pageSize,"page-sizes":[10,20,30,50],layout:" prev, pager, next,total, sizes, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"update:currentPage":function(t){return e.$set(e.queryInfo,"pageNum",t)},"update:current-page":function(t){return e.$set(e.queryInfo,"pageNum",t)}}})],1),1==e.oneStep?a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"确 定"},on:{buttonClick:e.handlerConfirmBillChoose}})],1):e._e(),2==e.oneStep?a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消"},on:{buttonClick:e.handleChooseClose}}),a("FeesButton",{attrs:{text:"确 定"},on:{buttonClick:e.confirmChoosePO}})],1):e._e()],1)],1)}),[],!1,null,"431b5df8",null).exports),_=a("307d"),D=a.n(_),S={name:"InvoiceMatch",components:{"match-left":d,TabLog:h,TabAttachment:g,TabDetail:w,TabTicket:k},data:function(){return{activeTab:"1",fieldGroup:{},chooseBillDialog:!1,lineMatchDialog:!1,stepOneTable:[],stepTwoTable:[],tableData:[],detailTableData:[],logData:[],attachmentData:[],invoiceMatchLeft:[],orderData:[],pageInfo:{length:10,startNo:1,matchStatus:0},loading:!1,detailLoading:!1,expandId:[],priceLogData:[],requestEnd:!1}},provide:function(){return{SUPPLIER:this}},created:function(){var e=this;l.a.$on("tab-change",(function(t){e.pageInfo.length=10,e.pageInfo.startNo=1,e.pageInfo.matchStatus=t,e.fieldGroup={}}));var t=JSON.parse(D.a.decode(this.$route.query.matchInfo));"已完成"===this.$route.query.statusStr&&(this.pageInfo.matchStatus=3),this.matchInfo=t,"财务审核"!==this.$route.query.statusStr&&this.initLeftList(t)},computed:{matchType:function(){return this.$route.query.matchType}},watch:{"pageInfo.matchStatus":function(){this.initLeftList(this.matchInfo)},fieldGroup:function(e){if(e!={}){if(!this.fieldGroup)return this.$message.warning("请先选择一张发票!"),this.detailTableData=[],this.logData=[],void(this.attachmentData=[]);switch(parseInt(this.activeTab)){case 2:this.initDetailData(e.id);break;case 3:this.initAttachmentList(e.id);break;case 4:this.initLogList(e.id)}}},activeTab:function(e){if(this.fieldGroup)switch(parseInt(e)){case 2:this.initDetailData(this.fieldGroup.id);break;case 3:this.initAttachmentList(this.fieldGroup.id);break;case 4:this.initLogList(this.fieldGroup.id)}}},mounted:function(){},methods:Object(i.a)(Object(i.a)({},Object(y.b)({getLeftInvoiceList:"supplier/getLeftInvoiceList",getDetailList:"supplier/getDetailList",getAttachmentList:"supplier/getAttachmentList",getLogList:"supplier/getLogList",deleteAttachmentList:"supplier/deleteAttachmentList",getLineMatchList:"supplier/getLineMatchList",putLineMatchList:"supplier/putLineMatchList",getMatchItem:"supplier/getMatchItem",clearMatching:"supplier/clearMatching",completeMatching:"supplier/completeMatching",passReview:"supplier/passReview",resendInvoice:"supplier/resendInvoice",revokeInvoice:"supplier/revokeInvoice",autoSmartMatch:"supplier/autoSmartMatch"})),{},{handleHidenshow:function(){this.priceLogData=[]},handleUnitExchange:function(){var e=this;Object(b.gb)(this.fieldGroup.id,this.fieldGroup.sellerNo).then((function(t){200==t.status?e.initDetailData(e.fieldGroup.id):e.$message.error(t.message)})).catch((function(t){e.$message.error(t.message)}))},handleQueryPriceLog:function(e,t){var a=this;if(!t)return this.priceLogData=[];Object(b.M)(e).then((function(e){200==e.status&&(a.priceLogData=e.result.map((function(e){return{preValue:e.preValue,operatorUser:e.operatorUser,afterValue:e.afterValue,createTime:e.createTime,reason:e.reason}})))})).catch((function(e){}))},handlePriceUpdate:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function a(){var n,i,r,s,o,c;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(b.L)(e);case 3:if(200!=(n=a.sent).status){a.next=14;break}return t.$message.success(n.message),l.a.$emit("closed"),i=e.pIndex,r=e.id,a.next=10,Object(b.X)(r);case 10:200==(s=a.sent).status&&(o=t.detailTableData[i].expendData,c=o.findIndex((function(e){return e.id==r})),o.splice(c,1,s.result),t.detailTableData[i].expendData=o,t.initDetailData(t.fieldGroup.id)),a.next=15;break;case 14:t.$message.error(n.message);case 15:a.next=20;break;case 17:a.prev=17,a.t0=a.catch(0);case 20:case"end":return a.stop()}}),a,null,[[0,17]])})))()},handlePriceChanged:function(e){var t=this;Object(b.ib)({priceType:e,id:this.fieldGroup.id}).then((function(a){200==a.status?t.fieldGroup.priceType=e:t.$message.error(a.message)})).catch((function(e){t.$message.error(e.message)}))},handleSwitchChanged:function(e){var t=this;Object(b.P)({id:this.fieldGroup.id,matchType:e}).then((function(a){200==a.status?t.fieldGroup.matchType=e:t.$message.error(a.message)})).catch((function(e){t.$message.error(e.message)}))},handleOperate:function(e,t){var a=this;switch(e){case"ALL":this.autoSmartMatch(this.fieldGroup.id).then((function(e){t.showPo(a.fieldGroup.id),200===e.status&&a.$message({message:"匹配成功",type:"success"})})).catch((function(e){a.interfaceHandle(e)}));break;case"BACK":this.revokeInvoice(this.fieldGroup.id).then((function(e){a.interfaceHandle(e)})).catch((function(e){a.interfaceHandle(e)}));break;case"OK":this.passReview(this.fieldGroup.id).then((function(e){a.interfaceHandle(e)})).catch((function(e){a.interfaceHandle(e)}));break;case"RESEND":this.resendInvoice(this.fieldGroup.id).then((function(e){a.interfaceHandle(e)})).catch((function(e){a.interfaceHandle(e)}))}},interfaceHandle:function(e){200==e.status?(this.$message.success(e.message),this.initLeftList(this.matchInfo)):this.$message.error(e.message)},handleMatchComplete:function(){var e=this,t=[];if(this.detailTableData&&this.detailTableData.forEach((function(e){e.expendData.length>0&&e.expendData.forEach((function(e){0==e.matchingStatus&&t.push(e.id)}))})),0==t.length)return this.$message.warning("暂无可匹配完成的");this.completeMatching({ids:t,invoiceId:this.fieldGroup.id}).then((function(t){200==t.status?(e.$message.success(t.message),e.initLeftList(e.matchInfo)):e.$message.error(t.message)})).catch((function(t){e.$message.error(t.message)}))},clearMatch:function(e,t){var a=this,n=e.id,i=t.id,l=this.detailTableData.findIndex((function(e){return e.id==n})),r=this.detailTableData[l].expendData.findIndex((function(e){return e.id==i}));this.clearMatching([i]).then((function(e){if(200==e.status){if(1==a.detailTableData[l].expendData.length){var t=a.expandId.findIndex((function(e){return e==n}));a.expandId.splice(t,1)}a.detailTableData[l].expendData.splice(r,1),a.refreshItem(n,l),a.handleVirtualMatchc(),a.$message.success(e.message)}else a.$message.error(e.message)})).catch((function(e){}))},refreshItem:function(e,t){var a=this;return Object(n.a)(regeneratorRuntime.mark((function n(){var i,l,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(b.q)(e);case 3:i=n.sent,l=a.detailTableData[t].expendData,(r=i.result).expendData=l,a.detailTableData.splice(t,1,r),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0);case 13:case"end":return n.stop()}}),n,null,[[0,10]])})))()},handleConfrimMatch:function(e,t,a){var n=this,i=e.id,l=this.fieldGroup.id;this.putLineMatchList({itemId:i,invoiceId:l,orders:t}).then((function(e){200==e.status&&(a.cancelMatch(),n.initDetailData(n.fieldGroup.id),n.$message.success(e.message))}))},handleMatch:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,a=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=e.id,l=e.unit,r=this.fieldGroup.id;this.getMatchList(r,i,t,a,n,l)},handleVirtualMatchc:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function a(){var n,i,l,r,s;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=t.detailTableData.length,i=t.detailTableData.findIndex((function(t){return t.id==e})),t.refreshItem(e,i),l=0;case 4:if(!(l0&&t.expandId.push(r.id),r.expendData=s.result),l==n-1&&(t.requestEnd=!1);case 11:l++,a.next=4;break;case 14:case"end":return a.stop()}}),a)})))()},searchHandleMatch:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0,r=e.id,s=e.unit,o=this.fieldGroup.id;this.getLineMatchList({invoiceId:o,itemId:r,level:a,prdMateName:n,unUsedAmount:i,unUsedQuantity:l,uom:s}).then((function(e){t.orderData=e.result})).catch((function(e){t.orderData=[],t.$message.error(e.message)}))},getMatchList:function(e,t,a,n,i,l){var r=this;this.getLineMatchList({invoiceId:e,itemId:t,level:a,unUsedAmount:n,unUsedQuantity:i,uom:l}).then((function(e){r.orderData=e.result})).catch((function(e){r.orderData=[],r.$message.error(e.message)}))},handleLoadMore:function(e){if(e){if(this.pageInfo.length>this.total)return this.$message.error("没有更多数据了!");this.pageInfo.length+=10,this.initLeftList(this.matchInfo)}},handleLogQuery:function(e){this.initLogList(this.fieldGroup.id,e)},handleUpdateAttr:function(){this.initAttachmentList(this.fieldGroup.id)},deleteAttachMent:function(e){var t=this;this.deleteAttachmentList(e).then((function(e){t.$message.success(e.message),t.initAttachmentList(t.fieldGroup.id)})).catch((function(e){t.$message.error(e.message)}))},handleGetDetail:function(e){this.activeTab="1",this.fieldGroup=e},initDetailData:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function a(){var n,i,l,r,s;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t.detailLoading=!0,t.requestEnd=!0,t.expandId=[],a.prev=3,a.next=6,t.getDetailList({itemId:e});case 6:if(200!=(n=a.sent).status){a.next=24;break}t.detailLoading=!1,t.detailTableData=n.result,i=t.detailTableData.length,l=0;case 12:if(!(l0&&t.expandId.push(r.id),r.expendData=s.result),l==i-1&&(t.requestEnd=!1);case 19:l++,a.next=12;break;case 22:a.next=25;break;case 24:t.detailLoading=!1;case 25:a.next=31;break;case 27:a.prev=27,a.t0=a.catch(3),t.detailLoading=!1,t.requestEnd=!1;case 31:case"end":return a.stop()}}),a,null,[[3,27]])})))()},initAttachmentList:function(e){var t=this;this.getAttachmentList(e).then((function(e){t.attachmentData=e.result})).catch((function(e){}))},initLogList:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.getLogList({itemId:e,keywords:a}).then((function(e){t.logData=e.result})).catch((function(e){}))},handleKeywords:function(e){var t=Object.assign(e,this.matchInfo);this.initLeftList(t)},initLeftList:function(e){var t=this;this.loading=!0;var a=Object.assign(e,this.pageInfo);this.getLeftInvoiceList(a).then((function(e){t.loading=!1,t.invoiceMatchLeft=e.result.data,t.total=e.result.pagination.total})).catch((function(e){t.loading=!1,t.invoiceMatchLeft=[],t.$message.error(e.message)}))}})},L=(a("ffc3"),a("b00e"),Object(s.a)(S,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"InvoiceMatch h100 d-flex p-top-1"},[a("match-left",{attrs:{invoiceMatchLeft:e.invoiceMatchLeft,loading:e.loading},on:{getDetail:e.handleGetDetail,loadMore:e.handleLoadMore,blur:e.handleKeywords}}),a("div",{staticClass:"match_invoiceFields w100 "},[a("el-tabs",{attrs:{type:"card"},model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[a("el-tab-pane",{attrs:{label:"配票",name:"1"}},[a("TabTicket",{attrs:{fieldGroup:e.fieldGroup,tableData:e.tableData,stepOneTable:e.stepOneTable,stepTwoTable:e.stepTwoTable},on:{switchChanged:e.handleSwitchChanged,priceChange:e.handlePriceChanged,handleOperate:e.handleOperate}})],1),a("el-tab-pane",{attrs:{label:"明细",name:"2"}},[a("TabDetail",{attrs:{tableData:e.detailTableData,fieldGroup:e.fieldGroup,orderData:e.orderData,expandId:e.expandId,loading:e.detailLoading,priceLogData:e.priceLogData,requestEnd:e.requestEnd},on:{match:e.handleMatch,virtualMatchConfirm:e.handleVirtualMatchc,searmatch:e.searchHandleMatch,updatePrice:e.handlePriceUpdate,confirmMatch:e.handleConfrimMatch,clearCurrentMatch:e.clearMatch,matchComplete:e.handleMatchComplete,unitexchange:e.handleUnitExchange,logPrice:e.handleQueryPriceLog,hiden:e.handleHidenshow,handleOperate:e.handleOperate}})],1),a("el-tab-pane",{attrs:{label:"附件",name:"3"}},[a("TabAttachment",{attrs:{attachmentData:e.attachmentData,fieldGroup:e.fieldGroup},on:{deleteAttachMent:e.deleteAttachMent,updateAttachMent:e.handleUpdateAttr}})],1),a("el-tab-pane",{attrs:{label:"日志",name:"4"}},[a("TabLog",{attrs:{logData:e.logData},on:{queryLog:e.handleLogQuery}})],1)],1)],1)],1)}),[],!1,null,"43e55df0",null));t.default=L.exports},e396:function(e,t,a){"use strict";var n=a("fdca");a.n(n).a},e3db:function(e,t){var a={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==a.call(e)}},e932:function(e,t,a){"use strict";var n=a("f484");a.n(n).a},f484:function(e,t,a){},f66c:function(e,t,a){},f8ce:function(e,t,a){},fdca:function(e,t,a){},ffc3:function(e,t,a){"use strict";var n=a("cad7");a.n(n).a}}]);