/* empty css             *//* empty css                   */import{_ as e}from"./index.vue_vue_type_script_setup_true_lang-e601cfd0.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                     */import{_ as a}from"./search.vue_vue_type_script_setup_true_lang-8a36466d.js";/* empty css                  */import{h as t}from"./moment-19b77ecd.js";/* empty css                 *//* empty css                     *//* empty css                  */import{u as l}from"./useGetList-33a80877.js";import{e as s,s as o,a as n,b as r}from"./index-5037de6e.js";import{e as p}from"./exportExcel-331c8441.js";import{d as m,u as i,n as u,q as c,z as d,ao as _,o as f,c as b,a as v,w as h,f as j,l as y,F as g,p as k,A as Y,b as x,e as C,Z as M,a7 as D,aq as V,B as w,D as z,a6 as q,av as H,X as S,aa as $,ah as A,ab as F,a2 as I}from"./index-545c1a76.js";/* empty css                   */import"./index-b347df0b.js";import"./http-795fd5dc.js";/* empty css                   */const L={class:"table-default"},R=C("br",null,null,-1),U=m({__name:"index",setup(m){const U=i(),B=u((()=>{var e;return U.getRoles,null==(e=U.getRoles)?void 0:e.some((e=>"cp"==(null==e?void 0:e.identify)))})),E=()=>{let e=c([]);o({is_export:1,...O.value}).then((a=>{e.value=a.data,e.value;const l={"月份":"month",cpid:"cp_id","cp名称":"cp_name","所属公司":"cp_company","结算书本量":"book_num","结算金额":"final_amount","结算情况":"final_state_str","结算日期":"final_time"};J.value.length>0?p(e.value,`cp结算${t().format("YYYY-MM-DD HH:mm:ss")}`,l,"cp结算"):D.warning("暂无数据")}))},G=e=>{if(O.value.time){const a=V(e);O.value.start_month=a[0],O.value.end_month=a[1]}else delete O.value.start_month,delete O.value.end_month},{data:N,query:O,search:P,reset:T,loading:X}=l("cpManage/cp/subscribeStatisticData/monthList",!0);let Z=c([]);const J=u((()=>{var e;return null==(e=N.value)?void 0:e.data})),K=e=>{Q(e?{cp_name:e}:{})},Q=e=>{r(e).then((e=>{Z.value=e.data}))};return d((()=>{Q({}),P()})),(l,o)=>{const r=w,m=z,i=q,u=H,d=S,V=a,U=$,N=A,Q=F,W=e,ee=_("action"),ae=I;return f(),b("div",null,[v(V,{search:j(P),reset:j(T)},{body:h((()=>[j(B)?Y("",!0):(f(),y(i,{key:0,label:"cp名称",prop:"cp"},{default:h((()=>[v(m,{modelValue:j(O).cp_name,"onUpdate:modelValue":o[0]||(o[0]=e=>j(O).cp_name=e),filterable:"",remote:"",clearable:"","remote-method":K,placeholder:"选择版权方"},{default:h((()=>[(f(!0),b(g,null,k(j(Z),(e=>(f(),y(r,{key:e.cp_id,label:e.cp_name,value:e.cp_name},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})),v(i,{label:"日期",prop:"cp_company"},{default:h((()=>[v(u,{"unlink-panels":"",clearable:"",onChange:G,format:"YYYY/MM","value-format":"YYYY-MM",modelValue:j(O).time,"onUpdate:modelValue":o[1]||(o[1]=e=>j(O).time=e),type:"monthrange","range-separator":"To","start-placeholder":"开始时间","end-placeholder":"结束时间"},null,8,["modelValue"])])),_:1})])),extra_button:h((()=>[v(d,{type:"primary",onClick:E,size:"default"},{default:h((()=>[x(" 导出 ")])),_:1})])),_:1},8,["search","reset"]),C("div",L,[M((f(),y(Q,{data:j(J),class:"mt-3"},{default:h((()=>[v(U,{prop:"month",label:"月份"}),v(U,{prop:"cp_id",label:"cpid"}),v(U,{prop:"cp_name",label:"cp名称"}),v(U,{prop:"cp_company",label:"所属公司"}),v(U,{prop:"book_num",label:"结算短剧量"}),v(U,{prop:"final_amount",label:"结算金额"}),M((f(),y(U,{label:"结算情况"},{default:h((e=>["notCheck"==e.row.final_state?(f(),y(d,{key:0,type:"primary",size:"default",onClick:a=>{return t=e.row,n({id:t.id,final_state:"done"}).then((e=>{const a=e.data,t=a.code,l=a.message;if(1e4===t)return D.success(l||"设置成功"),a})),P(),void T();var t}},{default:h((()=>[x("点击结算")])),_:2},1032,["onClick"])):(f(),y(N,{key:1,type:"success",size:"default",effect:"dark"},{default:h((()=>[x("已结算")])),_:1}))])),_:1})),[[ee,"cpManage.CpSubscribeStatisticData.saveFinalState"]]),v(U,{prop:"final_time",label:"结算日期"}),v(U,{label:"操作"},{default:h((e=>[v(d,{link:"",type:"primary",size:"small",onClick:a=>(e=>{const a={cp_name:e.cp_name,month:e.month};s(a).then((a=>{const l=c(),s={"书籍ID":"bid","书籍名称":"book_name","应结算金额":"final_amount","CP名称":"cp_name","月份":"month"};l.value=a.data,l.value.length>0?p(l.value,`(${e.cp_name})cp结算(月份)${t().format("YYYY-MM-DD HH:mm:ss")}`,s,"cp结算(月份)"):D.warning("暂无数据")}))})(e.row)},{default:h((()=>[x("导出")])),_:2},1032,["onClick"]),R])),_:1})])),_:1},8,["data"])),[[ae,j(X)]]),v(W)])])}}});export{U as default};
