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