import{J,K as Q,D as Z,C as G,w as H,F as W,L as X,M as Y,b as ee,t as oe,N as te,O as ae}from"./element-plus.ea2cdc63.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.9926caf5.js";import{d as L,s as ne,r as v,Z as ue,o as r,c as g,U as e,L as l,u as t,T as k,a9 as x,K as E,aa as D,R as b,M as se,a as S,j as re,Q as ie,n as pe}from"./@vue.18505fe0.js";import{u as me}from"./usePaging.6a6670f9.js";import{u as de}from"./useDictOptions.b6815f0f.js";import{d as ce,b as _e,e as fe}from"./store_branch_product.4e3f10af.js";import"./lodash.60201f64.js";import{a as he}from"./system_store.57d74831.js";import{f as ve}from"./index.ce9f3dae.js";import{_ as be}from"./edit.vue_vue_type_script_setup_true_name_storeBranchProductEdit_lang.0260f9e8.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.8ae0c638.js";import"./axios.2b8d80bd.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.b82a2ce7.js";import"./color.b905eb26.js";import"./clone.e1fb2883.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.495afef3.js";import"./vue-clipboard3.cb649e18.js";import"./clipboard.4592e390.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./picker.980aa3df.js";import"./index.d7e59336.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./index.baba5303.js";import"./index.971f0916.js";import"./vuedraggable.d1fd737a.js";import"./vue.feef8fd6.js";import"./sortablejs.c8f4cbb7.js";import"./store_product_unit.bb00db1e.js";const we={class:"mt-4"},Ce={class:"flex mt-4 justify-end"},ge=L({name:"storeBranchProductLists"}),ho=L({...ge,setup(Ee){const w=ne(),C=v(!1),s=ue({store_id:"",store_name:"",bar_code:"",status:"",exchange:0}),U=v([]),P=n=>{U.value=n.map(({id:a})=>a)},{dictData:K}=de(""),{pager:i,getLists:c,resetParams:T,resetPage:p}=me({fetchFun:fe,params:s}),$=async n=>{var a,m;C.value=!0,await pe(),(a=w.value)==null||a.open("edit"),(m=w.value)==null||m.setFormData(n)},N=async n=>{await ve.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ce({id:n}),c()};c();const _=v(!1),F=v([]),R=(n="")=>{_.value=!0,he({name:n,page_size:50}).then(a=>{F.value=a.lists,setTimeout(()=>{_.value=!1},300)}).catch(a=>{setTimeout(()=>{_.value=!1},300)})},I=n=>{_e({id:n.id,store_name:n.store_name,image:n.image,price:n.price,unit:n.unit,status:n.status})};return(n,a)=>{const m=J,B=Q,d=Z,y=G,f=H,A=W,V=X,u=Y,M=ee,j=oe,z=te,O=le,q=ae;return r(),g("div",null,[e(V,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[e(A,{class:"mb-[-16px]",model:t(s),inline:""},{default:l(()=>[e(d,{label:"\u95E8\u5E97",prop:"store_id"},{default:l(()=>[e(B,{modelValue:t(s).store_id,"onUpdate:modelValue":a[0]||(a[0]=o=>t(s).store_id=o),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":R,loading:t(_),style:{width:"240px"},onChange:t(p)},{default:l(()=>[(r(!0),g(k,null,x(t(F),o=>(r(),E(m,{key:o.id,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])]),_:1}),e(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:l(()=>[e(y,{class:"w-[280px]",modelValue:t(s).store_name,"onUpdate:modelValue":a[1]||(a[1]=o=>t(s).store_name=o),onKeydown:D(t(p),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue","onKeydown"])]),_:1}),e(d,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:l(()=>[e(y,{class:"w-[280px]",modelValue:t(s).bar_code,"onUpdate:modelValue":a[2]||(a[2]=o=>t(s).bar_code=o),onKeydown:D(t(p),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801"},null,8,["modelValue","onKeydown"])]),_:1}),e(d,{label:"\u72B6\u6001",prop:"bar_code"},{default:l(()=>[e(B,{modelValue:t(s).status,"onUpdate:modelValue":a[3]||(a[3]=o=>t(s).status=o),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",style:{width:"240px"},onChange:t(p)},{default:l(()=>[(r(),g(k,null,x([{id:1,name:"\u4E0A\u67B6"},{id:0,name:"\u4E0B\u67B6"}],o=>e(m,{key:o.id,label:o.name,value:o.id},null,8,["label","value"])),64))]),_:1},8,["modelValue","onChange"])]),_:1}),e(d,null,{default:l(()=>[e(f,{type:"primary",onClick:t(p)},{default:l(()=>[b("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(f,{onClick:t(T)},{default:l(()=>[b("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),se((r(),E(V,{class:"!border-none",shadow:"never"},{default:l(()=>[S("div",we,[e(z,{data:t(i).lists,onSelectionChange:P},{default:l(()=>[e(u,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(u,{label:"\u95E8\u5E97",prop:"system_store_name","show-overflow-tooltip":""}),e(u,{label:"\u5206\u7C7B",prop:"cate_name","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","show-overflow-tooltip":""},{default:l(({row:o})=>[e(M,{class:"w-[40px] h-[40px]",src:o.image},null,8,["src"])]),_:1}),e(u,{label:"\u4EF7\u683C",prop:"price","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code","show-overflow-tooltip":""}),e(u,{label:"\u9500\u91CF",prop:"sales","show-overflow-tooltip":""}),e(u,{label:"\u552E\u5356\u5E93\u5B58",prop:"stock","show-overflow-tooltip":""}),e(u,{label:"\u5151\u6362\u5E93\u5B58",prop:"swap","show-overflow-tooltip":""}),e(u,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(u,{label:"\u72B6\u6001",prop:"status"},{default:l(({row:o})=>[e(j,{size:"large",onChange:h=>I(o),modelValue:o.status,"onUpdate:modelValue":h=>o.status=h,"active-value":1,"inactive-value":0,"active-text":"\u4E0A\u67B6","inactive-text":"\u4E0B\u67B6","inline-prompt":""},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1}),e(u,{label:"\u64CD\u4F5C","min-width":"140",fixed:"right",align:"center","show-overflow-tooltip":""},{default:l(({row:o})=>[e(f,{type:"primary",link:"",onClick:h=>$(o)},{default:l(()=>[b("\u7F16\u8F91")]),_:2},1032,["onClick"]),e(f,{type:"danger",link:"",onClick:h=>N(o.id)},{default:l(()=>[b("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),S("div",Ce,[e(O,{modelValue:t(i),"onUpdate:modelValue":a[4]||(a[4]=o=>re(i)?i.value=o:null),onChange:t(c)},null,8,["modelValue","onChange"])])]),_:1})),[[q,t(i).loading]]),t(C)?(r(),E(be,{key:0,ref_key:"editRef",ref:w,"dict-data":t(K),onSuccess:t(c),onClose:a[5]||(a[5]=o=>C.value=!1)},null,8,["dict-data","onSuccess"])):ie("",!0)])}}});export{ho as default};