import{J as Z,K as G,D as H,C as X,w as Y,F as ee,L as oe,M as te,N as ae,O as le}from"./element-plus.a63a26dd.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import{f as re,b as se}from"./index.038cab91.js";import{u as ne}from"./usePaging.6a6670f9.js";import{u as ie}from"./useDictOptions.01b6a4d4.js";import{_ as pe,a as de,b as me,c as ce}from"./edit.vue_vue_type_script_setup_true_name_warehouseProductEdit_lang.4c0d61a2.js";import{d as N,s as _e,r as F,Z as fe,ap as we,o as s,c as g,U as e,L as l,u as t,a as y,T as $,a9 as T,K as i,R as d,M as c,S as he,Q as k,j as ve,n as U}from"./@vue.18505fe0.js";import"./lodash.2473fc51.js";import{a as be}from"./system_store.cd137b2d.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"./vue-router.101084e3.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.vue_vue_type_script_setup_true_name_systemStoreLists_lang.25896ae1.js";import"./store_product.2d7e1c11.js";import"./warehouse_product_storege.5f4584bd.js";import"./warehouse.5676e381.js";import"./index.95a86d91.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";const Ee={class:"flex items-center mr-4"},Ce={class:"mt-4"},Fe={style:{color:"red"}},ye={class:"flex mt-4 justify-end"},ke=N({name:"warehouseProductLists"}),fo=N({...ke,setup(De){const v=_e(),b=F(!1),n=fe({warehouse_id:"",product_id:"",financial_pm:"",store_id:""}),D=F([]),R=r=>{D.value=r.map(({id:a})=>a)},{dictData:V}=ie("warehouse_produc_pm"),{pager:_,getLists:f,resetParams:I,resetPage:B}=ne({fetchFun:ce,params:n}),M=async()=>{var r;b.value=!0,await U(),(r=v.value)==null||r.open("add")},W=async r=>{var a,m;b.value=!0,await U(),(a=v.value)==null||a.open("edit"),(m=v.value)==null||m.setFormData(r)},j=async r=>{await de({id:r}),f()},x=async r=>{await re.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await me({id:r}),f()},E=F(!1),L=F([]),K=(r="")=>{E.value=!0,be({name:r,page_size:50}).then(a=>{L.value=a.lists,setTimeout(()=>{E.value=!1},300)}).catch(a=>{setTimeout(()=>{E.value=!1},300)})};return f(),(r,a)=>{const m=Z,P=G,w=H,S=X,p=Y,O=ee,A=oe,q=se,u=te,z=ae,J=ue,h=we("perms"),Q=le;return s(),g("div",null,[e(A,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[e(O,{class:"mb-[-16px]",model:t(n),inline:""},{default:l(()=>[e(w,{label:"\u95E8\u5E97\u540D\u79F0",prop:"store_id"},{default:l(()=>[y("div",Ee,[e(P,{modelValue:t(n).store_id,"onUpdate:modelValue":a[0]||(a[0]=o=>t(n).store_id=o),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":K,loading:t(E),style:{width:"240px"},onChange:t(B)},{default:l(()=>[(s(!0),g($,null,T(t(L),o=>(s(),i(m,{key:o.id,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])])]),_:1}),e(w,{label:"\u4ED3\u5E93ID",prop:"warehouse_id"},{default:l(()=>[e(S,{class:"w-[280px]",modelValue:t(n).warehouse_id,"onUpdate:modelValue":a[1]||(a[1]=o=>t(n).warehouse_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93"},null,8,["modelValue"])]),_:1}),e(w,{label:"\u5546\u54C1",prop:"product_id"},{default:l(()=>[e(S,{class:"w-[280px]",modelValue:t(n).product_id,"onUpdate:modelValue":a[2]||(a[2]=o=>t(n).product_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1"},null,8,["modelValue"])]),_:1}),e(w,{label:"\u51FA\u5165\u5E93\u72B6\u6001",prop:"financial_pm"},{default:l(()=>[e(P,{style:{width:"240px"},modelValue:t(n).financial_pm,"onUpdate:modelValue":a[3]||(a[3]=o=>t(n).financial_pm=o),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u51FA\u5165\u5E93"},{default:l(()=>[e(m,{label:"\u5168\u90E8",value:""}),(s(!0),g($,null,T(t(V).warehouse_produc_pm,(o,C)=>(s(),i(m,{key:C,label:o.name,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(w,null,{default:l(()=>[e(p,{type:"primary",onClick:t(B)},{default:l(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(p,{onClick:t(I)},{default:l(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),c((s(),i(A,{class:"!border-none",shadow:"never"},{default:l(()=>[c((s(),i(p,{type:"primary",onClick:M},{icon:l(()=>[e(q,{name:"el-icon-Plus"})]),default:l(()=>[d(" \u65B0\u589E ")]),_:1})),[[h,["warehouse_product.warehouse_product/add"]]]),c((s(),i(p,{disabled:!t(D).length,onClick:a[4]||(a[4]=o=>x(t(D)))},{default:l(()=>[d(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[h,["warehouse_product.warehouse_product/delete"]]]),y("div",Ce,[e(z,{data:t(_).lists,onSelectionChange:R},{default:l(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"",prop:"id","show-overflow-tooltip":""}),e(u,{label:"\u64CD\u4F5C\u4EBA\u5458",prop:"admin_name","show-overflow-tooltip":""}),e(u,{label:"\u4ED3\u5E93",prop:"warehouse_name","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1",prop:"store_name","show-overflow-tooltip":""}),e(u,{label:"\u51FA\u5165\u5E93",prop:"financial_pm_name","show-overflow-tooltip":""}),e(u,{label:"\u95E8\u5E97",prop:"system_store_name","show-overflow-tooltip":""}),e(u,{label:"\u6279\u6B21",prop:"batch","show-overflow-tooltip":""}),e(u,{label:"\u6570\u91CF",prop:"nums","show-overflow-tooltip":""}),e(u,{label:"\u751F\u4EA7\u671F",prop:"manufacture","show-overflow-tooltip":""}),e(u,{label:"\u4FDD\u8D28\u671F",prop:"expiration_date","show-overflow-tooltip":""}),e(u,{label:"\u91C7\u8D2D\u4EF7",prop:"purchase","show-overflow-tooltip":""}),e(u,{label:"\u5546\u6237\u4EF7",prop:"cost","show-overflow-tooltip":""}),e(u,{label:"\u96F6\u552E\u4EF7",prop:"price","show-overflow-tooltip":""}),e(u,{label:"\u603B\u4EF7",prop:"total_price","show-overflow-tooltip":""}),e(u,{label:"\u64CD\u4F5C\u65F6\u95F4",prop:"create_time","show-overflow-tooltip":""}),e(u,{label:"\u5907\u6CE8","show-overflow-tooltip":""},{default:l(({row:o})=>[y("span",Fe,he(o.mark),1)]),_:1}),e(u,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:o})=>[o.status==0?c((s(),i(p,{key:0,type:"primary",link:"",onClick:C=>W(o)},{default:l(()=>[d(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[h,["warehouse_product.warehouse_product/edit"]]]):k("",!0),o.status==0?c((s(),i(p,{key:1,type:"danger",link:"",onClick:C=>x(o.id)},{default:l(()=>[d(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[h,["warehouse_product.warehouse_product/delete"]]]):k("",!0),o.status==0?c((s(),i(p,{key:2,type:"primary",link:"",onClick:C=>j(o.id)},{default:l(()=>[d(" \u786E\u8BA4 ")]),_:2},1032,["onClick"])),[[h,["warehouse_product.warehouse_product/enter"]]]):k("",!0)]),_:1})]),_:1},8,["data"])]),y("div",ye,[e(J,{modelValue:t(_),"onUpdate:modelValue":a[5]||(a[5]=o=>ve(_)?_.value=o:null),onChange:t(f)},null,8,["modelValue","onChange"])])]),_:1})),[[Q,t(_).loading]]),t(b)?(s(),i(pe,{key:0,ref_key:"editRef",ref:v,"dict-data":t(V),onSuccess:t(f),onClose:a[6]||(a[6]=o=>b.value=!1)},null,8,["dict-data","onSuccess"])):k("",!0)])}}});export{fo as default};