data-70f9ec31.js 5.3 KB
var u=(r,e,t)=>new Promise((o,d)=>{var i=n=>{try{c(t.next(n))}catch(a){d(a)}},s=n=>{try{c(t.throw(n))}catch(a){d(a)}},c=n=>n.done?o(n.value):Promise.resolve(n.value).then(i,s);c((t=t.apply(r,e)).next())});import{k as l,f as R}from"./vue-5a35c3f5.js";import{u as w,al as F}from"./index.js";import{u as S,q as b}from"./order-eff5d778.js";import{u as g}from"./order-007d1b19.js";import{bb as I}from"./antd-6b087f69.js";import"./message-c4c6f446.js";const C=w();l([]);const p=l([]),D=S(),{customerCode:A,productionDepartment:y}=g(D),T=[{field:"customerCode",label:"客户编码",component:"Select",colProps:{span:8},componentProps:{options:A,showSearch:!0,mode:"multiple"}},{field:"projectNo",label:"项目号",component:"Select",colProps:{span:8},componentProps:{options:p,showSearch:!0,mode:"multiple",onSearch:r=>u(void 0,null,function*(){p.value=yield b("projectNo",r)})}},{field:"productionDepartment",label:"生产科",component:"Select",colProps:{span:8},componentProps:{mode:"multiple",options:y,showSearch:!0}}],z=[{title:"客户编码",dataIndex:"customerCode",width:150},{title:"项目号",dataIndex:"projectNoPrefix",width:100},{title:"生产科",dataIndex:"productionDepartment",width:100},{title:"数量",dataIndex:"orderCount",width:100},{title:"生产科单价¥",dataIndex:"productionDepartmentPrice",width:120,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.productionDepartmentPrice)==null?void 0:t.toFixed(2)}},{title:"生产科总价¥",dataIndex:"productionDepartmentTotalPrice",width:120,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.productionDepartmentTotalPrice)==null?void 0:t.toFixed(2)}},{title:"生产科预算金额¥",dataIndex:"productionDepartmentPredictPrice",width:160,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.productionDepartmentPredictPrice)==null?void 0:t.toFixed(2)}},{title:"实际发生费用¥",dataIndex:"productionActualPrice",width:120,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.productionActualPrice)==null?void 0:t.toFixed(2)}},{title:"预算占比",dataIndex:"predictRatio",width:120,customRender:r=>{var e,t,o,d,i;return(e=r.record)!=null&&e.predictRatio?((o=(t=r.record)==null?void 0:t.predictRatio)==null?void 0:o.toFixed(2))+"%":(i=(d=r.record)==null?void 0:d.predictRatio)==null?void 0:i.toFixed(2)}},{title:"预算占比与实际占比差",dataIndex:"predictAndActualRatio",width:190,customRender:r=>{var e,t,o,d,i;return(e=r.record)!=null&&e.predictAndActualRatio?((o=(t=r.record)==null?void 0:t.predictAndActualRatio)==null?void 0:o.toFixed(2))+"%":(i=(d=r.record)==null?void 0:d.predictAndActualRatio)==null?void 0:i.toFixed(2)}},{title:"事前毛利润¥",dataIndex:"beforeGrossProfit",width:120,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.beforeGrossProfit)==null?void 0:t.toFixed(2)}},{title:"事前毛利率",dataIndex:"beforeGrossProfitRate",width:120,customRender:r=>{var e,t,o,d,i;return(e=r.record)!=null&&e.beforeGrossProfitRate?((o=(t=r.record)==null?void 0:t.beforeGrossProfitRate)==null?void 0:o.toFixed(2))+"%":(i=(d=r.record)==null?void 0:d.beforeGrossProfitRate)==null?void 0:i.toFixed(2)}},{title:"事后毛利润¥",dataIndex:"grossProfit",width:120,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.grossProfit)==null?void 0:t.toFixed(2)}},{title:"事后毛利率",dataIndex:"grossProfitRate",width:120,customRender:r=>{var e,t,o,d,i;return(e=r.record)!=null&&e.grossProfitRate?((o=(t=r.record)==null?void 0:t.grossProfitRate)==null?void 0:o.toFixed(2))+"%":(i=(d=r.record)==null?void 0:d.grossProfitRate)==null?void 0:i.toFixed(2)}},{title:"内部生产固定成本¥",dataIndex:"innerProductionFixedCost",width:180,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.innerProductionFixedCost)==null?void 0:t.toFixed(2)}},{title:"内部生产提成¥",dataIndex:"innerProductionCommission",width:150,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.innerProductionCommission)==null?void 0:t.toFixed(2)}},{title:"内部生产净利润¥",dataIndex:"innerProductionProfit",width:150,customRender:r=>{var e,t;return(t=(e=r.record)==null?void 0:e.innerProductionProfit)==null?void 0:t.toFixed(2)}},{title:"内部生产净利润率",dataIndex:"innerProductionProfitRate",width:150,customRender:r=>{var e,t,o,d,i;return(e=r.record)!=null&&e.innerProductionProfitRate?((o=(t=r.record)==null?void 0:t.innerProductionProfitRate)==null?void 0:o.toFixed(2))+"%":(i=(d=r.record)==null?void 0:d.innerProductionProfitRate)==null?void 0:i.toFixed(2)}},{title:"文件",dataIndex:"fileUrl",width:120,customRender:r=>{const e=()=>{const t=C.getToken;F.post("/basic-api/project/innerProfit/export",{},{params:{projectNoPrefix:r.record.projectNoPrefix},headers:{Authorization:`${t}`},responseType:"blob"}).then(o=>{const d=new Blob([o.data],{type:"application/zip"}),s=(()=>{const n=new Date,a=n.getFullYear(),m=String(n.getMonth()+1).padStart(2,"0"),x=String(n.getDate()).padStart(2,"0"),P=String(n.getHours()).padStart(2,"0"),f=String(n.getMinutes()).padStart(2,"0"),h=String(n.getSeconds()).padStart(2,"0");return`${a}-${m}-${x} ${P}:${f}:${h}`})(),c=document.createElement("a");c.href=window.URL.createObjectURL(d),c.download=`${s}.xlsx`,document.body.appendChild(c),c.click(),document.body.removeChild(c)}).catch(o=>{console.error(o)})};return R(I,{style:"font-size:25px",onClick:()=>e()},null)}}];export{z as COLUMNS,T as searchFormSchema};