Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

projectDialog.977f3e12.js 7.1KB

vor 3 Monaten
1
  1. var G=Object.defineProperty,H=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var z=(o,d,r)=>d in o?G(o,d,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[d]=r,x=(o,d)=>{for(var r in d||(d={}))K.call(d,r)&&z(o,r,d[r]);if(O)for(var r of O(d))Q.call(d,r)&&z(o,r,d[r]);return o},A=(o,d)=>H(o,J(d));var j=(o,d,r)=>new Promise((w,f)=>{var k=i=>{try{v(r.next(i))}catch(l){f(l)}},L=i=>{try{v(r.throw(i))}catch(l){f(l)}},v=i=>i.done?w(i.value):Promise.resolve(i.value).then(k,L);v((r=r.apply(o,d)).next())});import{s as W}from"./projectManage.6b7da462.js";import{d as X,z as Y,r as N,v as B,A as Z,f as b,g as n,p as y,w as t,e as s,x as g,c as V,s as _,F as C,q as ee,h,i as ae}from"./index.551f5afa.js";import{u as le}from"./useTreeSelectData.cd9b00f2.js";import{l as $}from"./userManage.a55501c8.js";const re=h(" \u63D0\u4EA4 "),oe=h(" \u5173\u95ED "),de=X({name:"projectDialog"}),pe=Object.assign(de,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object,cascaderOption:Array,companyOptions:Array},emits:["close"],setup(o,{emit:d}){const r=o,{proxy:w}=ae(),f=Y.userStore.userBaseInfo,{cascaderProps:k}=le(),L=N([]),v=N([]),i=N(),l=N({projectManagerUserIdList:[],engineerUserIdList:[]}),D={projectName:[{required:!0,message:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0",trigger:"blur"}],projectNum:[{required:!0,message:"\u8BF7\u8F93\u5165\u9879\u76EE\u7F16\u53F7",trigger:"blur"}],companyId:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F01\u4E1A",trigger:"change"}],regionCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u533A\u57DF",trigger:"change"}],projectManagerUserIdList:[{required:!0,message:"\u8BF7\u9009\u62E9\u9879\u76EE\u7ECF\u7406",trigger:"change"}],engineerUserIdList:[{required:!0,message:"\u8BF7\u9009\u62E9\u5DE5\u7A0B\u5E08",trigger:"change"}],projectLeaderId:[{required:!0,message:"\u8BF7\u9009\u62E9\u9879\u76EE\u8D1F\u8D23\u4EBA",trigger:"change"}]},S=p=>j(this,null,function*(){!p||(yield p.validate(a=>j(this,null,function*(){var m,u;if(a){const c=A(x({},l.value),{companyId:f.role==="enterprise_admin"?f.companyId:l.value.companyId,regionCode:Array.isArray(l.value.regionCode)?(m=l.value.regionCode)==null?void 0:m.at(-1):l.value.regionCode});yield W(c),w.$message.success(`${(u=r.data)!=null&&u.companyId?"\u7F16\u8F91":"\u65B0\u589E"}\u6210\u529F\uFF01`),d("close",!0)}})))}),q=(p,a)=>j(this,null,function*(){var m,u,c,I;L.value=(u=(m=(yield $({role:"engineer",companyId:p,pageNumber:1,pageSize:2e3})).data)==null?void 0:m.records)!=null?u:[],v.value=(I=(c=(yield $({role:"project_manager",companyId:p,pageNumber:1,pageSize:2e3})).data)==null?void 0:c.records)!=null?I:[],a||(l.value.projectManagerUserIdList=[],l.value.engineerUserIdList=[],l.value.orderAuditUserId=void 0)}),F=p=>{var a;p.includes((a=l.value)==null?void 0:a.orderAuditUserId)||(l.value.orderAuditUserId=void 0)},U=B(()=>f.role==="project_manager"),R=B(()=>v.value.filter(a=>l.value.projectManagerUserIdList.includes(a==null?void 0:a.userId)));return Z(()=>r.visible,p=>j(this,null,function*(){var a,m;if(p){const u=(a=r==null?void 0:r.data)!=null&&a.companyId?r.data.companyId:f.companyId;q(u,1),(m=r.data)!=null&&m.projectId&&(l.value=A(x({},r.data),{regionCode:r.data.regionCode}))}else l.value={projectManagerUserIdList:[],engineerUserIdList:[]},i.value.resetFields()})),(p,a)=>{const m=b("el-input"),u=b("el-form-item"),c=b("el-option"),I=b("el-select"),T=b("el-cascader"),P=b("el-form"),M=b("el-button"),E=b("el-dialog");return n(),y(E,{"model-value":o.visible,title:`${o.data&&o.data.projectId?"\u7F16\u8F91":"\u65B0\u589E"}\u9879\u76EE`,width:"560px","destroy-on-close":"",onClose:a[10]||(a[10]=e=>d("close"))},{footer:t(()=>[s(M,{type:"primary",size:"small",onClick:a[8]||(a[8]=e=>S(i.value))},{default:t(()=>[re]),_:1}),s(M,{type:"info",size:"small",onClick:a[9]||(a[9]=e=>d("close"))},{default:t(()=>[oe]),_:1})]),default:t(()=>[s(P,{ref_key:"formRef",ref:i,model:l.value,rules:D,"label-width":"115px","label-suffix":":",size:"small"},{default:t(()=>[s(u,{label:"\u9879\u76EE\u540D\u79F0",prop:"projectName"},{default:t(()=>[s(m,{modelValue:l.value.projectName,"onUpdate:modelValue":a[0]||(a[0]=e=>l.value.projectName=e),maxlength:"30",placeholder:"\u8BF7\u8F93\u5165",disabled:g(U)},null,8,["modelValue","disabled"])]),_:1}),s(u,{label:"\u9879\u76EE\u7F16\u53F7",prop:"projectNum"},{default:t(()=>[s(m,{modelValue:l.value.projectNum,"onUpdate:modelValue":a[1]||(a[1]=e=>l.value.projectNum=e),maxlength:"30",placeholder:"\u8BF7\u8F93\u5165",disabled:g(U)},null,8,["modelValue","disabled"])]),_:1}),g(f).role!=="enterprise_admin"?(n(),y(u,{key:0,label:"\u6240\u5C5E\u4F01\u4E1A",prop:"companyId"},{default:t(()=>[s(I,{modelValue:l.value.companyId,"onUpdate:modelValue":a[2]||(a[2]=e=>l.value.companyId=e),clearable:!0,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",disabled:g(U),onChange:q},{default:t(()=>[(n(!0),V(C,null,_(o.companyOptions,e=>(n(),y(c,{key:e.companyId,label:e.companyName,value:e.companyId},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1})):ee("",!0),s(u,{label:"\u6240\u5C5E\u533A\u57DF",prop:"regionCode"},{default:t(()=>[s(T,{modelValue:l.value.regionCode,"onUpdate:modelValue":a[3]||(a[3]=e=>l.value.regionCode=e),props:g(k),options:o.cascaderOption,clearable:"",class:"w-full",disabled:g(U)},null,8,["modelValue","props","options","disabled"])]),_:1}),s(u,{label:"\u9879\u76EE\u7ECF\u7406",prop:"projectManagerUserIdList"},{default:t(()=>[s(I,{modelValue:l.value.projectManagerUserIdList,"onUpdate:modelValue":a[4]||(a[4]=e=>l.value.projectManagerUserIdList=e),multiple:"",placeholder:"\u8BF7\u9009\u62E9",class:"w-full",disabled:g(U),onChange:F},{default:t(()=>[(n(!0),V(C,null,_(v.value,e=>(n(),y(c,{key:e.userId,label:e.realName,value:e.userId},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),s(u,{label:"\u5DE5\u7A0B\u5E08",prop:"engineerUserIdList"},{default:t(()=>[s(I,{modelValue:l.value.engineerUserIdList,"onUpdate:modelValue":a[5]||(a[5]=e=>l.value.engineerUserIdList=e),multiple:"",placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:t(()=>[(n(!0),V(C,null,_(L.value,e=>(n(),y(c,{key:e.userId,label:e.realName,value:e.userId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(u,{label:"\u8BA2\u5355\u5BA1\u6838\u5458",prop:"orderAuditUserId"},{default:t(()=>[s(I,{modelValue:l.value.orderAuditUserId,"onUpdate:modelValue":a[6]||(a[6]=e=>l.value.orderAuditUserId=e),placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:t(()=>[(n(!0),V(C,null,_(g(R),e=>(n(),y(c,{key:e.userId,label:e.realName,value:e.userId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(u,{label:"\u9879\u76EE\u8D1F\u8D23\u4EBA",prop:"projectLeaderId"},{default:t(()=>[s(I,{modelValue:l.value.projectLeaderId,"onUpdate:modelValue":a[7]||(a[7]=e=>l.value.projectLeaderId=e),placeholder:"\u8BF7\u9009\u62E9",class:"w-full",disabled:g(U)},{default:t(()=>[(n(!0),V(C,null,_(v.value,e=>(n(),y(c,{key:e.userId,label:e.realName,value:e.userId},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}});export{pe as default};