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