import{p as F}from"./index.50bf8544.js";import{_ as I,r as C,b as S,p as _,c as u,e as c,f as b,g as V,h as a,i as d,u as s,H as U,F as N,j as P,k as L,A as j,R as B,S as O}from"./index.0308b213.js";import"./pawnRequest.956aeb8a.js";const z=i=>(B("data-v-7d6aa68f"),i=i(),O(),i),A={class:"pawn-form",style:{"min-width":"300px"}},D={class:"form-section"},q=z(()=>V("div",{class:"section-title"},"\u9500\u552E\u4FE1\u606F",-1)),E={props:{goodsForms:Object,formData:Object,youLike:Object,is_code:Boolean,title:String},emits:["saleInfoForms"],setup(i,{emit:g}){const p=i,m=C();(()=>{F().then(r=>{m.value=r})})();const e=S({totalCost:"",totalSales:"",totalProfit:0,totalItems:"",itemCategory:"",salesperson:"",handler:"",partner:"",partner_id:null,remark:"",classify_text:"",create_time:"",other_fee:null}),v=r=>{const l=m.value.find(o=>o.id===r);e.partner=l.nickname,e.partner_id=l.id},x=r=>r.reduce((l,o)=>{let n=0;return o.origin==="\u5178\u5F53"?n=o.pawn_fee||0:o.origin==="\u95E8\u5E97"?n=o.stock_fee||0:o.origin==="\u6536\u8D27"&&(n=o.receiving_fee||0),l.totalCost+=n*(o.num||0),l.totalSales+=(o.sale_price||0)*(o.num||0),l.totalItems+=o.num||0,l},{totalCost:0,totalSales:0,totalItems:0});return _(()=>p.formData,r=>{Object.assign(e,r),e.profit_fee=Number((e.sale_fee-e.cost_fee).toFixed(2))-Number(e.other_fee)},{deep:!0,immediate:!0}),_(e,r=>{g("saleInfoForms",r)},{deep:!0}),_(()=>p.goodsForms,r=>{if(r!=null&&r.length&&p.title==="\u65B0\u589E\u9500\u552E"){const{totalCost:l,totalSales:o,totalItems:n}=x(r);e.cost_fee=Number(l.toFixed(2)),e.sale_fee=Number(o.toFixed(2)),e.profit_fee=Number((o-l).toFixed(2))-Number(e.other_fee),e.num=n}},{immediate:!0,deep:!0}),(r,l)=>{const o=u("el-input-number"),n=u("el-form-item"),f=u("el-input"),w=u("el-option"),k=u("el-select"),h=u("el-form");return c(),b("div",A,[V("div",D,[q,a(h,{model:s(e),"label-position":"left","require-asterisk-position":"right",size:"large"},{default:d(()=>[a(n,{label:"\u6210\u672C\u603B\u4EF7",class:"disabled"},{default:d(()=>[a(o,{class:"pawn-input disabled",disabled:"",modelValue:s(e).cost_fee,"onUpdate:modelValue":l[0]||(l[0]=t=>s(e).cost_fee=t),controls:!1,placeholder:"\u8BF7\u8F93\u5165\u6210\u672C\u603B\u4EF7"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u9500\u552E\u603B\u4EF7",class:"disabled"},{default:d(()=>[a(o,{class:"pawn-input disabled",disabled:"",modelValue:s(e).sale_fee,"onUpdate:modelValue":l[1]||(l[1]=t=>s(e).sale_fee=t),controls:!1,placeholder:"\u8BF7\u8F93\u5165\u9500\u552E\u603B\u4EF7"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u989D\u5916\u6210\u672C"},{default:d(()=>[a(o,{class:"pawn-input",modelValue:s(e).other_fee,"onUpdate:modelValue":l[2]||(l[2]=t=>s(e).other_fee=t),controls:!1,placeholder:"\u8BF7\u8F93\u5165\u989D\u5916\u6210\u672C"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u603B\u5229\u6DA6",class:"disabled"},{default:d(()=>[a(o,{class:"pawn-input disabled",disabled:"",modelValue:s(e).profit_fee,"onUpdate:modelValue":l[3]||(l[3]=t=>s(e).profit_fee=t),controls:!1},null,8,["modelValue"])]),_:1}),a(n,{label:"\u5546\u54C1\u603B\u6570",class:"disabled"},{default:d(()=>[a(o,{class:"pawn-input disabled",disabled:"",modelValue:s(e).num,"onUpdate:modelValue":l[4]||(l[4]=t=>s(e).num=t),controls:!1,placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u603B\u6570"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u5546\u54C1\u7C7B\u522B"},{default:d(()=>[a(f,{class:"pawn-input",modelValue:s(e).classify_text,"onUpdate:modelValue":l[5]||(l[5]=t=>s(e).classify_text=t),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u7C7B\u522B"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u9500\u552E\u4EBA"},{default:d(()=>[a(f,{class:"pawn-input",modelValue:s(e).salesperson,"onUpdate:modelValue":l[6]||(l[6]=t=>s(e).salesperson=t),placeholder:"\u8BF7\u8F93\u5165\u9500\u552E\u4EBA"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u7ECF\u624B\u4EBA"},{default:d(()=>[a(f,{class:"pawn-input",modelValue:s(e).handler,"onUpdate:modelValue":l[7]||(l[7]=t=>s(e).handler=t),placeholder:"\u8BF7\u8F93\u5165\u7ECF\u624B\u4EBA"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u5408\u4F19\u4EBA",class:U(p.title=="\u8D4E\u5F53\u8BB0\u5F55"?"disabled":"")},{default:d(()=>[a(k,{class:"pawn-input",modelValue:s(e).partner_id,"onUpdate:modelValue":l[8]||(l[8]=t=>s(e).partner_id=t),placeholder:"\u9009\u62E9\u5408\u4F19\u4EBA",onChange:v,clearable:"",filterable:""},{default:d(()=>[m.value?(c(!0),b(N,{key:0},P(m.value,(t,y)=>(c(),L(w,{key:y,label:t.nickname,value:t.id},null,8,["label","value"]))),128)):j("",!0)]),_:1},8,["modelValue"])]),_:1},8,["class"]),a(n,{label:"\u5907\u6CE8",style:{"border-bottom":"none"}}),a(n,{style:{"border-bottom":"none","padding-bottom":"10px"}},{default:d(()=>[a(f,{class:"pawn-textarea code",type:"textarea",modelValue:s(e).remark,"onUpdate:modelValue":l[9]||(l[9]=t=>s(e).remark=t),placeholder:"\u6DFB\u52A0\u5907\u6CE8\uFF08\u9009\u586B\uFF09"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])])}}},K=I(E,[["__scopeId","data-v-7d6aa68f"]]);export{K as default};
