import{C as G,S as I,T as L,D as T,a as O,F as P}from"./element-plus.55d71530.js";import{P as j}from"./index.8e3b20a1.js";import{r as p}from"./index.75e08341.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as C,s as B,r as M,b as N,_ as b,o as F,c as V,V as a,M as o,u as t,U as h,aa as z,L as H}from"./@vue.96c135a1.js";function te(s){return p.get({url:"/goods_fee_standards.goods_fee_standards/lists",params:s})}function J(s){return p.post({url:"/goods_fee_standards.goods_fee_standards/add",params:s})}function K(s){return p.post({url:"/goods_fee_standards.goods_fee_standards/edit",params:s})}function le(s){return p.post({url:"/goods_fee_standards.goods_fee_standards/delete",params:s})}function Q(s){return p.get({url:"/goods_fee_standards.goods_fee_standards/detail",params:s})}const W={class:"edit-popup"},X=C({name:"goodsFeeStandardsEdit"}),oe=C({...X,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(s,{expose:D,emit:y}){const _=y,c=B(),i=B(),m=M("add"),v=N(()=>m.value=="edit"?"\u7F16\u8F91\u5546\u54C1\u6536\u8D39\u6807\u51C6":"\u65B0\u589E\u5546\u54C1\u6536\u8D39\u6807\u51C6"),u=b({id:"",type:"",name:"",min_fee:0,max_fee:0,unit:"",goods_id:"",details:"",status:1}),A=b({type:[{required:!0,message:"\u8BF7\u8F93\u5165\u7C7B\u578B",trigger:["blur"]}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}],min_fee:[{required:!0,message:"\u8BF7\u8F93\u5165\u6700\u4F4E\u4EF7\u683C",trigger:["blur"]}],max_fee:[{required:!0,message:"\u8BF7\u8F93\u5165\u6700\u9AD8\u4EF7\u683C(\u4E3A0\u65F6\u5373\u6700\u4F4E\u4EF7\u4E3A\u56FA\u5B9A\u4EF7)",trigger:["blur"]}],unit:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4F4D",trigger:["blur"]}],status:[{required:!0,message:"\u8BF7\u8F93\u5165\u72B6\u6001",trigger:["blur"]}]}),g=async d=>{for(const e in u)d[e]!=null&&d[e]!=null&&(u[e]=d[e])},x=async d=>{const e=await Q({id:d.id});g(e)},w=async()=>{var e,r;await((e=c.value)==null?void 0:e.validate());const d={...u};m.value=="edit"?await K(d):await J(d),(r=i.value)==null||r.close(),_("success")},S=(d="add")=>{var e;m.value=d,(e=i.value)==null||e.open()},U=()=>{_("close")};return D({open:S,setFormData:g,getDetail:x}),(d,e)=>{const r=G,f=I,E=L,n=T,k=O,q=P;return F(),V("div",W,[a(j,{ref_key:"popupRef",ref:i,title:t(v),async:!0,width:"30%",onConfirm:w,onClose:U},{default:o(()=>[a(q,{ref_key:"formRef",ref:c,model:t(u),"label-width":"150px",rules:t(A)},{default:o(()=>[a(r,{type:"hidden",modelValue:t(u).goods_id,"onUpdate:modelValue":e[0]||(e[0]=l=>t(u).goods_id=l)},null,8,["modelValue"]),a(n,{label:"\u7C7B\u578B",prop:"type"},{default:o(()=>[a(E,{class:"w-[280px]",modelValue:t(u).type,"onUpdate:modelValue":e[1]||(e[1]=l=>t(u).type=l),clearable:"",placeholder:"\u7C7B\u578B"},{default:o(()=>[(F(!0),V(h,null,z(s.dictData.fee_standard_type,(l,R)=>(F(),H(f,{key:R,label:l.name,value:parseInt(l.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u540D\u79F0",prop:"name"},{default:o(()=>[a(r,{modelValue:t(u).name,"onUpdate:modelValue":e[2]||(e[2]=l=>t(u).name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u6700\u4F4E\u4EF7\u683C/\u56FA\u5B9A\u4EF7",prop:"min_fee"},{default:o(()=>[a(r,{modelValue:t(u).min_fee,"onUpdate:modelValue":e[3]||(e[3]=l=>t(u).min_fee=l),type:"number",step:"0.01",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6700\u4F4E\u4EF7\u683C"},null,8,["modelValue"])]),_:1}),a(k,{class:"ml-2",effect:"dark",content:"\u4E3A0\u65F6\u5373\u6700\u4F4E\u4EF7\u4E3A\u56FA\u5B9A\u4EF7",placement:"top-start"},{default:o(()=>[a(n,{label:"\u6700\u9AD8\u4EF7\u683C",prop:"max_fee"},{default:o(()=>[a(r,{modelValue:t(u).max_fee,"onUpdate:modelValue":e[4]||(e[4]=l=>t(u).max_fee=l),type:"number",step:"0.01",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6700\u9AD8\u4EF7\u683C"},null,8,["modelValue"])]),_:1})]),_:1}),a(n,{label:"\u5355\u4F4D",prop:"unit"},{default:o(()=>[a(r,{modelValue:t(u).unit,"onUpdate:modelValue":e[5]||(e[5]=l=>t(u).unit=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u8BE6\u60C5\u8BF4\u660E",prop:"details"},{default:o(()=>[a(r,{type:"textarea",modelValue:t(u).details,"onUpdate:modelValue":e[6]||(e[6]=l=>t(u).details=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BE6\u60C5\u8BF4\u660E"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u72B6\u6001",prop:"status"},{default:o(()=>[a(E,{class:"flex-1",modelValue:t(u).status,"onUpdate:modelValue":e[7]||(e[7]=l=>t(u).status=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u72B6\u6001"},{default:o(()=>[a(f,{label:"\u5F00\u542F",value:1}),a(f,{label:"\u5173\u95ED",value:0})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{oe as _,le as a,te as b};
