ProfitAnalysis-0900274a.js
4.11 KB
var T=Object.defineProperty;var b=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var C=(a,o,t)=>o in a?T(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t,y=(a,o)=>{for(var t in o||(o={}))V.call(o,t)&&C(a,t,o[t]);if(b)for(var t of b(o))R.call(o,t)&&C(a,t,o[t]);return a};var m=(a,o,t)=>new Promise((d,n)=>{var i=u=>{try{s(t.next(u))}catch(r){n(r)}},c=u=>{try{s(t.throw(u))}catch(r){n(r)}},s=u=>u.done?d(u.value):Promise.resolve(u.value).then(i,c);s((t=t.apply(a,o)).next())});import{d as k,k as l,o as L,w as P,e as x,J as I,a8 as p,_ as $,a9 as E,aa as D,a0 as A,E as S,f,a1 as U,ac as h,ad as W}from"./vue-5a35c3f5.js";import{B as j,b as q}from"./index-c1c2669a.js";import{D as z}from"./index-37bee0a2.js";import{u as H,a as J}from"./order-eff5d778.js";import{g as G}from"./config-9c004f0c.js";import{u as K}from"./order-007d1b19.js";import{u as Q,_ as X}from"./index.js";import{aI as Y,aT as Z}from"./antd-6b087f69.js";import"./useWindowSizeFn-cc2fb57c.js";import"./message-c4c6f446.js";const ee=k({components:{BasicModal:j,Description:z,Select:Y,Space:Z},setup(){const a=H(),{exchangeRate:o}=K(a),t=l([]),d=l(!0),n=l(10),i=l(),c=l("0"),s=l({}),u=l(),[r,{setModalProps:v,redoModalHeight:F}]=q(e=>m(this,null,function*(){t.value=I(e.data),u.value=e.searchData,s.value={}}));L(()=>m(this,null,function*(){var _,B;const e=yield G({settingCode:"exchangeRate",page:1,pageSize:10});i.value=(B=(_=e==null?void 0:e.items)==null?void 0:_[0])==null?void 0:B.settingValue}));const w=[{field:"customerTotalPrice",label:"客户总金额",render:e=>"$ "+(e||0).toFixed(2)},{field:"productionDepartmentTotalPrice",label:"供应商总价",render:e=>"¥ "+(e||0).toFixed(2)},{field:"packetTotalPrice",label:"包装费用",render:e=>"$"+(e||0).toFixed(2)},{field:"profitRate",label:"总利润率",render:e=>(Number(e||0)*100).toFixed(2)+"%"},{field:"orderTotalNum",label:"订单商品数量",render:e=>e||0},{field:"recordNum",label:"含有利润分析的订单数",render:e=>e||0}];P(()=>n.value,()=>{F()});const g=Q().getUserInfo;x(()=>{var e;return(e=g==null?void 0:g.roleSmallVO)==null?void 0:e.code});function M(e){e&&(d.value=!0,v({loading:!1,confirmLoading:!1}))}function N(){n.value=Math.round(Math.random()*20+10)}function O(){return m(this,null,function*(){const e=yield J({orderIds:t.value,profitType:c.value,exchangeRate:i.value,queryVO:u.value});s.value=y({},e||{})})}return{register:r,loading:d,handleShow:M,lines:n,setLines:N,info:s,schema:w,exchangeRate:o,handleCalc:O,activeRate:i,profitType:c}}});const ae={className:"mb-2"};function te(a,o,t,d,n,i){const c=p("Select"),s=p("a-button"),u=p("Space"),r=p("Description"),v=p("BasicModal");return $(),E(v,W(a.$attrs,{destroyOnClose:"",onRegister:a.register,title:"利润分析表",width:"600px",onVisibleChange:a.handleShow,footer:null}),{default:D(()=>[A("div",ae,[S(" 公式: "),f(c,{className:"w-[240px]",options:[{label:"公式1:1 -(LOCAL总金额 / 汇率 + 包装总金额)/ 客户总金额",value:"0"},{label:"公式2:1 -(LOCAL总金额 / 汇率 / (客户总金额-包装费用总金额)",value:"1"}],value:a.profitType,"onUpdate:value":o[0]||(o[0]=F=>a.profitType=F),placeholder:"请选择",defaultValue:"0"},null,8,["value"])]),f(u,null,{default:D(()=>[A("span",null," 汇率: "+U(a.activeRate),1),f(s,{type:"primary",onClick:a.handleCalc,className:"ml-4"},{default:D(()=>[S("计算")]),_:1},8,["onClick"])]),_:1}),h(' <Button @click="handleCalc">计算</Button> '),h(` :helpMessage="['提示1', '提示2']" `),h(` <template #insertFooter>
<a-button type="primary" danger @click="setLines" :disabled="loading">点我更新内容</a-button>
</template> `),h(` <template v-if="loading">
<div class="empty-tips">加载中,稍等3秒……</div>
</template> `),f(r,{class:"mt-4",layout:"vertical",collapseOptions:{canExpand:!0,helpMessage:"help me"},column:2,data:a.info,schema:a.schema},null,8,["data","schema"])]),_:1},16,["onRegister","onVisibleChange"])}const he=X(ee,[["render",te],["__scopeId","data-v-fbb97b17"],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/project/order/ProfitAnalysis.vue"]]);export{he as default};