import"./base-a9e1396c.js";import{E as x}from"./el-dialog-6b258e94.js";import"./el-overlay-27e164ea.js";import{E as D}from"./el-card-8d51e25c.js";import{a as U}from"./el-select-448a2068.js";import"./el-input-03ddc19a.js";import{E as N,a as T}from"./el-table-column-434c4a4c.js";import{E as L}from"./el-button-4f2e1711.js";import{E as P}from"./el-page-header-98396acf.js";import{a as q,E as I}from"./el-breadcrumb-item-594a11b8.js";import{u as R,b as $}from"./vue-router-9e943271.js";import{c as j,e as F,f as H}from"./bonus-d369ffa9.js";import{m,q as J,s as M,Q,v as A,x as p,y as e,w as o,J as G,o as b,z as i,a as K,I as O}from"./normalize-8daa80b1.js";import"./use-dialog-2f603928.js";import"./config-provider-ecb8405d.js";import"./index-6156c07c.js";import"./vnode-cca0b0eb.js";import"./aria-fbed35f0.js";import"./strings-4a84079a.js";import"./validator-9be52df0.js";import"./request-ba216ded.js";import"./axios-4a70c6fc.js";const W={class:"main"},X=p("span",{class:"text-large font-600 mr-3"}," 優惠劵使用列表 ",-1),Y=p("hr",null,null,-1),Z={class:"pagination-block"},ke={__name:"UseList",setup(ee){const f=R(),E=$();m(!1),m(!1);const w=E.query.type_id,a=J({page:1,pageSize:10,total:0,tableData:[]}),u=async(n,t)=>{const r=await j({id:w,page:n,pageSize:t});a.tableData=r.data.data,a.total=r.data.total};M(()=>{u(a.page,a.pageSize)}),Q(()=>[a.page,a.pageSize],([n,t])=>{u(n,t)});const z=()=>{f.back()},v=async n=>{(await F(n.bonus_id)).code===200&&u(a.page,a.pageSize)},d=m(!1),_=m([]),h=async n=>{d.value=!0;const t=await H({bonus_id:n.bonus_id});_.value=t.data};return(n,t)=>{const r=q,k=I,y=P,s=N,c=L,g=T,B=U,S=D,C=x;return b(),A(G,null,[p("div",W,[e(y,{onBack:z},{breadcrumb:o(()=>[e(k,{separator:"/"},{default:o(()=>[e(r,null,{default:o(()=>[i(" 電商管理中心 ")]),_:1}),e(r,null,{default:o(()=>[i("優惠劵")]),_:1}),e(r,null,{default:o(()=>[i("優惠劵使用列表")]),_:1})]),_:1})]),content:o(()=>[X]),_:1}),Y,e(S,null,{default:o(()=>[p("div",null,[e(g,{data:a.tableData,style:{width:"100%"}},{default:o(()=>[e(s,{prop:"bonus_id",label:"編號"}),e(s,{prop:"bonus_sn",label:"優惠劵序號"}),e(s,{prop:"bonus_number",label:"優惠劵數量",align:"right"}),e(s,{prop:"remain_number",label:"剩餘數量",align:"right"}),e(s,{label:"操作",align:"center",width:"180"},{default:o(l=>[l.row.remain_number<l.row.bonus_number?(b(),K(c,{key:0,type:"danger",size:"small",plain:"",onClick:V=>h(l.row)},{default:o(()=>[i("查看")]),_:2},1032,["onClick"])):O("",!0),e(c,{type:"danger",size:"small",plain:"",onClick:V=>v(l.row)},{default:o(()=>[i("刪除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),p("div",Z,[e(B,{"current-page":a.page,"onUpdate:currentPage":t[0]||(t[0]=l=>a.page=l),"page-size":a.pageSize,"onUpdate:pageSize":t[1]||(t[1]=l=>a.pageSize=l),"page-sizes":[10,20,50,100],small:"small",layout:"->,total, sizes, prev, pager, next, jumper",total:a.total},null,8,["current-page","page-size","total"])])])]),_:1})]),e(C,{modelValue:d.value,"onUpdate:modelValue":t[2]||(t[2]=l=>d.value=l),title:"使用紀錄"},{default:o(()=>[e(g,{data:_.value},{default:o(()=>[e(s,{prop:"sso_user_id",label:"使用客戶",width:"150"}),e(s,{prop:"order_sn",label:"訂單編號",width:"200"}),e(s,{prop:"used_time",label:"使用時間"})]),_:1},8,["data"])]),_:1},8,["modelValue"])],64)}}};export{ke as default};
