import{g as P,s as R,a as $}from"./index.ad00c928.js";import{d as I,b as U,r as A,c as _,e as n,f as m,h as u,i as o,u as s,F as f,j as y,k as g,g as F,m as d,t as k,E as T,_ as q}from"./index.0308b213.js";const z={class:"setting-form"},G={style:{display:"flex",width:"100%"}},H=d("\u5220\u9664\u9910\u5385"),J=d("\u6DFB\u52A0\u9910\u5385"),K={style:{display:"flex",width:"100%"}},O=d("\u5220\u9664"),Q=d("\u6DFB\u52A0"),W={class:"operation-btn"},X=d("\u63D0\u4EA4"),Y=I({setup(Z){const e=U({appid:"",franchiser_id:"",min_price:"",restaurant_id:[],restaurant_sid:[],pay_sid:[],pay_sid_method:[]}),b=U({list:[]}),C=[{label:"\u4F59\u989D",value:"credit"},{label:"\u652F\u4ED8\u5206",value:"payscore"},{label:"\u5148\u4F59\u989D\u540E\u652F\u4ED8\u5206",value:"together"}],r=A(1),w=()=>{r.value=r.value+1},S=t=>{r.value=r.value-1,e.restaurant_id.splice(t-1,1),e.restaurant_sid.splice(t-1,1)},p=A(1),L=()=>{p.value=p.value+1},x=t=>{p.value=p.value-1,e.pay_sid.splice(t-1,1),e.pay_sid_method.splice(t-1,1)};(()=>{P().then(t=>{console.log(t),b.list=t})})();const M=()=>{R(e).then(()=>{D(),T.success("\u4FDD\u5B58\u6210\u529F")})},D=()=>{$().then(t=>{console.log(t),t=t.data,e.appid=t.appid,e.franchiser_id=t.franchiser_id,e.min_price=t.min_price,e.restaurant_id=t.restaurant_id,e.restaurant_sid=t.restaurant_sid,r.value=t.restaurant_id.length,e.pay_sid=t.pay_sid,e.pay_sid_method=t.pay_sid_method,p.value=t.pay_sid.length})};return D(),(t,c)=>{const h=_("el-input"),i=_("el-form-item"),V=_("el-option"),E=_("el-select"),v=_("el-link"),N=_("el-form"),j=_("el-button");return n(),m("div",z,[u(N,{model:s(e),"label-width":"170px"},{default:o(()=>[u(i,{label:"appid"},{default:o(()=>[u(h,{modelValue:s(e).appid,"onUpdate:modelValue":c[0]||(c[0]=a=>s(e).appid=a)},null,8,["modelValue"])]),_:1}),u(i,{label:"\u52A0\u76DF\u5546id"},{default:o(()=>[u(h,{modelValue:s(e).franchiser_id,"onUpdate:modelValue":c[1]||(c[1]=a=>s(e).franchiser_id=a)},null,8,["modelValue"])]),_:1}),u(i,{label:"\u7ED1\u76D8\u5355\u4EF7"},{default:o(()=>[u(h,{modelValue:s(e).min_price,"onUpdate:modelValue":c[2]||(c[2]=a=>s(e).min_price=a)},null,8,["modelValue"])]),_:1}),(n(!0),m(f,null,y(r.value,a=>(n(),g(i,{label:"\u9910\u5385\u8BBE\u7F6E",prop:"restaurant_details",key:a},{default:o(()=>[F("view",G,[u(E,{class:"tn-el-form-item--item",modelValue:s(e).restaurant_sid[a-1],"onUpdate:modelValue":l=>s(e).restaurant_sid[a-1]=l,placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",filterable:"",clearable:""},{default:o(()=>[(n(!0),m(f,null,y(s(b).list,(l,B)=>(n(),g(V,{value:l.id,label:l.title},{default:o(()=>[d(k(l.title),1)]),_:2},1032,["value","label"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"]),u(h,{modelValue:s(e).restaurant_id[a-1],"onUpdate:modelValue":l=>s(e).restaurant_id[a-1]=l,style:{"margin-left":"10px",width:"200px"}},null,8,["modelValue","onUpdate:modelValue"]),u(v,{type:"danger",onClick:l=>S(a),style:{"margin-left":"10px"}},{default:o(()=>[H]),_:2},1032,["onClick"])])]),_:2},1024))),128)),u(i,{label:""},{default:o(()=>[u(v,{type:"primary",onClick:w},{default:o(()=>[J]),_:1})]),_:1}),(n(!0),m(f,null,y(p.value,a=>(n(),g(i,{label:"\u4ED8\u6B3E\u8BBE\u7F6E",prop:"pay_method_details",key:a},{default:o(()=>[F("view",K,[u(E,{class:"tn-el-form-item--item",modelValue:s(e).pay_sid[a-1],"onUpdate:modelValue":l=>s(e).pay_sid[a-1]=l,placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",filterable:"",clearable:""},{default:o(()=>[(n(!0),m(f,null,y(s(b).list,(l,B)=>(n(),g(V,{value:l.id,label:l.title},{default:o(()=>[d(k(l.title),1)]),_:2},1032,["value","label"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"]),u(E,{modelValue:s(e).pay_sid_method[a-1],"onUpdate:modelValue":l=>s(e).pay_sid_method[a-1]=l},{default:o(()=>[(n(),m(f,null,y(C,(l,B)=>u(V,{value:l.value,label:l.label},{default:o(()=>[d(k(l.label),1)]),_:2},1032,["value","label"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue"]),u(v,{type:"danger",onClick:l=>x(a),style:{"margin-left":"10px"}},{default:o(()=>[O]),_:2},1032,["onClick"])])]),_:2},1024))),128)),u(i,{label:""},{default:o(()=>[u(v,{type:"primary",onClick:L},{default:o(()=>[Q]),_:1})]),_:1})]),_:1},8,["model"]),F("div",W,[u(j,{type:"primary",onClick:M},{default:o(()=>[X]),_:1})])])}}});const ae=q(Y,[["__scopeId","data-v-423e6342"]]);export{ae as default};
