index.ce4598.js 5.4 KB

1
  1. import{_ as ne,d as oe,w as le,x as d,Z as V,W as se,A as ue,y as ie,ad as re,r as p,o as g,c as T,H as U,K as H,h as ce,l as a,D as l,F as me,E as de,m as c,by as pe,G as h,J as y,M as x,a as F,bA as fe,bx as j}from"./index.js";import{useColumns as ve}from"./columns.bcdd2e2.js";import{a as _e,b as ge}from"./index.38d51ba4.js";import ye from"./addEdit.791134.js";import he from"./resetPassword.c97e08.js";import"./index.95768c8f.js";import"./company-modal.30c47e.js";import"./index.f604950f.js";const Ce={class:"main"},ke={name:"companyAccount"},be=oe({...ke,setup(Fe){const{logout:B}=le(),f=d([]),o=V({nickname:"",username:"",status:"",page:1,size:15}),w=d([]),C=d(!0),k=d(!1),N=d(""),E=d("add"),{columns:G}=ve(),{currentCompany:S}=se(),I=V({id:"",nickname:"",mobile:"",role:"",companyArr:[]}),R=d(""),z=d(!1),L=d(),b=V({total:0,pageSize:15,currentPage:1,background:!0}),J=async n=>{const{id:e}=n;R.value=e,z.value=!0},K=async n=>{const{id:e,status:v}=n,{code:u,message:i}=await _e({id:e,status:v+""=="1"?"0":"1"});j({code:u,message:i,logout:B,handler:()=>m()})};async function O(n){o.page=n,await m()}async function W(n){o.size=n,o.page=1,await m()}function Z(n){}async function m(){C.value=!0;const{code:n,data:e,message:v}=await ge({...o,companyNo:S.value.companyNo,noRela:S.value.companyNo===""});j({code:n,message:v,logout:B,handler:()=>{const{list:u,count:i}=e;w.value=u!=null?u:[],b.total=i!=null?i:0,b.pageSize=o.size,b.currentPage=o.page}}),C.value=!1}async function q(){o.page=1,await m()}function A(n,e,v){N.value=n,E.value=e;for(let u in v)I[u]=v[u];k.value=!0}const Q=()=>{k.value=!1,m()},X=()=>{k.value=!1},M=()=>{z.value=!1},Y=n=>{!n||(n.resetFields(),o.page=1,m())};return ue(()=>S.value,()=>m()),ie(()=>{f.value=re().getMenuActions("companyAccount"),m()}),(n,e)=>{const v=p("el-option"),u=p("el-select"),i=p("el-form-item"),P=p("el-input"),_=p("el-button"),ee=p("el-form"),$=p("el-popconfirm"),ae=p("PureTable"),te=p("NoAuth");return g(),T("div",Ce,[U(ce("div",null,[a(ee,{ref_key:"formRef",ref:L,inline:!0,model:o,size:"small","label-width":0,class:"bg-white w-99/100 pl-8 pt-4"},{default:l(()=>[a(i,{prop:"status"},{default:l(()=>[a(u,{modelValue:o.status,"onUpdate:modelValue":e[0]||(e[0]=t=>o.status=t),style:{width:"100%"},placeholder:"\u8D26\u53F7\u72B6\u6001",clearable:""},{default:l(()=>[(g(!0),T(me,null,de(c(pe),(t,D)=>(g(),h(v,{key:"status"+t.value+D,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(i,{prop:"nickname"},{default:l(()=>[a(P,{modelValue:o.nickname,"onUpdate:modelValue":e[1]||(e[1]=t=>o.nickname=t),placeholder:"\u771F\u5B9E\u59D3\u540D",clearable:""},null,8,["modelValue"])]),_:1}),a(i,{prop:"username"},{default:l(()=>[a(P,{modelValue:o.username,"onUpdate:modelValue":e[2]||(e[2]=t=>o.username=t),placeholder:"\u624B\u673A\u53F7",clearable:""},null,8,["modelValue"])]),_:1}),a(i,null,{default:l(()=>[a(_,{type:"primary",icon:c(y)("search"),loading:C.value,onClick:q},{default:l(()=>[x(" \u641C\u7D22 ")]),_:1},8,["icon","loading"]),a(_,{icon:c(y)("refresh"),onClick:e[3]||(e[3]=t=>Y(L.value))},{default:l(()=>[x(" \u91CD\u7F6E ")]),_:1},8,["icon"])]),_:1})]),_:1},8,["model"]),a(c(fe),{title:"\u516C\u53F8\u8D26\u53F7\u7BA1\u7406",loading:C.value,dataList:w.value,size:"small",onRefresh:m},{buttons:l(()=>[a(_,{type:"primary",size:"small",icon:c(y)("add"),onClick:e[4]||(e[4]=t=>A("","add",{}))},{default:l(()=>[x(" \u65B0\u589E\u8D26\u53F7 ")]),_:1},8,["icon"])]),default:l(({size:t,checkList:D})=>[a(ae,{border:"",align:"left",showOverflowTooltip:"","table-layout":"auto",size:"small",data:w.value,columns:c(G),checkList:D,pagination:b,paginationSmall:t==="small","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:Z,onSizeChange:W,onCurrentChange:O},{operation:l(({row:r})=>[a($,{title:"\u786E\u8BA4\u91CD\u7F6E\u5BC6\u7801\uFF1F",onConfirm:s=>J(r)},{reference:l(()=>[f.value.some(s=>s=="012")?(g(),h(_,{key:0,class:"reset-margin",link:"",type:"primary",size:"small",icon:c(y)("refresh-right")},null,8,["icon"])):F("v-if",!0)]),_:2},1032,["onConfirm"]),f.value.some(s=>s=="007")?(g(),h(_,{key:0,class:"reset-margin",link:"",type:"primary",size:"small",onClick:s=>A(r.id,"view",r),icon:c(y)("eye-view")},null,8,["onClick","icon"])):F("v-if",!0),f.value.some(s=>s=="005")?(g(),h(_,{key:1,class:"reset-margin",link:"",type:"primary",size:"small",onClick:s=>A(r.id,"edit",r),icon:c(y)("edits")},null,8,["onClick","icon"])):F("v-if",!0),f.value.some(s=>s=="004")&&r.status+""=="1"||f.value.some(s=>s=="003")&&r.status+""=="0"?(g(),h($,{key:2,title:String(r.status)==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:s=>K(r)},{reference:l(()=>[a(_,{class:"reset-margin",link:"",type:"primary",size:"small",icon:c(y)(String(r.status)==="1"?"close-circle-line":"checkbox-circle-line")},null,8,["icon"])]),_:2},1032,["title","onConfirm"])):F("v-if",!0)]),_:2},1032,["data","columns","checkList","pagination","paginationSmall"])]),_:1},8,["loading","dataList"]),a(ye,{itemId:N.value,isDetails:E.value,"show-model":k.value,onRefresh:Q,onCancel:X,sitem:I},null,8,["itemId","isDetails","show-model","sitem"]),a(he,{itemId:R.value,"show-model":z.value,onRefresh:M,onCancel:M},null,8,["itemId","show-model"])],512),[[H,f.value.some(t=>t=="001")]]),U(a(te,null,null,512),[[H,!f.value.some(t=>t=="001")]])])}}});var Ne=ne(be,[["__scopeId","data-v-78d8219b"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/interest/companyAccount-origin/index.vue"]]);export{Ne as default};