list.vue 316 KB

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