index.61188509.js 5.3 KB

1
  1. import{_ as te,d as ne,v as le,w as m,ad as V,x as oe,X as se,r as d,o as g,c as $,H as T,K as U,b as ue,l as a,C as o,F as ie,D as re,u as c,G as C,J as h,M as A,a as F,b5 as ce,b2 as H}from"./index.1d5f2f42.js";import{useColumns as me}from"./columns.c453962b.js";import{b as de,c as pe}from"./company-modal.3b683ec2.js";import{a as fe}from"./status.3ccd5ebb.js";import{u as ve}from"./useCompany.f3b703c8.js";import _e from"./addEdit.a2e1e0f3.js";import ge from"./resetPassword.f93ad57e.js";import"./index.00fd5a1f.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:G}=me();ve();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}),J=async n=>{const{id:e}=n;R.value=e,S.value=!0},K=async n=>{const{id:e,status:v}=n,{code:u,message:i}=await de({id:e,status:v+""=="1"?"0":"1"});H({code:u,message:i,logout:B,handler:()=>f()})};async function O(n){l.page=n,await f()}async function X(n){l.size=n,l.page=1,await f()}function j(n){}async function f(){y.value=!0;const{code:n,data:e,message:v}=await pe({...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 q(){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()},W=()=>{k.value=!1},L=()=>{S.value=!1},Y=n=>{!n||(n.resetFields(),l.page=1,f())};return oe(()=>{p.value=se().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"),Z=d("el-form"),P=d("el-popconfirm"),ee=d("PureTable"),ae=d("NoAuth");return g(),$("div",he,[T(ue("div",null,[a(Z,{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),$(ie,null,re(c(fe),(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:q},{default:o(()=>[A(" \u641C\u7D22 ")]),_:1},8,["icon","loading"]),a(_,{icon:c(h)("refresh"),onClick:e[3]||(e[3]=t=>Y(E.value))},{default:o(()=>[A(" \u91CD\u7F6E ")]),_:1},8,["icon"])]),_:1})]),_:1},8,["model"]),a(c(ce),{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(G),checkList:D,pagination:b,paginationSmall:t==="small","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:j,onSizeChange:X,onCurrentChange:O},{operation:o(({row:r})=>[a(P,{title:"\u786E\u8BA4\u91CD\u7F6E\u5BC6\u7801\uFF1F",onConfirm:s=>J(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=>K(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:W,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 Be=te(ye,[["__scopeId","data-v-b9c3be96"],["__file","D:/work/rep-v3/report-v3/src/views/supplierManage/supplierAccoutManage/index.vue"]]);export{Be as default};