import{_ as q,d as R,W as U,w as y,aU as j,bn as z,b0 as G,z as L,r as m,aC as M,H as S,l as r,o as g,c as V,j as a,C as d,G as W,J as w,a as $,aq as H,aN as B}from"./index.js";import{e as I}from"./index.1b996d7e.js";import J from"./modal.466d23.js";const O={class:"mt-[10px]"},K=R({__name:"category-tree",props:{otherParms:{type:Object,required:!0},breadcrumb:{type:Array,required:!0}},emits:["breadcrumbChange"],setup(p,{expose:k,emit:x}){const E=p,{currentCompany:f}=U(),n=y(""),v=y({}),u=j(!1),{hasPermissionWithCode:P}=z("platformGrossProfit"),{data:_,loading:b,run:F}=G({isList:!0});function A(e){n.value=e.cat_id,s(),x("breadcrumbChange",e)}function s(){if(!f.value.companyNo){B.warning("\u8BF7\u5728\u53F3\u4E0A\u89D2\u9009\u62E9\u4E00\u5BB6\u4E1A\u52A1\u516C\u53F8!"),b.value=!1,_.value=[];return}if(!E.otherParms.platform_id){B.warning("\u8BF7\u9009\u62E9\u5E73\u53F0!"),b.value=!1,_.value=[];return}const e={...E.otherParms,...n.value?{pid:n.value}:{pid:0},size:1e3,companyNo:f.value.companyNo};F(I(e))}const N=()=>s();function D(e={}){const{cat_id:t,cat_name:l,order_rate:i,sale_rate:c,rate:C,low_rate:h}=e;v.value={id:t,cat_name:l,order_rate:i||0,sale_rate:c||0,rate:C||0,low_rate:h||0},u.value=!0}return N(),L(()=>f.value,s),k({changePid:e=>n.value=e,onSearch:()=>s()}),(e,t)=>{const l=m("ElTableColumn"),i=m("ElButton"),c=m("el-tooltip"),C=m("ElTable"),h=M("loading");return S((g(),V("ul",O,[a(C,{data:r(_),border:"",size:"small","max-height":"calc(100vh - 160px)"},{default:d(()=>[a(l,{label:"\u5206\u7C7B\u540D\u79F0",prop:"cat_name","min-width":"160px","show-overflow-tooltip":""}),a(l,{label:"\u5206\u7C7B\u7B49\u7EA7",prop:"level","min-width":"80px"}),a(l,{label:"\u64CD\u4F5C",width:"140px"},{default:d(({row:o})=>[r(P)("005")?(g(),W(c,{key:0,effect:"dark",content:"\u7F16\u8F91\u4E13\u5C5E\u5206\u7C7B",placement:"top"},{default:d(()=>[a(i,{link:"",class:"reset-margin",type:"primary",icon:r(w)("edits"),onClick:T=>D(o)},null,8,["icon","onClick"])]),_:2},1024)):$("v-if",!0),a(c,{effect:"dark",content:"\u4E0B\u4E00\u7EA7",placement:"top"},{default:d(()=>[a(i,{link:"",class:"reset-margin",type:"primary",icon:r(w)("arrow-right-s-line"),onClick:T=>A(o)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"]),a(J,{pid:n.value,data:v.value,"onUpdate:data":t[0]||(t[0]=o=>v.value=o),visible:r(u),"onUpdate:visible":t[1]||(t[1]=o=>H(u)?u.value=o:null),breadcrumb:p.breadcrumb,onRefresh:s,platform_id:p.otherParms.platform_id},null,8,["pid","data","visible","breadcrumb","platform_id"])])),[[h,r(b)]])}}});var Z=q(K,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/platformGrossProfit/cpns/category-tree.vue"]]);export{Z as default};
