moreShopAdmin/build/admin/assets/index.7cdae822.js

2 lines
9.2 KiB
JavaScript

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