import{A as U}from"./index.1d26a072.js";import{az as c,d as N,b as y,p as E,c as u,e as s,k as _,i as o,h as i,u as l,f as V,j as w,m as b,t as h,F as v,A as B,E as j}from"./index.0308b213.js";const J=d=>c.post("addon/teamReward.web.DeliveryerRewardSetting/list",d),q=d=>c.get("addon/teamReward.web.DeliveryerRewardSetting/detail?id="+d),z=d=>c.post("addon/teamReward.web.DeliveryerRewardSetting/set",d),M=d=>c.post("addon/teamReward.web.DeliveryerRewardSetting/getDeliveryerList",d),K=d=>c.post("addon/teamReward.web.DeliveryerRewardSetting/delete",{id:d}),T=b("\u63D0\u4EA4"),O=N({props:{show:{type:Boolean,default:!1},EditId:{type:Number,default:0}},emits:["hideEdit","refresh"],setup(d,{emit:p}){const m=d;let e=y({agentid:0,deliveryer_id:0,start_date:"",day:0,price:0,not_match_ids:[],id:0,record:[]}),f=y({list:[]});const F=()=>{M({agentid:Number(e.agentid)}).then(n=>{f.list=n})},D=()=>{m.EditId>0&&(e.id=m.EditId),z(e).then(n=>{j.success("\u8BBE\u7F6E\u6210\u529F"),p("hideEdit"),p("refresh")})},k=()=>{p("hideEdit")};return E(()=>m.EditId,()=>{m.EditId>0&&q(m.EditId).then(n=>{e.agentid=n.data.agentid,e.deliveryer_id=n.data.deliveryer_id,e.start_date=n.data.start_date,e.day=n.data.day,e.price=n.data.price,e.id=n.data.id,e.not_match_ids=n.data.not_match_ids,e.not_match_ids&&(e.not_match_ids=e.not_match_ids.map(a=>parseInt(a)))})},{immediate:!0}),E(()=>e.agentid,()=>{e.agentid>0&&F()},{immediate:!0}),(n,a)=>{const r=u("el-form-item"),A=u("el-option"),x=u("el-select"),g=u("el-input"),C=u("el-checkbox"),R=u("el-checkbox-group"),I=u("el-button"),S=u("el-dialog");return s(),_(S,{modelValue:d.show,title:d.EditId?"\u7F16\u8F91\u8BBE\u7F6E":"\u65B0\u589E\u8BBE\u7F6E",width:"50%",onClose:k},{default:o(()=>[i(r,{class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:o(()=>[i(l(U),{modelValue:l(e).agentid,"onUpdate:modelValue":a[0]||(a[0]=t=>l(e).agentid=t)},null,8,["modelValue"])]),_:1}),l(e).agentid?(s(),_(r,{key:0,label:"\u9A91\u624B\u56E2\u957F"},{default:o(()=>[i(x,{class:"agent-select",modelValue:l(e).deliveryer_id,"onUpdate:modelValue":a[1]||(a[1]=t=>l(e).deliveryer_id=t),placeholder:"\u8BF7\u9009\u62E9\u9A91\u624B",filterable:"",clearable:""},{default:o(()=>[(s(!0),V(v,null,w(l(f).list,(t,L)=>(s(),_(A,{value:t.id,label:t.title},{default:o(()=>[b(h(t.title),1)]),_:2},1032,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1})):B("",!0),i(r,{label:"\u5F00\u59CB\u65E5\u671F"},{default:o(()=>[i(g,{modelValue:l(e).start_date,"onUpdate:modelValue":a[2]||(a[2]=t=>l(e).start_date=t),placeholder:"\u683C\u5F0F:2024-02-26"},null,8,["modelValue"])]),_:1}),i(r,{label:"\u7ED3\u7B97\u5468\u671F"},{default:o(()=>[i(g,{modelValue:l(e).day,"onUpdate:modelValue":a[3]||(a[3]=t=>l(e).day=t)},null,8,["modelValue"])]),_:1}),i(r,{label:"\u6BCF\u5355\u5956\u52B1"},{default:o(()=>[i(g,{modelValue:l(e).price,"onUpdate:modelValue":a[4]||(a[4]=t=>l(e).price=t)},null,8,["modelValue"])]),_:1}),l(e).agentid?(s(),_(r,{key:1,label:"\u9664\u5916\u914D\u9001\u5458"},{default:o(()=>[i(R,{modelValue:l(e).not_match_ids,"onUpdate:modelValue":a[5]||(a[5]=t=>l(e).not_match_ids=t)},{default:o(()=>[(s(!0),V(v,null,w(l(f).list,(t,L)=>(s(),_(C,{key:t.id,label:t.id},{default:o(()=>[b(h(t.title),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})):B("",!0),i(r,{label:"",class:"continer-item"},{default:o(()=>[i(I,{type:"primary",onClick:D},{default:o(()=>[T]),_:1})]),_:1})]),_:1},8,["modelValue","title"])}}});export{O as _,K as d,J as g};
