index.0301bc5b.js 5.3 KB

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