1 |
- import{S as g,_ as Y,d as C,cp as x,cl as B,m as v,n as k,r as p,ag as w,o as l,c as d,h as t,u as n,cY as M,B as E,A,x as f,H as F,D as j,a as D,b as N}from"./index.56449854.js";import{a as T}from"./apis.88ca813e.js";import{f as V}from"./export.a2ce61c0.js";import"./createRequset.56e9fc42.js";import"./xlsx.ed122d16.js";const R=g(new Date).subtract(1,"month").format("YYYY-MM"),S={formItems:[{field:"year_month",type:"date_picker",defaultValue:R,placeholder:"\u660E\u7EC6\u6708\u4EFD",trigger:"change",otherOptions:{clearable:!1,editable:!1,type:"month",format:"YYYY-MM",valueFormat:"YYYY-MM"}}]},z=[{prop:"username",label:"\u59D3\u540D",minWidth:"155px"},{prop:"total_percentage",label:"\u63D0\u6210\u91D1\u989D",minWidth:"155px"}],P={"bg-white":"","p-2":""},W={key:0,flex:"","justify-end":"","mb-2":"","mr-2":""},I={flex:"","gap-5":""},q="projectDepartment",H=C({__name:"summary",setup(O){const{hasPermissionWithCode:_}=x(q),s=B(!1),c=v([]),m=v([]);async function b(){const r=c.value.map(({manager:e,total_percentage:a})=>({username:e,total_percentage:a})),u=m.value.map(({saler:e,total_percentage:a})=>({username:e,total_percentage:a})),o=[...r,...u];V({columns:z,name:"\u9879\u76EE\u90E8\u65B0\u653F\u7B56\u63D0\u6210\u4E1A\u7EE9\u6C47\u603B.xlsx",data:o})}async function i(r){s.value=!0;const{data:u,code:o}=await T.summary({...r,depart_type:"3"});if(s.value=!1,o!==1)return;const{manager:e=[],sale:a=[]}=u||{};c.value=e,m.value=a}const y=g(new Date).subtract(1,"month").format("YYYY-MM");return k(()=>i({year_month:y})),(r,u)=>{const o=p("ElButton"),e=p("ElTableColumn"),a=p("ElTable"),h=w("loading");return l(),d("div",null,[t(n(M),{"lock-key":["year_month"],"form-config":n(S),onResetBtnClick:i,onSearchBtnClick:i},null,8,["form-config"]),E((l(),d("div",P,[n(_)("9")?E((l(),d("div",W,[n(_)("9")?(l(),A(o,{key:0,icon:n(j)("arrow-up-line"),onClick:b,type:"primary",size:"small"},{default:f(()=>[F("\u5BFC\u51FA ")]),_:1},8,["icon"])):D("v-if",!0)])),[[h,s.value]]):D("v-if",!0),N("div",I,[t(a,{border:"",size:"small",data:m.value},{default:f(()=>[t(e,{prop:"saler",label:"\u9500\u552E\u4EBA\u5458"}),t(e,{prop:"total_percentage",label:"\u63D0\u6210\u91D1\u989D"})]),_:1},8,["data"]),t(a,{border:"",size:"small",data:c.value},{default:f(()=>[t(e,{prop:"manager",label:"\u4E1A\u52A1\u7ECF\u7406"}),t(e,{prop:"total_percentage",label:"\u63D0\u6210\u91D1\u989D"})]),_:1},8,["data"])])])),[[h,s.value]])])}}});var Q=Y(H,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/time/projectDepartment/components/summary.vue"]]);export{Q as default};
|