import{az as p,d as B,Q as D,r as m,x as E,o as L,A as b,B as d,f as l,a as t,E as g,k as K,a2 as Q,a8 as R,V as W,as as Z,at as q,W as G,K as H,Z as J,__tla as M}from"./index-92ad187a.js";import{_ as N,__tla as O}from"./Dialog-44c9fa34.js";import{u as X,__tla as Y}from"./useMessage-d9788660.js";let c,h,$=Promise.all([(()=>{try{return M}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return Y}catch{}})()]).then(async()=>{c={getPtProfitLogPage:async o=>await p.get({url:"/distri/pt-profit-log/page",params:o}),getPtProfitLog:async o=>await p.get({url:"/distri/pt-profit-log/get?id="+o}),createPtProfitLog:async o=>await p.post({url:"/distri/pt-profit-log/create",data:o}),updatePtProfitLog:async o=>await p.put({url:"/distri/pt-profit-log/update",data:o}),deletePtProfitLog:async o=>await p.delete({url:"/distri/pt-profit-log/delete?id="+o}),exportPtProfitLog:async o=>await p.download({url:"/distri/pt-profit-log/export-excel",params:o})},h=B({name:"PtProfitLogForm",__name:"PtProfitLogForm",emits:["success"],setup(o,{expose:x,emit:S}){const{t:_}=D(),P=X(),s=m(!1),y=m(""),i=m(!1),V=m(""),a=m({id:void 0,amount:void 0,afterAmount:void 0,profitStatus:void 0,orderId:void 0,percentTemplate:void 0}),A=E({}),v=m();x({open:async(u,e)=>{if(s.value=!0,y.value=_("action."+u),V.value=u,T(),e){i.value=!0;try{a.value=await c.getPtProfitLog(e)}finally{i.value=!1}}}});const U=S,I=async()=>{await v.value.validate(),i.value=!0;try{const u=a.value;V.value==="create"?(await c.createPtProfitLog(u),P.success(_("common.createSuccess"))):(await c.updatePtProfitLog(u),P.success(_("common.updateSuccess"))),s.value=!1,U("success")}finally{i.value=!1}},T=()=>{var u;a.value={id:void 0,amount:void 0,afterAmount:void 0,profitStatus:void 0,orderId:void 0,percentTemplate:void 0},(u=v.value)==null||u.resetFields()};return(u,e)=>{const f=R,n=W,k=Z,F=q,C=G,w=H,j=N,z=J;return L(),b(j,{title:t(y),modelValue:t(s),"onUpdate:modelValue":e[6]||(e[6]=r=>Q(s)?s.value=r:null)},{footer:d(()=>[l(w,{onClick:I,type:"primary",disabled:t(i)},{default:d(()=>[g("\u786E \u5B9A")]),_:1},8,["disabled"]),l(w,{onClick:e[5]||(e[5]=r=>s.value=!1)},{default:d(()=>[g("\u53D6 \u6D88")]),_:1})]),default:d(()=>[K((L(),b(C,{ref_key:"formRef",ref:v,model:t(a),rules:t(A),"label-width":"100px"},{default:d(()=>[l(n,{label:"\u589E\u52A0\u91D1\u989D",prop:"amount"},{default:d(()=>[l(f,{modelValue:t(a).amount,"onUpdate:modelValue":e[0]||(e[0]=r=>t(a).amount=r),placeholder:"\u8BF7\u8F93\u5165\u589E\u52A0\u91D1\u989D"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u589E\u52A0\u540E\u91D1\u989D",prop:"afterAmount"},{default:d(()=>[l(f,{modelValue:t(a).afterAmount,"onUpdate:modelValue":e[1]||(e[1]=r=>t(a).afterAmount=r),placeholder:"\u8BF7\u8F93\u5165\u589E\u52A0\u540E\u91D1\u989D"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u6536\u76CA\u7C7B\u578B 1:\u5E73\u53F0\u670D\u52A1\u5668\u8D39 2:\u5E73\u53F0\u6536\u76CA",prop:"profitStatus"},{default:d(()=>[l(F,{modelValue:t(a).profitStatus,"onUpdate:modelValue":e[2]||(e[2]=r=>t(a).profitStatus=r)},{default:d(()=>[l(k,{label:"1"},{default:d(()=>[g("\u8BF7\u9009\u62E9\u5B57\u5178\u751F\u6210")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(n,{label:"\u8BA2\u5355\u53F7",prop:"orderId"},{default:d(()=>[l(f,{modelValue:t(a).orderId,"onUpdate:modelValue":e[3]||(e[3]=r=>t(a).orderId=r),placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u53F7"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u8BA1\u7B97\u767E\u5206\u6BD4\u6A21\u677F",prop:"percentTemplate"},{default:d(()=>[l(f,{modelValue:t(a).percentTemplate,"onUpdate:modelValue":e[4]||(e[4]=r=>t(a).percentTemplate=r),placeholder:"\u8BF7\u8F93\u5165\u8BA1\u7B97\u767E\u5206\u6BD4\u6A21\u677F"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[z,t(i)]])]),_:1},8,["title","modelValue"])}}})});export{c as P,h as _,$ as __tla};
