import{P as A}from"./page.3b4d44cb.js";import{b7 as D,b as C,ar as S,N as $,E as F,_ as P,c as r,e as E,k as I,i as t,g as p,h as e,m as c,t as d}from"./index.0308b213.js";import{A as L,B as V}from"./storeActivity.634c4426.js";const j={components:{Page:A},setup(){const o=D(),n=C({loading:!1,delLoading:!1,tableData:[],selectIds:[]}),m=a=>{o.push({path:"/store/marketing/addDiscountByNum",query:{id:a}})},b=a=>{n.selectIds=a.map(s=>s.id)},y=C({page:1,limit:10}),g=()=>{n.loading=!0,L(y).then(a=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",a),n.tableData=a.list}).finally(()=>{n.loading=!1})};g();const i=a=>{$.alert("\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F","\u63D0\u793A",{showCancelButton:!0}).then(s=>{!(a!=null&&a.length)&&(n.delLoading=!0),V({ids:a||n.selectIds}).then(w=>{F.success("\u5220\u9664\u6210\u529F"),g()}).finally(()=>{!(a!=null&&a.length)&&(n.delLoading=!1)})}).catch(s=>{})};return{...S(n),toAddSagawa:m,del:i,tableSelects:b}}};const M={class:"container"},R=c("\u521B\u5EFAN\u4E2A\u6253N\u6298\u6D3B\u52A8"),q=c("\u7F16\u8F91"),T=c("\u5220\u9664"),x=c("\u5220\u9664");function z(o,n,m,b,y,g){const i=r("el-button"),a=r("el-col"),s=r("el-row"),w=r("el-alert"),u=r("el-table-column"),f=r("el-tag"),N=r("el-table"),v=r("Page");return E(),I(v,{showBorder:!1,loading:o.loading},{main:t(()=>[p("div",M,[e(s,null,{default:t(()=>[e(a,null,{default:t(()=>[e(i,{type:"primary",onClick:n[0]||(n[0]=l=>o.toAddSagawa())},{default:t(()=>[R]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(a,null,{default:t(()=>[e(w,{title:"\u6BCF\u4E2A\u95E8\u5E97\u6700\u591A\u652F\u6301\u4E0A\u67B6\u4E00\u4E2A\u6D3B\u52A8\u3002",type:"warning",closable:!1,"show-icon":""})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(a,null,{default:t(()=>[e(N,{border:"",data:o.tableData,style:{width:"100%"},onSelectionChange:o.tableSelects},{default:t(()=>[e(u,{align:"center",type:"selection"}),e(u,{align:"center",prop:"title",label:"\u6D3B\u52A8\u4E3B\u9898"}),e(u,{align:"center",label:"\u6BCF\u4EBA\u9650\u8D2D"},{default:t(l=>[e(s,{justify:"center"},{default:t(()=>[e(f,{effect:"dark",type:"success"},{default:t(()=>[c("\u6BCF\u4EBA\u6BCF\u5929\u9650\u8D2D"+d(l.row.order_limit)+"\u5355",1)]),_:2},1024)]),_:2},1024),e(s,{justify:"center"},{default:t(()=>[e(f,{effect:"dark",type:"danger"},{default:t(()=>[c("\u6BCF\u5355\u9650\u8D2D"+d(l.row.goods_limit)+"\u79CD\u5546\u54C1",1)]),_:2},1024)]),_:2},1024)]),_:1}),e(u,{align:"center",prop:"date",label:"\u6D3B\u52A8\u65E5\u671F"},{default:t(l=>[p("span",null,d(l.row.starttime)+" ~ "+d(l.row.endtime),1)]),_:1}),e(u,{align:"center",label:"\u62A2\u8D2D\u65F6\u6BB5"},{default:t(l=>[p("span",null,d(l.row.starthour)+"-"+d(l.row.endhour),1)]),_:1}),e(u,{align:"center",label:"\u72B6\u6001"},{default:t(l=>{var _,h;return[e(f,{effect:"dark",type:(h=(_=l.row)==null?void 0:_.bargain_status)==null?void 0:h.css},{default:t(()=>{var B,k;return[c(d((k=(B=l.row)==null?void 0:B.bargain_status)==null?void 0:k.text),1)]}),_:2},1032,["type"])]}),_:1}),e(u,{align:"center",label:"\u64CD\u4F5C"},{default:t(l=>[e(i,{onClick:_=>o.toAddSagawa(l.row.id)},{default:t(()=>[q]),_:2},1032,["onClick"]),e(i,{onClick:_=>o.del(l.row.id)},{default:t(()=>[T]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data","onSelectionChange"])]),_:1})]),_:1}),e(i,{type:"danger",loading:o.delLoading,onClick:n[1]||(n[1]=l=>o.del())},{default:t(()=>[x]),_:1},8,["loading"])])]),_:1},8,["loading"])}const K=P(j,[["render",z],["__scopeId","data-v-01425485"]]);export{K as default};
