OrderPercentageForm-0e0e5ce1.js 6.1 KB

1
  1. import{aq as f,d as q,h as K,r as g,K as O,e as M,o as w,v as U,w as r,f as a,a as o,n as i,x as R,O as T,V as G,A as H,D as J,C as L,I as W,_ as X,__tla as Y}from"./index-bd9277a1.js";import{_ as Z,__tla as $}from"./Dialog-eba103da.js";import{_ as ee,__tla as re}from"./Tooltip-61304978.js";import{u as ae,__tla as oe}from"./useMessage-274788d4.js";let y,m,x,te=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})()]).then(async()=>{m={getOrderPercentagePage:async d=>await f.get({url:"/distri/order-percentage/page",params:d}),getOrderPercentage:async d=>await f.get({url:"/distri/order-percentage/get?id="+d}),createOrderPercentage:async d=>await f.post({url:"/distri/order-percentage/create",data:d}),updateOrderPercentage:async d=>await f.put({url:"/distri/order-percentage/update",data:d}),deleteOrderPercentage:async d=>await f.delete({url:"/distri/order-percentage/delete?id="+d}),exportOrderPercentage:async d=>await f.download({url:"/distri/order-percentage/export-excel",params:d})},y=X(q({name:"OrderPercentageForm",__name:"OrderPercentageForm",emits:["success"],setup(d,{expose:A,emit:B}){const{t:v}=K(),_=ae(),p=g(!1),b=g(""),c=g(!1),V=g(""),e=g({id:void 0,grossProfitPerc:void 0,grossProfitUserQuotaPerc:void 0,grossProfitAncestorQuotaPerc:void 0,grossProfitBonusQuotaPerc:void 0,grossProfitPlatformQuotaPerc:void 0,divideIntoPerc:void 0}),I=O(()=>Number(e.value.grossProfitUserQuotaPerc)+Number(e.value.grossProfitAncestorQuotaPerc)+Number(e.value.grossProfitBonusQuotaPerc)+Number(e.value.grossProfitPlatformQuotaPerc)),F=O(()=>I.value>100),N=M({}),Q=g();A({open:async(s,t)=>{if(p.value=!0,b.value=v("action."+s),V.value=s,j(),t){c.value=!0;try{e.value=await m.getOrderPercentage(t)}finally{c.value=!1}h.forEach(u=>{e.value.hasOwnProperty(u)&&(e.value[u]=100*e.value[u])})}}});const h=["grossProfitPerc","grossProfitUserQuotaPerc","grossProfitAncestorQuotaPerc","grossProfitBonusQuotaPerc","grossProfitPlatformQuotaPerc","divideIntoPerc"],S=B,z=async()=>{if(h.forEach(s=>{e.value.hasOwnProperty(s)&&(e.value[s]=(e.value[s]/100).toFixed(4))}),F.value)_.error("\u7528\u6237\u81EA\u5F97+\u76F4\u63A8\u5956+\u5408\u8D62\u5956+\u5E73\u53F0\u670D\u52A1\u8D39,\u603B\u548C\u4E0D\u80FD\u8D85\u8FC7100");else{await Q.value.validate(),c.value=!0;try{const s=e.value;V.value==="create"?(await m.createOrderPercentage(s),_.success(v("common.createSuccess"))):(await m.updateOrderPercentage(s),_.success(v("common.updateSuccess"))),p.value=!1,S("success")}finally{c.value=!1}}},j=()=>{var s;e.value={id:void 0,grossProfitPerc:void 0,grossProfitUserQuotaPerc:void 0,grossProfitAncestorQuotaPerc:void 0,grossProfitBonusQuotaPerc:void 0,grossProfitPlatformQuotaPerc:void 0,divideIntoPerc:void 0},(s=Q.value)==null||s.resetFields()};return(s,t)=>{const u=ee,P=G,n=H,k=J,C=L,D=Z,E=W;return w(),U(D,{title:o(b),modelValue:o(p),"onUpdate:modelValue":t[6]||(t[6]=l=>T(p)?p.value=l:null)},{footer:r(()=>[a(C,{onClick:z,type:"primary",disabled:o(c)},{default:r(()=>[i("\u786E \u5B9A")]),_:1},8,["disabled"])]),default:r(()=>[R((w(),U(k,{ref_key:"formRef",ref:Q,model:o(e),rules:o(N),"label-width":"100px"},{default:r(()=>[a(n,{label:"\u6BDB\u5229\u767E\u5206\u6BD4",prop:"grossProfitPerc"},{label:r(()=>[a(u,{message:"\u4F8B(0.3888)",title:"\u6BDB\u5229"})]),default:r(()=>[a(P,{modelValue:o(e).grossProfitPerc,"onUpdate:modelValue":t[0]||(t[0]=l=>o(e).grossProfitPerc=l),placeholder:"\u8BF7\u8F93\u5165\u6BDB\u5229\u767E\u5206\u6BD4"},{append:r(()=>[i("%")]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u7528\u6237\u81EA\u5F97",prop:"grossProfitUserQuotaPerc"},{label:r(()=>[a(u,{message:"\u4F8B(35),\u7528\u6237\u81EA\u5F97+\u76F4\u63A8\u5956+\u5408\u8D62\u5956+\u5E73\u53F0\u670D\u52A1\u8D39,\u603B\u548C\u4E0D\u80FD\u8D85\u8FC7100",title:"\u7528\u6237\u81EA\u5F97"})]),default:r(()=>[a(P,{modelValue:o(e).grossProfitUserQuotaPerc,"onUpdate:modelValue":t[1]||(t[1]=l=>o(e).grossProfitUserQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u81EA\u5F97"},{append:r(()=>[i("%")]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u76F4\u63A8\u5956",prop:"grossProfitAncestorQuotaPerc"},{label:r(()=>[a(u,{message:"\u4F8B(35),\u7528\u6237\u81EA\u5F97+\u76F4\u63A8\u5956+\u5408\u8D62\u5956+\u5E73\u53F0\u670D\u52A1\u8D39,\u603B\u548C\u4E0D\u80FD\u8D85\u8FC7100",title:"\u76F4\u63A8\u5956"})]),default:r(()=>[a(P,{modelValue:o(e).grossProfitAncestorQuotaPerc,"onUpdate:modelValue":t[2]||(t[2]=l=>o(e).grossProfitAncestorQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u76F4\u63A8\u5956"},{append:r(()=>[i("%")]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u5408\u8D62\u5956",prop:"grossProfitBonusQuotaPerc"},{label:r(()=>[a(u,{message:"\u4F8B(22),\u7528\u6237\u81EA\u5F97+\u76F4\u63A8\u5956+\u5408\u8D62\u5956+\u5E73\u53F0\u670D\u52A1\u8D39,\u603B\u548C\u4E0D\u80FD\u8D85\u8FC7100",title:"\u5408\u8D62\u5956"})]),default:r(()=>[a(P,{modelValue:o(e).grossProfitBonusQuotaPerc,"onUpdate:modelValue":t[3]||(t[3]=l=>o(e).grossProfitBonusQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u5408\u8D62\u5956"},{append:r(()=>[i("%")]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u5E73\u53F0\u670D\u52A1\u8D39",prop:"grossProfitPlatformQuotaPerc"},{label:r(()=>[a(u,{message:"\u4F8B(35),\u7528\u6237\u81EA\u5F97+\u76F4\u63A8\u5956+\u5408\u8D62\u5956+\u5E73\u53F0\u670D\u52A1\u8D39,\u603B\u548C\u4E0D\u80FD\u8D85\u8FC7100",title:"\u5E73\u53F0\u670D\u52A1\u8D39"})]),default:r(()=>[a(P,{modelValue:o(e).grossProfitPlatformQuotaPerc,"onUpdate:modelValue":t[4]||(t[4]=l=>o(e).grossProfitPlatformQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u670D\u52A1\u8D39"},{append:r(()=>[i("%")]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u5206\u6210",prop:"divideIntoPerc"},{default:r(()=>[a(P,{modelValue:o(e).divideIntoPerc,"onUpdate:modelValue":t[5]||(t[5]=l=>o(e).divideIntoPerc=l),placeholder:"\u8BF7\u8F93\u5165\u5206\u6210"},{append:r(()=>[i("%")]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[E,o(c)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/system/distri/orderpercentage/OrderPercentageForm.vue"]]),x=Object.freeze(Object.defineProperty({__proto__:null,default:y},Symbol.toStringTag,{value:"Module"}))});export{y as O,te as __tla,m as a,x as b};