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