2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
import{a4 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 be,t as ve,N as Ee,O as we}from"./element-plus.91c68cc0.js";import{_ as he}from"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import{_ as ge}from"./index.vue_vue_type_script_setup_true_lang.d134accc.js";import{d as A,s as Ce,r as _,Z as Fe,i as ye,ap as $,o as r,c as C,U as o,L as a,u as l,T as V,a9 as x,K as v,aa as K,R as i,M as D,j as T,a as E,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.1f11cf62.js";import{a as z,e as De,c as Se}from"./store_branch_product.1a7156de.js";import"./lodash.4e6d2a38.js";import{a as Ue}from"./system_store.de1a4364.js";import{f as Le}from"./index.d12b3af4.js";import{_ as Pe}from"./edit.vue_vue_type_script_setup_true_name_storeBranchProductEdit_lang.a18ae869.js";import{_ as Re}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.9a96dd30.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.e03c2e5b.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.bb96af0c.js";import"./index.f2e66d1e.js";import"./index.839c505b.js";import"./vuedraggable.c04c7c0c.js";import"./vue.3299ef77.js";import"./sortablejs.c62bcaf8.js";import"./store_product_unit.dc1a8ac4.js";const $e={class:"mt-4"},Ke={class:"flex mt-4 justify-end"},Te=A({name:"storeBranchProductLists"}),To=A({...Te,setup(ze){const F=Ce(),y=_(!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:t})=>t)},{dictData:j}=xe(""),{pager:p,getLists:f,resetParams:O,resetPage:d}=Ve({fetchFun:z,params:u}),q=async s=>{var t,m;y.value=!0,await ke(),(t=F.value)==null||t.open("edit"),(m=F.value)==null||m.setFormData(s)},G=async s=>{await Le.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await De({id:s}),f()};ye(()=>{f()});const w=_(!1),L=_([]),H=(s="")=>{w.value=!0,Ue({name:s,page_size:50}).then(t=>{L.value=t.lists,setTimeout(()=>{w.value=!1},300)}).catch(t=>{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})},B=_("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),f()};return(s,t)=>{const m=re,k=ie,c=pe,P=de,h=me,Z=ge,W=ce,R=_e,b=se,X=ne,n=fe,Y=be,ee=ve,oe=Ee,te=he,le=$("prems"),ae=$("perms"),ue=we;return r(),C("div",null,[o(R,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[o(W,{class:"mb-[-16px]",model:l(u),inline:""},{default:a(()=>[o(c,{label:"\u95E8\u5E97",prop:"store_id"},{default:a(()=>[o(k,{modelValue:l(u).store_id,"onUpdate:modelValue":t[0]||(t[0]=e=>l(u).store_id=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":H,loading:l(w),style:{width:"240px"},onChange:l(d)},{default:a(()=>[(r(!0),C(V,null,x(l(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:a(()=>[o(P,{class:"w-[280px]",modelValue:l(u).store_name,"onUpdate:modelValue":t[1]||(t[1]=e=>l(u).store_name=e),onKeydown:K(l(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:a(()=>[o(P,{class:"w-[280px]",modelValue:l(u).bar_code,"onUpdate:modelValue":t[2]||(t[2]=e=>l(u).bar_code=e),onKeydown:K(l(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:a(()=>[o(k,{modelValue:l(u).order_by,"onUpdate:modelValue":t[3]||(t[3]=e=>l(u).order_by=e),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"}],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:a(()=>[o(k,{modelValue:l(u).status,"onUpdate:modelValue":t[4]||(t[4]=e=>l(u).status=e),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"}],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:a(()=>[o(h,{type:"primary",onClick:l(d)},{default:a(()=>t[8]||(t[8]=[i("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(h,{onClick:l(O)},{default:a(()=>t[9]||(t[9]=[i("\u91CD\u7F6E")])),_:1},8,["onClick"]),o(Z,{class:"ml-2.5","fetch-fun":l(z),params:l(u),"page-size":l(p).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),D((r(),v(R,{class:"!border-none",shadow:"never"},{default:a(()=>[o(X,{modelValue:l(B),"onUpdate:modelValue":t[5]||(t[5]=e=>T(B)?B.value=e:null),onChange:Q},{default:a(()=>[o(b,{label:"0"},{default:a(()=>t[10]||(t[10]=[i("\u5168\u90E8")])),_:1}),o(b,{label:"1"},{default:a(()=>t[11]||(t[11]=[i("\u4E0A\u67B6")])),_:1}),o(b,{label:"2"},{default:a(()=>t[12]||(t[12]=[i("\u4E0B\u67B6")])),_:1}),o(b,{label:"3"},{default:a(()=>t[13]||(t[13]=[i("\u5E93\u5B58\u8B66\u544A")])),_:1}),o(b,{label:"4"},{default:a(()=>t[14]||(t[14]=[i("\u5DF2\u552E\u7F44")])),_:1})]),_:1},8,["modelValue"]),E("div",$e,[o(oe,{data:l(p).lists,onSelectionChange:M},{default:a(()=>[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:a(({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:a(({row:e})=>[E("span",{class:"w-[40px] h-[40px]",style:S(e.purchase==0?"color:red":"")},U(e.purchase),5)]),_:1}),o(n,{label:"\u5546\u6237\u4EF7",prop:"cost","min-width":"120","show-overflow-tooltip":""},{default:a(({row:e})=>[E("span",{class:"w-[40px] h-[40px]",style:S(e.cost==0?"color:red":"")},U(e.cost),5)]),_:1}),o(n,{label:"\u7EC8\u7AEF\u96F6\u552E\u4EF7",prop:"price","min-width":"120","show-overflow-tooltip":""},{default:a(({row:e})=>[E("span",{class:"w-[40px] h-[40px]",style:S(e.price==0?"color:red":"")},U(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:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),o(n,{label:"\u4EF7\u503C",prop:"total_price","show-overflow-tooltip":""}),o(n,{label:"\u72B6\u6001",prop:"status"},{default:a(({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:a(({row:e})=>[D((r(),v(h,{type:"primary",link:"",onClick:g=>q(e)},{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=>G(e.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"])]),E("div",Ke,[o(te,{modelValue:l(p),"onUpdate:modelValue":t[6]||(t[6]=e=>T(p)?p.value=e:null),onChange:l(f)},null,8,["modelValue","onChange"])])]),_:1})),[[ue,l(p).loading]]),l(y)?(r(),v(Pe,{key:0,ref_key:"editRef",ref:F,"dict-data":l(j),onSuccess:l(f),onClose:t[7]||(t[7]=e=>y.value=!1)},null,8,["dict-data","onSuccess"])):Be("",!0),o(Re,{ref_key:"detailsRef",ref:N},null,512)])}}});export{To as default};
|