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 Ne,I as je,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.7a7ac716.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.4a63cc5a.js";import{b as We,c as Xe,d as el,e as ne}from"./beforehand_order_cart_info.5134d860.js";import{e as ll,f as ol,g as tl}from"./beforehand_order.3d53fdfd.js";import{u as al}from"./usePaging.6a6670f9.js";import{u as ul}from"./vue-router.101084e3.js";import{f as nl,h as dl}from"./index.8a627db9.js";import{_ as rl}from"./editProduct.vue_vue_type_script_setup_true_name_warehouseOrderEdit_lang.3018cd48.js";import{e as sl}from"./delivery_service.405ea7d3.js";import{_ as il}from"./goodsOffer.vue_vue_type_script_setup_true_name_subOrder_lang.83b1a75f.js";import{_ as pl}from"./warehousing.vue_vue_type_script_setup_true_name_subOrder_lang.e56250fd.js";import{_ as ml}from"./outbound.vue_vue_type_script_setup_true_name_subOrder_lang.01d1cf87.js";import{a as _l}from"./system_store.1fe99c9c.js";import{d as de,s as fl,r as d,Z as cl,ap as vl,o as i,c,U as l,L as t,a as s,S as A,u as a,R as m,j as k,T as $,a9 as S,K as y,M as N,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.cafcec20.js";import"./store_product.0bb06224.js";import"./store_branch_product.4bf8b9c9.js";import"./warehouse_product_storege.fe0678fb.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.0b423f94.js";import"./warehouse.aaa84702.js";import"./supplier.f9619dea.js";import"./warehouse_order.dda88a86.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 items-center justify-between m-4"},gl={class:"flex flex-col"},Dl=s("div",{style:{color:"gray"}},"\u603B\u4EF7",-1),Vl={style:{color:"black"}},kl={class:"flex flex-col flex-2"},wl=s("div",{style:{color:"gray"}},"\u65F6\u95F4",-1),Bl={style:{color:"black"}},xl={class:"flex items-center"},Ul={key:0},Al={key:1},$l={key:0},Ol={key:1},Ll={key:0,class:"flex mt-4 justify-end"},Rl={class:"mb-2"},Pl={class:"dialog-footer"},Sl={class:"dialog-footer"},Il={class:"dialog-footer"},Tl=de({name:"storeOrderDETAILS"}),jo=de({...Tl,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ml,{expose:re,emit:Yl}){const T=fl(),M=d(!1),g=d(!1),w=d(!1),j=d(null),G=d(null),q=d(null),se=ul(),ie=u=>{var o,n,x;u=="offer"&&((o=j.value)==null||o.getList(_.value.id)),u=="warehousing"&&((n=G.value)==null||n.getList(_.value.id)),u=="outbound"&&((x=q.value)==null||x.getList(_.value.id,_.value))},pe=d(!1),D=d(!1),Y=d("second"),K=d(0),H=d(0),me=d(0),_=d({id:"",code:"",total_price:"",supplier_name:"",warehouse_name:"",system_store:"",financial_pm:"",order_sn:"",top_cate:[]}),v=d({id:"",user_id:"",pay_type:"",store_id:""}),f=d({order_id:"",product_id:"",need_num:"",unit:"",is_buyer:"",buyer_id:"",mark:""}),_e=()=>{Ze(f.value).then(u=>{b(),g.value=!1})},fe=()=>{const u=F.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),D.value=!1,b()})},h=cl({bhoid:se.query.id,pay_type:"",top_cate:"",top_cate_value:""});(()=>{ll({id:h.bhoid}).then(u=>{_.value={...u},K.value=u.warehouse_id,v.value.id=u.id,u.financial_pm==0?H.value=1:me.value=1,F.value=[],b()})})();const ce=u=>{ol({id:u}).then(o=>{window.open(o.url,"_blank"),ue.success("\u5BFC\u51FA\u6210\u529F")})},B=d(!1),F=d([]),ve=u=>{F.value=F.value.filter(o=>o.id!==u)},he=u=>{u.forEach(o=>{F.value.find(n=>n.id==o.id)||F.value.push(o)}),B.value=!1};function J(u){u.total_price=u.num*u.purchases}const Q=d([]),be=()=>{sl({type:3}).then(u=>{Q.value=u.lists})},Z=(u,o)=>{u==1?(f.value.order_id=o.bhoid,f.value.product_id=o.product_id,f.value.unit=o.unit,f.value.need_num=o.cart_num,f.value.mark=o.mark,f.value.is_buyer="1",be(),g.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 nl.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await el({id:u}),b()},Ce=()=>{pe.value=!0},{pager:C,getLists:b,resetParams:Nl,resetPage:jl}=al({fetchFun:ne,params:h}),O=d(!1),W=d([]),Ee=(u="")=>{O.value=!0,dl({nickname:u,page_size:10}).then(o=>{W.value=o.lists,setTimeout(()=>{O.value=!1},300)}).catch(o=>{setTimeout(()=>{O.value=!1},300)})},X=d([]),ge=()=>{w.value=!0,_l({page_no:1,page_size:100}).then(u=>{X.value=u.lists})},De=()=>{tl(v.value).then(u=>{})},Ve=()=>{ne({export:2,bhoid:_.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 re({open:Ce}),(u,o)=>{const n=Se,x=$e,ke=Oe,r=Ie,le=Te,oe=Me,we=Qe,L=Le,Be=Re,xe=Ye,U=ze,te=Pe,z=Ne,R=je,Ue=Je,E=Ge,P=qe,V=Ke,ae=vl("perms"),Ae=He;return i(),c($,null,[l(xe,null,{default:t(()=>[s("div",bl,[s("div",yl,[Fl,s("div",Cl,A(a(_).order_id),1)])]),s("div",El,[s("div",gl,[Dl,s("div",Vl,"\uFFE5"+A(a(_).total_price),1)]),s("div",kl,[wl,s("div",Bl,A(a(_).create_time),1)]),l(n,{onClick:o[0]||(o[0]=e=>ce(a(_).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=>D.value=!0)},{default:t(()=>[m(" \u8FFD\u52A0 ")]),_:1}),l(Be,{modelValue:a(Y),"onUpdate:modelValue":o[5]||(o[5]=e=>k(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:Ve},{default:t(()=>[m("\u5BFC\u51FA\u8868\u683C ")]),_:1}),l(ke,{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(x,{value:0,label:"\u5168\u90E8",onChange:o[2]||(o[2]=e=>ee({name:"\u5168\u90E8",id:0}))}),(i(!0),c($,null,S(a(_).top_cate,e=>(i(),y(x,{value:e.id,label:e.name,key:e.id,onChange:p=>ee(e)},null,8,["value","label","onChange"]))),128))]),_:1},8,["modelValue"]),s("div",null,[s("div",null,[N((i(),y(oe,{data:a(C).lists},{default:t(()=>[l(r,{label:"id",prop:"id","show-overflow-tooltip":""}),l(r,{label:"\u5546\u54C1\u4FE1\u606F",prop:"store_name","show-overflow-tooltip":""},{default:t(({row:e})=>[s("div",xl,[l(le,{src:e.image,class:"w-16 h-16 mr-2","preview-teleported":!0},null,8,["src"]),s("div",null,A(e.store_name),1)])]),_:1}),l(r,{label:"\u4ED3\u5E93\u5E93\u5B58",prop:"warehouse_stock","show-overflow-tooltip":""}),l(r,{label:"\u9700\u8981\u6570\u91CF",prop:"cart_num","show-overflow-tooltip":""}),l(r,{label:"\u96F6\u552E\u4EF7",prop:"price","show-overflow-tooltip":""}),l(r,{label:"\u5408\u8BA1",prop:"total_price","show-overflow-tooltip":""}),l(r,{label:"\u662F\u5426\u9700\u91C7\u8D2D",prop:"is_buyer","show-overflow-tooltip":"",width:"100"},{default:t(({row:e})=>[e.is_buyer==0?(i(),c("div",Ul,[l(n,{type:"danger",round:"",size:"small",onClick:p=>Z(-1,e)},{default:t(()=>[m("\u5426")]),_:2},1032,["onClick"]),l(n,{type:"success",round:"",size:"small",onClick:p=>Z(1,e)},{default:t(()=>[m("\u662F")]),_:2},1032,["onClick"])])):(i(),c("div",Al,[e.is_buyer==1?(i(),c("span",$l,A(e.status_name),1)):I("",!0),e.is_buyer==-1?(i(),c("span",Ol,"\u65E0\u9700\u91C7\u8D2D")):I("",!0)]))]),_:1}),l(r,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:e})=>[N((i(),y(n,{type:"primary",link:"",onClick:p=>ye(e)},{default:t(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[ae,["beforehand_order_cart_info.beforehand_order_cart_info/edit"]]]),N((i(),y(n,{type:"danger",link:"",onClick:p=>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"])),[[Ae,a(C).loading]])]),a(C).lists.lengthk(C)?C.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:j,order_id:a(_).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(_).id},null,8,["order_id"])]),_:1}),l(L,{label:"\u51FA\u5E93",name:"outbound"},{default:t(()=>[l(ml,{ref_key:"outboundRef",ref:q,order_id:a(_).id},null,8,["order_id"])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(R,{modelValue:a(D),"onUpdate:modelValue":o[8]||(o[8]=e=>k(D)?D.value=e:null),title:"\u8FFD\u52A0\u5546\u54C1",width:"1200"},{footer:t(()=>[s("div",Pl,[l(n,{onClick:o[7]||(o[7]=e=>D.value=!1)},{default:t(()=>[m("\u53D6\u6D88")]),_:1}),l(n,{type:"primary",onClick:fe},{default:t(()=>[m(" \u786E\u8BA4 ")]),_:1})])]),default:t(()=>[l(z,{ref:"formRef",model:u.updateInfo,"label-width":"90px"},{default:t(()=>[s("div",Rl,[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(F)},{default:t(()=>[l(r,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),l(r,{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(r,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"180","show-overflow-tooltip":""}),l(r,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"80","show-overflow-tooltip":""}),l(r,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),l(r,{label:"\u6570\u91CF","min-width":"150"},{default:t(({row:e})=>[l(U,{modelValue:e.num,"onUpdate:modelValue":p=>e.num=p,onChange:p=>J(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),l(r,{label:"\u4EF7\u683C","min-width":"150"},{default:t(({row:e})=>[l(U,{modelValue:e.purchases,"onUpdate:modelValue":p=>e.purchases=p,onChange:p=>J(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),l(r,{label:"\u603B\u4EF7","min-width":"150"},{default:t(({row:e})=>[l(U,{modelValue:e.total_price,"onUpdate:modelValue":p=>e.total_price=p},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(r,{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":p=>e.manufacture=p,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u751F\u4EA7\u65E5\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(r,{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":p=>e.expiration_date=p,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u4FDD\u8D28\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(r,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:e})=>[l(n,{type:"danger",link:"",onClick:p=>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=>k(B)?B.value=e:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:t(()=>[l(Ue,{onOnBindStore:he,warehouse_id:a(K),is_warehouse:a(H)},null,8,["warehouse_id","is_warehouse"])]),_:1},8,["modelValue"]),a(M)?(i(),y(rl,{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(g),"onUpdate:modelValue":o[15]||(o[15]=e=>k(g)?g.value=e:null),title:"\u8BBE\u7F6E\u91C7\u8D2D",width:"600"},{footer:t(()=>[s("div",Sl,[l(n,{onClick:o[14]||(o[14]=e=>g.value=!1)},{default:t(()=>[m("\u53D6\u6D88")]),_:1}),l(n,{type:"primary",onClick:_e},{default:t(()=>[m(" \u786E\u8BA4 ")]),_:1})])]),default:t(()=>[l(z,{ref:"formRef",model:a(f),"label-width":"90px"},{default:t(()=>[l(V,{label:"\u91C7\u8D2D\u4EBA\u5458"},{default:t(()=>[l(P,{modelValue:a(f).buyer_id,"onUpdate:modelValue":o[11]||(o[11]=e=>a(f).buyer_id=e),placeholder:"\u8BF7\u9009\u62E9\u91C7\u8D2D\u4EBA\u5458",size:"large",style:{width:"240px"}},{default:t(()=>[(i(!0),c($,null,S(a(Q),e=>(i(),y(E,{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(f).need_num,"onUpdate:modelValue":o[12]||(o[12]=e=>a(f).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(f).mark,"onUpdate:modelValue":o[13]||(o[13]=e=>a(f).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(w),"onUpdate:modelValue":o[20]||(o[20]=e=>k(w)?w.value=e:null),title:"\u751F\u6210\u652F\u4ED8\u8BA2\u5355\u8BBE\u7F6E",width:"600"},{footer:t(()=>[s("div",Il,[l(n,{onClick:o[19]||(o[19]=e=>w.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(()=>[(i(!0),c($,null,S(a(W),e=>(i(),y(E,{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(()=>[(i(!0),c($,null,S(a(X),e=>(i(),y(E,{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(E,{label:"\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u652F\u4ED8",value:"7"}),l(E,{label:"\u91C7\u8D2D\u6B3E\u652F\u4ED8",value:"18"}),l(E,{label:"\u4F59\u989D\u652F\u4ED8",value:"3"}),l(E,{label:"\u73B0\u91D1\u652F\u4ED8",value:"17"})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])],64)}}});export{jo as default};