PtProfitForm-ff9de6d6.js 3.3 KB

1
  1. import{ar as p,d as D,i as O,r as c,f as B,o as g,x as b,w as r,g as s,a as t,n as x,y as J,P as M,W as R,B as W,G as q,D as E,J as H,_ as I,__tla as K}from"./index-3fb48822.js";import{_ as L,__tla as N}from"./Dialog-7d4425a0.js";import{u as Q,__tla as X}from"./useMessage-b6c78c26.js";let v,n,h,Y=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{n={getPtProfitPage:async a=>await p.get({url:"/distri/pt-profit/page",params:a}),getPtProfit:async a=>await p.get({url:"/distri/pt-profit/get?id="+a}),createPtProfit:async a=>await p.post({url:"/distri/pt-profit/create",data:a}),updatePtProfit:async a=>await p.put({url:"/distri/pt-profit/update",data:a}),deletePtProfit:async a=>await p.delete({url:"/distri/pt-profit/delete?id="+a}),exportPtProfit:async a=>await p.download({url:"/distri/pt-profit/export-excel",params:a})},v=I(D({name:"PtProfitForm",__name:"PtProfitForm",emits:["success"],setup(a,{expose:G,emit:T}){const{t:f}=O(),y=Q(),i=c(!1),A=c(""),u=c(!1),w=c(""),l=c({id:void 0,ptAdd:void 0,ptGrossAdd:void 0,ptTotalAdd:void 0}),F=B({}),m=c();G({open:async(d,e)=>{if(i.value=!0,A.value=f("action."+d),w.value=d,k(),e){u.value=!0;try{l.value=await n.getPtProfit(e)}finally{u.value=!1}}}});const S=T,U=async()=>{await m.value.validate(),u.value=!0;try{const d=l.value;w.value==="create"?(await n.createPtProfit(d),y.success(f("common.createSuccess"))):(await n.updatePtProfit(d),y.success(f("common.updateSuccess"))),i.value=!1,S("success")}finally{u.value=!1}},k=()=>{var d;l.value={id:void 0,ptAdd:void 0,ptGrossAdd:void 0,ptTotalAdd:void 0},(d=m.value)==null||d.resetFields()};return(d,e)=>{const _=R,P=W,z=q,V=E,j=L,C=H;return g(),b(j,{title:t(A),modelValue:t(i),"onUpdate:modelValue":e[4]||(e[4]=o=>M(i)?i.value=o:null)},{footer:r(()=>[s(V,{onClick:U,type:"primary",disabled:t(u)},{default:r(()=>[x("\u786E \u5B9A")]),_:1},8,["disabled"]),s(V,{onClick:e[3]||(e[3]=o=>i.value=!1)},{default:r(()=>[x("\u53D6 \u6D88")]),_:1})]),default:r(()=>[J((g(),b(z,{ref_key:"formRef",ref:m,model:t(l),rules:t(F),"label-width":"100px"},{default:r(()=>[s(P,{label:"\u5E73\u53F0\u670D\u52A1\u8D39(\u6BDB\u5229\u4E0B\u7684\u767E\u5206\u6BD4\u6536\u76CA)",prop:"ptAdd"},{default:r(()=>[s(_,{modelValue:t(l).ptAdd,"onUpdate:modelValue":e[0]||(e[0]=o=>t(l).ptAdd=o),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u670D\u52A1\u8D39(\u6BDB\u5229\u4E0B\u7684\u767E\u5206\u6BD4\u6536\u76CA)"},null,8,["modelValue"])]),_:1}),s(P,{label:"\u5E73\u53F0\u6536\u76CA(0.3888 \u4E4B\u5916\u7684\u6536\u76CA)",prop:"ptGrossAdd"},{default:r(()=>[s(_,{modelValue:t(l).ptGrossAdd,"onUpdate:modelValue":e[1]||(e[1]=o=>t(l).ptGrossAdd=o),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u6536\u76CA(0.3888 \u4E4B\u5916\u7684\u6536\u76CA)"},null,8,["modelValue"])]),_:1}),s(P,{label:"\u5E73\u53F0\u603B\u6536\u76CA",prop:"ptTotalAdd"},{default:r(()=>[s(_,{modelValue:t(l).ptTotalAdd,"onUpdate:modelValue":e[2]||(e[2]=o=>t(l).ptTotalAdd=o),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u603B\u6536\u76CA"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[C,t(u)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/distri/ptprofit/PtProfitForm.vue"]]),h=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"}))});export{v as P,Y as __tla,n as a,h as b};