PtProfitLogForm-ad626d7c.js 3.9 KB

1
  1. import{aA as p,d as O,P as J,r as n,x as M,o as L,C as x,A as d,f as l,a as t,D as g,k as R,a2 as W,a9 as Z,V as q,at as B,au as E,W as G,J as H,Z as K,_ as N,__tla as Q}from"./index-0b2503c4.js";import{_ as X,__tla as Y}from"./Dialog-3207cd36.js";import{u as $,__tla as ee}from"./useMessage-d05433ee.js";let P,f,S,te=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return ee}catch{}})()]).then(async()=>{f={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})},P=N(O({name:"PtProfitLogForm",__name:"PtProfitLogForm",emits:["success"],setup(o,{expose:h,emit:A}){const{t:_}=J(),y=$(),i=n(!1),V=n(""),s=n(!1),b=n(""),a=n({id:void 0,amount:void 0,afterAmount:void 0,profitStatus:void 0,orderId:void 0,percentTemplate:void 0}),T=M({}),v=n();h({open:async(u,e)=>{if(i.value=!0,V.value=_("action."+u),b.value=u,k(),e){s.value=!0;try{a.value=await f.getPtProfitLog(e)}finally{s.value=!1}}}});const U=A,I=async()=>{await v.value.validate(),s.value=!0;try{const u=a.value;b.value==="create"?(await f.createPtProfitLog(u),y.success(_("common.createSuccess"))):(await f.updatePtProfitLog(u),y.success(_("common.updateSuccess"))),i.value=!1,U("success")}finally{s.value=!1}},k=()=>{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 c=Z,m=q,F=B,z=E,j=G,w=H,C=X,D=K;return L(),x(C,{title:t(V),modelValue:t(i),"onUpdate:modelValue":e[6]||(e[6]=r=>W(i)?i.value=r:null)},{footer:d(()=>[l(w,{onClick:I,type:"primary",disabled:t(s)},{default:d(()=>[g("\u786E \u5B9A")]),_:1},8,["disabled"]),l(w,{onClick:e[5]||(e[5]=r=>i.value=!1)},{default:d(()=>[g("\u53D6 \u6D88")]),_:1})]),default:d(()=>[R((L(),x(j,{ref_key:"formRef",ref:v,model:t(a),rules:t(T),"label-width":"100px"},{default:d(()=>[l(m,{label:"\u589E\u52A0\u91D1\u989D",prop:"amount"},{default:d(()=>[l(c,{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(m,{label:"\u589E\u52A0\u540E\u91D1\u989D",prop:"afterAmount"},{default:d(()=>[l(c,{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(m,{label:"\u6536\u76CA\u7C7B\u578B 1:\u5E73\u53F0\u670D\u52A1\u5668\u8D39 2:\u5E73\u53F0\u6536\u76CA",prop:"profitStatus"},{default:d(()=>[l(z,{modelValue:t(a).profitStatus,"onUpdate:modelValue":e[2]||(e[2]=r=>t(a).profitStatus=r)},{default:d(()=>[l(F,{label:"1"},{default:d(()=>[g("\u8BF7\u9009\u62E9\u5B57\u5178\u751F\u6210")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(m,{label:"\u8BA2\u5355\u53F7",prop:"orderId"},{default:d(()=>[l(c,{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(m,{label:"\u8BA1\u7B97\u767E\u5206\u6BD4\u6A21\u677F",prop:"percentTemplate"},{default:d(()=>[l(c,{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"])),[[D,t(s)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/distri/ptprofitlog/PtProfitLogForm.vue"]]),S=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"}))});export{P,te as __tla,f as a,S as b};