import{_ as M,g as O,a as S,d as j,b as G}from"./EditStoreDiscountDialog.vue_vue_type_script_setup_true_lang.2c922e0c.js";import{s as R,m as H}from"./category.da132df4.js";import{A as J}from"./index.1d26a072.js";import{_ as K}from"./index.vue_vue_type_script_setup_true_lang.8a761348.js";import{d as Q,a6 as W,r as d,b as E,p as X,c,at as Y,e as m,f as D,u as e,h as t,i as o,A as F,g as i,w as Z,k as C,q as ee,F as te,m as g,y as k,N as ae,E as V,_ as le}from"./index.0308b213.js";import"./useInstance.233fbdde.js";import"./index.78db0dd0.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const se={key:0,class:"filter-form"},oe=g("\u67E5\u8BE2"),ne={class:"data"},ie={class:"operation-container"},ue={class:"operation-btn"},de=g("\u6DFB\u52A0"),ce={class:"table"},re=g("\u4E2A\u4EBA"),pe=g("\u4F01\u4E1A"),_e={class:"table-operation-btn"},me={class:"top"},ge=g("\u7F16\u8F91"),fe=g("\u5220\u9664"),ve={class:"bottom"},he={class:"pagination"},be=Q({setup(ye){const{OpPlatform:f}=W();let v=d(!1);const s=E({page:1,limit:10,type:"",status:"",agentid:"",sid:"",category_id:""});E({store:[]});const r=E({list:[],count:0});d([]);const p=()=>{v.value=!0,f.value=="shangpu"?O(s).then(a=>{r.list=a.list,r.count=a.count,v.value=!1}):S(s).then(a=>{r.list=a.list,r.count=a.count,v.value=!1})};p(),d(!1),d(!1),X(()=>[s.page,s.limit],()=>{p()});const w=()=>{p()};let _=d(!1),h=d(!1),b=d(0);const L=()=>{b.value=0,h.value=!0,k(()=>{_.value=!0})},z=a=>{b.value=a,h.value=!0,k(()=>{_.value=!0})},N=()=>{b.value=0,k(()=>{h.value=!1}),p()},P=a=>{ae.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{f.value=="shangpu"?j({id:a}).then(()=>{V({message:"\u5220\u9664\u6210\u529F",type:"success"}),p()}):G({id:a}).then(()=>{V({message:"\u5220\u9664\u6210\u529F",type:"success"}),p()})}).catch(()=>{})},x=E({list:[]});return(()=>{f.value=="shangpu"?R().then(a=>{x.list=a}):H().then(a=>{x.list=a})})(),(a,n)=>{const A=c("el-form-item"),y=c("el-button"),U=c("el-form"),u=c("el-table-column"),B=c("el-tag"),T=c("el-table"),$=c("el-pagination"),q=Y("loading");return m(),D(te,null,[e(f)==="shangpu"?(m(),D("div",se,[t(U,{model:e(s),"label-width":"90px",style:{display:"flex","flex-direction":"row"}},{default:o(()=>[t(A,{class:"tn-el-form-item",label:"\u4EE3\u7406",prop:"type"},{default:o(()=>[t(e(J),{modelValue:e(s).agentid,"onUpdate:modelValue":n[0]||(n[0]=l=>e(s).agentid=l),placeholder:"\u8BF7\u9009\u62E9",clearable:""},null,8,["modelValue"])]),_:1}),t(A,{label:"\u5E97\u94FA",prop:"sid"},{default:o(()=>[t(K,{modelValue:e(s).sid,"onUpdate:modelValue":n[1]||(n[1]=l=>e(s).sid=l),agentid:e(s).agentid},null,8,["modelValue","agentid"])]),_:1}),t(A,null,{default:o(()=>[t(y,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:w},{default:o(()=>[oe]),_:1})]),_:1})]),_:1},8,["model"])])):F("",!0),i("div",ne,[i("div",ie,[i("div",ue,[t(y,{class:"btn",type:"primary",onClick:L},{default:o(()=>[de]),_:1})])]),i("div",ce,[Z((m(),C(T,{data:e(r).list},{default:o(()=>[t(u,{label:"\u4EE3\u7406",prop:"agent_title"}),t(u,{label:"\u5E97\u94FA",prop:"store_title"}),t(u,{label:"\u5361\u79CD",prop:"card_title"}),t(u,{label:"\u7C7B\u578B",prop:"type"},{default:o(({row:l})=>[l.type=="person"?(m(),C(B,{key:0,type:"success"},{default:o(()=>[re]),_:1})):(m(),C(B,{key:1,type:"info"},{default:o(()=>[pe]),_:1}))]),_:1}),t(u,{label:"\u5916\u5356\u6298\u6263",prop:"takeout_discount"}),t(u,{label:"\u5802\u98DF\u6298\u6263",prop:"in_store_discount"}),t(u,{fixed:"right",label:"\u64CD\u4F5C",width:"290px"},{default:o(({row:l})=>[i("div",_e,[i("div",me,[t(y,{size:"small",type:"primary",onClick:I=>z(l.id)},{default:o(()=>[ge]),_:2},1032,["onClick"]),t(y,{size:"small",type:"danger",onClick:I=>P(l.id)},{default:o(()=>[fe]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])),[[q,e(v)]])])]),i("div",ve,[i("div",he,[t($,{currentPage:e(s).page,"onUpdate:currentPage":n[2]||(n[2]=l=>e(s).page=l),"page-size":e(s).limit,"onUpdate:page-size":n[3]||(n[3]=l=>e(s).limit=l),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:e(r).count},null,8,["currentPage","page-size","total"])])]),e(h)?(m(),C(M,{key:1,modelValue:e(_),"onUpdate:modelValue":n[4]||(n[4]=l=>ee(_)?_.value=l:_=l),id:e(b),onOnClose:N},null,8,["modelValue","id"])):F("",!0)],64)}}});const ze=le(be,[["__scopeId","data-v-2c364785"]]);export{ze as default};
