2 lines
8.2 KiB
JavaScript
2 lines
8.2 KiB
JavaScript
import{a6 as ee,C as oe,D as te,J as ae,K as le,w as se,F as ue,L as ne,M as re,b as ie,t as pe,N as de,O as me}from"./element-plus.4a7d92a3.js";import{_ as ce}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{_ as _e}from"./index.vue_vue_type_script_setup_true_lang.9ea6b13d.js";import{d as I,s as fe,r as g,Z as he,i as we,af as ve,ap as Ce,o as d,c as be,U as e,L as a,u as o,aa as ge,R as m,M as f,K as _,a as A,j as ye,Q as Ee,n as Fe}from"./@vue.18505fe0.js";import{u as ke}from"./usePaging.6a6670f9.js";import{u as Ve}from"./useDictOptions.7690fe0d.js";import{a as q,g as Be,h as De}from"./store_product.959dd79f.js";import"./lodash.9dc701ad.js";import{f as xe}from"./index.b17b0724.js";import{_ as Se}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.d1706eeb.js";import{_ as Pe}from"./copy.vue_vue_type_script_setup_true_name_storeProductEdit_lang.93775aca.js";import{a as $e}from"./store_category.0a6f61cf.js";import{u as ze}from"./vue-router.101084e3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.bc1a2af8.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.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.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./system_store.0064c44e.js";import"./warehouse_product_storege.cc8d987c.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.1a8b90a5.js";const Le={class:"mt-4"},Re={class:"flex mt-4 justify-end"},Ue=I({name:"storeProductLists"}),xo=I({...Ue,setup(Ae){const P=ze(),y=fe(),E=g(null),F=g(!1),n=he({store_name:"",class_all:"",is_show:"",bar_code:""}),k=g([]),K=s=>{k.value=s.map(({id:t})=>t)};Ve("");let $=1;P.query.page_no&&($=parseInt(P.query.page_no));const{pager:c,getLists:C,resetParams:N,resetPage:b}=ke({page:$,fetchFun:q,params:n}),T=async s=>{var t,r;(t=E.value)==null||t.open(),(r=E.value)==null||r.setFormData(s)},M=async s=>{var t,r;F.value=!0,await Fe(),(t=y.value)==null||t.open("edit"),(r=y.value)==null||r.setFormData(s)};let V,B;const D=g(!1);let x;const j=s=>(x=s,D.value=!0,z.lazyLoad(B,V),!1),z={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(s,t){V||(V=t),B||(B=s);const r=s.value||0;let i={};D.value?(i={name:x},x||(i={pid:r,page_size:1e4})):i={pid:r,page_size:1e4},$e({...i}).then(S=>{t(S.lists.map(h=>(h.leaf=!0,D.value=!1,h)))})}},O=s=>{Be({id:s.id,is_show:s.is_show})},L=async s=>{await xe.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await De({id:s}),C()};return we(()=>{C()}),(s,t)=>{const r=oe,i=te,S=ee,h=ae,J=le,p=se,Q=_e,Z=ue,R=ne,U=ve("router-link"),u=re,G=ie,H=pe,W=de,X=ce,w=Ce("perms"),Y=me;return d(),be("div",null,[e(R,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(Z,{class:"mb-[-16px]",model:o(n),inline:""},{default:a(()=>[e(i,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[e(r,{class:"w-[280px]",onKeydown:ge(o(b),["enter"]),modelValue:o(n).store_name,"onUpdate:modelValue":t[0]||(t[0]=l=>o(n).store_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),e(i,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[e(r,{class:"w-[280px]",modelValue:o(n).bar_code,"onUpdate:modelValue":t[1]||(t[1]=l=>o(n).bar_code=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801"},null,8,["modelValue"])]),_:1}),e(i,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:a(()=>[e(S,{class:"w-[280px]",modelValue:o(n).class_all,"onUpdate:modelValue":t[2]||(t[2]=l=>o(n).class_all=l),filterable:"",clearable:"","before-filter":j,props:z,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:o(b)},null,8,["modelValue","onChange"])]),_:1}),e(i,{label:"\u663E\u793A",prop:"is_show"},{default:a(()=>[e(J,{modelValue:o(n).is_show,"onUpdate:modelValue":t[3]||(t[3]=l=>o(n).is_show=l),placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A",style:{width:"240px"},onChange:o(b)},{default:a(()=>[e(h,{label:"\u663E\u793A",value:"1"}),e(h,{label:"\u4E0D\u663E\u793A",value:"0"})]),_:1},8,["modelValue","onChange"])]),_:1}),e(i,null,{default:a(()=>[e(p,{type:"primary",onClick:o(b)},{default:a(()=>[m("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(p,{onClick:o(N)},{default:a(()=>[m("\u91CD\u7F6E")]),_:1},8,["onClick"]),e(Q,{class:"ml-2.5","fetch-fun":o(q),params:o(n),"page-size":o(c).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),f((d(),_(R,{class:"!border-none",shadow:"never"},{default:a(()=>[f((d(),_(U,{to:{path:"store_product_edit",query:{id:0,mode:"add"}},class:"mr-4"},{default:a(()=>[e(p,{type:"primary",icon:"Plus"},{default:a(()=>[m(" \u65B0\u589E ")]),_:1})]),_:1})),[[w,["store_product.store_product/add"]]]),f((d(),_(p,{disabled:!o(k).length,onClick:t[4]||(t[4]=l=>L(o(k)))},{default:a(()=>[m(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[w,["store_product.store_product/delete"]]]),A("div",Le,[e(W,{data:o(c).lists,onSelectionChange:K},{default:a(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:a(({row:l})=>[e(G,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(u,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(u,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(u,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase","min-width":"100","show-overflow-tooltip":""}),e(u,{label:"\u5546\u6237\u4EF7",prop:"cost","min-width":"120","show-overflow-tooltip":""}),e(u,{label:"\u96F6\u552E\u4EF7",prop:"price","min-width":"120","show-overflow-tooltip":""}),e(u,{label:"\u8D77\u6279\u91CF",prop:"batch","min-width":"100","show-overflow-tooltip":""}),e(u,{label:"\u552E\u5356\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),e(u,{label:"\u9500\u91CF",prop:"sales","min-width":"100","show-overflow-tooltip":""}),e(u,{label:"\u72B6\u6001",prop:"is_show"},{default:a(({row:l})=>[e(H,{size:"large",onChange:v=>O(l),modelValue:l.is_show,"onUpdate:modelValue":v=>l.is_show=v,"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:"\u6761\u7801",prop:"bar_code","min-width":"200","show-overflow-tooltip":""}),e(u,{label:"\u64CD\u4F5C",width:"180",fixed:"right"},{default:a(({row:l})=>[f((d(),_(U,{to:{path:"store_product_edit",query:{id:l.id,mode:"edit",page:o(c).page}},class:"mr-4"},{default:a(()=>[e(p,{type:"primary",link:""},{default:a(()=>[m(" \u7F16\u8F91 ")]),_:1})]),_:2},1032,["to"])),[[w,["store_product.store_product/edit"]]]),f((d(),_(p,{type:"primary",link:"",onClick:v=>T(l)},{default:a(()=>[m(" \u8BE6\u60C5 ")]),_:2},1032,["onClick"])),[[w,["store_product.store_product/edit"]]]),e(p,{type:"primary",link:"",onClick:v=>M(l)},{default:a(()=>[m(" \u590D\u5236 ")]),_:2},1032,["onClick"]),f((d(),_(p,{type:"danger",link:"",onClick:v=>L(l.id)},{default:a(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[w,["store_product.store_product/delete"]]])]),_:1})]),_:1},8,["data"])]),A("div",Re,[e(X,{modelValue:o(c),"onUpdate:modelValue":t[5]||(t[5]=l=>ye(c)?c.value=l:null),onChange:o(C)},null,8,["modelValue","onChange"])])]),_:1})),[[Y,o(c).loading]]),e(Se,{ref_key:"detailsRef",ref:E},null,512),o(F)?(d(),_(Pe,{key:0,ref_key:"copyRef",ref:y,onSuccess:o(C),onClose:t[6]||(t[6]=l=>F.value=!1)},null,8,["onSuccess"])):Ee("",!0)])}}});export{xo as default};
|