import{_ as $,d as I,bn as G,X as J,aU as W,w as k,b0 as X,r as l,aC as K,l as s,H as Q,o as f,c as y,j as e,C as o,M as F,L as x,G as w,J as E,a as B,aq as Y,aN as Z}from"./index.js";import{M as ee,h as te,a as ae,b as se}from"./modal.a0422b.js";import"./addr-query.f67f9a06.js";import"./useTask.8a645393.js";import"./contact-modal.118bef.js";const ne=[{value:"0",label:"\u7981\u7528"},{value:"1",label:"\u542F\u7528"}],oe={key:0,class:"mt-[10px]"},le={key:1,class:"w-full leading-[198px] text-center border-[#ccc] border rounded-sm mt-2 color-[#ccc] font-bold"},ie=I({__name:"organize-tree",props:{otherParms:{type:Object,required:!0},breadcrumb:{type:Array,required:!0}},emits:["breadcrumbChange"],setup(g,{expose:A,emit:D}){const S=g,T="business",{hasPermissionWithCode:C}=G(T),z=J(),p=W(!1),u=k(""),_=k({}),{data:h,run:N,loading:P,isError:R}=X({isList:!1});function q(a){u.value=a.id,r(),D("breadcrumbChange",a)}function r(){const a={...u.value?{pid:u.value}:{pid:0},...S.otherParms};N(te(a))}function M(){r()}function O(a){if(a.status==1){Z.warning("\u7981\u7528\u540E\u624D\u80FD\u7F16\u8F91");return}_.value=a,p.value=!0}const U=async a=>{const{id:i,status:n,kh:d}=a,m=d==="0"?ae:se,{code:b,message:v}=await m({id:i,status:n+""=="1"?"0":"1"});z({code:b,message:v,handler:()=>r()})};return M(),A({changePid:a=>u.value=a,onSearch:()=>r()}),(a,i)=>{const n=l("ElTableColumn"),d=l("ElTag"),m=l("ElButton"),b=l("el-tooltip"),v=l("el-button"),j=l("el-popconfirm"),H=l("ElTable"),L=K("loading");return s(h)&&s(h).length>0&&!s(R)?Q((f(),y("ul",oe,[e(H,{data:s(h),border:"",size:"small"},{default:o(()=>[e(n,{label:"ID",prop:"id",width:"80px"}),e(n,{label:"\u7C7B\u578B",prop:"id",width:"80px"},{default:o(({row:t})=>[e(d,{size:"small",type:t.kh==0?"success":""},{default:o(()=>[F(x(t.kh==0?"\u7EC4\u7EC7":"\u4F01\u4E1A"),1)]),_:2},1032,["type"])]),_:1}),e(n,{label:"\u540D\u79F0",prop:"name","min-width":"160px","show-overflow-tooltip":""}),e(n,{label:"\u7F16\u7801",prop:"code","min-width":"120px","show-overflow-tooltip":""}),e(n,{label:"\u72B6\u6001",prop:"status",width:"70px"},{default:o(({row:t})=>[e(d,{type:String(t.status)==="0"?"warning":""},{default:o(()=>{var c;return[F(x(((c=s(ne).find(({value:V})=>V===String(t.status)))==null?void 0:c.label)||"--"),1)]}),_:2},1032,["type"])]),_:1}),e(n,{label:"\u521B\u5EFA\u4EBA\u90E8\u95E8",prop:"company_name",width:"120px"}),e(n,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"addtime",width:"160px"}),e(n,{label:"\u64CD\u4F5C",width:"140px"},{default:o(({row:t})=>[s(C)("005")?(f(),w(b,{key:0,effect:"dark",content:"\u7F16\u8F91",placement:"top"},{default:o(()=>[e(m,{link:"",class:"reset-margin",type:"primary",icon:s(E)("edits"),onClick:c=>O(t)},null,8,["icon","onClick"])]),_:2},1024)):B("v-if",!0),s(C)("004")?(f(),w(j,{key:1,title:String(t.status)==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:c=>U(t)},{reference:o(()=>[e(v,{class:"reset-margin",link:"",type:"primary",size:"small",icon:s(E)(String(t.status)==="1"?"close-circle-line":"checkbox-circle-line")},null,8,["icon"])]),_:2},1032,["title","onConfirm"])):B("v-if",!0),e(b,{effect:"dark",content:"\u4E0B\u4E00\u7EA7",placement:"top"},{default:o(()=>[e(m,{link:"",class:"reset-margin",type:"primary",icon:s(E)("arrow-right-s-line"),onClick:c=>q(t)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"]),e(ee,{data:_.value,"onUpdate:data":i[0]||(i[0]=t=>_.value=t),visible:s(p),"onUpdate:visible":i[1]||(i[1]=t=>Y(p)?p.value=t:null),pid:u.value,breadcrumb:g.breadcrumb,onRefresh:r},null,8,["data","visible","pid","breadcrumb"])])),[[L,s(P)]]):(f(),y("div",le," \u6682\u65E0\u6570\u636E "))}}});var me=$(ie,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/business/cpns/organize-tree.vue"]]);export{me as default};
