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