import{_ as S}from"./index.vue_vue_type_script_setup_true_lang.e7796e9d.js";import{d as j,r as g,b as L,b6 as P,p as R,c as n,e as m,f as _,g as i,h as o,i as t,u as l,F as V,j as C,k as q,t as z,H as N,R as O,S as G,_ as $}from"./index.0308b213.js";const A=d=>(O("data-v-a8bca498"),d=d(),G(),d),H={class:"pawn-form",style:{"min-width":"300px"}},M={class:"form-section"},J=A(()=>i("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=j({props:{formData:Object,classifyList:Object,is_code:Boolean,title:String,rate:Number},emits:["goodsForm"],setup(d,{expose:w,emit:y}){const p=d,k=g(),x=r=>{const a=p.classifyList.find(c=>c.id===r);e.classify_text=a.name},e=L({name:"",classify_text:"",classify_id:null,sku_text:"",num:0,valuation:100,pawn_fee:0,rate:.05,images:[],code:"",isChangeRate:0,sale_price:0,profit_fee:0});P(()=>{p.formData&&Object.assign(e,p.formData)}),R(e,r=>{if(e.sale_price){let a=0;e.origin==="\u5178\u5F53"?a=e.pawn_fee||0:e.origin==="\u95E8\u5E97"?a=e.stock_fee||0:e.origin==="\u6536\u8D27"&&(a=e.receiving_fee||0),e.profit_fee=e.sale_price-a}else e.profit_fee=0;y("goodsForm",r)},{deep:!0,immediate:!0});const f=g(!1),F=g(""),E=r=>{F.value=r,f.value=!0},B=()=>{f.value=!1};return w({form:e}),(r,a)=>{const c=n("el-input"),u=n("el-form-item"),h=n("el-option"),D=n("el-select"),b=n("el-input-number"),U=n("el-image"),I=n("el-form");return m(),_("div",H,[i("div",M,[J,o(I,{"label-position":"left","require-asterisk-position":"right",ref_key:"formRef",ref:k,model:l(e),disabled:p.title=="\u9500\u552E\u8BB0\u5F55",size:"large"},{default:t(()=>[o(u,{label:"\u5546\u54C1\u7F16\u53F7",class:"disabled"},{default:t(()=>[o(c,{class:"pawn-input",modelValue:l(e).goods_no,"onUpdate:modelValue":a[0]||(a[0]=s=>l(e).goods_no=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5546\u54C1\u540D\u79F0",class:"disabled"},{default:t(()=>[o(c,{class:"pawn-input",modelValue:l(e).name,"onUpdate:modelValue":a[1]||(a[1]=s=>l(e).name=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5546\u54C1\u6765\u6E90",class:"disabled"},{default:t(()=>[o(c,{class:"pawn-input",modelValue:l(e).origin,"onUpdate:modelValue":a[2]||(a[2]=s=>l(e).origin=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6765\u6E90"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5F53\u54C1\u7C7B\u522B",class:"required"},{default:t(()=>[o(D,{class:"pawn-input required",modelValue:l(e).classify_id,"onUpdate:modelValue":a[3]||(a[3]=s=>l(e).classify_id=s),placeholder:"\u9009\u62E9\u5F53\u54C1\u7C7B\u522B",style:{width:"240px"},onChange:x},{default:t(()=>[(m(!0),_(V,null,C(d.classifyList,(s,v)=>(m(),q(h,{key:v,label:s.name,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u6570\u91CF/\u91CD\u91CF",class:"disabled"},{default:t(()=>[o(b,{class:"pawn-input",disabled:"",modelValue:l(e).num,"onUpdate:modelValue":a[4]||(a[4]=s=>l(e).num=s),controls:!1},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5355\u4F4D",class:"disabled"},{default:t(()=>[o(c,{class:"pawn-input",disabled:"",modelValue:l(e).sku_text,"onUpdate:modelValue":a[5]||(a[5]=s=>l(e).sku_text=s),controls:!1},null,8,["modelValue"])]),_:1}),o(u,{label:"\u6210\u672C\u4EF7",class:"disabled"},{default:t(()=>[i("div",K,z(l(e).origin=="\u5178\u5F53"?l(e).pawn_fee:l(e).origin=="\u95E8\u5E97"?l(e).stock_fee:l(e).origin=="\u6536\u8D27"?l(e).receiving_fee:"0.00"),1)]),_:1}),o(u,{label:"\u9500\u552E\u4EF7"},{default:t(()=>[o(b,{class:"pawn-input",modelValue:l(e).sale_price,"onUpdate:modelValue":a[6]||(a[6]=s=>l(e).sale_price=s),controls:!1},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5229\u6DA6",class:"disabled"},{default:t(()=>[o(b,{class:"pawn-input",disabled:"",modelValue:l(e).profit_fee,"onUpdate:modelValue":a[7]||(a[7]=s=>l(e).profit_fee=s),controls:!1},null,8,["modelValue"])]),_:1}),o(u,{class:"normal-item disabled"},{default:t(()=>[o(S,{title:"\u56FE\u7247"},{default:t(()=>[i("div",Q,[(m(!0),_(V,null,C(l(e).images,(s,v)=>(m(),_("div",{class:"image-wrapper",onClick:Z=>E(s)},[o(U,{src:s,class:"image"},null,8,["src"])],8,T))),256))])]),_:1})]),_:1})]),_:1},8,["model","disabled"])]),i("div",{class:N(["image-modal",{visible:f.value}]),onClick:B},[i("div",W,[i("img",{src:F.value,alt:"Preview"},null,8,X)])],2)])}}});const ae=$(Y,[["__scopeId","data-v-a8bca498"]]);export{ae as default};
