chatapp-h5/h5/js/HistorySalary-Dr8qJJsb-1776148658686.js
2026-04-14 17:58:21 +08:00

2 lines
11 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as A,k as G,P as q,w as C,j as y,c as g,b as e,n as S,t as a,q as i,v as h,r as p,S as K,I as Q,o as Y,U as J,l as z,m as X,F as R,x as N,y as I,K as Z,al as ee,G as te,Q as ae}from"./index-CIAVq8iD-1776148658686.js";import{_ as oe}from"./help-BgsLqEJs-1776148658686.js";import{d as se,b as le}from"./teamBill-BWXvrc1S-1776148658686.js";import{G as ie}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";/* empty css */import{G as ne}from"./GradientBorder-CfwSeIMB-1776148658686.js";const re={style:{padding:"16px 8px 25px"}},de={style:{height:"100%",display:"flex","align-items":"center","justify-content":"space-around"}},ce={class:"contentTime"},ue={style:{flex:"1","min-width":"0",display:"grid","grid-template-rows":"repeat(2, 1fr)",gap:"2vw"}},pe={class:"contentText"},ye={class:"contentText"},ge={style:{flex:"1","min-width":"0",display:"grid","grid-template-rows":"repeat(2, 1fr)",gap:"2vw"}},me={class:"contentText"},ve={key:0,class:"contentText"},fe={__name:"workReportBox",props:{type:{type:String,default:""},date:{type:String,default:""},target:{type:String,default:""},salary:{type:String,default:""},income:{type:String,default:""},days:{type:String,default:""},more:{type:Boolean,default:!1}},emits:["showMore"],setup(_,{emit:s}){const{t:l}=G(),c=_,b=s,P=()=>{b("showMore")},f=p(""),u=p(""),m=p(""),x=q();C(()=>x.selectedLang,r=>{console.log("Language changed in header:",r),w()},{deep:!0});const T=K(()=>{if(c.type=="In Progress"||c.type==l("in_progress"))return"background: linear-gradient(248deg, #759CFF 5.66%, #3D73FF 42.49%);";if(c.type=="Pending"||c.type==l("pending"))return"background: linear-gradient(248deg, #FF7578 5.66%, #FF3D40 42.49%), linear-gradient(248deg, #759CFF 5.66%, #3D73FF 42.49%);";if(c.type=="Completed"||c.type==l("completed"))return"background: linear-gradient(248deg, #75FF98 5.66%, #3DFF54 42.49%), linear-gradient(248deg, #759CFF 5.66%, #3D73FF 42.49%);";if(c.type=="Out of account"||c.type==l("out_of_account"))return"background: linear-gradient(248deg, #BDBDBD 5.66%, #AEAEAE 42.49%), linear-gradient(248deg, #759CFF 5.66%, #3D73FF 42.49%);"}),w=()=>{console.log("更新展示类型"),c.type=="In Progress"?m.value=l("in_progress"):c.type=="Pending"?m.value=l("pending"):c.type=="Completed"?m.value=l("completed"):c.type=="Out of account"&&(m.value=l("out_of_account"))};return C(()=>c.type,r=>{console.log("newType:",r),w(),r=="In Progress"||r==l("in_progress")?(f.value="#EBF1FD",u.value="0.9em",m.value=l("in_progress")):r=="Pending"||r==l("pending")?(f.value="#FEEBEF",u.value="1em",m.value=l("pending")):r=="Completed"||r==l("completed")?(f.value="#E8FAED",u.value="1em",m.value=l("completed")):r=="Out of account"||r==l("out_of_account")?(f.value="#E9E9E9",u.value="0.7em",m.value=l("out_of_account")):(f.value="#EBF1FD",u.value="0.9em",m.value="")},{immediate:!0}),(r,F)=>(y(),g("div",{style:S([{position:"relative",width:"100%","border-radius":"8px"},{background:f.value}])},[e("div",{class:"status-background",style:S(T.value)},[e("div",{style:S([{color:"#fff","font-weight":"600"},{fontSize:u.value}])},a(m.value),5)],4),e("div",re,[e("div",de,[e("div",ce,a(_.date),1),e("div",ue,[e("div",pe,a(i(l)("target"))+": "+a(_.target),1),e("div",ye,a(i(l)("time_days"))+": "+a(_.days),1)]),e("div",ge,[e("div",me,a(i(l)("salary"))+": $"+a(_.salary),1),_.income?(y(),g("div",ve,a(i(l)("total_income"))+" "+a(_.income),1)):h("",!0)])]),_.more?(y(),g("div",{key:0,class:"moreBt",onClick:P},a(i(l)("more")),1)):h("",!0)])],4))}},_e=A(fe,[["__scopeId","data-v-2b6451a5"]]),he={class:"history-salary"},xe={class:"content"},be={style:{padding:"16px"}},we={style:{display:"flex","justify-content":"space-between",gap:"10px"}},Fe={style:{"font-size":"1em","font-weight":"700"}},ke={style:{"font-size":"1.5em","font-weight":"500"}},De={style:{"margin-bottom":"20px"}},Se={style:{margin:"10px 1%","font-weight":"600"}},Pe={style:{display:"flex","flex-direction":"column",gap:"12px"}},Te={key:0,style:{position:"fixed",bottom:"0",width:"100%"}},Ie={style:{display:"flex","justify-content":"center","align-items":"center"}},Ce={style:{margin:"0","font-size":"18px","font-weight":"600",color:"#333"}},Be={style:{display:"flex","justify-content":"space-between","align-items":"center"}},$e={style:{color:"rgba(0, 0, 0, 0.5)","font-weight":"600","font-size":"1.3em"}},Ee={key:0,style:{"font-size":"16px","font-weight":"600",color:"#333"}},Me={key:1,style:{"box-shadow":"0 0 4px 0 rgba(0, 0, 0, 0.25)","border-radius":"8px",padding:"12px",margin:"0 4px"}},ze={style:{display:"grid","grid-template-columns":"repeat(2, 1fr)",gap:"10px"}},Re={class:"text-700"},Ne={class:"text-700"},Ae={class:"text-700"},Ge={class:"text-700"},Ve={key:2,style:{"font-size":"16px","font-weight":"600",color:"#333"}},je={style:{"overflow-y":"auto"},class:"salaryList"},Oe={key:0,style:{display:"flex","flex-direction":"column",gap:"8px",padding:"4px"}},He={class:"text-700",style:{color:"rgba(0, 0, 0, 0.4)","margin-bottom":"8px"}},Le={style:{display:"flex","justify-content":"space-between","align-items":"center"}},Ue={class:"text-700"},We={style:{"font-size":"14px"}},qe={class:"text-700"},Ke={key:1,class:"modal-item"},Qe={style:{display:"flex","justify-content":"center","align-items":"center",padding:"16px",position:"relative"}},Ye={style:{margin:"0","font-size":"1.5em","font-weight":"700",color:"#333"}},Je={class:"help-modal-body"},Xe={__name:"HistorySalary",setup(_){const{t:s,locale:l}=G();l.value&&Q(l.value);const c=p("0.00"),b=p(!1),P=p(!1),f=p(!1),u=p(null),m=p([]),x=p(null),T=p(!1),w=p([]),r=p([]),F=p(""),k=p(""),D=p(""),V=t=>{console.log("更新展示类型"),t=="In Progress"?D.value=s("in_progress"):t=="Pending"?D.value=s("pending"):t=="Completed"?D.value=s("completed"):t=="Out of account"&&(D.value=s("out_of_account"))};C(()=>u.value?.status,t=>{console.log("newStatus:",t),V(t),t=="In Progress"&&(k.value="0 0 1px 0 #6085FF",F.value="rgba(61, 115, 255, 1)"),t=="Pending"&&(k.value="0 0 1px 0 #FF6062",F.value="rgba(255, 61, 64, 1)"),t=="Completed"&&(k.value="0 0 1px 0 #60FF65",F.value="rgba(61, 255, 84, 1)"),t=="Out Of Account"&&(k.value="0 0 1px 0 #6A6161",F.value="rgba(174, 174, 174, 1)")});const j=async()=>{try{T.value=!0;const t=Z();if(!t){console.warn("No team ID available");return}const o=await se(t);o&&o.status&&o.body&&(x.value=o.body,console.debug("Policy data loaded:",x.value))}catch(t){console.error("Failed to fetch policy data:",t)}finally{T.value=!1}},O=t=>{if(!x.value?.policy||!t)return 1;const o=parseFloat(t);if(isNaN(o))return 1;const n=[...x.value.policy].sort((v,d)=>parseFloat(d.target)-parseFloat(v.target));for(const v of n)if(o>=parseFloat(v.target))return v.level;return Math.min(...x.value.policy.map(v=>v.level))},H=async t=>{try{P.value=!0;const o=await le(t);if(o.status&&o.body){const n=o.body.targets||[];m.value=n;const v=await ee();w.value=n.map(d=>({id:d.id,date:d.billTitle,status:L(d.status),income:d.target?.acceptGiftValue,target:O(d.target?.acceptGiftValue),salary:B(v.body?.agent?(d.target?.settlementResult?.ownSalary||0)+(d.target?.settlementResult?.memberSalary||0):v.body?.anchor?d.target?.settlementResult?.memberSalary:null)||"-",totalSalary:B(d.target?.settlementResult?.totalSalary)||"-",timeDays:d.target?.effectiveDay||"-",hasDetails:d.target&&d.target.dailyTargets&&d.target.dailyTargets.length>0,originalData:d})),c.value=o.body.historySalary.toFixed(2)}}catch(o){console.error("Failed to fetch work reports:",o),w.value=[{id:1,date:"2025.07",status:"In Progress",target:"-",salary:"-",timeDays:"-",diamond:"-"}]}finally{P.value=!1}},B=t=>!t||t==="0"||t===0?"0.00":parseFloat(t).toFixed(2),L=t=>({SETTLED:s("completed"),UNPAID:s("in_progress"),HANG_UP:s("out_of_account"),PAY_OUT:s("completed")})[t]||t,U=t=>{if(u.value=t,t.originalData&&t.originalData.target){const o=t.originalData.target;r.value=o.dailyTargets||[]}f.value=!0},$=t=>Math.min(parseInt(t),120)||0,W=t=>{if(!t)return"";const o=t.toString();if(o.length!==8)return o;const n=o.substring(0,4),v=o.substring(4,6),d=o.substring(6,8);return`${n}.${v}.${d}`},E=()=>{b.value=!0},M=()=>{b.value=!1,f.value=!1,u.value=null,r.value=[]};return Y(async()=>{await j(),await H(J())}),(t,o)=>(y(),g("div",he,[z(ie,{title:i(s)("my_salary_title"),color:"black",onHelp:E},null,8,["title"]),e("div",xe,[z(ne,{radius:"20px",style:{margin:"0 1%","margin-bottom":"12px"}},{default:X(()=>[e("div",be,[e("div",we,[e("div",Fe,a(i(s)("history_salary")),1),e("img",{src:oe,alt:"",style:{display:"block",width:"1.2em","aspect-ratio":"1/1","object-fit":"contain"},onClick:I(E,["stop"])})]),e("div",ke,"$"+a(c.value),1)])]),_:1}),e("div",De,[e("div",Se,a(i(s)("work_report")),1),e("div",Pe,[(y(!0),g(R,null,N(w.value,n=>(y(),te(_e,{key:n.id,type:n.status,date:n.date,target:n.target,salary:n.salary,income:n.income,days:n.timeDays,more:"true",onShowMore:v=>U(n)},null,8,["type","date","target","salary","income","days","onShowMore"]))),128))])])]),f.value||b.value?(y(),g("div",{key:0,class:"modal-overlay",onClick:M},[f.value?(y(),g("div",Te,[e("div",{style:{background:"white","border-radius":"16px 16px 0 0","max-height":"80vh",overflow:"hidden",display:"flex","flex-direction":"column",gap:"10px",padding:"20px"},onClick:o[0]||(o[0]=I(()=>{},["stop"]))},[e("div",Ie,[e("div",Ce,a(i(s)("salary_details")),1)]),e("div",Be,[e("div",$e,a(u.value?.date),1),e("div",{style:S([{margin:"4px",padding:"0 8px","border-radius":"4px",display:"flex","align-items":"center"},{boxShadow:k.value}])},[e("div",{style:S([{"font-weight":"500"},{color:F.value}])},a(D.value),5)],4)]),r.value.length>0?(y(),g("div",Ee,a(i(s)("monthly_salary"))+": ",1)):h("",!0),u.value?(y(),g("div",Me,[e("div",null,[e("div",ze,[e("div",Re,a(i(s)("target"))+": "+a(u.value.target),1),e("div",Ne,a(i(s)("salary"))+": $"+a(u.value.salary),1),e("div",Ae,a(i(s)("time_days"))+": "+a(u.value.timeDays),1),e("div",Ge,a(i(s)("total_income"))+" "+a(u.value.income),1)])])])):h("",!0),r.value.length>0?(y(),g("div",Ve,a(i(s)("daily_salary"))+": ",1)):h("",!0),e("div",je,[r.value.length>0?(y(),g("div",Oe,[(y(!0),g(R,null,N(r.value,n=>(y(),g("div",{key:n.dateNumber,style:{"box-shadow":"0 0 4px 0 rgba(0, 0, 0, 0.25)","border-radius":"8px",padding:"10px"}},[e("div",He,a(W(n.dateNumber)),1),e("div",Le,[e("div",Ue,a(i(s)("income"))+": "+a(n.acceptGiftValue),1),e("div",We,[e("span",qe,a(i(s)("time"))+":",1),e("span",{class:ae(["text-700",{"time-value":$(n.onlineTime)==120}]),style:{"font-weight":"600"}},a($(n.onlineTime))+"/120 ",3)])])]))),128))])):h("",!0)])])])):h("",!0),b.value?(y(),g("div",Ke,[e("div",{style:{"background-color":"white","border-radius":"12px",width:"90%","max-width":"400px","max-height":"80vh",overflow:"hidden",display:"flex","flex-direction":"column"},onClick:o[1]||(o[1]=I(()=>{},["stop"]))},[e("div",Qe,[e("div",Ye,a(i(s)("help")),1),e("div",{onClick:M,style:{"font-size":"2em"},class:"closeBt"},"×")]),e("div",Je,[e("p",null,a(i(s)("work_report_description")),1),e("p",null,a(i(s)("status_description")),1),e("p",null,a(i(s)("status_completed")),1),e("p",null,a(i(s)("status_pending")),1),e("p",null,a(i(s)("status_out_of_account")),1),e("p",null,a(i(s)("status_in_progress")),1)])])])):h("",!0)])):h("",!0)]))}},lt=A(Xe,[["__scopeId","data-v-697d7e78"]]);export{lt as default};