Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

2 рядки
14KB

  1. var ue=Object.defineProperty,se=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var ne=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var G=(p,i,d)=>i in p?ue(p,i,{enumerable:!0,configurable:!0,writable:!0,value:d}):p[i]=d,E=(p,i)=>{for(var d in i||(i={}))ne.call(i,d)&&G(p,d,i[d]);if(Y)for(var d of Y(i))ie.call(i,d)&&G(p,d,i[d]);return p},z=(p,i)=>se(p,de(i));var w=(p,i,d)=>new Promise((P,N)=>{var _=b=>{try{V(d.next(b))}catch(I){N(I)}},B=b=>{try{V(d.throw(b))}catch(I){N(I)}},V=b=>b.done?P(b.value):Promise.resolve(b.value).then(_,B);V((d=d.apply(p,i)).next())});import{b as pe,e as me,s as ve}from"./userManage.384d8c0f.js";import{l as fe}from"./companyManage.74199cee.js";import{l as ce}from"./projectManage.b222baef.js";import{d as H,h as X,a as J,f as K}from"./uploadAction.25c9789a.js";import{d as ge,y as R,x as _e,r as $,z as be,f as m,g as n,n as c,w as a,e as l,p as j,c as k,q,v as g,F as T,b as W,h as x,i as ye}from"./index.32194486.js";const Ve=["src"],Ie=W("div",{class:"el-upload__tip"}," \u652F\u6301jpg\u3001png\u3001gif\u683C\u5F0F\uFF0C\u4E0D\u8D85\u8FC75MB ",-1),Ce=["src"],Fe=W("div",{class:"el-upload__tip"}," \u652F\u6301jpg\u3001png\u3001gif\u683C\u5F0F\uFF0C\u4E0D\u8D85\u8FC75MB ",-1),xe=x("\u6309\u5730\u533A"),ke=x("\u6309\u4E2A\u4EBA"),he=W("span",{class:"text-info"},"\u5143",-1),we=x("\u6708\u7ED3"),Ne=x("\u5468\u7ED3"),De=x("\u767D\u5929"),Oe=x("\u665A\u4E0A"),Ue=x(" \u63D0\u4EA4 "),Le=x(" \u5173\u95ED "),$e=ge({name:"userDialog"}),Be=Object.assign($e,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(p,{emit:i}){const d=p,{proxy:P}=ye(),N=R.dictStore.uploadUrl,_=R.userStore.userBaseInfo,{roleList:B}=_e(R.dictStore),V=$([]),b=$([]),I=$(!0),A=$(),e=$({avatarFile:[],licenseOfDriverFile:[],responsibleCompanyIdList:[],companyId:_.role==="project_manager"?_.companyId:void 0}),Q={realName:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237\u59D3\u540D",trigger:"blur"}],phoneNo:[{required:!0,pattern:/^1[3456789]\d{9}$/,message:"\u624B\u673A\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E",trigger:"blur"}],userName:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u53F7",trigger:"blur"}],password:[{required:!0,pattern:/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,20}$/,message:"\u8BF7\u8F93\u51658-20\u4F4D\u4E14\u81F3\u5C11\u5305\u542B\u5927\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u7279\u6B8A\u7B26\u53F7",trigger:"blur"}],role:[{required:!0,message:"\u8BF7\u9009\u62E9\u7528\u6237\u89D2\u8272",trigger:"change"}],companyId:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F01\u4E1A",trigger:"change"}],responsibleCompanyIdList:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F01\u4E1A",trigger:"change"}],idCard:[{required:!0,pattern:/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,message:"\u8EAB\u4EFD\u8BC1\u53F7\u7801\u8F93\u5165\u4E0D\u6B63\u786E",trigger:"blur"}],avatarFile:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u7167\u7247",type:"array",trigger:"change"}],licenseOfDriverFile:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9A7E\u9A76\u8BC1",type:"array",trigger:"change"}],carExpenseType:[{required:!0,message:"\u8BF7\u9009\u62E9\u51FA\u8F66\u8D39",trigger:"change"}],carExpense:[{required:!0,message:"\u8BF7\u8F93\u5165\u4E2A\u4EBA\u51FA\u8F66\u8D39",trigger:"blur"}],settlementPeriod:[{required:!0,message:"\u8BF7\u9009\u62E9\u7ED3\u7B97\u65B9\u5F0F",trigger:"change"}],bankName:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F00\u6237\u884C",trigger:"blur"}],bankCardNo:[{required:!0,pattern:/^[1-9][0-9]*$/,message:"\u6536\u6B3E\u8D26\u6237\u8F93\u5165\u4E0D\u6B63\u786E",trigger:"blur"}],driveTime:[{required:!0,message:"\u8BF7\u9009\u62E9\u51FA\u8F66\u65F6\u95F4",trigger:"blur"}]},ee=()=>w(this,null,function*(){b.value=(yield ce({pageNumber:1,pageSize:99999})).data.records}),ae=y=>{e.value.responsibleCompanyIdList=void 0,e.value.idCard=void 0,e.value.avatarFile=[],y==="driver"?(Z(),e.value.carExpenseType=2,e.value.settlementPeriod=2,e.value.driveTime="DAY"):(e.value.carExpenseType=void 0,e.value.carExpense=void 0,e.value.driveTime=void 0)},Z=y=>w(this,null,function*(){V.value=(yield fe(z(E({},y),{pageNumber:1,pageSize:2e3}))).data.records}),le=y=>w(this,null,function*(){!y||(yield y.validate(r=>w(this,null,function*(){var v,o;if(r){const s=z(E({},e.value),{companyId:_.role==="enterprise_admin"?_.companyId:e.value.companyId,avatarFileId:e.value.avatarFile&&e.value.avatarFile.length?e.value.avatarFile[0].response.data.id:void 0,licenseOfDriver:e.value.licenseOfDriverFile&&e.value.licenseOfDriverFile.length?e.value.licenseOfDriverFile[0].response.data.id:void 0,responsibleCompanyIdList:(v=e.value.responsibleCompanyIdList)!=null&&v.length?e.value.responsibleCompanyIdList:void 0});yield ve(s),P.$message.success(`${(o=d.data)!=null&&o.userId?"\u7F16\u8F91":"\u65B0\u589E"}\u6210\u529F\uFF01`),i("close",!0)}})))});return be(()=>d.visible,y=>w(this,null,function*(){var r,v,o,s,C,F,D,O,U;if(y){if(Z({managed:!0}),(r=d.data)!=null&&r.userId){const f=yield pe(d.data.userId);e.value=z(E({},f.data),{avatarFile:(v=f.data)!=null&&v.avatarFileId?[{name:`${new Date().getTime()}`,url:(yield H(f.data.avatarFileId)).url,response:{data:{id:f.data.avatarFileId}}}]:[],licenseOfDriverFile:(o=f.data)!=null&&o.licenseOfDriver?[{name:`${new Date().getTime()}`,url:(yield H(f.data.licenseOfDriver)).url,response:{data:{id:f.data.licenseOfDriver}}}]:[],responsibleCompanyIdList:(C=(s=f.data)==null?void 0:s.responsibleCompanyIdList)!=null?C:[],driverProjects:(D=(F=f.data)==null?void 0:F.driverProjects)!=null?D:[],driveCompanyList:(U=(O=f.data)==null?void 0:O.driveCompanyList)!=null?U:[]}),I.value=(yield me(d.data.userId)).data}ee()}else e.value={avatarFile:[],responsibleCompanyIdList:[],companyId:_.role==="project_manager"?_.companyId:void 0},I.value=!0,A.value.resetFields()})),(y,r)=>{const v=m("el-input"),o=m("el-form-item"),s=m("el-col"),C=m("el-option"),F=m("el-select"),D=m("el-row"),O=m("Plus"),U=m("el-icon"),f=m("el-upload"),h=m("el-radio"),S=m("el-radio-group"),re=m("el-input-number"),te=m("el-form"),M=m("el-button"),oe=m("el-dialog");return n(),c(oe,{"model-value":p.visible,title:`${p.data&&p.data.userId?"\u7F16\u8F91":"\u65B0\u589E"}\u7528\u6237`,width:"840px","destroy-on-close":"",onClose:r[20]||(r[20]=t=>i("close"))},{footer:a(()=>[l(M,{type:"primary",size:"small",onClick:r[18]||(r[18]=t=>le(A.value))},{default:a(()=>[Ue]),_:1}),l(M,{type:"info",size:"small",onClick:r[19]||(r[19]=t=>i("close"))},{default:a(()=>[Le]),_:1})]),default:a(()=>[l(te,{ref_key:"formRef",ref:A,model:e.value,rules:Q,"label-width":"100px","label-suffix":":",size:"small"},{default:a(()=>[l(D,{gutter:30},{default:a(()=>{var t;return[l(s,{span:12},{default:a(()=>[l(o,{label:"\u7528\u6237\u59D3\u540D",prop:"realName"},{default:a(()=>[l(v,{modelValue:e.value.realName,"onUpdate:modelValue":r[0]||(r[0]=u=>e.value.realName=u),maxlength:"10",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u624B\u673A\u53F7\u7801",prop:"phoneNo"},{default:a(()=>[l(v,{modelValue:e.value.phoneNo,"onUpdate:modelValue":r[1]||(r[1]=u=>e.value.phoneNo=u),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u8D26\u53F7",prop:"userName"},{default:a(()=>[l(v,{modelValue:e.value.userName,"onUpdate:modelValue":r[2]||(r[2]=u=>e.value.userName=u),maxlength:"30",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),(t=p.data)!=null&&t.userId?j("",!0):(n(),c(s,{key:0,span:12},{default:a(()=>[l(o,{label:"\u5BC6\u7801",prop:"password"},{default:a(()=>[l(v,{modelValue:e.value.password,"onUpdate:modelValue":r[3]||(r[3]=u=>e.value.password=u),maxlength:"30",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1})),l(s,{span:12},{default:a(()=>[l(o,{label:"\u7528\u6237\u89D2\u8272",prop:"role"},{default:a(()=>[l(F,{modelValue:e.value.role,"onUpdate:modelValue":r[4]||(r[4]=u=>e.value.role=u),placeholder:"\u8BF7\u9009\u62E9",class:"w-full",disabled:!I.value,onChange:ae},{default:a(()=>[(n(!0),k(T,null,q(g(B).filter(u=>u.auth.includes(g(_).role)),u=>(n(),c(C,{key:u.key,label:u.name,value:u.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1}),g(_).role!=="enterprise_admin"?(n(),c(s,{key:1,span:12},{default:a(()=>[l(o,{label:"\u6240\u5C5E\u4F01\u4E1A",prop:"companyId"},{default:a(()=>{var u;return[l(F,{modelValue:e.value.companyId,"onUpdate:modelValue":r[5]||(r[5]=L=>e.value.companyId=L),placeholder:"\u8BF7\u9009\u62E9",class:"w-full",disabled:!I.value||!((u=d.data)!=null&&u.userId)&&g(_).role==="project_manager"},{default:a(()=>[(n(!0),k(T,null,q(V.value,L=>(n(),c(C,{key:L.companyId,label:L.companyName,value:L.companyId},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]}),_:1})]),_:1})):j("",!0),e.value.role==="regional_general_manager"?(n(),c(s,{key:2,span:24},{default:a(()=>[l(o,{label:"\u8D1F\u8D23\u4F01\u4E1A",prop:"responsibleCompanyIdList"},{default:a(()=>[l(F,{modelValue:e.value.responsibleCompanyIdList,"onUpdate:modelValue":r[6]||(r[6]=u=>e.value.responsibleCompanyIdList=u),multiple:!0,placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:a(()=>[(n(!0),k(T,null,q(V.value,u=>(n(),c(C,{key:u.companyId,label:u.companyName,value:u.companyId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})):j("",!0)]}),_:1}),e.value.role==="driver"?(n(),c(D,{key:0,gutter:30},{default:a(()=>[l(s,{span:24},{default:a(()=>[l(o,{label:"\u8EAB\u4EFD\u8BC1\u53F7",prop:"idCard"},{default:a(()=>[l(v,{modelValue:e.value.idCard,"onUpdate:modelValue":r[7]||(r[7]=t=>e.value.idCard=t),maxlength:"18",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u4E00\u5BF8\u7167\u7247",prop:"avatarFile"},{default:a(()=>[l(f,{"file-list":e.value.avatarFile,"onUpdate:file-list":r[8]||(r[8]=t=>e.value.avatarFile=t),class:"avatar-uploader",action:g(N),"show-file-list":!1,"on-success":t=>g(X)(t,e.value.avatarFile,!0),"on-error":g(J),"before-upload":t=>g(K)(t,{types:["image/jpeg","image/png","image/gif"],size:5120})},{tip:a(()=>[Ie]),default:a(()=>[e.value.avatarFile&&e.value.avatarFile.length?(n(),k("img",{key:0,src:e.value.avatarFile[0].url,width:"80",height:"80",class:"avatar"},null,8,Ve)):(n(),c(U,{key:1,class:"avatar-uploader-icon"},{default:a(()=>[l(O)]),_:1}))]),_:1},8,["file-list","action","on-success","on-error","before-upload"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u9A7E\u9A76\u8BC1",prop:"licenseOfDriverFile"},{default:a(()=>[l(f,{"file-list":e.value.licenseOfDriverFile,"onUpdate:file-list":r[9]||(r[9]=t=>e.value.licenseOfDriverFile=t),class:"avatar-uploader",action:g(N),"show-file-list":!1,"on-success":t=>g(X)(t,e.value.licenseOfDriverFile,!0),"on-error":g(J),"before-upload":t=>g(K)(t,{types:["image/jpeg","image/png","image/gif"],size:5120})},{tip:a(()=>[Fe]),default:a(()=>[e.value.licenseOfDriverFile&&e.value.licenseOfDriverFile.length?(n(),k("img",{key:0,src:e.value.licenseOfDriverFile[0].url,width:"80",height:"80",class:"avatar"},null,8,Ce)):(n(),c(U,{key:1,class:"avatar-uploader-icon"},{default:a(()=>[l(O)]),_:1}))]),_:1},8,["file-list","action","on-success","on-error","before-upload"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u51FA\u8F66\u8D39",prop:"carExpenseType"},{default:a(()=>[l(S,{modelValue:e.value.carExpenseType,"onUpdate:modelValue":r[10]||(r[10]=t=>e.value.carExpenseType=t)},{default:a(()=>[l(h,{label:2},{default:a(()=>[xe]),_:1}),l(h,{label:1},{default:a(()=>[ke]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e.value.carExpenseType===1?(n(),c(s,{key:0,span:12},{default:a(()=>[l(o,{label:"\u4E2A\u4EBA\u51FA\u8F66\u8D39",prop:"carExpense"},{default:a(()=>[l(re,{modelValue:e.value.carExpense,"onUpdate:modelValue":r[11]||(r[11]=t=>e.value.carExpense=t),min:.01,max:99999.99,precision:2,controls:!1,placeholder:"\u8BF7\u8F93\u5165",class:"flex-1 mr-8"},null,8,["modelValue","min","max"]),he]),_:1})]),_:1})):j("",!0),l(s,{span:12},{default:a(()=>[l(o,{label:"\u7ED3\u7B97\u65B9\u5F0F",prop:"settlementPeriod"},{default:a(()=>[l(S,{modelValue:e.value.settlementPeriod,"onUpdate:modelValue":r[12]||(r[12]=t=>e.value.settlementPeriod=t)},{default:a(()=>[l(h,{label:2},{default:a(()=>[we]),_:1}),l(h,{label:1},{default:a(()=>[Ne]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u5F00\u6237\u884C",prop:"bankName"},{default:a(()=>[l(v,{modelValue:e.value.bankName,"onUpdate:modelValue":r[13]||(r[13]=t=>e.value.bankName=t),maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u6536\u6B3E\u8D26\u6237",prop:"bankCardNo"},{default:a(()=>[l(v,{modelValue:e.value.bankCardNo,"onUpdate:modelValue":r[14]||(r[14]=t=>e.value.bankCardNo=t),maxlength:"19",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u51FA\u8F66\u65F6\u95F4",prop:"driveTime"},{default:a(()=>[l(S,{modelValue:e.value.driveTime,"onUpdate:modelValue":r[15]||(r[15]=t=>e.value.driveTime=t)},{default:a(()=>[l(h,{label:"DAY"},{default:a(()=>[De]),_:1}),l(h,{label:"NIGHT"},{default:a(()=>[Oe]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u6240\u5C5E\u9879\u76EE"},{default:a(()=>[l(F,{modelValue:e.value.driverProjects,"onUpdate:modelValue":r[16]||(r[16]=t=>e.value.driverProjects=t),multiple:!0,placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:a(()=>[(n(!0),k(T,null,q(b.value,t=>(n(),c(C,{key:t.projectId,label:t.projectName,value:t.projectId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(s,{span:12},{default:a(()=>[l(o,{label:"\u53EF\u63A5\u5355\u4F01\u4E1A"},{default:a(()=>[l(F,{modelValue:e.value.driveCompanyList,"onUpdate:modelValue":r[17]||(r[17]=t=>e.value.driveCompanyList=t),multiple:!0,placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:a(()=>[(n(!0),k(T,null,q(V.value,t=>(n(),c(C,{key:t.companyId,label:t.companyName,value:t.companyId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})):j("",!0)]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}});export{Be as default};