import{g as G,a as M,b as O,c as q}from"./index.a63f2653.js";import{u as z}from"./useInstance.233fbdde.js";import{A as H}from"./index.1d26a072.js";import{d as J,a6 as K,s as Q,r as k,p as F,b as V,c as n,e as r,k as f,i as a,g,t as x,u as o,h as s,A as y,f as W,j as X,m as b,F as Y,a2 as Z,E as S,R as ee,S as te,_ as oe}from"./index.0308b213.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const le=d=>(ee("data-v-aa7b50b9"),d=d(),te(),d),ue={class:"container"},ae={class:"title-box"},se={class:"title"},ne=b("\u5168\u9009"),de=le(()=>g("div",{class:"tips"}," \u4F8B\u5982\u57FA\u7840\u514D\u8FD0\u8D39\u6570\u91CF\u4E3A3\uFF0C\u53E0\u52A0\u8BBE\u7F6E1\u5143\uFF0C\u8D85\u51FA3\u4EF6\u540E\u6BCF\u5355\u589E\u52A01\u5143\u914D\u9001\u8D39\u3002 ",-1)),ie=b("\u63D0\u4EA4"),_e=b("\u5173\u95ED"),re=J({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(d,{emit:B}){const c=d,{OpPlatform:m}=K(),{global:L}=z();let w=Q(()=>Number(c.id)>0);const E=k(!1);F(()=>c.modelValue,l=>{E.value=l,l&&c.id&&(e.id=c.id)});const e=V({id:"",agentid:"",sid:[],is_open:1,base_free_num:0,add_delivery_fee:0,goodsList:[],detail:{},select_all:1,check_box_select_all:0});!e.id&&m.value!="shangpu"&&(e.agentid=sessionStorage.getItem("shangpu_tuniao_agent_id")),F(()=>e.check_box_select_all,l=>{l==1?e.sid=i.list.map(t=>t.id):e.sid=[]});let i=V({list:[]});const U=l=>{console.log("val",l),e.sid=l},C=()=>{m.value=="shangpu"?G({agentid:e.agentid}).then(l=>{i.list=l}):M({}).then(l=>{i.list=l})};C(),F(()=>e.agentid,l=>{l&&(l!=e.agentid&&(e.sid="",e.deliveryer_id=""),i.list=[],C())},{immediate:!0});const I=V({option_text:"\u65B0\u589E",loading:!0,classifyList:[],goodsList:[],dialogTableData:[],keyword:"",cid:[],showDialog:!1,btnLoading:!1,preselection:[],goodsPageLoading:!1}),h=k(),N=()=>{m.value=="shangpu"?O(e).then(l=>{console.log("res",l),S.success("\u64CD\u4F5C\u6210\u529F"),p()}):q(e).then(l=>{console.log("res",l),S.success("\u64CD\u4F5C\u6210\u529F"),p()})},P=()=>{p()},p=()=>{B("update:modelValue",!1),B("onClose"),L.$resetForm(h.value,e)};return(l,t)=>{const _=n("el-form-item"),v=n("el-checkbox"),R=n("el-checkbox-group"),$=n("el-switch"),D=n("el-input"),A=n("el-button"),T=n("el-dialog");return r(),f(T,{modelValue:E.value,"onUpdate:modelValue":t[8]||(t[8]=u=>E.value=u),title:o(w)?"\u67E5\u770B\u8BBE\u7F6E(\u9ED8\u8BA4\u5168\u9009\u5546\u54C1)":"\u65B0\u589E\u8BBE\u7F6E(\u9ED8\u8BA4\u5168\u9009\u5546\u54C1)",width:"70%","destroy-on-close":"",onClose:p},{default:a(()=>[g("div",ue,[g("div",ae,[g("h2",se,x(o(I).option_text)+"\u6D3B\u52A8",1)]),s(o(Z),{class:"form-container",ref_key:"formRef",ref:h,model:o(e),"label-width":"180px"},{default:a(()=>[o(m)==="shangpu"?(r(),f(_,{key:0,label:"\u6240\u5C5E\u4EE3\u7406"},{default:a(()=>[s(o(H),{modelValue:o(e).agentid,"onUpdate:modelValue":t[0]||(t[0]=u=>o(e).agentid=u)},null,8,["modelValue"])]),_:1})):y("",!0),o(e).agentid?(r(),f(_,{key:1,label:"\u95E8\u5E97"},{default:a(()=>[s(R,{modelValue:o(e).sid,"onUpdate:modelValue":t[1]||(t[1]=u=>o(e).sid=u),onChange:U},{default:a(()=>[(r(!0),W(Y,null,X(o(i).list,(u,j)=>(r(),f(v,{key:j,label:u.id},{default:a(()=>[b(x(u.title),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"]),s(v,{modelValue:o(e).check_box_select_all,"onUpdate:modelValue":t[2]||(t[2]=u=>o(e).check_box_select_all=u),label:"1"},{default:a(()=>[ne]),_:1},8,["modelValue"])]),_:1})):y("",!0),s(_,{label:"\u662F\u5426\u5F00\u542F"},{default:a(()=>[s($,{modelValue:o(e).is_open,"onUpdate:modelValue":t[3]||(t[3]=u=>o(e).is_open=u),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1}),s(_,{label:"\u57FA\u7840\u514D\u8FD0\u8D39\u6570\u91CF"},{default:a(()=>[s(D,{modelValue:o(e).base_free_num,"onUpdate:modelValue":t[4]||(t[4]=u=>o(e).base_free_num=u)},null,8,["modelValue"])]),_:1}),s(_,{label:"\u8D85\u51FA\u6570\u91CF\u540E\u6BCF\u5355\u589E\u52A0x\u5143(\u53E0\u52A0)"},{default:a(()=>[s(D,{modelValue:o(e).add_delivery_fee,"onUpdate:modelValue":t[5]||(t[5]=u=>o(e).add_delivery_fee=u)},null,8,["modelValue"]),de]),_:1}),s(A,{type:"primary",onClick:t[6]||(t[6]=u=>N())},{default:a(()=>[ie]),_:1}),s(A,{type:"info",onClick:t[7]||(t[7]=u=>P())},{default:a(()=>[_e]),_:1})]),_:1},8,["model"])])]),_:1},8,["modelValue","title"])}}});const Fe=oe(re,[["__scopeId","data-v-aa7b50b9"]]);export{Fe as default};
