list.vue 288 KB

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