2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
import{M as Ee,a3 as Fe,Q as he,C as ke,D as we,N as Be,O as De,w as Ve,F as xe,K as Se,G as $e,b as Re,t as Ae,H as Pe,L as Ue,I as Ie}from"./element-plus.8e273e86.js";import{_ as ze}from"./index.vue_vue_type_script_setup_true_name_product_lang.4169abc8.js";import{_ as Le}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{_ as Ke}from"./index.vue_vue_type_script_setup_true_lang.dc11f5d9.js";import{d as ee,r as C,s as H,Z as qe,i as Ne,af as Te,ap as We,o as m,c as Z,U as o,L as u,u as l,aa as je,R as s,M as F,K as f,j as L,a as n,S as v,Q as w,n as J}from"./@vue.76ce7aa3.js";import{u as Me}from"./usePaging.f8c888e4.js";import{u as Ge}from"./useDictOptions.b801ef8f.js";import{a as X,h as Oe,i as Qe,j as He}from"./store_product.38b6e967.js";import"./lodash.41b9567d.js";import{f as Y}from"./index.23ef5f03.js";import{_ as Ze}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.c87cd8e8.js";import{_ as Je}from"./copy.vue_vue_type_script_setup_true_name_storeProductEdit_lang.0712a015.js";import{_ as Xe}from"./copyWarehouse.vue_vue_type_script_setup_true_name_storeProductEdit_lang.4ef95bf2.js";import{a as Ye}from"./store_category.3aeb76f7.js";import{u as eo}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"./store_product_price.fc8f7865.js";import"./moment.40bc58bf.js";import"./vue-echarts.fe276ff7.js";import"./resize-detector.4e96b72b.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./index.bfcf3e4f.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";import"./axios.b4cbdbc9.js";import"./jspdf.75308076.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.f23177ae.js";import"./color.a6ad6672.js";import"./clone.954ba32c.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"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./system_store.2ac4da80.js";import"./warehouse_product_storege.882d73e4.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.d0a18972.js";import"./warehouse.1799126a.js";const oo={class:"mt-4"},to=["onClick"],lo={style:{color:"red"}},uo={style:{color:"red"}},ao={style:{color:"red"}},so={style:{color:"red"}},no={style:{color:"red"}},ro={style:{color:"red"}},io={class:"mr-1"},po={class:"ml-1"},mo={key:0},_o={class:"flex mt-4 justify-end"},co=ee({name:"storeProductLists"}),Ct=ee({...co,setup(fo){const k=C(!1),K=C(""),q=C(0),oe=a=>{k.value=!0,K.value=a,q.value++},B=C("0"),te=a=>{a==1?r.product_status=1:r.product_status=0,g()},N=eo(),D=H(),V=H(),x=C(null),S=C(!1),$=C(!1),r=qe({store_name:"",class_all:"",is_show:"",id:"",bar_code:"",product_status:0,product_type:""}),R=C([]),le=a=>{R.value=a.map(({id:e})=>e)};Ge("");let T=1;N.query.page_no&&(T=parseInt(N.query.page_no));const{pager:b,getLists:g,resetParams:ue,resetPage:E}=Me({page:T,fetchFun:X,params:r}),ae=async a=>{var e,i;(e=x.value)==null||e.open(),(i=x.value)==null||i.setFormData(a)},se=async a=>{var e,i;S.value=!0,await J(),(e=D.value)==null||e.open("edit"),(i=D.value)==null||i.setFormData(a)},ne=async a=>{var e,i;$.value=!0,await J(),(e=V.value)==null||e.open("edit"),(i=V.value)==null||i.setFormData(a)};let A,P;const U=C(!1);let I;const re=a=>(I=a,U.value=!0,W.lazyLoad(P,A),!1),W={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(a,e){A||(A=e),P||(P=a);const i=a.value||0;let p={};U.value?(p={name:I},I||(p={pid:i,page_size:1e4})):p={pid:i,page_size:1e4},Ye({...p}).then(z=>{e(z.lists.map(_=>(_.leaf=!0,U.value=!1,_)))})}},ie=a=>{Oe({id:a.id,is_show:a.is_show})},j=async a=>{await Y.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await Qe({id:a}),g()},pe=async a=>{await Y.confirm("\u786E\u5B9A\u8981\u6062\u590D\u5417\uFF1F"),await He({id:a}),g()};return Ne(()=>{g()}),(a,e)=>{const i=ke,p=we,z=Ee,_=Be,M=De,c=Ve,de=Ke,me=xe,G=Se,O=Te("router-link"),Q=Fe,_e=he,d=$e,ce=Re,fe=Ae,Ce=Pe,ve=Le,ye=ze,be=Ue,h=We("perms"),ge=Ie;return m(),Z("div",null,[o(G,{class:"!border-none mb-4",shadow:"never"},{default:u(()=>[o(me,{class:"mb-[-16px]",model:l(r),inline:""},{default:u(()=>[o(p,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:u(()=>[o(i,{class:"w-[280px]",onKeydown:je(l(E),["enter"]),modelValue:l(r).store_name,"onUpdate:modelValue":e[0]||(e[0]=t=>l(r).store_name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),o(p,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:u(()=>[o(i,{class:"w-[280px]",modelValue:l(r).bar_code,"onUpdate:modelValue":e[1]||(e[1]=t=>l(r).bar_code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",onChange:l(E)},null,8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u5546\u54C1ID",prop:"id"},{default:u(()=>[o(i,{class:"w-[280px]",modelValue:l(r).id,"onUpdate:modelValue":e[2]||(e[2]=t=>l(r).id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1ID",onChange:l(E)},null,8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:u(()=>[o(z,{class:"w-[280px]",modelValue:l(r).class_all,"onUpdate:modelValue":e[3]||(e[3]=t=>l(r).class_all=t),filterable:"",clearable:"","before-filter":re,props:W,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:l(E)},null,8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type"},{default:u(()=>[o(M,{modelValue:l(r).product_type,"onUpdate:modelValue":e[4]||(e[4]=t=>l(r).product_type=t),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",style:{width:"240px"},onChange:l(E)},{default:u(()=>[o(_,{label:"\u666E\u901A\u5546\u54C1",value:"0"}),o(_,{label:"\u5151\u6362\u4EA7\u54C1",value:"2"}),o(_,{label:"\u6D3B\u52A8\u5546\u54C1",value:"4"}),o(_,{label:"\u6279\u53D1\u4EA7\u54C1",value:"5"}),o(_,{label:"\u7279\u6B8A\u4EA7\u54C1",value:"7"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u663E\u793A",prop:"is_show"},{default:u(()=>[o(M,{modelValue:l(r).is_show,"onUpdate:modelValue":e[5]||(e[5]=t=>l(r).is_show=t),placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A",style:{width:"240px"},onChange:l(E)},{default:u(()=>[o(_,{label:"\u663E\u793A",value:"1"}),o(_,{label:"\u4E0D\u663E\u793A",value:"0"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(p,null,{default:u(()=>[o(c,{type:"primary",onClick:l(E)},{default:u(()=>e[12]||(e[12]=[s("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(c,{onClick:l(ue)},{default:u(()=>e[13]||(e[13]=[s("\u91CD\u7F6E")])),_:1},8,["onClick"]),o(de,{class:"ml-2.5","fetch-fun":l(X),params:l(r),"page-size":l(b).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),F((m(),f(G,{class:"!border-none",shadow:"never"},{default:u(()=>[F((m(),f(O,{to:{path:"store_product_edit",query:{id:0,mode:"add"}},class:"mr-4"},{default:u(()=>[o(c,{type:"primary",icon:"Plus"},{default:u(()=>e[14]||(e[14]=[s(" \u65B0\u589E ")])),_:1})]),_:1})),[[h,["store_product.store_product/add"]]]),F((m(),f(c,{class:"mr-4",disabled:!l(R).length,onClick:e[6]||(e[6]=t=>j(l(R)))},{default:u(()=>e[15]||(e[15]=[s(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[h,["store_product.store_product/delete"]]]),o(_e,{modelValue:l(B),"onUpdate:modelValue":e[7]||(e[7]=t=>L(B)?B.value=t:null),onChange:te},{default:u(()=>[o(Q,{label:"0"},{default:u(()=>e[16]||(e[16]=[s("\u5168\u90E8")])),_:1}),o(Q,{label:"1"},{default:u(()=>e[17]||(e[17]=[s("\u5DF2\u5220\u9664")])),_:1})]),_:1},8,["modelValue"]),n("div",oo,[o(Ce,{data:l(b).lists,onSelectionChange:le},{default:u(()=>[o(d,{type:"selection",width:"55"}),o(d,{label:"ID",prop:"id","show-overflow-tooltip":""}),o(d,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:u(({row:t})=>[o(ce,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""},{default:u(({row:t})=>[n("div",null,v(t.store_name),1),n("div",{onClick:y=>oe(t.id)},[e[18]||(e[18]=s(" \u4F9B\u8D27\u4EF7:")),n("span",lo,v(t.purchase),1),e[19]||(e[19]=n("span",{style:{"margin-left":"3px"}},"\u67E5\u770B",-1))],8,to),n("div",null,[e[20]||(e[20]=s(" \u5546\u6237\u4EF7: ")),n("span",uo,v(t.cost),1)]),n("div",null,[e[21]||(e[21]=s(" \u4F1A\u5458\u4EF7: ")),n("span",ao,v(t.vip_price),1)]),n("div",null,[e[22]||(e[22]=s(" \u96F6\u552E\u4EF7:")),n("span",so,v(t.price),1)])]),_:1}),o(d,{label:"\u5206\u7C7B",prop:"cate_name","show-overflow-tooltip":""}),o(d,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),o(d,{label:"\u5546\u54C1\u7C7B\u578B/\u8D77\u6279\u91CF",prop:"batch","show-overflow-tooltip":""},{default:u(({row:t})=>[n("div",null,[e[23]||(e[23]=s(" \u5546\u54C1\u7C7B\u578B: ")),n("span",no,v(t.product_type_name),1)]),n("div",null,[e[24]||(e[24]=s(" \u8D77\u6279\u91CF:")),n("span",ro,v(t.batch),1)])]),_:1}),o(d,{label:"\u89C4\u683C",prop:"store_info","show-overflow-tooltip":""}),o(d,{label:"\u5E93\u5B58/\u9500\u91CF",prop:"stock","show-overflow-tooltip":""},{default:u(({row:t})=>[n("span",io,v(t.stock),1),e[25]||(e[25]=s("/")),n("span",po,v(t.sales),1)]),_:1}),o(d,{label:"\u72B6\u6001",prop:"is_show"},{default:u(({row:t})=>[o(fe,{size:"large",onChange:y=>ie(t),modelValue:t.is_show,"onUpdate:modelValue":y=>t.is_show=y,"active-value":1,"inactive-value":0,"active-text":"\u4E0A\u67B6","inactive-text":"\u4E0B\u67B6","inline-prompt":""},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1}),o(d,{label:"\u6761\u7801",prop:"bar_code","show-overflow-tooltip":""}),o(d,{label:"\u64CD\u4F5C",width:"180",fixed:"right"},{default:u(({row:t})=>[t.delete_time==0||t.delete_time==null?(m(),Z("div",mo,[F((m(),f(O,{to:{path:"store_product_edit",query:{id:t.id,mode:"edit",page:l(b).page}},class:"mr-4"},{default:u(()=>[o(c,{type:"primary",link:""},{default:u(()=>e[26]||(e[26]=[s(" \u7F16\u8F91 ")])),_:1})]),_:2},1032,["to"])),[[h,["store_product.store_product/edit"]]]),F((m(),f(c,{type:"primary",link:"",onClick:y=>ae(t)},{default:u(()=>e[27]||(e[27]=[s(" \u8BE6\u60C5 ")])),_:2},1032,["onClick"])),[[h,["store_product.store_product/edit"]]]),o(c,{type:"primary",link:"",onClick:y=>se(t)},{default:u(()=>e[28]||(e[28]=[s(" \u590D\u5236 ")])),_:2},1032,["onClick"]),o(c,{type:"primary",link:"",onClick:y=>ne(t)},{default:u(()=>e[29]||(e[29]=[s(" \u590D\u5236\u5230\u4ED3\u5E93 ")])),_:2},1032,["onClick"]),F((m(),f(c,{type:"danger",link:"",onClick:y=>j(t.id)},{default:u(()=>e[30]||(e[30]=[s(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[h,["store_product.store_product/delete"]]])])):w("",!0),t.delete_time!=null?(m(),f(c,{key:1,type:"danger",link:"",onClick:y=>pe(t.id)},{default:u(()=>e[31]||(e[31]=[s(" \u6062\u590D ")])),_:2},1032,["onClick"])):w("",!0)]),_:1})]),_:1},8,["data"])]),n("div",_o,[o(ve,{modelValue:l(b),"onUpdate:modelValue":e[8]||(e[8]=t=>L(b)?b.value=t:null),onChange:l(g)},null,8,["modelValue","onChange"])])]),_:1})),[[ge,l(b).loading]]),o(Ze,{ref_key:"detailsRef",ref:x},null,512),l(S)?(m(),f(Je,{key:0,ref_key:"copyRef",ref:D,onSuccess:l(g),onClose:e[9]||(e[9]=t=>S.value=!1)},null,8,["onSuccess"])):w("",!0),l($)?(m(),f(Xe,{key:1,ref_key:"copyWarehouseRef",ref:V,onSuccess:l(g),onClose:e[10]||(e[10]=t=>$.value=!1)},null,8,["onSuccess"])):w("",!0),o(be,{modelValue:l(k),"onUpdate:modelValue":e[11]||(e[11]=t=>L(k)?k.value=t:null),title:"\u4EF7\u683C\u8D70\u52BF",width:"70%"},{default:u(()=>[(m(),f(ye,{ref:"priceChartRef",key:l(q),type:2,productId:l(K)},null,8,["productId"]))]),_:1},8,["modelValue"])])}}});export{Ct as default};
|