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