import{k as ve,C as ee,D as le,w as oe,F as ue,M as te,b as ae,N as re,O as ne,G as Ce,H as ye,J as he,K as De,L as Fe,I as we}from"./element-plus.7e347b00.js";import{_ as pe}from"./index.vue_vue_type_script_setup_true_lang.af250dfd.js";import{d as R,Z as de,r as y,o as v,c as x,U as e,L as o,u as t,aa as Z,R as d,M as se,a as D,j as $,i as Ve,T as O,a9 as Q,K as L,Q as Be}from"./@vue.18505fe0.js";import{u as ie}from"./usePaging.6a6670f9.js";import{c as me,a as Ee,f as ge}from"./purchase_product_offer.b662b482.js";import{a as ke}from"./supplier.0023f3c8.js";import{e as xe}from"./delivery_service.bb55829c.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.9f7dd589.js";import"./lodash.4e6d2a38.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const Ue={class:"mt-4"},Pe={class:"flex mt-4 justify-end"},Se=R({name:"systemStoreLists"}),Ae=R({...Se,emits:["onBindStore"],setup(_e,{emit:F}){const f=de({buyer_confirm:0}),_=y([]),a=w=>{_.value=w.map(({id:s})=>s)},g=()=>{U()},{pager:h,getLists:U,resetParams:T,resetPage:M}=ie({fetchFun:me,params:f});U();const B=F,P=()=>{const w=h.lists.filter(s=>_.value.includes(s.id));if(!w.length)return ve.error("\u8BF7\u5148\u9009\u62E9\u5546\u54C1");B("onBindStore",w)};return(w,s)=>{const V=ee,I=le,S=oe,q=ue,p=te,j=ae,E=re,k=pe,G=ne;return v(),x("div",null,[e(q,{class:"mb-[-16px]",model:t(f),inline:""},{default:o(()=>[e(I,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:o(()=>[e(V,{class:"w-[200px]",modelValue:t(f).store_name,"onUpdate:modelValue":s[0]||(s[0]=c=>t(f).store_name=c),onKeydown:s[1]||(s[1]=Z(c=>g(),["enter"])),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(I,null,{default:o(()=>[e(S,{type:"primary",onClick:t(M)},{default:o(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(S,{onClick:t(T)},{default:o(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),se((v(),x("div",Ue,[e(E,{data:t(h).lists,onSelectionChange:a,height:300},{default:o(()=>[e(p,{type:"selection",width:"55"}),e(p,{label:"id",prop:"id","show-overflow-tooltip":""}),e(p,{label:"\u8BA2\u5355id",prop:"order_id","show-overflow-tooltip":""}),e(p,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),e(p,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:c})=>[e(j,{style:{width:"50px",height:"50px"},src:c.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(p,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),e(p,{label:"\u5206\u7C7B",prop:"cate_name","show-overflow-tooltip":""}),e(p,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(p,{label:"\u4F9B\u5E94\u5546",prop:"supplier_name","show-overflow-tooltip":""}),e(p,{label:"\u9700\u6C42\u6570\u91CF",prop:"need_num","show-overflow-tooltip":""}),e(p,{label:"\u91C7\u8D2D\u6570\u91CF",prop:"buyer_nums","show-overflow-tooltip":""}),e(p,{label:"\u91C7\u8D2D\u4EF7",prop:"price","show-overflow-tooltip":""}),e(p,{label:"\u91C7\u8D2D\u603B\u4EF7",prop:"total_price","show-overflow-tooltip":""}),e(p,{label:"\u91C7\u8D2D\u4EBA\u5458",prop:"buyer_name","show-overflow-tooltip":""}),e(p,{label:"\u91C7\u8D2D\u72B6\u6001",prop:"buyer_confirm_name","show-overflow-tooltip":""})]),_:1},8,["data"])])),[[G,t(h).loading]]),D("div",Pe,[e(k,{modelValue:t(h),"onUpdate:modelValue":s[2]||(s[2]=c=>$(h)?h.value=c:null),onChange:t(U)},null,8,["modelValue","onChange"])]),e(S,{class:"w-full mt-4",type:"primary",onClick:P},{default:o(()=>[d("\u6DFB\u52A0\u5546\u54C1")]),_:1})])}}}),Le={class:"flex items-center mr-4"},$e={class:"mt-4"},Ie={class:"flex mt-4 justify-end"},qe={class:"dialog-footer"},Ke={class:"flex-1 w-full"},Ne={class:"mb-2"},Oe={class:"dialog-footer"},Re=R({name:"storeProductLists"}),gl=R({...Re,setup(_e){const F=y(!1),f=y(!1),_=de({buyer_id:"",order_id:"",store_name:"",buyer_confirm:""}),a=y({id:"",bhoid:0,supplier_id:"",purchase:0,outbound_price:0,total_price:0,buyer_nums:0,package:"",store_info:"",marques:"",after_sales:"",pay_type:1}),g=y({supplier_id:""}),h=()=>{a.value.total_price=(a.value.buyer_nums*a.value.purchase).toFixed(2)},U=r=>{a.value.id=r.id,a.value.bhoid=r.order_id,a.value.buyer_nums=r.need_num,a.value.purchase=r.price,a.value.total_price=r.total_price,a.value.package=r.package,a.value.store_info=r.store_info,a.value.marques=r.marques,a.value.after_sales=r.after_sales,F.value=!0},T=()=>{Ee(a.value).then(r=>{F.value=!1,k()})},M=()=>{const r=V.value.map(u=>({id:u.id,buyer_nums:u.buyer_nums,purchase:u.purchase,total_price:u.total_price,pay_type:u.pay_type}));ge({supplier_id:g.value.supplier_id,product_arr:r}).then(u=>{f.value=!1,k()})},B=y(!1),P=y([]),w=(r="")=>{B.value=!0,ke({mer_name:r}).then(u=>{P.value=u.lists,setTimeout(()=>{B.value=!1},300)}).catch(u=>{setTimeout(()=>{B.value=!1},300)})},s=y(!1),V=y([]),I=r=>{V.value=V.value.filter(u=>u.id!==r)},S=r=>{r.forEach(u=>{V.value.find(m=>m.id==u.id)||V.value.push(u)}),s.value=!1};function q(r){r.buyer_nums>0&&r.purchase>0&&(r.total_price=(r.buyer_nums*r.purchase).toFixed(2))}const p=y([]),j=()=>{xe({type:3}).then(r=>{p.value=r.lists})},{pager:E,getLists:k,resetParams:G,resetPage:c}=ie({fetchFun:me,params:_});return Ve(()=>{k(),j()}),(r,u)=>{const m=ee,i=le,A=he,K=De,C=oe,H=ue,z=Fe,n=te,W=ae,X=re,fe=pe,N=Ce,Y=ye,J=we,ce=Ae,be=ne;return v(),x(O,null,[D("div",null,[e(z,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[e(H,{class:"mb-[-16px]",model:t(_),inline:""},{default:o(()=>[e(i,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:o(()=>[e(m,{class:"w-[280px]",modelValue:t(_).store_name,"onUpdate:modelValue":u[0]||(u[0]=l=>t(_).store_name=l),onKeydown:Z(t(c),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue","onKeydown"])]),_:1}),e(i,{label:"\u8BA2\u5355id",prop:"order_id"},{default:o(()=>[e(m,{class:"w-[280px]",modelValue:t(_).order_id,"onUpdate:modelValue":u[1]||(u[1]=l=>t(_).order_id=l),onKeydown:Z(t(c),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355id"},null,8,["modelValue","onKeydown"])]),_:1}),e(i,{label:"\u91C7\u8D2D\u4EBA\u5458",prop:"buyer_id"},{default:o(()=>[D("div",Le,[e(K,{modelValue:t(_).buyer_id,"onUpdate:modelValue":u[2]||(u[2]=l=>t(_).buyer_id=l),placeholder:"\u9009\u62E9\u9009\u62E9\u91C7\u8D2D\u4EBA\u5458",style:{width:"240px"},onChange:t(c)},{default:o(()=>[(v(!0),x(O,null,Q(t(p),l=>(v(),L(A,{key:l.uid,label:l.nickname,value:l.uid},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])])]),_:1}),e(i,{label:"\u91C7\u8D2D\u72B6\u6001"},{default:o(()=>[e(K,{modelValue:t(_).buyer_confirm,"onUpdate:modelValue":u[3]||(u[3]=l=>t(_).buyer_confirm=l),placeholder:"\u8BF7\u9009\u62E9\u91C7\u8D2D\u72B6\u6001",style:{width:"240px"}},{default:o(()=>[e(A,{label:"\u91C7\u8D2D\u5B8C\u6210",value:"1"}),e(A,{label:"\u672A\u5B8C\u6210",value:"0"})]),_:1},8,["modelValue"])]),_:1}),e(i,null,{default:o(()=>[e(C,{type:"primary",onClick:t(c)},{default:o(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(C,{onClick:t(G)},{default:o(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),se((v(),L(z,{class:"!border-none",shadow:"never"},{default:o(()=>[e(C,{type:"primary",onClick:u[4]||(u[4]=l=>f.value=!0)},{default:o(()=>[d(" \u6279\u91CF\u91C7\u8D2D\u4FE1\u606F\u8BBE\u7F6E ")]),_:1}),D("div",$e,[e(X,{data:t(E).lists},{default:o(()=>[e(n,{type:"selection",width:"55"}),e(n,{label:"id",prop:"id","show-overflow-tooltip":""}),e(n,{label:"\u8BA2\u5355id",prop:"order_id","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:l})=>[e(W,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),e(n,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(n,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(n,{label:"\u4F9B\u5E94\u5546",prop:"supplier_name","show-overflow-tooltip":""}),e(n,{label:"\u9700\u6C42\u6570\u91CF",prop:"need_num","show-overflow-tooltip":""}),e(n,{label:"\u91C7\u8D2D\u6570\u91CF",prop:"buyer_nums","show-overflow-tooltip":""}),e(n,{label:"\u91C7\u8D2D\u4EF7",prop:"price","show-overflow-tooltip":""}),e(n,{label:"\u91C7\u8D2D\u603B\u4EF7",prop:"total_price","show-overflow-tooltip":""}),e(n,{label:"\u91C7\u8D2D\u4EBA\u5458",prop:"buyer_name","show-overflow-tooltip":""}),e(n,{label:"\u91C7\u8D2D\u72B6\u6001",prop:"buyer_confirm_name","show-overflow-tooltip":""}),e(n,{label:"\u662F\u5426\u5165\u5E93",prop:"is_storage_name","show-overflow-tooltip":""}),e(n,{label:"\u64CD\u4F5C",fixed:"right"},{default:o(({row:l})=>[l.is_storage==0?(v(),L(C,{key:0,type:"primary",link:"",onClick:b=>U(l)},{default:o(()=>[d("\u8BBE\u7F6E\u91C7\u8D2D\u4FE1\u606F")]),_:2},1032,["onClick"])):Be("",!0)]),_:1})]),_:1},8,["data"])]),D("div",Ie,[e(fe,{modelValue:t(E),"onUpdate:modelValue":u[5]||(u[5]=l=>$(E)?E.value=l:null),onChange:t(k)},null,8,["modelValue","onChange"])])]),_:1})),[[be,t(E).loading]])]),e(J,{modelValue:t(F),"onUpdate:modelValue":u[16]||(u[16]=l=>$(F)?F.value=l:null),title:"\u91C7\u8D2D\u4FE1\u606F\u8BBE\u7F6E",width:"600"},{footer:o(()=>[D("div",qe,[e(C,{onClick:u[15]||(u[15]=l=>F.value=!1)},{default:o(()=>[d("\u53D6\u6D88")]),_:1}),e(C,{type:"primary",onClick:T},{default:o(()=>[d(" \u786E\u8BA4 ")]),_:1})])]),default:o(()=>[e(H,{ref:"formRef",model:t(a),"label-width":"90px"},{default:o(()=>[e(i,{label:"\u4F9B\u5E94\u5546"},{default:o(()=>[e(K,{modelValue:t(a).supplier_id,"onUpdate:modelValue":u[6]||(u[6]=l=>t(a).supplier_id=l),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u4F9B\u5E94\u5546\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":w,loading:t(B),style:{width:"240px"}},{default:o(()=>[(v(!0),x(O,null,Q(t(P),l=>(v(),L(A,{key:l.id,label:l.mer_name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),e(i,{label:"\u6570\u91CF",prop:"buyer_nums"},{default:o(()=>[e(m,{modelValue:t(a).buyer_nums,"onUpdate:modelValue":u[7]||(u[7]=l=>t(a).buyer_nums=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u6570\u91CF",readonly:!1,onChange:h},null,8,["modelValue"])]),_:1}),e(i,{label:"\u91C7\u8D2D\u4EF7",prop:"purchase"},{default:o(()=>[e(m,{modelValue:t(a).purchase,"onUpdate:modelValue":u[8]||(u[8]=l=>t(a).purchase=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u4EF7",readonly:!1,onChange:h},null,8,["modelValue"])]),_:1}),e(i,{label:"\u91C7\u8D2D\u603B\u4EF7",prop:"total_price"},{default:o(()=>[e(m,{modelValue:t(a).total_price,"onUpdate:modelValue":u[9]||(u[9]=l=>t(a).total_price=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u603B\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),e(i,{label:"\u4ED8\u6B3E\u65B9\u5F0F",prop:"pay_type"},{default:o(()=>[e(Y,{modelValue:t(a).pay_type,"onUpdate:modelValue":u[10]||(u[10]=l=>t(a).pay_type=l)},{default:o(()=>[e(N,{label:1},{default:o(()=>[d("\u8D4A\u8D26")]),_:1}),e(N,{label:2},{default:o(()=>[d("\u73B0\u91D1")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(i,{label:"\u5305\u88C5",prop:"package"},{default:o(()=>[e(m,{modelValue:t(a).package,"onUpdate:modelValue":u[11]||(u[11]=l=>t(a).package=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5305\u88C5",readonly:!1},null,8,["modelValue"])]),_:1}),e(i,{label:"\u89C4\u683C",prop:"store_info"},{default:o(()=>[e(m,{modelValue:t(a).store_info,"onUpdate:modelValue":u[12]||(u[12]=l=>t(a).store_info=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u683C",readonly:!1},null,8,["modelValue"])]),_:1}),e(i,{label:"\u578B\u53F7",prop:"marques"},{default:o(()=>[e(m,{modelValue:t(a).marques,"onUpdate:modelValue":u[13]||(u[13]=l=>t(a).marques=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u578B\u53F7",readonly:!1},null,8,["modelValue"])]),_:1}),e(i,{label:"\u552E\u540E",prop:"after_sales"},{default:o(()=>[e(m,{modelValue:t(a).after_sales,"onUpdate:modelValue":u[14]||(u[14]=l=>t(a).after_sales=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u552E\u540E",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),e(J,{modelValue:t(f),"onUpdate:modelValue":u[20]||(u[20]=l=>$(f)?f.value=l:null),title:"\u6279\u91CF\u91C7\u8D2D\u4FE1\u606F\u8BBE\u7F6E",width:"1200"},{footer:o(()=>[D("div",Oe,[e(C,{onClick:u[19]||(u[19]=l=>f.value=!1)},{default:o(()=>[d("\u53D6\u6D88")]),_:1}),e(C,{type:"primary",onClick:M},{default:o(()=>[d(" \u786E\u8BA4 ")]),_:1})])]),default:o(()=>[e(H,{ref:"formRef",model:t(g)},{default:o(()=>[e(i,{label:"\u4F9B\u5E94\u5546"},{default:o(()=>[e(K,{modelValue:t(g).supplier_id,"onUpdate:modelValue":u[17]||(u[17]=l=>t(g).supplier_id=l),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u4F9B\u5E94\u5546\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":w,loading:t(B),style:{width:"240px"}},{default:o(()=>[(v(!0),x(O,null,Q(t(P),l=>(v(),L(A,{key:l.id,label:l.mer_name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),e(i,{label:"\u5546\u54C1",prop:"store_id"},{default:o(()=>[D("div",Ke,[D("div",Ne,[e(C,{type:"primary",onClick:u[18]||(u[18]=l=>s.value=!0)},{default:o(()=>[d("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(X,{data:t(V)},{default:o(()=>[e(n,{label:"id",prop:"id","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:l})=>[e(W,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),e(n,{label:"\u6570\u91CF"},{default:o(({row:l})=>[e(m,{modelValue:l.buyer_nums,"onUpdate:modelValue":b=>l.buyer_nums=b,onChange:b=>q(l)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(n,{label:"\u91C7\u8D2D\u4EF7"},{default:o(({row:l})=>[e(m,{modelValue:l.purchase,"onUpdate:modelValue":b=>l.purchase=b,onChange:b=>q(l)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(n,{label:"\u91C7\u8D2D\u603B\u4EF7"},{default:o(({row:l})=>[e(m,{modelValue:l.total_price,"onUpdate:modelValue":b=>l.total_price=b},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(n,{label:"\u652F\u4ED8\u7C7B\u578B",width:"180"},{default:o(({row:l})=>[e(Y,{modelValue:l.pay_type,"onUpdate:modelValue":b=>l.pay_type=b},{default:o(()=>[e(N,{label:1},{default:o(()=>[d("\u8D4A\u8D26")]),_:1}),e(N,{label:2},{default:o(()=>[d("\u73B0\u91D1")]),_:1})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1}),e(n,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:l})=>[e(C,{type:"danger",link:"",onClick:b=>I(l.id)},{default:o(()=>[d(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),e(J,{modelValue:t(s),"onUpdate:modelValue":u[21]||(u[21]=l=>$(s)?s.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:o(()=>[e(ce,{onOnBindStore:S})]),_:1},8,["modelValue"])],64)}}});export{gl as default};