OrderPercentageForm-a1266a21.js 11 KB

1
  1. import{aA as m,d as W,P as Z,r as P,e as S,x as q,o as g,C,A as r,f as o,a,D as c,k as G,c as w,F as h,a2 as H,a9 as K,V as L,W as X,J as Y,Z as $,_ as ee,__tla as ae}from"./index-54aa57d8.js";import{_ as oe,__tla as te}from"./Dialog-7bb778a5.js";import{_ as re,__tla as le}from"./Tooltip-b383fd4d.js";import{u as se,__tla as ie}from"./useMessage-f56cafbb.js";let U,_,A,de=Promise.all([(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return ie}catch{}})()]).then(async()=>{_={getOrderPercentagePage:async d=>await m.get({url:"/distri/order-percentage/page",params:d}),getOrderPercentage:async d=>await m.get({url:"/distri/order-percentage/get?id="+d}),createOrderPercentage:async d=>await m.post({url:"/distri/order-percentage/create",data:d}),updateOrderPercentage:async d=>await m.put({url:"/distri/order-percentage/update",data:d}),deleteOrderPercentage:async d=>await m.delete({url:"/distri/order-percentage/delete?id="+d}),exportOrderPercentage:async d=>await m.download({url:"/distri/order-percentage/export-excel",params:d})},U=ee(W({name:"OrderPercentageForm",__name:"OrderPercentageForm",emits:["success"],setup(d,{expose:O,emit:x}){const{t:y}=Z(),V=se(),f=P(!1),I=P("\u7F16\u8F91"),p=P(!1),v=P(""),e=P({id:void 0,grossProfitPerc:void 0,grossProfitUserQuotaPerc:void 0,grossProfitAncestorQuotaPerc:void 0,grossProfitBonusQuotaPerc:void 0,grossProfitPlatformQuotaPerc:void 0,divideIntoPerc:void 0,orderUserSocialStatus:void 0,orderAncestorSocialStatus:void 0,registerSocialStatus:void 0,registerAncestorSocialStatus:void 0,collectSocialStatus:void 0,signInSocialStatus:void 0,signInSocialStatusMax:void 0,consumptionMagnification:void 0,firstTopUpConsumption:void 0,followUpConsumption:void 0,withdrawCommission:void 0,withdrawConsumption:void 0,userTopUpConsumptionPoints:void 0,triggerMagnificationPoints:void 0}),M=S(()=>Number(e.value.grossProfitUserQuotaPerc)+Number(e.value.grossProfitAncestorQuotaPerc)+Number(e.value.grossProfitBonusQuotaPerc)+Number(e.value.grossProfitPlatformQuotaPerc)),k=S(()=>M.value>100),B=S(()=>Number(e.value.withdrawCommission)+Number(e.value.withdrawConsumption)),F=S(()=>B.value!==100),N=q({}),b=P();O({open:async(u,t)=>{if(f.value=!0,v.value=u,j(),t){p.value=!0;try{e.value=await _.getOrderPercentage(t)}finally{p.value=!1}Q.forEach(n=>{e.value.hasOwnProperty(n)&&(e.value[n]=100*e.value[n])})}}});const Q=["grossProfitPerc","grossProfitUserQuotaPerc","grossProfitAncestorQuotaPerc","grossProfitBonusQuotaPerc","grossProfitPlatformQuotaPerc","divideIntoPerc","consumptionMagnification","withdrawCommission","withdrawConsumption"],T=x,z=async()=>{if(k.value)V.error("\u7528\u6237\u81EA\u5F97+\u76F4\u63A8\u5956+\u5408\u8D62\u5956+\u5E73\u53F0\u670D\u52A1\u8D39,\u603B\u548C\u4E0D\u80FD\u8D85\u8FC7100%");else if(F.value)V.error("\u63D0\u73B0\u4F63\u91D1+\u63D0\u73B0\u6D88\u8D39\u91D1\u989D,\u603B\u548C\u5FC5\u987B\u4E3A100%");else{Q.forEach(u=>{e.value.hasOwnProperty(u)&&(e.value[u]=(e.value[u]/100).toFixed(4))}),await b.value.validate(),p.value=!0;try{const u=e.value;v.value==="create"?(await _.createOrderPercentage(u),V.success(y("common.createSuccess"))):(await _.updateOrderPercentage(u),V.success(y("common.updateSuccess"))),f.value=!1,T("success")}finally{p.value=!1}}},j=()=>{var u;e.value={id:void 0,grossProfitPerc:void 0,grossProfitUserQuotaPerc:void 0,grossProfitAncestorQuotaPerc:void 0,grossProfitBonusQuotaPerc:void 0,grossProfitPlatformQuotaPerc:void 0,divideIntoPerc:void 0},(u=b.value)==null||u.resetFields()};return(u,t)=>{const n=re,s=K,i=L,D=X,E=Y,J=oe,R=$;return g(),C(J,{title:a(I),modelValue:a(f),"onUpdate:modelValue":t[18]||(t[18]=l=>H(f)?f.value=l:null)},{footer:r(()=>[o(E,{onClick:z,type:"primary",disabled:a(p)},{default:r(()=>[c("\u786E \u5B9A")]),_:1},8,["disabled"])]),default:r(()=>[G((g(),C(D,{ref_key:"formRef",ref:b,model:a(e),rules:a(N),"label-width":"200px"},{default:r(()=>[a(v)=="update1"?(g(),w(h,{key:0},[o(i,{label:"\u6BDB\u5229\u767E\u5206\u6BD4",prop:"grossProfitPerc"},{label:r(()=>[o(n,{message:"\u4F8B(0.3888)",title:"\u6BDB\u5229"})]),default:r(()=>[o(s,{modelValue:a(e).grossProfitPerc,"onUpdate:modelValue":t[0]||(t[0]=l=>a(e).grossProfitPerc=l),placeholder:"\u8BF7\u8F93\u5165\u6BDB\u5229\u767E\u5206\u6BD4"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u7528\u6237\u81EA\u5F97",prop:"grossProfitUserQuotaPerc"},{label:r(()=>[o(n,{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(()=>[o(s,{modelValue:a(e).grossProfitUserQuotaPerc,"onUpdate:modelValue":t[1]||(t[1]=l=>a(e).grossProfitUserQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u81EA\u5F97"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u76F4\u63A8\u5956",prop:"grossProfitAncestorQuotaPerc"},{label:r(()=>[o(n,{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(()=>[o(s,{modelValue:a(e).grossProfitAncestorQuotaPerc,"onUpdate:modelValue":t[2]||(t[2]=l=>a(e).grossProfitAncestorQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u76F4\u63A8\u5956"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u5408\u8D62\u5956",prop:"grossProfitBonusQuotaPerc"},{label:r(()=>[o(n,{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(()=>[o(s,{modelValue:a(e).grossProfitBonusQuotaPerc,"onUpdate:modelValue":t[3]||(t[3]=l=>a(e).grossProfitBonusQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u5408\u8D62\u5956"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u5E73\u53F0\u670D\u52A1\u8D39",prop:"grossProfitPlatformQuotaPerc"},{label:r(()=>[o(n,{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(()=>[o(s,{modelValue:a(e).grossProfitPlatformQuotaPerc,"onUpdate:modelValue":t[4]||(t[4]=l=>a(e).grossProfitPlatformQuotaPerc=l),placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u670D\u52A1\u8D39"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u5206\u6210",prop:"divideIntoPerc"},{default:r(()=>[o(s,{modelValue:a(e).divideIntoPerc,"onUpdate:modelValue":t[5]||(t[5]=l=>a(e).divideIntoPerc=l),placeholder:"\u8BF7\u8F93\u5165\u5206\u6210"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1})],64)):a(v)=="withdraw"?(g(),w(h,{key:1},[o(i,{label:"\u63D0\u73B0\u6BD4\u4F8B",prop:"withdrawCommission"},{label:r(()=>[o(n,{message:"\u4F8B80%,\u63D0\u73B0\u6BD4\u4F8B+\u6D88\u8D39\u5206\u6BD4\u4F8B\u5FC5\u987B\u7B49\u4E8E100%",title:"\u63D0\u73B0\u6BD4\u4F8B"})]),default:r(()=>[o(s,{modelValue:a(e).withdrawCommission,"onUpdate:modelValue":t[6]||(t[6]=l=>a(e).withdrawCommission=l),placeholder:"\u8BF7\u8F93\u5165\u63D0\u73B0\u6BD4\u4F8B"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u6D88\u8D39\u5206\u6BD4\u4F8B",prop:"withdrawConsumption"},{label:r(()=>[o(n,{message:"\u4F8B20%,\u63D0\u73B0\u6BD4\u4F8B+\u6D88\u8D39\u5206\u6BD4\u4F8B\u5FC5\u987B\u7B49\u4E8E100%",title:"\u6D88\u8D39\u5206\u6BD4\u4F8B"})]),default:r(()=>[o(s,{modelValue:a(e).withdrawConsumption,"onUpdate:modelValue":t[7]||(t[7]=l=>a(e).withdrawConsumption=l),placeholder:"\u8BF7\u8F93\u5165\u6D88\u8D39\u5206\u6BD4\u4F8B"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1})],64)):a(v)=="update2"?(g(),w(h,{key:2},[o(i,{label:"\u8D2D\u7269\u81EA\u5F97",prop:"orderUserSocialStatus"},{default:r(()=>[o(s,{modelValue:a(e).orderUserSocialStatus,"onUpdate:modelValue":t[8]||(t[8]=l=>a(e).orderUserSocialStatus=l),placeholder:"\u8BF7\u8F93\u5165\u8D2D\u7269\u81EA\u5F97"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u8D2D\u7269\u63A8\u8350\u4EBA\u83B7\u5F97",prop:"orderAncestorSocialStatus"},{default:r(()=>[o(s,{modelValue:a(e).orderAncestorSocialStatus,"onUpdate:modelValue":t[9]||(t[9]=l=>a(e).orderAncestorSocialStatus=l),placeholder:"\u8BF7\u8F93\u5165\u8D2D\u7269\u63A8\u8350\u4EBA\u83B7\u5F97"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u6CE8\u518C\u9ED8\u8BA4\u8EAB\u4EF7",prop:"registerSocialStatus"},{default:r(()=>[o(s,{modelValue:a(e).registerSocialStatus,"onUpdate:modelValue":t[10]||(t[10]=l=>a(e).registerSocialStatus=l),placeholder:"\u8BF7\u8F93\u5165\u6CE8\u518C\u9ED8\u8BA4\u8EAB\u4EF7"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u63A8\u8350\u6CE8\u518C\u8EAB\u4EF7",prop:"registerAncestorSocialStatus"},{default:r(()=>[o(s,{modelValue:a(e).registerAncestorSocialStatus,"onUpdate:modelValue":t[11]||(t[11]=l=>a(e).registerAncestorSocialStatus=l),placeholder:"\u8BF7\u8F93\u5165\u63A8\u8350\u6CE8\u518C\u8EAB\u4EF7"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u6536\u85CF\u83B7\u5F97",prop:"collectSocialStatus"},{default:r(()=>[o(s,{modelValue:a(e).collectSocialStatus,"onUpdate:modelValue":t[12]||(t[12]=l=>a(e).collectSocialStatus=l),placeholder:"\u8BF7\u8F93\u5165\u6536\u85CF\u83B7\u5F97"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u7B7E\u5230\u83B7\u5F97",prop:"signInsocialstatus"},{default:r(()=>[o(s,{modelValue:a(e).signInSocialStatus,"onUpdate:modelValue":t[13]||(t[13]=l=>a(e).signInSocialStatus=l),placeholder:"\u8BF7\u8F93\u5165\u7B7E\u5230\u83B7\u5F97"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u7B7E\u5230\u53EF\u83B7\u5F97\u6700\u5927\u8EAB\u4EF7\u503C",prop:"signInsocialstatusMax"},{default:r(()=>[o(s,{modelValue:a(e).signInSocialStatusMax,"onUpdate:modelValue":t[14]||(t[14]=l=>a(e).signInSocialStatusMax=l),placeholder:"\u8BF7\u8F93\u5165\u7B7E\u5230\u83B7\u5F97"},null,8,["modelValue"])]),_:1})],64)):(g(),w(h,{key:3},[o(i,{label:"\u5145\u503C\u500D\u7387",prop:"consumptionMagnification"},{default:r(()=>[o(s,{modelValue:a(e).consumptionMagnification,"onUpdate:modelValue":t[15]||(t[15]=l=>a(e).consumptionMagnification=l),placeholder:"\u8BF7\u8F93\u5165\u5145\u503C\u500D\u7387"},{append:r(()=>[c("%")]),_:1},8,["modelValue"])]),_:1}),o(i,{label:"\u89E6\u53D1\u500D\u7387\u7684\u6700\u4F4E\u91D1\u989D",prop:"triggerMagnificationPoints"},{default:r(()=>[o(s,{modelValue:a(e).triggerMagnificationPoints,"onUpdate:modelValue":t[16]||(t[16]=l=>a(e).triggerMagnificationPoints=l),placeholder:"\u8BF7\u8F93\u5165\u89E6\u53D1\u500D\u7387\u7684\u6700\u4F4E\u91D1\u989D"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u7528\u6237\u5355\u6B21\u6700\u4F4E\u5145\u503C\u91D1\u989D",prop:"userTopUpConsumptionPoints"},{default:r(()=>[o(s,{modelValue:a(e).userTopUpConsumptionPoints,"onUpdate:modelValue":t[17]||(t[17]=l=>a(e).userTopUpConsumptionPoints=l),placeholder:"\u7528\u6237\u5355\u6B21\u6700\u4F4E\u5145\u503C\u91D1\u989D"},null,8,["modelValue"])]),_:1})],64))]),_:1},8,["model","rules"])),[[R,a(p)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/distri/orderpercentage/OrderPercentageForm.vue"]]),A=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}))});export{U as O,de as __tla,_ as a,A as b};