2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
import{a8 as ee,C as oe,D as te,J as le,K as ae,w as ue,F as se,L as re,M as ne,b as pe,t as ie,N as de,O as me}from"./element-plus.91c68cc0.js";import{_ as _e}from"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import{_ as ce}from"./index.vue_vue_type_script_setup_true_lang.96f62f54.js";import{d as K,s as fe,r as g,Z as Ce,i as ve,af as we,ap as be,o as m,c as he,U as e,L as a,u as t,aa as ge,R as _,M as v,K as C,a as I,j as ye,Q as Ee,n as Fe}from"./@vue.76ce7aa3.js";import{u as Be}from"./usePaging.f8c888e4.js";import{u as Ve}from"./useDictOptions.1cd81cc1.js";import{a as q,g as De,h as ke}from"./store_product.95e574d3.js";import"./lodash.4e6d2a38.js";import{f as xe}from"./index.0e5577f4.js";import{_ as Se}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.2266ef4f.js";import{_ as Ae}from"./copy.vue_vue_type_script_setup_true_name_storeProductEdit_lang.7e1b0011.js";import{a as Pe}from"./store_category.3fcc23e3.js";import{u as Ue}from"./vue-router.10bd5b90.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.395bb96e.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./system_store.2fa4ef1a.js";import"./warehouse_product_storege.1636c94e.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.d43e61d8.js";const $e={class:"mt-4"},ze={class:"flex mt-4 justify-end"},Le=K({name:"storeProductLists"}),Po=K({...Le,setup(Re){const A=Ue(),y=fe(),E=g(null),F=g(!1),r=Ce({store_name:"",class_all:"",is_show:"",id:"",bar_code:"",product_type:""}),B=g([]),N=s=>{B.value=s.map(({id:o})=>o)};Ve("");let P=1;A.query.page_no&&(P=parseInt(A.query.page_no));const{pager:c,getLists:h,resetParams:T,resetPage:f}=Be({page:P,fetchFun:q,params:r}),M=async s=>{var o,n;(o=E.value)==null||o.open(),(n=E.value)==null||n.setFormData(s)},j=async s=>{var o,n;F.value=!0,await Fe(),(o=y.value)==null||o.open("edit"),(n=y.value)==null||n.setFormData(s)};let V,D;const k=g(!1);let x;const O=s=>(x=s,k.value=!0,U.lazyLoad(D,V),!1),U={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(s,o){V||(V=o),D||(D=s);const n=s.value||0;let p={};k.value?(p={name:x},x||(p={pid:n,page_size:1e4})):p={pid:n,page_size:1e4},Pe({...p}).then(S=>{o(S.lists.map(i=>(i.leaf=!0,k.value=!1,i)))})}},J=s=>{De({id:s.id,is_show:s.is_show})},$=async s=>{await xe.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ke({id:s}),h()};return ve(()=>{h()}),(s,o)=>{const n=oe,p=te,S=ee,i=le,z=ae,d=ue,Q=ce,Z=se,L=re,R=we("router-link"),u=ne,G=pe,H=ie,W=de,X=_e,w=be("perms"),Y=me;return m(),he("div",null,[e(L,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(Z,{class:"mb-[-16px]",model:t(r),inline:""},{default:a(()=>[e(p,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[e(n,{class:"w-[280px]",onKeydown:ge(t(f),["enter"]),modelValue:t(r).store_name,"onUpdate:modelValue":o[0]||(o[0]=l=>t(r).store_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),e(p,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[e(n,{class:"w-[280px]",modelValue:t(r).bar_code,"onUpdate:modelValue":o[1]||(o[1]=l=>t(r).bar_code=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",onChange:t(f)},null,8,["modelValue","onChange"])]),_:1}),e(p,{label:"\u5546\u54C1ID",prop:"id"},{default:a(()=>[e(n,{class:"w-[280px]",modelValue:t(r).id,"onUpdate:modelValue":o[2]||(o[2]=l=>t(r).id=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1ID",onChange:t(f)},null,8,["modelValue","onChange"])]),_:1}),e(p,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:a(()=>[e(S,{class:"w-[280px]",modelValue:t(r).class_all,"onUpdate:modelValue":o[3]||(o[3]=l=>t(r).class_all=l),filterable:"",clearable:"","before-filter":O,props:U,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:t(f)},null,8,["modelValue","onChange"])]),_:1}),e(p,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type"},{default:a(()=>[e(z,{modelValue:t(r).product_type,"onUpdate:modelValue":o[4]||(o[4]=l=>t(r).product_type=l),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",style:{width:"240px"},onChange:t(f)},{default:a(()=>[e(i,{label:"\u666E\u901A\u5546\u54C1",value:"0"}),e(i,{label:"\u5151\u6362\u4EA7\u54C1",value:"2"}),e(i,{label:"\u6D3B\u52A8\u5546\u54C1",value:"4"}),e(i,{label:"\u6279\u53D1\u4EA7\u54C1",value:"5"})]),_:1},8,["modelValue","onChange"])]),_:1}),e(p,{label:"\u663E\u793A",prop:"is_show"},{default:a(()=>[e(z,{modelValue:t(r).is_show,"onUpdate:modelValue":o[5]||(o[5]=l=>t(r).is_show=l),placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A",style:{width:"240px"},onChange:t(f)},{default:a(()=>[e(i,{label:"\u663E\u793A",value:"1"}),e(i,{label:"\u4E0D\u663E\u793A",value:"0"})]),_:1},8,["modelValue","onChange"])]),_:1}),e(p,null,{default:a(()=>[e(d,{type:"primary",onClick:t(f)},{default:a(()=>o[9]||(o[9]=[_("\u67E5\u8BE2")])),_:1},8,["onClick"]),e(d,{onClick:t(T)},{default:a(()=>o[10]||(o[10]=[_("\u91CD\u7F6E")])),_:1},8,["onClick"]),e(Q,{class:"ml-2.5","fetch-fun":t(q),params:t(r),"page-size":t(c).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),v((m(),C(L,{class:"!border-none",shadow:"never"},{default:a(()=>[v((m(),C(R,{to:{path:"store_product_edit",query:{id:0,mode:"add"}},class:"mr-4"},{default:a(()=>[e(d,{type:"primary",icon:"Plus"},{default:a(()=>o[11]||(o[11]=[_(" \u65B0\u589E ")])),_:1})]),_:1})),[[w,["store_product.store_product/add"]]]),v((m(),C(d,{disabled:!t(B).length,onClick:o[6]||(o[6]=l=>$(t(B)))},{default:a(()=>o[12]||(o[12]=[_(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[w,["store_product.store_product/delete"]]]),I("div",$e,[e(W,{data:t(c).lists,onSelectionChange:N},{default:a(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"ID",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","show-overflow-tooltip":""}),e(u,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type_name","show-overflow-tooltip":""}),e(u,{label:"\u4F9B\u8D27\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:"\u8D77\u6279\u91CF",prop:"batch","show-overflow-tooltip":""}),e(u,{label:"\u6BDB\u5229\u7387",prop:"rose","min-width":"100","show-overflow-tooltip":""}),e(u,{label:"\u552E\u5356\u5E93\u5B58",prop:"stock","show-overflow-tooltip":""}),e(u,{label:"\u9500\u91CF",prop:"sales","show-overflow-tooltip":""}),e(u,{label:"\u72B6\u6001",prop:"is_show"},{default:a(({row:l})=>[e(H,{size:"large",onChange:b=>J(l),modelValue:l.is_show,"onUpdate:modelValue":b=>l.is_show=b,"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","show-overflow-tooltip":""}),e(u,{label:"\u64CD\u4F5C",width:"180",fixed:"right"},{default:a(({row:l})=>[v((m(),C(R,{to:{path:"store_product_edit",query:{id:l.id,mode:"edit",page:t(c).page}},class:"mr-4"},{default:a(()=>[e(d,{type:"primary",link:""},{default:a(()=>o[13]||(o[13]=[_(" \u7F16\u8F91 ")])),_:1})]),_:2},1032,["to"])),[[w,["store_product.store_product/edit"]]]),v((m(),C(d,{type:"primary",link:"",onClick:b=>M(l)},{default:a(()=>o[14]||(o[14]=[_(" \u8BE6\u60C5 ")])),_:2},1032,["onClick"])),[[w,["store_product.store_product/edit"]]]),e(d,{type:"primary",link:"",onClick:b=>j(l)},{default:a(()=>o[15]||(o[15]=[_(" \u590D\u5236 ")])),_:2},1032,["onClick"]),v((m(),C(d,{type:"danger",link:"",onClick:b=>$(l.id)},{default:a(()=>o[16]||(o[16]=[_(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[w,["store_product.store_product/delete"]]])]),_:1})]),_:1},8,["data"])]),I("div",ze,[e(X,{modelValue:t(c),"onUpdate:modelValue":o[7]||(o[7]=l=>ye(c)?c.value=l:null),onChange:t(h)},null,8,["modelValue","onChange"])])]),_:1})),[[Y,t(c).loading]]),e(Se,{ref_key:"detailsRef",ref:E},null,512),t(F)?(m(),C(Ae,{key:0,ref_key:"copyRef",ref:y,onSuccess:t(h),onClose:o[8]||(o[8]=l=>F.value=!1)},null,8,["onSuccess"])):Ee("",!0)])}}});export{Po as default};
|