2 lines
4.6 KiB
JavaScript
2 lines
4.6 KiB
JavaScript
import{m as g,s as W,r as B,aT as I,B as j,b2 as G,p as i,q as X,t as o,v as t,u as l,a2 as r,L as f,y as m,x as k,G as Y,i as z,A as H,n as y,aW as J,aX as K,ae as M,aY as O,b5 as Q,b6 as Z,b7 as ee,b8 as oe}from"./.pnpm.1b0299fb.js";import{_ as te}from"./index.vue_vue_type_script_setup_true_lang.b077f234.js";import{f as le,b as ae}from"./index.689cfa31.js";import{u as ue}from"./usePaging.00aa976d.js";import{u as ne}from"./useDictOptions.e9843f63.js";import{e as se,a as ie}from"./warehouse.c65c5953.js";import"./lodash.c3b66c05.js";import{_ as re}from"./edit.vue_vue_type_script_setup_true_name_warehouseEdit_lang.72119956.js";import"./@vueuse.72d44d91.js";import"./@vue.9d708d7c.js";import"./index.6c48d0ba.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.abac7546.js";const de={class:"mt-4"},pe={class:"flex mt-4 justify-end"},me=g({name:"warehouseLists"}),ge=g({...me,setup(ce){const _=W(),v=B(!1),s=I({name:"",contacts:"",tel:""}),E=B([]),h=n=>{E.value=n.map(({id:e})=>e)},{dictData:V}=ne(""),{pager:c,getLists:w,resetParams:x,resetPage:$}=ue({fetchFun:ie,params:s}),A=async()=>{var n;v.value=!0,await y(),(n=_.value)==null||n.open("add")},L=async n=>{var e,d;v.value=!0,await y(),(e=_.value)==null||e.open("edit"),(d=_.value)==null||d.setFormData(n)},F=async n=>{await le.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await se({id:n}),w()};return w(),(n,e)=>{const d=J,b=K,p=M,P=O,D=Q,S=ae,u=Z,T=j("router-link"),N=ee,R=te,C=G("perms"),U=oe;return i(),X("div",null,[o(D,{class:"!border-none mb-4",shadow:"never"},{default:t(()=>[o(P,{class:"mb-[-16px]",model:l(s),inline:""},{default:t(()=>[o(b,{label:"\u4ED3\u5E93\u540D\u79F0",prop:"name"},{default:t(()=>[o(d,{class:"w-[280px]",modelValue:l(s).name,"onUpdate:modelValue":e[0]||(e[0]=a=>l(s).name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(b,{label:"\u8054\u7CFB\u4EBA\u5458",prop:"contacts"},{default:t(()=>[o(d,{class:"w-[280px]",modelValue:l(s).contacts,"onUpdate:modelValue":e[1]||(e[1]=a=>l(s).contacts=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA\u5458"},null,8,["modelValue"])]),_:1}),o(b,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"tel"},{default:t(()=>[o(d,{class:"w-[280px]",modelValue:l(s).tel,"onUpdate:modelValue":e[2]||(e[2]=a=>l(s).tel=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),o(b,null,{default:t(()=>[o(p,{type:"primary",onClick:l($)},{default:t(()=>e[6]||(e[6]=[r("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(p,{onClick:l(x)},{default:t(()=>e[7]||(e[7]=[r("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),f((i(),m(D,{class:"!border-none",shadow:"never"},{default:t(()=>[f((i(),m(p,{type:"primary",onClick:A},{icon:t(()=>[o(S,{name:"el-icon-Plus"})]),default:t(()=>[e[8]||(e[8]=r(" \u65B0\u589E "))]),_:1})),[[C,["admin.warehouse/add"]]]),f((i(),m(p,{disabled:!l(E).length,onClick:e[3]||(e[3]=a=>F(l(E)))},{default:t(()=>e[9]||(e[9]=[r(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[C,["admin.warehouse/delete"]]]),k("div",de,[o(N,{data:l(c).lists,onSelectionChange:h},{default:t(()=>[o(u,{type:"selection",width:"55"}),o(u,{label:"",prop:"id","show-overflow-tooltip":""}),o(u,{label:"\u4ED3\u5E93\u540D\u79F0","show-overflow-tooltip":""},{default:t(({row:a})=>[o(T,{to:{path:"product_import",query:{id:a.id}},class:"ml-4 text-success"},{default:t(()=>[r(Y(a.name),1)]),_:2},1032,["to"])]),_:1}),o(u,{label:"\u4ED3\u5E93\u7F16\u53F7",prop:"code","show-overflow-tooltip":""}),o(u,{label:"\u8054\u7CFB\u4EBA\u5458",prop:"contacts","show-overflow-tooltip":""}),o(u,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"tel","show-overflow-tooltip":""}),o(u,{label:"\u4ED3\u5E93\u5730\u5740",prop:"address","show-overflow-tooltip":""}),o(u,{label:"\u5907\u6CE8\u4FE1\u606F",prop:"notes","show-overflow-tooltip":""}),o(u,{label:"\u6392\u5E8F",prop:"sort","show-overflow-tooltip":""}),o(u,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:a})=>[f((i(),m(p,{type:"primary",link:"",onClick:q=>L(a)},{default:t(()=>e[10]||(e[10]=[r(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[C,["admin.warehouse/edit"]]]),f((i(),m(p,{type:"danger",link:"",onClick:q=>F(a.id)},{default:t(()=>e[11]||(e[11]=[r(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[C,["admin.warehouse/delete"]]])]),_:1})]),_:1},8,["data"])]),k("div",pe,[o(R,{modelValue:l(c),"onUpdate:modelValue":e[4]||(e[4]=a=>z(c)?c.value=a:null),onChange:l(w)},null,8,["modelValue","onChange"])])]),_:1})),[[U,l(c).loading]]),l(v)?(i(),m(re,{key:0,ref_key:"editRef",ref:_,"dict-data":l(V),onSuccess:l(w),onClose:e[5]||(e[5]=a=>v.value=!1)},null,8,["dict-data","onSuccess"])):H("",!0)])}}});export{ge as default};
|