moreShopAdmin/build/admin/assets/index2.940fabec.js

2 lines
9.3 KiB
JavaScript

import{a3 as se,Q as ne,N as re,O as ie,D as pe,C as de,w as me,F as ce,K as _e,G as fe,b as be,t as ve,H as we,I as Ee}from"./element-plus.8e273e86.js";import{_ as he}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{_ as ge}from"./index.vue_vue_type_script_setup_true_lang.fd925c92.js";import{d as z,s as Ce,r as _,Z as Fe,i as ye,ap as $,o as r,c as C,U as e,L as a,u as l,T as V,a9 as x,K as v,aa as A,R as i,M as D,j as K,a as w,a0 as S,S as U,Q as Be,n as ke}from"./@vue.76ce7aa3.js";import{u as Ve}from"./usePaging.f8c888e4.js";import{u as xe}from"./useDictOptions.0dd5e671.js";import{a as T,f as De,c as Se}from"./store_branch_product.ac0ad4d4.js";import"./lodash.4e6d2a38.js";import{a as Ue}from"./system_store.205c69d8.js";import{f as Pe}from"./index.91315c44.js";import{_ as Re}from"./edit.vue_vue_type_script_setup_true_name_storeBranchProductEdit_lang.6f59ddcf.js";import{_ as Le}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.10b167b6.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.2d5cf0a7.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"./vue-router.10bd5b90.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"./picker.f5cc8bd6.js";import"./index.7596567c.js";import"./index.fb4305ae.js";import"./vuedraggable.c04c7c0c.js";import"./vue.3299ef77.js";import"./sortablejs.c62bcaf8.js";import"./store_product_unit.0c3fad1a.js";const $e={class:"mt-4"},Ae={class:"flex mt-4 justify-end"},Ke=z({name:"storeBranchProductLists"}),Ko=z({...Ke,setup(Te){const F=Ce(),y=_(!1),I=_(null),u=Fe({store_id:"",store_name:"",bar_code:"",exchange:0,status:null,order_by:"",field:"stock",low_stock:1}),N=_([]),M=s=>{N.value=s.map(({id:t})=>t)},{dictData:j}=xe(""),{pager:p,getLists:f,resetParams:G,resetPage:d}=Ve({fetchFun:T,params:u}),O=async s=>{var t,m;y.value=!0,await ke(),(t=F.value)==null||t.open("edit"),(m=F.value)==null||m.setFormData(s)},Q=async s=>{await Pe.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await De({id:s}),f()};ye(()=>{f()});const E=_(!1),P=_([]),q=(s="")=>{E.value=!0,Ue({name:s,page_size:50}).then(t=>{P.value=t.lists,setTimeout(()=>{E.value=!1},300)}).catch(t=>{setTimeout(()=>{E.value=!1},300)})},H=s=>{Se({id:s.id,store_name:s.store_name,image:s.image,price:s.price,unit:s.unit,status:s.status})},B=_("0"),Z=s=>{s==0?(u.status=null,u.stock=null):s==1?(u.status=1,u.stock=null):s==2?(u.status=0,u.stock=null):s==3?(u.status=null,u.stock=10):s==4&&(u.status=null,u.stock=0),f()};return(s,t)=>{const m=re,k=ie,c=pe,R=de,h=me,J=ge,W=ce,L=_e,b=se,X=ne,n=fe,Y=be,ee=ve,oe=we,te=he,le=$("prems"),ae=$("perms"),ue=Ee;return r(),C("div",null,[e(L,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(W,{class:"mb-[-16px]",model:l(u),inline:""},{default:a(()=>[e(c,{label:"\u95E8\u5E97",prop:"store_id"},{default:a(()=>[e(k,{modelValue:l(u).store_id,"onUpdate:modelValue":t[0]||(t[0]=o=>l(u).store_id=o),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":q,loading:l(E),style:{width:"240px"},onChange:l(d)},{default:a(()=>[(r(!0),C(V,null,x(l(P),o=>(r(),v(m,{key:o.id,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])]),_:1}),e(c,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[e(R,{class:"w-[280px]",modelValue:l(u).store_name,"onUpdate:modelValue":t[1]||(t[1]=o=>l(u).store_name=o),onKeydown:A(l(d),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue","onKeydown"])]),_:1}),e(c,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[e(R,{class:"w-[280px]",modelValue:l(u).bar_code,"onUpdate:modelValue":t[2]||(t[2]=o=>l(u).bar_code=o),onKeydown:A(l(d),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801"},null,8,["modelValue","onKeydown"])]),_:1}),e(c,{label:"\u6392\u5E8F",prop:"order_by"},{default:a(()=>[e(k,{modelValue:l(u).order_by,"onUpdate:modelValue":t[3]||(t[3]=o=>l(u).order_by=o),placeholder:"\u8BF7\u9009\u62E9\u6392\u5E8F",style:{width:"240px"},onChange:l(d)},{default:a(()=>[(r(),C(V,null,x([{id:"asc",name:"\u5347\u5E8F"},{id:"desc",name:"\u964D\u5E8F"}],o=>e(m,{key:o.id,label:o.name,value:o.id},null,8,["label","value"])),64))]),_:1},8,["modelValue","onChange"])]),_:1}),e(c,{label:"\u72B6\u6001",prop:"bar_code"},{default:a(()=>[e(k,{modelValue:l(u).status,"onUpdate:modelValue":t[4]||(t[4]=o=>l(u).status=o),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",style:{width:"240px"},onChange:l(d)},{default:a(()=>[(r(),C(V,null,x([{id:1,name:"\u4E0A\u67B6"},{id:0,name:"\u4E0B\u67B6"}],o=>e(m,{key:o.id,label:o.name,value:o.id},null,8,["label","value"])),64))]),_:1},8,["modelValue","onChange"])]),_:1}),e(c,null,{default:a(()=>[e(h,{type:"primary",onClick:l(d)},{default:a(()=>t[8]||(t[8]=[i("\u67E5\u8BE2")])),_:1},8,["onClick"]),e(h,{onClick:l(G)},{default:a(()=>t[9]||(t[9]=[i("\u91CD\u7F6E")])),_:1},8,["onClick"]),e(J,{class:"ml-2.5","fetch-fun":l(T),params:l(u),"page-size":l(p).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),D((r(),v(L,{class:"!border-none",shadow:"never"},{default:a(()=>[e(X,{modelValue:l(B),"onUpdate:modelValue":t[5]||(t[5]=o=>K(B)?B.value=o:null),onChange:Z},{default:a(()=>[e(b,{label:"0"},{default:a(()=>t[10]||(t[10]=[i("\u5168\u90E8")])),_:1}),e(b,{label:"1"},{default:a(()=>t[11]||(t[11]=[i("\u4E0A\u67B6")])),_:1}),e(b,{label:"2"},{default:a(()=>t[12]||(t[12]=[i("\u4E0B\u67B6")])),_:1}),e(b,{label:"3"},{default:a(()=>t[13]||(t[13]=[i("\u5E93\u5B58\u8B66\u544A")])),_:1}),e(b,{label:"4"},{default:a(()=>t[14]||(t[14]=[i("\u5DF2\u552E\u7F44")])),_:1})]),_:1},8,["modelValue"]),w("div",$e,[e(oe,{data:l(p).lists,onSelectionChange:M},{default:a(()=>[e(n,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(n,{label:"\u95E8\u5E97",prop:"system_store_name","show-overflow-tooltip":""}),e(n,{label:"\u5206\u7C7B",prop:"cate_name","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","show-overflow-tooltip":""},{default:a(({row:o})=>[e(Y,{class:"w-[40px] h-[40px]",src:o.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(n,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase","min-width":"100","show-overflow-tooltip":""},{default:a(({row:o})=>[w("span",{class:"w-[40px] h-[40px]",style:S(o.purchase==0?"color:red":"")},U(o.purchase),5)]),_:1}),e(n,{label:"\u5546\u6237\u4EF7",prop:"cost","min-width":"120","show-overflow-tooltip":""},{default:a(({row:o})=>[w("span",{class:"w-[40px] h-[40px]",style:S(o.cost==0?"color:red":"")},U(o.cost),5)]),_:1}),e(n,{label:"\u7EC8\u7AEF\u96F6\u552E\u4EF7",prop:"price","min-width":"120","show-overflow-tooltip":""},{default:a(({row:o})=>[w("span",{class:"w-[40px] h-[40px]",style:S(o.price==0?"color:red":"")},U(o.price),5)]),_:1}),e(n,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code","show-overflow-tooltip":""}),e(n,{label:"\u9500\u91CF",prop:"sales","show-overflow-tooltip":""}),e(n,{label:"\u552E\u5356\u5E93\u5B58",prop:"stock","show-overflow-tooltip":""}),e(n,{label:"\u544A\u8B66\u5E93\u5B58",prop:"low_stock","show-overflow-tooltip":""}),e(n,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(n,{label:"\u4EF7\u503C",prop:"total_price","show-overflow-tooltip":""}),e(n,{label:"\u72B6\u6001",prop:"status"},{default:a(({row:o})=>[e(ee,{size:"large",onChange:g=>H(o),modelValue:o.status,"onUpdate:modelValue":g=>o.status=g,"active-value":1,"inactive-value":0,"active-text":"\u4E0A\u67B6","inactive-text":"\u4E0B\u67B6","inline-prompt":""},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1}),e(n,{label:"\u64CD\u4F5C","min-width":"140",fixed:"right",align:"center","show-overflow-tooltip":""},{default:a(({row:o})=>[D((r(),v(h,{type:"primary",link:"",onClick:g=>O(o)},{default:a(()=>t[15]||(t[15]=[i("\u7F16\u8F91")])),_:2},1032,["onClick"])),[[le,["store_branch_product.store_branch_product/deit"]]]),D((r(),v(h,{type:"danger",link:"",onClick:g=>Q(o.id)},{default:a(()=>t[16]||(t[16]=[i("\u5220\u9664")])),_:2},1032,["onClick"])),[[ae,["store_branch_product.store_branch_product/delete"]]])]),_:1})]),_:1},8,["data"])]),w("div",Ae,[e(te,{modelValue:l(p),"onUpdate:modelValue":t[6]||(t[6]=o=>K(p)?p.value=o:null),onChange:l(f)},null,8,["modelValue","onChange"])])]),_:1})),[[ue,l(p).loading]]),l(y)?(r(),v(Re,{key:0,ref_key:"editRef",ref:F,"dict-data":l(j),onSuccess:l(f),onClose:t[7]||(t[7]=o=>y.value=!1)},null,8,["dict-data","onSuccess"])):Be("",!0),e(Le,{ref_key:"detailsRef",ref:I},null,512)])}}});export{Ko as default};