import{al as k,a$ as y,_ as S,d as w,w as h,aU as D,r as d,o as N,G as P,C as a,j as o,l as f,M as v,aq as A,aN as F}from"./index.js";import{h as W,a as _}from"./category-modal.ae301f.js";import{s as $,M}from"./modal.2d8038.js";import{u as R}from"./useTask.8a645393.js";import{u as T}from"./use-page-search.f7bc460e.js";const U=[{type:"selection",fixed:"left",_noset_:!0},{prop:"supplierNo",label:"\u4F9B\u5E94\u5546\u7F16\u53F7",minWidth:"140px"},{prop:"supplierName",label:"\u4F9B\u5E94\u5546\u540D\u79F0",minWidth:"140px"},{prop:"cat",label:"\u5206\u7C7B\u540D\u79F0",minWidth:"120px"},{label:"\u72B6\u6001",prop:"status",width:100,cellRenderer:({row:u})=>k(y,{type:String(u.status)==="1"?"success":"danger"},{default:()=>String(u.status)==="1"?"\u542F\u7528":"\u7981\u7528"})},{prop:"creater",label:"\u521B\u5EFA\u4EBA",minWidth:"60px"},{prop:"addtime",label:"\u6DFB\u52A0\u65F6\u95F4",minWidth:"145px"},{prop:"",label:"\u64CD\u4F5C",fixed:"right",width:"50px",_noset_:!0,slot:"operation"}],j={title:"\u516C\u53F8\u8D26\u53F7\u89D2\u8272\u67E5\u8BE2",columns:U,notPreview:!0,apis:{httpList:W,httpStatus:({id:u,status:r})=>_({id:[u],status:r}),httpAdd:!0}},C={formItems:[{type:"supplier-query",field:"supplierNo",placeholder:"\u4F9B\u5E94\u5546\u540D\u79F0"},{field:"status",type:"select",options:$,placeholder:"\u72B6\u6001"}]},q=w({__name:"index",setup(u){const r="supplierCat",i=h(null),n=D(!1),l=h([]),B={pageSearchHook:()=>T(void 0,void 0,C)},x={content:{create(){n.value=!0}}},E=R();async function m(p="1"){var e;try{if(l.value.length===0){F.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u6761\u8BB0\u5F55");return}const s=l.value.map(({id:c})=>c);await E.run(_({id:s,status:p})),F.success(`${p==="1"?"\u542F\u7528":"\u7981\u7528"}\u6210\u529F`),(e=i.value)==null||e.onSearch()}catch{}}return(p,e)=>{const s=d("ElButton"),c=d("PageContainer"),b=d("PageAuth");return N(),P(b,{pageName:r},{default:a(()=>[o(c,{hooks:B,events:x,"content-config":f(j),"search-config":f(C),"get-content-ref":t=>i.value=t,onContentSelectChange:e[2]||(e[2]=t=>l.value=t)},{content_header:a(()=>[o(s,{size:"small",type:"success",onClick:e[0]||(e[0]=t=>m("1"))},{default:a(()=>[v("\u6279\u91CF\u542F\u7528")]),_:1}),o(s,{size:"small",type:"danger",onClick:e[1]||(e[1]=t=>m("0"))},{default:a(()=>[v("\u6279\u91CF\u7981\u7528")]),_:1})]),_:1},8,["content-config","search-config","get-content-ref"]),o(M,{visible:f(n),"onUpdate:visible":e[3]||(e[3]=t=>A(n)?n.value=t:null),onRefresh:e[4]||(e[4]=t=>{var g;return(g=i.value)==null?void 0:g.onSearch()})},null,8,["visible"])]),_:1})}}});var L=S(q,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/supplierCat/index.vue"]]);export{L as default};
