PtProfitForm-fa403679.js 2.8 KB

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