list.vue 309 KB

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