list.vue 327 KB

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