1 |
- import{aD as D,a3 as $,a4 as W,aF as j,Z as G,_ as O,d as Y,b4 as Q,$ as X,w as v,ae as z,x as Z,aP as J,z as K,r as F,o as d,G as S,C as q,u as V,a as P,c as I,F as ee,D as te,l as b,M as oe,aB as ae,bj as H,bk as T,aG as ne}from"./index.ab2ff1c1.js";import{R as le,M as E}from"./role-modal.cb3e86a8.js";import{r as se}from"./columnRenderHelper.a3cce1af.js";import{u as ue}from"./use-page-search.4260ed86.js";import{u as re}from"./useCompany.6a1f0240.js";import"./index.af082ad5.js";const{VITE_PROXY_DOMAIN_REAL:Me,VITE_PROXY_USER_REAL:ce}=$(),A=ce+"/admin/",ie=t=>D.request("post",`${A}userlist`,{data:{level:"3",...t}}),pe=t=>D.request("post",`${A}usersave`,{data:t}),de=t=>D.request("post",`${A}menustatus`,{data:t}),me=t=>D.request("post",`${A}setrole`,{data:t}),fe=[{type:"selection",width:40,align:"center",hide:({checkList:t})=>!t.includes("\u52FE\u9009\u5217")},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:t})=>!t.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:t})=>W(j,{type:String(t.status)==="1"?"success":"danger"},{default:()=>String(t.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",...se("companyCode","companyName","\u516C\u53F8\u7F16\u7801:")},{label:"\u521B\u5EFA\u65F6\u95F4",width:140,prop:"addtime",formatter:({addtime:t})=>G(t).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:t})=>({companyNo:t}),apis:{httpAdd:!0,httpDelete:de,httpUpdate:pe,httpList:ie}},U={formItems:[{field:"nickname",type:"input",placeholder:"\u771F\u5B9E\u59D3\u540D"},{field:"username",type:"input",placeholder:"\u624B\u673A\u53F7"}]};const he={key:1,class:"super-loading"},ve={key:2,class:"super-no-more"},ye=Y({__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(t,{expose:M,emit:m}){const s=t,{setCurrentCompany:f}=re(),C=Q(),{userLevel:i}=X(),y=v(s.code),k=v(null),c=v([]),e=z({loading:!1,noMore:!1,name:"",count:0,page:1});let l=null;const g=ae(w,500);function h(o){return i.value==="3"||s.isSupplier?o:o.map(a=>({...a,code:a.companyNo,name:a.company_name}))}async function u(o,n){e.name=o,e.page=1,e.noMore=!1;const a=i.value==="3"||s.isSupplier,_=a||s.isSupplier?H:T,{data:p,message:r,code:B}=await _({[a?"name":"company_name"]:e.name,[a?"code":"companyNo"]:n,page:e.page});C({code:B,message:r,handler:()=>{c.value=h(p.list),e.count=p.count,e.loading=!1;const R=Math.ceil(e.count/10);e.noMore=R<=1}})}function N(o){const n=c.value.find(({code:a})=>a===o);s.noSet||f(n),m("change",n)}async function w(){const o=l.clientHeight,n=l.scrollTop,a=l.scrollHeight;if(o+n>=a&&!e.noMore){e.page++,e.loading=!0;const _=i.value==="3"||s.isSupplier?H:T,{data:p,message:r,code:B}=await _({name:e.name,page:e.page,noRela:!0}),R=L=>{c.value=[...c.value,...h(L)]};C({code:B,message:r,handler:()=>{e.count=p.count;const L=Math.ceil(e.count/10);if(e.page>L){e.noMore=!0,e.loading=!1;return}R(p.list)}})}}Z(()=>{setTimeout(()=>{var n;const o=document.querySelector(".super-item");!o||(l=(n=o.parentElement)==null?void 0:n.parentElement,l&&l.addEventListener("scroll",g,!1))},1e3)}),J(()=>{e.loading=!1,e.noMore=!1,e.name="",e.page=1,l&&l.removeEventListener("scroll",g)}),K(()=>i.value,o=>{o!==""&&(e.loading=!1,e.noMore=!1,e.name="",e.page=1,c.value=[],u(void 0,s.code))});const x=o=>{const{code:n,name:a}=o;return n+" / "+a};return u(void 0,s.code),M({selectAll:()=>y.value=""}),(o,n)=>{const a=F("ElOption"),_=F("IconifyIconOffline"),p=F("ElSelect");return d(),S(p,{filterable:"",remote:"",modelValue:y.value,"onUpdate:modelValue":n[0]||(n[0]=r=>y.value=r),"remote-method":u,onChange:N,style:{width:"450px"},placeholder:t.placeholder,ref_key:"selectRef",ref:k},{default:q(()=>[t.noAll?P("v-if",!0):(d(),S(a,{key:0,label:V(i)==="3"?"\u6240\u6709\u4F9B\u5E94\u5546\u516C\u53F8":"\u6240\u6709\u4E1A\u52A1\u516C\u53F8",value:""},null,8,["label"])),(d(!0),I(ee,null,te(c.value,r=>(d(),S(a,{class:"super-item",key:r.code,value:r.code,label:x(r)},null,8,["value","label"]))),128)),e.loading?(d(),I("p",he,[b(_,{class:"animate-spin",icon:"Loading"}),oe(" \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=O(ye,[["__scopeId","data-v-894137a8"],["__file","C:/Users/a/Desktop/projects/report-v3/src/layout/components/company/super.vue"]]);const Fe=Y({__name:"index",setup(t){const M="supplierAccoutQuery",m=v(null),s=v(null),f=v(""),C=()=>({result:{companyNo:f.value},deleteProps:[]}),i={pageSearchHook:()=>ue(C,()=>f.value="",U,!0)},{run:y}=ne({success:()=>s.value.onSearch()}),k={content:{create:()=>m.value.onDisplay(void 0,E.create),preview:e=>m.value.onDisplay(e,E.preview),update:e=>m.value.onDisplay(e,E.update)}};function c(e,l){const{roleid:g,nickname:h,relaComNo:u,id:N,companyNo:w,mobile:x}=e,o={id:N,mobile:x,roleid:g,nickname:h,relaComNo:u,companyNo:w};switch(l){case E.update:y(me(o));break}}return(e,l)=>{const g=F("PageContainer"),h=F("PageAuth");return d(),S(h,{pageName:M},{default:q(()=>[b(g,{hooks:i,events:k,contentConfig:V(ge),"search-config":V(U),"get-content-ref":u=>s.value=u},{search_field:q(()=>[b(_e,{style:{"margin-right":"20px",width:"100%"},modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=u=>f.value=u),placeholder:"\u4F9B\u5E94\u5546\u516C\u53F8","no-all":"","no-set":"","is-supplier":""},null,8,["modelValue"])]),_:1},8,["contentConfig","search-config","get-content-ref"]),b(le,{ref_key:"roleModalRef",ref:m,onFinanceSave:c},null,512)]),_:1})}}});var ke=O(Fe,[["__file","C:/Users/a/Desktop/projects/report-v3/src/views/supplierManage/supplierAccoutQuery/index.vue"]]);export{ke as default};
|