list.vue 285 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true">
  6. <el-form-item :label="$t('listofitems')" class="toolbar_formitem_n1">
  7. </el-form-item>
  8. <el-form-item >
  9. <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
  10. <div v-if="true" style="display: flex;align-items: center;height: 40px;">
  11. <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? $t('peaseenterthe') : $t('peaseenterthe')" clearable="true" size="small">
  12. <el-select v-model="searchField" style="width:120px;" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
  13. <el-option :label="$t('headerTop.projectName')" value=1 ></el-option>
  14. <el-option :label="$t('Itemno')" value=2 ></el-option>
  15. </el-select>
  16. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  17. </el-input>
  18. </div>
  19. </el-form-item>
  20. <el-form-item >
  21. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('state.states') }}</span>
  22. <el-select v-model="status" style="width:120px;" :placeholder="$t('defaultText.pleaseChoose')" @change="searchList" size="small">
  23. <el-option :label="$t('all')" value=0 ></el-option>
  24. <el-option :label="$t('ongoing')" value=1 ></el-option>
  25. <el-option :label="$t('state.completed')" value=2 ></el-option>
  26. <el-option :label="$t('state.undone')" value=3 ></el-option>
  27. <el-option :label="$t('paused')" value=4 ></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <!-- 主项目筛选 -->
  31. <el-form-item v-if="user.timeType.mainProjectState == '1'">
  32. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('zhu-xiang-mu') }}</span>
  33. <el-select v-model="projectMainId" style="width:110px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  34. <el-option v-for="item in mainProjectList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <!-- 分类筛选 -->
  38. <el-form-item >
  39. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
  40. <el-select v-model="statusClf" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  41. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item style="float:right;" v-if="permissions.projectImport || permissions.projectExport || permissions.projectClassification || (user.company.packageProject == 1 && permissions.projectCostOfItems)">
  45. <el-dropdown>
  46. <el-link type="primary" :underline="false">{{ $t('viewmore') }}<i class="el-icon-arrow-down el-icon--right"></i></el-link>
  47. <el-dropdown-menu slot="dropdown">
  48. <el-dropdown-item v-if="permissions.projectImport">
  49. <el-link type="primary" :underline="false" @click="importProjectBefore">{{ $t('importproject') }}</el-link>
  50. <!-- <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  51. <el-link type="primary" :underline="false" >{{ $t('importproject') }}</el-link>
  52. </el-upload> -->
  53. </el-dropdown-item>
  54. <el-dropdown-item v-if="permissions.projectImport">
  55. <el-link type="primary" :underline="false" @click="downloadmb" v-if="user.company.packageCustomer == 1 || user.company.packageProvider == 1 || user.timeType.mainProjectState == 1 || user.companyId == '936' || user.timeType.reportCc == 1">{{ $t('Downloadthetemplate') }}</el-link>
  56. <el-link type="primary" :underline="false" href="./upload/项目导入模板.xlsx" :download="$t('importtemplateproject') + '.xlsx'" v-else-if="user.timeType.projectWithDept==0">{{ $t('Downloadthetemplate') }}</el-link>
  57. <!--项目带所属部门的-->
  58. <el-link type="primary" :underline="false" href="./upload/项目导入模板_部门.xlsx" download="项目导入模板+部门.xlsx" v-else>{{ $t('Downloadthetemplate') }}</el-link>
  59. </el-dropdown-item>
  60. <el-dropdown-item v-if="permissions.projectExport" :disabled="exportDisabled">
  61. <el-link type="primary" :underline="false" @click="exportProjectData" :download="$t('exportProject') + '.xlsx'">{{ $t('exportProject') }}</el-link>
  62. </el-dropdown-item>
  63. <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectExport">
  64. <el-link type="primary" :underline="false" v-if="user.companyId==936" @click="groupTaskDialog=true" :download="$t('exportingTaskGroups') +'.xlsx'">{{ $t('exportingTaskGroups') }}</el-link>
  65. <el-link type="primary" :underline="false" v-else @click="exportProjectGroup" :download="$t('exportingTaskGroups') +'.xlsx'">{{ $t('exportingTaskGroups') }}</el-link>
  66. </el-dropdown-item>
  67. <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectCostOfItems">
  68. <el-link type="primary" :underline="false" @click="showBaseCostItemDialog">{{ $t('baselinecostitem') }}</el-link>
  69. </el-dropdown-item>
  70. <el-dropdown-item v-if="permissions.projectClassification">
  71. <el-link type="primary" :underline="false" @click="showClfDialog = true">{{ $t('classificationmanagement') }}</el-link>
  72. </el-dropdown-item>
  73. <el-dropdown-item v-if="user.timeType.mainProjectState == 1">
  74. <el-link type="primary" :underline="false" @click="mainProjectDialog = true">{{ $t('masterprojectmanagement') }}</el-link>
  75. </el-dropdown-item>
  76. <el-dropdown-item v-if="permissions.projectPhase && user.company.packageProject == 1">
  77. <el-link type="primary" :underline="false" @click="phaseProjectDialog = true">{{ $t('projectstagemanagement') }}</el-link>
  78. </el-dropdown-item>
  79. <el-dropdown-item v-if="user.timeType.projectLevelState == 1">
  80. <el-link type="primary" :underline="false" @click="projectLevelDialog = true">{{ $t('projectlevelmanagement') }}</el-link>
  81. </el-dropdown-item>
  82. <el-dropdown-item v-if="user.timeType.syncFanwei==1||user.timeType.syncSap==1">
  83. <el-link type="primary" :underline="false" @click="syncProjectForThird()">{{'同步项目信息'}}</el-link>
  84. </el-dropdown-item>
  85. <el-dropdown-item v-if="user.companyId==3385 && permissions.projectClassification">
  86. <el-link type="primary" :underline="false" @click="functionalDivisionDig=true,getFunctionalList()">{{'职能分工设置'}}</el-link>
  87. </el-dropdown-item>
  88. <el-dropdown-item v-if="user.timeType.projectManDay == 1 && permissions.projectClassification">
  89. <el-link type="primary" :underline="false" @click="projectManDaySettingDialog = true;getManDaySetting()">{{ '预估工时配置' }}</el-link>
  90. </el-dropdown-item>
  91. </el-dropdown-menu>
  92. </el-dropdown>
  93. </el-form-item>
  94. <!-- <el-form-item style="float:right;" v-if="user.role == 1||user.role == 2||user.role == 5"> -->
  95. <el-form-item style="float:right;" v-if="permissions.projectNew">
  96. <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{ $t('newproject') }}</el-link>
  97. </el-form-item>
  98. <el-form-item style="float:right;" v-if="permissions.projectResources">
  99. <!-- <router-link to="/projectGantt"> -->
  100. <el-link type="primary" :underline="false" @click="isganttshow = true">{{ $t('resourceallocation') }}</el-link>
  101. <!-- </router-link> -->
  102. <el-dialog v-if="isganttshow" :visible.sync="isganttshow" width="90vw" top="3vh" style="height:96%" class="ganttdialog">
  103. <projectgantt></projectgantt>
  104. </el-dialog>
  105. </el-form-item>
  106. <br/>
  107. <br v-if="user.companyId == 936">
  108. <!-- 时间段筛选 -->
  109. <el-form-item>
  110. <span style="margin-left:15px;margin-right:5px;color:#606266;">时间段</span>
  111. <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="manageSelect()" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:290px;margin-left:5px"></el-date-picker>
  112. </el-form-item>
  113. <!-- 项目经理筛选 -->
  114. <el-form-item>
  115. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('projectmanager') }}</span>
  116. <el-select v-if="user.userNameNeedTranslate != 1" v-model="inchagerId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="manageSelect" size="small" filterable popper-class="managePopperClass">
  117. <el-option v-for="item in users" :key="item.id" :label="user.companyId == 936 ? item.name + '\u3000' + item.jobNumber : item.name" :value="item.id">
  118. <span style="float: left">{{ item.name }}</span>
  119. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  120. </el-option>
  121. </el-select>
  122. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="inchagerId" :distinction="'1'" :clearable="true" @selectCal="selectCal"></selectCat>
  123. </el-form-item>
  124. <el-form-item>
  125. <span style="margin-left:25px;margin-right:5px;color:#606266;">{{ $t('participantin') }}</span>
  126. <el-select v-if="user.userNameNeedTranslate != 1" v-model="participationId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="participationSelect" size="small" filterable popper-class="managePopperClass">
  127. <el-option v-for="item in users" :key="item.id" :label="user.companyId == 936 ? item.name + '\u3000' + item.jobNumber : item.name" :value="item.id">
  128. <span style="float: left">{{ item.name }}</span>
  129. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  130. </el-option>
  131. </el-select>
  132. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="participationId" :distinction="'2'" :clearable="true" @selectCal="selectCal"></selectCat>
  133. </el-form-item>
  134. <!-- 部门筛选 -->
  135. <el-form-item v-if="user.timeType.projectWithDept">
  136. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('lable.department') }}</span>
  137. <el-cascader v-model="deptId" style="width:140px;" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
  138. :props="{ checkStrictly: true, expandTrigger: 'hover' }" :show-all-levels="false" clearable filterable @change="searchClfList" size="small"
  139. ></el-cascader>
  140. </el-form-item>
  141. </el-form>
  142. </el-col>
  143. <!--列表-->
  144. <el-table ref="projectlistOfWudulist" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist" @sort-change="tableSort">
  145. <el-table-column type="selection" width="60" :selectable="isSelectable">
  146. <!-- creator 项目创建人 incharger 项目负责人 -->
  147. </el-table-column>
  148. <!-- <el-table-column type="index" width="60" v-else>
  149. <template slot-scope="scope" >
  150. {{scope.$index+1+(page-1)*size}}
  151. </template>
  152. </el-table-column> -->
  153. <el-table-column prop="projectCode" :label="$t('Itemno')" sortable="custom" width="150"></el-table-column>
  154. <el-table-column prop="contractCode" :label="$t('contractno')" width="200" v-if="user.companyId == '936'">
  155. <template slot-scope="scope">
  156. <!-- <div v-if="scope.row.projectSeparate">
  157. {{scope.row.projectSeparate.contractCode}}
  158. </div> -->
  159. <div v-if="scope.row.projectSeparate">
  160. <div v-if="scope.row.projectSeparate.contractCode">
  161. <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.contractCode.length > 15">
  162. <div>
  163. <span>{{scope.row.projectSeparate.contractCode}}</span>
  164. </div>
  165. <div slot="reference" class="kans">
  166. <span>{{scope.row.projectSeparate.contractCode}}...</span>
  167. </div>
  168. </el-popover>
  169. <div v-else>
  170. <span>{{scope.row.projectSeparate.contractCode}}</span>
  171. </div>
  172. </div>
  173. </div>
  174. </template>
  175. </el-table-column>
  176. <!-- <el-table-column prop="projectCategorySub" label="项目分组" width="200" v-if="user.companyId == '428'">
  177. <template slot-scope="scope">
  178. <div v-if="scope.row.projectSeparate">
  179. <div v-if="scope.row.projectSeparate.projectCategorySub">
  180. <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.projectCategorySub.length > 15">
  181. <div>
  182. <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
  183. </div>
  184. <div slot="reference" class="kans">
  185. <span>{{scope.row.projectSeparate.projectCategorySub}}...</span>
  186. </div>
  187. </el-popover>
  188. <div v-else>
  189. <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
  190. </div>
  191. </div>
  192. </div>
  193. </template>
  194. </el-table-column> -->
  195. <el-table-column prop="categoryName" :label="$t('projectclassification')" sortable="custom" width="140"></el-table-column>
  196. <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250" sortable="custom">
  197. <template slot-scope="scope">
  198. <!-- <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectName.length > 15">
  199. <div>
  200. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  201. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  202. </div>
  203. <div slot="reference" class="kans">
  204. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName.substring(0,15)}}...</el-link>
  205. <span v-if="user.company.packageProject==0" >{{scope.row.projectName.substring(0,15)}}...</span>
  206. </div>
  207. </el-popover>
  208. <div v-else>
  209. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  210. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  211. </div> -->
  212. <div>
  213. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  214. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  215. </div>
  216. </template>
  217. </el-table-column>
  218. <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable="custom" width="200" v-if="user.timeType.projectWithDept"></el-table-column>
  219. <el-table-column prop="projectMainName" :label="$t('zhu-xiang-mu')" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
  220. </el-table-column>
  221. <el-table-column prop="inchargerName" :label="$t('projectmanager')" sortable="custom" min-width="150">
  222. <template slot-scope="scope">
  223. <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
  224. <span v-if="user.userNameNeedTranslate != 1">
  225. {{scope.row.inchargerName}}
  226. </span>
  227. <span v-if="user.userNameNeedTranslate == 1">
  228. <ww-open-data type='userName' :openid='scope.row.inchargerName'></ww-open-data>
  229. </span>
  230. </el-link>
  231. </template>
  232. </el-table-column>
  233. <div v-if="user.timeType.projectCustom">
  234. <el-table-column :prop="`plate${+index+1}`" sortable="custom" width="200" v-for="(item, index) in dataList" :key="item.id" :label="item.customName" v-if="item.customType!=1" ></el-table-column>
  235. </div>
  236. <!-- 项目阶段 -->
  237. <!-- 换位置之前看下项目阶段发起的请求 -->
  238. <el-table-column prop="currentStage" :label="$t('projectphase')" sortable="custom" min-width="150" width="220" v-if="user.company.packageProject == 1">
  239. <template slot-scope="scope">
  240. {{scope.row.currentStageId == null ? $t('nostage') : scope.row.currentStageName}}
  241. <el-link v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId)" type="primary" :underline="false" @click="showChangeStageDialog(scope.row.id, scope.row.currentStageId)">
  242. <i class="el-icon-edit"></i>
  243. </el-link>
  244. </template>
  245. </el-table-column>
  246. <el-table-column prop="participator" :label="$t('participants')" :min-width="user.company.packageCustomer != 1 ? '100' : '300'" sortable v-if="user.company.packageProject==0">
  247. <template slot-scope="scope">
  248. <!-- <v-for v-for="par in scope.row.participator" :key="par.id" >
  249. <el-link style="margin-right:10px;" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
  250. </v-for> -->
  251. <div v-if="scope.row.participator.length > 5">
  252. <el-popover placement="top" width="500" trigger="hover" v-if="scope.row.participator.length > 0">
  253. <span v-for="par in scope.row.participator" :key="par.id">
  254. <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
  255. <span v-if="user.userNameNeedTranslate != 1">
  256. {{par.name}}
  257. </span>
  258. <span v-if="user.userNameNeedTranslate == 1">
  259. <ww-open-data type='userName' :openid='par.name'></ww-open-data>
  260. </span>
  261. </el-link>
  262. </span>
  263. <div slot="reference" class="addss">
  264. <span v-for="par in scope.row.participator" :key="par.id">
  265. <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
  266. <span v-if="user.userNameNeedTranslate != 1">
  267. {{par.name}}
  268. </span>
  269. <span v-if="user.userNameNeedTranslate == 1">
  270. <ww-open-data type='userName' :openid='par.name'></ww-open-data>
  271. </span>
  272. </el-link>
  273. </span>
  274. </div>
  275. </el-popover>
  276. </div>
  277. <div v-else>
  278. <span v-for="par in scope.row.participator" :key="par.id" >
  279. <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate != 1">
  280. {{par.name}}
  281. </el-link>
  282. <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate == 1">
  283. <ww-open-data type='userName' :openid='par.name'></ww-open-data>
  284. </el-link>
  285. </span>
  286. </div>
  287. </template>
  288. </el-table-column>
  289. <!-- 客户管理 -->
  290. <el-table-column prop="customerName" :label="$t('ke-hu')" min-width="190" v-if="user.company.packageCustomer == 1" sortable="custom">
  291. <template slot-scope="scope">
  292. <el-popover placement="top" width="250" trigger="hover" v-if="scope.row.customerName&&scope.row.customerName.length > 12">
  293. <div slot="reference" class="kans">
  294. <span >{{scope.row.customerName.substring(0,12)}}...</span>
  295. </div>
  296. <span >{{scope.row.customerName}}</span>
  297. </el-popover>
  298. <div v-else>
  299. <span >{{scope.row.customerName}}</span>
  300. </div>
  301. </template>
  302. </el-table-column>
  303. <!-- 研究中心 -->
  304. <el-table-column prop="associateDegreeNames" :label="centerNameDegree" min-width="190" v-if="user.timeType.isCro == 1" sortable="custom">
  305. <template slot-scope="scope">
  306. <!-- <div>
  307. {{scope.row.associateDegreeNames}}
  308. </div> -->
  309. <el-popover placement="top" width="300" trigger="hover" v-if="scope.row.associateDegreeNames&&scope.row.associateDegreeNames.length > 12">
  310. <div slot="reference" class="kans">
  311. <span >{{scope.row.associateDegreeNames.substring(0,12)}}...</span>
  312. </div>
  313. <span >{{scope.row.associateDegreeNames}}</span>
  314. </el-popover>
  315. <div v-else>
  316. <span >{{scope.row.associateDegreeNames}}</span>
  317. </div>
  318. </template>
  319. </el-table-column>
  320. <!-- 级别 -->
  321. <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" :label="$t('ji-bie')" min-width="190" v-if="user.company.packageProject == 1">
  322. <template slot-scope="scope">
  323. <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
  324. <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
  325. </template>
  326. </el-table-column>
  327. <!-- 合同金额 -->
  328. <el-table-column prop="contractAmount" :label="'合同金额'" width="200" v-if="user.company.packageProject==1" align="right">
  329. <template slot-scope="scope" >
  330. <span>¥{{Number(scope.row.contractAmount).toFixed(2)}}</span>
  331. </template>
  332. </el-table-column>
  333. <!-- 日报审核人 -->
  334. <el-table-column prop="projectAuditorName" :label="'日报审核人'" sortable="custom" min-width="150" v-if="user.company.companyName=='成都明夷电子科技有限公司'">
  335. <template slot-scope="scope">
  336. <el-link type="primary" :underline="false" @click="showUser(scope.row.projectAuditorId)">
  337. {{scope.row.projectAuditorName}}
  338. </el-link>
  339. </template>
  340. </el-table-column>
  341. <!-- 供应商 -->
  342. <!-- <el-table-column prop="providerNames" label="供应商" min-width="190" v-if="user.company.packageProvider">
  343. </el-table-column> -->
  344. <!-- <div v-if="user.company.packageProvider"> -->
  345. <template>
  346. <div v-for="(item, index) in listHeader" :key="index">
  347. <el-table-column prop="providerNames" :label="item" min-width="190" v-if="user.company.packageProvider">
  348. <template slot-scope="scope">
  349. <div>
  350. {{item | mobans(scope.row.providerInfoList)}}
  351. </div>
  352. </template>
  353. </el-table-column>
  354. </div>
  355. </template>
  356. <el-table-column prop="status" :label="$t('state.states')" min-width="100" sortable="custom">
  357. <template slot-scope="scope">
  358. {{scope.row.status == null?"-":statusTxt[scope.row.status]}}
  359. </template>
  360. </el-table-column>
  361. <!--专业项目协作-->
  362. <el-table-column prop="planStartDate" :label="$t('time.startDate')" min-width="96" >
  363. </el-table-column>
  364. <el-table-column prop="planEndDate" :label="$t('expirationdate')" min-width="96" >
  365. </el-table-column>
  366. <el-table-column prop="progress" :label="$t('completeness')" min-width="100" v-if="user.company.packageProject == 1">
  367. <template slot-scope="scope">
  368. {{scope.row.progress==null?"-":scope.row.progress}}%
  369. </template>
  370. </el-table-column>
  371. <el-table-column prop="manDay" :label="'预估工时'" min-width="150" v-if="user.timeType.projectManDay == 1">
  372. <template slot-scope="scope">
  373. {{scope.row.manDay==null?"":scope.row.manDay}}<span v-if="scope.row.manDay">人天({{scope.row.estimatedWorkTime}}h)</span>
  374. </template>
  375. </el-table-column>
  376. <el-table-column prop="residueEstimatedWorkTime" :label="'剩余预估工时'" min-width="120" v-if="user.timeType.projectManDay == 1">
  377. <template slot-scope="scope">
  378. {{scope.row.residueEstimatedWorkTime==null?"":scope.row.residueEstimatedWorkTime}}<span v-if="scope.row.residueEstimatedWorkTime">h</span>
  379. </template>
  380. </el-table-column>
  381. <el-table-column :label="$t('operation')" :width="showColumnWidth" align="left" fixed="right" v-if="showColumnWidth != '0' || permissions.projectManagement">
  382. <template slot-scope="scope">
  383. <el-button v-if="(permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1'" size="mini" @click="subProject(scope.row)">{{ $t('lable.subproject') }}</el-button>
  384. <el-button size="mini" v-if="permissions.projectParticipator || permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId" type="primary" @click="handleAdd(scope.$index, scope.row)">{{ $t('bian-ji') }}</el-button>
  385. <!-- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini" @click="deletePro(scope.$index, scope.row)">删除</el-button> -->
  386. <el-dropdown class="customdropdown" split-button size="mini" @click="finishPro(scope.row)" v-if="(permissions.projectManagement || user.id==scope.row.creatorId || user.id==scope.row.inchargerId) && scope.row.status == 1" placement="bottom-start">
  387. {{ $t('wan-cheng') }}
  388. <el-dropdown-menu slot="dropdown" class="customdropdown_menu">
  389. <el-button size="mini" @click="cancelPro(scope.row)" class="customdropdown_menu_btn">{{ $t('btn.undo') }}</el-button><br>
  390. <el-button size="mini" @click="suspendPro(scope.row)" class="customdropdown_menu_btn">{{ $t('zan-ting') }}</el-button><br>
  391. </el-dropdown-menu>
  392. </el-dropdown>
  393. <el-button v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId) && scope.row.status >= 2" size="mini" @click="restartPro(scope.row)">{{ $t('zhong-qi') }}</el-button>
  394. </template>
  395. </el-table-column>
  396. </el-table>
  397. <!--工具条-->
  398. <el-col :span="24" class="toolbar">
  399. <el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">{{ $t('btn.cancel') }}</el-button>
  400. <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
  401. <el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">{{ $t('volumeset') }} {{user.timeType.customDegreeName}}</el-button>
  402. <el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">{{ $t('pi-liang-tian-jia') }} {{user.timeType.customDegreeName}}</el-button>
  403. </template>
  404. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  405. <el-button size="small" type="primary" @click="addTaskGroup()" >{{'批量增加任务分组'}}</el-button>
  406. </template>
  407. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  408. <el-button size="small" type="primary" @click="setGroupIncharger()" >{{'批量设置分组负责人'}}</el-button>
  409. </template>
  410. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  411. <el-button size="small" type="primary" @click="addGroupPerson()" :loading="addGroupPersonBtnLoading">{{ $t('groupparticipantsinbatches') }}</el-button>
  412. </template>
  413. <template v-if="(showColumnWidth != '0' || permissions.projectManagement)">
  414. <el-button size="small" type="primary" @click="addProPreson()">{{ $t('projectparticipantsinbatches') }}</el-button>
  415. <el-button size="small" type="primary" v-if="permissions.projectManagement" @click="batchIncharger()">{{ $t('projectmanagersinbatches') }}</el-button>
  416. <el-button size="small" type="primary" v-if="user.roleName='超级管理员'" @click="batchDelete()" :loading="isDeleting">批量删除</el-button>
  417. </template>
  418. <el-pagination :key="projectListPageComponentKey"
  419. @size-change="handleSizeChange"
  420. @current-change="handleCurrentChange"
  421. :page-sizes="[20 , 50 , 80 , 100]"
  422. :page-size="size"
  423. :current-page.sync="page"
  424. layout="total, sizes, prev, pager, next"
  425. :total="total"
  426. style="float:right;"
  427. ></el-pagination>
  428. </el-col>
  429. <!--新增界面-->
  430. <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px" :top="'6vh'">
  431. <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
  432. <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
  433. <el-form-item :label="$t('Itemno')" :class="title == $t('newproject')" v-if="user.companyId!=936">
  434. <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
  435. <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName)" maxlength="50" show-word-limit="true"></el-input>
  436. </el-form-item>
  437. <el-form-item :label="$t('Itemno')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.companyId==936" prop="code">
  438. <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
  439. <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName) || isShowProjectName" maxlength="50" show-word-limit="true"></el-input>
  440. </el-form-item>
  441. <el-form-item :label="$t('zhu-xiang-mu')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.mainProjectState == '1'">
  442. <!-- <el-select v-model="addForm.projectMainId" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id" @change="projectManagementChange"> -->
  443. <el-select v-model="addForm.projectMainId" clearable @change="projectManagementChange">
  444. <el-option v-for="(item) in mainProjectList" :key="item.id" :value="item.id" :label="item.name + '\u3000' + item.code">
  445. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.code }}</span>
  446. <span style="float: right;margin-left: 20px">{{ item.name }}</span>
  447. </el-option>
  448. </el-select>
  449. </el-form-item>
  450. <el-form-item :label="$t('projectclassification')" v-if="user.timeType.mainProjectState != '1'">
  451. <!-- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
  452. <el-select v-model="addForm.category" style="width:32%;" clearable filterable :disabled="canOnlyModParticipator">
  453. <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
  454. </el-select>
  455. </el-form-item>
  456. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  457. <!-- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input> -->
  458. <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName) || isShowProjectName" maxlength="255" show-word-limit="true"></el-input>
  459. </el-form-item>
  460. <el-form-item :label="$t('other.projectDescription')" prop="projectDesc">
  461. <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
  462. <el-input v-model="addForm.projectDesc" :placeholder="$t('peaseenterthe')" clearable maxlength="4000" :disabled="canOnlyModParticipator" show-word-limit></el-input>
  463. </el-form-item>
  464. <el-form-item :label="$t('projecttype')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" prop="isPublic">
  465. <!-- <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
  466. <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="canOnlyModParticipator">
  467. <!-- <el-option :value="0" :label="$t('commonproject')"></el-option>
  468. <el-option :value="1" :label="$t('publicprojects')"></el-option> -->
  469. <el-option :value="0" :label="$t('zheng-shi-xiang-mu')"></el-option>
  470. <el-option :value="1" :label="$t('fei-xiang-mu')"></el-option>
  471. </el-select>
  472. <el-tooltip effect="dark" :content="$t('zheng-shi-xiang-mu-zhi-dui-can-yu-ren-kai-fang-fei-xiang-mu-dui-suo-you-cheng-yuan-kai-fang')" placement="top-start">
  473. <i class="el-icon-question"></i>
  474. </el-tooltip>
  475. <div v-if="user.company.packageCustomer == 1" style="display: inline-block;width: 50%">
  476. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ke-hu') }}</span>
  477. <el-select v-model="addForm.customerId" clearable="true" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:70%;" :disabled="canOnlyModParticipator">
  478. <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
  479. </el-select>
  480. </div>
  481. </el-form-item>
  482. <el-form-item :label="$t('subordinatedepartments')" :prop="user.companyId == 936 ? 'deptId' : false" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.projectWithDept">
  483. <el-cascader v-model="addForm.deptId" :options="departmentList" :placeholder="$t('defaultText.pleaseChoose')" :disabled="canOnlyModParticipator"
  484. :props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable filterable @change="cascaderChange" style="width: 100%"
  485. ></el-cascader>
  486. </el-form-item>
  487. <!-- 供应商 -->
  488. <!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
  489. <el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
  490. <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id">
  491. </el-option>
  492. </el-select>
  493. </el-form-item> -->
  494. <el-form-item :label="$t('supplier')" v-if="user.company.packageProvider">
  495. <el-select v-model="addForm.supplierId" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width: 100%" :disabled="canOnlyModParticipator">
  496. <span v-for="(item, index) in supplierList" :key="index">
  497. <el-option :label="item.providerName" :value="item.id"></el-option>
  498. </span>
  499. </el-select>
  500. </el-form-item>
  501. <el-form-item :label="yonghuUser.customDegreeName" v-if="yonghuUser.customDegreeActive == 1">
  502. <el-select v-model="auseList" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width: 100%" :disabled="canOnlyModParticipator">
  503. <span v-for="(item, index) in ause" :key="index">
  504. <el-option :label="item.name" :value="item.id"></el-option>
  505. </span>
  506. </el-select>
  507. </el-form-item>
  508. <!-- <el-form-item label="客户" v-if="user.company.packageCustomer == 1">
  509. <el-select v-model="addForm.customerId" clearable="true" filterable placeholder="请选择客户" style="width:100%;" >
  510. <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
  511. </el-select>
  512. </el-form-item> -->
  513. <el-form-item :label="$t('Allparticipants')" v-show="addForm.isPublic == 0" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  514. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != 1">
  515. <div slot="content" style="width:780px">{{addForm.userNames}}</div>
  516. <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
  517. </el-tooltip>
  518. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
  519. <div slot="content" style="width:780px">
  520. <span v-for="(item, index) in addFormUserNames" :key="index">
  521. <!-- {{item}} -->
  522. <ww-open-data type='userName' :openid='item'></ww-open-data>
  523. <span v-if="index < addFormUserNames.length - 1">,</span>
  524. </span>
  525. </div>
  526. <div @click="showChooseMembTree" style="width: 800px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
  527. <span v-for="(item, index) in addFormUserNames" :key="index">
  528. <!-- {{item}} -->
  529. <ww-open-data type='userName' :openid='item'></ww-open-data>
  530. <span v-if="index < addFormUserNames.length - 1">,</span>
  531. </span>
  532. </div>
  533. </el-tooltip>
  534. </el-form-item>
  535. <el-form-item :label="$t('projectmanager')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  536. <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator || projectManagerEdit">
  537. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  538. <span style="float: left">{{ item.name }}</span>
  539. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  540. </el-option>
  541. </el-select>
  542. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit || isShowProjectName"></selectCat>
  543. </el-form-item>
  544. <el-form-item :label="$t('newspaperauditor')" v-show="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4 || user.timeType.reportAuditType == 6">
  545. <el-select v-if="user.userNameNeedTranslate != '1'" @change="$forceUpdate()" v-model="addForm.auditUserIds" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" :multiple="user.timeType.reportAuditType != 6" >
  546. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  547. </el-select>
  548. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.auditUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="user.timeType.reportAuditType != 6" @selectCal="selectCal"></selectCat>
  549. </el-form-item>
  550. <el-form-item v-if="user.timeType.reportCc == 1" label="日报抄送人" >
  551. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.ccUserIds" multiple="true" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable placeholder="请选择抄送人" style="width:100%;" >
  552. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  553. </el-select>
  554. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.ccUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="true" @selectCal="selectCal"></selectCat>
  555. </el-form-item>
  556. <!--专业项目协作版本功能 -->
  557. <el-form-item :label="$t('ji-bie')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.packageProject==1">
  558. <el-select v-model="addForm.level" :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" v-if="user.timeType.projectLevelState == 1" :disabled="canOnlyModParticipator || isShowProjectName">
  559. <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
  560. </el-select>
  561. <el-select v-model="addForm.level" :placeholder="this.$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator" v-else>
  562. <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
  563. </el-select>
  564. <!-- 增加合同金额字段 -->
  565. <!-- <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
  566. <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;" @blur="contractAmountChange(addForm.contractAmount)"
  567. placeholder="整数" clearable @keyup.native="restrictNumber('contractAmount')" :disabled="title == '新增项目' ? false : false"></el-input><span style="margin-left:10px;">元</span> -->
  568. </el-form-item>
  569. <!-- 增加合同金额字段 -->
  570. <el-form-item :label="$t('contractamount')" v-if="user.company.packageProject==1">
  571. <el-input id="contractAmount" v-model="addForm.contractAmount" :disabled="canOnlyModParticipator" style="width:32%;" @input="contractAmountChange(addForm.contractAmount)" :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('contractAmount')"></el-input><span style="margin-left:10px;position:absolute;">{{ $t('yuan') }}</span>
  572. <template v-if="title == $t('modifytheproject') && contractAmountReasonShow">
  573. <span style="margin-left:63px;margin-right:10px;">{{ $t('modifythereason') }}</span>
  574. <el-input v-model="addForm.changeContractReason" style="width:33%" clearable :placeholder="$t('contractamountasd')"></el-input>
  575. </template>
  576. </el-form-item>
  577. <el-form-item :label="$t('ommencementDate')" prop="planStartDate" >
  578. <el-date-picker v-model="addForm.planStartDate" :disabled="canOnlyModParticipator"
  579. :editable="false" style="width:32%;"
  580. format="yyyy-MM-dd"
  581. value-format="yyyy-MM-dd"
  582. :clearable="false" type="date"
  583. :placeholder="$t('optiondate')"></el-date-picker>
  584. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ji-hua-jie-shu-ri-qi') }}</span>
  585. <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
  586. :editable="false" :disabled="canOnlyModParticipator"
  587. format="yyyy-MM-dd"
  588. value-format="yyyy-MM-dd"
  589. :clearable="false" type="date"
  590. :placeholder="$t('optiondate')"></el-date-picker>
  591. </el-form-item>
  592. <!-- 增加BU字段 绎维固定字段 -->
  593. <el-form-item label="BU" v-if="user.companyId == '862'">
  594. <el-cascader ref="deptCascader" v-model="addForm.bu" style="width: 250px" :show-all-levels="false" :disabled="canOnlyModParticipator"
  595. :options="buOption" :props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable v-show="user.userNameNeedTranslate != 1"></el-cascader>
  596. <vueCascader :size="'small'" :subjectId="addForm.bu" :widthStr="'200'" :clearable="true" :subject="buOption" :radios="true" :distinction="'32'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  597. </el-form-item>
  598. <!-- 增加项目人天字段 绎维固定字段 -->
  599. <el-form-item v-if="user.timeType.projectManDay == 1">
  600. <template slot="label"><span v-if="manDaySetting.projectManDayFillMode == 2 || (manDaySetting.projectManDayFillMode == 1 && addForm.fromOutside == 0)" style="padding:5px;color:red;">*</span>项目人天</template>
  601. <el-input v-model.number="addForm.manDay" :placeholder="$t('peaseenterthe')" @input="jisuanEstimatedWorkTime(addForm.manDay)" style="width: 100px"></el-input><span style="margin-left:10px;position:absolute;">人天(预估工时:{{this.estimatedWorkTime}}h)</span>
  602. <el-tooltip effect="dark" :content="$t('根据系统基础设置每日正常工作时长计算,1人天为一个每日正常工作时长')" placement="top-start" style="margin-left:180px">
  603. <i class="el-icon-question" style="color:#606266"></i>
  604. </el-tooltip>
  605. <span style="margin-left:63px;margin-right:10px;" v-if="user.companyId != 936" >{{'管控开始日期'}}</span>
  606. <el-date-picker v-model="addForm.manDayStartDate" v-if="user.companyId != 936"
  607. :editable="false" style="width:20%;"
  608. format="yyyy-MM-dd"
  609. value-format="yyyy-MM-dd"
  610. :clearable="false" type="date"
  611. :placeholder="$t('optiondate')"></el-date-picker>
  612. <el-tooltip effect="dark" :content="$t('从该日期起,填报工时开始占用预算人天工时')" placement="top-start" style="margin-left:10px" v-if="user.companyId != 936">
  613. <i class="el-icon-question" style="color:#606266"></i>
  614. </el-tooltip>
  615. </el-form-item>
  616. <el-form-item :label="$t('projectoutput')" prop="outputValue" v-if="user.timeType.outputValueStatus == 1">
  617. <el-input id="outputValue" v-model="addForm.outputValue" style="width:32%;" :disabled="canOnlyModParticipator"
  618. placeholder="" clearable @keyup.native="restrictNumber('outputValue')">
  619. </el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  620. </el-form-item>
  621. <!-- 单个公司的固定字段 -->
  622. <div v-if="user.companyId == '936'">
  623. <el-form-item :label="$t('contractno')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  624. <el-input v-model="addForm.contractCode" maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || isShowProjectName"></el-input>
  625. </el-form-item>
  626. <el-form-item :label="$t('warrantystartime')">
  627. <el-date-picker v-model="addForm.warrantyStartDate"
  628. :editable="false" style="width:32%;" :disabled="canOnlyModParticipator"
  629. format="yyyy-MM-dd"
  630. value-format="yyyy-MM-dd"
  631. :clearable="false" type="date"
  632. :placeholder="$t('optiondate')"></el-date-picker>
  633. <span style="margin-left:63px;margin-right:10px;" >{{ $t('warrantyexpirationtime') }}</span>
  634. <el-date-picker v-model="addForm.warrantyEndDate" style="width:33%;" :disabled="canOnlyModParticipator"
  635. :editable="false"
  636. format="yyyy-MM-dd"
  637. value-format="yyyy-MM-dd"
  638. :clearable="false" type="date"
  639. :placeholder="$t('optiondate')"></el-date-picker>
  640. </el-form-item>
  641. <el-form-item :label="$t('IndependentProject')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  642. <!-- <el-input v-model="addForm.projectCategorySub" placeholder="请输入自主项目类别" clearable></el-input> -->
  643. <el-select v-model="addForm.projectCategorySub" :placeholder="$t('defaultText.pleaseChoose')" clearable :disabled="canOnlyModParticipator">
  644. <el-option :value="$t('softwareproject')" :label="$t('softwareproject')"></el-option>
  645. <el-option :value="$t('hardwareproject')" :label="$t('hardwareproject')"></el-option>
  646. <el-option :value="$t('integrationproject')" :label="$t('integrationproject')"></el-option>
  647. <el-option :value="$t('fu-wu-xiang-mu')" :label="$t('fu-wu-xiang-mu')"></el-option>
  648. </el-select>
  649. </el-form-item>
  650. <el-form-item :label="$t('region')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  651. <el-input v-model="addForm.region" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || isShowProjectName"></el-input>
  652. </el-form-item>
  653. <el-form-item :label="$t('subordinateBU')" >
  654. <el-input v-model="addForm.bu" :placeholder="$t('subordinateBU')" clearable :disabled="canOnlyModParticipator"></el-input>
  655. </el-form-item>
  656. </div>
  657. <!-- 用户自己定义的字段 -->
  658. <div style="margin-top: 20px" v-if="dataList.length > 0 && user.timeType.projectCustom">
  659. <el-form-item v-for="(item, index) in dataList" :key="item.id" :label="item.customName">
  660. <div v-if="item.customType == 0">
  661. <el-input v-model="item.value" clearable placeholder="请输入内容" @input="ipts(item.value, index)"></el-input>
  662. </div>
  663. <div v-if="item.customType == 1">
  664. <el-upload
  665. list-type="picture-card"
  666. ref="upload" :file-list="item.value" :action="index" :auto-upload="true" :limit="2" :disabled="item.valuelist.length == '2'" :http-request="fileUpload">
  667. <i slot="default" class="el-icon-plus"></i>
  668. <div slot="file" slot-scope="{file}">
  669. <img
  670. class="el-upload-list__item-thumbnail"
  671. :src="file.url" alt=""
  672. >
  673. <span class="el-upload-list__item-actions">
  674. <span
  675. class="el-upload-list__item-preview"
  676. @click="handlePictureCardPreview(file)"
  677. >
  678. <i class="el-icon-zoom-in"></i>
  679. </span>
  680. <span
  681. v-if="!disabled"
  682. class="el-upload-list__item-delete"
  683. @click="handleRemove(file, index)"
  684. >
  685. <i class="el-icon-delete"></i>
  686. </span>
  687. </span>
  688. </div>
  689. </el-upload>
  690. </div>
  691. <div v-if="item.customType == 2">
  692. <el-date-picker v-model="item.value" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd"></el-date-picker>
  693. </div>
  694. </el-form-item>
  695. </div>
  696. <!-- <div v-if="user.companyId == '428'">
  697. <el-form-item :label="$t('projectgroup')" >
  698. <el-input v-model="addForm.projectCategorySub" maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable></el-input>
  699. </el-form-item>
  700. </div> -->
  701. <!-- 项目基线 -->
  702. <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1 && !canOnlyModParticipator">
  703. <el-tabs v-model="activeName" @tab-click="handleClick">
  704. <el-tab-pane :label="$t('costbaseline')" name="baseCostPanel" >
  705. <div style="padding-top:10px;">
  706. <!--新版 -->
  707. <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
  708. <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
  709. <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
  710. :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  711. </span>
  712. <!-- 合计 -->
  713. <div style="margin-top: 10px;float:right;">
  714. <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">{{ $t('other.totals') }}</span>
  715. <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
  716. <span v-else>{{addForm.budget | numberToCurrency}}</span>
  717. <span style="margin-right:50px;margin-left:10px;">{{ $t('yuan') }}</span>
  718. </div>
  719. </div>
  720. </el-tab-pane>
  721. <el-tab-pane :label="$t('keynodes')" name="baseCostPanep" v-if="user.companyId == '936'">
  722. <div style="padding-top:10px;">
  723. <!--新版 -->
  724. <div class="keyNodes">
  725. <div class="keyNodesName">{{ $t('nameofthenode') }}</div>
  726. <div class="keyNodesTime">{{ $t('plannedcompletiontime') }}</div>
  727. <div class="keyNodesTime">{{ $t('actualcompletiontime') }}</div>
  728. <div class="keyNodesTime">{{ $t('state.states') }}</div>
  729. </div>
  730. <div class="keyNodes" v-for="item in projectKeyNodesData" :key="item.nodesId">
  731. <div class="keyNodesName">{{item.nodesName}}</div>
  732. <div class="keyNodesTime">
  733. <el-date-picker v-model="item.planCompleteDate" clearable style="width: 80%" size="small" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
  734. </div>
  735. <div class="keyNodesTime">
  736. <el-date-picker v-model="item.actualCompleteDate" clearable style="width: 80%" size="small" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
  737. </div>
  738. <div class="keyNodesTime">
  739. <el-select v-model="item.states" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" size="small">
  740. <el-option :label="$t('zheng-chang')" value="0"></el-option>
  741. <el-option :label="$t('yan-qi')" value="1"></el-option>
  742. <el-option :label="$t('wan-cheng')" value="2"></el-option>
  743. </el-select>
  744. </div>
  745. </div>
  746. </div>
  747. </el-tab-pane>
  748. <el-tab-pane :label="$t('engineering')" name="engineeringProfession" v-if="user.company.packageEngineering == 1">
  749. <div style="padding-top:10px;" class="gongcheng">
  750. <el-table :data="projectProfessionList" size="small" :key="Math.random()" :height="'400px'">
  751. <el-table-column prop="professionId" width="200">
  752. <template slot-scope="scope">
  753. <el-select v-model="scope.row.professionId" >
  754. <el-option v-for="item in professionList" :key="item.id" :label="item.name" :value="item.id"/>
  755. </el-select>
  756. </template>
  757. <template slot="header" >
  758. <span style="font-size:14px;font-weight:normal;">{{ $t('nameprofessional') }}</span>
  759. </template>
  760. </el-table-column>
  761. <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
  762. <template slot-scope="scope">
  763. <div><el-input type="number" v-model="scope.row.percentage"></el-input></div>
  764. </template>
  765. </el-table-column>
  766. <el-table-column prop="membNames" :label="$t('personnelproportion')">
  767. <template slot-scope="scope">
  768. <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">
  769. <span v-if="user.userNameNeedTranslate != 1">{{item.membName}}({{item.percentage}}%)</span>
  770. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.membName'></ww-open-data>({{item.percentage}}%)</span>
  771. </span>
  772. <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?$t('professionalparticipants'):$t('setup')}}</el-link>
  773. </template>
  774. </el-table-column>
  775. <el-table-column prop="inchargerName" width="200" :label="$t('head')">
  776. <template slot-scope="scope">
  777. <el-select v-model="scope.row.inchargerId" v-if="user.userNameNeedTranslate != 1">
  778. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  779. </el-select>
  780. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="participator" :subjectId="scope.row.inchargerId" :other="scope.$index" :distinction="'4'" @selectCal="selectCal"></selectCat>
  781. </template>
  782. </el-table-column>
  783. <el-table-column width="80">
  784. <template slot-scope="scope">
  785. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.$index)"></el-button>
  786. </template>
  787. <template slot="header" >
  788. <el-link type="primary" :underline="false" @click="addItem">{{ $t('addTian') }}</el-link>
  789. </template>
  790. </el-table-column>
  791. </el-table>
  792. </div>
  793. </el-tab-pane>
  794. <!-- <el-tab-pane label="相关领导" name="leaders" >
  795. <div style="padding-top:10px;">
  796. <el-input @focus="showChooseLeaderTree" v-model="addForm.notifyUserNames" placeholder="请选择需要接收审核通知的相关领导"></el-input>
  797. </div>
  798. </el-tab-pane> -->
  799. </el-tabs>
  800. </div>
  801. </el-form>
  802. </div>
  803. <div slot="footer" class="dialog-footer;">
  804. <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectManagement || user.id==deleteVif) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
  805. <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
  806. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  807. </div>
  808. </el-dialog>
  809. <!-- 图片放大弹窗 -->
  810. <el-dialog :visible.sync="imgUrlListFlg" width="70%" :before-close="xhutDown">
  811. <img width="100%" :src="imgUrlLists" alt="">
  812. </el-dialog>
  813. <!--用户详细信息弹出框-->
  814. <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  815. <div class="line"><span>{{ $t('lable.name') }}</span>
  816. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
  817. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
  818. </div>
  819. <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
  820. <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
  821. <div class="line"><span>{{ $t('jiao-se') }}</span><span>{{userDetail.roleName}}</span></div>
  822. <div class="line"><span>{{ $t('lable.department') }}</span>
  823. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
  824. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
  825. </div>
  826. <div slot="footer" class="dialog-footer">
  827. <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
  828. </div>
  829. </el-dialog>
  830. <!-- 子项目列表 -->
  831. <el-dialog :title="$t('listofsubitems')" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  832. <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
  833. <el-table-column width="120" :label="$t('subprojectno')" prop="code"></el-table-column>
  834. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  835. <el-table-column :label="$t('operation')" width="220">
  836. <template slot-scope="scope" >
  837. <el-switch
  838. @change="changSubStatus(scope.row)"
  839. v-model="scope.row.status"
  840. active-color="#13ce66"
  841. inactive-color="#ff4949"
  842. style="margin-right: 20px;">
  843. </el-switch>
  844. <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">{{ $t('bian-ji') }}</el-button>
  845. <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  846. </template>
  847. </el-table-column>
  848. </el-table>
  849. <div slot="footer" class="dialog-footer">
  850. <el-button type="default" :disabled="subProjectList.length == 0" @click="forSubProjectlist = list.filter(a=>a.id != currentProject.id);copySubPListVisible = true;" style="align:left;">复制到其他项目</el-button>
  851. <el-button type="primary" @click="subProjectVisible = false" >{{ $t('Shutdown') }}</el-button>
  852. <el-button type="primary" @click="addNewSubProject()" >{{ $t('addsubitems') }}</el-button>
  853. </div>
  854. </el-dialog>
  855. <!--选择项目弹出框-->
  856. <el-dialog title="选择要复制到的目标项目" v-if="copySubPListVisible" :visible.sync="copySubPListVisible" :close-on-click-modal="false" customClass="customWidth" width="700px">
  857. <el-table ref="projectForSubCopy" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="forSubProjectlist" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedProlistForSub" @sort-change="tableSort">
  858. <el-table-column type="selection" width="60" >
  859. </el-table-column>
  860. <el-table-column prop="projectCode" :label="$t('Itemno')" width="150"></el-table-column>
  861. <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250">
  862. </el-table-column>
  863. </el-table>
  864. <div slot="footer" class="dialog-footer">
  865. <el-button @click.native="copySubPListVisible = false">{{ $t('btn.cancel') }}</el-button>
  866. <el-button type="primary" @click="submitCopySubProject()" >{{ $t('btn.submit') }}</el-button>
  867. </div>
  868. </el-dialog>
  869. <!-- 新增子项目弹出框 -->
  870. <el-dialog :title="$t('modifysubproject')" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
  871. <el-form ref="form2" :model="temaddForm" :rules="rules" label-width="100px">
  872. <!-- <el-form-item label="项目编号" prop="code"> -->
  873. <el-form-item :label="$t('Itemno')">
  874. <el-input v-model="temaddForm.code" :placeholder="$t('peaseenterthe')" clearable></el-input>
  875. </el-form-item>
  876. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  877. <el-input v-model="temaddForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  878. </el-form-item>
  879. </el-form>
  880. <div slot="footer" class="dialog-footer">
  881. <el-button @click.native="addSubProject = false">{{ $t('btn.cancel') }}</el-button>
  882. <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  883. </div>
  884. </el-dialog>
  885. <!-- 项目基线成本项配置弹出框 -->
  886. <el-dialog :title="$t('baselinecostitemmanagement')" show-header="false" v-if="showBaseConfig" :visible.sync="showBaseConfig" :close-on-click-modal="false" customClass="customWidth" width="600px">
  887. <el-table :data="baseCostItemList" highlight-current-row height="400" style="width: 100%;">
  888. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  889. <template slot-scope="scope" >
  890. {{scope.$index+1+(page-1)*size}}
  891. </template>
  892. </el-table-column>
  893. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  894. <el-table-column prop="alarmType" :label="$t('yu-jing')">
  895. <template slot-scope="scope">
  896. <span>{{scope.row.alarmType ? $t('hourscostwarning') : $t('wu-yu-jing')}}</span>
  897. </template>
  898. </el-table-column>
  899. <el-table-column :label="$t('operation')" width="150">
  900. <template slot-scope="scope" >
  901. <el-button size="small" type="primary" @click="addNewBaseItem(scope.row)">{{ $t('bian-ji') }}</el-button>
  902. <el-button size="small" type="danger" @click="deleteBaseItem(scope.row)">{{ $t('btn.delete') }}</el-button>
  903. </template>
  904. </el-table-column>
  905. </el-table>
  906. <div slot="footer" class="dialog-footer">
  907. <el-button type="primary" @click="showBaseConfig = false" >{{ $t('Shutdown') }}</el-button>
  908. <el-button type="primary" @click="addNewBaseItem()" >{{ $t('newcostitem') }}</el-button>
  909. </div>
  910. </el-dialog>
  911. <!-- 项目关键节点配置弹出框 -->
  912. <el-dialog :title="$t('keyprojectnodes')" show-header="false" v-if="keyNodesIsShow" :visible.sync="keyNodesIsShow" :close-on-click-modal="false" customClass="customWidth" width="600px">
  913. <el-table :data="keyNodesList" highlight-current-row height="400" style="width: 100%;">
  914. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  915. <template slot-scope="scope" >
  916. {{scope.$index+1+(page-1)*size}}
  917. </template>
  918. </el-table-column>
  919. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  920. <el-table-column :label="$t('operation')" width="150">
  921. <template slot-scope="scope" >
  922. <el-button size="small" type="primary" @click="addNewkeyNodes(scope.row)">{{ $t('bian-ji') }}</el-button>
  923. <el-button size="small" type="danger" @click="deletekeyNodes(scope.row)">{{ $t('btn.delete') }}</el-button>
  924. </template>
  925. </el-table-column>
  926. </el-table>
  927. <div slot="footer" class="dialog-footer">
  928. <el-button type="primary" @click="keyNodesIsShow = false" >{{ $t('Shutdown') }}</el-button>
  929. <el-button type="primary" @click="addNewkeyNodes()" >{{$t('addingKeyNodes')}}</el-button>
  930. </div>
  931. </el-dialog>
  932. <!-- 分类条目配置 -->
  933. <el-dialog :title="$t('projectclassificationqwe')" show-header="false" v-if="showClfDialog" :visible.sync="showClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  934. <el-table :data="baseClfList" highlight-current-row height="400" style="width: 100%;">
  935. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  936. <template slot-scope="scope" >
  937. {{scope.$index+1}}
  938. </template>
  939. </el-table-column>
  940. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  941. <el-table-column :label="$t('operation')" :width="user.companyId == '862' ? '300px' : '180px'">
  942. <template slot-scope="scope" >
  943. <el-button size="small" type="primary" @click="auditProcess(scope.row)" v-if="user.companyId == '862'" >{{ $t('AuditProcess') }}</el-button>
  944. <el-button size="small" type="primary" @click="addNewClf(scope.row)">{{ $t('bian-ji') }}</el-button>
  945. <el-button size="small" type="danger" @click="deleteClf(scope.row)">{{ $t('btn.delete') }}</el-button>
  946. </template>
  947. </el-table-column>
  948. </el-table>
  949. <div slot="footer" class="dialog-footer">
  950. <el-button type="primary" @click="showClfDialog = false" >{{ $t('Shutdown') }}</el-button>
  951. <el-button type="primary" @click="addNewClf()" >{{ $t('newCategoryItem') }}</el-button>
  952. </div>
  953. </el-dialog>
  954. <!-- 主项目配置 -->
  955. <el-dialog :title="$t('masterprojectmanagement')" show-header="false" v-if="mainProjectDialog" :visible.sync="mainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="800px">
  956. <el-table :data="mainProjectList" highlight-current-row height="400" style="width: 100%;">
  957. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  958. <template slot-scope="scope" >
  959. {{scope.$index+1+(page-1)*size}}
  960. </template>
  961. </el-table-column>
  962. <el-table-column prop="code" :label="$t('bian-hao')" ></el-table-column>
  963. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  964. <el-table-column prop="categoryName" :label="$t('fen-lei-ming-cheng')" ></el-table-column>
  965. <el-table-column :label="$t('operation')" width="150">
  966. <template slot-scope="scope" >
  967. <el-button size="small" type="primary" @click="addManPro(scope.row)">{{ $t('bian-ji') }}</el-button>
  968. <el-button size="small" type="danger" @click="deleteManPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  969. </template>
  970. </el-table-column>
  971. </el-table>
  972. <div slot="footer" class="dialog-footer">
  973. <el-button type="primary" @click="mainProjectDialog = false" >{{ $t('Shutdown') }}</el-button>
  974. <el-button type="primary" @click="addManPro()" >{{ $t('addzhuxiang') }}</el-button>
  975. </div>
  976. </el-dialog>
  977. <!-- 项目阶段配置 -->
  978. <el-dialog :title="$t('projectstagemanagement')" show-header="false" v-if="phaseProjectDialog" :visible.sync="phaseProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  979. <el-table :data="phaseList" highlight-current-row height="400" style="width: 100%;">
  980. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  981. <template slot-scope="scope" >
  982. {{scope.$index+1+(page-1)*size}}
  983. </template>
  984. </el-table-column>
  985. <el-table-column prop="projectStageName" :label="$t('phasename')" ></el-table-column>
  986. <el-table-column :label="$t('operation')" width="150">
  987. <template slot-scope="scope" >
  988. <el-button size="small" type="primary" @click="addPanthPro(scope.row)">{{ $t('bian-ji') }}</el-button>
  989. <el-button size="small" type="danger" @click="deletePanthPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  990. </template>
  991. </el-table-column>
  992. </el-table>
  993. <div slot="footer" class="dialog-footer">
  994. <el-button type="primary" @click="phaseProjectDialog = false" >{{ $t('Shutdown') }}</el-button>
  995. <el-button type="primary" @click="addPanthPro()" >{{ $t('newprojectstage') }}</el-button>
  996. </div>
  997. </el-dialog>
  998. <!-- 项目级别管理 -->
  999. <el-dialog :title="$t('projectlevelmanagement')" show-header="false" v-if="projectLevelDialog" :visible.sync="projectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1000. <el-table :data="levelList" highlight-current-row height="400" style="width: 100%;" >
  1001. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  1002. <template slot-scope="scope" >
  1003. {{scope.$index+1+(page-1)*size}}
  1004. </template>
  1005. </el-table-column>
  1006. <el-table-column prop="projectLevelName" :label="$t('levelnames')" ></el-table-column>
  1007. <el-table-column :label="$t('operation')" width="150">
  1008. <template slot-scope="scope" >
  1009. <el-button size="small" type="primary" @click="addProjectLevel(scope.row)">{{ $t('bian-ji') }}</el-button>
  1010. <el-button size="small" type="danger" @click="deleteProjectLevel(scope.row)">{{ $t('btn.delete') }}</el-button>
  1011. </template>
  1012. </el-table-column>
  1013. </el-table>
  1014. <div slot="footer" class="dialog-footer">
  1015. <el-button type="primary" @click="projectLevelDialog = false" >{{ $t('Shutdown') }}</el-button>
  1016. <el-button type="primary" @click="addProjectLevel()" >{{ $t('newProjectLevel') }}</el-button>
  1017. </div>
  1018. </el-dialog>
  1019. <el-dialog title="项目预估工时配置" show-header="false" v-if="projectManDaySettingDialog" :visible.sync="projectManDaySettingDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1020. <el-form label-width="200px" :form="manDaySetting">
  1021. <el-form-item :label="'预估工时是否必填'" >
  1022. <el-select v-model="manDaySetting.projectManDayFillMode" :placeholder="$t('defaultText.pleaseChoose')" >
  1023. <el-option label="非必填" :value="0"></el-option>
  1024. <el-option label="工时系统创建的项目必填" :value="1"></el-option>
  1025. <el-option label="工时系统和外部同步的项目都必填" :value="2"></el-option>
  1026. </el-select>
  1027. </el-form-item>
  1028. <el-form-item :label="'项目工时提醒百分比'" >
  1029. <el-input v-model="manDaySetting.projectWarningPercent" type="number" style="width:200px;">
  1030. </el-input>%
  1031. </el-form-item>
  1032. <el-form-item :label="'项目工时不足时'" >
  1033. <el-select v-model="manDaySetting.projectFronzeOnLack" :placeholder="$t('defaultText.pleaseChoose')" >
  1034. <el-option label="禁止填报" :value="1"></el-option>
  1035. <el-option label="可以填报,仅提醒" :value="0"></el-option>
  1036. </el-select>
  1037. </el-form-item>
  1038. <el-form-item :label="'分组工时提醒百分比'" v-if="user.company.packageProject == 1">
  1039. <el-input v-model="manDaySetting.groupWarningPercent" type="number" style="width:200px;">
  1040. </el-input>%
  1041. </el-form-item>
  1042. <el-form-item :label="'分组工时不足时'" v-if="user.company.packageProject == 1" >
  1043. <el-select v-model="manDaySetting.groupFronzeOnLack" :placeholder="$t('defaultText.pleaseChoose')" >
  1044. <el-option label="禁止填报" :value="1"></el-option>
  1045. <el-option label="可以填报,仅提醒" :value="0"></el-option>
  1046. </el-select>
  1047. </el-form-item>
  1048. </el-form>
  1049. <div slot="footer" class="dialog-footer">
  1050. <el-button type="default" @click="projectManDaySettingDialog = false" >{{ $t('Shutdown') }}</el-button>
  1051. <el-button type="primary" @click="saveProjectManDaySetting()" >保存</el-button>
  1052. </div>
  1053. </el-dialog>
  1054. <!-- 导出任务分组 -->
  1055. <el-dialog :title="'导出任务分组'" show-header="false" v-if="groupTaskDialog" :visible.sync="groupTaskDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1056. <el-form>
  1057. <el-form-item :label="'自主项目类别'">
  1058. <el-select v-model="projectCategorySubId" :placeholder="$t('defaultText.pleaseChoose')" clearable >
  1059. <el-option v-for="item in projectCategorySubList" :key="item.value" :label="item.label" :value="item.value"></el-option>
  1060. </el-select>
  1061. </el-form-item>
  1062. </el-form>
  1063. <div slot="footer" class="dialog-footer">
  1064. <el-button type="primary" @click="groupTaskDialog = false" >{{ $t('Shutdown') }}</el-button>
  1065. <el-button type="primary" @click="exportProjectGroup" >{{ '导出' }}</el-button>
  1066. </div>
  1067. </el-dialog>
  1068. <!-- 新增/编辑项目级别 -->
  1069. <el-dialog :title="$t('modifyingtheprojectLevel')" v-if="addProjectLevelDialog" :visible.sync="addProjectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1070. <el-form ref="form2" :model="addLevelForm" :rules="rules" label-width="120px">
  1071. <el-form-item :label="$t('projectLevelName')" prop="projectLevelName">
  1072. <el-input v-model="addLevelForm.projectLevelName" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1073. </el-form-item>
  1074. </el-form>
  1075. <div slot="footer" class="dialog-footer">
  1076. <el-button @click="addProjectLevelDialog = false">{{ $t('btn.cancel') }}</el-button>
  1077. <el-button type="primary" @click="submitLevelPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1078. </div>
  1079. </el-dialog>
  1080. <!-- 新增/编辑 分类条目 -->
  1081. <el-dialog :title="$t('addmodifycategoryentry')" v-if="addClfDialog" :visible.sync="addClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1082. <el-form ref="form2" :model="addClf" :rules="rules" label-width="100px">
  1083. <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
  1084. <el-form-item :label="$t('fen-lei-ming-cheng')" prop="name">
  1085. <el-input v-model="addClf.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1086. </el-form-item>
  1087. </el-form>
  1088. <div slot="footer" class="dialog-footer">
  1089. <el-button @click.native="addClfDialog = false">{{ $t('btn.cancel') }}</el-button>
  1090. <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1091. </div>
  1092. </el-dialog>
  1093. <!-- 分类条目有关审核流程设置 -->
  1094. <el-dialog :title="$t('AuditProcess')" v-if="auditProcessDialog" :visible.sync="auditProcessDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1095. <el-form ref="form2" :model="auditProcess" :rules="rules" label-width="150px">
  1096. <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
  1097. <el-form-item :label="$t('AuditProcess')" prop="name">
  1098. <template>
  1099. <el-checkbox v-model="addClf.proInchargerAudit" >项目审核人审核</el-checkbox>
  1100. <div style="width: 120px ; text-align: center;"><i class="el-icon-bottom"></i></div>
  1101. <el-checkbox v-model="addClf.proBuAudit" >项目所属BU负责人审核</el-checkbox>
  1102. </template>
  1103. </el-form-item>
  1104. </el-form>
  1105. <div slot="footer" class="dialog-footer">
  1106. <el-button @click.native="auditProcessDialog = false">{{ $t('btn.cancel') }}</el-button>
  1107. <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1108. </div>
  1109. </el-dialog>
  1110. <!-- 新增/编辑主项目 -->
  1111. <el-dialog :title="$t('modifythemainproject')" v-if="addFlgmainProjectDialog" :visible.sync="addFlgmainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1112. <el-form ref="form2" :model="addMainForm" :rules="rules" label-width="100px">
  1113. <!-- <el-form-item label="主项目编号" prop="code"> -->
  1114. <el-form-item :label="$t('mainProjectNo')">
  1115. <el-input v-model="addMainForm.code" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1116. </el-form-item>
  1117. <el-form-item :label="$t('mainProjectName')" prop="name">
  1118. <el-input v-model="addMainForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1119. </el-form-item>
  1120. <el-form-item :label="$t('projectclassification')">
  1121. <el-select v-model="addMainForm.categoryId" :placeholder="$t('defaultText.pleaseChoose')" clearable >
  1122. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1123. </el-select>
  1124. </el-form-item>
  1125. </el-form>
  1126. <div slot="footer" class="dialog-footer">
  1127. <el-button @click.native="addFlgmainProjectDialog = false">{{ $t('btn.cancel') }}</el-button>
  1128. <el-button type="primary" @click="submitManPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1129. </div>
  1130. </el-dialog>
  1131. <!-- 新增/编辑项目阶段 -->
  1132. <el-dialog :title="$t('modifyingtheprojectphase')" v-if="addFlgPanthProjectDialog" :visible.sync="addFlgPanthProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1133. <el-form ref="form2" :model="addPanthForm" :rules="rules" label-width="120px">
  1134. <el-form-item :label="$t('projectStageName')" prop="name">
  1135. <el-input v-model="addPanthForm.projectStageName" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1136. </el-form-item>
  1137. </el-form>
  1138. <div slot="footer" class="dialog-footer">
  1139. <el-button @click.native="addFlgPanthProjectDialog = false">{{ $t('btn.cancel') }}</el-button>
  1140. <el-button type="primary" @click="submitPanthPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1141. </div>
  1142. </el-dialog>
  1143. <el-dialog :title="$t('modificationcostitem')" v-if="addBaseItemDialog" :visible.sync="addBaseItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1144. <el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
  1145. <el-form-item :label="$t('nameofcostitem')" prop="name">
  1146. <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1147. </el-form-item>
  1148. <el-form-item :label="$t('yu-jing')" prop="alarmType">
  1149. <el-radio v-model="addForm.alarmType" :label="0">{{ $t('wu-yu-jing') }}</el-radio>
  1150. <el-radio v-model="addForm.alarmType" :label="1">{{ $t('hourscostwarning') }}</el-radio>
  1151. </el-form-item>
  1152. </el-form>
  1153. <div slot="footer" class="dialog-footer">
  1154. <el-button @click.native="addBaseItemDialog = false">{{ $t('btn.cancel') }}</el-button>
  1155. <el-button type="primary" @click="submitInsertBaseItem" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1156. </div>
  1157. </el-dialog>
  1158. <el-dialog :title="$t('modifyingKeyNodesn')" v-if="addBasekeyNodesialog" :visible.sync="addBasekeyNodesialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1159. <el-form ref="form2" :model="addFormkeyNodes" :rules="rules" label-width="120px">
  1160. <el-form-item :label="$t('keyNodeNames')" prop="name">
  1161. <el-input v-model.trim="addFormkeyNodes.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1162. </el-form-item>
  1163. </el-form>
  1164. <div slot="footer" class="dialog-footer">
  1165. <el-button @click.native="addBasekeyNodesialog = false">{{ $t('btn.cancel') }}</el-button>
  1166. <el-button type="primary" @click="submitkeyNodes" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1167. </div>
  1168. </el-dialog>
  1169. <!-- 按部门选择人员 -->
  1170. <el-dialog :title="$t('selectingParticipants')" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1171. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1172. <div v-if="user.userNameNeedTranslate == '1'">
  1173. <el-input placeholder="请输入内容" v-model.trim="filterText" class="input-with-select">
  1174. <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
  1175. </el-input>
  1176. </div>
  1177. <div class="tree" style="height:400px">
  1178. <el-scrollbar style="height:100%">
  1179. <el-input
  1180. :placeholder="$t('keywordfiltering')"
  1181. v-model="filterText" v-if="user.userNameNeedTranslate != '1'">
  1182. </el-input>
  1183. <el-tree :data="deptMembData" :key="searchPersonnelFlgnum" show-checkbox :default-expand-all="searchPersonnelFlg" :props="defaultProps" node-key="id"
  1184. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
  1185. highlight-current :filter-node-method="filterNode">
  1186. <span class="custom-tree-node" slot-scope="{ node, data }">
  1187. <span v-if="user.userNameNeedTranslate == '1'">
  1188. <span v-if="node.data.children">
  1189. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1190. </span>
  1191. <span v-else>
  1192. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1193. </span>
  1194. </span>
  1195. <span v-if="user.userNameNeedTranslate != '1'">
  1196. {{ node.label }}
  1197. </span>
  1198. <!-- {{ node.label }} -->
  1199. </span>
  1200. </el-tree>
  1201. </el-scrollbar>
  1202. </div>
  1203. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  1204. <div slot="footer" class="dialog-footer">
  1205. <el-button @click="chooseParticipVisible = false" >{{ $t('btn.cancel') }}</el-button>
  1206. <el-button type="primary" @click="chooseParticip()" >{{ $t('btn.determine') }}</el-button>
  1207. </div>
  1208. </el-dialog>
  1209. <!-- 按部门选择相关领导,弃用 -->
  1210. <!-- <el-dialog title="选择相关领导" v-if="chooseLeaderVisible" :visible.sync="chooseLeaderVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1211. <div class="tree" style="height:400px">
  1212. <el-scrollbar style="height:100%">
  1213. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1214. ref="chooseLeaderTree" @check-change="onLeaderTreeItemChange" :default-checked-keys="addForm.notifyUserIds"
  1215. highlight-current ></el-tree>
  1216. </el-scrollbar>
  1217. </div>
  1218. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  1219. <div slot="footer" class="dialog-footer">
  1220. <el-button @click="chooseLeaderVisible = false" >取消</el-button>
  1221. <el-button type="primary" @click="chooseLeader()" >确定</el-button>
  1222. </div>
  1223. </el-dialog> -->
  1224. <!-- 项目专业人员的设置 -->
  1225. <el-dialog :title="$t('setupprojectprofessionals')" v-if="editPpMembDialog" :visible.sync="editPpMembDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1226. <div class="gongcheng">
  1227. <el-table :data="curProfessionRow.membList" height="400">
  1228. <el-table-column prop="name" :label="$t('professionals')">
  1229. <template slot-scope="scope">
  1230. <el-select v-model="scope.row.membId" v-if="user.userNameNeedTranslate != 1" filterable :placeholder="$t('professionaladdsparticipant')" style="width:100%;" >
  1231. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  1232. </el-option>
  1233. </el-select>
  1234. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="scope.row.membId" :distinction="'11'" :other="scope.$index" @selectCal="selectCal"></selectCat>
  1235. </template>
  1236. </el-table-column>
  1237. <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
  1238. <template slot-scope="scope">
  1239. <el-input type="number" v-model="scope.row.percentage"></el-input>
  1240. </template>
  1241. </el-table-column>
  1242. <el-table-column width="80">
  1243. <template slot-scope="scope">
  1244. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteMembItem(scope.$index)"></el-button>
  1245. </template>
  1246. <template slot="header" >
  1247. <el-link @click="addMembItem" type="primary">{{ $t('addTian') }}</el-link>
  1248. </template>
  1249. </el-table-column>
  1250. </el-table>
  1251. <div slot="footer" class="dialog-footer">
  1252. <el-button @click="editPpMembDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1253. <el-button type="primary" @click="addPpMemb" >{{ $t('btn.determine') }}</el-button>
  1254. </div>
  1255. </div>
  1256. </el-dialog>
  1257. <!-- 批量修改自定义维度 -->
  1258. <el-dialog :title="checkoradd ? $t('changes') : $t('pi-liang-tian-jia')" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
  1259. <el-form model="" label-width="20%">
  1260. <el-form-item :label="$t('setup') + user.timeType.customDegreeName">
  1261. <el-select v-model="checkedWuduArr" value-key="id" :placeholder="$t('defaultText.pleaseChoose') + user.timeType.customDegreeName" multiple style="width: 100%">
  1262. <el-option v-for="item in ause" :key="item.id" :label="item.name" :value="item"></el-option>
  1263. </el-select>
  1264. </el-form-item>
  1265. </el-form>
  1266. <div slot="footer" class="dialog-footer">
  1267. <el-button @click="checkedWuduDialog = false">{{ $t('btn.cancel') }}</el-button>
  1268. <el-button type="primary" @click="batchSetWudulistBtn3" v-if="checkoradd">{{ $t('btn.determine') }}</el-button>
  1269. <el-button type="primary" @click="batchSetWudulistBtn4" v-if="!checkoradd">{{ $t('btn.determine') }}</el-button>
  1270. </div>
  1271. </el-dialog>
  1272. <!-- 批量添加参与人 -->
  1273. <el-dialog :title="isAddGroupPerson ? $t('groupparticipantsinbatches') : $t('projectparticipantsinbatches')" v-if="addGroupPersonDialog" :visible.sync="addGroupPersonDialog" width="600px">
  1274. <el-form label-width="20%">
  1275. <el-form-item :label="$t('screening.selectPeople')">
  1276. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != '1'">
  1277. <div slot="content" style="width:450px">{{addGroupPersonData.personNames}}</div>
  1278. <el-input @focus="addGroupPersonP" v-model="addGroupPersonData.personNames"></el-input>
  1279. </el-tooltip>
  1280. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == '1'">
  1281. <div slot="content" style="width:580px">
  1282. <span v-for="(item, index) in addGroupPersonDataPersonNames" :key="index">
  1283. <!-- {{item}} -->
  1284. <ww-open-data type='userName' :openid='item'></ww-open-data>
  1285. <span v-if="index < addGroupPersonDataPersonNames.length - 1">,</span>
  1286. </span>
  1287. </div>
  1288. <div @click="addGroupPersonP" style="width: 450px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
  1289. <span v-for="(item, index) in addGroupPersonDataPersonNames" :key="index">
  1290. <!-- {{item}} -->
  1291. <ww-open-data type='userName' :openid='item'></ww-open-data>
  1292. <span v-if="index < addGroupPersonDataPersonNames.length - 1">,</span>
  1293. </span>
  1294. </div>
  1295. </el-tooltip>
  1296. </el-form-item>
  1297. <el-form-item :label="$t('xuan-ze-fen-zu')" v-if="isAddGroupPerson">
  1298. <el-select v-model="addGroupPersonData.group" multiple :placeholder="$t('selectagroup')" style="width:100%">
  1299. <el-option v-for="item in addGroupList"
  1300. :key="item.groupIds"
  1301. :label="item.name"
  1302. :value="item.groupIds"></el-option>
  1303. </el-select>
  1304. </el-form-item>
  1305. </el-form>
  1306. <div slot="footer" class="dialog-footer">
  1307. <el-button @click="addGroupPersonDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1308. <el-button type="primary" @click="addGroupPersonSure()" v-if="isAddGroupPerson">{{ $t('btn.determine') }}</el-button>
  1309. <el-button type="primary" @click="addProPersonSure()" v-else>{{ $t('btn.determine') }}</el-button>
  1310. </div>
  1311. <el-dialog append-to-body :title="$t('screening.selectPeople')" v-if="addGroupPersonPdialog" :visible.sync="addGroupPersonPdialog" width="40%">
  1312. <div class="tree" style="height:300px">
  1313. <el-scrollbar style="height:100%">
  1314. <el-input
  1315. :placeholder="$t('keywordfiltering')"
  1316. v-model="filterText2"
  1317. v-if="user.userNameNeedTranslate != 1">
  1318. </el-input>
  1319. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1320. ref="chooseMembTree2" @check-change="addPersonCheck"
  1321. highlight-current :filter-node-method="filterNode" :default-checked-keys="addGroupPersonData.person">
  1322. <span class="custom-tree-node" slot-scope="{ node, data }">
  1323. <span v-if="user.userNameNeedTranslate == '1'">
  1324. <span v-if="node.data.children">
  1325. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1326. </span>
  1327. <span v-else>
  1328. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1329. </span>
  1330. </span>
  1331. <span v-if="user.userNameNeedTranslate != '1'">
  1332. {{ node.label }}
  1333. </span>
  1334. </span>
  1335. </el-tree>
  1336. </el-scrollbar>
  1337. </div>
  1338. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  1339. <div slot="footer" class="dialog-footer">
  1340. <el-button @click="addGroupPersonPdialog = false" >{{ $t('btn.cancel') }}</el-button>
  1341. <el-button type="primary" @click="addPersonSure()" >{{ $t('btn.determine') }}</el-button>
  1342. </div>
  1343. </el-dialog>
  1344. </el-dialog>
  1345. <!-- 批量设置项目经理 -->
  1346. <el-dialog :title="$t('projectmanagersinbatches')" v-if="batchInchargerDialog" :visible.sync="batchInchargerDialog" width="500px">
  1347. <el-form model="" label-width="120px">
  1348. <el-form-item :label="$t('setupprojectmanager')">
  1349. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="paramInchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" filterable clearable>
  1350. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  1351. <span style="float: left">{{item.name}}</span>
  1352. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  1353. </el-option>
  1354. </el-select>
  1355. <selectCat :size="'small'" :widthStr="'272'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="paramInchargerId" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1356. </el-form-item>
  1357. </el-form>
  1358. <div slot="footer" class="dialog-footer">
  1359. <el-button @click="batchInchargerDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1360. <el-button type="primary" @click="batchInchargerSure()">{{ $t('btn.determine') }}</el-button>
  1361. </div>
  1362. </el-dialog>
  1363. <el-dialog :title="$t('importproject')" v-if="importProjectBeforeDialog" :visible.sync="importProjectBeforeDialog" width="30%">
  1364. <el-checkbox v-model="paramData1" style="margin-left:10px">{{ $t('dui-yi-you-xiang-mu-jin-hang-xin-xi-geng-xin') }}</el-checkbox>
  1365. <div slot="footer" class="dialog-footer" style="text-algin:center;">
  1366. <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  1367. <el-button type="primary">{{ $t('importproject') }}</el-button>
  1368. </el-upload>
  1369. </div>
  1370. </el-dialog>
  1371. <el-dialog :title="$t('xiu-gai-xiang-mu-dang-qian-jie-duan')" v-if="changeStageDialogVisible" :visible.sync="changeStageDialogVisible" width="300px">
  1372. <el-select v-model="curChangeProject.curStageId" filterable :placeholder="$t('pleaseselecttheprojectphase')" style="margin: 0 auto;">
  1373. <el-option v-for="(item, index) in phaseList" :key="index" :label="item.projectStageName" :value="item.id"> </el-option>
  1374. </el-select>
  1375. <div slot="footer" class="dialog-footer" style="text-algin:center;">
  1376. <el-button type="primary" @click="confirmChangeStage">{{ $t('btn.determine') }}</el-button>
  1377. </div>
  1378. </el-dialog>
  1379. <el-dialog append-to-body :title="$t('projectimportresult')" v-if="showImportResult" :visible.sync="showImportResult" width="40%">
  1380. <div >
  1381. {{importResultMsg}}
  1382. </div>
  1383. </el-dialog>
  1384. <!-- 职能分工设置 -->
  1385. <el-dialog :title="'职能分工设置'" v-if="functionalDivisionDig" :visible.sync="functionalDivisionDig" width="80%">
  1386. <el-table border :data="functionalList" style="width: 100%">
  1387. <el-table-column prop="id" label="序号" width="50" type="index" align="center"
  1388. :index="index=>index+1"/>
  1389. <el-table-column prop="timeType" label="工时类型" align="center">
  1390. <template slot-scope="scope">
  1391. <span v-show="!scope.row.editFlag">{{scope.row.timeType}}</span>
  1392. <el-select v-show="scope.row.editFlag" v-model="scope.row.timeType" placeholder="请选择">
  1393. <el-option
  1394. v-for="item in timeTypeList"
  1395. :key="item.value"
  1396. :label="item.label"
  1397. :value="item.label">
  1398. </el-option>
  1399. </el-select>
  1400. </template>
  1401. </el-table-column>
  1402. <el-table-column prop="roleId" label="角色" align="center">
  1403. <template slot-scope="scope">
  1404. <span v-show="!scope.row.editFlag">{{scope.row.role}}</span>
  1405. <el-select v-show="scope.row.editFlag" v-model="scope.row.role" placeholder="请选择">
  1406. <el-option
  1407. v-for="item in roleList"
  1408. :key="item.value"
  1409. :label="item.label"
  1410. :value="item.label">
  1411. </el-option>
  1412. </el-select>
  1413. </template>
  1414. </el-table-column>
  1415. <el-table-column prop="jobRespon" label="工作职责" align="center">
  1416. <template slot-scope="scope">
  1417. <span v-show="!scope.row.editFlag">{{scope.row.jobRespon}}</span>
  1418. <el-input v-show="scope.row.editFlag"
  1419. v-model="scope.row.jobRespon">
  1420. </el-input>
  1421. </template>
  1422. </el-table-column>
  1423. <el-table-column prop="workContext" label="工作内容" align="center">
  1424. <template slot-scope="scope">
  1425. <a v-if="scope.row.id" @click="workContextDig=true,getWorkContextList(scope.row.id)" style="color:#409EFF">{{'数据维护'}}</a>
  1426. <a v-else>{{'数据维护'}}</a>
  1427. </template>
  1428. </el-table-column>
  1429. <el-table-column label="操作" width="120" align="center">
  1430. <template slot-scope="scope">
  1431. <div style="display: flex;">
  1432. <el-button size="small"
  1433. type="text"
  1434. icon="CircleCheck"
  1435. v-show="scope.row.editFlag"
  1436. @click="functionalSubmit(scope.row)">确定
  1437. </el-button>
  1438. <el-button size="small"
  1439. type="text"
  1440. icon="CircleClose"
  1441. v-show="scope.row.editFlag"
  1442. @click="functionalCancel(scope.row,scope.$index,'functional')">取消
  1443. </el-button>
  1444. <el-button size="small"
  1445. icon="Edit"
  1446. type="text"
  1447. v-show="!scope.row.editFlag"
  1448. @click="functionalEditVersion(scope.row)"> 编辑
  1449. </el-button>
  1450. <el-button size="small"
  1451. icon="Delete"
  1452. type="text"
  1453. v-show="!scope.row.editFlag"
  1454. @click="functionalDelVersion(scope.row,scope.$index)">删除
  1455. </el-button>
  1456. </div>
  1457. </template>
  1458. </el-table-column>
  1459. </el-table>
  1460. <div slot="footer" class="dialog-footer">
  1461. <el-button @click="addFunctional('functional')" type="primary">添加一行</el-button>
  1462. <el-button @click="functionalDivisionDig = false" >{{ $t('btn.cancel') }}</el-button>
  1463. <el-button type="primary" @click="submitFunctional()">{{ $t('btn.determine') }}</el-button>
  1464. </div>
  1465. </el-dialog>
  1466. <!-- 工作内容dig -->
  1467. <el-dialog :title="'工作内容'" v-if="workContextDig" :visible.sync="workContextDig" width="40%">
  1468. <el-table border :data="workContextList" style="width: 100%">
  1469. <el-table-column prop="id" label="序号" width="50" type="index" align="center"
  1470. :index="index=>index+1"/>
  1471. <el-table-column prop="workContext" label="工作内容" align="center">
  1472. <template slot-scope="scope">
  1473. <span v-show="!scope.row.editFlag">{{scope.row.workContext}}</span>
  1474. <el-input v-show="scope.row.editFlag"
  1475. v-model="scope.row.workContext">
  1476. </el-input>
  1477. </template>
  1478. </el-table-column>
  1479. <el-table-column label="操作" width="120" align="center">
  1480. <template slot-scope="scope">
  1481. <div style="display: flex;">
  1482. <el-button size="small"
  1483. type="text"
  1484. icon="CircleCheck"
  1485. v-show="scope.row.editFlag"
  1486. @click="functionalSubmit(scope.row)">确定
  1487. </el-button>
  1488. <el-button size="small"
  1489. type="text"
  1490. icon="CircleClose"
  1491. v-show="scope.row.editFlag"
  1492. @click="functionalCancel(scope.row,scope.$index,'workContext')">取消
  1493. </el-button>
  1494. <el-button size="small"
  1495. icon="Edit"
  1496. type="text"
  1497. v-show="!scope.row.editFlag"
  1498. @click="functionalEditVersion(scope.row)"> 编辑
  1499. </el-button>
  1500. <el-button size="small"
  1501. icon="Delete"
  1502. type="text"
  1503. v-show="!scope.row.editFlag"
  1504. @click="workContextDelVersion(scope.row,scope.$index)">删除
  1505. </el-button>
  1506. </div>
  1507. </template>
  1508. </el-table-column>
  1509. </el-table>
  1510. <div slot="footer" class="dialog-footer">
  1511. <el-button @click="addFunctional('workContext')" type="primary">添加一行</el-button>
  1512. <el-button @click="workContextDig = false" >{{ $t('btn.cancel') }}</el-button>
  1513. <el-button type="primary" @click="submitWorkContext()">{{ $t('btn.determine') }}</el-button>
  1514. </div>
  1515. </el-dialog>
  1516. <!-- 批量增加任务分组 -->
  1517. <el-dialog :title="'批量增加任务分组'" v-if="addTaskGroupDig" :visible.sync="addTaskGroupDig" width="40%">
  1518. <el-form label-width="20%">
  1519. <el-form-item :label="'分组名称:'">
  1520. <el-input v-model="batchAddTaskGroupName" placeholder="请输入内容"></el-input>
  1521. </el-form-item>
  1522. </el-form>
  1523. <div slot="footer" class="dialog-footer">
  1524. <el-button @click="addTaskGroupDig = false,this.batchAddTaskGroupName=null">{{ $t('btn.cancel') }}</el-button>
  1525. <el-button type="primary" @click="batchAddTaskGroup()">{{ $t('btn.determine') }}</el-button>
  1526. </div>
  1527. </el-dialog>
  1528. <!-- 批量设置任务分组负责人 -->
  1529. <el-dialog :title="'批量设置任务分组负责人'" v-if="addTaskGroupInchargerDig" :visible.sync="addTaskGroupInchargerDig" width="40%">
  1530. <el-form label-width="20%">
  1531. <el-form-item :label="'分组名称:'">
  1532. <el-select v-model="hasSetGroupName" placeholder="请选择">
  1533. <el-option
  1534. v-for="item in hasSetGroupList"
  1535. :key="item.value"
  1536. :label="item.label"
  1537. :value="item.label">
  1538. </el-option>
  1539. </el-select>
  1540. </el-form-item>
  1541. <el-form-item :label="'分组负责人:'">
  1542. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="hasSetGroupInchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" filterable clearable>
  1543. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  1544. <span style="float: left">{{item.name}}</span>
  1545. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  1546. </el-option>
  1547. </el-select>
  1548. <selectCat :size="'small'" :widthStr="'272'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="paramInchargerId" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1549. </el-form-item>
  1550. </el-form>
  1551. <div slot="footer" class="dialog-footer">
  1552. <el-button @click="addTaskGroupInchargerDig = false,this.hasSetGroupInchargerId=null,this.hasSetGroupName=null">{{ $t('btn.cancel') }}</el-button>
  1553. <el-button type="primary" @click="batchSetGroupIncharger()">{{ $t('btn.determine') }}</el-button>
  1554. </div>
  1555. </el-dialog>
  1556. </section>
  1557. </template>
  1558. <style scoped>
  1559. .input-with-select .el-input-group__prepend {
  1560. background-color: #fff;
  1561. }
  1562. .line {
  1563. padding:10px;
  1564. }
  1565. .line span{
  1566. font-size:15px;
  1567. }
  1568. .line span:nth-child(even){
  1569. float:right;
  1570. }
  1571. .kans {
  1572. width: 230px;
  1573. overflow:hidden;
  1574. white-space:nowrap;
  1575. text-overflow: ellipsis;
  1576. }
  1577. a {
  1578. text-decoration: none;
  1579. }
  1580. .router-link-active {
  1581. text-decoration: none;
  1582. }
  1583. </style>
  1584. <script>
  1585. import util from "../../common/js/util";
  1586. import projectgantt from "./project_gantt.vue"
  1587. // 自定义select组件
  1588. import selectCat from "@/components/select.vue"
  1589. export default {
  1590. components:{
  1591. projectgantt,
  1592. selectCat
  1593. },
  1594. data() {
  1595. return {
  1596. manDaySetting:{},
  1597. projectManDaySettingDialog: false,
  1598. projectListPageComponentKey: 1,
  1599. isDeleting: false,
  1600. forSubProjectlist:[],
  1601. copySubPListVisible: false,
  1602. projectManagerEdit: false,
  1603. canOnlyModParticipator: false,
  1604. curChangeProject:null,
  1605. changeStageDialogVisible: false,
  1606. addFlgmainProjectDialog: false,
  1607. addFlgPanthProjectDialog: false,
  1608. addProjectLevelDialog: false,
  1609. mainProjectList: [],
  1610. mainProjectDialog: false,
  1611. projectLevelDialog: false,
  1612. showImportResult: false,
  1613. importResultMsg:null,
  1614. isganttshow: false,
  1615. deleteAlertMsg: null,
  1616. chosenLeaders:[],
  1617. baseClfList:[],
  1618. chooseLeaderVisible:false,
  1619. projectProfessionItem:null,
  1620. curProfessionRow:null,
  1621. editPpMembDialog:false,
  1622. professionList:[],
  1623. projectProfessionList:[],
  1624. activeName:"baseCostPanel",
  1625. chosenMembCount:0,
  1626. chosenMembList:[],//选中的人员
  1627. allMembData:[],
  1628. auditProcessDialog: false,
  1629. deptMembData: [
  1630. {
  1631. id: 0,
  1632. label: this.$t('lable.unassigned'),
  1633. }
  1634. ],
  1635. option: [],
  1636. depData: {
  1637. id: -1,
  1638. label: this.$t('lable.allStaff'),
  1639. },
  1640. defaultProps: {
  1641. children: 'children',
  1642. label: 'label'
  1643. },
  1644. wxFilterText: '',
  1645. mainProjectId:'',
  1646. filterName:null,
  1647. chooseParticipVisible: false,
  1648. projectBaseCostData:[],
  1649. addBaseItemDialog:false,
  1650. showBaseConfig:false,
  1651. customerList:[],
  1652. roleArray:[this.$t('role.ordinaryEmployees'),this.$t('role.superAdministrator'), this.$t('role.systemAdministrator'), this.$t('role.companyTop'),this.$t('role.financialAdministrator'), this.$t('role.projectManager')],
  1653. status:"1",
  1654. statusTxt:["-",this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone'),this.$t('paused')],
  1655. importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
  1656. importanceListLable:[this.$t('zheng-chang'), this.$t('jin-ji'), this.$t('zhong-yao'), this.$t('zhong-yao-qie-jin-ji'), this.$t('di-feng-xian'), this.$t('zhong-feng-xian'), this.$t('gao-feng-xian')],
  1657. searchField:'1',
  1658. keyword:null,
  1659. user: JSON.parse(sessionStorage.getItem("user")),
  1660. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1661. userDetailVisible: false,
  1662. userDetail:{},
  1663. date: new Date(),
  1664. users: [],
  1665. participator:[],
  1666. tableHeight: 0,
  1667. listLoading: false,
  1668. total: 0,
  1669. page: 1,
  1670. size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
  1671. list: [],
  1672. subProjectVisible: false,
  1673. subProjectList: [],//子项目列表
  1674. currentProject:{},
  1675. addSubProject: false,
  1676. addFormVisible: false,
  1677. addLoading: false,
  1678. groupTaskDialog:false,
  1679. addUp: 0, // 合计
  1680. title: "",
  1681. addForm: {
  1682. name: '',
  1683. userId: [],
  1684. level:1,
  1685. bu:'',
  1686. id: '',
  1687. code: '',
  1688. projectDesc: '',
  1689. alarmType: 0
  1690. },
  1691. addFormUserNames: [],
  1692. temaddForm: {},
  1693. rules: {
  1694. name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1695. code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
  1696. projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1697. projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1698. deptId: [{ required: true, message: '请选择所属部门', trigger: "blur" }]
  1699. },
  1700. ause: [],
  1701. auseList: [],
  1702. yonghuUser: [],
  1703. filterText: '',
  1704. filterText2: '',
  1705. showClfDialog: false,
  1706. addClfDialog:false,
  1707. addClf:{name:'',id:''},
  1708. addMainForm:{
  1709. name:'',
  1710. id:'',
  1711. code: '',
  1712. categoryId: ''
  1713. },
  1714. addPanthForm: {
  1715. id: '',
  1716. projectStageName: ''
  1717. },
  1718. addLevelForm: {
  1719. id: '',
  1720. projectStageName: ''
  1721. },
  1722. statusClf:null,
  1723. permissionsObj: {},
  1724. checkedPForSubArr:[],
  1725. checkedProjectArr: [],
  1726. checkedWuduDialog: false,
  1727. checkedWuduArr: [],
  1728. checkoradd: true,
  1729. addGroupPersonBtnLoading: false,
  1730. addGroupPersonDialog: false,
  1731. addGroupList: [],
  1732. addGroupPersonData: {
  1733. group: [],
  1734. person: null,
  1735. personNames: ''
  1736. },
  1737. addGroupPersonPdialog: false,
  1738. showColumnWidth: '300',
  1739. deleteVif: null,
  1740. isAddGroupPerson: true,
  1741. projectMainId: '',
  1742. supplierList: '',
  1743. sortProp: '',
  1744. sortOrder: null,
  1745. currentCell: null, // 当前单击的是哪一个单元格
  1746. phaseList: [],
  1747. phaseProjectId: '', // 阶段项目id
  1748. phaseProjectValie: null, // 阶段项目值
  1749. listHeader: [], // 列表表头
  1750. rowid: '',
  1751. phaseProjectDialog: false, // 项目阶段
  1752. levelList: [], // 项目级别
  1753. departmentList: [],
  1754. deptId: [],
  1755. buOption:[],
  1756. contractAmountOld: 0,
  1757. contractAmountReasonShow: false,
  1758. centerNameDegree: '',
  1759. batchInchargerDialog: false,
  1760. paramInchargerId: '',
  1761. inchagerId: '',
  1762. keyNodesIsShow: false,
  1763. keyNodesList: [],
  1764. projectKeyNodesData: [],
  1765. addBasekeyNodesialog: false,
  1766. addFormkeyNodes: {
  1767. name: ''
  1768. },
  1769. participationId: '',
  1770. importProjectBeforeDialog: false,
  1771. paramData1: false,
  1772. chosenListBackup: [], // 备份
  1773. searchPersonnelFlg: false,
  1774. searchPersonnelFlgnum: 1,
  1775. createDate: [], // 项目筛选时间段
  1776. exportDisabled: false,
  1777. exportNotification: null,
  1778. dataList: [],
  1779. dataListBf: [],
  1780. imgUrlLists: '',
  1781. imgUrlListFlg: false,
  1782. estimatedWorkTime:'',
  1783. projectCategorySubList:[
  1784. {
  1785. value: 1,
  1786. label: '纯软件项目'
  1787. },
  1788. {
  1789. value: 2,
  1790. label: '纯硬件项目'
  1791. },
  1792. {
  1793. value: 3,
  1794. label: '集成项目'
  1795. },
  1796. {
  1797. value: 4,
  1798. label: '服务项目'
  1799. }
  1800. ],
  1801. projectCategorySubId:'',
  1802. // 威派格定制(只有管理员才能更改项目名称,编号,级别,合同,大区,经理)
  1803. isShowProjectName: false,
  1804. //职能相关字段
  1805. functionalDivisionDig:false,
  1806. functionalList:[],
  1807. timeTypeList:[
  1808. {
  1809. value: 1,
  1810. label: '项目工时'
  1811. },
  1812. {
  1813. value: 2,
  1814. label: '非项目工时'
  1815. },
  1816. ],
  1817. roleList:[
  1818. {
  1819. value: 1,
  1820. label: 'CRC&LM'
  1821. },
  1822. {
  1823. value: 2,
  1824. label: 'PM'
  1825. },
  1826. ],
  1827. //工作内容
  1828. workContextDig:false,
  1829. functionalId:null,
  1830. workContextList:[],
  1831. oldValue:null,
  1832. addTaskGroupDig:false,
  1833. batchAddTaskGroupName:null,
  1834. hasSetGroupName:null,
  1835. hasSetGroupInchargerId:null,
  1836. hasSetGroupList:[],
  1837. addTaskGroupInchargerDig:false,
  1838. filterNodePersonnel: []
  1839. };
  1840. },
  1841. // 过滤器
  1842. filters: {
  1843. numberToCurrency(value) {
  1844. if (!value) return '0.00'
  1845. // 将数值截取,保留两位小数
  1846. value = value.toFixed(2)
  1847. // 获取整数部分
  1848. const intPart = Math.trunc(value)
  1849. // 整数部分处理,增加,
  1850. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  1851. // 预定义小数部分
  1852. let floatPart = '.00'
  1853. // 将数值截取为小数部分和整数部分
  1854. const valueArray = value.toString().split('.')
  1855. if (valueArray.length === 2) { // 有小数部分
  1856. floatPart = valueArray[1].toString() // 取得小数部分
  1857. return intPartFormat + '.' + floatPart
  1858. }
  1859. return intPartFormat + floatPart
  1860. },
  1861. mobans(value, valueList) {
  1862. for(var i in valueList) {
  1863. if(valueList[i].providerCateGoryName == value) {
  1864. return valueList[i].providerInfoName
  1865. }
  1866. }
  1867. },
  1868. },
  1869. watch: {
  1870. filterText(val) {
  1871. let { userNameNeedTranslate } = JSON.parse(sessionStorage.getItem("user"))
  1872. if(userNameNeedTranslate != 1) {
  1873. this.$refs.chooseMembTree.filter(val);
  1874. }
  1875. if(!val) {
  1876. this.$refs.chooseMembTree.filter(val);
  1877. }
  1878. },
  1879. filterText2(val) {
  1880. this.$refs.chooseMembTree2.filter(val);
  1881. }
  1882. },
  1883. updated () {
  1884. // console.log('执行upload生命周期')
  1885. this.$nextTick(()=>{
  1886. this.$refs.projectlistOfWudulist.doLayout();
  1887. })
  1888. },
  1889. methods: {
  1890. saveProjectManDaySetting() {
  1891. this.http.post('/estimate-time-setting/save', this.manDaySetting,
  1892. res => {
  1893. if (res.code == "ok") {
  1894. this.projectManDaySettingDialog = false;
  1895. } else {
  1896. this.$message({
  1897. message: res.msg,
  1898. type: "error"
  1899. });
  1900. }
  1901. },
  1902. error => {
  1903. this.$message({
  1904. message: error,
  1905. type: "error"
  1906. });
  1907. });
  1908. },
  1909. //获取项目预估工时配置数据
  1910. getManDaySetting() {
  1911. this.http.post('/estimate-time-setting/get', {
  1912. companyId: this.user.companyId
  1913. },
  1914. res => {
  1915. if (res.code == "ok") {
  1916. this.manDaySetting = res.data;
  1917. } else {
  1918. this.$message({
  1919. message: res.msg,
  1920. type: "error"
  1921. });
  1922. }
  1923. },
  1924. error => {
  1925. this.$message({
  1926. message: error,
  1927. type: "error"
  1928. });
  1929. });
  1930. },
  1931. submitCopySubProject() {
  1932. //获取选中的项目
  1933. if (this.checkedPForSubArr.length == 0) {
  1934. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  1935. return
  1936. }
  1937. var targetPIds = JSON.stringify(this.checkedPForSubArr.map((a)=>{return a.id}));
  1938. //http post请求提交
  1939. this.http.post('/sub-project/copyToProjects', {
  1940. projectId: this.currentProject.id,
  1941. targetProjectIds: targetPIds,
  1942. },
  1943. res => {
  1944. if (res.code == "ok") {
  1945. this.$message({
  1946. message: '操作成功',
  1947. type: "success"
  1948. });
  1949. this.copySubPListVisible = false;
  1950. } else {
  1951. this.$message({
  1952. message: res.msg,
  1953. type: "error"
  1954. });
  1955. }
  1956. },
  1957. error => {
  1958. this.$message({
  1959. message: error,
  1960. type: "error"
  1961. });
  1962. });
  1963. },
  1964. confirmChangeStage() {
  1965. let currentStageName = ''
  1966. for(var i in this.phaseList) {
  1967. if(this.phaseList[i].id == this.curChangeProject.curStageId) {
  1968. currentStageName = this.phaseList[i].projectStageName
  1969. }
  1970. }
  1971. this.http.post('/project/changeCurrentStage', {
  1972. projectId: this.curChangeProject.projectId,
  1973. currentStageId: this.curChangeProject.curStageId,
  1974. currentStageName: currentStageName
  1975. },
  1976. res => {
  1977. if (res.code == "ok") {
  1978. this.getList()
  1979. this.changeStageDialogVisible = false;
  1980. } else {
  1981. this.$message({
  1982. message: res.msg,
  1983. type: "error"
  1984. });
  1985. }
  1986. },
  1987. error => {
  1988. this.$message({
  1989. message: error,
  1990. type: "error"
  1991. });
  1992. });
  1993. },
  1994. showChangeStageDialog(projectId, curStageId) {
  1995. this.curChangeProject = {projectId: projectId, curStageId: curStageId};
  1996. this.changeStageDialogVisible = true;
  1997. },
  1998. addNewkeyNodes(row) {
  1999. this.addBasekeyNodesialog = true
  2000. if(row) {
  2001. this.addFormkeyNodes = row
  2002. } else {
  2003. this.addFormkeyNodes = {
  2004. name: ''
  2005. }
  2006. }
  2007. },
  2008. // 获取关键节点
  2009. getkeyNodes() {
  2010. this.http.post('/project-key-nodes-setting/list', {},
  2011. res => {
  2012. if (res.code == "ok") {
  2013. // this.keyNodesIsShow = true
  2014. this.keyNodesList = res.data
  2015. } else {
  2016. this.$message({
  2017. message: res.msg,
  2018. type: "error"
  2019. });
  2020. }
  2021. },
  2022. error => {
  2023. this.$message({
  2024. message: error,
  2025. type: "error"
  2026. });
  2027. });
  2028. },
  2029. hoverCall(row) {
  2030. this.rowid=row.id
  2031. },
  2032. handCall() {
  2033. this.rowid = ''
  2034. },
  2035. // 获取阶段
  2036. obtainPhase(item) {
  2037. this.http.post('/project-stage/list', {},
  2038. res => {
  2039. if (res.code == "ok") {
  2040. // this.phaseList = res.data
  2041. this.$set(this, 'phaseList', res.data)
  2042. } else {
  2043. this.$message({
  2044. message: res.msg,
  2045. type: "error"
  2046. });
  2047. }
  2048. },
  2049. error => {
  2050. this.$message({
  2051. message: error,
  2052. type: "error"
  2053. });
  2054. });
  2055. },
  2056. // 获取级别
  2057. getProjectLevel(){
  2058. this.http.post('/project-level/list', {},
  2059. res => {
  2060. if (res.code == "ok") {
  2061. this.levelList = res.data
  2062. // this.$set(this, 'levelList', res.data)
  2063. } else {
  2064. this.$message({
  2065. message: res.msg,
  2066. type: "error"
  2067. });
  2068. }
  2069. },
  2070. error => {
  2071. this.$message({
  2072. message: error,
  2073. type: "error"
  2074. });
  2075. });
  2076. },
  2077. addProjectLevel(row){
  2078. this.addProjectLevelDialog = true
  2079. if(!row) {
  2080. this.addLevelForm = {
  2081. projectLevelName: '',
  2082. id: ''
  2083. // companyId:''
  2084. }
  2085. } else {
  2086. this.addLevelForm = {
  2087. id: row.id,
  2088. projectLevelName: row.projectLevelName
  2089. // companyId: row.companyId
  2090. }
  2091. }
  2092. },
  2093. deleteProjectLevel(row) {
  2094. this.$confirm($t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingprojectlevels'), {
  2095. confirmButtonText: this.$t('btn.determine'),
  2096. cancelButtonText: this.$t('btn.cancel'),
  2097. type: "warning"
  2098. })
  2099. .then(() => {
  2100. this.listLoading = true;
  2101. this.http.post('/project-level/delete',{
  2102. id: row.id
  2103. },
  2104. res => {
  2105. this.listLoading = false;
  2106. if (res.code == "ok") {
  2107. this.$message({
  2108. message: this.$t('message.successfullyDeleted'),
  2109. type: "success"
  2110. });
  2111. this.getProjectLevel();
  2112. } else {
  2113. this.$message({
  2114. message: res.msg,
  2115. type: "error"
  2116. });
  2117. }
  2118. },
  2119. error => {
  2120. this.listLoading = false;
  2121. this.$message({
  2122. message: error,
  2123. type: "error"
  2124. });
  2125. }
  2126. );
  2127. })
  2128. .catch(() => {});
  2129. },
  2130. submitLevelPro(){
  2131. this.http.post('/project-level/addOrMod',this.addLevelForm,
  2132. res => {
  2133. if (res.code == "ok") {
  2134. this.addProjectLevelDialog = false;
  2135. this.getProjectLevel()
  2136. } else {
  2137. this.$message({
  2138. message: res.msg,
  2139. type: "error"
  2140. });
  2141. }
  2142. },
  2143. error => {
  2144. this.$message({
  2145. message: error,
  2146. type: "error"
  2147. });
  2148. }
  2149. );
  2150. },
  2151. // 表格点击
  2152. tableCellClassName({row, column, rowIndex, columnIndex}) {
  2153. row.index=rowIndex;
  2154. column.index=columnIndex;
  2155. },
  2156. // clickCell(row,column) {
  2157. // // console.log('can can need',row,column)
  2158. // this.currentCell = row.index + ',' + column.index;
  2159. // this.phaseProjectValie = row.currentStageId ? row.currentStageId : ''
  2160. // if(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId) {
  2161. // this.phaseProjectId = row.id
  2162. // setTimeout(() => {
  2163. // // 获得焦点
  2164. // this.$refs[row.index + ',' + column.index].focus();
  2165. // })
  2166. // }
  2167. // },
  2168. // selectChange() {
  2169. // let currentStageName = ''
  2170. // for(var i in this.phaseList) {
  2171. // if(this.phaseList[i].id == this.phaseProjectValie) {
  2172. // currentStageName = this.phaseList[i].projectStageName
  2173. // }
  2174. // }
  2175. // this.http.post('/project/changeCurrentStage', {
  2176. // projectId: this.phaseProjectId,
  2177. // currentStageId: this.phaseProjectValie,
  2178. // currentStageName: currentStageName
  2179. // },
  2180. // res => {
  2181. // if (res.code == "ok") {
  2182. // this.getList()
  2183. // } else {
  2184. // this.$message({
  2185. // message: res.msg,
  2186. // type: "error"
  2187. // });
  2188. // }
  2189. // },
  2190. // error => {
  2191. // this.$message({
  2192. // message: error,
  2193. // type: "error"
  2194. // });
  2195. // });
  2196. // },
  2197. // hideSelect() {
  2198. // var that = this
  2199. // setTimeout(() => {
  2200. // that.currentCell = null
  2201. // }, 500)
  2202. // },
  2203. // 点击主项目事件
  2204. projectManagementChange() {
  2205. let categoryId = ''
  2206. for(var i in this.mainProjectList) {
  2207. if(this.mainProjectList[i].id == this.addForm.projectMainId) {
  2208. categoryId = this.mainProjectList[i].categoryId
  2209. }
  2210. }
  2211. categoryId == '' ? '' : this.addForm.category = categoryId
  2212. // console.log(this.addForm)
  2213. },
  2214. tableSort({column, prop, order}){
  2215. if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage' || prop == 'departmentName' || prop == 'associateDegreeNames'){
  2216. this.sortOrder = order
  2217. this.sortProp = prop
  2218. this.getList()
  2219. }
  2220. },
  2221. fileUpload(file) {
  2222. //首先判断文件类型
  2223. console.log(file)
  2224. let str = file.file.name.split(".");
  2225. let indexLi = file.action
  2226. let format = str[str.length - 1];
  2227. if (format != "jpg" && format != "jpeg" && format != "png") {
  2228. this.$message({
  2229. message: "请选择.jpg或.jpeg文件",
  2230. type: "error"
  2231. });
  2232. } else {
  2233. let formData = new FormData();
  2234. formData.append("multipartFile", file.file);
  2235. this.http.uploadFile('/common/uploadFile', formData,
  2236. res => {
  2237. if (res.code == "ok") {
  2238. this.dataList[indexLi].valuelist.push(res.data)
  2239. this.$forceUpdate()
  2240. this.$message({
  2241. message: "上传成功",
  2242. type: "success"
  2243. });
  2244. } else {
  2245. this.$message({
  2246. message: res.msg,
  2247. type: "error"
  2248. });
  2249. }
  2250. },
  2251. error => {
  2252. this.$message({
  2253. message: error,
  2254. type: "error"
  2255. });
  2256. });
  2257. }
  2258. },
  2259. handleRemove(file, index) {
  2260. let uploadFiles = this.$refs.upload[0].uploadFiles
  2261. for (var i = 0; i < uploadFiles.length; i++) {
  2262. if (uploadFiles[i]['url'] == file.url) {
  2263. uploadFiles.splice(i, 1)
  2264. this.dataList[index].valuelist.splice(i, 1)
  2265. }
  2266. }
  2267. },
  2268. handlePictureCardPreview(file) {
  2269. console.log(file)
  2270. this.imgUrlLists = file.url;
  2271. this.imgUrlListFlg = true;
  2272. // this.$set(this, 'imgUrlListFlg', true)
  2273. // console.log(this.imgUrlListFlg)
  2274. this.$forceUpdate()
  2275. },
  2276. xhutDown(done) {
  2277. this.imgUrlListFlg = false
  2278. done()
  2279. this.$forceUpdate()
  2280. },
  2281. ipts(i, item) {
  2282. this.$forceUpdate()
  2283. },
  2284. getObtain() {
  2285. this.http.post('/project-custom/getProjectCustom', {},
  2286. res => {
  2287. if(res.code == 'ok') {
  2288. var yaunz = []
  2289. for(var i in res.data) {
  2290. if(res.data[i].customType == '1') {
  2291. this.$set(res.data[i], 'value', [])
  2292. this.$set(res.data[i], 'valuelist', [])
  2293. } else {
  2294. this.$set(res.data[i], 'value', '')
  2295. this.$set(res.data[i], 'valuelist', [])
  2296. }
  2297. yaunz.push(res.data[i])
  2298. }
  2299. this.dataList = yaunz
  2300. this.dataListBf = yaunz
  2301. } else {
  2302. this.$message({
  2303. message: error,
  2304. type: "error"
  2305. });
  2306. }
  2307. },
  2308. error => {;
  2309. this.$message({
  2310. message: error,
  2311. type: "error"
  2312. });
  2313. });
  2314. },
  2315. //获取项目列表
  2316. getSupplierList() {
  2317. this.http.post('/provider-info/list', {
  2318. pageIndex: 1,
  2319. // pageSize: 999,
  2320. pageSize: -1,
  2321. keyword: ''
  2322. },
  2323. res => {
  2324. if (res.code == "ok") {
  2325. this.supplierList = res.data.records;
  2326. } else {
  2327. this.$message({
  2328. message: res.msg,
  2329. type: "error"
  2330. });
  2331. }
  2332. },
  2333. error => {
  2334. this.$message({
  2335. message: error,
  2336. type: "error"
  2337. });
  2338. });
  2339. },
  2340. addManPro(row) {
  2341. this.addFlgmainProjectDialog = true
  2342. if(!row) {
  2343. this.addMainForm = {
  2344. name: '',
  2345. id: '',
  2346. code: '',
  2347. categoryId: ''
  2348. }
  2349. } else {
  2350. this.addMainForm = {
  2351. id: row.id,
  2352. code: row.code,
  2353. name: row.name,
  2354. categoryId: row.categoryId,
  2355. }
  2356. }
  2357. },
  2358. addPanthPro(row) {
  2359. this.addFlgPanthProjectDialog = true
  2360. if(!row) {
  2361. this.addPanthForm = {
  2362. projectStageName: '',
  2363. id: '',
  2364. companyId:''
  2365. }
  2366. } else {
  2367. this.addPanthForm = {
  2368. id: row.id,
  2369. projectStageName: row.projectStageName,
  2370. companyId: row.companyId
  2371. }
  2372. }
  2373. },
  2374. // 获取主项目
  2375. getMainProject() {
  2376. this.http.post('/project-main/list',{},res => {
  2377. if(res.code == 'ok'){
  2378. this.mainProjectList = res.data
  2379. }else {
  2380. this.$message({
  2381. message: res.msg,
  2382. type: 'error'
  2383. })
  2384. }
  2385. },err => {
  2386. this.$message({
  2387. message: err,
  2388. type: 'error'
  2389. })
  2390. })
  2391. },
  2392. checkedProlistForSub(e) {
  2393. this.checkedPForSubArr = e;
  2394. },
  2395. // 批量修改自定义维度
  2396. checkedWudulist(e){
  2397. // console.log(e);
  2398. this.checkedProjectArr = e
  2399. },
  2400. batchSetWudulistBtn1(){
  2401. this.$refs.projectlistOfWudulist.clearSelection()
  2402. this.checkedWuduArr = [],
  2403. this.addGroupPersonData = {
  2404. group: null,
  2405. person: null,
  2406. personNames: ''
  2407. }
  2408. },
  2409. batchSetWudulistBtn2(e){
  2410. if(this.checkedProjectArr.length == 0){
  2411. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2412. return
  2413. }
  2414. this.checkoradd = e
  2415. this.checkedWuduDialog = true
  2416. },
  2417. batchSetWudulistBtn3(){
  2418. if(this.checkedWuduArr.length == 0){
  2419. this.$message(this.$t('defaultText.pleaseChoose') + this.user.timeType.customDegreeName)
  2420. return
  2421. }
  2422. let projectIds = []
  2423. for(let i=0; i<this.checkedProjectArr.length; i++){
  2424. projectIds.push(this.checkedProjectArr[i].id)
  2425. }
  2426. let degreeIds = []
  2427. let degreeNames = []
  2428. for(let s=0; s<this.checkedWuduArr.length; s++){
  2429. degreeIds.push(this.checkedWuduArr[s].id)
  2430. degreeNames.push(this.checkedWuduArr[s].name)
  2431. }
  2432. this.http.post('/project/saveBatchAccoDegrees',{
  2433. ids: JSON.stringify(projectIds),
  2434. associateDegrees: degreeIds.toString(),
  2435. associateDegreeNames: degreeNames.toString()
  2436. },res => {
  2437. if(res.code == 'ok'){
  2438. this.checkedWuduDialog = false
  2439. this.batchSetWudulistBtn1()
  2440. this.$message({
  2441. message: this.$t('setupthesuccess'),
  2442. type: 'success'
  2443. })
  2444. this.getList()
  2445. }else {
  2446. this.$message({
  2447. message: res.msg,
  2448. type: 'error'
  2449. })
  2450. }
  2451. },err => {
  2452. this.$message({
  2453. message: err,
  2454. type: 'error'
  2455. })
  2456. })
  2457. },
  2458. batchSetWudulistBtn4(){
  2459. if(this.checkedWuduArr.length == 0){
  2460. this.$message(this.$t('defaultText.pleaseChoose') + this.user.timeType.customDegreeName)
  2461. return
  2462. }
  2463. let projectIds = []
  2464. for(let i=0; i<this.checkedProjectArr.length; i++){
  2465. projectIds.push(this.checkedProjectArr[i].id)
  2466. }
  2467. let degreeIds = []
  2468. let degreeNames = []
  2469. for(let s=0; s<this.checkedWuduArr.length; s++){
  2470. degreeIds.push(this.checkedWuduArr[s].id)
  2471. degreeNames.push(this.checkedWuduArr[s].name)
  2472. }
  2473. this.http.post('/project/addBatchAccoDegrees',{
  2474. ids: JSON.stringify(projectIds),
  2475. associateDegrees: degreeIds.toString(),
  2476. associateDegreeNames: degreeNames.toString()
  2477. },res => {
  2478. if(res.code == 'ok'){
  2479. this.checkedWuduDialog = false
  2480. this.batchSetWudulistBtn1()
  2481. this.$message({
  2482. message: this.$t('addsuccessful'),
  2483. type: 'success'
  2484. })
  2485. this.getList()
  2486. }else {
  2487. this.$message({
  2488. message: res.msg,
  2489. type: 'error'
  2490. })
  2491. }
  2492. },err => {
  2493. this.$message({
  2494. message: err,
  2495. type: 'error'
  2496. })
  2497. })
  2498. },
  2499. isSelectable(row,index){
  2500. if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectManagement){
  2501. return true
  2502. }else{
  2503. return false
  2504. }
  2505. },
  2506. test(row){
  2507. // console.log(row);
  2508. },
  2509. //批量增加任务分组
  2510. addTaskGroup(){
  2511. if(this.checkedProjectArr.length == 0){
  2512. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2513. return
  2514. }
  2515. this.addTaskGroupDig=true
  2516. },
  2517. batchAddTaskGroup(){
  2518. if(!this.batchAddTaskGroupName){
  2519. this.$message({
  2520. message: '请填写分组名称',
  2521. type: 'warning'
  2522. })
  2523. return
  2524. }
  2525. let proArr = []
  2526. for(let i=0;i<this.checkedProjectArr.length;i++){
  2527. proArr.push(this.checkedProjectArr[i].id)
  2528. }
  2529. this.http.post("/task-group/batchSaveTaskGroup",{
  2530. taskGroupName:this.batchAddTaskGroupName,
  2531. projectIds:proArr.join(",")
  2532. },res=>{
  2533. if(res.code == 'ok'){
  2534. this.$message({
  2535. message: '操作成功',
  2536. type: 'success'
  2537. })
  2538. this.addTaskGroupDig=false
  2539. this.batchAddTaskGroupName=null
  2540. }else {
  2541. this.$message({
  2542. message: res.msg,
  2543. type: 'error'
  2544. })
  2545. }
  2546. },err=>{
  2547. this.$message({
  2548. message: err,
  2549. type: 'error'
  2550. })
  2551. })
  2552. },
  2553. //批量设置分组负责人
  2554. setGroupIncharger(){
  2555. let proArr = []
  2556. for(let i=0;i<this.checkedProjectArr.length;i++){
  2557. proArr.push(this.checkedProjectArr[i].id)
  2558. }
  2559. if(this.checkedProjectArr.length == 0){
  2560. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2561. return
  2562. }
  2563. this.addTaskGroupInchargerDig=true
  2564. this.http.post("/task-group/getAllHadGroup",{
  2565. projectIds:proArr.join(",")
  2566. },res=>{
  2567. if(res.code == 'ok'){
  2568. this.hasSetGroupList=res.data
  2569. }else {
  2570. this.$message({
  2571. message: res.msg,
  2572. type: 'error'
  2573. })
  2574. }
  2575. },err=>{
  2576. this.$message({
  2577. message: err,
  2578. type: 'error'
  2579. })
  2580. })
  2581. },
  2582. batchSetGroupIncharger(){
  2583. if(!this.hasSetGroupName){
  2584. this.$message({
  2585. message: '请选择任务分组',
  2586. type: 'warning'
  2587. })
  2588. return
  2589. }
  2590. if(!this.hasSetGroupInchargerId){
  2591. this.$message({
  2592. message: '请选择分组负责人',
  2593. type: 'warning'
  2594. })
  2595. return
  2596. }
  2597. let proArr = []
  2598. for(let i=0;i<this.checkedProjectArr.length;i++){
  2599. proArr.push(this.checkedProjectArr[i].id)
  2600. }
  2601. this.http.post("/task-group/batchSetGroupIncharger",{
  2602. taskGroupName:this.hasSetGroupName,
  2603. projectIds:proArr.join(","),
  2604. inchargerId:this.hasSetGroupInchargerId
  2605. },res=>{
  2606. if(res.code == 'ok'){
  2607. this.$message({
  2608. message: '操作成功',
  2609. type: 'success'
  2610. })
  2611. this.addTaskGroupInchargerDig=false
  2612. this.hasSetGroupInchargerId=null
  2613. this.hasSetGroupName=null
  2614. }else {
  2615. this.$message({
  2616. message: res.msg,
  2617. type: 'error'
  2618. })
  2619. }
  2620. },err=>{
  2621. this.$message({
  2622. message: err,
  2623. type: 'error'
  2624. })
  2625. })
  2626. },
  2627. // 批量添加分组参与人员
  2628. addGroupPerson(){
  2629. let proArr = []
  2630. if(this.checkedProjectArr.length == 0){
  2631. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2632. return
  2633. }
  2634. this.addGroupPersonBtnLoading = true
  2635. this.isAddGroupPerson = true
  2636. for(let i=0;i<this.checkedProjectArr.length;i++){
  2637. proArr.push(this.checkedProjectArr[i].id)
  2638. }
  2639. this.http.post('/project/getProjectsGroups',{
  2640. projectIdArray: JSON.stringify(proArr)
  2641. },res => {
  2642. if(res.code == 'ok'){
  2643. // console.log('分组',res.data);
  2644. this.addGroupList = res.data
  2645. this.addGroupPersonBtnLoading = false
  2646. this.addGroupPersonDialog = true
  2647. }else {
  2648. this.$message({
  2649. message: res.msg,
  2650. type: 'error'
  2651. })
  2652. }
  2653. },err => {
  2654. this.$message({
  2655. message: err,
  2656. type: 'error'
  2657. })
  2658. })
  2659. },
  2660. addGroupPersonP(){
  2661. this.filterText2 = ''
  2662. this.addGroupPersonPdialog = true
  2663. },
  2664. addPersonCheck(){
  2665. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  2666. var list = chosenList.filter(item=>item.isUser == 1);
  2667. this.chosenMembCount = list.length;
  2668. // console.log(list);
  2669. },
  2670. addPersonSure(){
  2671. this.addGroupPersonPdialog = false
  2672. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  2673. let list = chosenList.filter(item=>item.isUser == 1);
  2674. let listIDs = []
  2675. let listNames = ''
  2676. let listNamesList = []
  2677. for(let i=0;i<list.length;i++){
  2678. listIDs.push(list[i].id)
  2679. listNames += list[i].label + ','
  2680. listNamesList.push(list[i].label)
  2681. }
  2682. this.addGroupPersonData.person = listIDs
  2683. this.addGroupPersonData.personNames = listNames
  2684. this.addGroupPersonDataPersonNames = listNamesList
  2685. console.log('触发', this.addGroupPersonDataPersonNames)
  2686. },
  2687. addGroupPersonSure(){
  2688. if(this.addGroupPersonData.group.length == 0 || this.addGroupPersonData.person == null){
  2689. this.$message({
  2690. message: this.$t('pleaseselectpersonnelasd'),
  2691. type: 'warning'
  2692. })
  2693. return
  2694. }
  2695. let groupList = []
  2696. for(let i=0;i<this.addGroupPersonData.group.length;i++){
  2697. groupList = [...groupList,...this.addGroupPersonData.group[i]]
  2698. }
  2699. this.http.post('/project/batchAddMembToGroup',{
  2700. membIdArray: JSON.stringify(this.addGroupPersonData.person),
  2701. groupIds: JSON.stringify(groupList)
  2702. },res => {
  2703. if(res.code == 'ok'){
  2704. this.addGroupPersonDialog = false,
  2705. this.batchSetWudulistBtn1()
  2706. this.$message({
  2707. message: this.$t('addsuccessful'),
  2708. type: 'success'
  2709. })
  2710. this.getList()
  2711. }else {
  2712. this.$message({
  2713. message: res.msg,
  2714. type: 'error'
  2715. })
  2716. }
  2717. },err => {
  2718. this.$message({
  2719. message: err,
  2720. type: 'error'
  2721. })
  2722. })
  2723. },
  2724. batchDelete(){
  2725. if(this.checkedProjectArr.length == 0){
  2726. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2727. return
  2728. }
  2729. let proArr = []
  2730. for(let i=0;i<this.checkedProjectArr.length;i++){
  2731. proArr.push(this.checkedProjectArr[i].id)
  2732. // proArr += this.checkedProjectArr[i].id + ','
  2733. }
  2734. this.isDeleting = true;
  2735. // proArr = proArr.substring(0,proArr.length - 1)
  2736. this.http.post('/project/batchDeleteProject',{
  2737. projectIdArray: JSON.stringify(proArr)
  2738. },res => {
  2739. this.isDeleting = false;
  2740. if(res.code == 'ok'){
  2741. this.$message({
  2742. message: this.$t('message.successfullyDeleted'),
  2743. type: 'success'
  2744. })
  2745. this.getList()
  2746. }else {
  2747. this.$message({
  2748. message: res.msg,
  2749. type: 'error'
  2750. })
  2751. }
  2752. },err => {
  2753. this.$message({
  2754. message: err,
  2755. type: 'error'
  2756. })
  2757. })
  2758. },
  2759. // 批量设置项目经理
  2760. batchIncharger(){
  2761. if(this.checkedProjectArr.length == 0){
  2762. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2763. return
  2764. }
  2765. this.batchInchargerDialog = true
  2766. this.paramInchargerId = ''
  2767. },
  2768. batchInchargerSure(){
  2769. if(!this.paramInchargerId){
  2770. this.$message({
  2771. message: this.$t('pleaseselecttheprojectmanager'),
  2772. type: 'warning'
  2773. })
  2774. return
  2775. }
  2776. let proArr = ''
  2777. for(let i=0;i<this.checkedProjectArr.length;i++){
  2778. // proArr.push(this.checkedProjectArr[i].id)
  2779. proArr += this.checkedProjectArr[i].id + ','
  2780. }
  2781. proArr = proArr.substring(0,proArr.length - 1)
  2782. this.http.post('/project/batchExchangeIncharger',{
  2783. inchargerId: this.paramInchargerId,
  2784. projectIds: proArr
  2785. },res => {
  2786. if(res.code == 'ok'){
  2787. this.batchInchargerDialog = false
  2788. this.$message({
  2789. message: this.$t('setupthesuccess'),
  2790. type: 'success'
  2791. })
  2792. this.getList()
  2793. }else {
  2794. this.$message({
  2795. message: res.msg,
  2796. type: 'error'
  2797. })
  2798. }
  2799. },err => {
  2800. this.$message({
  2801. message: err,
  2802. type: 'error'
  2803. })
  2804. })
  2805. },
  2806. // 批量添加项目参与人
  2807. addProPreson(){
  2808. if(this.checkedProjectArr.length == 0){
  2809. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2810. return
  2811. }
  2812. this.addGroupPersonDialog = true
  2813. this.isAddGroupPerson = false
  2814. },
  2815. addProPersonSure(){
  2816. if(this.addGroupPersonData.person == null){
  2817. this.$message({
  2818. message: this.$t('pleaseselectpersonnel'),
  2819. type: 'warning'
  2820. })
  2821. return
  2822. }
  2823. let proArr = []
  2824. for(let i=0;i<this.checkedProjectArr.length;i++){
  2825. proArr.push(this.checkedProjectArr[i].id)
  2826. // proArr += this.checkedProjectArr[i].id + ','
  2827. }
  2828. // proArr = proArr.substring(0,proArr.length - 1)
  2829. this.http.post('/project/batchSetParticipation',{
  2830. userIds: JSON.stringify(this.addGroupPersonData.person),
  2831. projectIdArray: JSON.stringify(proArr)
  2832. },res => {
  2833. if(res.code == 'ok'){
  2834. this.addGroupPersonDialog = false,
  2835. this.batchSetWudulistBtn1()
  2836. this.$message({
  2837. message: this.$t('addsuccessful'),
  2838. type: 'success'
  2839. })
  2840. this.getList()
  2841. }else {
  2842. this.$message({
  2843. message: res.msg,
  2844. type: 'error'
  2845. })
  2846. }
  2847. },err => {
  2848. this.$message({
  2849. message: err,
  2850. type: 'error'
  2851. })
  2852. })
  2853. },
  2854. filterNode(value, data) {
  2855. // if (!value) return true;
  2856. // return data.label.indexOf(value) !== -1;
  2857. let { userNameNeedTranslate } = this.user
  2858. console.log(value, data, '《=== 执行')
  2859. if (!value) return true;
  2860. if(userNameNeedTranslate != '1') {
  2861. return data.label.indexOf(value) !== -1;
  2862. } else {
  2863. return this.filterNodePersonnel.some(item => item.includes(data.label))
  2864. }
  2865. },
  2866. //重启项目
  2867. restartPro(row) {
  2868. this.http.post('/project/start',{id: row.id},
  2869. res => {
  2870. if (res.code == "ok") {
  2871. this.$message({
  2872. message: this.$t('restartthesuccess'),
  2873. type: "success"
  2874. });
  2875. row.status = 1;
  2876. } else {
  2877. this.$message({
  2878. message: res.msg,
  2879. type: "error"
  2880. });
  2881. }
  2882. },
  2883. error => {
  2884. this.$message({
  2885. message: error,
  2886. type: "error"
  2887. });
  2888. });
  2889. },
  2890. //撤销项目
  2891. cancelPro(row) {
  2892. this.http.post('/project/cancel',{id: row.id},
  2893. res => {
  2894. if (res.code == "ok") {
  2895. this.$message({
  2896. message: this.$t('Revocationofsuccess'),
  2897. type: "success"
  2898. });
  2899. row.status = 3;
  2900. } else {
  2901. this.$message({
  2902. message: res.msg,
  2903. type: "error"
  2904. });
  2905. }
  2906. },
  2907. error => {
  2908. this.$message({
  2909. message: error,
  2910. type: "error"
  2911. });
  2912. });
  2913. },
  2914. // 暂停项目
  2915. suspendPro(row) {
  2916. this.http.post('/project/suspend',{id: row.id},
  2917. res => {
  2918. if (res.code == "ok") {
  2919. this.$message({
  2920. message: this.$t('suspensionofsuccess'),
  2921. type: "success"
  2922. });
  2923. row.status = 4;
  2924. } else {
  2925. this.$message({
  2926. message: res.msg,
  2927. type: "error"
  2928. });
  2929. }
  2930. },
  2931. error => {
  2932. this.$message({
  2933. message: error,
  2934. type: "error"
  2935. });
  2936. });
  2937. },
  2938. //完成项目
  2939. finishPro(row) {
  2940. this.http.post('/project/finish',{id: row.id},
  2941. res => {
  2942. if (res.code == "ok") {
  2943. this.$message({
  2944. message: this.$t('projectcompletion'),
  2945. type: "success"
  2946. });
  2947. row.status = 2;
  2948. } else {
  2949. this.$message({
  2950. message: res.msg,
  2951. type: "error"
  2952. });
  2953. }
  2954. },
  2955. error => {
  2956. this.$message({
  2957. message: error,
  2958. type: "error"
  2959. });
  2960. });
  2961. },
  2962. exportProjectData() {
  2963. let param = {
  2964. status: this.status,
  2965. }
  2966. if(this.keyword){param.searchField = this.searchField;param.keyword = this.keyword}
  2967. if(this.projectMainId){param.projectMainId = this.projectMainId}
  2968. if(this.statusClf){param.category = this.statusClf}
  2969. if(this.deptId.length){param.deptId = this.deptId[this.deptId.length-1]}
  2970. if(this.inchagerId){param.inchagerId = this.inchagerId}
  2971. if(this.participationId){param.participation = this.participationId}
  2972. this.exportDisabled = true
  2973. this.exportNotification = this.$notify({
  2974. title: '导出项目',
  2975. message: '项目导出中、请稍后...',
  2976. duration: 0,
  2977. showClose: false
  2978. });
  2979. //导出项目
  2980. this.http.post('/project/exportData',param,
  2981. res => {
  2982. this.exportDisabled = false
  2983. this.exportNotification.close()
  2984. if (res.code == "ok") {
  2985. var filePath = res.data;
  2986. const a = document.createElement('a'); // 创建a标签
  2987. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  2988. a.setAttribute('href', filePath);// href链接
  2989. a.click(); //自执行点击事件
  2990. a.remove();
  2991. }
  2992. },
  2993. error => {
  2994. this.exportDisabled = false
  2995. this.exportNotification.close()
  2996. this.$message({
  2997. message: error,
  2998. type: "error"
  2999. });
  3000. }
  3001. );
  3002. },
  3003. exportProjectGroup() {
  3004. //导出项目分组
  3005. this.http.post('/project/exportGroupData',{projectCategorySubId:this.projectCategorySubId},
  3006. res => {
  3007. if (res.code == "ok") {
  3008. var filePath = res.data;
  3009. const a = document.createElement('a'); // 创建a标签
  3010. a.setAttribute('download', this.$t('projecttaskgroupexport') + '.xlsx');// download属性
  3011. a.setAttribute('href', filePath);// href链接
  3012. a.click(); //自执行点击事件
  3013. a.remove();
  3014. }
  3015. },
  3016. error => {
  3017. this.$message({
  3018. message: error,
  3019. type: "error"
  3020. });
  3021. }
  3022. );
  3023. },
  3024. userssHu() {
  3025. this.http.post('/time-type/getCompanyTimeSetting',{
  3026. companyId: this.user.companyId
  3027. },
  3028. res => {
  3029. if (res.code == "ok") {
  3030. this.yonghuUser = res.data
  3031. // console.log(this.yonghuUser)
  3032. }
  3033. },
  3034. error => {
  3035. this.$message({
  3036. message: error,
  3037. type: "error"
  3038. });
  3039. }
  3040. );
  3041. },
  3042. yanjiuzx() {
  3043. this.http.post('/report-extra-degree/getAll ',{},
  3044. res => {
  3045. if (res.code == "ok") {
  3046. // console.log(res, '过来的数据')
  3047. this.ause = res.data
  3048. } else {
  3049. this.$message({
  3050. message: res.msg,
  3051. type: "error"
  3052. });
  3053. }
  3054. },
  3055. error => {
  3056. this.$message({
  3057. message: error,
  3058. type: "error"
  3059. });
  3060. }
  3061. );
  3062. },
  3063. selectPublic() {
  3064. if (this.addForm.isPublic == 1) {
  3065. this.participator = this.users;
  3066. } else {
  3067. this.participator = [];
  3068. }
  3069. },
  3070. addPpMemb() {
  3071. //检查合计比例是否到达100%
  3072. let p = 0;
  3073. let hasNoMemb = false;
  3074. this.curProfessionRow.membList.forEach(m=>{
  3075. p += parseInt(m.percentage);
  3076. //检查人员是否选择
  3077. if (m.membId == null) {
  3078. hasNoMemb = true;
  3079. }
  3080. });
  3081. if (hasNoMemb) {
  3082. this.$message({
  3083. message: this.$t('professionalscannotbeempty'),
  3084. type: "error"
  3085. });
  3086. return;
  3087. }
  3088. //检查人员不能重复
  3089. let hasDuplicate = false;
  3090. this.curProfessionRow.membList.forEach(m=>{
  3091. if (this.curProfessionRow.membList.filter(innerM=>innerM.membId == m.membId).length>1) {
  3092. hasDuplicate = true;
  3093. }
  3094. });
  3095. if (hasDuplicate) {
  3096. this.$message({
  3097. message: this.$t('professionalscannotrepeat'),
  3098. type: "error"
  3099. });
  3100. return;
  3101. }
  3102. if (p != 100) {
  3103. this.$message({
  3104. message: this.$t('totalproportionmust'),
  3105. type: "error"
  3106. });
  3107. return;
  3108. }
  3109. this.editPpMembDialog = false;
  3110. this.curProfessionRow.membList.forEach(m=>{
  3111. m.membName = this.participator.filter(p=>p.id == m.membId)[0].name;
  3112. });
  3113. this.projectProfessionItem.membList = JSON.parse(JSON.stringify(this.curProfessionRow.membList));
  3114. },
  3115. //删除专业人员
  3116. deleteMembItem(index) {
  3117. this.curProfessionRow.membList.splice(index,1);
  3118. },
  3119. //添加专业人员
  3120. addMembItem() {
  3121. if (this.curProfessionRow.membList == null) {
  3122. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  3123. } else {
  3124. let p = 0;
  3125. this.curProfessionRow.membList.forEach(m=>{
  3126. p += parseInt(m.percentage);
  3127. });
  3128. this.curProfessionRow.membList.push({membId:null, percentage:100-p});
  3129. }
  3130. this.$forceUpdate();
  3131. },
  3132. showEditPpMembs(row) {
  3133. this.projectProfessionItem = row;
  3134. this.curProfessionRow = JSON.parse(JSON.stringify(row));
  3135. if (this.curProfessionRow.membList == null || this.curProfessionRow.membList.length == 0) {
  3136. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  3137. }
  3138. this.editPpMembDialog = true;
  3139. },
  3140. getProjectNotifyUserList(projectId) {
  3141. this.http.post("/project-notify-user/get", {projectId: projectId},
  3142. res => {
  3143. if (res.code == "ok") {
  3144. var chosenLeaderIds = [];
  3145. var chosenLeaderNames = '';
  3146. var leaderList = res.data;
  3147. this.chosenLeaders = leaderList;
  3148. for(var j in leaderList) {
  3149. chosenLeaderIds.push(leaderList[j].userId)
  3150. chosenLeaderNames += leaderList[j].userName+',';
  3151. }
  3152. if (chosenLeaderNames.length > 0) {
  3153. chosenLeaderNames = chosenLeaderNames.substring(0, chosenLeaderNames.length -1);
  3154. }
  3155. this.addForm.notifyUserIds = chosenLeaderIds;
  3156. this.addForm.notifyUserNames = chosenLeaderNames;
  3157. } else {
  3158. this.$message({
  3159. message: res.msg,
  3160. type: "error"
  3161. });
  3162. }
  3163. },
  3164. error => {
  3165. this.$message({
  3166. message: error,
  3167. type: "error"
  3168. });
  3169. });
  3170. },
  3171. getProjectProfessions(projectId) {
  3172. this.http.post("/project-profession/get", {projectId: projectId},
  3173. res => {
  3174. if (res.code == "ok") {
  3175. this.projectProfessionList = res.data;
  3176. } else {
  3177. this.$message({
  3178. message: res.msg,
  3179. type: "error"
  3180. });
  3181. }
  3182. },
  3183. error => {
  3184. this.$message({
  3185. message: error,
  3186. type: "error"
  3187. });
  3188. });
  3189. },
  3190. checkProjectProfession() {
  3191. //检查合计比例是否到达100%
  3192. let p = 0;
  3193. let hasNoMemb = false;
  3194. let hasNoProfession = false;
  3195. let hasNoMembList = false;
  3196. this.projectProfessionList.forEach(m=>{
  3197. p += parseInt(m.percentage);
  3198. //检查人员是否选择
  3199. if (m.inchargerId == null) {
  3200. hasNoMemb = true;
  3201. }
  3202. if (m.professionId == null) {
  3203. hasNoProfession = true;
  3204. }
  3205. if (m.membList == null) {
  3206. hasNoMembList = true;
  3207. }
  3208. });
  3209. if (hasNoProfession) {
  3210. this.$message({
  3211. message: this.$t('majorcannotbeempty'),
  3212. type: "error"
  3213. });
  3214. return false;
  3215. }
  3216. if (hasNoMembList) {
  3217. this.$message({
  3218. message: this.$t('personnelcannotbeleftblank'),
  3219. type: "error"
  3220. });
  3221. return false;
  3222. }
  3223. if (hasNoMemb) {
  3224. this.$message({
  3225. message: this.$t('leadercannotbeblank'),
  3226. type: "error"
  3227. });
  3228. return false;
  3229. }
  3230. //检查专业不能重复
  3231. let hasDuplicate = false;
  3232. this.projectProfessionList.forEach(m=>{
  3233. if (this.projectProfessionList.filter(innerM=>innerM.professionId == m.professionId).length>1) {
  3234. hasDuplicate = true;
  3235. }
  3236. });
  3237. if (hasDuplicate) {
  3238. this.$message({
  3239. message: this.$t('shouldnotberepeated'),
  3240. type: "error"
  3241. });
  3242. return false;
  3243. }
  3244. if (this.projectProfessionList.length > 0 && p != 100) {
  3245. this.$message({
  3246. message: this.$t('numberomajorsmust'),
  3247. type: "error"
  3248. });
  3249. return false;
  3250. }
  3251. return true;
  3252. },
  3253. //保存项目专业
  3254. saveProjectProfessions(projectId) {
  3255. var list = this.projectProfessionList.filter(p=>p.professionId != null);
  3256. list.forEach(p=>p.inchargerName = this.participator.filter(m=>m.id == p.inchargerId)[0].name);
  3257. list.forEach(p=>p.professionName = this.professionList.filter(m=>m.id == p.professionId)[0].name);
  3258. this.http.post("/project-profession/modify", {projectId: projectId, json: JSON.stringify(list)},
  3259. res => {
  3260. if (res.code == "ok") {
  3261. return false;
  3262. } else {
  3263. this.$message({
  3264. message: res.msg,
  3265. type: "error"
  3266. });
  3267. }
  3268. },
  3269. error => {
  3270. this.$message({
  3271. message: error,
  3272. type: "error"
  3273. });
  3274. });
  3275. },
  3276. //删除项目专业
  3277. deleteItem(index) {
  3278. this.projectProfessionList.splice(index,1);
  3279. },
  3280. //添加项目专业
  3281. addItem() {
  3282. let p = 0;
  3283. this.projectProfessionList.forEach(m=>{
  3284. p += parseInt(m.percentage);
  3285. });
  3286. this.projectProfessionList.push( { professionId:null, inchargerId:null,membIds:[], percentage: 100-p});
  3287. },
  3288. getProfessionList() {
  3289. this.http.post("/profession/getAll", {},
  3290. res => {
  3291. if (res.code == "ok") {
  3292. var list = res.data;
  3293. this.professionList = list;
  3294. } else {
  3295. this.$message({
  3296. message: res.msg,
  3297. type: "error"
  3298. });
  3299. }
  3300. },
  3301. error => {
  3302. this.$message({
  3303. message: error,
  3304. type: "error"
  3305. });
  3306. });
  3307. },
  3308. restrictNumber(targetId) {
  3309. let inpu = document.getElementById(targetId);
  3310. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3311. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3312. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3313. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3314. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3315. inpu.value = parseFloat(inpu.value);
  3316. }
  3317. },
  3318. showChooseLeaderTree() {
  3319. this.chosenMembCount = this.chosenLeaders.length;
  3320. this.chooseLeaderVisible = true;
  3321. },
  3322. onLeaderTreeItemChange() {
  3323. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  3324. var list = chosenList.filter(item=>item.isUser == 1);
  3325. this.chosenMembCount = list.length;
  3326. },
  3327. showChooseMembTree() {
  3328. this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
  3329. this.chosenMembCount = this.participator.length;
  3330. this.chooseParticipVisible = true;
  3331. this.filterText = ''
  3332. this.wxFilterText = ''
  3333. if(this.user.userNameNeedTranslate == 1) {
  3334. this.getDepartment()
  3335. }
  3336. let that = this
  3337. setTimeout(()=>{
  3338. that.chosenListBackup = that.$refs.chooseMembTree.getCheckedNodes();
  3339. }, 500)
  3340. console.log(this.chosenListBackup, '备份的数据')
  3341. },
  3342. onTreeItemChange() {
  3343. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3344. var list = chosenList.filter(item=>item.isUser == 1);
  3345. this.chosenMembCount = list.length;
  3346. },
  3347. findUserInTree() {
  3348. if (this.filterName == '') {
  3349. this.deptMembData = this.allMembData;
  3350. } else {
  3351. var list = this.findRecursively(this.filterName, this.allMembData);
  3352. this.deptMembData = list;
  3353. }
  3354. },
  3355. findRecursively(username, list) {
  3356. var filterList = [];
  3357. for (var i=0;i<list.length; i++) {
  3358. if (list[i].isUser == 1) {
  3359. if (list[i].label.indexOf(username) >= 0) {
  3360. //匹配上了
  3361. filterList.push(list[i]);
  3362. }
  3363. } else if (list[i].children != null && list[i].children.length > 0) {
  3364. var subList = this.findRecursively(username, list[i].children);
  3365. if (subList.length > 0) {
  3366. subList.forEach(s=>filterList.push(s));
  3367. }
  3368. }
  3369. }
  3370. return filterList;
  3371. },
  3372. //确定选择参与人
  3373. chooseParticip() {
  3374. this.chooseParticipVisible = false;
  3375. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3376. if(this.searchPersonnelFlg) {
  3377. chosenList = [...chosenList, ...this.chosenListBackup]
  3378. }
  3379. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3380. this.addForm.userNames = '';
  3381. this.addFormUserNames = []
  3382. this.addForm.userId = [];
  3383. this.participator = [];
  3384. for (var i=0;i<this.chosenMembList.length; i++) {
  3385. this.addForm.userId.push(this.chosenMembList[i].id);
  3386. this.addForm.userNames += this.chosenMembList[i].label+',';
  3387. this.addFormUserNames.push(this.chosenMembList[i].label)
  3388. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3389. this.participator.push(item);
  3390. }
  3391. if (this.addForm.userNames.length > 0) {
  3392. this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
  3393. // this.addFormUserNames = this.addFormUserNames.substring(0, this.addFormUserNames.length-1);
  3394. }
  3395. console.log(this.addForm.userId)
  3396. console.log(this.addForm.userNames)
  3397. console.log(this.addFormUserNames)
  3398. },
  3399. //选中相关领导
  3400. // chooseLeader() {
  3401. // this.chooseLeaderVisible = false;
  3402. // var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  3403. // var chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3404. // this.addForm.notifyUserNames = '';
  3405. // this.addForm.notifyUserIds = [];
  3406. // this.chosenLeaders = [];
  3407. // for (var i=0;i<chosenMembList.length; i++) {
  3408. // this.addForm.notifyUserIds.push(chosenMembList[i].id);
  3409. // this.addForm.notifyUserNames += chosenMembList[i].label+',';
  3410. // var item = {userId:chosenMembList[i].id, userName:chosenMembList[i].label};
  3411. // this.chosenLeaders.push(item);
  3412. // }
  3413. // if (this.addForm.notifyUserNames.length > 0) {
  3414. // this.addForm.notifyUserNames = this.addForm.notifyUserNames.substring(0, this.addForm.notifyUserNames.length-1);
  3415. // }
  3416. // },
  3417. // 获取部门列表
  3418. getDepartment() {
  3419. this.http.post("/department/listAllMemb", {},
  3420. res => {
  3421. if (res.code == "ok") {
  3422. var list = res.data;
  3423. //设置员工到部门下面
  3424. this.setUserToDept(list);
  3425. this.deptMembData = list;
  3426. console.log(this.deptMembData, '看看数据')
  3427. //用于筛选过滤
  3428. this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
  3429. } else {
  3430. this.$message({
  3431. message: res.msg,
  3432. type: "error"
  3433. });
  3434. }
  3435. },
  3436. error => {
  3437. this.$message({
  3438. message: error,
  3439. type: "error"
  3440. });
  3441. });
  3442. },
  3443. // 获取部门列表
  3444. getDepartment2() {
  3445. this.http.post(
  3446. this.port.manage.depList,{},
  3447. (res) => {
  3448. if (res.code == "ok") {
  3449. var list = res.data
  3450. this.buOption = this.changeArr(JSON.parse(JSON.stringify(list)));
  3451. } else {
  3452. this.$message({
  3453. message: res.msg,
  3454. type: "error",
  3455. });
  3456. }
  3457. },
  3458. (error) => {
  3459. this.$message({
  3460. message: error,
  3461. type: "error",
  3462. });
  3463. }
  3464. );
  3465. },
  3466. // 修改数组
  3467. changeArr(arr) {
  3468. for (var i = 0; i < arr.length; i++) {
  3469. if(arr[i].id != -1 && arr[i].id != 0) {
  3470. // if(arr[i].userList) {
  3471. // if(arr[i].userList.length > 0) {
  3472. // arr[i].children = arr[i].userList
  3473. // }
  3474. // }
  3475. if (arr[i].children != null && arr[i].children.length>0) {
  3476. arr[i].children = this.changeArr(arr[i].children);
  3477. }
  3478. arr[i].id && (arr[i].value = arr[i].id);
  3479. delete arr[i].id;
  3480. }
  3481. }
  3482. for(var i in arr) {
  3483. if(arr[i].id == -1 || arr[i].id == 0) {
  3484. arr.splice(i,1)
  3485. }
  3486. }
  3487. return arr;
  3488. },
  3489. // 企业微信搜索
  3490. echartDepartment() {
  3491. console.log('我点击了搜索')
  3492. if(this.filterText != '') {
  3493. this.http.post("/user/getEmployeeList", {
  3494. keyword: this.filterText,
  3495. cursor: '',
  3496. departmentId: -1,
  3497. pageIndex: 1,
  3498. pageSize: 1000
  3499. },
  3500. res => {
  3501. if (res.code == "ok") {
  3502. this.filterNodePersonnel = res.data.records.map(item => item.name)
  3503. this.$refs.chooseMembTree.filter(this.filterText);
  3504. } else {
  3505. this.$message({
  3506. message: res.msg,
  3507. type: "error"
  3508. });
  3509. }
  3510. },
  3511. error => {
  3512. this.$message({
  3513. message: error,
  3514. type: "error"
  3515. });
  3516. });
  3517. } else {
  3518. this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
  3519. this.searchPersonnelFlg = false
  3520. this.getDepartment()
  3521. }
  3522. },
  3523. setUserToDept(list) {
  3524. for (var i in list) {
  3525. if (list[i].children != null) {
  3526. this.setUserToDept(list[i].children);
  3527. }
  3528. if (list[i].userList != null) {
  3529. if (list[i].children == null) {
  3530. list[i].children = [];
  3531. }
  3532. list[i].userList.forEach(element => {
  3533. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  3534. list[i].children.push(obj);
  3535. });
  3536. }
  3537. }
  3538. },
  3539. // 获取分类条目
  3540. getClfConfigList() {
  3541. this.http.get('/project-category/list',
  3542. res => {
  3543. if (res.code == "ok") {
  3544. this.baseClfList = res.data;
  3545. // console.log("获取分类条目",res.data);
  3546. this.$forceUpdate();
  3547. } else {
  3548. this.$message({
  3549. message: res.msg,
  3550. type: "error"
  3551. });
  3552. }
  3553. },
  3554. error => {
  3555. this.$message({
  3556. message: error,
  3557. type: "error"
  3558. });
  3559. }
  3560. );
  3561. },
  3562. // 新增/编辑 分类条目
  3563. addNewClf(row) {
  3564. this.addClfDialog = true;
  3565. if (row == null) {
  3566. this.addClf = {}
  3567. } else {
  3568. this.addClf = row;
  3569. }
  3570. },
  3571. // 提交
  3572. submitClf() {
  3573. this.addClf.proBuAudit ? this.addClf.proBuAudit =1 : this.addClf.proBuAudit = 0
  3574. this.addClf.proInchargerAudit ? this.addClf.proInchargerAudit = 1 : this.addClf.proInchargerAudit = 0
  3575. this.http.post('/project-category/addOrMod',this.addClf,
  3576. res => {
  3577. if (res.code == "ok") {
  3578. this.addClfDialog = false;
  3579. this.auditProcessDialog=false;
  3580. this.baseClfList = res.data;
  3581. // this.$forceUpdate();
  3582. // console.log(res.data);
  3583. } else {
  3584. this.$message({
  3585. message: res.msg,
  3586. type: "error"
  3587. });
  3588. }
  3589. },
  3590. error => {
  3591. this.$message({
  3592. message: error,
  3593. type: "error"
  3594. });
  3595. }
  3596. );
  3597. },
  3598. // 提交
  3599. submitManPro() {
  3600. this.http.post('/project-main/addOrMod',this.addMainForm,
  3601. res => {
  3602. if (res.code == "ok") {
  3603. this.addFlgmainProjectDialog = false;
  3604. this.getMainProject()
  3605. } else {
  3606. this.$message({
  3607. message: res.msg,
  3608. type: "error"
  3609. });
  3610. }
  3611. },
  3612. error => {
  3613. this.$message({
  3614. message: error,
  3615. type: "error"
  3616. });
  3617. }
  3618. );
  3619. },
  3620. // 分类绑定审核流程设置
  3621. auditProcess(row) {
  3622. this.auditProcessDialog = true;
  3623. row.proBuAudit ? row.proBuAudit = true : row.proBuAudit = false
  3624. row.proInchargerAudit ? row.proInchargerAudit = true : row.proInchargerAudit = false
  3625. if (row == null) {
  3626. this.addClf = {}
  3627. } else {
  3628. this.addClf = row;
  3629. }
  3630. },
  3631. // 提交项目阶段
  3632. submitPanthPro() {
  3633. this.http.post('/project-stage/addOrMod',this.addPanthForm,
  3634. res => {
  3635. if (res.code == "ok") {
  3636. this.addFlgPanthProjectDialog = false;
  3637. this.obtainPhase()
  3638. } else {
  3639. this.$message({
  3640. message: res.msg,
  3641. type: "error"
  3642. });
  3643. }
  3644. },
  3645. error => {
  3646. this.$message({
  3647. message: error,
  3648. type: "error"
  3649. });
  3650. }
  3651. );
  3652. },
  3653. // 删除
  3654. deleteClf(row) {
  3655. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingCategoryEntry'), {
  3656. confirmButtonText: this.$t('btn.determine'),
  3657. cancelButtonText: this.$t('btn.cancel'),
  3658. type: "warning"
  3659. })
  3660. .then(() => {
  3661. this.listLoading = true;
  3662. this.http.post('/project-category/delete',{
  3663. id: row.id
  3664. },
  3665. res => {
  3666. this.listLoading = false;
  3667. if (res.code == "ok") {
  3668. this.$message({
  3669. message: this.$t('message.successfullyDeleted'),
  3670. type: "success"
  3671. });
  3672. this.getClfConfigList();
  3673. } else {
  3674. this.$message({
  3675. message: res.msg,
  3676. type: "error"
  3677. });
  3678. }
  3679. },
  3680. error => {
  3681. this.listLoading = false;
  3682. this.$message({
  3683. message: error,
  3684. type: "error"
  3685. });
  3686. }
  3687. );
  3688. })
  3689. .catch(() => {});
  3690. },
  3691. // 删除主项目
  3692. deleteManPro(row) {
  3693. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletethemainproject'), {
  3694. confirmButtonText: this.$t('btn.determine'),
  3695. cancelButtonText: this.$t('btn.cancel'),
  3696. type: "warning"
  3697. })
  3698. .then(() => {
  3699. this.listLoading = true;
  3700. this.http.post('/project-main/delete',{
  3701. id: row.id
  3702. },
  3703. res => {
  3704. this.listLoading = false;
  3705. if (res.code == "ok") {
  3706. this.$message({
  3707. message: this.$t('message.successfullyDeleted'),
  3708. type: "success"
  3709. });
  3710. this.getMainProject();
  3711. } else {
  3712. this.$message({
  3713. message: res.msg,
  3714. type: "error"
  3715. });
  3716. }
  3717. },
  3718. error => {
  3719. this.listLoading = false;
  3720. this.$message({
  3721. message: error,
  3722. type: "error"
  3723. });
  3724. }
  3725. );
  3726. })
  3727. .catch(() => {});
  3728. },
  3729. // 删除项目阶段
  3730. deletePanthPro(row) {
  3731. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingprojectphases'), {
  3732. confirmButtonText: this.$t('btn.determine'),
  3733. cancelButtonText: this.$t('btn.cancel'),
  3734. type: "warning"
  3735. })
  3736. .then(() => {
  3737. this.listLoading = true;
  3738. this.http.post('/project-stage/delete ',{
  3739. id: row.id
  3740. },
  3741. res => {
  3742. this.listLoading = false;
  3743. if (res.code == "ok") {
  3744. this.$message({
  3745. message: this.$t('message.successfullyDeleted'),
  3746. type: "success"
  3747. });
  3748. this.obtainPhase();
  3749. } else {
  3750. this.$message({
  3751. message: res.msg,
  3752. type: "error"
  3753. });
  3754. }
  3755. },
  3756. error => {
  3757. this.listLoading = false;
  3758. this.$message({
  3759. message: error,
  3760. type: "error"
  3761. });
  3762. }
  3763. );
  3764. })
  3765. .catch(() => {});
  3766. },
  3767. // 分类筛选
  3768. searchClfList(){
  3769. this.page = 1;
  3770. this.getList();
  3771. },
  3772. manageSelect(){
  3773. this.page = 1
  3774. this.getList()
  3775. },
  3776. getProjectBaseConfigList() {
  3777. this.http.post('/project-basecost-setting/list',{},
  3778. res => {
  3779. if (res.code == "ok") {
  3780. this.baseCostItemList = res.data;
  3781. this.$forceUpdate();
  3782. } else {
  3783. this.$message({
  3784. message: res.msg,
  3785. type: "error"
  3786. });
  3787. }
  3788. },
  3789. error => {
  3790. this.$message({
  3791. message: error,
  3792. type: "error"
  3793. });
  3794. }
  3795. );
  3796. },
  3797. deletekeyNodes(row) {
  3798. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingKeyNode'), {
  3799. confirmButtonText: this.$t('btn.determine'),
  3800. cancelButtonText: this.$t('btn.cancel'),
  3801. type: "warning"
  3802. })
  3803. .then(() => {
  3804. this.listLoading = true;
  3805. this.http.post('/project-key-nodes-setting/delete',{
  3806. id: row.id
  3807. },
  3808. res => {
  3809. this.listLoading = false;
  3810. if (res.code == "ok") {
  3811. this.$message({
  3812. message: this.$t('message.successfullyDeleted'),
  3813. type: "success"
  3814. });
  3815. this.getkeyNodes();
  3816. } else {
  3817. this.$message({
  3818. message: res.msg,
  3819. type: "error"
  3820. });
  3821. }
  3822. },
  3823. error => {
  3824. this.listLoading = false;
  3825. this.$message({
  3826. message: error,
  3827. type: "error"
  3828. });
  3829. }
  3830. );
  3831. })
  3832. .catch(() => {});
  3833. },
  3834. syncProjectForThird(){
  3835. let url=''
  3836. if(this.user.timeType.syncFanwei==1){
  3837. // 美莱德同步项目信息来源泛微
  3838. url='/project/syncProjectWithFanwei'
  3839. }else if(this.user.timeType.syncSap==1){
  3840. // 依斯倍同步项目信息来源SAP
  3841. url='/project/syncProjectWithSap'
  3842. }
  3843. this.$confirm('确认同步项目数据?','提示',{
  3844. confirmButtonText: '确定',
  3845. cancelButtonText: '取消',
  3846. type: 'info'
  3847. }).then(()=>{
  3848. const loading = this.$loading({
  3849. lock: true,
  3850. text: '正在同步中,请耐心等待。',
  3851. spinner: 'el-icon-loading',
  3852. background: 'rgba(0, 0, 0, 0.7)'
  3853. });
  3854. this.http.post(url,{},
  3855. res => {
  3856. loading.close();
  3857. console.log(res, 'res')
  3858. if (res.code == "ok") {
  3859. this.$message({
  3860. message: '项目同步成功',
  3861. type: "success"
  3862. });
  3863. } else {
  3864. this.$message({
  3865. message: res.msg,
  3866. type: "error"
  3867. });
  3868. }
  3869. },
  3870. error => {
  3871. loading.close();
  3872. console.log(error, 'res')
  3873. this.$message({
  3874. message: error,
  3875. type: "error"
  3876. });
  3877. }
  3878. );
  3879. }).catch(() => {
  3880. });
  3881. },
  3882. deleteBaseItem(row) {
  3883. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletethecostbaselineitem'), {
  3884. confirmButtonText: this.$t('btn.determine'),
  3885. cancelButtonText: this.$t('btn.cancel'),
  3886. type: "warning"
  3887. })
  3888. .then(() => {
  3889. this.listLoading = true;
  3890. this.http.post('/project-basecost-setting/delete',{
  3891. id: row.id
  3892. },
  3893. res => {
  3894. this.listLoading = false;
  3895. if (res.code == "ok") {
  3896. this.$message({
  3897. message: this.$t('message.successfullyDeleted'),
  3898. type: "success"
  3899. });
  3900. this.getProjectBaseConfigList();
  3901. } else {
  3902. this.$message({
  3903. message: res.msg,
  3904. type: "error"
  3905. });
  3906. }
  3907. },
  3908. error => {
  3909. this.listLoading = false;
  3910. this.$message({
  3911. message: error,
  3912. type: "error"
  3913. });
  3914. }
  3915. );
  3916. })
  3917. .catch(() => {});
  3918. },
  3919. submitInsertBaseItem() {
  3920. this.http.post('/project-basecost-setting/addOrMod',this.addForm,
  3921. res => {
  3922. if (res.code == "ok") {
  3923. this.addBaseItemDialog = false;
  3924. this.baseCostItemList = res.data;
  3925. this.$forceUpdate();
  3926. } else {
  3927. this.$message({
  3928. message: res.msg,
  3929. type: "error"
  3930. });
  3931. }
  3932. },
  3933. error => {
  3934. this.$message({
  3935. message: error,
  3936. type: "error"
  3937. });
  3938. }
  3939. );
  3940. },
  3941. submitkeyNodes() {
  3942. // console.log(this.addForm, '提交的参数')
  3943. // return
  3944. this.http.post('/project-key-nodes-setting/addOrMod',this.addFormkeyNodes,
  3945. res => {
  3946. if (res.code == "ok") {
  3947. this.addBasekeyNodesialog = false;
  3948. this.keyNodesList = res.data;
  3949. this.$forceUpdate();
  3950. } else {
  3951. this.$message({
  3952. message: res.msg,
  3953. type: "error"
  3954. });
  3955. }
  3956. },
  3957. error => {
  3958. this.$message({
  3959. message: error,
  3960. type: "error"
  3961. });
  3962. }
  3963. );
  3964. },
  3965. showBaseCostItemDialog() {
  3966. this.showBaseConfig = true;
  3967. },
  3968. addNewBaseItem(row) {
  3969. this.addBaseItemDialog = true;
  3970. if (row == null) {
  3971. this.addForm = {alarmType: 0}
  3972. } else {
  3973. this.addForm = JSON.parse(JSON.stringify(row));
  3974. }
  3975. },
  3976. //获取客户列表
  3977. getCustomerList() {
  3978. this.http.post('/customer-info/getAll', {
  3979. },
  3980. res => {
  3981. if (res.code == "ok") {
  3982. this.customerList = res.data;
  3983. } else {
  3984. this.$message({
  3985. message: res.msg,
  3986. type: "error"
  3987. });
  3988. }
  3989. },
  3990. error => {
  3991. this.$message({
  3992. message: error,
  3993. type: "error"
  3994. });
  3995. });
  3996. },
  3997. importProjectBefore(){
  3998. this.paramData1 = false
  3999. this.importProjectBeforeDialog = true
  4000. },
  4001. importProject(item) {
  4002. //首先判断文件类型
  4003. let str = item.file.name.split(".");
  4004. let format = str[str.length - 1];
  4005. if (format != "xls" && format != "xlsx") {
  4006. this.$message({
  4007. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  4008. type: "error"
  4009. });
  4010. } else {
  4011. this.listLoading = true;
  4012. let formData = new FormData();
  4013. formData.append("file", item.file);
  4014. formData.append("userId", this.user.id);
  4015. formData.append('key',this.paramData1 ? 1 : 0)
  4016. this.http.uploadFile('/project/importData', formData,
  4017. res => {
  4018. this.$refs.upload.clearFiles();
  4019. this.listLoading = false;
  4020. if (res.code == "ok") {
  4021. // this.$message({
  4022. // message: res.data,
  4023. // type: "success"
  4024. // },5000);
  4025. //弹窗显示
  4026. this.showImportResult = true;
  4027. this.importProjectBeforeDialog = false
  4028. this.importResultMsg = res.data;
  4029. this.getList();
  4030. } else {
  4031. this.$message({
  4032. message: res.msg,
  4033. type: "error"
  4034. });
  4035. }
  4036. },
  4037. error => {
  4038. this.$refs.upload.clearFiles();
  4039. this.listLoading = false;
  4040. this.$message({
  4041. message: error,
  4042. type: "error"
  4043. });
  4044. });
  4045. }
  4046. },
  4047. number(){
  4048. //     this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
  4049. // this.addForm.budget = this.addForm.budget.replace('.','');
  4050. },
  4051. deleteSubPro(subProject) {
  4052. this.$confirm(this.$t('makesuretodeletethesubproject') + subProject.name + this.$t('ma'),this.$t('deletesubproject'), {
  4053. confirmButtonText: this.$t('btn.determine'),
  4054. cancelButtonText: this.$t('btn.cancel'),
  4055. type: "warning"
  4056. })
  4057. .then(() => {
  4058. this.listLoading = true;
  4059. this.http.post('/sub-project/deleteProject',{
  4060. id: subProject.id
  4061. },
  4062. res => {
  4063. this.listLoading = false;
  4064. if (res.code == "ok") {
  4065. this.$message({
  4066. message: this.$t('message.successfullyDeleted'),
  4067. type: "success"
  4068. });
  4069. this.subProject(this.currentProject);
  4070. } else {
  4071. this.$message({
  4072. message: res.msg,
  4073. type: "error"
  4074. });
  4075. }
  4076. },
  4077. error => {
  4078. this.listLoading = false;
  4079. this.$message({
  4080. message: error,
  4081. type: "error"
  4082. });
  4083. }
  4084. );
  4085. })
  4086. .catch(() => {});
  4087. },
  4088. searchList() {
  4089. this.page = 1;
  4090. this.getList();
  4091. },
  4092. addNewSubProject(subProject) {
  4093. if (subProject == null) {
  4094. this.temaddForm = {projectId: this.currentProject.id, level:1}
  4095. } else {
  4096. let aac = JSON.parse(JSON.stringify(subProject))
  4097. aac.status=aac.status==true?1:0
  4098. this.temaddForm = JSON.parse(JSON.stringify(aac));
  4099. }
  4100. this.addSubProject = true;
  4101. },
  4102. //显示子项目
  4103. subProject(item) {
  4104. this.subProjectVisible = true;
  4105. this.currentProject = item;
  4106. this.http.post('/sub-project/list', {
  4107. projectId: item.id
  4108. },
  4109. res => {
  4110. if (res.code == "ok") {
  4111. for(let i = 0; i < res.data.length; i++){
  4112. res.data[i].status=res.data[i].status==1?true:false
  4113. }
  4114. this.subProjectList = res.data
  4115. } else {
  4116. this.$message({
  4117. message: res.msg,
  4118. type: "error"
  4119. });
  4120. }
  4121. },
  4122. error => {
  4123. this.$message({
  4124. message: error,
  4125. type: "error"
  4126. });
  4127. });
  4128. },
  4129. //显示用户详情
  4130. showUser(userId) {
  4131. this.userDetailVisible = true;
  4132. this.http.post(this.port.manage.userDetail, {
  4133. userId: userId
  4134. },
  4135. res => {
  4136. if (res.code == "ok") {
  4137. this.userDetail = res.data;
  4138. } else {
  4139. this.$message({
  4140. message: res.msg,
  4141. type: "error"
  4142. });
  4143. }
  4144. },
  4145. error => {
  4146. this.$message({
  4147. message: error,
  4148. type: "error"
  4149. });
  4150. });
  4151. },
  4152. //选择参与人
  4153. changeParticipator() {
  4154. //检查是否在参与人中,如果没有需要加入到参与人中
  4155. // console.log('addform',this.addForm.userId,this.users);
  4156. this.participator = [];
  4157. this.addForm.userId.forEach(u=>{
  4158. var list = this.users.filter(au=>au.id == u);
  4159. if (list.length > 0) {
  4160. var findUser = list[0];
  4161. this.participator.push(findUser);
  4162. } else {
  4163. console.log('未找到用户: '+u);
  4164. }
  4165. })
  4166. },
  4167. getUsers() {
  4168. // this.http.post(this.port.manage.list, {
  4169. // departmentId: -1,
  4170. // pageIndex: 1,
  4171. // // pageSize: 99999
  4172. // pageSize: -1
  4173. // },
  4174. this.http.post('/user/getSimpleActiveUserList', {},
  4175. res => {
  4176. if (res.code == "ok") {
  4177. this.users = res.data;
  4178. } else {
  4179. this.$message({
  4180. message: res.msg,
  4181. type: "error"
  4182. });
  4183. }
  4184. },
  4185. error => {
  4186. this.$message({
  4187. message: error,
  4188. type: "error"
  4189. });
  4190. });
  4191. },
  4192. //分页
  4193. handleCurrentChange(val) {
  4194. this.page = val;
  4195. this.getList();
  4196. },
  4197. handleSizeChange(val) {
  4198. this.size = val;
  4199. localStorage.projectPageSize = this.size;
  4200. this.page = 1
  4201. this.getList();
  4202. },
  4203. participationSelect(){
  4204. this.page = 1
  4205. this.getList()
  4206. },
  4207. //获取项目列表
  4208. getList() {
  4209. localStorage.projectPageIndex = this.page;
  4210. this.listLoading = true;
  4211. let parameter = {
  4212. pageIndex: this.page,
  4213. pageSize: this.size,
  4214. keyword:this.keyword,
  4215. searchField: this.searchField,
  4216. status: this.status,
  4217. category: this.statusClf,
  4218. projectMainId: this.projectMainId,
  4219. inchagerId: this.inchagerId,
  4220. participation: this.participationId,
  4221. }
  4222. if(this.createDate) {
  4223. parameter.startDate = this.createDate[0]
  4224. parameter.endDate = this.createDate[1]
  4225. }
  4226. if(this.sortOrder){
  4227. if(this.sortProp == 'inchargerName'){
  4228. parameter.sortProp = "incharger_id"
  4229. }else if(this.sortProp == 'customerName'){
  4230. parameter.sortProp = "customer_id"
  4231. }else if(this.sortProp == 'projectCode'){
  4232. parameter.sortProp = 'project_code'
  4233. }else if(this.sortProp == 'categoryName'){
  4234. parameter.sortProp = 'category'
  4235. }else if(this.sortProp == 'projectName'){
  4236. parameter.sortProp = 'project_name'
  4237. }else if(this.sortProp == 'status'){
  4238. parameter.sortProp = 'status'
  4239. }else if(this.sortProp == 'currentStage'){
  4240. parameter.sortProp = 'current_stage_name'
  4241. }else if(this.sortProp == 'departmentName'){
  4242. parameter.sortProp = 'dept_id'
  4243. }else if(this.sortProp == 'associateDegreeNames'){
  4244. parameter.sortProp = 'associate_degrees'
  4245. }
  4246. if(this.sortOrder == 'descending'){
  4247. parameter.sortOrder = 0
  4248. }else if(this.sortOrder == 'ascending'){
  4249. parameter.sortOrder = 1
  4250. }
  4251. }
  4252. if(this.deptId.length > 0) {
  4253. parameter.deptId = this.deptId[this.deptId.length - 1]
  4254. } else {
  4255. parameter.deptId = ''
  4256. }
  4257. this.http.post(this.port.project.listPage, parameter,
  4258. res => {
  4259. this.listLoading = false;
  4260. if (res.code == "ok") {
  4261. var list = res.data.records;
  4262. for(var i in list) {
  4263. var participator = list[i].participator , str = "";
  4264. for(var j in participator) {
  4265. if(j == participator.length-1) {
  4266. str += participator[j].name
  4267. } else {
  4268. str += participator[j].name + ','
  4269. }
  4270. }
  4271. list[i].userNames = str;
  4272. }
  4273. this.centerNameDegree = res.data.degrees
  4274. this.showColumnWidth = this.showColumn(list)
  4275. this.list = list;
  4276. this.total = res.data.total;
  4277. // this.$nextTick(()=>{
  4278. // this.$refs.projectlistOfWudulist.doLayout();
  4279. // })
  4280. this.listHeader = res.data.nameList;
  4281. } else {
  4282. this.$message({
  4283. message: res.msg,
  4284. type: "error"
  4285. });
  4286. }
  4287. },
  4288. error => {
  4289. this.listLoading = false;
  4290. this.$message({
  4291. message: error,
  4292. type: "error"
  4293. });
  4294. });
  4295. },
  4296. showColumn(list){
  4297. if(!this.permissions.projectManagement){
  4298. let creat = false
  4299. let incha = false
  4300. for(let i in list){
  4301. if(this.user.id == list[i].creatorId){
  4302. creat = true
  4303. }
  4304. if(this.user.id == list[i].inchargerId){
  4305. incha = true
  4306. }
  4307. }
  4308. if(creat){
  4309. return '300'
  4310. }else {
  4311. if(incha){
  4312. return '210'
  4313. } else if (this.permissions.projectParticipator) {//编辑参与人权限
  4314. return '110'
  4315. } else {
  4316. return '0'
  4317. }
  4318. }
  4319. }else {
  4320. return '300'
  4321. }
  4322. },
  4323. // 合同金额发生改变,需弹出修改原因的输入框
  4324. contractAmountChange(value){
  4325. if(this.contractAmountOld != value){
  4326. this.contractAmountReasonShow = true
  4327. }else{
  4328. this.contractAmountReasonShow = false
  4329. this.addForm.changeContractReason = ''
  4330. }
  4331. },
  4332. // 处理数据
  4333. chulishuju(data) {
  4334. console.log(data, 12345)
  4335. console.log(this.dataListBf, '看看')
  4336. let arrLists = JSON.parse(JSON.stringify(this.dataListBf))
  4337. var arr = []
  4338. for(var s in arrLists) {
  4339. for(var p in data.plateMap) {
  4340. if(arrLists[s].customName == p && arrLists[s].customType != '1') {
  4341. arrLists[s].value = data.plateMap[p]
  4342. }
  4343. if(arrLists[s].customName == p && arrLists[s].customType == '1' && data.plateMap[p] != null && data.plateMap[p] != ''){
  4344. var sel = data.plateMap[p].split(',')
  4345. var live = []
  4346. for(var dd in sel) {
  4347. var obj = {}
  4348. obj.name = p
  4349. // obj.url = this.pictureAddress + '/upload/' + sel[dd]
  4350. obj.url = '/upload/' + sel[dd]
  4351. live.push(obj)
  4352. }
  4353. console.log('值值hi', this.pictureAddress)
  4354. arrLists[s].value = live
  4355. arrLists[s].valuelist = sel
  4356. }
  4357. }
  4358. }
  4359. this.dataList = arrLists
  4360. console.log(this.form, 9999)
  4361. console.log(this.dataList, 8888)
  4362. this.dialogVisible = true
  4363. },
  4364. //显示新增界面
  4365. handleAdd(i, item) {
  4366. this.canOnlyModParticipator = false;
  4367. this.projectManagerEdit = false
  4368. this.contractAmountReasonShow = false
  4369. if(i == -1) {
  4370. if(this.user.companyId == '936') {
  4371. this.isShowProjectName = false
  4372. }
  4373. this.title = this.$t('newproject');
  4374. this.addForm = {
  4375. name: '',
  4376. isPublic:0,
  4377. userId: [],
  4378. userNames:'',
  4379. code:'',
  4380. inchargerId:null,
  4381. level: this.user.timeType.projectLevelState == 1 ? (this.levelList.length > 0 ? this.levelList[0].id : null) : 1,
  4382. customerId:null,
  4383. notifyUserNames:'',
  4384. chosenLeaders:[],
  4385. category:null,
  4386. creatorId: this.user.id,
  4387. projectMainId: '',
  4388. outputValue: '',
  4389. bu: [],
  4390. manDay:0,
  4391. fromOutside: 0,
  4392. // deptId: []
  4393. }
  4394. this.estimatedWorkTime=''
  4395. for(var i in this.dataList) {
  4396. var str = 'plate' + (+i + 1)
  4397. this.$set(this.addForm,str, '')
  4398. }
  4399. if(this.user.timeType.projectWithDept) {
  4400. this.$set(this.addForm, 'deptId', [])
  4401. }
  4402. if(this.user.companyId == '936') {
  4403. this.$set(this.addForm, 'contractCode', '')
  4404. this.$set(this.addForm, 'warrantyStartDate', '')
  4405. this.$set(this.addForm, 'warrantyEndDate', '')
  4406. this.$set(this.addForm, 'projectCategorySub', '')
  4407. this.$set(this.addForm, 'region', '')
  4408. this.$set(this.addForm, 'bu', '')
  4409. }
  4410. if(this.user.timeType.projectManDay){
  4411. this.$set(this.addForm, 'manDay',0)
  4412. this.$set(this.addForm, 'manDayStartDate','')
  4413. }
  4414. // if(this.user.companyId == '428') {
  4415. // this.$set(this.addForm, 'projectCategorySub', '')
  4416. // }
  4417. this.projectBaseCostData = [];
  4418. this.auseList = [];
  4419. for (var m=0;m<this.baseCostItemList.length; m++) {
  4420. this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
  4421. }
  4422. // 关键节点
  4423. if(this.user.companyId == '936') {
  4424. this.projectKeyNodesData = []
  4425. for (var m=0;m<this.keyNodesList.length; m++) {
  4426. this.projectKeyNodesData.push({nodesId: this.keyNodesList[m].id, nodesName:this.keyNodesList[m].name, planCompleteDate: null, actualCompleteDate: null, states: '0'});
  4427. }
  4428. // console.log(this.projectKeyNodesData, '节点值')
  4429. }
  4430. } else {
  4431. console.log('点击来编辑执行')
  4432. const usersJson = JSON.parse(sessionStorage.getItem("user"))
  4433. if(usersJson.companyId == '936') {
  4434. if(usersJson.roleName != '超级管理员' && usersJson.roleName != '系统管理员') {
  4435. this.isShowProjectName = true
  4436. } else {
  4437. this.isShowProjectName = false
  4438. }
  4439. }
  4440. console.log(this.isShowProjectName, '看看值')
  4441. this.http.post('/project/detailTwo', {id: item.id},
  4442. res => {
  4443. if (res.code == "ok") {
  4444. this.chulishuju(res.data)
  4445. this.estimatedWorkTime=res.data.estimatedWorkTime==null?0:res.data.estimatedWorkTime
  4446. }
  4447. });
  4448. //编辑时,非 (管理全部项目,项目创建人,项目经理),有编辑项目参与人权限的人,可以进行参与人的修改
  4449. if (!(this.permissions.projectManagement || this.user.id==item.inchargerId || this.user.id == item.creatorId) && this.permissions.projectParticipator) {
  4450. this.canOnlyModParticipator = true;
  4451. }
  4452. if(this.permissions.projectManagement || this.user.id == item.creatorId) {
  4453. this.projectManagerEdit = false
  4454. } else {
  4455. this.projectManagerEdit = true
  4456. }
  4457. this.title = this.$t('modifytheproject');
  4458. var list = item.participator;
  4459. if (item.isPublic == 1) {
  4460. list = this.users;
  4461. }
  4462. var arr = [];
  4463. var names = '';
  4464. let namesLiss = [] // 企业微信用到的参与者
  4465. for(var j in list) {
  4466. arr.push(list[j].id)
  4467. names += list[j].name+',';
  4468. namesLiss.push(list[j].name)
  4469. }
  4470. if (names.length > 0) {
  4471. names = names.substring(0, names.length -1);
  4472. }
  4473. this.addFormUserNames = namesLiss
  4474. var listList = JSON.parse(JSON.stringify(item)),
  4475. arrList = [],
  4476. array = [];
  4477. if (listList.deptCascade != "0" && listList.deptCascade != null) {
  4478. if (listList.deptCascade.indexOf(",") > -1) {
  4479. arrList = listList.deptCascade.split(",");
  4480. } else {
  4481. arrList = [].concat(listList.deptCascade);
  4482. }
  4483. }
  4484. for (var i in arrList) {
  4485. array.push(parseInt(arrList[i]));
  4486. }
  4487. let buascaderList = []
  4488. if(item.buId) {
  4489. let buArrList = item.buId.split(',')
  4490. for(var i in buArrList) {
  4491. buArrList[i] = +buArrList[i]
  4492. }
  4493. buascaderList = buArrList
  4494. }
  4495. // console.log(array, '转换', listList)
  4496. this.addForm = {
  4497. id: item.id,
  4498. name: item.projectName,
  4499. isPublic: item.isPublic,
  4500. userId: arr,
  4501. userNames:names,
  4502. code:item.projectCode,
  4503. inchargerId: item.inchargerId,
  4504. level: item.level,
  4505. planStartDate: item.planStartDate,
  4506. planEndDate: item.planEndDate,
  4507. budget: item.budget,
  4508. baseMan: item.baseMan,
  4509. contractAmount: item.contractAmount,
  4510. baseFee: item.baseFee,
  4511. baseRisk1: item.baseRisk1,
  4512. baseRisk2: item.baseRisk2,
  4513. baseOutsourcing: item.baseOutsourcing,
  4514. customerId:item.customerId==0?null:item.customerId,
  4515. category:item.category,
  4516. projectDesc: item.projectDesc,
  4517. projectMainId: item.projectMainId,
  4518. creatorId: item.creatorId,
  4519. outputValue: item.outputValue,
  4520. // deptId: array.reverse(),
  4521. changeContractReason: '',
  4522. bu: buascaderList,
  4523. manDay:item.manDay==null?0:item.manDay,
  4524. manDayStartDate:item.manDayStartDate,
  4525. manDayDisable:item.manDay,
  4526. fromOutside:item.fromOutside
  4527. }
  4528. for(var i in this.dataList) {
  4529. var str = 'plate' + (+i + 1)
  4530. if(this.dataList[i].customType != '1') {
  4531. this.$set(this.addForm,str, this.dataList[i].value==null?'':this.dataList[i].value)
  4532. } else {
  4533. this.$set(this.addForm,str,this.dataList[i].valuelist.join('@'))
  4534. }
  4535. }
  4536. this.contractAmountOld = item.contractAmount ? item.contractAmount : 0
  4537. // console.log(this.addForm, '数据')
  4538. if(this.user.timeType.projectWithDept) {
  4539. this.$set(this.addForm, 'deptId', array.reverse())
  4540. }
  4541. // 判断公司id是否等于936
  4542. if(this.user.companyId == '936') {
  4543. if(item.projectSeparate) {
  4544. this.$set(this.addForm, 'contractCode', item.projectSeparate.contractCode)
  4545. this.$set(this.addForm, 'warrantyStartDate', item.projectSeparate.warrantyStartDate)
  4546. this.$set(this.addForm, 'warrantyEndDate', item.projectSeparate.warrantyEndDate)
  4547. this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
  4548. this.$set(this.addForm, 'region', item.projectSeparate.region)
  4549. this.$set(this.addForm, 'bu', item.projectSeparate.bu)
  4550. } else {
  4551. this.$set(this.addForm, 'contractCode', '')
  4552. this.$set(this.addForm, 'warrantyStartDate', '')
  4553. this.$set(this.addForm, 'warrantyEndDate', '')
  4554. this.$set(this.addForm, 'projectCategorySub', '')
  4555. this.$set(this.addForm, 'region', '')
  4556. this.$set(this.addForm, 'bu', '')
  4557. }
  4558. }
  4559. // if(this.user.companyId == '428') {
  4560. // if(item.projectSeparate) {
  4561. // this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
  4562. // } else {
  4563. // this.$set(this.addForm, 'projectCategorySub', '')
  4564. // }
  4565. // }
  4566. // 判断是否有供应商
  4567. if(this.user.company.packageProvider) {
  4568. // this.addForm.supplierId = item.providerIds.split(',')
  4569. if(item.providerIds) {
  4570. let arr = []
  4571. let zhhi = item.providerIds.split(',')
  4572. for(let i in zhhi) {
  4573. arr.push(+zhhi[i] + 0)
  4574. }
  4575. this.$set(this.addForm, 'supplierId', arr)
  4576. // console.log( this.addForm.supplierId)
  4577. } else {
  4578. this.$set(this.addForm, 'supplierId', [])
  4579. }
  4580. }
  4581. // 判断是否有供应商结尾
  4582. this.deleteVif = item.creatorId
  4583. // console.log("handleadd",this.deleteVif,this.addForm)
  4584. if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
  4585. var spli = item.associateDegrees.split(',')
  4586. var sl = []
  4587. for(var i in spli) {
  4588. var num = +spli[i] + 0
  4589. sl.push(num)
  4590. }
  4591. this.auseList = sl
  4592. // console.log(this.auseList)
  4593. } else {
  4594. this.auseList = []
  4595. }
  4596. // var spli = item.associateDegrees.split(',')
  4597. // var sl = []
  4598. // for(var i in spli) {
  4599. // var num = +spli[i] + 0
  4600. // sl.push(num)
  4601. // }
  4602. // this.auseList = sl
  4603. // console.log(this.auseList)
  4604. this.changeParticipator();
  4605. this.getProjectBaseData(item.id);
  4606. this.getProjectKeyNodeData(item.id)
  4607. if (this.user.company.packageEngineering == 1) {
  4608. this.getProjectProfessions(item.id);
  4609. }
  4610. //获取项目的相关领导
  4611. // this.getProjectNotifyUserList(item.id);
  4612. this.getProjectAutorList(item.id);
  4613. if (this.user.timeType.reportCc == 1) {
  4614. this.getProjectCcUserList(item.id);
  4615. }
  4616. // this.findUserInTree()
  4617. }
  4618. this.addFormVisible = true;
  4619. if (this.user.timeType.projectManDay == 1) {
  4620. this.getManDaySetting();
  4621. }
  4622. if (this.user.company.packageEngineering == 1) {
  4623. if (this.professionList.length == 0) {
  4624. this.getProfessionList();
  4625. }
  4626. }
  4627. },
  4628. //获取项目日报抄送人
  4629. getProjectCcUserList(projectId) {
  4630. this.http.post('/project-ccuser/getList',{projectId: projectId},
  4631. res => {
  4632. if (res.code == "ok") {
  4633. this.addForm.ccUserIds = res.data.map(function(item) {
  4634. return item.userId;
  4635. });
  4636. this.$forceUpdate()
  4637. } else {
  4638. this.$message({
  4639. message: res.msg,
  4640. type: "error"
  4641. });
  4642. }
  4643. },
  4644. error => {
  4645. this.listLoading = false;
  4646. this.$message({
  4647. message: error,
  4648. type: "error"
  4649. });
  4650. }
  4651. );
  4652. },
  4653. //获取项目审核人
  4654. getProjectAutorList(projectId) {
  4655. this.http.post('/project-auditor/getList',{projectId: projectId},
  4656. res => {
  4657. if (res.code == "ok") {
  4658. if (this.user.timeType.reportAuditType == 6) {
  4659. //单个日报审核人,单选
  4660. var arr = res.data.map(function(item) {
  4661. return item.auditorId;
  4662. });
  4663. if (arr.length > 0) {
  4664. this.addForm.auditUserIds = arr[0];
  4665. } else {
  4666. this.addForm.auditUserIds = null;
  4667. }
  4668. } else {
  4669. this.addForm.auditUserIds = res.data.map(function(item) {
  4670. return item.auditorId;
  4671. });
  4672. }
  4673. this.$forceUpdate()
  4674. } else {
  4675. this.$message({
  4676. message: res.msg,
  4677. type: "error"
  4678. });
  4679. }
  4680. },
  4681. error => {
  4682. this.listLoading = false;
  4683. this.$message({
  4684. message: error,
  4685. type: "error"
  4686. });
  4687. }
  4688. );
  4689. },
  4690. getProjectBaseData(projectId) {
  4691. this.http.post('/project-basecost/get',{projectId: projectId},
  4692. res => {
  4693. if (res.code == "ok") {
  4694. this.projectBaseCostData = res.data;
  4695. } else {
  4696. this.$message({
  4697. message: res.msg,
  4698. type: "error"
  4699. });
  4700. }
  4701. },
  4702. error => {
  4703. this.listLoading = false;
  4704. this.$message({
  4705. message: error,
  4706. type: "error"
  4707. });
  4708. }
  4709. );
  4710. },
  4711. getProjectKeyNodeData(projectId) {
  4712. this.http.post('/project-key-nodes/get',{projectId: projectId},
  4713. res => {
  4714. if (res.code == "ok") {
  4715. this.projectKeyNodesData = res.data;
  4716. } else {
  4717. this.$message({
  4718. message: res.msg,
  4719. type: "error"
  4720. });
  4721. }
  4722. },
  4723. error => {
  4724. this.listLoading = false;
  4725. this.$message({
  4726. message: error,
  4727. type: "error"
  4728. });
  4729. }
  4730. );
  4731. },
  4732. //提交子项目创建修改请求
  4733. submitInsertSubProject () {
  4734. this.$refs.form2.validate(valid => {
  4735. if (valid) {
  4736. this.http.post('/sub-project/saveOrUpdate',this.temaddForm,
  4737. res => {
  4738. if (res.code == "ok") {
  4739. this.$message({
  4740. message: this.$t('operationissuccessful'),
  4741. type: "success"
  4742. });
  4743. this.subProject(this.currentProject);
  4744. this.addSubProject = false;
  4745. } else {
  4746. this.$message({
  4747. message: res.msg,
  4748. type: "error"
  4749. });
  4750. }
  4751. },
  4752. error => {
  4753. this.listLoading = false;
  4754. this.$message({
  4755. message: error,
  4756. type: "error"
  4757. });
  4758. }
  4759. );
  4760. }
  4761. });
  4762. },
  4763. // 项目基线合计
  4764. addUpfun() {
  4765. var total = 0;
  4766. for (var i=0;i<this.projectBaseCostData.length; i++) {
  4767. if (this.projectBaseCostData[i].baseAmount) {
  4768. total += parseFloat(this.projectBaseCostData[i].baseAmount);
  4769. }
  4770. }
  4771. this.addForm.budget = total;
  4772. // var a = '0'
  4773. // var q = '0'
  4774. // var w = '0'
  4775. // var e = '0'
  4776. // var r = '0'
  4777. // // this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
  4778. // if (this.addForm.baseMan == undefined || this.addForm.baseMan == NaN) {
  4779. // a = 0
  4780. // } else {
  4781. // a = this.addForm.baseMan
  4782. // }
  4783. // if (this.addForm.baseFee !== undefined) q = this.addForm.baseFee
  4784. // if (this.addForm.baseOutsourcing !== undefined) w = this.addForm.baseOutsourcing
  4785. // if (this.addForm.baseRisk1 !== undefined) e = this.addForm.baseRisk1
  4786. // if (this.addForm.baseRisk2 !== undefined) r = this.addForm.baseRisk2
  4787. // this.addForm.budget = +a + +q + +w + +e + +r
  4788. },
  4789. submitInsert() {
  4790. this.$refs.form1.validate(valid => {
  4791. if (valid) {
  4792. if (this.user.company.packageEngineering == 1) {
  4793. if (!this.checkProjectProfession()) {//检查不通过,直接返回
  4794. return;
  4795. }
  4796. }
  4797. this.addLoading = true;
  4798. let formData = new FormData();
  4799. formData.append("name", this.addForm.name);
  4800. if(this.addForm.projectDesc != null) {
  4801. formData.append("projectDesc", this.addForm.projectDesc);
  4802. }
  4803. if(this.addForm.id != null) {
  4804. formData.append("id", this.addForm.id);
  4805. }
  4806. if(this.addForm.isPublic != null) {
  4807. formData.append("isPublic", this.addForm.isPublic);
  4808. }
  4809. if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
  4810. for(var j in this.addForm.userId) {
  4811. formData.append("userId", this.addForm.userId[j]);
  4812. }
  4813. }
  4814. if(this.addForm.inchargerId != null) {
  4815. formData.append("inchargerId", this.addForm.inchargerId);
  4816. }
  4817. if(this.addForm.code != null) {
  4818. formData.append("code", this.addForm.code);
  4819. }
  4820. if(this.addForm.planStartDate != null) {
  4821. formData.append("planStartDate", this.addForm.planStartDate);
  4822. }
  4823. if(this.addForm.planEndDate != null) {
  4824. formData.append("planEndDate", this.addForm.planEndDate);
  4825. }
  4826. if(this.addForm.level != null) {
  4827. formData.append("level", this.addForm.level);
  4828. }
  4829. if(this.addForm.contractAmount != null) {
  4830. formData.append("contractAmount", this.addForm.contractAmount);
  4831. }
  4832. if(this.contractAmountReasonShow){
  4833. formData.append("changeContractReason", this.addForm.changeContractReason);
  4834. }
  4835. if (this.projectBaseCostData != null) {
  4836. formData.append("projectBaseCostData", JSON.stringify(this.projectBaseCostData));
  4837. //计算总预算成本
  4838. if (this.addForm.budget == null) {
  4839. this.addForm.budget = 0;
  4840. }
  4841. formData.append("budget", this.addForm.budget);
  4842. }
  4843. if (this.addForm.customerId == null) {
  4844. formData.append("customerId", 0);
  4845. } else {
  4846. formData.append("customerId", this.addForm.customerId);
  4847. }
  4848. if (this.addForm.contractAmount) {
  4849. formData.append("contractAmount", this.addForm.contractAmount);
  4850. } else {
  4851. formData.append("contractAmount", 0);
  4852. }
  4853. if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
  4854. formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
  4855. }
  4856. if (this.user.timeType.outputValueStatus == 1){
  4857. formData.append("outputValue",this.addForm.outputValue ? this.addForm.outputValue : 0)
  4858. }
  4859. var listId = []
  4860. var listName = []
  4861. for(var i in this.auseList) {
  4862. for(var j in this.ause) {
  4863. if(this.auseList[i] == this.ause[j].id) {
  4864. listId.push(this.ause[j].id);
  4865. listName.push(this.ause[j].name);
  4866. break;
  4867. }
  4868. }
  4869. }
  4870. listId.toString()
  4871. listName.toString()
  4872. formData.append("associateDegrees", listId)
  4873. formData.append("associateDegreeNames", listName)
  4874. //日报审核人
  4875. if (this.addForm.auditUserIds) {
  4876. if (this.user.timeType.reportAuditType == 6) {
  4877. formData.append("auditUserIds", this.addForm.auditUserIds);
  4878. } else {
  4879. formData.append("auditUserIds", JSON.stringify(this.addForm.auditUserIds));
  4880. }
  4881. }
  4882. //日报抄送人
  4883. if (this.addForm.ccUserIds) {
  4884. formData.append("ccUserIds", JSON.stringify(this.addForm.ccUserIds));
  4885. }
  4886. if(this.addForm.category != null) {
  4887. formData.append("category", this.addForm.category);
  4888. }
  4889. if(this.user.timeType.mainProjectState == '1' && this.addForm.projectMainId) {
  4890. formData.append("projectMainId", this.addForm.projectMainId);
  4891. }
  4892. // 提交供应商
  4893. // 线判断是否有供应商
  4894. if(this.user.company.packageProvider) {
  4895. let suppStrName = []
  4896. for(let is in this.addForm.supplierId) {
  4897. for(let js in this.supplierList) {
  4898. if(this.addForm.supplierId[is] == this.supplierList[js].id) {
  4899. suppStrName.push(this.supplierList[js].providerName)
  4900. }
  4901. }
  4902. }
  4903. formData.append("providerNames", suppStrName.toString());
  4904. formData.append("providerIds", this.addForm.supplierId.toString());
  4905. }
  4906. // 判断公司id是否等于 936
  4907. if(this.user.companyId == '936') {
  4908. formData.append("contractCode", this.addForm.contractCode ? this.addForm.contractCode : '');
  4909. formData.append("warrantyStartDate", this.addForm.warrantyStartDate ? this.addForm.warrantyStartDate : '');
  4910. formData.append("warrantyEndDate", this.addForm.warrantyEndDate ? this.addForm.warrantyEndDate : '');
  4911. formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
  4912. formData.append("region", this.addForm.region ? this.addForm.region : '');
  4913. // 关键节点
  4914. formData.append("projectKeyNodesData", JSON.stringify(this.projectKeyNodesData));
  4915. }
  4916. // if(this.user.companyId == '428') {
  4917. // formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
  4918. // }
  4919. if(this.user.timeType.projectWithDept) {
  4920. if(this.addForm.deptId != null && this.addForm.deptId != '') {
  4921. formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
  4922. }
  4923. }
  4924. formData.append("buId", this.addForm.bu ? this.addForm.bu : '');
  4925. if(this.user.timeType.projectManDay){
  4926. //检验预估人天的必填属性
  4927. if (this.manDaySetting.projectManDayFillMode == 2 || (this.manDaySetting.projectManDayFillMode == 1 && this.addForm.fromOutside == 0)) {
  4928. if (!this.addForm.manDay) {
  4929. this.$message({
  4930. message: '预估工时不能为0',
  4931. type: "error"
  4932. });
  4933. this.addLoading = false;
  4934. return;
  4935. }
  4936. }
  4937. formData.append("manDay", this.addForm.manDay ? this.addForm.manDay : '');
  4938. formData.append("manDayStartDate", this.addForm.manDayStartDate ? this.addForm.manDayStartDate : '');
  4939. }
  4940. for(var i in this.dataList) {
  4941. var str = 'plate' + (+i + 1)
  4942. if(this.dataList[i].customType != '1') {
  4943. formData.append(str,this.dataList[i].value==null?'':this.dataList[i].value);
  4944. } else {
  4945. formData.append(str,this.dataList[i].valuelist.join('@'));
  4946. }
  4947. }
  4948. // formData.append("associateDegreeNames", listName)
  4949. //console.log("addform",this.addForm);
  4950. //return
  4951. this.http.uploadFile(this.port.project.add,formData,
  4952. res => {
  4953. this.addLoading = false;
  4954. if (res.code == "ok") {
  4955. this.$message({
  4956. message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
  4957. type: "success"
  4958. });
  4959. this.addFormVisible = false;
  4960. this.getList();
  4961. if (this.user.company.packageEngineering == 1) {
  4962. this.saveProjectProfessions(res.data);
  4963. }
  4964. } else {
  4965. this.$message({
  4966. message: res.msg,
  4967. type: "error"
  4968. });
  4969. }
  4970. },
  4971. error => {
  4972. this.addLoading = false;
  4973. this.$message({
  4974. message: error,
  4975. type: "error"
  4976. });
  4977. });
  4978. }
  4979. });
  4980. },
  4981. cascaderChange(e) {
  4982. // console.log(e)
  4983. // console.log(this.addForm)
  4984. // if(e.length )
  4985. // console.log(e)
  4986. },
  4987. // 删除
  4988. deletePro(i, item) {
  4989. this.$confirm(this.$t('makesuretodeletetheitem')+"[" + item.name + "]"+this.$t('ma'),this.$t('deletetheproject'), {
  4990. confirmButtonText: this.$t('btn.determine'),
  4991. cancelButtonText: this.$t('btn.cancel'),
  4992. type: "warning"
  4993. })
  4994. .then(() => {
  4995. this.listLoading = true;
  4996. this.http.post(this.port.project.delete,{
  4997. id: item.id
  4998. },
  4999. res => {
  5000. this.listLoading = false;
  5001. if (res.code == "ok") {
  5002. this.$message({
  5003. message: this.$t('message.successfullyDeleted'),
  5004. type: "success"
  5005. });
  5006. this.getList();
  5007. this.addFormVisible = false
  5008. } else if (res.code == 'reconfirm') {
  5009. this.deleteAlertMsg = res.msg;
  5010. this.forceDeletePro(item.id);
  5011. } else {
  5012. this.$message({
  5013. message: res.msg,
  5014. type: "error"
  5015. });
  5016. }
  5017. },
  5018. error => {
  5019. this.listLoading = false;
  5020. this.$message({
  5021. message: error,
  5022. type: "error"
  5023. });
  5024. }
  5025. );
  5026. })
  5027. .catch(() => {});
  5028. },
  5029. // 模板下载
  5030. downloadmb(){
  5031. this.http.post('/project/getTemplate',{
  5032. companyId: this.user.companyId
  5033. },res => {
  5034. if(res.code == 'ok'){
  5035. var filePath = res.data;
  5036. const a = document.createElement('a'); // 创建a标签
  5037. var fileName = filePath.split('/')[2];
  5038. a.setAttribute('download', fileName);// download属性
  5039. a.setAttribute('href', filePath);// href链接
  5040. a.click(); //自执行点击事件
  5041. a.remove();
  5042. }else{
  5043. this.$message({
  5044. message: res.msg,
  5045. type: 'error'
  5046. })
  5047. }
  5048. },err => {
  5049. this.$message({
  5050. message: err,
  5051. type: 'error'
  5052. })
  5053. })
  5054. },
  5055. //强制删除项目
  5056. forceDeletePro(deleteProId) {
  5057. this.$confirm(this.deleteAlertMsg,this.$t('deletetheproject'), {
  5058. confirmButtonText: this.$t('btn.determine'),
  5059. cancelButtonText: this.$t('btn.cancel'),
  5060. type: "warning"
  5061. })
  5062. .then(() => {
  5063. this.listLoading = true;
  5064. this.http.post(this.port.project.delete,{
  5065. id: deleteProId ,force:1
  5066. },
  5067. res => {
  5068. this.listLoading = false;
  5069. if (res.code == "ok") {
  5070. this.$message({
  5071. message: this.$t('message.successfullyDeleted'),
  5072. type: "success"
  5073. });
  5074. this.getList();
  5075. this.addFormVisible = false;
  5076. } else {
  5077. this.$message({
  5078. message: res.msg,
  5079. type: "error"
  5080. });
  5081. }
  5082. },
  5083. error => {
  5084. this.listLoading = false;
  5085. this.$message({
  5086. message: error,
  5087. type: "error"
  5088. });
  5089. }
  5090. );
  5091. })
  5092. .catch(() => {});
  5093. },
  5094. detail(i) {
  5095. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  5096. },
  5097. // 获取部门
  5098. getDepartmentList() {
  5099. this.http.post( this.port.manage.depList, {},
  5100. res => {
  5101. if (res.code == "ok") {
  5102. let dptlist = JSON.parse(JSON.stringify(res.data));
  5103. this.departmentList = this.changeArr(dptlist);
  5104. } else {
  5105. this.$message({
  5106. message: res.msg,
  5107. type: "error"
  5108. });
  5109. }
  5110. },error => {
  5111. this.$message({
  5112. message: error,
  5113. type: "error"
  5114. });
  5115. });
  5116. },
  5117. changeArr(arr) {
  5118. for (var i = 0; i < arr.length; i++) {
  5119. if(arr[i].id != -1 && arr[i].id != 0) {
  5120. if (arr[i].children != null && arr[i].children.length>0) {
  5121. arr[i].children = this.changeArr(arr[i].children);
  5122. }
  5123. arr[i].id && (arr[i].value = arr[i].id);
  5124. delete arr[i].id;
  5125. }
  5126. }
  5127. for(var i in arr) {
  5128. if(arr[i].id == -1 || arr[i].id == 0) {
  5129. arr.splice(i,1)
  5130. }
  5131. }
  5132. return arr;
  5133. },
  5134. // 自定义组件事件
  5135. selectCal(obj) {
  5136. if(obj.distinction == '1') {
  5137. this.inchagerId = obj.id
  5138. this.manageSelect()
  5139. } else if(obj.distinction == '2') {
  5140. this.participationId = obj.id
  5141. this.participationSelect()
  5142. } else if(obj.distinction == '3') {
  5143. this.addForm.inchargerId = obj.id
  5144. // console.log(this.participator)
  5145. this.participator = JSON.parse(JSON.stringify(this.participator))
  5146. } else if(obj.distinction =='4') {
  5147. this.projectProfessionList[obj.other].inchargerId = obj.id
  5148. } else if(obj.distinction =='5') {
  5149. this.paramInchargerId = obj.id
  5150. } else if(obj.distinction == '10') {
  5151. let userList = obj.arrUserList
  5152. let arr = []
  5153. for(var i in userList) {
  5154. arr.push(userList[i].id)
  5155. }
  5156. this.participator = JSON.parse(JSON.stringify(this.participator))
  5157. this.addForm.auditUserIds = arr
  5158. } else if(obj.distinction == '11') {
  5159. let userList = obj.id
  5160. console.log(obj)
  5161. this.curProfessionRow.membList[obj.other].membId = userList
  5162. }
  5163. },
  5164. vueCasader(obj) {
  5165. if(obj.distinction == '32') {
  5166. let arr = []
  5167. arr.push(obj.id)
  5168. this.addForm.bu = arr.join(",")
  5169. }
  5170. },
  5171. changSubStatus(subProject) {
  5172. this.http.post('/sub-project/updateStatus',{
  5173. id: subProject.id,
  5174. status: subProject.status?1:0
  5175. },
  5176. res => {
  5177. this.listLoading = false;
  5178. if (res.code == "ok") {
  5179. this.$message({
  5180. message: subProject.status?"开启成功":"关闭成功",
  5181. type: "success"
  5182. });
  5183. this.subProject(this.currentProject);
  5184. } else {
  5185. this.$message({
  5186. message: res.msg,
  5187. type: "error"
  5188. });
  5189. }
  5190. },
  5191. error => {
  5192. this.$message({
  5193. message: error,
  5194. type: "error"
  5195. });
  5196. }
  5197. );
  5198. },
  5199. //计算预估工时
  5200. jisuanEstimatedWorkTime(manDay){
  5201. this.estimatedWorkTime=manDay*this.user.timeType.allday
  5202. },
  5203. //点击添加
  5204. addFunctional(type){
  5205. if(type=="functional"){
  5206. this.functionalList.push({
  5207. "id":null,
  5208. 'timeType': '项目工时',
  5209. 'role': 'CRC&LM',
  5210. 'jobRespon': '',
  5211. "companyId":this.user.companyId,
  5212. 'editFlag': true, // 可编辑标识
  5213. 'isSubmit': 0, // 是否点击确定标识
  5214. })
  5215. }else if(type=="workContext"){
  5216. this.workContextList.push({
  5217. "id":null,
  5218. "proFunId":this.functionalId,
  5219. 'workContext':null,
  5220. 'editFlag': true, // 可编辑标识
  5221. 'isSubmit': 0, // 是否点击确定标识
  5222. })
  5223. }
  5224. },
  5225. // 确定
  5226. functionalSubmit(row){
  5227. row.editFlag = false
  5228. row.isSubmit = 1
  5229. },
  5230. // 取消
  5231. functionalCancel(row, index,type){
  5232. row.editFlag = false
  5233. if (row.isSubmit) {
  5234. if(type=="functional"){
  5235. // this.functionalList[index]=this.oldValue
  5236. this.$set(this.functionalList,index,this.oldValue);
  5237. }else if(type=="workContext"){
  5238. this.workContextList[index] = this.oldValue
  5239. }
  5240. }
  5241. else if(!row.id){
  5242. if(type=="functional"){
  5243. this.functionalDelVersion(row,index);
  5244. }else if(type=="workContext"){
  5245. this.workContextDelVersion(row,index);
  5246. }
  5247. }
  5248. },
  5249. // 编辑
  5250. functionalEditVersion(row){
  5251. // v.value = JSON.parse(JSON.stringify(row));
  5252. this.oldValue= Object.assign({}, row);;
  5253. console.log("row",row,"old",this.oldValue)
  5254. row.editFlag = true;
  5255. },
  5256. // 删除
  5257. functionalDelVersion (row,index){
  5258. console.log("index",index,'row',row)
  5259. if(row.id==null){
  5260. this.functionalList.splice(index, 1)
  5261. return
  5262. }
  5263. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  5264. confirmButtonText: '确定',
  5265. cancelButtonText: '取消',
  5266. type: 'warning'
  5267. }).then(() => {
  5268. this.functionalList.splice(index, 1)
  5269. this.http.post('/project/deleteFunctionalDivision',{
  5270. id:row.id,
  5271. },
  5272. res => {
  5273. if (res.code == "ok") {
  5274. this.$message({
  5275. message: '删除成功',
  5276. type: "success"
  5277. });
  5278. } else {
  5279. this.$message({
  5280. message: res.msg,
  5281. type: "error"
  5282. });
  5283. }
  5284. },
  5285. error => {
  5286. this.$message({
  5287. message: error,
  5288. type: "error"
  5289. });
  5290. }
  5291. );
  5292. }).catch(() => {
  5293. this.$message({
  5294. type: 'info',
  5295. message: '已取消删除'
  5296. });
  5297. });
  5298. },
  5299. // 删除
  5300. workContextDelVersion (row,index){
  5301. if(row.id==null){
  5302. this.workContextList.splice(index, 1)
  5303. return
  5304. }
  5305. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  5306. confirmButtonText: '确定',
  5307. cancelButtonText: '取消',
  5308. type: 'warning'
  5309. }).then(() => {
  5310. this.workContextList.splice(index, 1)
  5311. this.http.post('/project/deleteFunWorkContext',{
  5312. id:row.id,
  5313. },
  5314. res => {
  5315. if (res.code == "ok") {
  5316. this.$message({
  5317. message: '删除成功',
  5318. type: "success"
  5319. });
  5320. } else {
  5321. this.$message({
  5322. message: res.msg,
  5323. type: "error"
  5324. });
  5325. }
  5326. },
  5327. error => {
  5328. this.$message({
  5329. message: error,
  5330. type: "error"
  5331. });
  5332. }
  5333. );
  5334. }).catch(() => {
  5335. this.$message({
  5336. type: 'info',
  5337. message: '已取消删除'
  5338. });
  5339. });
  5340. },
  5341. //保存职能分工
  5342. submitFunctional(){
  5343. this.http.post('/project/editFunctionalDivision',{
  5344. json:JSON.stringify(this.functionalList),
  5345. },
  5346. res => {
  5347. if (res.code == "ok") {
  5348. this.$message({
  5349. message: '操作成功',
  5350. type: "success"
  5351. });
  5352. this.getFunctionalList()
  5353. } else {
  5354. this.$message({
  5355. message: res.msg,
  5356. type: "error"
  5357. });
  5358. }
  5359. },
  5360. error => {
  5361. this.$message({
  5362. message: error,
  5363. type: "error"
  5364. });
  5365. }
  5366. );
  5367. },
  5368. //保存工作内容
  5369. submitWorkContext(){
  5370. for(var index in this.workContextList){
  5371. if(!this.workContextList[index].workContext){
  5372. this.$message({
  5373. message: "请填写工作内容",
  5374. type: "error"
  5375. });
  5376. return
  5377. }
  5378. }
  5379. this.http.post('/project/editFunWorkContext',{
  5380. json:JSON.stringify(this.workContextList),
  5381. },
  5382. res => {
  5383. if (res.code == "ok") {
  5384. this.$message({
  5385. message: '操作成功',
  5386. type: "success"
  5387. });
  5388. // this.workContextDig = false
  5389. this.getWorkContextList()
  5390. } else {
  5391. this.$message({
  5392. message: res.msg,
  5393. type: "error"
  5394. });
  5395. }
  5396. },
  5397. error => {
  5398. this.$message({
  5399. message: error,
  5400. type: "error"
  5401. });
  5402. }
  5403. );
  5404. },
  5405. //获取职能列表
  5406. getFunctionalList(){
  5407. this.http.post('/project/getFunctionalDivisionList',{},
  5408. res => {
  5409. if (res.code == "ok") {
  5410. this.functionalList=res.data
  5411. } else {
  5412. this.$message({
  5413. message: res.msg,
  5414. type: "error"
  5415. });
  5416. }
  5417. },
  5418. error => {
  5419. this.$message({
  5420. message: error,
  5421. type: "error"
  5422. });
  5423. }
  5424. );
  5425. },
  5426. //获取工作内容
  5427. getWorkContextList(item){
  5428. if(item){
  5429. this.functionalId=item
  5430. }
  5431. this.http.post('/project/getFunWorkContextList',{
  5432. id:this.functionalId
  5433. },
  5434. res => {
  5435. if (res.code == "ok") {
  5436. this.workContextList=res.data
  5437. } else {
  5438. this.$message({
  5439. message: res.msg,
  5440. type: "error"
  5441. });
  5442. }
  5443. },
  5444. error => {
  5445. this.$message({
  5446. message: error,
  5447. type: "error"
  5448. });
  5449. }
  5450. );
  5451. },
  5452. //获取角色列表
  5453. getRoleList(){
  5454. this.http.post('/permission/getRoleList',{
  5455. companyId:this.user.companyId,
  5456. },
  5457. res => {
  5458. if (res.code == "ok") {
  5459. this.roleList=res.data
  5460. } else {
  5461. this.$message({
  5462. message: res.msg,
  5463. type: "error"
  5464. });
  5465. }
  5466. },
  5467. error => {
  5468. this.$message({
  5469. message: error,
  5470. type: "error"
  5471. });
  5472. }
  5473. );
  5474. }
  5475. },
  5476. created() {
  5477. let height = window.innerHeight;
  5478. this.tableHeight = height - 225;
  5479. const that = this;
  5480. window.onresize = function temp() {
  5481. that.tableHeight = window.innerHeight - 195;
  5482. };
  5483. },
  5484. mounted() {
  5485. this.userssHu()
  5486. this.getDepartment();
  5487. this.getDepartment2();
  5488. this.projectListPageComponentKey++;
  5489. //localStorage中为string类型,需转化为int类型才会发生渲染
  5490. if (localStorage.projectPageIndex) {
  5491. this.page = parseInt(localStorage.projectPageIndex);
  5492. }
  5493. this.getList();
  5494. this.getUsers();
  5495. this.getCustomerList();
  5496. this.getProjectBaseConfigList();
  5497. this.getClfConfigList()
  5498. this.yanjiuzx()
  5499. this.getObtain()
  5500. // this.getRoleList()
  5501. // 判断是否有供应商字段
  5502. if(this.user.company.packageProvider == 1){
  5503. this.getSupplierList()
  5504. // this.getPhase()
  5505. }
  5506. if(this.user.company.packageProject == 1) {
  5507. this.obtainPhase()
  5508. }
  5509. // this.getSupplierList()
  5510. if(this.user.timeType.mainProjectState == 1){
  5511. this.getMainProject()
  5512. }
  5513. if(this.user.timeType.projectLevelState == 1){
  5514. this.getProjectLevel()
  5515. }
  5516. // 判断释放为专业版
  5517. if(this.user.company.packageProject == 1) {
  5518. this.importanceList = [{id:1,label:this.$t('zheng-chang')},{id:5,label:this.$t('di-feng-xian')},{id:6,label:this.$t('zhong-feng-xian')},{id:7,label:this.$t('gao-feng-xian')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}]
  5519. } else {
  5520. this.importanceList = [{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}]
  5521. }
  5522. // 获取部门
  5523. if(this.user.timeType.projectWithDept) {
  5524. this.getDepartmentList()
  5525. }
  5526. if(this.user.companyId == '936') {
  5527. this.getkeyNodes()
  5528. }
  5529. if (this.user.timeType.projectManDay == 1) {
  5530. this.getManDaySetting();
  5531. }
  5532. }
  5533. };
  5534. </script>
  5535. <style lang="scss" scoped>
  5536. .rg_span{
  5537. display: inline-block;
  5538. }
  5539. .rg_span span {
  5540. text-align: right;
  5541. box-sizing: border-box;
  5542. padding-right: 10px;
  5543. }
  5544. .el-dialog__title {
  5545. display: inline-table;
  5546. margin-top: 20px;
  5547. }
  5548. .addss {
  5549. width: 100%;
  5550. overflow: hidden;
  5551. white-space: nowrap;
  5552. text-overflow: ellipsis;
  5553. }
  5554. .keyNodes {
  5555. display: flex;
  5556. width: 100%;
  5557. box-sizing: border-box;
  5558. padding: 10px 30px;
  5559. }
  5560. .keyNodes .keyNodesTime {
  5561. width: 190px;
  5562. display: flex;
  5563. justify-content: center;
  5564. }
  5565. .keyNodes .keyNodesName {
  5566. width: 260px;
  5567. display: flex;
  5568. align-items: center;
  5569. overflow: hidden;
  5570. text-overflow: ellipsis;
  5571. }
  5572. .dialogSwitch {
  5573. }
  5574. // 111
  5575. </style>
  5576. <style>
  5577. .managePopperClass{
  5578. width: 190px;
  5579. }
  5580. .el-dropdown-link {
  5581. color: #409EFF;
  5582. }
  5583. .customdropdown{
  5584. margin-left: 10px;
  5585. }
  5586. .customdropdown .el-dropdown__caret-button{
  5587. height: 27px;
  5588. }
  5589. .customdropdown .el-button--mini:nth-child(1){
  5590. height: 27px;
  5591. }
  5592. .customdropdown_menu{
  5593. padding: 0;
  5594. }
  5595. .customdropdown_menu_btn{
  5596. border-color: transparent;
  5597. }
  5598. .ganttdialog .el-dialog__body{
  5599. height: 550px;
  5600. }
  5601. .toolbar_formitem_n1{
  5602. margin-right: 0 !important;
  5603. }
  5604. .wpgCssClass .el-form-item__label{
  5605. font-weight: 600;
  5606. }
  5607. .gongcheng .el-table .cell{
  5608. overflow: inherit !important;
  5609. }
  5610. </style>