import{G as $e,H as Oe,x as Le,y as Re,U as Pe,k as ue,w as Se,M as Ie,b as Te,N as Me,L as Ye,C as ze,F as je,I as Ne,J as Ge,K as qe,D as Ke,O as He}from"./element-plus.a63a26dd.js";import{_ as Je}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.e3a0bbf9.js";import{_ as Qe}from"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import{c as Ze}from"./purchase_product_offer.47752baf.js";import{b as We,c as Xe,d as el,e as se}from"./beforehand_order_cart_info.c3720953.js";import{e as ll,f as ol,g as tl}from"./beforehand_order.b74d20f4.js";import{u as al}from"./usePaging.6a6670f9.js";import{u as ul}from"./vue-router.101084e3.js";import{f as sl,h as nl}from"./index.f6b01d13.js";import{_ as dl}from"./editProduct.vue_vue_type_script_setup_true_name_warehouseOrderEdit_lang.31327c5b.js";import{e as rl}from"./delivery_service.a6020776.js";import{_ as il}from"./goodsOffer.vue_vue_type_script_setup_true_name_subOrder_lang.ffb3065c.js";import{_ as pl}from"./warehousing.vue_vue_type_script_setup_true_name_subOrder_lang.9d921297.js";import{_ as _l}from"./outbound.vue_vue_type_script_setup_true_name_subOrder_lang.2298bf37.js";import{a as ml}from"./system_store.0ebd35e8.js";import{d as ne,s as cl,r,Z as fl,ap as vl,o as p,c as f,U as l,L as t,a as s,S as y,u as a,R as m,j as w,T as $,a9 as S,K as F,M as j,Q as I,n as hl}from"./@vue.18505fe0.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.4884cfc2.js";import"./axios.932d3f8a.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./useDictOptions.9851f478.js";import"./store_product.cda57076.js";import"./store_branch_product.81680c31.js";import"./warehouse_product_storege.44bc818a.js";import"./lodash.2473fc51.js";import"./pinia.a969beab.js";import"./css-color-function.9f6a56f3.js";import"./color.d1bc3784.js";import"./clone.83700f2e.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.fcc9be76.js";import"./vue-clipboard3.9e751565.js";import"./clipboard.dda64e67.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.a21e3cda.js";import"./warehouse.e115257c.js";import"./supplier.b7935d3b.js";import"./warehouse_order.260c4a01.js";const bl={class:"flex items-center justify-between m-4"},yl={class:"flex flex-col"},Fl=s("div",{style:{color:"gray"}},"\u5355\u53F7\uFF1A",-1),Cl={style:{color:"black"}},El={class:"flex flex-col"},gl=s("div",{style:{color:"gray"}},"\u652F\u4ED8\u5355\u53F7\uFF1A",-1),Dl={style:{color:"black"}},kl={class:"flex flex-col"},Vl=s("div",{style:{color:"gray"}},"\u95E8\u5E97\uFF1A",-1),wl={style:{color:"black"}},xl={class:"flex items-center justify-between m-4"},Bl={class:"flex flex-col"},Al=s("div",{style:{color:"gray"}},"\u5907\u6CE8\uFF1A",-1),Ul={style:{color:"black"}},$l={class:"flex items-center justify-between m-4"},Ol={class:"flex flex-col"},Ll=s("div",{style:{color:"gray"}},"\u603B\u4EF7",-1),Rl={style:{color:"black"}},Pl={class:"flex flex-col flex-2"},Sl=s("div",{style:{color:"gray"}},"\u65F6\u95F4",-1),Il={style:{color:"black"}},Tl={class:"flex items-center"},Ml={key:0},Yl={key:1},zl={key:0},jl={key:1},Nl={key:0,class:"flex mt-4 justify-end"},Gl={class:"mb-2"},ql={class:"dialog-footer"},Kl={class:"dialog-footer"},Hl={class:"dialog-footer"},Jl=ne({name:"storeOrderDETAILS"}),et=ne({...Jl,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ql,{expose:de,emit:Zl}){const T=cl(),M=r(!1),D=r(!1),x=r(!1),N=r(null),G=r(null),q=r(null),re=ul(),ie=u=>{var o,n,A;u=="offer"&&((o=N.value)==null||o.getList(i.value.id)),u=="warehousing"&&((n=G.value)==null||n.getList(i.value.id,i.value.warehousing_id)),u=="outbound"&&((A=q.value)==null||A.getList(i.value.id,i.value))},pe=r(!1),k=r(!1),Y=r("second"),K=r(0),H=r(0),_e=r(0),i=r({id:"",code:"",total_price:"",supplier_name:"",warehouse_name:"",system_store:"",financial_pm:"",order_sn:"",warehousing_id:"",top_cate:[]}),v=r({id:"",user_id:"",pay_type:"",store_id:""}),c=r({order_id:"",product_id:"",need_num:"",unit:"",is_buyer:"",buyer_id:"",mark:""}),me=()=>{Ze(c.value).then(u=>{b(),D.value=!1})},ce=()=>{const u=C.value.map(o=>({id:o.id,nums:o.num||0,purchase:o.purchases||0,prices:o.purchase||0,total_price:o.total_price||0,manufacture:o.manufacture,expiration_date:o.expiration_date}));We({id:h.bhoid,product_arr:u}).then(o=>{console.log(o),k.value=!1,b()})},h=fl({bhoid:re.query.id,pay_type:"",top_cate:"",top_cate_value:""});(()=>{ll({id:h.bhoid}).then(u=>{i.value={...u},K.value=u.warehouse_id,v.value.id=u.id,u.financial_pm==0?H.value=1:_e.value=1,C.value=[],b()})})();const fe=u=>{ol({id:u}).then(o=>{window.open(o.url,"_blank"),ue.success("\u5BFC\u51FA\u6210\u529F")})},B=r(!1),C=r([]),ve=u=>{C.value=C.value.filter(o=>o.id!==u)},he=u=>{u.forEach(o=>{C.value.find(n=>n.id==o.id)||C.value.push(o)}),B.value=!1};function J(u){u.total_price=u.num*u.purchases}const Q=r([]),be=()=>{rl({type:3}).then(u=>{Q.value=u.lists})},Z=(u,o)=>{u==1?(c.value.order_id=o.bhoid,c.value.product_id=o.product_id,c.value.unit=o.unit,c.value.need_num=o.cart_num,c.value.mark=o.mark,c.value.is_buyer="1",be(),D.value=!0):Xe({id:o.id}).then(()=>{b()})},ye=async u=>{var o,n;M.value=!0,await hl(),(o=T.value)==null||o.open("edit"),(n=T.value)==null||n.setFormData(u)},Fe=async u=>{await sl.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await el({id:u}),b()},Ce=()=>{pe.value=!0},{pager:E,getLists:b,resetParams:Xl,resetPage:eo}=al({fetchFun:se,params:h}),O=r(!1),W=r([]),Ee=(u="")=>{O.value=!0,nl({nickname:u,page_size:10}).then(o=>{W.value=o.lists,setTimeout(()=>{O.value=!1},300)}).catch(o=>{setTimeout(()=>{O.value=!1},300)})},X=r([]),ge=()=>{x.value=!0,ml({page_no:1,page_size:100}).then(u=>{X.value=u.lists})},De=()=>{tl(v.value).then(u=>{})},ke=()=>{se({export:2,bhoid:i.value.id}).then(u=>{window.open(u.url,"_blank"),ue.success("\u5BFC\u51FA\u6210\u529F")})},ee=u=>{u.id==0?(h.top_cate="",h.top_cate_value="\u5168\u90E8",b()):(h.top_cate=u.id,h.top_cate_value=u.name,b())};return de({open:Ce}),(u,o)=>{const n=Se,A=$e,Ve=Oe,d=Ie,le=Te,oe=Me,we=Qe,L=Le,xe=Re,Be=Ye,U=ze,te=Pe,z=je,R=Ne,Ae=Je,g=Ge,P=qe,V=Ke,ae=vl("perms"),Ue=He;return p(),f($,null,[l(Be,null,{default:t(()=>[s("div",bl,[s("div",yl,[Fl,s("div",Cl,y(a(i).order_id),1)]),s("div",El,[gl,s("div",Dl,y(a(i).order_sn),1)]),s("div",kl,[Vl,s("div",wl,y(a(i).system_store),1)])]),s("div",xl,[s("div",Bl,[Al,s("div",Ul,y(a(i).mark),1)])]),s("div",$l,[s("div",Ol,[Ll,s("div",Rl,"\uFFE5"+y(a(i).total_price),1)]),s("div",Pl,[Sl,s("div",Il,y(a(i).create_time),1)]),l(n,{onClick:o[0]||(o[0]=e=>fe(a(i).id))},{default:t(()=>[m(" \u6253\u5370\u5546\u54C1\u6807\u7B7E ")]),_:1}),l(n,{onClick:ge},{default:t(()=>[m(" \u751F\u6210\u5546\u54C1\u8BA2\u5355 ")]),_:1})]),l(n,{type:"primary",onClick:o[1]||(o[1]=e=>k.value=!0)},{default:t(()=>[m(" \u8FFD\u52A0 ")]),_:1}),l(xe,{modelValue:a(Y),"onUpdate:modelValue":o[5]||(o[5]=e=>w(Y)?Y.value=e:null),class:"demo-tabs mt-3",type:"border-card",onTabChange:ie},{default:t(()=>[l(L,{label:"\u660E\u7EC6",name:"second"},{default:t(()=>[l(n,{type:"primary",onClick:ke},{default:t(()=>[m("\u5BFC\u51FA\u8868\u683C ")]),_:1}),l(Ve,{modelValue:a(h).top_cate_value,"onUpdate:modelValue":o[3]||(o[3]=e=>a(h).top_cate_value=e),style:{"margin-left":"30px"}},{default:t(()=>[l(A,{value:0,label:"\u5168\u90E8",onChange:o[2]||(o[2]=e=>ee({name:"\u5168\u90E8",id:0}))}),(p(!0),f($,null,S(a(i).top_cate,e=>(p(),F(A,{value:e.id,label:e.name,key:e.id,onChange:_=>ee(e)},null,8,["value","label","onChange"]))),128))]),_:1},8,["modelValue"]),s("div",null,[s("div",null,[j((p(),F(oe,{data:a(E).lists},{default:t(()=>[l(d,{label:"id",prop:"id","show-overflow-tooltip":""}),l(d,{label:"\u5546\u54C1\u4FE1\u606F",prop:"store_name","show-overflow-tooltip":""},{default:t(({row:e})=>[s("div",Tl,[l(le,{src:e.image,class:"w-16 h-16 mr-2","preview-teleported":!0},null,8,["src"]),s("div",null,y(e.store_name),1)])]),_:1}),l(d,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),l(d,{label:"\u4ED3\u5E93\u5E93\u5B58",prop:"warehouse_stock","show-overflow-tooltip":""}),l(d,{label:"\u9700\u8981\u6570\u91CF",prop:"cart_num","show-overflow-tooltip":""}),l(d,{label:"\u96F6\u552E\u4EF7",prop:"price","show-overflow-tooltip":""}),l(d,{label:"\u5408\u8BA1",prop:"total_price","show-overflow-tooltip":""}),l(d,{label:"\u662F\u5426\u9700\u91C7\u8D2D",prop:"is_buyer","show-overflow-tooltip":"",width:"100"},{default:t(({row:e})=>[e.is_buyer==0?(p(),f("div",Ml,[l(n,{type:"danger",round:"",size:"small",onClick:_=>Z(-1,e)},{default:t(()=>[m("\u5426")]),_:2},1032,["onClick"]),l(n,{type:"success",round:"",size:"small",onClick:_=>Z(1,e)},{default:t(()=>[m("\u662F")]),_:2},1032,["onClick"])])):(p(),f("div",Yl,[e.is_buyer==1?(p(),f("span",zl,y(e.status_name),1)):I("",!0),e.is_buyer==-1?(p(),f("span",jl,"\u65E0\u9700\u91C7\u8D2D")):I("",!0)]))]),_:1}),l(d,{label:"\u5907\u6CE8",prop:"mark","show-overflow-tooltip":""}),l(d,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:e})=>[j((p(),F(n,{type:"primary",link:"",onClick:_=>ye(e)},{default:t(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[ae,["beforehand_order_cart_info.beforehand_order_cart_info/edit"]]]),j((p(),F(n,{type:"danger",link:"",onClick:_=>Fe(e.id)},{default:t(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[ae,["beforehand_order_cart_info.beforehand_order_cart_info/delete"]]])]),_:1})]),_:1},8,["data"])),[[Ue,a(E).loading]])]),a(E).lists.lengthw(E)?E.value=e:null),onChange:a(b)},null,8,["modelValue","onChange"])])):I("",!0)])]),_:1}),l(L,{label:"\u91C7\u8D2D",name:"offer"},{default:t(()=>[l(il,{ref_key:"goodsOfferRef",ref:N,order_id:a(i).id},null,8,["order_id"])]),_:1}),l(L,{label:"\u5165\u5E93",name:"warehousing"},{default:t(()=>[l(pl,{ref_key:"warehousingRef",ref:G,order_id:a(i).id},null,8,["order_id"])]),_:1}),l(L,{label:"\u51FA\u5E93",name:"outbound"},{default:t(()=>[l(_l,{ref_key:"outboundRef",ref:q,order_id:a(i).id},null,8,["order_id"])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(R,{modelValue:a(k),"onUpdate:modelValue":o[8]||(o[8]=e=>w(k)?k.value=e:null),title:"\u8FFD\u52A0\u5546\u54C1",width:"1200"},{footer:t(()=>[s("div",ql,[l(n,{onClick:o[7]||(o[7]=e=>k.value=!1)},{default:t(()=>[m("\u53D6\u6D88")]),_:1}),l(n,{type:"primary",onClick:ce},{default:t(()=>[m(" \u786E\u8BA4 ")]),_:1})])]),default:t(()=>[l(z,{ref:"formRef",model:u.updateInfo,"label-width":"90px"},{default:t(()=>[s("div",Gl,[l(n,{type:"primary",onClick:o[6]||(o[6]=e=>B.value=!0)},{default:t(()=>[m("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),l(oe,{data:a(C)},{default:t(()=>[l(d,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),l(d,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:t(({row:e})=>[l(le,{style:{width:"50px",height:"50px"},src:e.image,"preview-teleported":!0},null,8,["src"])]),_:1}),l(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"180","show-overflow-tooltip":""}),l(d,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"80","show-overflow-tooltip":""}),l(d,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),l(d,{label:"\u6570\u91CF","min-width":"150"},{default:t(({row:e})=>[l(U,{modelValue:e.num,"onUpdate:modelValue":_=>e.num=_,onChange:_=>J(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),l(d,{label:"\u4EF7\u683C","min-width":"150"},{default:t(({row:e})=>[l(U,{modelValue:e.purchases,"onUpdate:modelValue":_=>e.purchases=_,onChange:_=>J(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),l(d,{label:"\u603B\u4EF7","min-width":"150"},{default:t(({row:e})=>[l(U,{modelValue:e.total_price,"onUpdate:modelValue":_=>e.total_price=_},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(d,{label:"\u751F\u4EA7\u65E5\u671F","min-width":"140"},{default:t(({row:e})=>[l(te,{readonly:!1,class:"flex-1 !flex",modelValue:e.manufacture,"onUpdate:modelValue":_=>e.manufacture=_,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u751F\u4EA7\u65E5\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(d,{label:"\u4FDD\u8D28\u671F","min-width":"140"},{default:t(({row:e})=>[l(te,{readonly:!1,class:"flex-1 !flex",modelValue:e.expiration_date,"onUpdate:modelValue":_=>e.expiration_date=_,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u4FDD\u8D28\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(d,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:e})=>[l(n,{type:"danger",link:"",onClick:_=>ve(e.id)},{default:t(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1},8,["model"])]),_:1},8,["modelValue"]),l(R,{modelValue:a(B),"onUpdate:modelValue":o[9]||(o[9]=e=>w(B)?B.value=e:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:t(()=>[l(Ae,{onOnBindStore:he,warehouse_id:a(K),is_warehouse:a(H)},null,8,["warehouse_id","is_warehouse"])]),_:1},8,["modelValue"]),a(M)?(p(),F(dl,{key:0,ref_key:"editRef",ref:T,onSuccess:a(b),onClose:o[10]||(o[10]=e=>M.value=!1)},null,8,["onSuccess"])):I("",!0),l(R,{modelValue:a(D),"onUpdate:modelValue":o[15]||(o[15]=e=>w(D)?D.value=e:null),title:"\u8BBE\u7F6E\u91C7\u8D2D",width:"600"},{footer:t(()=>[s("div",Kl,[l(n,{onClick:o[14]||(o[14]=e=>D.value=!1)},{default:t(()=>[m("\u53D6\u6D88")]),_:1}),l(n,{type:"primary",onClick:me},{default:t(()=>[m(" \u786E\u8BA4 ")]),_:1})])]),default:t(()=>[l(z,{ref:"formRef",model:a(c),"label-width":"90px"},{default:t(()=>[l(V,{label:"\u91C7\u8D2D\u4EBA\u5458"},{default:t(()=>[l(P,{modelValue:a(c).buyer_id,"onUpdate:modelValue":o[11]||(o[11]=e=>a(c).buyer_id=e),placeholder:"\u8BF7\u9009\u62E9\u91C7\u8D2D\u4EBA\u5458",size:"large",style:{width:"240px"}},{default:t(()=>[(p(!0),f($,null,S(a(Q),e=>(p(),F(g,{label:e.nickname,value:e.uid},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1}),l(V,{label:"\u91C7\u8D2D\u6570\u91CF",prop:"need_num"},{default:t(()=>[l(U,{modelValue:a(c).need_num,"onUpdate:modelValue":o[12]||(o[12]=e=>a(c).need_num=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u6570\u91CF",readonly:!1},null,8,["modelValue"])]),_:1}),l(V,{label:"\u5907\u6CE8",prop:"mark"},{default:t(()=>[l(U,{modelValue:a(c).mark,"onUpdate:modelValue":o[13]||(o[13]=e=>a(c).mark=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),l(R,{modelValue:a(x),"onUpdate:modelValue":o[20]||(o[20]=e=>w(x)?x.value=e:null),title:"\u751F\u6210\u652F\u4ED8\u8BA2\u5355\u8BBE\u7F6E",width:"600"},{footer:t(()=>[s("div",Hl,[l(n,{onClick:o[19]||(o[19]=e=>x.value=!1)},{default:t(()=>[m("\u53D6\u6D88")]),_:1}),l(n,{type:"primary",onClick:De},{default:t(()=>[m(" \u786E\u8BA4 ")]),_:1})])]),default:t(()=>[l(z,{model:a(v),"label-width":"90px"},{default:t(()=>[l(V,{label:"\u7528\u6237"},{default:t(()=>[l(P,{modelValue:a(v).user_id,"onUpdate:modelValue":o[16]||(o[16]=e=>a(v).user_id=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u7528\u6237\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":Ee,loading:a(O),style:{width:"240px"}},{default:t(()=>[(p(!0),f($,null,S(a(W),e=>(p(),F(g,{key:e.id,label:`${e.real_name}|${e.mobile} (ID:${e.id})`,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),l(V,{label:"\u95E8\u5E97",prop:"store_id"},{default:t(()=>[l(P,{modelValue:a(v).store_id,"onUpdate:modelValue":o[17]||(o[17]=e=>a(v).store_id=e),placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",size:"large",style:{width:"240px"}},{default:t(()=>[(p(!0),f($,null,S(a(X),e=>(p(),F(g,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(V,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type"},{default:t(()=>[l(P,{modelValue:a(v).pay_type,"onUpdate:modelValue":o[18]||(o[18]=e=>a(v).pay_type=e),placeholder:"\u8BF7\u9009\u62E9\u652F\u4ED8\u65B9\u5F0F",size:"large",style:{width:"240px"}},{default:t(()=>[l(g,{label:"\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u652F\u4ED8",value:"7"}),l(g,{label:"\u91C7\u8D2D\u6B3E\u652F\u4ED8",value:"18"}),l(g,{label:"\u4F59\u989D\u652F\u4ED8",value:"3"}),l(g,{label:"\u73B0\u91D1\u652F\u4ED8",value:"17"})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])],64)}}});export{et as default};