import{_ as S}from"./index.vue_vue_type_script_setup_true_lang.e7796e9d.js";import{d as N,r as F,b as j,b6 as L,p as P,c as n,e as _,f,g as d,h as a,i as t,u as s,F as g,j as w,k as R,t as q,H as z,R as O,S as G,_ as $}from"./index.0308b213.js";const H=i=>(O("data-v-b63798fd"),i=i(),G(),i),M={class:"pawn-form",style:{"min-width":"300px"}},A={class:"form-section"},J=H(()=>d("div",{class:"section-title"},"\u5F53\u7269\u4FE1\u606F",-1)),K={style:{"font-size":"14px",color:"#555","padding-right":"15px"}},Q={class:"image-container"},T=["onClick"],W={class:"modal-content"},X=["src"],Y=N({props:{formData:Object,classifyList:Object,is_code:Boolean,title:String,rate:Number},emits:["goodsForm"],setup(i,{expose:C,emit:y}){const r=i,x=F(),D=m=>{const o=r.classifyList.find(c=>c.id===m);e.classify_text=o.name},e=j({name:"",classify_text:"",classify_id:null,sku_text:"",num:0,valuation:100,pawn_fee:0,rate:.05,images:[],code:"",isChangeRate:0});L(()=>{r.formData&&(Object.assign(e,r.formData),console.log("form",e)),r.rate&&(e.rate=r.rate)}),P(e,m=>{e.pawn_fee=e.valuation*e.discount_rate,y("goodsForm",m)},{deep:!0});const b=F(!1),v=F(""),B=m=>{v.value=m,b.value=!0},k=()=>{b.value=!1};return C({form:e}),(m,o)=>{const c=n("el-input"),u=n("el-form-item"),h=n("el-option"),E=n("el-select"),p=n("el-input-number"),U=n("el-image"),I=n("el-form");return _(),f("div",M,[d("div",A,[J,a(I,{"label-position":"left","require-asterisk-position":"right",ref_key:"formRef",ref:x,model:s(e),disabled:r.title=="\u7EDD\u5F53\u8BB0\u5F55",size:"large"},{default:t(()=>[a(u,{label:"\u5F53\u54C1\u7F16\u53F7",class:"disabled"},{default:t(()=>[a(c,{class:"pawn-input",disabled:"",modelValue:s(e).goods_no,"onUpdate:modelValue":o[0]||(o[0]=l=>s(e).goods_no=l),placeholder:"\u8BF7\u8F93\u5165\u5F53\u54C1\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),a(u,{label:"\u5F53\u54C1\u540D\u79F0",class:"disabled"},{default:t(()=>[a(c,{class:"pawn-input",disabled:"",modelValue:s(e).name,"onUpdate:modelValue":o[1]||(o[1]=l=>s(e).name=l),placeholder:"\u8BF7\u8F93\u5165\u5F53\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(u,{label:"\u5F53\u54C1\u7C7B\u522B",class:"required"},{default:t(()=>[a(E,{class:"pawn-input required",modelValue:s(e).classify_id,"onUpdate:modelValue":o[2]||(o[2]=l=>s(e).classify_id=l),placeholder:"\u9009\u62E9\u5F53\u54C1\u7C7B\u522B",style:{width:"240px"},onChange:D},{default:t(()=>[(_(!0),f(g,null,w(i.classifyList,(l,V)=>(_(),R(h,{key:V,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(u,{label:"\u5355\u4F4D",class:"disabled"},{default:t(()=>[a(c,{class:"pawn-input",disabled:"",modelValue:s(e).sku_text,"onUpdate:modelValue":o[3]||(o[3]=l=>s(e).sku_text=l),controls:!1},null,8,["modelValue"])]),_:1}),a(u,{label:"\u6570\u91CF/\u91CD\u91CF",class:"disabled"},{default:t(()=>[a(p,{class:"pawn-input",disabled:"",modelValue:s(e).num,"onUpdate:modelValue":o[4]||(o[4]=l=>s(e).num=l),controls:!1},null,8,["modelValue"])]),_:1}),a(u,{label:"\u4F30\u4EF7",class:"disabled"},{default:t(()=>[a(p,{class:"pawn-input",disabled:"",modelValue:s(e).valuation,"onUpdate:modelValue":o[5]||(o[5]=l=>s(e).valuation=l),controls:!1},null,8,["modelValue"])]),_:1}),a(u,{label:"\u6298\u5F53\u7387",class:"disabled"},{default:t(()=>[a(p,{class:"pawn-input",disabled:"",modelValue:s(e).discount_rate,"onUpdate:modelValue":o[6]||(o[6]=l=>s(e).discount_rate=l),controls:!1},null,8,["modelValue"])]),_:1}),a(u,{label:"\u5178\u5F53\u91D1\u989D",class:"disabled"},{default:t(()=>[a(p,{class:"pawn-input",disabled:"",modelValue:s(e).pawn_fee,"onUpdate:modelValue":o[7]||(o[7]=l=>s(e).pawn_fee=l),controls:!1},null,8,["modelValue"])]),_:1}),a(u,{label:"\u8D39\u7387",class:"disabled"},{default:t(()=>[a(p,{class:"pawn-input",disabled:"",modelValue:s(e).rate,"onUpdate:modelValue":o[8]||(o[8]=l=>s(e).rate=l),controls:!1},null,8,["modelValue"])]),_:1}),a(u,{label:"\u624B\u7EED\u8D39",class:"disabled"},{default:t(()=>[d("div",K,q(Number(s(e).rate)*Number(s(e).pawn_fee)),1)]),_:1}),a(u,{class:"normal-item"},{default:t(()=>[a(S,{title:"\u56FE\u7247"},{default:t(()=>[d("div",Q,[(_(!0),f(g,null,w(s(e).images,(l,V)=>(_(),f("div",{class:"image-wrapper",onClick:Z=>B(l)},[a(U,{src:l,class:"image"},null,8,["src"])],8,T))),256))])]),_:1})]),_:1})]),_:1},8,["model","disabled"])]),d("div",{class:z(["image-modal",{visible:b.value}]),onClick:k},[d("div",W,[d("img",{src:v.value,alt:"Preview"},null,8,X)])],2)])}}});const ae=$(Y,[["__scopeId","data-v-b63798fd"]]);export{ae as default};
