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 lines
71 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-d2c71566"],{"070c":function(e,t,a){"use strict";var i=a("5fd8");a.n(i).a},"1e44":function(e,t,a){"use strict";var i=a("21a3");a.n(i).a},"21a3":function(e,t,a){},"21c8":function(e,t,a){},"237c":function(e,t,a){"use strict";var i=a("2946");a.n(i).a},2946:function(e,t,a){},"37d8":function(e,t,a){"use strict";var i=a("21c8");a.n(i).a},"519a":function(e,t,a){"use strict";var i=a("7dab");a.n(i).a},"59c8":function(e,t,a){},"59e8":function(e,t,a){},"5b2b":function(e,t,a){"use strict";var i=a("2b0e");t.a=new i.default},"5b4e":function(e,t,a){"use strict";var i=a("59e8");a.n(i).a},"5dfc":function(e,t,a){"use strict";var i=a("59c8");a.n(i).a},"5fd8":function(e,t,a){},"7dab":function(e,t,a){},"7eb6":function(e,t,a){"use strict";var i={name:"img-preview",props:{imgItem:{type:Object}},created:function(){},data:function(){return{}}},n=(a("5dfc"),a("2877")),l=Object(n.a)(i,(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},"7f56":function(e,t,a){},"8eed":function(e,t,a){},"97c1":function(e,t,a){"use strict";var i={name:"TabLog",data:function(){return{keywords:""}},props:{logData:{type:Array}},methods:{queryLog:function(){this.$emit("queryLog",this.keywords)}}},n=a("2877"),l=Object(n.a)(i,(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:"550",border:""}},[a("el-table-column",{attrs:{align:"center",prop:"createTime",label:"操作时间",width:"200"}}),""!=e.logData.operatorUserName?a("el-table-column",{attrs:{align:"center",prop:"operatorUserName",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,"35e63df4",null);t.a=l.exports},"99a1":function(e,t,a){"use strict";var i=a("7f56");a.n(i).a},b4da:function(e,t,a){"use strict";var i=a("e845");a.n(i).a},e3ee:function(e,t,a){"use strict";var i=a("8eed");a.n(i).a},e845:function(e,t,a){},e9b6:function(e,t,a){"use strict";a.r(t);a("4de4"),a("c740"),a("4160"),a("d81d"),a("a434"),a("159b"),a("cca6"),a("96cf");var i=a("1da1"),n=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("519a"),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,i){return a("div",{directives:[{name:"show",rawName:"v-show",value:!e.isCollapse,expression:"!isCollapse"}],key:i,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,"09e6b42f",null).exports,c={name:"collapse",props:["title","isCollapse","isShowCollapse"],data:function(){return{}}},u=(a("1e44"),{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,"27db402f",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-50<a&&t.$emit("loadMore",!0)}),300)},backTop:function(){var e=document.getElementById("mIT");e.scrollTop>0&&(e.scrollTop=0)},handlerBackSearch:function(){location.reload()},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("5b4e"),a("237c"),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,i){return a("div",{key:i,staticClass:"invoiceItem cursor",class:{alreadyClick:e.currentClick==i},on:{click:function(a){return e.handleInvoiceClick(i,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==i?"#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,"23203d4a",null).exports),h=a("97c1"),p=(a("a4d3"),a("e01a"),a("a630"),a("3ca3"),a("c7f0")),f={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),i=a.type,n=a.description,l=new FormData;Array.from(e).forEach((function(e){l.append("files",e)})),l.append("invoiceId",this.fieldGroup.id),l.append("type",i),l.append("description",n),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(i.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:p.a}},m=Object(s.a)(f,(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,"2e9762ca",null).exports,g=a("dd85"),b={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:{},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;t<e.length;t++)e[t].innerHTML=""})),l.a.$on("closed",(function(){e.cancelUpdate()}))},updated:function(){this.copyOrderData=JSON.parse(JSON.stringify(this.orderData))},methods:{handleExportMapping:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(a={}).invoiceId=e.tableData[0].pid,e.$file.downloadFile("api/manager/supplier/invoice-items-line-all-export",a,"reportForm.xlsx");case 3:case"end":return t.stop()}}),t)})))()},blurFn:function(e,t){switch(this.fieldGroup.matchType){case 1:(parseInt(e)>this.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){"OK"==e?this.$emit("passReviewBefore",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,i=e.itemId,n=e.invoiceId,l=e.taxRate,r=e.price;this.singleData=Object.assign(this.singleData,{prePrice:r,id:a,itemId:i,invoiceId:n,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(i.a)(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:t.dialogVisible=!0,t.rowData=e;case 2:case"end":return a.stop()}}),a)})))()},virtualMatchConfirm:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a,i,n,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.dialogVisible=!1,"",a=e.tableData[0].pid,i={itemId:"",invoiceId:a},t.next=6,Object(g.G)(i);case 6:for(n=0;n<e.tableData.length;n++)l=e.tableData[n],e.$emit("virtualMatchConfirm",l);case 7:case"end":return t.stop()}}),t)})))()},clearMatch:function(e,t){this.$emit("clearCurrentMatch",e,t)},rowClick:function(e){this.rows=e,this.lineMatchDialog=!0},handleMatchComplete:function(){this.$emit("matchComplete")}}},v=(a("070c"),Object(s.a)(b,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"p1 Detail"},[a("div",{staticClass:"d-flex a-center m-bottom-1 j-sb"},[a("div",{staticClass:"d-flex a-center"},[a("FeesButton",{directives:[{name:"permission",rawName:"v-permission",value:"Revocation",expression:"'Revocation'"},{name:"show",rawName:"v-show",value:1!==e.currenStatus&&0!==e.currenStatus,expression:"currenStatus !== 1 && currenStatus !== 0"}],attrs:{text:"撤回"},on:{buttonClick:function(t){return e.handlerOperate("BACK")}}}),a("FeesButton",{directives:[{name:"show",rawName:"v-show",value:1==e.currenStatus,expression:"currenStatus == 1"}],attrs:{text:"撤回"},on:{buttonClick:function(t){return e.handlerOperate("BACK")}}}),a("FeesButton",{directives:[{name:"permission",rawName:"v-permission",value:"Approved",expression:"'Approved'"},{name:"show",rawName:"v-show",value:1==e.currenStatus,expression:"currenStatus == 1"}],attrs:{text:"审核通过"},on:{buttonClick:function(t){return e.handlerOperate("OK")}}}),e.ifShowButton?a("FeesButton",{attrs:{text:"匹配完成"},on:{buttonClick:e.handleMatchComplete}}):e._e(),e.ifShowButton?a("FeesButton",{attrs:{text:"单位换算"},on:{buttonClick:e.handleUnitExchange}}):e._e(),e.ifShowButton?a("FeesButton",{directives:[{name:"permission",rawName:"v-permission",value:"Virtualmaterial",expression:"'Virtualmaterial'"}],attrs:{text:"虚拟物料"},on:{buttonClick:e.virtualMatch}}):e._e(),a("FeesButton",{attrs:{text:"导出匹配明细"},on:{buttonClick:e.handleExportMapping}})],1),a("text-button",{on:{click:function(t){e.isShow=!e.isShow}}},[e._v(e._s(e.isShow?"折叠":"展开"))])],1),a("el-dialog",{attrs:{title:"选择行匹配",visible:e.lineMatchDialog,width:"80vw"},on:{"update:visible":function(t){e.lineMatchDialog=t}}},[a("div",{staticClass:"line-match"},[a("div",{staticClass:"text-color m-bottom-1"},[e._v("发票行")]),a("el-table",{staticStyle:{width:"90%","margin-bottom":"20px"},attrs:{data:e.lineData,"highlight-current-row":"",id:"lineData",border:""}},[a("el-table-column",{attrs:{prop:"name",align:"center",label:"名称",width:"240"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.name}},[e._v(e._s(i.name))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"specification",label:"规格"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.specification}},[e._v(e._s(i.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:{align:"right",prop:"price",label:"单价","header-align":"center"}}),a("el-table-column",{attrs:{align:"right",prop:"unUsedAmount",label:"未匹配金额/数量","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v(" "+e._s(1==e.fieldGroup.matchType?a.unUsedQuantity:a.unUsedAmount)+" ")]}}])}),a("el-table-column",{attrs:{align:"right",prop:"total",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.total,a.total))+" ")]}}])}),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))+" ")]}}])}),a("el-table-column",{attrs:{align:"right",prop:"deductionAmount",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.deductionAmount,a.deductionAmount))+" ")]}}])}),a("el-table-column",{attrs:{align:"right",prop:"deductionTax",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.deductionTax,a.deductionTax))+" ")]}}])})],1),a("div",{staticClass:"text-color m-bottom-1 d-flex j-sb"},[a("div",{staticClass:"elTable"},[a("span",{staticClass:"text-color"},[e._v("可选订单行")]),a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.prdMateName,callback:function(t){e.prdMateName=t},expression:"prdMateName"}}),a("el-button",{attrs:{size:"small"},on:{click:function(t){return e.allSearch()}}},[e._v("搜索")])],1),a("div",{staticClass:"d-flex a-center m-bottom-1 showAll"},e._l(e.filterList,(function(t,i){return a("text-button",{key:i,staticClass:"m-left-1",attrs:{color:e.level==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("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:e.orderData,id:"orderData",border:"",height:"360"},on:{"selection-change":e.handleSelectionThese}},[a("el-table-column",{attrs:{type:"selection",width:"55",label:"序号",align:"center"}}),a("el-table-column",{attrs:{align:"center",prop:"receiveNo",label:"ID"}}),a("el-table-column",{attrs:{align:"center",prop:"orderNo",label:"单据号"}}),a("el-table-column",{attrs:{align:"center",prop:"receiveTime",label:"收货日期"}}),a("el-table-column",{attrs:{prop:"goods",align:"center",width:"240",label:"产品名称"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.goods}},[e._v(e._s(i.goods))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"itemNo",label:"物料号"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.itemNo}},[e._v(e._s(i.itemNo))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"uom",label:"单位"}}),a("el-table-column",{attrs:{align:"center",prop:"receivedNum",label:"收货数量"}}),a("el-table-column",{attrs:{align:"right",prop:"unitPrice",label:"单价","header-align":"center"}}),a("el-table-column",{attrs:{align:"right",prop:"amount",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.amount,a.amount))+" ")]}}])}),a("el-table-column",{attrs:{align:"right",prop:"unUsedAmount",label:"数量/匹配金额","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"edit-match-price"},[!e.isEdit||e.isEdit&&e.tabCurrentIndex!=t.$index?a("i",{staticClass:"el-icon-edit",on:{click:function(a){return e.handleClick(t)}}},[e._v(" "+e._s(1==e.fieldGroup.matchType?t.row.unUsedQuantity:t.row.unUsedAmount))]):e._e(),e.isEdit&&e.tabCurrentIndex==t.$index?a("div",[1==e.fieldGroup.matchType?a("input",{directives:[{name:"focus",rawName:"v-focus"},{name:"model",rawName:"v-model",value:t.row.unUsedQuantity,expression:"scope.row.unUsedQuantity"}],staticClass:"unUsedAmount",attrs:{type:"text"},domProps:{value:t.row.unUsedQuantity},on:{blur:function(a){return e.blurFn(t.row.unUsedQuantity,t.$index)},input:function(a){a.target.composing||e.$set(t.row,"unUsedQuantity",a.target.value)}}}):a("input",{directives:[{name:"focus",rawName:"v-focus"},{name:"model",rawName:"v-model",value:t.row.unUsedAmount,expression:"scope.row.unUsedAmount"}],staticClass:"unUsedAmount",attrs:{type:"text"},domProps:{value:t.row.unUsedAmount},on:{blur:function(a){return e.blurFn(t.row.unUsedAmount,t.$index)},input:function(a){a.target.composing||e.$set(t.row,"unUsedAmount",a.target.value)}}})]):e._e()])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"taxRate",label:"税率"}}),a("el-table-column",{attrs:{align:"right",prop:"rate",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.rate,a.rate))+" ")]}}])})],1)],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"返 回"},on:{buttonClick:e.cancelMatch}}),a("FeesButton",{attrs:{text:"确 定"},on:{buttonClick:e.handleChooseThis}})],1)]),a("el-dialog",{attrs:{title:"价格",visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("el-form",{attrs:{model:e.singleData,"label-position":"right"}},[a("el-form-item",{attrs:{label:"原价","label-width":"120"}},[a("el-input",{attrs:{disabled:"",autocomplete:"off"},model:{value:e.singleData.prePrice,callback:function(t){e.$set(e.singleData,"prePrice",t)},expression:"singleData.prePrice"}})],1),a("el-form-item",{attrs:{label:"更新价格类型"}},[a("el-radio-group",{model:{value:e.singleData.containsTax,callback:function(t){e.$set(e.singleData,"containsTax",t)},expression:"singleData.containsTax"}},[a("el-radio",{attrs:{label:!0}},[e._v("含税价")]),a("el-radio",{attrs:{label:!1}},[e._v("不含税价")])],1)],1),a("el-form-item",{attrs:{label:"更新价格","label-width":"120"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.singleData.afterPrice,callback:function(t){e.$set(e.singleData,"afterPrice",t)},expression:"singleData.afterPrice"}})],1),a("el-form-item",{attrs:{label:"备注","label-width":"120"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.singleData.reason,callback:function(t){e.$set(e.singleData,"reason",t)},expression:"singleData.reason"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.cancelUpdate}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.updatePrice}},[e._v("确 定")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"pTable m-bottom-2",staticStyle:{overflow:"auto",width:"99%"},attrs:{data:e.tableData,"row-key":"id","expand-row-keys":e.expandId,"tree-props":{children:"children",hasChildren:"hasChildren"}}},[a("el-table-column",{attrs:{type:"expand",align:"center",width:"1"},scopedSlots:e._u([{key:"default",fn:function(t){return e.isShow?[a("el-table",{staticClass:"sTable",attrs:{id:"sTable",data:t.row.expendData,border:""}},[a("el-table-column",{attrs:{prop:"",align:"center","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.row;return[a("span",{directives:[{name:"show",rawName:"v-show",value:0==n.matchingStatus,expression:"row.matchingStatus == 0"}],staticClass:"cursor text-color",on:{click:function(a){return e.clearMatch(t.row,n)}}},[a("i",{staticClass:"iconfont icon-Disconnect c-red f-700"})])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"orderNo",width:"150",align:"center",label:"PO","header-align":"center"}}),a("el-table-column",{attrs:{prop:"name",width:"240",align:"center",label:"产品名称"}}),a("el-table-column",{attrs:{align:"center",prop:"itemNo",label:"物料号"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.itemNo}},[e._v(e._s(i.itemNo))])]}}],null,!0)}),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:{align:"right","header-align":"center",prop:"price",label:"单价"},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.row;return[a("el-popover",{attrs:{"open-delay":n.priceHasUpdated?300:3e5,placement:"top-start",title:"价格修改记录",width:"580",trigger:"hover"},on:{show:function(t){return e.handlePriceShow(n)},hide:e.handleHideShow}},[a("el-table",{attrs:{data:e.priceLogData,height:"180"}},[a("el-table-column",{attrs:{width:"180",prop:"createTime",label:"操作时间"}}),a("el-table-column",{attrs:{width:"150",prop:"preValue",label:"前值"}}),a("el-table-column",{attrs:{width:"150",prop:"afterValue",label:"后值"}}),a("el-table-column",{attrs:{width:"150",prop:"reason",label:"备注","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{width:"100",prop:"operatorUser",label:"操作人"}})],1),a("span",{class:{red:n.priceHasUpdated},staticStyle:{display:"inline-block","min-width":"50px"},attrs:{slot:"reference"},on:{click:function(a){return e.handleSubRowClick(n,t)}},slot:"reference"},[e._v(e._s(n.price))])],1)]}}],null,!0)}),a("el-table-column",{attrs:{align:"right","header-align":"center",prop:"receivedTotal",label:"收货金额"}}),a("el-table-column",{attrs:{align:"right",prop:"total","header-align":"center",label:"匹配金额"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{style:{color:i.total>0?"#3399cc":"red"}},[e._v(e._s(e._f("priceFormat")(i.total,i.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:"130"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{staticClass:"cursor text-color",on:{click:function(t){return e.startMatch(i)}}},[e._v("匹配")])]}}])}),a("el-table-column",{attrs:{type:"index",width:"80",label:"序号",align:"center"}}),a("el-table-column",{attrs:{align:"center",prop:"name",label:"产品名称",width:"240"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.name}},[e._v(" "+e._s(i.name))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"specification",label:"规格"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{attrs:{title:i.specification}},[e._v(e._s(i.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 i=t.row;return[a("span",{style:{color:0===i.unUsedAmount?"#17c917":"red"}},[e._v(e._s(e._f("priceFormat")(i.unUsedAmount,i.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 i=t.row;return[a("span",{style:{color:i.deductionAmount>0?"#3399cc":"#e19b9b"},attrs:{title:i.deductionAmount}},[e._v(e._s(e._f("priceFormat")(i.deductionAmount,i.deductionAmount))+" ")])]}}])}),a("el-table-column",{attrs:{align:"right",prop:"deductionTax",label:"折扣税额","header-align":"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{style:{color:i.deductionTax>0?"#3399cc":"#e19b9b"}},[e._v(e._s(e._f("priceFormat")(i.deductionTax,i.deductionTax))+" ")])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"difference",label:"差异"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("span",{style:{color:0==i.difference?"green":"red"}},[e._v(" "+e._s(i.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),w=(a("99af"),a("caad"),a("a15b"),a("13d5"),a("a9e3"),a("d3b7"),a("2532"),a("ddb0"),a("e260"),a("e6cf"),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"},{key:"ext10",keyCn:"预制发票号",isRequired:!0,type:"input"}],y={name:"Ticket",components:{imgPreview:a("7eb6").a},data:function(){return{sellerList:[],chooseItem:null,loading:!0,inputSearch:"",formField:x,formFieldList:[],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||"",isShowMaterielDialog:!1,isShowNoTaxDialog:!1,materielData:[],selectedMaterial:{},sellerName:""}},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),"3"==e.matchStatus?this.formFieldList=this.formField:this.formFieldList=this.formField.filter((function(e){return"ext10"!=e.key}))}},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}]},mounted:function(){this.$nextTick((function(){}))},methods:Object(n.a)(Object(n.a)({},Object(w.b)({getOrderLineList:"supplier/getOrderLineList",getOrderLineDetail:"supplier/getOrderLineDetail",getHasAdd:"supplier/getHasAdd",putPo:"supplier/putPo",queryPo:"supplier/queryPo"})),{},{handleSellerCurrentChange:function(e){this.chooseItem=e},confirmSeller:function(){if(null!=this.chooseItem){var e=this.chooseItem,t=e.id,a=e.taxNo;this.saveSupplier(t,a)}else this.$message.warning("请选择供应商")},saveSupplier:function(e,t){var a=this,i={id:e,taxNo:t};Object(g.bb)(i).then((function(e){200==e.status?(a.$message.success(e.message),a.isShowNoTaxDialog=!1,a.chooseItem=null):a.$message.warning(e.message)}))},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},handleSelectionChange1: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(i.a)(regeneratorRuntime.mark((function a(){var i,n,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!=(i=t.hasChooseLineData.findIndex((function(t){return t.orderNo==e.orderNo})))&&(t.hasChooseLineData.splice(i,1),n=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:n}).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(n.a)({invoiceId:this.fieldGroup.id,all:t},this.queryInfo);this.getOrderLineList(a).then((function(t){e.oneStep=2;var a=[],i=(e.hasChooseLineData||[]).map((function(e){return e.orderNo}));(t.result.list||[]).map((function(e){i.includes(e.orderNo)||a.push(e)})),e.orderLineList=a,e.loading=!1,e.total=t.result.total})).catch((function(t){if("供应商不存在"==t.message){e.isShowNoTaxDialog=!0;var a=e.fieldGroup.seller;e.getSupplierByNameLike(a)}}))},handleSearch:function(){var e=this.sellerName;this.getSupplierByNameLike(e)},getSupplierByNameLike:function(e){var t=this,a={name:e};Object(g.C)(a).then((function(e){t.sellerList=e.result}))},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(i.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)})))()},handleMaterialMatch:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={invoiceId:e.fieldGroup.id},t.next=3,Object(g.c)(a);case 3:200==(i=t.sent).status?0==i.result.isAutoMat?(e.isShowMaterielDialog=!0,e.materielData=i.result.response.resFormat):e.$message.success("匹配成功"):e.$message.error(i.message);case 5:case"end":return t.stop()}}),t)})))()},handleSelectionChange:function(e){this.selectedMaterial=e},confirmChooseMaterial:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=e.selectedMaterial.map((function(e){return{material:e.D,materialNo:e.C,orgName:"",source:"",supplierMaterial:e.F,specification:e.G,uom:e.H,supplierNo:e.supplierCode}})),Promise.all(a.map((function(e){return Object(g.g)(e)}))).then((function(t){e.$message.success("创建成功"),e.isShowMaterielDialog=!1})).catch((function(t){e.$message.warning(t)}));case 2:case"end":return t.stop()}}),t)})))()},confirmNoTax:function(){}})},C=(a("b4da"),a("e3ee"),Object(s.a)(y,(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:e.handleMaterialMatch}}),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}})],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}})],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",{class:"3"==e.fieldGroup.matchStatus?"ticketAllocate-input-match ":"ticketAllocate-input"},e._l(e.formFieldList,(function(t,i){return a("div",{key:i,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.imgPath,"preview-src-list":[e.fieldGroup.imgPath]}})]},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 i=t.row;return[a("span",{staticClass:"text-color"},[e._v(e._s(i.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,i){return a("text-button",{key:i,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.handleSelectionChange1}},[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 i=t.row;return[a("span",{staticClass:"text-color"},[e._v(e._s(i.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 i=t.row;return[a("span",{staticClass:"text-color cursor",on:{click:function(t){return e.handlerDetail(i.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),a("el-dialog",{attrs:{title:"物料",visible:e.isShowMaterielDialog,width:"50%"},on:{"update:visible":function(t){e.isShowMaterielDialog=t}}},[a("el-table",{attrs:{data:e.materielData},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"C",label:"物料编号",width:"120"}}),a("el-table-column",{attrs:{prop:"D",label:"物料描述",width:"200"}}),a("el-table-column",{attrs:{prop:"F",label:"发票物料描述"}}),a("el-table-column",{attrs:{prop:"G",label:"规格"}})],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.isShowMaterielDialog=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.confirmChooseMaterial}},[e._v("确 定")])],1)],1),a("el-dialog",{attrs:{title:"供应商",visible:e.isShowNoTaxDialog,width:"50%"},on:{"update:visible":function(t){e.isShowNoTaxDialog=t}}},[a("div",[a("el-row",{attrs:{type:"flex",align:"middle"}},[a("el-col",{attrs:{span:2}},[e._v("供应商")]),a("el-col",{attrs:{span:8}},[a("el-input",{model:{value:e.sellerName,callback:function(t){e.sellerName=t},expression:"sellerName"}})],1),a("el-col",{attrs:{push:1,span:14}},[a("el-button",{attrs:{type:"primary"},on:{click:e.handleSearch}},[e._v("搜索")])],1)],1)],1),a("div",[a("el-table",{attrs:{data:e.sellerList,"highlight-current-row":""},on:{"current-change":e.handleSellerCurrentChange}},[a("el-table-column",{attrs:{prop:"name",label:"供应商"}}),a("el-table-column",{attrs:{prop:"taxNo",label:"税号"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.isShowNoTaxDialog=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.confirmSeller}},[e._v("确 定")])],1)])],1)}),[],!1,null,"0eb3b144",null).exports),D={name:"InvoiceMatch",components:{"match-left":d,TabLog:h.a,TabAttachment:m,TabDetail:v,TabTicket:C},data:function(){return{activeTab:"1",fieldGroup:{},chooseBillDialog:!1,lineMatchDialog:!1,stepOneTable:[],stepTwoTable:[],tableData:[],detailTableData:[],logData:[],attachmentData:[],invoiceMatchLeft:[],exchangeRateDate:"",orderData:[],pageInfo:{length:10,startNo:1,matchStatus:0},queryInfo:{pageSize:10,pageNo:1},detailTotal:0,loading:!1,detailLoading:!1,expandId:[],priceLogData:[],requestEnd:!1,chooseMatchDialog:!0,exchangeRateDateDialog:!1,exchangeRateDateNeed:!1,matchFields:{invoiceType:"",seller:"",number:"",buyer:"",matchMode:1,received:""},received:[{id:"",name:"全部"},{id:1,name:"是"}],fileOptionsFilter:[],flag:!0,rules:{invoiceType:[{required:!0,message:"请选择发票类型",trigger:"change"}],ticketCode:[{required:!0,message:"请选择发票类型",trigger:"blur"}],matchMode:[{required:!0,message:"请选择匹配类型",trigger:"blur"}]}}},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={}})),this.matchInfo=this.matchFields,this.getExpenseList(),setTimeout((function(){e.invoiceMatch()}),1e3)},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.queryInfo.pageNo=1,this.queryInfo.pageSize=10,this.total=0,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(n.a)(Object(n.a)({},Object(w.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",passReview2:"supplier/passReview",resendInvoice:"supplier/resendInvoice",revokeInvoice:"supplier/revokeInvoice",autoSmartMatch:"supplier/autoSmartMatch"})),{},{handleHidenshow:function(){this.priceLogData=[]},invoiceMatch:function(){1==this.fileOptionsFilter.length&&(this.matchFields.invoiceType=this.fileOptionsFilter[0].id),this.chooseMatchDialog=!0},confirmMatchInvoice:function(){var e=this,t=Object.assign({},this.matchFields);this.$refs.invoiceForm.validate((function(a){if(!a)return e.$message.error("请检查是否存在未填项!");if(1==t.matchMode)e.chooseMatchDialog=!1,e.initLeftList(t);else{e.chooseMatchDialog=!1;var i=Object.assign({length:10,startNo:1,matchStatus:2},e.matchFields);e.getLeftInvoiceList(i).then((function(t){e.billData=t.result})),clearTimeout(e.timeId),e.timeId=setTimeout((function(){e.chooseBillDialog=!0}),600)}}))},closeMatchDialog:function(){this.chooseMatchDialog=!1,this.exchangeRateDateDialog=!1},getExpenseList:function(){var e=this;return Object(i.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(g.eb)();case 2:a=t.sent,e.fileOptionsFilter=a.result.filter((function(e){return e.id<3}));case 4:case"end":return t.stop()}}),t)})))()},handleUnitExchange:function(){var e=this;Object(g.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(g.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){a.$message.error(e.message)}))},handlePriceUpdate:function(e){var t=this;return Object(i.a)(regeneratorRuntime.mark((function a(){var i,n,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(g.L)(e);case 3:if(200!=(i=a.sent).status){a.next=14;break}return t.$message.success(i.message),l.a.$emit("closed"),n=e.pIndex,r=e.id,a.next=10,Object(g.X)(r);case 10:200==(s=a.sent).status&&(o=t.detailTableData[n].expendData,c=o.findIndex((function(e){return e.id==r})),o.splice(c,1,s.result),t.detailTableData[n].expendData=o,t.initDetailData(t.fieldGroup.id)),a.next=15;break;case 14:t.$message.error(i.message);case 15:a.next=20;break;case 17:a.prev=17,a.t0=a.catch(0),t.$message.error(a.t0.message);case 20:case"end":return a.stop()}}),a,null,[[0,17]])})))()},handlePriceChanged:function(e){var t=this;Object(g.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(g.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)}))},passReviewBefore:function(){var e=this;if("60100"==this.fieldGroup.ticketCode){Object(g.E)({code:"INVOICE_EXCHANGE_RATE_DATE_NEED"}).then((function(t){200===t.status&&"1"==t.result.value?(e.exchangeRateDateNeed=!0,e.exchangeRateDateDialog=!0):(e.exchangeRateDateNeed=!1,e.handleOperate("OK"))})).catch((function(t){e.interfaceHandle(t)}))}else this.exchangeRateDateNeed=!1,this.handleOperate("OK")},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":if(this.exchangeRateDateNeed&&0==this.exchangeRateDate.length){this.$message({message:"形式发票,税率日期必填",type:"warning"});break}Object(g.K)(this.fieldGroup.id,this.exchangeRateDate).then((function(e){200==e.status&&(a.$message({message:"审核完成",type:"success"}),a.exchangeRateDateDialog=!1,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,i=e.id,n=t.id,l=this.detailTableData.findIndex((function(e){return e.id==i})),r=this.detailTableData[l].expendData.findIndex((function(e){return e.id==n}));this.clearMatching([n]).then((function(e){if(200==e.status){if(1==a.detailTableData[l].expendData.length){var t=a.expandId.findIndex((function(e){return e==i}));a.expandId.splice(t,1)}a.detailTableData[l].expendData.splice(r,1),a.refreshItem(i,l),a.$message.success(e.message)}else a.$message.error(e.message)})).catch((function(e){a.$message.error(e.message)}))},refreshItem:function(e,t){var a=this;return Object(i.a)(regeneratorRuntime.mark((function i(){var n,l,r;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,Object(g.q)(e);case 3:n=i.sent,l=a.detailTableData[t].expendData,(r=n.result).expendData=l,a.detailTableData.splice(t,1,r),i.next=13;break;case 10:i.prev=10,i.t0=i.catch(0),a.$message.error(i.t0.message);case 13:case"end":return i.stop()}}),i,null,[[0,10]])})))()},handleConfrimMatch:function(e,t,a){var i=this,n=e.id,l=this.fieldGroup.id;this.putLineMatchList({itemId:n,invoiceId:l,orders:t}).then((function(e){200==e.status&&(a.cancelMatch(),i.initDetailData(i.fieldGroup.id),i.$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,i=arguments.length>3?arguments[3]:void 0,n=e.id,l=e.unit,r=this.fieldGroup.id;this.getMatchList(r,n,t,a,i,l)},handleVirtualMatchc:function(e){var t=this;return Object(i.a)(regeneratorRuntime.mark((function a(){var i,n,l;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return i=t.detailTableData.length,n=t.detailTableData.findIndex((function(t){return t.id==e.id})),t.refreshItem(e.id,n),a.next=5,t.getMatchItem({itemId:e.id});case 5:200==(l=a.sent).status&&(l.result.length>0&&t.expandId.push(e.id),e.expendData=l.result),n==i-1&&(t.requestEnd=!1);case 8:case"end":return a.stop()}}),a)})))()},searchHandleMatch:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,i=arguments.length>2?arguments[2]:void 0,n=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:i,unUsedAmount:n,unUsedQuantity:l,uom:s}).then((function(e){e.result.forEach((function(e){e.unUsedQuantity=parseFloat(e.unUsedQuantity)})),t.orderData=e.result})).catch((function(e){t.orderData=[],t.$message.error(e.message)}))},getMatchList:function(e,t,a,i,n,l){var r=this;this.getLineMatchList({invoiceId:e,itemId:t,level:a,unUsedAmount:i,unUsedQuantity:n,uom:l}).then((function(e){e.result.forEach((function(e){e.unUsedQuantity=parseFloat(e.unUsedQuantity)})),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},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.initDetailData(this.fieldGroup.id)},handleCurrentChange:function(e){this.queryInfo.pageNo=e,this.initDetailData(this.fieldGroup.id)},initDetailData:function(e){var t=this;return Object(i.a)(regeneratorRuntime.mark((function a(){var i,l,r,s,o;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,i=Object(n.a)(Object(n.a)({},t.queryInfo),{},{itemId:e}),a.next=7,t.getDetailList(i);case 7:if(200==(l=a.sent).status)for(t.detailLoading=!1,t.detailTableData=l.result.dataResult,t.detailTotal=l.result.total,t.queryInfo.pageNo=l.result.currentPage,t.queryInfo.pageSize=l.result.pageSize,r=t.detailTableData.length,s=0;s<r;s++)o=t.detailTableData[s],t.expandId.push(o.id),o.expendData=o.itemMatchingList;else t.detailLoading=!1;a.next=15;break;case 11:a.prev=11,a.t0=a.catch(3),t.detailLoading=!1,t.requestEnd=!1;case 15:case"end":return a.stop()}}),a,null,[[3,11]])})))()},initAttachmentList:function(e){var t=this;this.getAttachmentList(e).then((function(e){t.attachmentData=e.result})).catch((function(e){t.$message.error(e.message)}))},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){t.$message.error(e.message)}))},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)}))}})},k=(a("99a1"),a("37d8"),Object(s.a)(D,(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",{staticClass:"detail-info",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,passReviewBefore:e.passReviewBefore}}),e.detailTotal>=10?a("el-pagination",{attrs:{background:"","page-sizes":[10,20,30,50],layout:" prev, pager, next,total, sizes, jumper",total:e.detailTotal,"current-page":e.queryInfo.pageNo,"page-size":e.queryInfo.pageSize},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"update:currentPage":function(t){return e.$set(e.queryInfo,"pageNo",t)},"update:current-page":function(t){return e.$set(e.queryInfo,"pageNo",t)}}}):e._e()],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),a("el-dialog",{attrs:{title:"选择匹配信息",visible:e.chooseMatchDialog,width:"30vw"},on:{"update:visible":function(t){e.chooseMatchDialog=t}}},[a("el-form",{ref:"invoiceForm",attrs:{model:e.matchFields,"label-width":"120px",rules:e.rules}},[a("el-form-item",{attrs:{label:"发票类型",prop:"invoiceType"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择发票类型"},model:{value:e.matchFields.invoiceType,callback:function(t){e.$set(e.matchFields,"invoiceType",t)},expression:"matchFields.invoiceType"}},e._l(e.fileOptionsFilter,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"匹配类型",prop:"matchMode"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择匹配类型"},model:{value:e.matchFields.matchMode,callback:function(t){e.$set(e.matchFields,"matchMode",t)},expression:"matchFields.matchMode"}},[a("el-option",{attrs:{label:"单张发票匹配",value:1}}),2!=e.matchFields.invoiceType?a("el-option",{attrs:{label:"批量匹配发票",value:2}}):e._e()],1)],1),a("el-form-item",{attrs:{label:"供应商名称"}},[a("el-input",{model:{value:e.matchFields.seller,callback:function(t){e.$set(e.matchFields,"seller",t)},expression:"matchFields.seller"}})],1),a("el-form-item",{attrs:{label:"发票号码"}},[a("el-input",{attrs:{disabled:2==e.matchFields.matchMode},model:{value:e.matchFields.number,callback:function(t){e.$set(e.matchFields,"number",t)},expression:"matchFields.number"}})],1),a("el-form-item",{attrs:{label:"购买方名称"}},[a("el-input",{model:{value:e.matchFields.buyer,callback:function(t){e.$set(e.matchFields,"buyer",t)},expression:"matchFields.buyer"}})],1),a("el-form-item",{attrs:{label:"是否收票"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"是否收票"},model:{value:e.matchFields.received,callback:function(t){e.$set(e.matchFields,"received",t)},expression:"matchFields.received"}},e._l(e.received,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消",icon:"el-icon-circle-close"},on:{buttonClick:e.closeMatchDialog}}),a("FeesButton",{directives:[{name:"debounce",rawName:"v-debounce",value:{time:500,methods:e.confirmMatchInvoice},expression:"{ time: 500, methods: confirmMatchInvoice }"}],attrs:{text:"确 定",icon:"el-icon-circle-check"}})],1)],1),a("el-dialog",{attrs:{title:"填选汇率日期",visible:e.exchangeRateDateDialog,width:"30vw"},on:{"update:visible":function(t){e.exchangeRateDateDialog=t}}},[a("el-form",{ref:"exchangeRateDateForm",attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"汇率日期",prop:"exchangeRateDate"}},[a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"选择日期"},model:{value:e.exchangeRateDate,callback:function(t){e.exchangeRateDate=t},expression:"exchangeRateDate"}})],1)],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消",icon:"el-icon-circle-close"},on:{buttonClick:e.closeMatchDialog}}),a("FeesButton",{attrs:{text:"确 定",icon:"el-icon-circle-check"},on:{buttonClick:function(t){return e.handleOperate("OK")}}})],1)],1)],1)}),[],!1,null,"67c426b8",null));t.default=k.exports}}]);