2 lines
8.2 KiB
JavaScript
2 lines
8.2 KiB
JavaScript
import{a2 as ae,H as le,J as se,K as ue,D as ne,C as re,w as ie,F as pe,L as ce,M as me,b as de,t as _e,N as fe,O as he}from"./element-plus.ebe4edc1.js";import{_ as ve}from"./index.vue_vue_type_script_setup_true_lang.311652af.js";import{_ as we}from"./index.vue_vue_type_script_setup_true_lang.34868847.js";import{d as T,s as be,r as _,Z as Ee,ap as L,o as i,c as P,U as e,L as t,u as a,T as ge,a9 as Ce,K as f,aa as U,R as r,M as x,j as K,a as c,a0 as C,S as F,Q as Fe,n as ye}from"./@vue.18505fe0.js";import{u as Be}from"./usePaging.6a6670f9.js";import{u as ke}from"./useDictOptions.b19b6c11.js";import{d as R,e as xe,b as Ve}from"./store_branch_product.00a5cfbf.js";import"./lodash.9da25972.js";import{a as De}from"./system_store.53207144.js";import{f as Se}from"./index.97d0e487.js";import{_ as Le}from"./edit.vue_vue_type_script_setup_true_name_storeBranchProductEdit_lang.9c3b5015.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.2abc406c.js";import"./axios.9e25675c.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.16bffd29.js";import"./index.vue_vue_type_style_index_0_scoped_b8e715d9_lang.220569d0.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.ae040c61.js";import"./color.130f7952.js";import"./clone.4a149bdb.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.e75c9f38.js";import"./vue-clipboard3.cacf014a.js";import"./clipboard.1f8f6543.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./picker.375b8b4c.js";import"./index.a00b7819.js";import"./index.53ec9cfa.js";import"./vuedraggable.d0c2add0.js";import"./vue.fcb68125.js";import"./sortablejs.430f5f4d.js";import"./store_product_unit.bac71e51.js";const Pe={class:"mt-4"},Ue={class:"flex mt-4 justify-end"},Ke=T({name:"storeBranchProductLists"}),So=T({...Ke,setup(Re){const y=be(),B=_(!1),u=Ee({store_id:"",store_name:"",bar_code:"",exchange:0,status:null,stock:null}),$=_([]),z=l=>{$.value=l.map(({id:s})=>s)},{dictData:A}=ke(""),{pager:p,getLists:m,resetParams:N,resetPage:h}=Be({fetchFun:R,params:u}),I=async l=>{var s,w;B.value=!0,await ye(),(s=y.value)==null||s.open("edit"),(w=y.value)==null||w.setFormData(l)},M=async l=>{await Se.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await xe({id:l}),m()};m();const v=_(!1),V=_([]),j=(l="")=>{v.value=!0,De({name:l,page_size:50}).then(s=>{V.value=s.lists,setTimeout(()=>{v.value=!1},300)}).catch(s=>{setTimeout(()=>{v.value=!1},300)})},O=l=>{Ve({id:l.id,store_name:l.store_name,image:l.image,price:l.price,unit:l.unit,status:l.status})},k=_("0"),q=l=>{l==0?(u.status=null,u.stock=null):l==1?(u.status=1,u.stock=null):l==2?(u.status=0,u.stock=null):l==3?(u.status=null,u.stock=10):l==4&&(u.status=null,u.stock=0),m()};return(l,s)=>{const w=se,G=ue,b=ne,D=re,E=ie,H=we,J=pe,S=ce,d=ae,Q=le,n=me,Z=de,W=_e,X=fe,Y=ve,ee=L("prems"),oe=L("perms"),te=he;return i(),P("div",null,[e(S,{class:"!border-none mb-4",shadow:"never"},{default:t(()=>[e(J,{class:"mb-[-16px]",model:a(u),inline:""},{default:t(()=>[e(b,{label:"\u95E8\u5E97",prop:"store_id"},{default:t(()=>[e(G,{modelValue:a(u).store_id,"onUpdate:modelValue":s[0]||(s[0]=o=>a(u).store_id=o),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":j,loading:a(v),style:{width:"240px"},onChange:a(h)},{default:t(()=>[(i(!0),P(ge,null,Ce(a(V),o=>(i(),f(w,{key:o.id,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])]),_:1}),e(b,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:t(()=>[e(D,{class:"w-[280px]",modelValue:a(u).store_name,"onUpdate:modelValue":s[1]||(s[1]=o=>a(u).store_name=o),onKeydown:U(a(h),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue","onKeydown"])]),_:1}),e(b,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:t(()=>[e(D,{class:"w-[280px]",modelValue:a(u).bar_code,"onUpdate:modelValue":s[2]||(s[2]=o=>a(u).bar_code=o),onKeydown:U(a(h),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801"},null,8,["modelValue","onKeydown"])]),_:1}),e(b,null,{default:t(()=>[e(E,{type:"primary",onClick:a(h)},{default:t(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(E,{onClick:a(N)},{default:t(()=>[r("\u91CD\u7F6E")]),_:1},8,["onClick"]),e(H,{class:"ml-2.5","fetch-fun":a(R),params:a(u),"page-size":a(p).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),x((i(),f(S,{class:"!border-none",shadow:"never"},{default:t(()=>[e(Q,{modelValue:a(k),"onUpdate:modelValue":s[3]||(s[3]=o=>K(k)?k.value=o:null),onChange:q},{default:t(()=>[e(d,{label:"0"},{default:t(()=>[r("\u5168\u90E8")]),_:1}),e(d,{label:"1"},{default:t(()=>[r("\u4E0A\u67B6")]),_:1}),e(d,{label:"2"},{default:t(()=>[r("\u4E0B\u67B6")]),_:1}),e(d,{label:"3"},{default:t(()=>[r("\u5E93\u5B58\u8B66\u544A")]),_:1}),e(d,{label:"4"},{default:t(()=>[r("\u5DF2\u552E\u7F44")]),_:1})]),_:1},8,["modelValue"]),c("div",Pe,[e(X,{data:a(p).lists,onSelectionChange:z},{default:t(()=>[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:t(({row:o})=>[e(Z,{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:t(({row:o})=>[c("span",{class:"w-[40px] h-[40px]",style:C(o.purchase==0?"color:red":"")},F(o.purchase),5)]),_:1}),e(n,{label:"\u5546\u6237\u4EF7",prop:"cost","min-width":"120","show-overflow-tooltip":""},{default:t(({row:o})=>[c("span",{class:"w-[40px] h-[40px]",style:C(o.cost==0?"color:red":"")},F(o.cost),5)]),_:1}),e(n,{label:"\u4F1A\u5458\u4EF7",prop:"vip_price","min-width":"120","show-overflow-tooltip":""},{default:t(({row:o})=>[c("span",{class:"w-[40px] h-[40px]",style:C(o.vip_price==0?"color:red":"")},F(o.vip_price),5)]),_:1}),e(n,{label:"\u7EC8\u7AEF\u96F6\u552E\u4EF7",prop:"price","min-width":"120","show-overflow-tooltip":""},{default:t(({row:o})=>[c("span",{class:"w-[40px] h-[40px]",style:C(o.price==0?"color:red":"")},F(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:"\u5151\u6362\u5E93\u5B58",prop:"swap","show-overflow-tooltip":""}),e(n,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(n,{label:"\u72B6\u6001",prop:"status"},{default:t(({row:o})=>[e(W,{size:"large",onChange:g=>O(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:t(({row:o})=>[x((i(),f(E,{type:"primary",link:"",onClick:g=>I(o)},{default:t(()=>[r("\u7F16\u8F91")]),_:2},1032,["onClick"])),[[ee,["store_branch_product.store_branch_product/deit"]]]),x((i(),f(E,{type:"danger",link:"",onClick:g=>M(o.id)},{default:t(()=>[r("\u5220\u9664")]),_:2},1032,["onClick"])),[[oe,["store_branch_product.store_branch_product/delete"]]])]),_:1})]),_:1},8,["data"])]),c("div",Ue,[e(Y,{modelValue:a(p),"onUpdate:modelValue":s[4]||(s[4]=o=>K(p)?p.value=o:null),onChange:a(m)},null,8,["modelValue","onChange"])])]),_:1})),[[te,a(p).loading]]),a(B)?(i(),f(Le,{key:0,ref_key:"editRef",ref:y,"dict-data":a(A),onSuccess:a(m),onClose:s[5]||(s[5]=o=>B.value=!1)},null,8,["dict-data","onSuccess"])):Fe("",!0)])}}});export{So as default};
|