import{_ as M,g as O,a as $,b as R,c as H,d as J,e as K}from"./EditDialog.vue_vue_type_script_setup_true_lang.4d3aaca8.js";import{A as Q}from"./index.1d26a072.js";import{d as W,a6 as X,b as C,r as m,p as k,c as d,e as g,f as V,g as i,h as e,i as o,u as l,k as B,A as x,F as L,j as Y,m as f,t as Z,q as ee,y as A,N as te,E as z,_ as le}from"./index.0308b213.js";import"./useInstance.233fbdde.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const ae={class:"filter-form"},se=f("\u67E5\u8BE2"),oe={class:"data"},ne={class:"operation-container"},ue={class:"operation-btn"},ie=f("\u6DFB\u52A0"),de={class:"table"},re={class:"table-operation-btn"},pe={class:"top"},ce=f("\u7F16\u8F91"),_e=f("\u5220\u9664"),me={class:"bottom"},ge={class:"pagination"},fe=W({setup(be){const{OpPlatform:r}=X(),a=C({page:1,limit:10,agentid:0,sid:""}),p=C({list:[],count:0});m([]);const c=()=>{r.value==="shangpu"?O(a).then(t=>{p.list=t.list,p.count=t.count}):$(a).then(t=>{p.list=t.list,p.count=t.count})};c();let b=C({list:[]});const D=()=>{r.value=="shangpu"?R({agentid:a.agentid}).then(t=>{b.list=t}):H({}).then(t=>{b.list=t})};D(),k(()=>a.agentid,t=>{t&&r.value=="shangpu"&&(t!=a.agentid&&(a.sid=""),b.list=[],D())},{immediate:!0}),m(!1),m(!1),k(()=>[a.page,a.limit],()=>{c()});const w=()=>{c()};let _=m(!1),h=m(!1),v=m(0);const N=()=>{v.value=0,h.value=!0,A(()=>{_.value=!0})},P=t=>{v.value=t,h.value=!0,A(()=>{_.value=!0})},S=()=>{v.value=0,A(()=>{h.value=!1}),c()},U=t=>{te.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{r.value=="shangpu"?J({id:t}).then(()=>{z({message:"\u5220\u9664\u6210\u529F",type:"success"}),c()}):K({id:t}).then(()=>{z({message:"\u5220\u9664\u6210\u529F",type:"success"}),c()})}).catch(()=>{})};return(t,n)=>{const y=d("el-form-item"),T=d("el-option"),I=d("el-select"),E=d("el-button"),j=d("el-form"),u=d("el-table-column"),q=d("el-table"),G=d("el-pagination");return g(),V(L,null,[i("div",ae,[e(j,{model:l(a),"label-width":"90px"},{default:o(()=>[l(r)==="shangpu"?(g(),B(y,{key:0,class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:o(()=>[e(l(Q),{modelValue:l(a).agentid,"onUpdate:modelValue":n[0]||(n[0]=s=>l(a).agentid=s)},null,8,["modelValue"])]),_:1})):x("",!0),e(y,{class:"tn-el-form-item",label:"\u95E8\u5E97"},{default:o(()=>[e(I,{class:"agent-select",modelValue:l(a).sid,"onUpdate:modelValue":n[1]||(n[1]=s=>l(a).sid=s),placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",filterable:"",clearable:""},{default:o(()=>[(g(!0),V(L,null,Y(l(b).list,(s,F)=>(g(),B(T,{value:s.id,label:s.title},{default:o(()=>[f(Z(s.title),1)]),_:2},1032,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),e(y,null,{default:o(()=>[e(E,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:w},{default:o(()=>[se]),_:1})]),_:1})]),_:1},8,["model"])]),i("div",oe,[i("div",ne,[i("div",ue,[e(E,{class:"btn",type:"primary",onClick:N},{default:o(()=>[ie]),_:1})])]),i("div",de,[e(q,{data:l(p).list},{default:o(()=>[e(u,{label:"ID",prop:"id"}),l(r)==="shangpu"?(g(),B(u,{key:0,label:"\u6240\u5C5E\u4EE3\u7406",prop:"agent_title",width:"120px"})):x("",!0),e(u,{label:"\u5546\u6237",prop:"store_title"}),e(u,{label:"\u5956\u52B1\u7C7B\u578B",prop:"type_text"}),e(u,{label:"\u9A91\u624B",prop:"deliveryer_title"}),e(u,{label:"\u5F00\u59CB\u65E5\u671F",prop:"start_date"}),e(u,{label:"\u5468\u671F",prop:"day"}),e(u,{label:"\u5956\u52B1\u91D1\u989D",prop:"price"}),e(u,{label:"\u72B6\u6001",prop:"status_text"}),e(u,{fixed:"right",label:"\u64CD\u4F5C",width:"290px"},{default:o(({row:s})=>[i("div",re,[i("div",pe,[e(E,{size:"small",type:"primary",onClick:F=>P(s.id)},{default:o(()=>[ce]),_:2},1032,["onClick"]),e(E,{size:"small",type:"danger",onClick:F=>U(s.id)},{default:o(()=>[_e]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),i("div",me,[i("div",ge,[e(G,{currentPage:l(a).page,"onUpdate:currentPage":n[2]||(n[2]=s=>l(a).page=s),"page-size":l(a).limit,"onUpdate:page-size":n[3]||(n[3]=s=>l(a).limit=s),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:l(p).count},null,8,["currentPage","page-size","total"])])]),l(h)?(g(),B(M,{key:0,modelValue:l(_),"onUpdate:modelValue":n[4]||(n[4]=s=>ee(_)?_.value=s:_=s),id:l(v),onOnClose:S},null,8,["modelValue","id"])):x("",!0)],64)}}});const Ae=le(fe,[["__scopeId","data-v-7a3fe96b"]]);export{Ae as default};
