1 |
- import{ck as D,X as W,Z as $,cr as j,S as X,d as O,cS as Q,U as Z,m as g,a8 as z,n as G,cB as J,w as K,r as _,o as d,A as E,x as q,u as V,a as P,c as I,F as ee,y as oe,h as A,H as te,_ as Y,ci as ne,d6 as H,d7 as U,cv as ae}from"./index.56449854.js";import{R as se,M as C}from"./role-modal.d1c2d001.js";import{r as le}from"./columnRenderHelper.59df13d6.js";import{u as ue}from"./use-page-search.59eb5443.js";import{u as re}from"./useCompany.e9cb4fed.js";import"./index.1844ab0a.js";const{VITE_PROXY_DOMAIN_REAL:ke,VITE_PROXY_USER_REAL:ce}=W(),b=ce+"/admin/",pe=o=>D.request("post",`${b}userlist`,{data:{level:"3",...o}}),ie=o=>D.request("post",`${b}usersave`,{data:o}),de=o=>D.request("post",`${b}menustatus`,{data:o}),me=o=>D.request("post",`${b}setrole`,{data:o}),fe=[{type:"selection",width:40,align:"center",hide:({checkList:o})=>!o.includes("\u52FE\u9009\u5217")},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:o})=>!o.includes("\u5E8F\u53F7\u5217")},{label:"\u624B\u673A\u53F7",prop:"mobile",width:120,align:"left"},{label:"\u771F\u5B9E\u59D3\u540D",prop:"nickname",minWidth:150},{label:"\u72B6\u6001",prop:"status",width:120,cellRenderer:({row:o})=>$(j,{type:String(o.status)==="1"?"success":"danger"},{default:()=>String(o.status)==="1"?"\u542F\u7528":"\u7981\u7528"})},{label:"\u89D2\u8272",prop:"role_name",minWidth:150,align:"left"},{label:"\u516C\u53F8\u540D\u79F0",prop:"companyName",minWidth:180,align:"left",...le("companyCode","companyName","\u516C\u53F8\u7F16\u7801:")},{label:"\u521B\u5EFA\u65F6\u95F4",width:140,prop:"addtime",formatter:({addtime:o})=>X(o).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],ge={title:"\u516C\u53F8\u8D26\u53F7\u89D2\u8272\u67E5\u8BE2",columns:fe,deleteProp:"payNo",notNeedCompanyFilter:!0,statusRowProp:({companyCode:o})=>({companyNo:o}),apis:{httpAdd:!0,httpDelete:de,httpUpdate:ie,httpList:pe}},T={formItems:[{type:"input",field:"nickname",placeholder:"\u771F\u5B9E\u59D3\u540D"},{type:"input",field:"username",placeholder:"\u624B\u673A\u53F7"}]};const he={key:1,class:"super-loading"},ve={key:2,class:"super-no-more"},ye=O({__name:"super",props:{noAll:{type:Boolean,required:!1},noSet:{type:Boolean,required:!1},code:{type:String,required:!1,default:""},isSupplier:{type:Boolean,required:!1},placeholder:{type:String,required:!1}},emits:["change","update:code"],setup(o,{expose:m,emit:F}){const s=o,{setCurrentCompany:M}=re(),S=Q(),{userLevel:p}=Z(),h=g(s.code),k=g(null),l=g([]),e=z({loading:!1,noMore:!1,name:"",count:0,page:1});let u=null;const f=ne(w,500);function c(t){return p.value==="3"||s.isSupplier?t:t.map(n=>({...n,code:n.companyNo,name:n.company_name}))}async function v(t,a){e.name=t,e.page=1,e.noMore=!1;const n=p.value==="3"||s.isSupplier,y=n||s.isSupplier?H:U,{data:i,message:r,code:x}=await y({[n?"name":"company_name"]:e.name,[n?"code":"companyNo"]:a,page:e.page});S({code:x,message:r,handler:()=>{l.value=c(i.list),e.count=i.count,e.loading=!1;const R=Math.ceil(e.count/10);e.noMore=R<=1}})}function N(t){const a=l.value.find(({code:n})=>n===t);s.noSet||M(a),F("change",a)}async function w(){const t=u.clientHeight,a=u.scrollTop,n=u.scrollHeight;if(t+a>=n&&!e.noMore){e.page++,e.loading=!0;const y=p.value==="3"||s.isSupplier?H:U,{data:i,message:r,code:x}=await y({name:e.name,page:e.page,noRela:!0}),R=L=>{l.value=[...l.value,...c(L)]};S({code:x,message:r,handler:()=>{e.count=i.count;const L=Math.ceil(e.count/10);if(e.page>L){e.noMore=!0,e.loading=!1;return}R(i.list)}})}}G(()=>{setTimeout(()=>{var a;const t=document.querySelector(".super-item");!t||(u=(a=t.parentElement)==null?void 0:a.parentElement,u&&u.addEventListener("scroll",f,!1))},1e3)}),J(()=>{e.loading=!1,e.noMore=!1,e.name="",e.page=1,u&&u.removeEventListener("scroll",f)}),K(()=>p.value,t=>{t!==""&&(e.loading=!1,e.noMore=!1,e.name="",e.page=1,l.value=[],v(void 0,s.code))});const B=t=>{const{code:a,name:n}=t;return a+" / "+n};return v(void 0,s.code),m({selectAll:()=>h.value=""}),(t,a)=>{const n=_("ElOption"),y=_("IconifyIconOffline"),i=_("ElSelect");return d(),E(i,{filterable:"",remote:"",modelValue:h.value,"onUpdate:modelValue":a[0]||(a[0]=r=>h.value=r),"remote-method":v,onChange:N,style:{width:"450px"},placeholder:t.placeholder,ref_key:"selectRef",ref:k},{default:q(()=>[t.noAll?P("v-if",!0):(d(),E(n,{key:0,label:V(p)==="3"?"\u6240\u6709\u4F9B\u5E94\u5546\u516C\u53F8":"\u6240\u6709\u4E1A\u52A1\u516C\u53F8",value:""},null,8,["label"])),(d(!0),I(ee,null,oe(l.value,r=>(d(),E(n,{class:"super-item",key:r.code,value:r.code,label:B(r)},null,8,["value","label"]))),128)),e.loading?(d(),I("p",he,[A(y,{class:"animate-spin",icon:"Loading"}),te(" \u52A0\u8F7D\u4E2D ")])):P("v-if",!0),e.noMore?(d(),I("p",ve,"\u6CA1\u6709\u66F4\u591A\u6570\u636E\u4E86...")):P("v-if",!0)]),_:1},8,["modelValue","placeholder"])}}});var _e=Y(ye,[["__scopeId","data-v-894137a8"],["__file","C:/Users/89793/Desktop/projects/report-v3/src/layout/components/company/super.vue"]]);const Fe="supplierAccoutQuery",Se=O({__name:"index",setup(o){const m=g(null),F=g(null),s=g(""),M=()=>({result:{companyNo:s.value},deleteProps:[]}),S={pageSearchHook:()=>ue(M,()=>s.value="",T)},{run:p}=ae({success:()=>F.value.onSearch()}),h={content:{create:()=>m.value.onDisplay(void 0,C.create),preview:l=>m.value.onDisplay(l,C.preview),update:l=>m.value.onDisplay(l,C.update)}};function k(l,e){const{roleid:u,nickname:f,relaComNo:c,id:v,companyNo:N,mobile:w}=l,B={id:v,mobile:w,roleid:u,nickname:f,relaComNo:c,companyNo:N};switch(e){case C.update:p(me(B));break}}return(l,e)=>{const u=_("PageContainer"),f=_("PageAuth");return d(),E(f,{pageName:Fe},{default:q(()=>[A(u,{hooks:S,events:h,contentConfig:V(ge),"search-config":V(T),"get-content-ref":c=>F.value=c},{search_field:q(()=>[A(_e,{style:{"margin-right":"20px",width:"100%"},modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=c=>s.value=c),placeholder:"\u4F9B\u5E94\u5546\u516C\u53F8","no-all":"","no-set":"","is-supplier":""},null,8,["modelValue"])]),_:1},8,["contentConfig","search-config","get-content-ref"]),A(se,{ref_key:"roleModalRef",ref:m,onFinanceSave:k},null,512)]),_:1})}}});var Ne=Y(Se,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/supplierManage/supplierAccoutQuery/index.vue"]]);export{Ne as default};
|