reportImport-legacy-98ccbf4e.js 6.8 KB

1
  1. System.register(["./vendor-legacy-8856a2a6.js","./index-legacy-240e7575.js"],(function(e,t){"use strict";var a,l,n,i,o,r,s=document.createElement("style");return s.textContent=".import-container[data-v-a25b7a0f]{text-align:center;height:calc(100vh - var(--main-nav-height) - var(--main-tabs-height) - var(--main-footer-height) - 15px - 50px);background-color:#fff;padding:15px;border-radius:8px}.import-container .import-con[data-v-a25b7a0f]{display:inline-block;margin-top:20vh;font-size:13px;color:#999}.import-container .import-con .img[data-v-a25b7a0f]{height:180px;cursor:pointer}.import-container .import-con .img[data-v-a25b7a0f]:hover{opacity:.8}.import-container .import-con .link-con[data-v-a25b7a0f]{margin:10px 0 20px}\n",document.head.appendChild(s),{setters:[function(e){a=e.u,l=e.r,n=e.o,i=e.e},function(e){o=e.n,r=e.g}],execute:function(){e("default",o({__name:"reportImport",setup:function(e){var t=a(),o=l(),s=l([]),c=l(!0),d=l([{name:"营业额",reality:0,threshold:0,target:0,challenge:0},{name:"变动费",reality:0,threshold:0,target:0,challenge:0},{name:"边界利润",reality:0,threshold:0,target:0,challenge:0},{name:"边界利润率",reality:0,threshold:0,target:0,challenge:0},{name:"固定费",reality:0,threshold:0,target:0,challenge:0},{name:"经营利润",reality:0,threshold:0,target:0,challenge:0},{name:"人效",reality:0,threshold:0,target:0,challenge:0}]),u=l(!1);function h(e){return parseFloat(e)/100}function p(){c.value=!0,HTTP.get("business_data_statistics").then((function(e){if(0==e.code){e.data.results.length>0?u.value=!0:u.value=!1;var t=e.data.results[0],a=d.value;a[0].reality=t.total_revenue,a[1].reality=t.total_change_fees,a[2].reality=t.total_revenue-t.total_change_fees,a[3].reality=((t.total_revenue-t.total_change_fees)/t.total_revenue*100).toFixed(2)+"%",a[4].reality=t.total_fixed_fees,a[5].reality=t.total_revenue-t.total_change_fees-t.total_fixed_fees,a[6].reality=(t.total_revenue-t.total_change_fees)/t.team_size,a[3].threshold=((t.total_revenue-t.total_change_fees)/t.total_revenue*100).toFixed(2)+"%",a[4].threshold=t.total_fixed_fees,a[2].threshold=a[4].threshold+a[5].threshold,a[0].threshold=(a[2].threshold/((t.total_revenue-t.total_change_fees)/t.total_revenue)).toFixed(0),a[1].threshold=a[0].threshold-a[2].threshold,a[6].threshold=a[2].threshold/t.team_size,a[3].target=(100*(h(a[3].reality)+.01)).toFixed(2)+"%",a[4].target=1.1*t.total_fixed_fees,a[5].target=(1.1*(t.total_revenue-t.total_change_fees-t.total_fixed_fees)).toFixed(0),a[2].target=parseFloat(a[4].target)+parseFloat(a[5].target),a[0].target=(a[2].target/(h(a[3].reality)+.01)).toFixed(0),a[1].target=a[0].target-a[2].target,a[6].target=a[2].target/t.team_size,a[3].challenge=(100*(h(a[3].reality)+.01)).toFixed(2)+"%",a[4].challenge=1.1*t.total_fixed_fees,a[5].challenge=(2*(t.total_revenue-t.total_change_fees-t.total_fixed_fees)).toFixed(0),a[2].challenge=parseFloat(a[4].challenge)+parseFloat(a[5].challenge),a[0].challenge=(a[2].challenge/(h(a[3].reality)+.01)).toFixed(0),a[1].challenge=a[0].challenge-a[2].challenge,a[6].challenge=a[2].challenge/t.team_size}})).finally((function(){setTimeout((function(){return c.value=!1}),500)}))}var g=l(0);return n((function(){c.value=!0,u.value=!0,p()})),{__sfc:!0,router:t,excel_upload_input:o,fileList:s,uploadUrl:"http://sms.9haoai.com/api/upload_qiniu/",loading:c,downloadTemplate:function(){var e=document.createElement("a");e.href="https://salary-management-public.oss-cn-hangzhou.aliyuncs.com/%E7%BB%8F%E8%90%A5%E6%8A%A5%E8%A1%A8%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx",e.download="",e.style.display="none",document.body.appendChild(e),e.click(),setTimeout((function(){document.body.removeChild(e)}),100)},setHeaders:function(){return{Authorization:"token "+r("token")}},selectFile:function(){o.value.click()},handleAvatarSuccess:function(e,t,a){if(0==e.code){var l={file_url:e.data};HTTP.post("parse_financial_statements",l).then((function(e){0==e.code?i.exports.Message.success("导入成功"):i.exports.Message.error(e.msg)}))}},goPage:function(){t.push({path:"/finances/businessReport/enterReportView"})},tableData:d,showTable:u,percentToNumber:h,goDetail:function(){t.push({path:"/finances/businessReport/dynamicReport"})},getList:p,towNum:g,anewUpload:function(){u.value=!1,g.value=1},back:function(){u.value=!0}}}},(function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:a.loading,expression:"loading"}],staticClass:"import-container"},[a.showTable?t("div",{staticClass:"container"},[t("div",{staticStyle:{display:"flex","margin-bottom":"10px"}},[a.showTable?t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61104,expression:"61104"}],staticClass:"btn-con",staticStyle:{"margin-left":"auto"},attrs:{type:"primary"},on:{click:a.goDetail}},[e._v("查看详情 ")]):e._e(),t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61105,expression:"61105"}],staticClass:"re-btn",attrs:{type:"primary",plain:""},on:{click:a.anewUpload}},[e._v("重新上传财务报表 ")])],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:a.tableData,"header-cell-style":{background:"#F6FAFF"}}},[t("el-table-column",{attrs:{prop:"name",align:"center",label:"经营合计"}}),t("el-table-column",{attrs:{prop:"reality",align:"center",label:"去年实际"}}),t("el-table-column",{attrs:{prop:"threshold",align:"center",label:"门槛值(盈亏平衡值)"}}),t("el-table-column",{attrs:{prop:"target",align:"center",label:"目标值(利润增长10%)"}}),t("el-table-column",{attrs:{prop:"challenge",align:"center",label:"挑战值(利润翻倍)"}})],1)],1):t("div",{staticStyle:{position:"relative"}},[0!=a.towNum?t("div",{staticStyle:{position:"absolute","z-index":"9999",right:"0"}},[t("el-button",{staticClass:"btn-con",staticStyle:{"margin-left":"auto"},on:{click:a.back}},[e._v("返回 ")])],1):e._e(),t("el-row",{attrs:{gutter:20}},[t("el-col",{directives:[{name:"permission",rawName:"v-permission",value:61101,expression:"61101"}],attrs:{span:12}},[t("div",{staticClass:"import-con"},[t("el-upload",{staticClass:"upload-demo",attrs:{action:a.uploadUrl,headers:a.setHeaders(),name:"myfile","file-list":a.fileList,"on-success":a.handleAvatarSuccess}},[t("img",{staticClass:"img",attrs:{src:"/png/icon-1-89c76ca0.png",alt:""}})]),t("div",{staticClass:"link-con"},[t("el-link",{attrs:{type:"primary"},on:{click:a.downloadTemplate}},[e._v("点击下载《经营报表导入模板》 ")])],1)],1)]),t("el-col",{directives:[{name:"permission",rawName:"v-permission",value:61102,expression:"61102"}],attrs:{span:12}},[t("div",{staticClass:"import-con",on:{click:a.goPage}},[t("img",{staticClass:"img",attrs:{src:"/png/icon-2-4cc433b6.png",alt:""}}),t("div",{staticClass:"link-con"},[t("el-link",{attrs:{type:"primary"}},[e._v("进入经营报表录入页面")])],1)])])],1)],1)])}),[],!1,null,"a25b7a0f",null,null).exports)}}}));