list.vue 308 KB

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