import{_ as P,d as T,bs as O,b0 as g,w as R,ag as h,z as S,r as i,aC as I,o as E,G as v,C as l,j as e,M as d,l as r,bS as L,h as C,H as Q,L as U,aq as G,aN as H}from"./index.js";import{P as J}from"./platform-query.44bd7119.js";import{f as K,g as W}from"./index.3c9dc929.js";const X={class:"flex w-full justify-end"},Y={class:"w-full flex justify-end",span:6},Z=T({__name:"productModal",props:{visible:{type:Boolean,required:!0},item:{type:null,required:!0},index:{type:Number,required:!0}},emits:["refresh"],setup(p,{emit:y}){const a=p,m=O(a,"visible"),{run:F,data:V,loading:x}=g({initialData:[],isList:!0}),{run:D,loading:B}=g({success(){m.value=!1,y("refresh",a.index)}}),f=R([]),b=h(()=>{const{can:o}=a.item||{},t={id:"",label:""};return!o||!Array.isArray(o)||o.length!==3||(t.id=o[o.length-1].id,t.label=o.map(({name:s})=>s).join("-")),t}),z=h(()=>({buy_num:a.item.num,cat_id:b.value.id,companyNo:a.item.companyNo,platform_code:a.item.platform,price:a.item.budget_price,page:1,size:1e3})),k=()=>F(K(z.value));function A(){if(f.value.length===0){H.warning("\u81F3\u5C11\u9009\u62E9\u4E00\u6761\u4E0A\u7EBF\u5546\u54C1");return}const o=f.value.map(({skuCode:s})=>s),t={pgNo:a.item.pgNo,spuCode:o,source:"1"};D(W(t))}return S(()=>[a.item,a.visible],([o,t])=>{!o||!t||k()}),(o,t)=>{const s=i("ElInput"),n=i("ElCol"),_=i("ElButton"),w=i("ElRow"),u=i("ElTableColumn"),N=i("ElTable"),j=i("ElDialog"),M=I("loading");return E(),v(j,{modelValue:r(m),"onUpdate:modelValue":t[1]||(t[1]=c=>G(m)?m.value=c:null),title:"\u9009\u62E9\u5DF2\u4E0A\u7EBF\u7684\u5546\u54C1",center:"",top:"20px"},{default:l(()=>[e(w,{class:"mb-[10px]",gutter:10},{default:l(()=>[e(n,{span:8},{default:l(()=>[e(s,{size:"small",disabled:"",modelValue:p.item.num},{prepend:l(()=>[d("\u8D77\u8BA2\u91CF:")]),_:1},8,["modelValue"])]),_:1}),e(n,{span:8},{default:l(()=>[e(r(L),{size:"small",modelValue:p.item.companyNo,disabled:"",placeholder:"\u4E1A\u52A1\u516C\u53F8"},null,8,["modelValue"])]),_:1}),e(n,{span:8},{default:l(()=>[C("div",X,[e(_,{type:"warning",size:"small"},{default:l(()=>[d("\u91CD\u7F6E")]),_:1}),e(_,{type:"primary",size:"small"},{default:l(()=>[d("\u641C\u7D22")]),_:1})])]),_:1})]),_:1}),e(w,{gutter:10},{default:l(()=>[e(n,{span:6},{default:l(()=>[e(s,{size:"small",disabled:"",modelValue:p.item.budget_price},{prepend:l(()=>[d("\u552E\u4EF7 \u2264")]),_:1},8,["modelValue"])]),_:1}),e(n,{span:6},{default:l(()=>[e(r(J),{modelValue:p.item.platform,size:"small",disabled:""},null,8,["modelValue"])]),_:1}),e(n,{span:6},{default:l(()=>[e(s,{modelValue:r(b).label,size:"small",disabled:""},null,8,["modelValue"])]),_:1}),e(n,{span:6},{default:l(()=>[C("div",Y,[e(_,{type:"success",size:"small",onClick:A,loading:r(B)},{default:l(()=>[d("\u6DFB\u52A0")]),_:1},8,["loading"])])]),_:1})]),_:1}),Q((E(),v(N,{border:"",size:"small",class:"mt-[10px]","max-height":"400px",data:r(V),onSelectionChange:t[0]||(t[0]=c=>f.value=c)},{default:l(()=>[e(u,{type:"selection",fixed:"left"}),e(u,{prop:"skuCode",label:"\u5546\u54C1\u7F16\u7801",width:"160","show-overflow-tooltip":""}),e(u,{prop:"good_name",label:"\u5546\u54C1\u540D\u79F0","min-width":"120","show-overflow-tooltip":""}),e(u,{prop:"cat_name",label:"\u5546\u54C1\u5206\u7C7B","min-width":"130","show-overflow-tooltip":""},{default:l(({row:c})=>[d(U(c.cat_info.map(({name:q})=>q).join("-")),1)]),_:1}),e(u,{prop:"stock_total",label:"\u53EF\u7528\u5E93\u5B58","min-width":"90px","show-overflow-tooltip":""}),e(u,{prop:"unit",label:"\u5355\u4F4D",width:"45","show-overflow-tooltip":""}),e(u,{prop:"brand_name",label:"\u54C1\u724C","min-width":"145","show-overflow-tooltip":""}),e(u,{prop:"sale_price",label:"\u552E\u4EF7",width:"110","show-overflow-tooltip":""})]),_:1},8,["data"])),[[M,r(x)]])]),_:1},8,["modelValue"])}}});var te=P(Z,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/sellOut/project/components/productModal.vue"]]);export{te as default};
