2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
import{a2 as Z,H as W,J as X,K as Y,D as ee,C as oe,w as te,F as le,L as ae,M as se,b as ue,t as ne,N as re,O as ie}from"./element-plus.5a7ba693.js";import{_ as pe}from"./index.vue_vue_type_script_setup_true_lang.bd623527.js";import{d as U,s as me,r as d,Z as de,ap as ce,o as i,c as y,U as e,L as l,u as t,T as _e,a9 as fe,K as h,aa as D,R as r,M as x,j as S,a as L,Q as ve,n as be}from"./@vue.18505fe0.js";import{u as he}from"./usePaging.6a6670f9.js";import{u as we}from"./useDictOptions.a3f298d7.js";import{b as Ce,d as Ee}from"./store_branch_product.d429d02f.js";import"./lodash.60201f64.js";import{a as ge}from"./system_store.02f99212.js";import"./index.5c2d321b.js";import{_ as Fe}from"./edit.vue_vue_type_script_setup_true_name_storeBranchProductEdit_lang.54060f4f.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.8ae0c638.js";import"./axios.2b8d80bd.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.b82a2ce7.js";import"./color.b905eb26.js";import"./clone.e1fb2883.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.495afef3.js";import"./vue-clipboard3.cb649e18.js";import"./clipboard.4592e390.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./picker.ff602e29.js";import"./index.b110836f.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./index.4a2655b0.js";import"./index.0b1a8ccb.js";import"./vuedraggable.d1fd737a.js";import"./vue.feef8fd6.js";import"./sortablejs.c8f4cbb7.js";import"./store_product_unit.a88fee37.js";const Be={class:"mt-4"},Ve={class:"flex mt-4 justify-end"},ke=U({name:"storeBranchProductLists"}),Eo=U({...ke,setup(ye){const w=me(),C=d(!1),u=de({store_id:"",store_name:"",bar_code:"",exchange:0,status:null,stock:null}),P=d([]),K=s=>{P.value=s.map(({id:a})=>a)},{dictData:R}=we(""),{pager:p,getLists:c,resetParams:T,resetPage:_}=he({fetchFun:Ee,params:u}),N=async s=>{var a,v;C.value=!0,await be(),(a=w.value)==null||a.open("edit"),(v=w.value)==null||v.setFormData(s)};c();const f=d(!1),B=d([]),$=(s="")=>{f.value=!0,ge({name:s,page_size:50}).then(a=>{B.value=a.lists,setTimeout(()=>{f.value=!1},300)}).catch(a=>{setTimeout(()=>{f.value=!1},300)})},I=s=>{Ce({id:s.id,store_name:s.store_name,image:s.image,price:s.price,unit:s.unit,status:s.status})},E=d("0"),A=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),c()};return(s,a)=>{const v=X,M=Y,b=ee,V=oe,g=te,j=le,k=ae,m=Z,z=W,n=se,O=ue,q=ne,G=re,H=pe,J=ce("prems"),Q=ie;return i(),y("div",null,[e(k,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[e(j,{class:"mb-[-16px]",model:t(u),inline:""},{default:l(()=>[e(b,{label:"\u95E8\u5E97",prop:"store_id"},{default:l(()=>[e(M,{modelValue:t(u).store_id,"onUpdate:modelValue":a[0]||(a[0]=o=>t(u).store_id=o),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":$,loading:t(f),style:{width:"240px"},onChange:t(_)},{default:l(()=>[(i(!0),y(_e,null,fe(t(B),o=>(i(),h(v,{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:l(()=>[e(V,{class:"w-[280px]",modelValue:t(u).store_name,"onUpdate:modelValue":a[1]||(a[1]=o=>t(u).store_name=o),onKeydown:D(t(_),["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:l(()=>[e(V,{class:"w-[280px]",modelValue:t(u).bar_code,"onUpdate:modelValue":a[2]||(a[2]=o=>t(u).bar_code=o),onKeydown:D(t(_),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801"},null,8,["modelValue","onKeydown"])]),_:1}),e(b,null,{default:l(()=>[e(g,{type:"primary",onClick:t(_)},{default:l(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(g,{onClick:t(T)},{default:l(()=>[r("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),x((i(),h(k,{class:"!border-none",shadow:"never"},{default:l(()=>[e(z,{modelValue:t(E),"onUpdate:modelValue":a[3]||(a[3]=o=>S(E)?E.value=o:null),onChange:A},{default:l(()=>[e(m,{label:"0"},{default:l(()=>[r("\u5168\u90E8")]),_:1}),e(m,{label:"1"},{default:l(()=>[r("\u4E0A\u67B6")]),_:1}),e(m,{label:"2"},{default:l(()=>[r("\u4E0B\u67B6")]),_:1}),e(m,{label:"3"},{default:l(()=>[r("\u5E93\u5B58\u8B66\u544A")]),_:1}),e(m,{label:"4"},{default:l(()=>[r("\u5DF2\u552E\u7F44")]),_:1})]),_:1},8,["modelValue"]),L("div",Be,[e(G,{data:t(p).lists,onSelectionChange:K},{default:l(()=>[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:l(({row:o})=>[e(O,{class:"w-[40px] h-[40px]",src:o.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(n,{label:"\u4EF7\u683C",prop:"price","show-overflow-tooltip":""}),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:l(({row:o})=>[e(q,{size:"large",onChange:F=>I(o),modelValue:o.status,"onUpdate:modelValue":F=>o.status=F,"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:l(({row:o})=>[x((i(),h(g,{type:"primary",link:"",onClick:F=>N(o)},{default:l(()=>[r("\u7F16\u8F91")]),_:2},1032,["onClick"])),[[J,["store_branch_product.store_branch_product/deit"]]])]),_:1})]),_:1},8,["data"])]),L("div",Ve,[e(H,{modelValue:t(p),"onUpdate:modelValue":a[4]||(a[4]=o=>S(p)?p.value=o:null),onChange:t(c)},null,8,["modelValue","onChange"])])]),_:1})),[[Q,t(p).loading]]),t(C)?(i(),h(Fe,{key:0,ref_key:"editRef",ref:w,"dict-data":t(R),onSuccess:t(c),onClose:a[5]||(a[5]=o=>C.value=!1)},null,8,["dict-data","onSuccess"])):ve("",!0)])}}});export{Eo as default};
|