import{u as R}from"./useInstance.233fbdde.js";import{aa as r,d as V,a6 as q,s as C,r as D,b as S,p as G,c as p,e as v,k as L,i as a,h as o,u as s,a2 as x,m as g,E as P,_ as O}from"./index.0308b213.js";const H=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/list",params:e}),J=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/delete",method:"POST",data:e}),T=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/detail",params:e}),k=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/edit",method:"POST",data:e}),N=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/add",method:"POST",data:e}),K=()=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/getStores"}),Q=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/getGoodsList",params:e}),W=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/getGoodsCategoryList",params:e}),X=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/setMerchantNo",method:"POST",data:e}),Y=e=>r.request({url:"agent/plugin.purchasePriceRecord.purchase_price_record/submitBatch",method:"POST",data:e}),Z=e=>r.request({url:"agent/plugin.purchasePriceRecord.supplier_rebate_record/list",params:e}),ee=()=>r.request({url:"agent/plugin.purchasePriceRecord.supplier_rebate_record/getSupplierList"}),w=g("%"),M=g("\u63D0\u4EA4"),j=g("\u53D6\u6D88"),U=V({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(e,{emit:m}){const n=e;q();const{global:F}=R();let A=C(()=>Number(n.id)>0);const d=D(!1),h=D(),t=S({id:"",base_price:"",rebate_ratio:""}),B=()=>{t.id>0?k(t).then(u=>{P({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),c()}):N(t).then(u=>{P({message:"\u65B0\u589E\u6210\u529F",type:"success"}),c()})};G(()=>n.modelValue,u=>{d.value=u,u&&n.id&&(t.id=n.id,y())});const y=()=>{T({id:n.id}).then(u=>{u=u.data,t.base_price=u.base_price,t.rebate_ratio=u.rebate_ratio})},c=()=>{m("update:modelValue",!1),m("onClose"),F.$resetForm(h.value,t)};return(u,l)=>{const f=p("el-input"),_=p("el-form-item"),b=p("el-button"),E=p("el-dialog");return v(),L(E,{modelValue:d.value,"onUpdate:modelValue":l[2]||(l[2]=i=>d.value=i),title:s(A)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:c},{default:a(()=>[o(s(x),{ref_key:"formRef",ref:h,model:s(t),"inline-message":!0,"label-width":"160px"},{default:a(()=>[o(_,{label:"\u57FA\u7840\u91C7\u8D2D\u4EF7"},{default:a(()=>[o(f,{modelValue:s(t).base_price,"onUpdate:modelValue":l[0]||(l[0]=i=>s(t).base_price=i),type:"number",min:0,placeholder:"\u8BF7\u8F93\u5165\u57FA\u7840\u91C7\u8D2D\u4EF7"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u8FD4\u70B9\u6BD4\u4F8B"},{default:a(()=>[o(f,{modelValue:s(t).rebate_ratio,"onUpdate:modelValue":l[1]||(l[1]=i=>s(t).rebate_ratio=i),type:"number",min:0,placeholder:"\u8BF7\u8F93\u5165\u8FD4\u70B9\u6BD4\u4F8B"},{append:a(()=>[w]),_:1},8,["modelValue"])]),_:1}),o(_,null,{default:a(()=>[o(b,{type:"primary",onClick:B},{default:a(()=>[M]),_:1}),o(b,{onClick:c},{default:a(()=>[j]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});const I=O(U,[["__scopeId","data-v-8f66d5b2"]]),te=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"}));export{I as E,H as a,J as b,K as c,Q as d,X as e,Y as f,W as g,Z as h,ee as i,te as j};
