import{N as U,O as A,C as S,K as P,w as N,g as G}from"./element-plus.8e273e86.js";import{a as L,b as O}from"./store_product_group_price.7cd8a583.js";import{d as h,r as y,o as d,K as f,L as u,c as T,T as j,a9 as I,u as F,a as s,S as g,R as i,U as o,j as K}from"./@vue.76ce7aa3.js";import"./lodash.41b9567d.js";const R={style:{display:"inline-block","margin-right":"20px"}},$={style:{display:"inline-block","margin-right":"20px"}},z={style:{display:"inline-block","margin-right":"20px"}},q={style:{display:"inline-block","margin-right":"20px"}},H={style:{display:"inline-block","margin-right":"20px"}},J=h({name:"storeProductGroupPriceDETAILS"}),w=h({...J,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(M,{expose:b,emit:V}){const E=V,n=y(!1);function c(e){e.base_rate>0&&e.purchase>0&&(e.price_type==1?e.price=(parseFloat(e.purchase)+parseFloat(e.base_rate)).toFixed(2):e.price_type==2?e.price=(parseFloat(e.purchase)-parseFloat(e.base_rate)).toFixed(2):e.price_type==3&&(e.price=(parseFloat(e.purchase)*parseFloat(e.base_rate)/100).toFixed(2)))}const p=y([]),_=async e=>{p.value=e},x=async e=>{const a=await L({product_id:e.id});_(a)},B=()=>{O(p.value).then(()=>{E("close")})};return b({open:()=>{n.value=!0},setFormData:_,getDetail:x}),(e,a)=>{const r=U,v=A,m=S,C=P,k=N,D=G;return d(),f(D,{modelValue:F(n),"onUpdate:modelValue":a[0]||(a[0]=t=>K(n)?n.value=t:null),title:"\u8BA2\u5355\u8BE6\u60C5",size:700},{default:u(()=>[(d(!0),T(j,null,I(F(p),t=>(d(),f(C,{class:"mb-3",key:t.id},{default:u(()=>[s("div",R,g(t.title)+":",1),s("div",$,"\u4F9B\u8D27\u4EF7:"+g(t.purchase),1),s("div",z,[a[1]||(a[1]=i(" \u8BA1\u7B97\u65B9\u5F0F: ")),o(v,{modelValue:t.price_type,"onUpdate:modelValue":l=>t.price_type=l,placeholder:"\u8BF7\u9009\u62E9\u8BA1\u7B97\u65B9\u5F0F",style:{width:"80px"},onChange:l=>c(t)},{default:u(()=>[o(r,{value:1,label:"\u52A0"}),o(r,{value:2,label:"\u51CF"}),o(r,{value:3,label:"\u4E58"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),s("div",q,[a[2]||(a[2]=i(" \u52A0\u4EF7\u503C:")),o(m,{modelValue:t.base_rate,"onUpdate:modelValue":l=>t.base_rate=l,style:{width:"80px"},onChange:l=>c(t)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),s("div",H,[a[3]||(a[3]=i(" \u552E\u4EF7:")),o(m,{modelValue:t.price,"onUpdate:modelValue":l=>t.price=l,style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])])]),_:2},1024))),128)),o(k,{type:"primary",onClick:B},{default:u(()=>a[4]||(a[4]=[i("\u786E\u5B9A")])),_:1})]),_:1},8,["modelValue"])}}});export{w as _};
