2 lines
9.7 KiB
JavaScript
2 lines
9.7 KiB
JavaScript
import{M as oe,C as te,D as le,N as ae,O as ue,w as se,F as ne,K as re,G as ie,b as pe,t as de,H as me,I as _e}from"./element-plus.8e273e86.js";import{_ as ce}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{_ as fe}from"./index.vue_vue_type_script_setup_true_lang.f8366c38.js";import{d as N,s as Ce,r as E,Z as ve,i as be,af as ge,ap as ye,o as c,c as we,U as o,L as a,u as l,aa as he,R as r,M as g,K as b,a as n,S as f,j as Ee,Q as Fe,n as Be}from"./@vue.76ce7aa3.js";import{u as De}from"./usePaging.f8c888e4.js";import{u as Ve}from"./useDictOptions.66a6bcee.js";import{a as K,g as ke,h as xe}from"./store_product.88054e51.js";import"./lodash.41b9567d.js";import{f as Se}from"./index.da348ba1.js";import{_ as Ae}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.3c5b5f50.js";import{_ as Pe}from"./copy.vue_vue_type_script_setup_true_name_storeProductEdit_lang.fc226a79.js";import{a as Ue}from"./store_category.6c8be7ea.js";import{u as $e}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.0b11b102.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"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./system_store.4b403c4a.js";import"./warehouse_product_storege.a6861efc.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.f06fa423.js";const ze={class:"mt-4"},Ie={style:{color:"red"}},Le={style:{color:"red"}},Re={style:{color:"red"}},qe={style:{color:"red"}},Ke={style:{color:"red"}},Ne={class:"mr-1"},Te={class:"ml-1"},Me={class:"flex mt-4 justify-end"},je=N({name:"storeProductLists"}),Ko=N({...je,setup(Oe){const U=$e(),F=Ce(),B=E(null),D=E(!1),s=ve({store_name:"",class_all:"",is_show:"",id:"",bar_code:"",product_type:""}),V=E([]),T=u=>{V.value=u.map(({id:e})=>e)};Ve("");let $=1;U.query.page_no&&($=parseInt(U.query.page_no));const{pager:C,getLists:h,resetParams:M,resetPage:v}=De({page:$,fetchFun:K,params:s}),j=async u=>{var e,p;(e=B.value)==null||e.open(),(p=B.value)==null||p.setFormData(u)},O=async u=>{var e,p;D.value=!0,await Be(),(e=F.value)==null||e.open("edit"),(p=F.value)==null||p.setFormData(u)};let k,x;const S=E(!1);let A;const G=u=>(A=u,S.value=!0,z.lazyLoad(x,k),!1),z={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(u,e){k||(k=e),x||(x=u);const p=u.value||0;let d={};S.value?(d={name:A},A||(d={pid:p,page_size:1e4})):d={pid:p,page_size:1e4},Ue({...d}).then(P=>{e(P.lists.map(m=>(m.leaf=!0,S.value=!1,m)))})}},H=u=>{ke({id:u.id,is_show:u.is_show})},I=async u=>{await Se.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await xe({id:u}),h()};return be(()=>{h()}),(u,e)=>{const p=te,d=le,P=oe,m=ae,L=ue,_=se,Q=fe,Z=ne,R=re,q=ge("router-link"),i=ie,J=pe,W=de,X=me,Y=ce,y=ye("perms"),ee=_e;return c(),we("div",null,[o(R,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[o(Z,{class:"mb-[-16px]",model:l(s),inline:""},{default:a(()=>[o(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[o(p,{class:"w-[280px]",onKeydown:he(l(v),["enter"]),modelValue:l(s).store_name,"onUpdate:modelValue":e[0]||(e[0]=t=>l(s).store_name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),o(d,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[o(p,{class:"w-[280px]",modelValue:l(s).bar_code,"onUpdate:modelValue":e[1]||(e[1]=t=>l(s).bar_code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",onChange:l(v)},null,8,["modelValue","onChange"])]),_:1}),o(d,{label:"\u5546\u54C1ID",prop:"id"},{default:a(()=>[o(p,{class:"w-[280px]",modelValue:l(s).id,"onUpdate:modelValue":e[2]||(e[2]=t=>l(s).id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1ID",onChange:l(v)},null,8,["modelValue","onChange"])]),_:1}),o(d,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:a(()=>[o(P,{class:"w-[280px]",modelValue:l(s).class_all,"onUpdate:modelValue":e[3]||(e[3]=t=>l(s).class_all=t),filterable:"",clearable:"","before-filter":G,props:z,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:l(v)},null,8,["modelValue","onChange"])]),_:1}),o(d,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type"},{default:a(()=>[o(L,{modelValue:l(s).product_type,"onUpdate:modelValue":e[4]||(e[4]=t=>l(s).product_type=t),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",style:{width:"240px"},onChange:l(v)},{default:a(()=>[o(m,{label:"\u666E\u901A\u5546\u54C1",value:"0"}),o(m,{label:"\u5151\u6362\u4EA7\u54C1",value:"2"}),o(m,{label:"\u6D3B\u52A8\u5546\u54C1",value:"4"}),o(m,{label:"\u6279\u53D1\u4EA7\u54C1",value:"5"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(d,{label:"\u663E\u793A",prop:"is_show"},{default:a(()=>[o(L,{modelValue:l(s).is_show,"onUpdate:modelValue":e[5]||(e[5]=t=>l(s).is_show=t),placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A",style:{width:"240px"},onChange:l(v)},{default:a(()=>[o(m,{label:"\u663E\u793A",value:"1"}),o(m,{label:"\u4E0D\u663E\u793A",value:"0"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(d,null,{default:a(()=>[o(_,{type:"primary",onClick:l(v)},{default:a(()=>e[9]||(e[9]=[r("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(_,{onClick:l(M)},{default:a(()=>e[10]||(e[10]=[r("\u91CD\u7F6E")])),_:1},8,["onClick"]),o(Q,{class:"ml-2.5","fetch-fun":l(K),params:l(s),"page-size":l(C).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),g((c(),b(R,{class:"!border-none",shadow:"never"},{default:a(()=>[g((c(),b(q,{to:{path:"store_product_edit",query:{id:0,mode:"add"}},class:"mr-4"},{default:a(()=>[o(_,{type:"primary",icon:"Plus"},{default:a(()=>e[11]||(e[11]=[r(" \u65B0\u589E ")])),_:1})]),_:1})),[[y,["store_product.store_product/add"]]]),g((c(),b(_,{disabled:!l(V).length,onClick:e[6]||(e[6]=t=>I(l(V)))},{default:a(()=>e[12]||(e[12]=[r(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[y,["store_product.store_product/delete"]]]),n("div",ze,[o(X,{data:l(C).lists,onSelectionChange:T},{default:a(()=>[o(i,{type:"selection",width:"55"}),o(i,{label:"ID",prop:"id","show-overflow-tooltip":""}),o(i,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:a(({row:t})=>[o(J,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(i,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""},{default:a(({row:t})=>[n("div",null,f(t.store_name),1),n("div",null,[e[13]||(e[13]=r(" \u4F9B\u8D27\u4EF7:")),n("span",Ie,f(t.purchase),1)]),n("div",null,[e[14]||(e[14]=r(" \u5546\u6237\u4EF7: ")),n("span",Le,f(t.cost),1)]),n("div",null,[e[15]||(e[15]=r(" \u96F6\u552E\u4EF7:")),n("span",Re,f(t.price),1)])]),_:1}),o(i,{label:"\u5206\u7C7B",prop:"cate_name","show-overflow-tooltip":""}),o(i,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),o(i,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type_name","show-overflow-tooltip":""}),o(i,{label:"\u8D77\u6279\u91CF/\u6BDB\u5229\u7387",prop:"batch","show-overflow-tooltip":""},{default:a(({row:t})=>[n("div",null,[e[16]||(e[16]=r(" \u8D77\u6279\u91CF:")),n("span",qe,f(t.batch),1)]),n("div",null,[e[17]||(e[17]=r(" \u6BDB\u5229\u7387: ")),n("span",Ke,f(t.rose),1)])]),_:1}),o(i,{label:"\u89C4\u683C",prop:"store_info","show-overflow-tooltip":""}),o(i,{label:"\u5E93\u5B58/\u9500\u91CF",prop:"stock","show-overflow-tooltip":""},{default:a(({row:t})=>[n("span",Ne,f(t.stock),1),e[18]||(e[18]=r("/")),n("span",Te,f(t.sales),1)]),_:1}),o(i,{label:"\u72B6\u6001",prop:"is_show"},{default:a(({row:t})=>[o(W,{size:"large",onChange:w=>H(t),modelValue:t.is_show,"onUpdate:modelValue":w=>t.is_show=w,"active-value":1,"inactive-value":0,"active-text":"\u4E0A\u67B6","inactive-text":"\u4E0B\u67B6","inline-prompt":""},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1}),o(i,{label:"\u6761\u7801",prop:"bar_code","show-overflow-tooltip":""}),o(i,{label:"\u64CD\u4F5C",width:"180",fixed:"right"},{default:a(({row:t})=>[g((c(),b(q,{to:{path:"store_product_edit",query:{id:t.id,mode:"edit",page:l(C).page}},class:"mr-4"},{default:a(()=>[o(_,{type:"primary",link:""},{default:a(()=>e[19]||(e[19]=[r(" \u7F16\u8F91 ")])),_:1})]),_:2},1032,["to"])),[[y,["store_product.store_product/edit"]]]),g((c(),b(_,{type:"primary",link:"",onClick:w=>j(t)},{default:a(()=>e[20]||(e[20]=[r(" \u8BE6\u60C5 ")])),_:2},1032,["onClick"])),[[y,["store_product.store_product/edit"]]]),o(_,{type:"primary",link:"",onClick:w=>O(t)},{default:a(()=>e[21]||(e[21]=[r(" \u590D\u5236 ")])),_:2},1032,["onClick"]),g((c(),b(_,{type:"danger",link:"",onClick:w=>I(t.id)},{default:a(()=>e[22]||(e[22]=[r(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[y,["store_product.store_product/delete"]]])]),_:1})]),_:1},8,["data"])]),n("div",Me,[o(Y,{modelValue:l(C),"onUpdate:modelValue":e[7]||(e[7]=t=>Ee(C)?C.value=t:null),onChange:l(h)},null,8,["modelValue","onChange"])])]),_:1})),[[ee,l(C).loading]]),o(Ae,{ref_key:"detailsRef",ref:B},null,512),l(D)?(c(),b(Pe,{key:0,ref_key:"copyRef",ref:F,onSuccess:l(h),onClose:e[8]||(e[8]=t=>D.value=!1)},null,8,["onSuccess"])):Fe("",!0)])}}});export{Ko as default};
|