list.vue 286 KB

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