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