"use strict";(self["webpackChunk"]=self["webpackChunk"]||[]).push([[63],{9063:function(e,t,a){a.r(t),a.d(t,{default:function(){return p}});var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("div",[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onSave}},[e._v("保存")]),t("div",{staticClass:"fileWrap"},[t("el-button",{attrs:{type:"warning",size:"mini"}},[e._v("上传")]),t("input",{ref:"inputRef",attrs:{type:"file"},on:{change:e.upload}})],1),t("el-button",{attrs:{size:"mini"},on:{click:e.back}},[e._v("返回")])],1),t("div",{staticClass:"tableWrap"},[t("table",[t("thead",[t("tr",[t("td",{attrs:{colspan:"6"}},[e._v(e._s(e.invoiceData.title||""))])])]),t("tbody",[t("tr",[t("td",{attrs:{colspan:"6",align:"left"}},[t("div",{staticClass:"td-item"},[e._v(e._s(`缴款码:${e.invoiceData.paymentCode||""}`))]),t("div",{staticClass:"td-item"},[t("span",[e._v(" "+e._s(`执收单位编码:${e.invoiceData.receivingCode||""}`))]),t("span",[e._v(" "+e._s(`票据代码:${e.invoiceData.invoiceCode||""}`))]),t("span",[e._v(" "+e._s(`校验码:${e.invoiceData.checkCode||""}`))])]),t("div",{staticClass:"td-item"},[t("span",[e._v(" "+e._s(`执收单位名称:${e.invoiceData.receivingName||""}`))]),t("span",[e._v(" "+e._s(`票据号码:${e.invoiceData.invoiceNumber||""}`))]),t("span",[e._v(" "+e._s(`填制日期:${e.invoiceData.billingDate||""}`))])])])]),t("tr",[t("td",{attrs:{rowspan:"3"}},[e._v("付款人")]),t("td",[e._v("全称")]),t("td",[e._v(e._s(e.invoiceData.payerName||""))]),t("td",{attrs:{rowspan:"3"}},[e._v("收款人")]),t("td",[e._v("全称")]),t("td",[e._v(e._s(e.invoiceData.payeeName||""))])]),t("tr",[t("td",[e._v("账号")]),t("td",[e._v(e._s(e.invoiceData.payerNumber||""))]),t("td",[e._v("账号")]),t("td",[e._v(e._s(e.invoiceData.payeeNumber||""))])]),t("tr",[t("td",[e._v("开户银行")]),t("td",[e._v(e._s(e.invoiceData.payerBank||""))]),t("td",[e._v("开户银行")]),t("td",[e._v(e._s(e.invoiceData.payeeBank||""))])]),t("tr",[t("td",{attrs:{colspan:"4"}},[t("div",{staticClass:"td-item",staticStyle:{"justify-content":"left"}},[t("span",{staticStyle:{"margin-right":"50px"}},[e._v(" "+e._s(`币种:${e.invoiceData.currencyCode||"人民币"}`))]),t("span",[e._v(" "+e._s(`金额(大写):${e.invoiceData.amountTaxCN||""}`))])])]),t("td",{attrs:{colspan:"2"}},[e._v(e._s(`(小写):${e.invoiceData.amountTax||""}`))])]),e._m(0),e._l(e.invoiceData.invoiceLists,(function(a){return t("tr",{key:a.commodityNo},[t("td",[e._v(e._s(a.commodityNo||""))]),t("td",[e._v(e._s(a.commodityName||""))]),t("td",[e._v(e._s(a.unit||"元"))]),t("td",[e._v(e._s(a.quantity||""))]),t("td",[e._v(e._s(a.standard||""))]),t("td",[e._v(e._s(a.amount||""))])])})),e._m(1),e._m(2),t("tr",[t("td",{attrs:{colspan:"3"}},[t("div",{staticClass:"td-item"},[t("span",[e._v(" "+e._s("执收单位盖章:"))]),t("span",[e._v(" "+e._s(`经办人盖章:${e.invoiceData.sealMark||""}`))])])]),t("td",{staticStyle:{"text-align":"left"},attrs:{colspan:"3"}},[e._v(e._s(`备注:${e.invoiceData.remarks||""}`))])])],2)])])])},o=[function(){var e=this,t=e._self._c;return t("tr",[t("td",[e._v("项目编码")]),t("td",[e._v("收入项目名称")]),t("td",[e._v("单位")]),t("td",[e._v("数量")]),t("td",[e._v("收缴标准")]),t("td",[e._v("金额")])])},function(){var e=this,t=e._self._c;return t("tr",[t("td"),t("td"),t("td"),t("td"),t("td"),t("td")])},function(){var e=this,t=e._self._c;return t("tr",[t("td"),t("td"),t("td"),t("td"),t("td"),t("td")])}],s=a(5139),r=a(2313),i=a(2112),c={name:"InvoiceDecoder",components:{},data(){return{invoiceData:{},filePath:""}},computed:{},mounted(){},methods:{netocr(e){let t=new FormData;t.append("file",e),t.append("key",r.J.key),t.append("secret",r.J.secret),t.append("typeId",20090),t.append("format","json"),(0,s.Em)(t).then((e=>{const{data:t}=e;this.invoiceData=t[0]?.invoice})).catch((e=>{console.log("🚀 ~ getNetocr ~ err:",e)}))},baiduNormal(e){const t={pdf_file:e,verify_parameter:!1,probability:!1,location:!1};(0,s.getBaiduNormal)(t).then((e=>{console.log("🚀 ~ main ~ res:",e)})).catch((e=>{console.log("🚀 ~ main ~ err:",e)}))},obsFile(e){const t=localStorage.getItem("domainId")||"default",a=new Date,n=a.getFullYear(),o=a.getMonth()+1<10?"0"+(a.getMonth()+1):a.getMonth()+1,s=a.getDate()<10?"0"+a.getDate():a.getDate(),i=o+"-"+s,c=`uploads/${n}/${i}/${t}/${a.getTime()}/${e.name}`;let d=this;const u=new ObsClient({access_key_id:r.R.ak,secret_access_key:r.R.sk,server:r.R.urlserver,timeout:300});u.putObject({Bucket:r.R.BucketName,Key:c,SourceFile:e}).then((function(e){if(e.CommonMsg.Status<300){const e=`https://${r.R.BucketName}.${r.R.urlserver}/${c}`;d.filePath=e}}))},upload(e){const t=e.target.files[0];this.obsFile(t),this.netocr(t),this.$refs.inputRef.value=""},onSave(){if(!this.invoiceData.title)return this.$message.error("请先上传文件");const{paymentCode:e,receivingCode:t,invoiceCode:a,checkCode:n,receivingName:o,invoiceNumber:r,billingDate:c,payerName:d,payerBank:u,payerNumber:l,payeeName:p,payeeNumber:m,payeeBank:v,amountTaxCN:_,amountTax:h,invoiceLists:f,sealMark:y,remarks:b}=this.invoiceData,g={payment_code:e,collection_unit_code:t,bill_code:a,verification_code:n,collection_unit_name:o,bill_number:r,fill_date:c,payer_name:d,payer_bank:u,payer_account:l,payee_name:p,payee_account:m,payee_bank:v,amount_words:_||(0,i.u9)(h),amount_figures:h,project_code:f[0]?.commodityNo,project_name:f[0]?.commodityName,number:f[0]?.quantity,fee_standards:f[0]?.standard,sum_price:f[0]?.amount,collection_unit:"",operator_name:y,remark:b,file:this.filePath};(0,s.Uw)(g).then((e=>{1==e.code?(this.$message.success(e.msg),setTimeout((()=>{window.open("about:blank","_self").close()}),3e3)):this.$message.error(e.msg)})).catch((e=>{console.log("🚀 ~ savePayment ~ err:",e)}))},back(){window.open("about:blank","_self").close()}}},d=c,u=a(1656),l=(0,u.A)(d,n,o,!1,null,"0c2c76d0",null),p=l.exports},5139:function(e,t,a){a.d(t,{tb:function(){return h},T$:function(){return l},TJ:function(){return u},Em:function(){return p},$A:function(){return y},e:function(){return b},nl:function(){return f},Uw:function(){return m},K9:function(){return _},mv:function(){return v}});var n=a(417),o=a(4927);const s=n.A.create({baseURL:window.location.origin,timeout:5e4,headers:{"Content-Type":"application/json"}});s.interceptors.request.use((e=>{if(!e.url.includes("/api/v2/recogInvoive.do")){const t=localStorage.getItem("accessToken");t&&(e.headers.accessToken=t)}return e}),(e=>Promise.reject(e))),s.interceptors.response.use((e=>{let t=e.data;return e.headers["x-subject-token"]&&(t={...e.data,"x-subject-token":e.headers["x-subject-token"]}),t.code&&0!==t.code?401!==t.code?t:void(window.location.href="/"):t}),(e=>(-1!=e.message.indexOf("timeout")?o.Message.error("网络超时"):"Network Error"==e.message?o.Message.error("网络连接错误"):e.response.data?o.Message.error(e.response.data.message||e.response.statusText):o.Message.error("接口路径找不到"),Promise.reject(e))));var r=s;const i="OAnbVZhEuY5UNB9WbDeqstbj",c="1mMtAGw9ZgoblmNpTrk0SQFikFHFVsbh",d=()=>{let e={method:"POST",url:`/bdapi/oauth/2.0/token?client_id=${i}&client_secret=${c}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}};return new Promise(((t,a)=>{r(e).then((e=>{t(e.access_token)})).catch((e=>{a(e)}))}))},u=async(e={})=>r({url:"/bdapi/rpc/2.0/brain/solution/faceprint/result/simple?access_token="+await d(),method:"post",headers:{"Content-Type":"application/json",Accept:"application/json"},data:e}),l=async(e={})=>r({url:"/bdapi/rest/2.0/ocr/v1/idcard?access_token="+await d(),method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},data:e}),p=async(e={})=>r({url:"https://netocr.com/api/v2/recogInvoive.do",method:"post",headers:{"Content-Type":"multipart/form-data"},data:e}),m=async(e={})=>r({url:"/obpm/magic-api/tax/payment",method:"post",data:e}),v=async(e={})=>r({url:"/v5api/v3/shared/common/resources",method:"post",data:e}),_=async(e={})=>r({url:"/v5api/v3/shared/common/resources/base64",method:"post",data:e}),h=async(e={},t)=>r({url:"/v5api/v3/wechat/cgi-bin/confirm-check-status",method:"post",data:e,headers:t});function f(e,t){return r(`${t}/identify/api/baidu/match-face`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:{bizFaceMode:"UNIAPP",vtp:70,appointChannel:"UNIAPP",...e}})}const y=async()=>r({url:"/hwapi/v3/auth/tokens",method:"post",headers:{"Content-Type":"application/json",Accept:"application/json"},data:{auth:{identity:{methods:["password"],password:{user:{name:"bcxin_yw",password:"Bcxin#202103#5186",domain:{name:"bcxin_yw"}}}},scope:{project:{name:"cn-north-4"}}}}}),b=async(e,t)=>r({url:"/hwfaceapi/v2/967cb11fa5304894816463bde95c8a78/face-detect",method:"post",headers:{...t},data:e})},2313:function(e,t,a){a.d(t,{J:function(){return o},R:function(){return n}});let n={};n="true"==localStorage.getItem("__isDev__")?{ak:"YYSIHHGD8VTNTQVA2NCB",sk:"fd3My9hE8N7Byl4SJ8Mx0kKcn7gvaZoh506WGC0y",urlserver:"obs.cn-north-1.myhuaweicloud.com",BucketName:"bcxin-saas-test",CDN_POINT:"https://bcxinsaasprod.baibaodun.cn"}:{ak:"YYSIHHGD8VTNTQVA2NCB",sk:"fd3My9hE8N7Byl4SJ8Mx0kKcn7gvaZoh506WGC0y",urlserver:"obs.cn-north-1.myhuaweicloud.com",BucketName:"bcxin-saas-prod",CDN_POINT:"https://bcxinsaasprod.baibaodun.cn"};const o={key:"Es1TRT94hJsvSttv9GLhy4",secret:"19d6be2e3e164f98a1b7d1321a73189c"}},2112:function(e,t,a){a.d(t,{UE:function(){return s},u9:function(){return o}});var n=a(2313);const o=e=>{let t,a,n,o=new Array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖"),s=new Array("","拾","佰","仟"),r=new Array("","万","亿","兆"),i=new Array("角","分","毫","厘"),c="整",d="元",u=1e15,l="";if(""==e)return"";if(e=parseFloat(e),e>=u)return"";if(0==e)return l=o[0]+d+c,l;if(e=e.toString(),-1==e.indexOf(".")?(t=e,a=""):(n=e.split("."),t=n[0],a=n[1].substr(0,4)),parseInt(t,10)>0){let e=0,a=t.length;for(let n=0;n0&&(l+=o[0]),e=0,l+=o[parseInt(i)]+s[u]),0==u&&e<4&&(l+=r[d])}l+=d}if(""!=a){let e=a.length;for(let t=0;tnew Promise(((a,o)=>{const s=new Date,r=s.getFullYear(),i=s.getMonth()+1<10?"0"+(s.getMonth()+1):s.getMonth()+1,c=s.getDate()<10?"0"+s.getDate():s.getDate(),d=i+"-"+c,u=`uploads/${r}/${d}/${t}/${s.getTime()}/${e.name}`,l=new ObsClient({access_key_id:n.R.ak,secret_access_key:n.R.sk,server:n.R.urlserver,timeout:300});l.putObject({Bucket:n.R.BucketName,Key:u,SourceFile:e}).then((function(e){if(e.CommonMsg.Status<300){const e=`https://${n.R.BucketName}.${n.R.urlserver}/${u}`;a(e)}else o(!1)})).catch((()=>{o(!1)}))}))}}]); //# sourceMappingURL=63.f5f42b26.js.map