import{G as H,H as K,k as Z,w as z,M as J,b as Q,N as W,D as X,v as Y,F as ee,I as oe,L as te}from"./element-plus.a63a26dd.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.37957c41.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.338318d2.js";import{w as ae}from"./index.0a3a642f.js";import{d as se}from"./store_product.424a8e33.js";import{d as U,s as re,r,Z as ie,ap as ne,o as E,K as b,L as o,a as p,U as e,u as n,R as i,S as pe,M as F,j as C}from"./@vue.18505fe0.js";import"./lodash.2473fc51.js";import{u as de,a as me}from"./vue-router.101084e3.js";import{a as _e}from"./store_product_unit.3d2f29dc.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"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.b595d96c.js";import"./warehouse_product_storege.c0e7a660.js";import"./system_store.0a42829f.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";const ce=p("div",{class:"mb-4 text-lg font-bold"},"\u5BFC\u5165\u5546\u54C1\u5230\u95E8\u5E97",-1),fe={class:"flex-1 w-full"},we={class:"mb-2"},he={class:"flex-1 w-full"},ve={class:"mb-2"},Ee=p("span",{class:"text-info text-xs ml-6"},"\u9ED8\u8BA4\u4E3A\u5206\u914D\u552E\u5356\u5E93\u5B58, \u5982\u9700\u5206\u914D\u5151\u6362\u5E93\u5B58\u8BF7\u9009\u62E9\u5206\u914D\u5151\u6362\u5E93\u5B58",-1),be=U({name:"storeProductEdit"}),po=U({...be,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ce,{emit:Be}){const B=de(),A=re(),{removeTab:R}=ae();r("add");const w=r(""),S=ie({store_id:""});B.query.warehouse_id&&(w.value=parseInt(B.query.warehouse_id));const _=r(!1),d=r([]),I=s=>{d.value=d.value.filter(l=>l.id!==s)},L=s=>{s.forEach(l=>{d.value.find(u=>u.id==l.id)||d.value.push(l)}),_.value=!1},c=r(!1),m=r([]),P=s=>{m.value=m.value.filter(l=>l.id!==s)},$=s=>{s.forEach(l=>{m.value.find(u=>u.id==l.id)||m.value.push(l)}),c.value=!1},N=r([]);(()=>{_e({}).then(s=>{N.value=s.lists})})();const h=r(1);me();const T=async()=>{if(w.value==""){Z.error("\u8BF7\u9009\u62E9\u4ED3\u5E93");return}const s=m.value.map(u=>({id:u.product_id,stock:u.new_stock||0,batch:u.batch||0})),l=d.value.map(u=>u.id);se({product_arr:s,store_arr:l,stock_type:h.value,warehouse_id:w.value}).then(u=>{R()})};return(s,l)=>{const u=z,a=J,D=Q,y=W,v=X,g=Y,k=H,M=K,O=ee,j=ue,V=oe,q=le,G=te,x=ne("perms");return E(),b(G,null,{default:o(()=>[ce,p("div",null,[e(O,{ref_key:"formRef",ref:A,model:n(S),"label-width":"90px"},{default:o(()=>[e(v,{label:"\u95E8\u5E97",prop:"store_id"},{default:o(()=>[p("div",fe,[p("div",we,[e(u,{type:"primary",onClick:l[0]||(l[0]=t=>_.value=!0)},{default:o(()=>[i("\u6DFB\u52A0\u95E8\u5E97")]),_:1})]),e(y,{data:n(d)},{default:o(()=>[e(a,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(a,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(a,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),e(a,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),e(a,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:o(({row:t})=>[e(D,{src:t.image,class:"w-[40px] h-[40px]","preview-teleported":!0},null,8,["src"])]),_:1}),e(a,{label:"\u8425\u4E1A\u72B6\u6001",prop:"is_show","show-overflow-tooltip":""},{default:o(({row:t})=>[i(pe(t.is_show?"\u8425\u4E1A":"\u6253\u70CA"),1)]),_:1}),e(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:t})=>[F((E(),b(u,{type:"danger",link:"",onClick:f=>I(t.id)},{default:o(()=>[i(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[x,["system_store.system_store/delete"]]])]),_:1})]),_:1},8,["data"])])]),_:1}),e(v,{label:"\u5546\u54C1",prop:"store_id"},{default:o(()=>[p("div",he,[p("div",ve,[e(u,{type:"primary",onClick:l[1]||(l[1]=t=>c.value=!0)},{default:o(()=>[i("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(y,{data:n(m)},{default:o(()=>[e(a,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:t})=>[e(D,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(a,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(a,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""}),e(a,{label:"\u5206\u914D\u5E93\u5B58","min-width":"150"},{default:o(({row:t})=>[e(g,{modelValue:t.new_stock,"onUpdate:modelValue":f=>t.new_stock=f,min:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(a,{label:"\u6279\u6B21","min-width":"150"},{default:o(({row:t})=>[e(g,{modelValue:t.batch,"onUpdate:modelValue":f=>t.batch=f},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:t})=>[F((E(),b(u,{type:"danger",link:"",onClick:f=>P(t.id)},{default:o(()=>[i(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[x,["system_store.system_store/delete"]]])]),_:1})]),_:1},8,["data"])])]),_:1}),e(v,{label:"\u5E93\u5B58\u7C7B\u578B",prop:"stock_type"},{default:o(()=>[e(M,{modelValue:n(h),"onUpdate:modelValue":l[2]||(l[2]=t=>C(h)?h.value=t:null),class:"ml-6"},{default:o(()=>[e(k,{value:1,label:1},{default:o(()=>[i("\u5206\u914D\u552E\u5356\u5E93\u5B58")]),_:1}),e(k,{value:2,label:2},{default:o(()=>[i("\u5206\u914D\u5151\u6362\u5E93\u5B58")]),_:1})]),_:1},8,["modelValue"]),Ee]),_:1}),e(v,{label:""},{default:o(()=>[e(u,{onClick:T,type:"primary",class:"w-40"},{default:o(()=>[i("\u63D0\u4EA4")]),_:1})]),_:1})]),_:1},8,["model"])]),e(V,{modelValue:n(_),"onUpdate:modelValue":l[3]||(l[3]=t=>C(_)?_.value=t:null),title:"\u9009\u62E9\u95E8\u5E97",width:"70%"},{default:o(()=>[e(j,{onOnBindStore:L})]),_:1},8,["modelValue"]),e(V,{modelValue:n(c),"onUpdate:modelValue":l[4]||(l[4]=t=>C(c)?c.value=t:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:o(()=>[e(q,{onOnBindStore:$,is_warehouse:"1",warehouse_id:n(w)},null,8,["warehouse_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{po as default};