OrderCalcForm-3a547811.js 5.2 KB

1
  1. import{aA as p,d as F,P as S,r as m,x as j,o as b,C,A as t,f as r,a as o,D as O,k as z,a2 as J,a9 as M,V as R,W as T,J as W,Z,_ as q,__tla as E}from"./index-54aa57d8.js";import{_ as G,__tla as H}from"./Dialog-7bb778a5.js";import{u as K,__tla as L}from"./useMessage-f56cafbb.js";let g,f,U,X=Promise.all([(()=>{try{return E}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return L}catch{}})()]).then(async()=>{f={getOrderCalcPage:async s=>await p.get({url:"/distri/order-calc/page",params:s}),getOrderCalc:async s=>await p.get({url:"/distri/order-calc/get?id="+s}),createOrderCalc:async s=>await p.post({url:"/distri/order-calc/create",data:s}),updateOrderCalc:async s=>await p.put({url:"/distri/order-calc/update",data:s}),deleteOrderCalc:async s=>await p.delete({url:"/distri/order-calc/delete?id="+s}),exportOrderCalc:async s=>await p.download({url:"/distri/order-calc/export-excel",params:s})},g=q(F({name:"OrderCalcForm",__name:"OrderCalcForm",emits:["success"],setup(s,{expose:h,emit:w}){const{t:v}=S(),P=K(),c=m(!1),V=m(""),n=m(!1),y=m(""),l=m({id:void 0,orderNo:void 0,userId:void 0,price:void 0,cost:void 0,grossProfit:void 0,grossProfitUserQuota:void 0,grossProfitAncestorQuota:void 0,grossProfitBonusQuota:void 0,grossProfitPlatformQuota:void 0}),x=j({}),_=m();h({open:async(d,e)=>{if(c.value=!0,V.value=v("action."+d),y.value=d,B(),e){n.value=!0;try{l.value=await f.getOrderCalc(e)}finally{n.value=!1}}}});const A=w,I=async()=>{await _.value.validate(),n.value=!0;try{const d=l.value;y.value==="create"?(await f.createOrderCalc(d),P.success(v("common.createSuccess"))):(await f.updateOrderCalc(d),P.success(v("common.updateSuccess"))),c.value=!1,A("success")}finally{n.value=!1}},B=()=>{var d;l.value={id:void 0,orderNo:void 0,userId:void 0,price:void 0,cost:void 0,grossProfit:void 0,grossProfitUserQuota:void 0,grossProfitAncestorQuota:void 0,grossProfitBonusQuota:void 0,grossProfitPlatformQuota:void 0},(d=_.value)==null||d.resetFields()};return(d,e)=>{const u=M,i=R,D=T,Q=W,N=G,k=Z;return b(),C(N,{title:o(V),modelValue:o(c),"onUpdate:modelValue":e[10]||(e[10]=a=>J(c)?c.value=a:null)},{footer:t(()=>[r(Q,{onClick:I,type:"primary",disabled:o(n)},{default:t(()=>[O("\u786E \u5B9A")]),_:1},8,["disabled"]),r(Q,{onClick:e[9]||(e[9]=a=>c.value=!1)},{default:t(()=>[O("\u53D6 \u6D88")]),_:1})]),default:t(()=>[z((b(),C(D,{ref_key:"formRef",ref:_,model:o(l),rules:o(x),"label-width":"100px"},{default:t(()=>[r(i,{label:"\u8BA2\u5355\u7F16\u53F7",prop:"orderNo"},{default:t(()=>[r(u,{modelValue:o(l).orderNo,"onUpdate:modelValue":e[0]||(e[0]=a=>o(l).orderNo=a),placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u7528\u6237ID",prop:"userId"},{default:t(()=>[r(u,{modelValue:o(l).userId,"onUpdate:modelValue":e[1]||(e[1]=a=>o(l).userId=a),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u552E\u4EF7",prop:"price"},{default:t(()=>[r(u,{modelValue:o(l).price,"onUpdate:modelValue":e[2]||(e[2]=a=>o(l).price=a),placeholder:"\u8BF7\u8F93\u5165\u552E\u4EF7"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u6210\u672C",prop:"cost"},{default:t(()=>[r(u,{modelValue:o(l).cost,"onUpdate:modelValue":e[3]||(e[3]=a=>o(l).cost=a),placeholder:"\u8BF7\u8F93\u5165\u6210\u672C"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u6BDB\u5229 = \u6210\u672C * 0.38... (\u63A8\u5E7F\u8D39\u7528)",prop:"grossProfit"},{default:t(()=>[r(u,{modelValue:o(l).grossProfit,"onUpdate:modelValue":e[4]||(e[4]=a=>o(l).grossProfit=a),placeholder:"\u8BF7\u8F93\u5165\u6BDB\u5229 = \u6210\u672C * 0.38... (\u63A8\u5E7F\u8D39\u7528)"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u63A8\u5E7F-\u7528\u6237\u989D\u5EA6",prop:"grossProfitUserQuota"},{default:t(()=>[r(u,{modelValue:o(l).grossProfitUserQuota,"onUpdate:modelValue":e[5]||(e[5]=a=>o(l).grossProfitUserQuota=a),placeholder:"\u8BF7\u8F93\u5165\u63A8\u5E7F-\u7528\u6237\u989D\u5EA6"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u63A8\u5E7F-\u63A8\u8350\u4EBA\u989D\u5EA6",prop:"grossProfitAncestorQuota"},{default:t(()=>[r(u,{modelValue:o(l).grossProfitAncestorQuota,"onUpdate:modelValue":e[6]||(e[6]=a=>o(l).grossProfitAncestorQuota=a),placeholder:"\u8BF7\u8F93\u5165\u63A8\u5E7F-\u63A8\u8350\u4EBA\u989D\u5EA6"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u63A8\u5E7F-\u5408\u8D62\u5956\u989D\u5EA6(\u6D6E\u52A8)",prop:"grossProfitBonusQuota"},{default:t(()=>[r(u,{modelValue:o(l).grossProfitBonusQuota,"onUpdate:modelValue":e[7]||(e[7]=a=>o(l).grossProfitBonusQuota=a),placeholder:"\u8BF7\u8F93\u5165\u63A8\u5E7F-\u5408\u8D62\u5956\u989D\u5EA6(\u6D6E\u52A8)"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u63A8\u5E7F-\u5E73\u53F0\u5206\u6210\u989D\u5EA6(\u6D6E\u52A8)",prop:"grossProfitPlatformQuota"},{default:t(()=>[r(u,{modelValue:o(l).grossProfitPlatformQuota,"onUpdate:modelValue":e[8]||(e[8]=a=>o(l).grossProfitPlatformQuota=a),placeholder:"\u8BF7\u8F93\u5165\u63A8\u5E7F-\u5E73\u53F0\u5206\u6210\u989D\u5EA6(\u6D6E\u52A8)"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[k,o(n)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/distri/ordercalc/OrderCalcForm.vue"]]),U=Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}))});export{g as O,X as __tla,f as a,U as b};