list.vue 283 KB

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