import z from"./SupplierListDialog.7532e2c1.js";import{g as P}from"./index.31ffd861.js";import{a as U}from"./index.01a74280.js";import{g as N,x as q}from"./merchant.9d35eb14.js";import{A as M}from"./index.1d26a072.js";import{d as j,a6 as G,r as d,b as h,p as O,c as s,e as S,f as V,u as a,h as t,i as n,A as R,g as i,F as T,m as x,_ as $}from"./index.0308b213.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const H={key:0,class:"filter-form"},J=x("\u67E5\u8BE2"),K={class:"data"},Q={class:"logo"},W=["src"],X={class:"table-operation-btn"},Y=x("\u9009\u62E9\u4F9B\u5E94\u5546"),Z={class:"bottom"},ee={class:"pagination"},te=j({setup(le){const{OpPlatform:_}=G();let g=d(!1);const l=h({page:1,limit:10,agentid:"",keyword:""}),F=h({page:1,limit:10}),c=h({list:[],count:0}),m=()=>{g.value=!0,_.value=="shangpu"&&N(l).then(u=>{c.list=u.list,c.count=u.count,g.value=!1})};m();const C=()=>{l.page=1,m()};O(()=>[l.page,l.limit],()=>{m()});const f=d([]),b=d([]),y=u=>{g.value=!0,_.value=="shangpu"?P(F).then(e=>{f.value=e.list}):U(F).then(e=>{f.value=e.list})},v=d(!1);let E=d(null);const B=u=>{b.value=u.supplier_ids,console.log("defaultSelectedIds",b.value),y(u.agentid),v.value=!0,E.value=u},k=u=>{const e=E.value.id;q({sid:e,supplier_ids:u}).then(()=>{console.log("\u4F9B\u5E94\u5546\u5DF2\u6210\u529F\u4FDD\u5B58\u5230\u6570\u636E\u5E93",e,u)}).catch(r=>{console.error("\u4FDD\u5B58\u4F9B\u5E94\u5546\u5230\u6570\u636E\u5E93\u5931\u8D25:",r)}),m()};return(u,e)=>{const r=s("el-form-item"),w=s("el-input"),D=s("el-button"),L=s("el-form"),p=s("el-table-column"),A=s("el-table"),I=s("el-pagination");return S(),V(T,null,[a(_)==="shangpu"?(S(),V("div",H,[t(L,{model:a(l),"label-width":"90px"},{default:n(()=>[t(r,{class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:n(()=>[t(a(M),{modelValue:a(l).agentid,"onUpdate:modelValue":e[0]||(e[0]=o=>a(l).agentid=o)},null,8,["modelValue"])]),_:1}),t(r,{class:"tn-el-form-item",label:"\u5546\u6237\u540D\u79F0"},{default:n(()=>[t(w,{modelValue:a(l).keyword,"onUpdate:modelValue":e[1]||(e[1]=o=>a(l).keyword=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u540D\u79F0",clearable:""},null,8,["modelValue"])]),_:1}),t(r,null,{default:n(()=>[t(D,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:C},{default:n(()=>[J]),_:1})]),_:1})]),_:1},8,["model"])])):R("",!0),i("div",K,[t(A,{data:a(c).list,style:{width:"100%"}},{default:n(()=>[t(p,{prop:"id",label:"\u5546\u6237ID",align:"center"}),t(p,{label:"\u95E8\u5E97logo",align:"center"},{default:n(o=>[i("div",Q,[i("div",null,[i("img",{src:o.row.logo},null,8,W)])])]),_:1}),t(p,{prop:"title",label:"\u5546\u6237\u540D\u79F0",align:"center"}),t(p,{label:"\u6240\u5C5E\u4EE3\u7406",prop:"agentid_title",align:"center"}),t(p,{fixed:"right",label:"\u64CD\u4F5C",width:"350px",align:"center"},{default:n(o=>[i("div",X,[t(D,{class:"tn-button tn-button--blue--light",onClick:oe=>B(o.row)},{default:n(()=>[Y]),_:2},1032,["onClick"])])]),_:1})]),_:1},8,["data"])]),i("div",Z,[i("div",ee,[t(I,{currentPage:a(l).page,"onUpdate:currentPage":e[2]||(e[2]=o=>a(l).page=o),"page-size":a(l).limit,"onUpdate:page-size":e[3]||(e[3]=o=>a(l).limit=o),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:a(c).count},null,8,["currentPage","page-size","total"])])]),t(z,{modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=o=>v.value=o),supplierList:f.value,defaultSelected:b.value,onSelectSupplier:k},null,8,["modelValue","supplierList","defaultSelected"])],64)}}});const me=$(te,[["__scopeId","data-v-bf0b80b6"]]);export{me as default};
