list.vue 285 KB

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