import{C as k,D as v,F as U}from"./element-plus.ae09c4a0.js";import{P as h}from"./index.e64ff1d1.js";import{r as i}from"./index.80696382.js";import"./lodash.fc1b942f.js";import{d as F,s as D,r as x,b as P,a0 as y,o as R,c as q,W as r,O as p,u as o}from"./@vue.a7a54728.js";function J(d){return i.get({url:"/property.property_commission/lists",params:d})}function O(d){return i.post({url:"/property.property_commission/add",params:d})}function j(d){return i.post({url:"/property.property_commission/edit",params:d})}function L(d){return i.get({url:"/property.property_commission/detail",params:d})}const N={class:"edit-popup"},S=F({name:"propertyCommissionEdit"}),K=F({...S,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(d,{expose:B,emit:E}){const _=E,c=D(),n=D(),m=x("add"),b=P(()=>m.value=="edit"?"\u7F16\u8F91\u7269\u4E1A\u5206\u6210\u8868":"\u65B0\u589E\u7269\u4E1A\u5206\u6210\u8868"),u=y({id:"",property_head_id:"",property_user_id:"",property_order_id:"",work_id:"",order_amount:"",ratio:"",commission_amount:""}),V=y({property_head_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u4E1A\u8D1F\u8D23\u4EBAID",trigger:["blur"]}],property_user_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u6237\u4E3BID",trigger:["blur"]}],property_order_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u4E1A\u4E0B\u5355ID",trigger:["blur"]}],work_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5DE5\u5355ID",trigger:["blur"]}]}),f=async l=>{for(const e in u)l[e]!=null&&l[e]!=null&&(u[e]=l[e])},A=async l=>{const e=await L({id:l.id});f(e)},g=async()=>{var e,a;await((e=c.value)==null?void 0:e.validate());const l={...u};m.value=="edit"?await j(l):await O(l),(a=n.value)==null||a.close(),_("success")},I=(l="add")=>{var e;m.value=l,(e=n.value)==null||e.open()},w=()=>{_("close")};return B({open:I,setFormData:f,getDetail:A}),(l,e)=>{const a=k,s=v,C=U;return R(),q("div",N,[r(h,{ref_key:"popupRef",ref:n,title:o(b),async:!0,width:"550px",onConfirm:g,onClose:w},{default:p(()=>[r(C,{ref_key:"formRef",ref:c,model:o(u),"label-width":"90px",rules:o(V)},{default:p(()=>[r(s,{label:"\u7269\u4E1A\u8D1F\u8D23\u4EBAID",prop:"property_head_id"},{default:p(()=>[r(a,{modelValue:o(u).property_head_id,"onUpdate:modelValue":e[0]||(e[0]=t=>o(u).property_head_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7269\u4E1A\u8D1F\u8D23\u4EBAID"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u6237\u4E3BID",prop:"property_user_id"},{default:p(()=>[r(a,{modelValue:o(u).property_user_id,"onUpdate:modelValue":e[1]||(e[1]=t=>o(u).property_user_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6237\u4E3BID"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u7269\u4E1A\u4E0B\u5355ID",prop:"property_order_id"},{default:p(()=>[r(a,{modelValue:o(u).property_order_id,"onUpdate:modelValue":e[2]||(e[2]=t=>o(u).property_order_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7269\u4E1A\u4E0B\u5355ID"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u5DE5\u5355ID",prop:"work_id"},{default:p(()=>[r(a,{modelValue:o(u).work_id,"onUpdate:modelValue":e[3]||(e[3]=t=>o(u).work_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5DE5\u5355ID"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u8BA2\u5355\u53EF\u5206\u6210\u603B\u91D1\u989D",prop:"order_amount"},{default:p(()=>[r(a,{modelValue:o(u).order_amount,"onUpdate:modelValue":e[4]||(e[4]=t=>o(u).order_amount=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u53EF\u5206\u6210\u603B\u91D1\u989D"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u63D0\u6210\u6BD4\u4F8B",prop:"ratio"},{default:p(()=>[r(a,{modelValue:o(u).ratio,"onUpdate:modelValue":e[5]||(e[5]=t=>o(u).ratio=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u63D0\u6210\u6BD4\u4F8B"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u63D0\u6210\u6536\u76CA\u91D1\u989D",prop:"commission_amount"},{default:p(()=>[r(a,{modelValue:o(u).commission_amount,"onUpdate:modelValue":e[6]||(e[6]=t=>o(u).commission_amount=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u63D0\u6210\u6536\u76CA\u91D1\u989D"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{K as _,J as a};
