import{d as S,Q as j,r as p,x as B,o as P,A as V,B as o,f as s,a,E as h,k as D,a2 as E,a8 as K,V as Q,W as R,K as W,Z,__tla as q}from"./index-92ad187a.js";import{_ as z,__tla as H}from"./Dialog-44c9fa34.js";import{P as n,__tla as I}from"./index-1fa8adc8.js";import{u as J,__tla as L}from"./useMessage-d9788660.js";let b,M=Promise.all([(()=>{try{return q}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return L}catch{}})()]).then(async()=>{b=S({name:"PtProfitForm",__name:"PtProfitForm",emits:["success"],setup(N,{expose:w,emit:G}){const{t:i}=j(),f=J(),r=p(!1),v=p(""),u=p(!1),A=p(""),l=p({id:void 0,ptAdd:void 0,ptGrossAdd:void 0,ptTotalAdd:void 0}),T=B({}),c=p();w({open:async(t,e)=>{if(r.value=!0,v.value=i("action."+t),A.value=t,U(),e){u.value=!0;try{l.value=await n.getPtProfit(e)}finally{u.value=!1}}}});const k=G,x=async()=>{await c.value.validate(),u.value=!0;try{const t=l.value;A.value==="create"?(await n.createPtProfit(t),f.success(i("common.createSuccess"))):(await n.updatePtProfit(t),f.success(i("common.updateSuccess"))),r.value=!1,k("success")}finally{u.value=!1}},U=()=>{var t;l.value={id:void 0,ptAdd:void 0,ptGrossAdd:void 0,ptTotalAdd:void 0},(t=c.value)==null||t.resetFields()};return(t,e)=>{const m=K,_=Q,F=R,y=W,C=z,g=Z;return P(),V(C,{title:a(v),modelValue:a(r),"onUpdate:modelValue":e[4]||(e[4]=d=>E(r)?r.value=d:null)},{footer:o(()=>[s(y,{onClick:x,type:"primary",disabled:a(u)},{default:o(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),s(y,{onClick:e[3]||(e[3]=d=>r.value=!1)},{default:o(()=>[h("\u53D6 \u6D88")]),_:1})]),default:o(()=>[D((P(),V(F,{ref_key:"formRef",ref:c,model:a(l),rules:a(T),"label-width":"100px"},{default:o(()=>[s(_,{label:"\u5E73\u53F0\u670D\u52A1\u8D39(\u6BDB\u5229\u4E0B\u7684\u767E\u5206\u6BD4\u6536\u76CA)",prop:"ptAdd"},{default:o(()=>[s(m,{modelValue:a(l).ptAdd,"onUpdate:modelValue":e[0]||(e[0]=d=>a(l).ptAdd=d),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u670D\u52A1\u8D39(\u6BDB\u5229\u4E0B\u7684\u767E\u5206\u6BD4\u6536\u76CA)"},null,8,["modelValue"])]),_:1}),s(_,{label:"\u5E73\u53F0\u6536\u76CA(0.3888 \u4E4B\u5916\u7684\u6536\u76CA)",prop:"ptGrossAdd"},{default:o(()=>[s(m,{modelValue:a(l).ptGrossAdd,"onUpdate:modelValue":e[1]||(e[1]=d=>a(l).ptGrossAdd=d),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u6536\u76CA(0.3888 \u4E4B\u5916\u7684\u6536\u76CA)"},null,8,["modelValue"])]),_:1}),s(_,{label:"\u5E73\u53F0\u603B\u6536\u76CA",prop:"ptTotalAdd"},{default:o(()=>[s(m,{modelValue:a(l).ptTotalAdd,"onUpdate:modelValue":e[2]||(e[2]=d=>a(l).ptTotalAdd=d),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u603B\u6536\u76CA"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[g,a(u)]])]),_:1},8,["title","modelValue"])}}})});export{b as _,M as __tla};
