/* empty css             *//* empty css                   */import{_ as e}from"./index.vue_vue_type_script_setup_true_lang-e74be938.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                  *//* empty css                     */import{_ as a}from"./search.vue_vue_type_script_setup_true_lang-8edf6ccf.js";/* empty css                  */import{h as t}from"./moment-19b77ecd.js";/* empty css                 *//* empty css                     *//* empty css                  */import{u as l}from"./useGetList-d550ec92.js";import{e as s,s as o,a as n,b as r}from"./index-3e17a66a.js";import{e as p}from"./exportExcel-331c8441.js";import{d as m,u as i,p as u,m as c,x 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,y as k,z as Y,b as x,e as M,Z as C,a7 as D,ar as w,A as V,B as z,a6 as S,aC as H,W as $,aa as L,ah as R,ab as U,a2 as F}from"./index-41bf27b7.js";/* empty css                   */import"./index-2a89b0c2.js";import"./http-e55ef919.js";/* empty css                   */const T={class:"table-default"},W=M("br",null,null,-1),q=m({__name:"index",setup(m){const q=i(),A=u((()=>{var e;return q.getRoles,null==(e=q.getRoles)?void 0:e.some((e=>"cp"==(null==e?void 0:e.identify)))})),B=()=>{let e=c([]);o({is_export:1,...I.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"};Z.value.length>0?p(e.value,`cp结算${t().format("YYYY-MM-DD HH:mm:ss")}`,l,"cp结算"):D.warning("暂无数据")}))},E=e=>{if(I.value.time){const a=w(e);I.value.start_month=a[0],I.value.end_month=a[1]}else delete I.value.start_month,delete I.value.end_month},{data:G,query:I,search:N,reset:P,loading:Q}=l("cpManage/cp/subscribeStatisticData/monthList",!0);let X=c([]);const Z=u((()=>{var e;return null==(e=G.value)?void 0:e.data})),J=e=>{K(e?{cp_name:e}:{})},K=e=>{r(e).then((e=>{X.value=e.data}))};return d((()=>{K({}),N()})),(l,o)=>{const r=V,m=z,i=S,u=H,d=$,w=a,q=L,G=R,K=U,O=e,ee=_("action"),ae=F;return f(),b("div",null,[v(w,{search:j(N),reset:j(P)},{body:h((()=>[j(A)?Y("",!0):(f(),y(i,{key:0,label:"cp名称",prop:"cp"},{default:h((()=>[v(m,{modelValue:j(I).cp_name,"onUpdate:modelValue":o[0]||(o[0]=e=>j(I).cp_name=e),filterable:"",remote:"",clearable:"","remote-method":J,placeholder:"选择版权方"},{default:h((()=>[(f(!0),b(g,null,k(j(X),(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:E,format:"YYYY/MM","value-format":"YYYY-MM",modelValue:j(I).time,"onUpdate:modelValue":o[1]||(o[1]=e=>j(I).time=e),type:"monthrange","range-separator":"To","start-placeholder":"开始时间","end-placeholder":"结束时间"},null,8,["modelValue"])])),_:1})])),extra_button:h((()=>[v(d,{type:"primary",onClick:B,size:"default"},{default:h((()=>[x(" 导出 ")])),_:1})])),_:1},8,["search","reset"]),M("div",T,[C((f(),y(K,{data:j(Z),class:"mt-3"},{default:h((()=>[v(q,{prop:"month",label:"月份"}),v(q,{prop:"cp_id",label:"cpid"}),v(q,{prop:"cp_name",label:"cp名称"}),v(q,{prop:"cp_company",label:"所属公司"}),v(q,{prop:"book_num",label:"结算短剧量"}),v(q,{prop:"final_amount",label:"结算金额"}),C((f(),y(q,{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})),N(),void P();var t}},{default:h((()=>[x("点击结算")])),_:2},1032,["onClick"])):(f(),y(G,{key:1,type:"success",size:"default",effect:"dark"},{default:h((()=>[x("已结算")])),_:1}))])),_:1})),[[ee,"cpManage.CpSubscribeStatisticData.saveFinalState"]]),v(q,{prop:"final_time",label:"结算日期"}),v(q,{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"]),W])),_:1})])),_:1},8,["data"])),[[ae,j(Q)]]),v(O)])])}}});export{q as default};
