12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395 |
- <template>
- <section>
- <!--工具条-->
- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
- <el-form :inline="true">
- <el-form-item label="项目列表" class="toolbar_formitem_n1">
-
- </el-form-item>
- <el-form-item >
- <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
- <div style="display: flex;align-items: center;height: 40px;">
- <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? '请输入项目名称关键字' : '请输入项目编号关键字'" clearable="true" size="small">
- <el-select v-model="searchField" style="width:120px;" slot="prepend" placeholder="请选择">
- <el-option label="项目名称" value=1 ></el-option>
- <el-option label="项目编号" value=2></el-option>
- </el-select>
- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
- </el-input>
- </div>
- </el-form-item>
- <el-form-item >
- <span style="margin-left:5px;margin-right:5px;color:#606266;">状态</span>
- <el-select v-model="status" style="width:110px;" placeholder="请选择" @change="searchList" size="small">
- <el-option label="全部" value=0 ></el-option>
- <el-option label="进行中" value=1 ></el-option>
- <el-option label="已完成" value=2 ></el-option>
- <el-option label="已撤销" value=3 ></el-option>
- <el-option label="已暂停" value=4 ></el-option>
- </el-select>
- </el-form-item>
- <!-- 主项目筛选 -->
- <el-form-item v-if="user.timeType.mainProjectState == '1'">
- <span style="margin-left:5px;margin-right:5px;color:#606266;">主项目</span>
- <el-select v-model="projectMainId" style="width:110px;" placeholder="请选择" clearable @change="searchClfList" size="small">
- <el-option v-for="item in mainProjectList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- </el-form-item>
- <!-- 分类筛选 -->
- <el-form-item >
- <span style="margin-left:5px;margin-right:5px;color:#606266;">分类</span>
- <el-select v-model="statusClf" style="width:110px;" placeholder="请选择" clearable @change="searchClfList" size="small">
- <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- </el-form-item>
-
- <!-- 分类条目 -->
- <!-- <el-form-item style="float:right;" v-if="permissions.projectClassification">
- <el-link type="primary" :underline="false" @click="showClfDialog = true">分类管理</el-link>
- </el-form-item>
- <el-form-item style="float:right;" v-if="user.company.packageProject == 1 && permissions.projectCostOfItems">
- <el-link type="primary" :underline="false" @click="showBaseCostItemDialog">基线成本项</el-link>
- </el-form-item>
-
- <el-form-item style="float:right;" v-if="permissions.projectExport">
- <el-link type="primary" style="margin-left:5px;" :underline="false" @click="exportProjectData" download="项目导出.xlsx">导出项目</el-link>
- </el-form-item>
- <el-form-item style="float:right;" v-if="permissions.projectImport">
- <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/项目导入模板.xlsx" download="项目导入模板.xlsx">模板下载</el-link>
- </el-form-item>
- <el-form-item style="float:right;" v-if="permissions.projectImport">
- <el-upload ref="upload" style="margin-left:5px;" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
- <el-link type="primary" :underline="false" >导入项目</el-link>
- </el-upload>
- </el-form-item> -->
- <el-form-item style="float:right;" v-if="permissions.projectImport || permissions.projectExport || permissions.projectClassification || (user.company.packageProject == 1 && permissions.projectCostOfItems)">
- <el-dropdown>
- <el-link type="primary" :underline="false">查看更多<i class="el-icon-arrow-down el-icon--right"></i></el-link>
-
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if="permissions.projectImport">
- <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
- <el-link type="primary" :underline="false" >导入项目</el-link>
- </el-upload>
- </el-dropdown-item>
- <el-dropdown-item v-if="permissions.projectImport">
- <el-link type="primary" :underline="false" @click="downloadmb" v-if="user.company.packageCustomer == 1 || user.company.packageProvider == 1 || user.timeType.mainProjectState == 1">模板下载</el-link>
- <el-link type="primary" :underline="false" href="./upload/项目导入模板.xlsx" download="项目导入模板.xlsx" v-else>模板下载</el-link>
- </el-dropdown-item>
- <el-dropdown-item v-if="permissions.projectExport">
- <el-link type="primary" :underline="false" @click="exportProjectData" download="项目导出.xlsx">导出项目</el-link>
- </el-dropdown-item>
- <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectCostOfItems">
- <el-link type="primary" :underline="false" @click="showBaseCostItemDialog">基线成本项</el-link>
- </el-dropdown-item>
- <el-dropdown-item v-if="permissions.projectClassification">
- <el-link type="primary" :underline="false" @click="showClfDialog = true">分类管理</el-link>
- </el-dropdown-item>
- <!-- <el-dropdown-item v-if="user.timeType.mainProjectState == 1 && !permissions.projectClassification"> -->
- <el-dropdown-item v-if="user.timeType.mainProjectState == 1">
- <el-link type="primary" :underline="false" @click="mainProjectDialog = true">主项目管理</el-link>
- </el-dropdown-item>
- <el-dropdown-item v-if="permissions.projectPhase && user.company.packageProject == 1">
- <el-link type="primary" :underline="false" @click="phaseProjectDialog = true">项目阶段管理</el-link>
- </el-dropdown-item>
- <el-dropdown-item v-if="user.timeType.projectLevelState == 1">
- <el-link type="primary" :underline="false" @click="projectLevelDialog = true">项目级别管理</el-link>
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </el-form-item>
- <!-- <el-form-item style="float:right;" v-if="user.role == 1||user.role == 2||user.role == 5"> -->
- <el-form-item style="float:right;" v-if="permissions.projectNew">
- <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增项目</el-link>
- </el-form-item>
- <el-form-item style="float:right;" v-if="permissions.projectResources">
- <!-- <router-link to="/projectGantt"> -->
- <el-link type="primary" :underline="false" @click="isganttshow = true">资源分配</el-link>
- <!-- </router-link> -->
- <el-dialog v-if="isganttshow" :visible.sync="isganttshow" width="90vw" top="3vh" style="height:96%" class="ganttdialog">
- <projectgantt></projectgantt>
- </el-dialog>
- </el-form-item>
- </el-form>
- </el-col>
- <!--列表-->
- <el-table ref="projectlistOfWudulist" @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" @cell-click="clickCell" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist" @sort-change="tableSort">
- <el-table-column type="selection" width="60" :selectable="isSelectable">
- <!-- creator 项目创建人 incharger 项目负责人 -->
- </el-table-column>
- <!-- <el-table-column type="index" width="60" v-else>
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column> -->
- <el-table-column prop="projectCode" label="项目编号" sortable="custom" width="120"></el-table-column>
- <el-table-column prop="categoryName" label="项目分类" sortable="custom" width="120"></el-table-column>
- <el-table-column prop="projectName" label="项目名称" width="250" sortable="custom">
- <template slot-scope="scope">
- <!-- <div class="kans">
- <el-link type="primary" v-if="user.company.packageProject==1" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
- <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
- </div> -->
- <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectName.length > 15">
- <div>
- <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
- <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
- </div>
- <div slot="reference" class="kans">
- <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>
- <span v-if="user.company.packageProject==0" >{{scope.row.projectName.substring(0,15)}}...</span>
- </div>
- </el-popover>
- <div v-else>
- <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
- <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="projectMainName" label="主项目" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
- </el-table-column>
- <el-table-column prop="inchargerName" label="负责人" sortable="custom" min-width="150">
- <template slot-scope="scope">
- <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">{{scope.row.inchargerName}}</el-link>
- </template>
- </el-table-column>
- <!-- 项目阶段 -->
- <!-- 换位置之前看下项目阶段发起的请求 -->
- <el-table-column prop="currentStage" label="项目阶段" sortable="custom" min-width="150" width="220" v-if="user.company.packageProject == 1 && permissions.projectPhase">
- <template slot-scope="scope">
- <span style="display: inline-block; width: 150px">
- <el-select v-model="phaseProjectValie" v-if="scope.row.index + ',' + scope.column.index == currentCell" :ref="scope.row.index + ',' + scope.column.index" filterable placeholder="请选择项目阶段" size="mini" @blur="hideSelect" @change="selectChange">
- <el-option v-for="(item, index) in phaseList" :key="index" :label="item.projectStageName" :value="item.id"> </el-option>
- </el-select>
- <el-link v-else type="primary" :underline="false">{{scope.row.currentStageId == null ? '暂无' : scope.row.currentStageName}}</el-link>
- </span>
-
- <el-link v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId) && scope.row.index + ',' + scope.column.index != currentCell && rowid == scope.row.id" type="primary" :underline="false"><i class="el-icon-edit"></i></el-link>
- </template>
- </el-table-column>
- <el-table-column prop="participator" label="参与者" :min-width="user.company.packageCustomer != 1 ? '' : '300'" sortable v-if="user.company.packageProject==0">
- <template slot-scope="scope">
- <!-- <v-for v-for="par in scope.row.participator" :key="par.id" >
- <el-link style="margin-right:10px;" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
- </v-for> -->
- <div v-if="scope.row.participator.length > 5">
- <el-popover placement="top" width="500" trigger="hover" v-if="scope.row.participator.length > 0">
- <span v-for="par in scope.row.participator" :key="par.id">
- <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
- </span>
- <div slot="reference" class="addss">
- <span v-for="par in scope.row.participator" :key="par.id">
- <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
- </span>
- </div>
- </el-popover>
- </div>
- <div v-else>
- <span v-for="par in scope.row.participator" :key="par.id" >
- <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)">{{par.name}}</el-link>
- </span>
- </div>
-
- </template>
- </el-table-column>
- <!-- 客户管理 -->
- <el-table-column prop="customerName" label="客户" min-width="190" v-if="user.company.packageCustomer == 1" sortable="custom">
- <template slot-scope="scope">
- <el-popover placement="top" width="250" trigger="hover" v-if="scope.row.customerName&&scope.row.customerName.length > 12">
- <div slot="reference" class="kans">
- <span >{{scope.row.customerName.substring(0,12)}}...</span>
- </div>
- <span >{{scope.row.customerName}}</span>
- </el-popover>
- <div v-else>
- <span >{{scope.row.customerName}}</span>
- </div>
- </template>
- </el-table-column>
- <!-- 级别 -->
- <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" label="级别" min-width="190" v-if="user.company.packageProject == 1">
- <template slot-scope="scope">
- <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
- <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
- </template>
- </el-table-column>
- <!-- 供应商 -->
- <!-- <el-table-column prop="providerNames" label="供应商" min-width="190" v-if="user.company.packageProvider">
- </el-table-column> -->
- <!-- <div v-if="user.company.packageProvider"> -->
- <template>
- <div v-for="(item, index) in listHeader" :key="index">
- <el-table-column prop="providerNames" :label="item" min-width="190" v-if="user.company.packageProvider">
- <template slot-scope="scope">
- <div>
- {{item | mobans(scope.row.providerInfoList)}}
- </div>
- </template>
- </el-table-column>
- </div>
- </template>
- <el-table-column prop="status" label="状态" min-width="100" sortable="custom">
- <template slot-scope="scope">
- {{scope.row.status == null?"-":statusTxt[scope.row.status]}}
- </template>
- </el-table-column>
- <!--专业项目协作-->
-
- <el-table-column prop="planStartDate" label="开始日期" min-width="96" >
- </el-table-column>
- <el-table-column prop="planEndDate" label="截止日期" min-width="96" >
- </el-table-column>
- <el-table-column prop="progress" label="完成度" min-width="100" v-if="user.company.packageProject == 1">
- <template slot-scope="scope">
- {{scope.row.progress==null?"-":scope.row.progress}}%
- </template>
- </el-table-column>
- <el-table-column label="操作" :width="showColumnWidth" align="left" fixed="right" v-if="showColumnWidth != '0' || permissions.projectManagement">
- <template slot-scope="scope">
- <el-button v-if="(permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1'" size="mini" @click="subProject(scope.row)">子项目</el-button>
- <el-button size="mini" v-if="permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
- <!-- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini" @click="deletePro(scope.$index, scope.row)">删除</el-button> -->
- <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">
- 完成
- <el-dropdown-menu slot="dropdown" class="customdropdown_menu">
- <el-button size="mini" @click="cancelPro(scope.row)" class="customdropdown_menu_btn">撤销</el-button><br>
- <el-button size="mini" @click="suspendPro(scope.row)" class="customdropdown_menu_btn">暂停</el-button><br>
- </el-dropdown-menu>
- </el-dropdown>
- <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)">重启</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条-->
- <el-col :span="24" class="toolbar">
- <el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">取消</el-button>
- <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
- <el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">批量设置{{user.timeType.customDegreeName}}</el-button>
- <el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">批量添加{{user.timeType.customDegreeName}}</el-button>
- </template>
- <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
- <el-button size="small" type="primary" @click="addGroupPerson()" :loading="addGroupPersonBtnLoading">批量添加分组参与人</el-button>
- <el-button size="small" type="primary" @click="addProPreson()">批量添加项目参与人</el-button>
- </template>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20 , 50 , 80 , 100]"
- :page-size="size"
- layout="total, sizes, prev, pager, next"
- :total="total"
- style="float:right;"
- ></el-pagination>
- </el-col>
- <!--新增界面-->
- <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px">
- <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
- <el-form-item label="项目编号" >
- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input>
- </el-form-item>
- <el-form-item label="主项目" v-if="user.timeType.mainProjectState == '1'">
- <el-select v-model="addForm.projectMainId" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id" @change="projectManagementChange">
- <el-option v-for="(item) in mainProjectList" :key="item.id" :value="item.id" :label="item.name + '\u3000' + item.code">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.code }}</span>
- <span style="float: right;margin-left: 20px">{{ item.name }}</span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="项目分类" v-if="user.timeType.mainProjectState != '1'">
- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id">
- <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="项目名称" prop="name">
- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input>
- </el-form-item>
- <el-form-item label="项目描述" prop="projectDesc">
- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input>
- </el-form-item>
- <el-form-item label="项目类型" prop="isPublic">
- <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="!permissions.projectManagement && addForm.creatorId != user.id">
- <el-option :value="0" label="普通项目"></el-option>
- <el-option :value="1" label="公共项目"></el-option>
- </el-select>
- <el-tooltip effect="dark" content="普通项目只对参与人员开放,公共项目对所有成员开放" placement="top-start">
- <i class="el-icon-question"></i>
- </el-tooltip>
- <div v-if="user.company.packageCustomer == 1" style="display: inline-block;width: 50%">
- <span style="margin-left:63px;margin-right:10px;" >客户</span>
- <el-select v-model="addForm.customerId" clearable="true" filterable placeholder="请选择客户" style="width:70%;" >
- <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
- </el-select>
- </div>
- </el-form-item>
- <!-- 供应商 -->
- <!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
- <el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
- <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item label="供应商" v-if="user.company.packageProvider">
- <el-select v-model="addForm.supplierId" multiple placeholder="请选择" filterable="true" style="width: 100%">
- <span v-for="(item, index) in supplierList" :key="index">
- <el-option :label="item.providerName" :value="item.id"></el-option>
- </span>
- </el-select>
- </el-form-item>
- <el-form-item :label="yonghuUser.customDegreeName" v-if="yonghuUser.customDegreeActive == 1">
- <el-select v-model="auseList" multiple placeholder="请选择" filterable="true" style="width: 100%">
- <span v-for="(item, index) in ause" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="客户" v-if="user.company.packageCustomer == 1">
- <el-select v-model="addForm.customerId" clearable="true" filterable placeholder="请选择客户" style="width:100%;" >
- <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item label="全部参与者" v-show="addForm.isPublic == 0">
- <el-tooltip placement="top" effect="light">
- <div slot="content" style="width:780px">{{addForm.userNames}}</div>
- <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
- </el-tooltip>
- </el-form-item>
- <el-form-item label="负责人" ><el-select v-model="addForm.inchargerId" :disabled="(addForm.userId.length==0 && addForm.isPublic == 0) || (!permissions.projectManagement && user.id != addForm.creatorId)" filterable placeholder="请选择负责人" style="width:32%;" >
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="日报审核人" v-show="user.timeType.reportAuditType==0">
- <el-select v-model="addForm.auditUserIds" multiple="true" :disabled=" !(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable placeholder="默认为项目负责人" style="width:100%;" >
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!--专业项目协作版本功能 -->
- <el-form-item label="级别" v-if="user.company.packageProject==1">
- <el-select v-model="addForm.level" placeholder="请选择级别" style="width:32%;" v-if="user.timeType.projectLevelState == 1">
- <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
- </el-select>
- <el-select v-model="addForm.level" placeholder="请选择级别" style="width:32%;" v-else>
- <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
- </el-select>
- <!-- 增加合同金额字段 -->
- <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
- <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;"
- placeholder="整数" clearable @keyup.native="restrictNumber('contractAmount')" :disabled="true"></el-input><span style="margin-left:10px;">元</span>
- <!-- 增加合同金额字段 -->
- </el-form-item>
- <el-form-item label="开始日期" prop="planStartDate" >
- <el-date-picker v-model="addForm.planStartDate"
- :editable="false" style="width:32%;"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :clearable="false" type="date"
- placeholder="选择日期"></el-date-picker>
- <span style="margin-left:63px;margin-right:10px;" >截止日期</span>
- <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
- :editable="false"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :clearable="false" type="date"
- placeholder="选择日期"></el-date-picker>
- </el-form-item>
-
- <!-- 项目基线 -->
- <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="成本基线" name="baseCostPanel" >
- <div style="padding-top:10px;">
- <!--新版 -->
- <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
- <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
- <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
- placeholder="整数" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">元</span>
- </span>
- <!-- 合计 -->
- <div style="margin-top: 10px;float:right;">
- <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">合计</span>
- <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
- <span v-else>{{addForm.budget | numberToCurrency}}</span>
- <span style="margin-right:50px;margin-left:10px;">元</span>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="工程专业" name="engineeringProfession" v-if="user.company.packageEngineering == 1">
- <div style="padding-top:10px;">
- <el-table :data="projectProfessionList" size="small" :key="Math.random()">
- <el-table-column prop="professionId" width="200">
- <template slot-scope="scope">
- <el-select v-model="scope.row.professionId" >
- <el-option v-for="item in professionList" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </template>
- <template slot="header" >
- <span style="font-size:14px;font-weight:normal;">专业名称</span>
- </template>
- </el-table-column>
- <el-table-column prop="percentage" width="120" label="占比(%)">
- <template slot-scope="scope">
- <div><el-input type="number" v-model="scope.row.percentage"></el-input></div>
- </template>
- </el-table-column>
-
- <el-table-column prop="membNames" label="相关人员及占比">
- <template slot-scope="scope">
- <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">{{item.membName}}({{item.percentage}}%)</span>
- <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?'设置专业参与人员':'设置'}}</el-link>
- </template>
- </el-table-column>
- <el-table-column prop="inchargerName" width="120" label="负责人">
- <template slot-scope="scope">
- <el-select v-model="scope.row.inchargerId" >
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
-
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column width="80">
- <template slot-scope="scope">
- <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.$index)"></el-button>
- </template>
- <template slot="header" >
- <el-link type="primary" :underline="false" @click="addItem">添加</el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-tab-pane>
- <el-tab-pane label="相关领导" name="leaders" >
- <div style="padding-top:10px;">
- <el-input @focus="showChooseLeaderTree" v-model="addForm.notifyUserNames" placeholder="请选择需要接收审核通知的相关领导"></el-input>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
-
- </el-form>
- <div slot="footer" class="dialog-footer;">
- <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectManagement || user.id==deleteVif) && addForm.id" style="float:left">删除</el-button>
- <el-button @click.native="addFormVisible = false">取消</el-button>
- <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <!--用户详细信息弹出框-->
- <el-dialog title="查看详情" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
- <div class="line"><span>姓名</span><span>{{userDetail.name}}</span></div>
- <div class="line"><span>手机号码</span><span>{{userDetail.phone}}</span></div>
- <div class="line"><span>角色</span><span>{{roleArray[userDetail.role]}}</span></div>
- <div class="line"><span>部门</span><span>{{userDetail.departmentName}}</span></div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="userDetailVisible = false" >确定</el-button>
- </div>
- </el-dialog>
- <!-- 子项目列表 -->
- <el-dialog title="子项目列表" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
- <!-- <el-table-column type="index" width="60" label="序号">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column> -->
- <el-table-column width="120" label="子项目编号" prop="code"></el-table-column>
- <el-table-column prop="name" label="名称" ></el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">编辑</el-button>
- <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="subProjectVisible = false" >关闭</el-button>
- <el-button type="primary" @click="addNewSubProject()" >新增子项目</el-button>
- </div>
- </el-dialog>
- <!-- 新增子项目弹出框 -->
- <el-dialog title="新增/修改子项目" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-form ref="form2" :model="temaddForm" :rules="rules" label-width="100px">
- <!-- <el-form-item label="项目编号" prop="code"> -->
- <el-form-item label="项目编号">
- <el-input v-model="temaddForm.code" placeholder="请输入项目编号" clearable></el-input>
- </el-form-item>
- <el-form-item label="项目名称" prop="name">
- <el-input v-model="temaddForm.name" placeholder="请输入项目名称" clearable></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click.native="addSubProject = false">取消</el-button>
- <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <!-- 项目基线成本项配置弹出框 -->
- <el-dialog title="项目基线成本项管理" show-header="false" v-if="showBaseConfig" :visible.sync="showBaseConfig" :close-on-click-modal="false" customClass="customWidth" width="600px">
- <el-table :data="baseCostItemList" highlight-current-row height="400" style="width: 100%;">
- <el-table-column type="index" width="60" label="序号">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="名称" ></el-table-column>
- <el-table-column prop="alarmType" label="预警">
- <template slot-scope="scope">
- <span>{{scope.row.alarmType ? "工时成本预警" : "无预警"}}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addNewBaseItem(scope.row)">编辑</el-button>
- <el-button size="small" type="danger" @click="deleteBaseItem(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="showBaseConfig = false" >关闭</el-button>
- <el-button type="primary" @click="addNewBaseItem()" >新增成本项</el-button>
- </div>
- </el-dialog>
- <!-- 分类条目配置 -->
- <el-dialog title="项目分类条目管理" show-header="false" v-if="showClfDialog" :visible.sync="showClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-table :data="baseClfList" highlight-current-row height="400" style="width: 100%;">
- <el-table-column type="index" width="60" label="序号">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="名称" ></el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addNewClf(scope.row)">编辑</el-button>
- <el-button size="small" type="danger" @click="deleteClf(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="showClfDialog = false" >关闭</el-button>
- <el-button type="primary" @click="addNewClf()" >新增分类项</el-button>
- </div>
- </el-dialog>
- <!-- 主项目配置 -->
- <el-dialog title="主项目管理" show-header="false" v-if="mainProjectDialog" :visible.sync="mainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="800px">
- <el-table :data="mainProjectList" highlight-current-row height="400" style="width: 100%;">
- <el-table-column type="index" width="60" label="序号">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="code" label="编号" ></el-table-column>
- <el-table-column prop="name" label="名称" ></el-table-column>
- <el-table-column prop="categoryName" label="分类名称" ></el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addManPro(scope.row)">编辑</el-button>
- <el-button size="small" type="danger" @click="deleteManPro(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="mainProjectDialog = false" >关闭</el-button>
- <el-button type="primary" @click="addManPro()" >新增主项目</el-button>
- </div>
- </el-dialog>
- <!-- 项目阶段配置 -->
- <el-dialog title="项目阶段管理" show-header="false" v-if="phaseProjectDialog" :visible.sync="phaseProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
- <el-table :data="phaseList" highlight-current-row height="400" style="width: 100%;">
- <el-table-column type="index" width="60" label="序号">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="projectStageName" label="阶段名称" ></el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addPanthPro(scope.row)">编辑</el-button>
- <el-button size="small" type="danger" @click="deletePanthPro(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="phaseProjectDialog = false" >关闭</el-button>
- <el-button type="primary" @click="addPanthPro()" >新增项目阶段</el-button>
- </div>
- </el-dialog>
- <!-- 项目级别管理 -->
- <el-dialog title="项目级别管理" show-header="false" v-if="projectLevelDialog" :visible.sync="projectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
- <el-table :data="levelList" highlight-current-row height="400" style="width: 100%;" >
- <el-table-column type="index" width="60" label="序号">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="projectLevelName" label="级别名称" ></el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addProjectLevel(scope.row)">编辑</el-button>
- <el-button size="small" type="danger" @click="deleteProjectLevel(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="projectLevelDialog = false" >关闭</el-button>
- <el-button type="primary" @click="addProjectLevel()" >新增项目级别</el-button>
- </div>
- </el-dialog>
- <!-- 新增/编辑项目级别 -->
- <el-dialog title="新增/修改项目级别" v-if="addProjectLevelDialog" :visible.sync="addProjectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-form ref="form2" :model="addLevelForm" :rules="rules" label-width="120px">
- <el-form-item label="项目级别名称" prop="projectLevelName">
- <el-input v-model="addLevelForm.projectLevelName" placeholder="请输入名称" clearable></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="addProjectLevelDialog = false">取消</el-button>
- <el-button type="primary" @click="submitLevelPro" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <!-- 新增/编辑 分类条目 -->
- <el-dialog title="新增/修改分类条目" v-if="addClfDialog" :visible.sync="addClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-form ref="form2" :model="addClf" :rules="rules" label-width="100px">
- <el-form-item label="主项目名称" prop="name">
- <el-input v-model="addClf.name" placeholder="请输入主项目名称" clearable></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click.native="addClfDialog = false">取消</el-button>
- <el-button type="primary" @click="submitClf" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <!-- 新增/编辑主项目 -->
- <el-dialog title="新增/修改主项目" v-if="addFlgmainProjectDialog" :visible.sync="addFlgmainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-form ref="form2" :model="addMainForm" :rules="rules" label-width="100px">
- <!-- <el-form-item label="主项目编号" prop="code"> -->
- <el-form-item label="主项目编号">
- <el-input v-model="addMainForm.code" placeholder="请输入编号" clearable></el-input>
- </el-form-item>
- <el-form-item label="主项目名称" prop="name">
- <el-input v-model="addMainForm.name" placeholder="请输入名称" clearable></el-input>
- </el-form-item>
- <el-form-item label="项目分类">
- <el-select v-model="addMainForm.categoryId" placeholder="请选择分类" clearable >
- <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click.native="addFlgmainProjectDialog = false">取消</el-button>
- <el-button type="primary" @click="submitManPro" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <!-- 新增/编辑项目阶段 -->
- <el-dialog title="新增/修改项目阶段" v-if="addFlgPanthProjectDialog" :visible.sync="addFlgPanthProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-form ref="form2" :model="addPanthForm" :rules="rules" label-width="120px">
- <el-form-item label="项目阶段名称" prop="name">
- <el-input v-model="addPanthForm.projectStageName" placeholder="请输入名称" clearable></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click.native="addFlgPanthProjectDialog = false">取消</el-button>
- <el-button type="primary" @click="submitPanthPro" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <el-dialog title="新增/修改成本项" v-if="addBaseItemDialog" :visible.sync="addBaseItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
- <el-form-item label="成本项名称" prop="name">
- <el-input v-model="addForm.name" placeholder="请输入名称" clearable></el-input>
- </el-form-item>
- <el-form-item label="预警" prop="alarmType">
- <el-radio v-model="addForm.alarmType" :label="0">无预警</el-radio>
- <el-radio v-model="addForm.alarmType" :label="1">工时成本预警</el-radio>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click.native="addBaseItemDialog = false">取消</el-button>
- <el-button type="primary" @click="submitInsertBaseItem" :loading="addLoading">提交</el-button>
- </div>
- </el-dialog>
- <!-- 按部门选择人员 -->
- <el-dialog title="选择参与人员" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
- <div class="tree" style="height:400px">
- <el-scrollbar style="height:100%">
- <el-input
- placeholder="输入关键字进行过滤"
- v-model="filterText">
- </el-input>
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
- ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
- highlight-current :filter-node-method="filterNode"></el-tree>
- </el-scrollbar>
- </div>
- <div>已选中 {{chosenMembCount}} 人</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="chooseParticipVisible = false" >取消</el-button>
- <el-button type="primary" @click="chooseParticip()" >确定</el-button>
- </div>
- </el-dialog>
- <!-- 按部门选择相关领导 -->
- <el-dialog title="选择相关领导" v-if="chooseLeaderVisible" :visible.sync="chooseLeaderVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
- <div class="tree" style="height:400px">
- <el-scrollbar style="height:100%">
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
- ref="chooseLeaderTree" @check-change="onLeaderTreeItemChange" :default-checked-keys="addForm.notifyUserIds"
- highlight-current ></el-tree>
- </el-scrollbar>
- </div>
- <div>已选中 {{chosenMembCount}} 人</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="chooseLeaderVisible = false" >取消</el-button>
- <el-button type="primary" @click="chooseLeader()" >确定</el-button>
- </div>
- </el-dialog>
- <!-- 项目专业人员的设置 -->
- <el-dialog title="设置项目专业人员" v-if="editPpMembDialog" :visible.sync="editPpMembDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
- <el-table :data="curProfessionRow.membList" height="400">
- <el-table-column prop="name" label="专业人员">
- <template slot-scope="scope">
- <el-select v-model="scope.row.membId" filterable placeholder="请选择专业参与人" style="width:100%;" >
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="percentage" width="120" label="占比(%)">
- <template slot-scope="scope">
- <el-input type="number" v-model="scope.row.percentage"></el-input>
- </template>
- </el-table-column>
- <el-table-column width="80">
- <template slot-scope="scope">
- <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteMembItem(scope.$index)"></el-button>
- </template>
- <template slot="header" >
- <el-link @click="addMembItem">添加</el-link>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="editPpMembDialog = false" >取消</el-button>
- <el-button type="primary" @click="addPpMemb" >确定</el-button>
- </div>
- </el-dialog>
- <!-- 批量修改自定义维度 -->
- <el-dialog :title="checkoradd ? '批量修改' : '批量添加'" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
- <el-form model="" label-width="20%">
- <el-form-item :label="'设置' + user.timeType.customDegreeName">
- <el-select v-model="checkedWuduArr" value-key="id" :placeholder="'请选择' + user.timeType.customDegreeName" multiple style="width: 100%">
- <el-option v-for="item in ause" :key="item.id" :label="item.name" :value="item"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="checkedWuduDialog = false">取消</el-button>
- <el-button type="primary" @click="batchSetWudulistBtn3" v-if="checkoradd">确定</el-button>
- <el-button type="primary" @click="batchSetWudulistBtn4" v-if="!checkoradd">确定</el-button>
- </div>
- </el-dialog>
- <!-- 批量添加参与人 -->
- <el-dialog :title="isAddGroupPerson ? '批量添加分组参与人' : '批量添加项目参与人'" v-if="addGroupPersonDialog" :visible.sync="addGroupPersonDialog" width="40%">
- <el-form label-width="20%">
- <el-form-item label="选择人员">
- <el-tooltip placement="top" effect="light">
- <div slot="content" style="width:450px">{{addGroupPersonData.personNames}}</div>
- <el-input @focus="addGroupPersonP" v-model="addGroupPersonData.personNames"></el-input>
- </el-tooltip>
- </el-form-item>
- <el-form-item label="选择分组" v-if="isAddGroupPerson">
- <el-select v-model="addGroupPersonData.group" multiple placeholder="请选择分组" style="width:100%">
- <el-option v-for="item in addGroupList"
- :key="item.groupIds"
- :label="item.name"
- :value="item.groupIds"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="addGroupPersonDialog = false" >取消</el-button>
- <el-button type="primary" @click="addGroupPersonSure()" v-if="isAddGroupPerson">确定</el-button>
- <el-button type="primary" @click="addProPersonSure()" v-else>确定</el-button>
- </div>
- <el-dialog append-to-body title="选择人员" v-if="addGroupPersonPdialog" :visible.sync="addGroupPersonPdialog" width="40%">
- <div class="tree" style="height:300px">
- <el-scrollbar style="height:100%">
- <el-input
- placeholder="输入关键字进行过滤"
- v-model="filterText2">
- </el-input>
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
- ref="chooseMembTree2" @check-change="addPersonCheck"
- highlight-current :filter-node-method="filterNode" :default-checked-keys="addGroupPersonData.person"></el-tree>
- </el-scrollbar>
- </div>
- <div>已选中 {{chosenMembCount}} 人</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="addGroupPersonPdialog = false" >取消</el-button>
- <el-button type="primary" @click="addPersonSure()" >确定</el-button>
- </div>
- </el-dialog>
- </el-dialog>
- <el-dialog append-to-body title="项目导入结果" v-if="showImportResult" :visible.sync="showImportResult" width="40%">
- <div >
- {{importResultMsg}}
- </div>
- </el-dialog>
- </section>
- </template>
- <style scoped>
- .input-with-select .el-input-group__prepend {
- background-color: #fff;
- }
- .line {
- padding:10px;
- }
- .line span{
- font-size:15px;
- }
- .line span:nth-child(even){
- float:right;
- }
- .kans {
- width: 230px;
- overflow:hidden;
- white-space:nowrap;
- text-overflow: ellipsis;
- }
- a {
- text-decoration: none;
- }
-
- .router-link-active {
- text-decoration: none;
- }
- </style>
- <script>
- import util from "../../common/js/util";
- import projectgantt from "./project_gantt.vue"
- export default {
- components:{projectgantt},
- data() {
- return {
- addFlgmainProjectDialog: false,
- addFlgPanthProjectDialog: false,
- addProjectLevelDialog: false,
- mainProjectList: [],
- mainProjectDialog: false,
- projectLevelDialog: false,
- showImportResult: false,
- importResultMsg:null,
- isganttshow: false,
- deleteAlertMsg: null,
- chosenLeaders:[],
- chooseLeaderVisible:false,
- projectProfessionItem:null,
- curProfessionRow:null,
- editPpMembDialog:false,
- professionList:[],
- projectProfessionList:[],
- activeName:"baseCostPanel",
- chosenMembCount:0,
- chosenMembList:[],//选中的人员
- allMembData:[],
- deptMembData: [
- {
- id: 0,
- label: '未分配',
- }
- ],
- option: [],
- depData: {
- id: -1,
- label: '全部人员',
- },
- defaultProps: {
- children: 'children',
- label: 'label'
- },
- filterName:null,
- chooseParticipVisible: false,
- projectBaseCostData:[],
- addBaseItemDialog:false,
- showBaseConfig:false,
- customerList:[],
- roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员"],
- status:"1",
- statusTxt:["-","进行中","已完成","已撤销","已暂停"],
- importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
- importanceListLable:['正常', '紧急', '重要', '重要且紧急', '低风险', '中风险', '高风险'],
- searchField:'1',
- keyword:null,
- user: JSON.parse(sessionStorage.getItem("user")),
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- userDetailVisible: false,
- userDetail:{},
- date: new Date(),
- users: [],
- participator:[],
- tableHeight: 0,
- listLoading: false,
- total: 0,
- page: 1,
- size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
- list: [],
- subProjectVisible: false,
- subProjectList: [],//子项目列表
- currentProject:{},
- addSubProject: false,
- addFormVisible: false,
- addLoading: false,
- addUp: 0, // 合计
- title: "",
- addForm: {
- name: '',
- userId: [],
- level:1,
- id: '',
- code: '',
- projectDesc: '',
- alarmType: 0
- },
- temaddForm: {},
- rules: {
- name: [{ required: true, message: "请输入名称", trigger: "blur" }],
- code: [{ required: true, message: "请输入编号", trigger: "blur" }],
- projectStageName: [{ required: true, message: "请输入名称", trigger: "blur" }],
- projectLevelName: [{ required: true, message: "请输入名称", trigger: "blur" }],
- },
- ause: [],
- auseList: [],
- yonghuUser: [],
- filterText: '',
- filterText2: '',
- showClfDialog: false,
- addClfDialog:false,
- addClf:{name:'',id:''},
- addMainForm:{
- name:'',
- id:'',
- code: '',
- categoryId: ''
- },
- addPanthForm: {
- id: '',
- projectStageName: ''
- },
- addLevelForm: {
- id: '',
- projectStageName: ''
- },
- statusClf:null,
- permissionsObj: {},
- checkedProjectArr: [],
- checkedWuduDialog: false,
- checkedWuduArr: [],
- checkoradd: true,
- addGroupPersonBtnLoading: false,
- addGroupPersonDialog: false,
- addGroupList: [],
- addGroupPersonData: {
- group: [],
- person: null,
- personNames: ''
- },
- addGroupPersonPdialog: false,
- showColumnWidth: '300',
- deleteVif: null,
- isAddGroupPerson: true,
- projectMainId: '',
- supplierList: '',
- sortProp: '',
- sortOrder: null,
- currentCell: null, // 当前单击的是哪一个单元格
- phaseList: [],
- phaseProjectId: '', // 阶段项目id
- phaseProjectValie: null, // 阶段项目值
- listHeader: [], // 列表表头
- rowid: '',
- phaseProjectDialog: false, // 项目阶段
- levelList: [], // 项目级别
- };
- },
- // 过滤器
- filters: {
- numberToCurrency(value) {
- if (!value) return '0.00'
- // 将数值截取,保留两位小数
- value = value.toFixed(2)
- // 获取整数部分
- const intPart = Math.trunc(value)
- // 整数部分处理,增加,
- const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
- // 预定义小数部分
- let floatPart = '.00'
- // 将数值截取为小数部分和整数部分
- const valueArray = value.toString().split('.')
- if (valueArray.length === 2) { // 有小数部分
- floatPart = valueArray[1].toString() // 取得小数部分
- return intPartFormat + '.' + floatPart
- }
- return intPartFormat + floatPart
- },
- mobans(value, valueList) {
- for(var i in valueList) {
- if(valueList[i].providerCateGoryName == value) {
- return valueList[i].providerInfoName
- }
- }
- },
- },
- watch: {
- filterText(val) {
- this.$refs.chooseMembTree.filter(val);
- },
- filterText2(val) {
- this.$refs.chooseMembTree2.filter(val);
- }
- },
- methods: {
- hoverCall(row) {
- this.rowid=row.id
- },
- handCall() {
- this.rowid = ''
- },
- // 获取阶段
- obtainPhase(item) {
- this.http.post('/project-stage/list', {},
- res => {
- if (res.code == "ok") {
- // this.phaseList = res.data
- this.$set(this, 'phaseList', res.data)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取级别
- getProjectLevel(){
- this.http.post('/project-level/list', {},
- res => {
- if (res.code == "ok") {
- this.levelList = res.data
- // this.$set(this, 'levelList', res.data)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- addProjectLevel(row){
- this.addProjectLevelDialog = true
- if(!row) {
- this.addLevelForm = {
- projectLevelName: '',
- id: ''
- // companyId:''
- }
- } else {
- this.addLevelForm = {
- id: row.id,
- projectLevelName: row.projectLevelName
- // companyId: row.companyId
- }
- }
- },
- deleteProjectLevel(row) {
- this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除项目级别", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/project-level/delete',{
- id: row.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getProjectLevel();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- submitLevelPro(){
- this.http.post('/project-level/addOrMod',this.addLevelForm,
- res => {
- if (res.code == "ok") {
- this.addProjectLevelDialog = false;
- this.getProjectLevel()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- // 表格点击
- tableCellClassName({row, column, rowIndex, columnIndex}) {
- row.index=rowIndex;
- column.index=columnIndex;
- },
- clickCell(row,column) {
- console.log(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId)
- if(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId) {
- this.phaseProjectValie = row.currentStageId ? row.currentStageId : ''
- this.currentCell = row.index + ',' + column.index;
- if(column.index == 6) {
- this.phaseProjectId = row.id
- // this.obtainPhase(row)
- }
- setTimeout(() => {
- // 获得焦点
- this.$refs[row.index + ',' + column.index].focus();
- })
- }
- },
- selectChange() {
- let currentStageName = ''
- for(var i in this.phaseList) {
- if(this.phaseList[i].id == this.phaseProjectValie) {
- currentStageName = this.phaseList[i].projectStageName
- }
- }
- this.http.post('/project/changeCurrentStage', {
- projectId: this.phaseProjectId,
- currentStageId: this.phaseProjectValie,
- currentStageName: currentStageName
- },
- res => {
- if (res.code == "ok") {
- this.getList()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- hideSelect() {
- var that = this
- setTimeout(() => {
- that.currentCell = null
- }, 500)
- },
- // 点击主项目事件
- projectManagementChange() {
- let categoryId = ''
- for(var i in this.mainProjectList) {
- if(this.mainProjectList[i].id == this.addForm.projectMainId) {
- categoryId = this.mainProjectList[i].categoryId
- }
- }
- categoryId == '' ? '' : this.addForm.category = categoryId
- console.log(this.addForm)
- },
- tableSort({column, prop, order}){
- if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage'){
- this.sortOrder = order
- this.sortProp = prop
- this.getList()
- }
- },
- //获取项目列表
- getSupplierList() {
- this.http.post('/provider-info/list', {
- pageIndex: 1,
- // pageSize: 999,
- pageSize: -1,
- keyword: ''
- },
- res => {
- if (res.code == "ok") {
- this.supplierList = res.data.records;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- addManPro(row) {
- this.addFlgmainProjectDialog = true
- if(!row) {
- this.addMainForm = {
- name: '',
- id: '',
- code: '',
- categoryId: ''
- }
- } else {
- this.addMainForm = {
- id: row.id,
- code: row.code,
- name: row.name,
- categoryId: row.categoryId,
- }
- }
- },
- addPanthPro(row) {
- this.addFlgPanthProjectDialog = true
- if(!row) {
- this.addPanthForm = {
- projectStageName: '',
- id: '',
- companyId:''
- }
- } else {
- this.addPanthForm = {
- id: row.id,
- projectStageName: row.projectStageName,
- companyId: row.companyId
- }
- }
- },
- // 获取主项目
- getMainProject() {
- this.http.post('/project-main/list',{},res => {
- if(res.code == 'ok'){
- this.mainProjectList = res.data
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 批量修改自定义维度
- checkedWudulist(e){
- console.log(e);
- this.checkedProjectArr = e
- },
- batchSetWudulistBtn1(){
- this.$refs.projectlistOfWudulist.clearSelection()
- this.checkedWuduArr = [],
- this.addGroupPersonData = {
- group: null,
- person: null,
- personNames: ''
- }
- },
- batchSetWudulistBtn2(e){
- if(this.checkedProjectArr.length == 0){
- this.$message('请选择项目')
- return
- }
- this.checkoradd = e
- this.checkedWuduDialog = true
- },
- batchSetWudulistBtn3(){
- if(this.checkedWuduArr.length == 0){
- this.$message('请选择' + this.user.timeType.customDegreeName)
- return
- }
- let projectIds = []
- for(let i=0; i<this.checkedProjectArr.length; i++){
- projectIds.push(this.checkedProjectArr[i].id)
- }
- let degreeIds = []
- let degreeNames = []
- for(let s=0; s<this.checkedWuduArr.length; s++){
- degreeIds.push(this.checkedWuduArr[s].id)
- degreeNames.push(this.checkedWuduArr[s].name)
- }
- this.http.post('/project/saveBatchAccoDegrees',{
- ids: JSON.stringify(projectIds),
- associateDegrees: degreeIds.toString(),
- associateDegreeNames: degreeNames.toString()
- },res => {
- if(res.code == 'ok'){
- this.checkedWuduDialog = false
- this.batchSetWudulistBtn1()
- this.$message({
- message: '设置成功',
- type: 'success'
- })
- this.getList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- batchSetWudulistBtn4(){
- if(this.checkedWuduArr.length == 0){
- this.$message('请选择' + this.user.timeType.customDegreeName)
- return
- }
- let projectIds = []
- for(let i=0; i<this.checkedProjectArr.length; i++){
- projectIds.push(this.checkedProjectArr[i].id)
- }
- let degreeIds = []
- let degreeNames = []
- for(let s=0; s<this.checkedWuduArr.length; s++){
- degreeIds.push(this.checkedWuduArr[s].id)
- degreeNames.push(this.checkedWuduArr[s].name)
- }
- this.http.post('/project/addBatchAccoDegrees',{
- ids: JSON.stringify(projectIds),
- associateDegrees: degreeIds.toString(),
- associateDegreeNames: degreeNames.toString()
- },res => {
- if(res.code == 'ok'){
- this.checkedWuduDialog = false
- this.batchSetWudulistBtn1()
- this.$message({
- message: '添加成功',
- type: 'success'
- })
- this.getList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- isSelectable(row,index){
- if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectManagement){
- return true
- }else{
- return false
- }
- },
- test(row){
- console.log(row);
- },
- // 批量添加分组参与人员
- addGroupPerson(){
- let proArr = []
- if(this.checkedProjectArr.length == 0){
- this.$message('请选择项目')
- return
- }
- this.addGroupPersonBtnLoading = true
- for(let i=0;i<this.checkedProjectArr.length;i++){
- proArr.push(this.checkedProjectArr[i].id)
- }
- this.http.post('/project/getProjectsGroups',{
- projectIdArray: JSON.stringify(proArr)
- },res => {
- if(res.code == 'ok'){
- console.log('分组',res.data);
- this.addGroupList = res.data
- this.addGroupPersonBtnLoading = false
- this.addGroupPersonDialog = true
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
-
- },
- addGroupPersonP(){
- this.filterText2 = ''
- this.addGroupPersonPdialog = true
- },
- addPersonCheck(){
- var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- console.log(list);
- },
- addPersonSure(){
- this.addGroupPersonPdialog = false
- let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
- let list = chosenList.filter(item=>item.isUser == 1);
- let listIDs = []
- let listNames = ''
- for(let i=0;i<list.length;i++){
- listIDs.push(list[i].id)
- listNames += list[i].label + ','
- }
- this.addGroupPersonData.person = listIDs
- this.addGroupPersonData.personNames = listNames
- },
- addGroupPersonSure(){
- if(this.addGroupPersonData.group.length == 0 || this.addGroupPersonData.person == null){
- this.$message({
- message: '请选择人员/分组',
- type: 'warning'
- })
- return
- }
- let groupList = []
- for(let i=0;i<this.addGroupPersonData.group.length;i++){
- groupList = [...groupList,...this.addGroupPersonData.group[i]]
- }
- this.http.post('/project/batchAddMembToGroup',{
- membIdArray: JSON.stringify(this.addGroupPersonData.person),
- groupIds: JSON.stringify(groupList)
- },res => {
- if(res.code == 'ok'){
- this.addGroupPersonDialog = false,
-
- this.batchSetWudulistBtn1()
- this.$message({
- message: '添加成功',
- type: 'success'
- })
- this.getList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- batchDelete(){
- if(this.checkedProjectArr.length == 0){
- this.$message('请选择项目')
- return
- }
- let proArr = []
- for(let i=0;i<this.checkedProjectArr.length;i++){
- proArr.push(this.checkedProjectArr[i].id)
- // proArr += this.checkedProjectArr[i].id + ','
- }
- // proArr = proArr.substring(0,proArr.length - 1)
- this.http.post('/project/batchDeleteProject',{
- projectIdArray: JSON.stringify(proArr)
- },res => {
- if(res.code == 'ok'){
- this.$message({
- message: '删除成功',
- type: 'success'
- })
- this.getList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 批量添加项目参与人
- addProPreson(){
- if(this.checkedProjectArr.length == 0){
- this.$message('请选择项目')
- return
- }
- this.addGroupPersonDialog = true
- this.isAddGroupPerson = false
- },
- addProPersonSure(){
- if(this.addGroupPersonData.person == null){
- this.$message({
- message: '请选择人员',
- type: 'warning'
- })
- return
- }
- let proArr = []
- for(let i=0;i<this.checkedProjectArr.length;i++){
- proArr.push(this.checkedProjectArr[i].id)
- // proArr += this.checkedProjectArr[i].id + ','
- }
- // proArr = proArr.substring(0,proArr.length - 1)
- this.http.post('/project/batchSetParticipation',{
- userIds: JSON.stringify(this.addGroupPersonData.person),
- projectIdArray: JSON.stringify(proArr)
- },res => {
- if(res.code == 'ok'){
- this.addGroupPersonDialog = false,
-
- this.batchSetWudulistBtn1()
- this.$message({
- message: '添加成功',
- type: 'success'
- })
- this.getList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- filterNode(value, data) {
- if (!value) return true;
- return data.label.indexOf(value) !== -1;
- },
- //重启项目
- restartPro(row) {
- this.http.post('/project/start',{id: row.id},
- res => {
- if (res.code == "ok") {
- this.$message({
- message: '重启成功',
- type: "success"
- });
- row.status = 1;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //撤销项目
- cancelPro(row) {
- this.http.post('/project/cancel',{id: row.id},
- res => {
- if (res.code == "ok") {
- this.$message({
- message: '撤销成功',
- type: "success"
- });
- row.status = 3;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 暂停项目
- suspendPro(row) {
- this.http.post('/project/suspend',{id: row.id},
- res => {
- if (res.code == "ok") {
- this.$message({
- message: '暂停成功',
- type: "success"
- });
- row.status = 4;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //完成项目
- finishPro(row) {
- this.http.post('/project/finish',{id: row.id},
- res => {
- if (res.code == "ok") {
- this.$message({
- message: '项目完成',
- type: "success"
- });
- row.status = 2;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- exportProjectData() {
- //导出项目
- this.http.post('/project/exportData',{},
- res => {
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', '项目导出.xls');// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- userssHu() {
- this.http.post('/time-type/getCompanyTimeSetting',{
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.yonghuUser = res.data
- console.log(this.yonghuUser)
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- yanjiuzx() {
- this.http.post('/report-extra-degree/getAll ',{},
- res => {
- if (res.code == "ok") {
- console.log(res, '过来的数据')
- this.ause = res.data
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- selectPublic() {
- if (this.addForm.isPublic == 1) {
- this.participator = this.users;
- } else {
- this.participator = [];
- }
- },
- addPpMemb() {
- //检查合计比例是否到达100%
- let p = 0;
- let hasNoMemb = false;
- this.curProfessionRow.membList.forEach(m=>{
- p += parseInt(m.percentage);
- //检查人员是否选择
- if (m.membId == null) {
- hasNoMemb = true;
- }
- });
- if (hasNoMemb) {
- this.$message({
- message: '专业人员不能为空',
- type: "error"
- });
- return;
- }
- //检查人员不能重复
- let hasDuplicate = false;
- this.curProfessionRow.membList.forEach(m=>{
- if (this.curProfessionRow.membList.filter(innerM=>innerM.membId == m.membId).length>1) {
- hasDuplicate = true;
- }
- });
- if (hasDuplicate) {
- this.$message({
- message: '专业人员不能重复',
- type: "error"
- });
- return;
- }
- if (p != 100) {
- this.$message({
- message: '占比合计必须是100%',
- type: "error"
- });
- return;
- }
-
- this.editPpMembDialog = false;
- this.curProfessionRow.membList.forEach(m=>{
- m.membName = this.participator.filter(p=>p.id == m.membId)[0].name;
- });
- this.projectProfessionItem.membList = JSON.parse(JSON.stringify(this.curProfessionRow.membList));
- },
- //删除专业人员
- deleteMembItem(index) {
- this.curProfessionRow.membList.splice(index,1);
- },
- //添加专业人员
- addMembItem() {
- if (this.curProfessionRow.membList == null) {
- this.curProfessionRow.membList = [{membId:null, percentage:100}];
- } else {
- let p = 0;
- this.curProfessionRow.membList.forEach(m=>{
- p += parseInt(m.percentage);
- });
- this.curProfessionRow.membList.push({membId:null, percentage:100-p});
- }
- this.$forceUpdate();
- },
- showEditPpMembs(row) {
- this.projectProfessionItem = row;
- this.curProfessionRow = JSON.parse(JSON.stringify(row));
- if (this.curProfessionRow.membList == null || this.curProfessionRow.membList.length == 0) {
- this.curProfessionRow.membList = [{membId:null, percentage:100}];
- }
- this.editPpMembDialog = true;
- },
- getProjectNotifyUserList(projectId) {
- this.http.post("/project-notify-user/get", {projectId: projectId},
- res => {
- if (res.code == "ok") {
- var chosenLeaderIds = [];
- var chosenLeaderNames = '';
- var leaderList = res.data;
- this.chosenLeaders = leaderList;
- for(var j in leaderList) {
- chosenLeaderIds.push(leaderList[j].userId)
- chosenLeaderNames += leaderList[j].userName+',';
- }
- if (chosenLeaderNames.length > 0) {
- chosenLeaderNames = chosenLeaderNames.substring(0, chosenLeaderNames.length -1);
- }
- this.addForm.notifyUserIds = chosenLeaderIds;
- this.addForm.notifyUserNames = chosenLeaderNames;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getProjectProfessions(projectId) {
- this.http.post("/project-profession/get", {projectId: projectId},
- res => {
- if (res.code == "ok") {
- this.projectProfessionList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- checkProjectProfession() {
- //检查合计比例是否到达100%
- let p = 0;
- let hasNoMemb = false;
- let hasNoProfession = false;
- let hasNoMembList = false;
- this.projectProfessionList.forEach(m=>{
- p += parseInt(m.percentage);
- //检查人员是否选择
- if (m.inchargerId == null) {
- hasNoMemb = true;
- }
- if (m.professionId == null) {
- hasNoProfession = true;
- }
- if (m.membList == null) {
- hasNoMembList = true;
- }
- });
-
- if (hasNoProfession) {
- this.$message({
- message: '专业不能为空',
- type: "error"
- });
- return false;
- }
- if (hasNoMembList) {
- this.$message({
- message: '专业相关人员不能为空',
- type: "error"
- });
- return false;
- }
- if (hasNoMemb) {
- this.$message({
- message: '专业负责人不能为空',
- type: "error"
- });
- return false;
- }
- //检查专业不能重复
- let hasDuplicate = false;
- this.projectProfessionList.forEach(m=>{
- if (this.projectProfessionList.filter(innerM=>innerM.professionId == m.professionId).length>1) {
- hasDuplicate = true;
- }
- });
- if (hasDuplicate) {
- this.$message({
- message: '专业不能重复',
- type: "error"
- });
- return false;
- }
- if (this.projectProfessionList.length > 0 && p != 100) {
- this.$message({
- message: '专业占比合计必须是100%',
- type: "error"
- });
- return false;
- }
- return true;
- },
- //保存项目专业
- saveProjectProfessions(projectId) {
- var list = this.projectProfessionList.filter(p=>p.professionId != null);
- list.forEach(p=>p.inchargerName = this.participator.filter(m=>m.id == p.inchargerId)[0].name);
- list.forEach(p=>p.professionName = this.professionList.filter(m=>m.id == p.professionId)[0].name);
- this.http.post("/project-profession/modify", {projectId: projectId, json: JSON.stringify(list)},
- res => {
- if (res.code == "ok") {
-
- return false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //删除项目专业
- deleteItem(index) {
- this.projectProfessionList.splice(index,1);
- },
- //添加项目专业
- addItem() {
- let p = 0;
- this.projectProfessionList.forEach(m=>{
- p += parseInt(m.percentage);
- });
- this.projectProfessionList.push( { professionId:null, inchargerId:null,membIds:[], percentage: 100-p});
- },
- getProfessionList() {
- this.http.post("/profession/getAll", {},
- res => {
- if (res.code == "ok") {
- var list = res.data;
- this.professionList = list;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- restrictNumber(targetId) {
- let inpu = document.getElementById(targetId);
- inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
- inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
- inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
- inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
- if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
- inpu.value = parseFloat(inpu.value);
- }
- },
- showChooseLeaderTree() {
- this.chosenMembCount = this.chosenLeaders.length;
- this.chooseLeaderVisible = true;
- },
- onLeaderTreeItemChange() {
- var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- showChooseMembTree() {
- this.chosenMembCount = this.participator.length;
- this.chooseParticipVisible = true;
- this.filterText = ''
- },
- onTreeItemChange() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- findUserInTree() {
- if (this.filterName == '') {
- this.deptMembData = this.allMembData;
- } else {
- var list = this.findRecursively(this.filterName, this.allMembData);
- this.deptMembData = list;
- }
- },
- findRecursively(username, list) {
- var filterList = [];
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == 1) {
- if (list[i].label.indexOf(username) >= 0) {
- //匹配上了
- filterList.push(list[i]);
- }
- } else if (list[i].children != null && list[i].children.length > 0) {
- var subList = this.findRecursively(username, list[i].children);
- if (subList.length > 0) {
- subList.forEach(s=>filterList.push(s));
- }
- }
- }
- return filterList;
- },
- //确定选择参与人
- chooseParticip() {
- this.chooseParticipVisible = false;
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
- this.addForm.userNames = '';
- this.addForm.userId = [];
- this.participator = [];
- for (var i=0;i<this.chosenMembList.length; i++) {
- this.addForm.userId.push(this.chosenMembList[i].id);
- this.addForm.userNames += this.chosenMembList[i].label+',';
- var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
- this.participator.push(item);
- }
- if (this.addForm.userNames.length > 0) {
- this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
- }
- },
- //选中相关领导
- chooseLeader() {
- this.chooseLeaderVisible = false;
- var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
- var chosenMembList = chosenList.filter(item=>item.isUser == 1);
- this.addForm.notifyUserNames = '';
- this.addForm.notifyUserIds = [];
- this.chosenLeaders = [];
- for (var i=0;i<chosenMembList.length; i++) {
- this.addForm.notifyUserIds.push(chosenMembList[i].id);
- this.addForm.notifyUserNames += chosenMembList[i].label+',';
- var item = {userId:chosenMembList[i].id, userName:chosenMembList[i].label};
- this.chosenLeaders.push(item);
- }
- if (this.addForm.notifyUserNames.length > 0) {
- this.addForm.notifyUserNames = this.addForm.notifyUserNames.substring(0, this.addForm.notifyUserNames.length-1);
- }
- },
- // 获取部门列表
- getDepartment() {
- this.http.post("/department/listAllMemb", {},
- res => {
- if (res.code == "ok") {
- var list = res.data;
- //设置员工到部门下面
- this.setUserToDept(list);
- this.deptMembData = list;
- //用于筛选过滤
- this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
-
- setUserToDept(list) {
- for (var i in list) {
- if (list[i].children != null) {
- this.setUserToDept(list[i].children);
- }
-
- if (list[i].userList != null) {
- if (list[i].children == null) {
- list[i].children = [];
- }
- list[i].userList.forEach(element => {
- var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
- list[i].children.push(obj);
- });
- }
- }
- },
- // 获取分类条目
- getClfConfigList() {
- this.http.get('/project-category/list',
- res => {
- if (res.code == "ok") {
- this.baseClfList = res.data;
- console.log("获取分类条目",res.data);
- this.$forceUpdate();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
-
- },
- // 新增/编辑 分类条目
- addNewClf(row) {
- this.addClfDialog = true;
- if (row == null) {
- this.addClf = {}
- } else {
- this.addClf = row;
- }
- },
- // 提交
- submitClf() {
- this.http.post('/project-category/addOrMod',this.addClf,
- res => {
- if (res.code == "ok") {
- this.addClfDialog = false;
- this.baseClfList = res.data;
- // this.$forceUpdate();
- // console.log(res.data);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- // 提交
- submitManPro() {
- this.http.post('/project-main/addOrMod',this.addMainForm,
- res => {
- if (res.code == "ok") {
- this.addFlgmainProjectDialog = false;
- this.getMainProject()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- // 提交项目阶段
- submitPanthPro() {
- this.http.post('/project-stage/addOrMod',this.addPanthForm,
- res => {
- if (res.code == "ok") {
- this.addFlgPanthProjectDialog = false;
- this.obtainPhase()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- // 删除
- deleteClf(row) {
- this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除分类条目", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/project-category/delete',{
- id: row.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getClfConfigList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- // 删除主项目
- deleteManPro(row) {
- this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除主项目", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/project-main/delete',{
- id: row.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getMainProject();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- // 删除项目阶段
- deletePanthPro(row) {
- this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除项目阶段", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/project-stage/delete ',{
- id: row.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.obtainPhase();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- // 分类筛选
- searchClfList(){
- this.page = 1;
- this.getList();
- },
-
- getProjectBaseConfigList() {
- this.http.post('/project-basecost-setting/list',{},
- res => {
- if (res.code == "ok") {
- this.baseCostItemList = res.data;
- this.$forceUpdate();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
-
- },
- deleteBaseItem(row) {
- this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除成本基线项", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/project-basecost-setting/delete',{
- id: row.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getProjectBaseConfigList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- submitInsertBaseItem() {
- this.http.post('/project-basecost-setting/addOrMod',this.addForm,
- res => {
- if (res.code == "ok") {
- this.addBaseItemDialog = false;
- this.baseCostItemList = res.data;
- this.$forceUpdate();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- showBaseCostItemDialog() {
- this.showBaseConfig = true;
- },
- addNewBaseItem(row) {
- this.addBaseItemDialog = true;
- if (row == null) {
- this.addForm = {alarmType: 0}
- } else {
- this.addForm = row;
- }
- },
- //获取客户列表
- getCustomerList() {
- this.http.post('/customer-info/getAll', {
- },
- res => {
- if (res.code == "ok") {
- this.customerList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- importProject(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: "请选择.xls或.xlsx文件",
- type: "error"
- });
- } else {
- this.listLoading = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("userId", this.user.id);
- this.http.uploadFile('/project/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.listLoading = false;
- if (res.code == "ok") {
- // this.$message({
- // message: res.data,
- // type: "success"
- // },5000);
- //弹窗显示
- this.showImportResult = true;
- this.importResultMsg = res.data;
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- number(){
- // this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
- // this.addForm.budget = this.addForm.budget.replace('.','');
- },
- deleteSubPro(subProject) {
- this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/sub-project/deleteProject',{
- id: subProject.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.subProject(this.currentProject);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- searchList() {
- this.page = 1;
- this.getList();
- },
- addNewSubProject(subProject) {
- if (subProject == null) {
- this.temaddForm = {projectId: this.currentProject.id, level:1}
- } else {
- this.temaddForm = JSON.parse(JSON.stringify(subProject));
- }
- this.addSubProject = true;
- },
- //显示子项目
- subProject(item) {
- this.subProjectVisible = true;
- this.currentProject = item;
- this.http.post('/sub-project/list', {
- projectId: item.id
- },
- res => {
- if (res.code == "ok") {
- this.subProjectList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //显示用户详情
- showUser(userId) {
- this.userDetailVisible = true;
- this.http.post(this.port.manage.userDetail, {
- userId: userId
- },
- res => {
- if (res.code == "ok") {
- this.userDetail = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //选择参与人
- changeParticipator() {
- //检查是否在参与人中,如果没有需要加入到参与人中
- this.participator = [];
- this.addForm.userId.forEach(u=>{
- var list = this.users.filter(au=>au.id == u);
- if (list.length > 0) {
- var findUser = list[0];
- this.participator.push(findUser);
- } else {
- console.log('未找到用户: '+u);
- }
-
- })
- },
- getUsers() {
- this.http.post(this.port.manage.list, {
- departmentId: -1,
- pageIndex: 1,
- // pageSize: 99999
- pageSize: -1
- },
- res => {
- if (res.code == "ok") {
- this.users = res.data.records;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //分页
- handleCurrentChange(val) {
- this.page = val;
- this.getList();
- },
- handleSizeChange(val) {
- this.size = val;
- localStorage.projectPageSize = this.size;
- this.getList();
- },
- //获取项目列表
- getList() {
- this.listLoading = true;
- let parameter = {
- pageIndex: this.page,
- pageSize: this.size,
- keyword:this.keyword,
- searchField: this.searchField,
- status: this.status,
- category: this.statusClf,
- projectMainId: this.projectMainId
- }
- if(this.sortOrder){
- if(this.sortProp == 'inchargerName'){
- parameter.sortProp = "incharger_id"
- }else if(this.sortProp == 'customerName'){
- parameter.sortProp = "customer_id"
- }else if(this.sortProp == 'projectCode'){
- parameter.sortProp = 'project_code'
- }else if(this.sortProp == 'categoryName'){
- parameter.sortProp = 'category'
- }else if(this.sortProp == 'projectName'){
- parameter.sortProp = 'project_name'
- }else if(this.sortProp == 'status'){
- parameter.sortProp = 'status'
- }else if(this.sortProp == 'currentStage'){
- parameter.sortProp = 'current_stage'
- }
- if(this.sortOrder == 'descending'){
- parameter.sortOrder = 0
- }else if(this.sortOrder == 'ascending'){
- parameter.sortOrder = 1
- }
- }
- this.http.post(this.port.project.listPage, parameter,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- var list = res.data.records;
- for(var i in list) {
- var participator = list[i].participator , str = "";
- for(var j in participator) {
- if(j == participator.length-1) {
- str += participator[j].name
- } else {
- str += participator[j].name + ','
- }
- }
- list[i].userNames = str;
- }
- this.showColumnWidth = this.showColumn(list)
- this.list = list;
- this.total = res.data.total;
- this.$nextTick(()=>{
- this.$refs.projectlistOfWudulist.doLayout();
- })
- this.listHeader = res.data.nameList
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- showColumn(list){
- if(!this.permissions.projectManagement){
- let creat = false
- let incha = false
- for(let i in list){
- if(this.user.id == list[i].creatorId){
- creat = true
- }
- if(this.user.id == list[i].inchargerId){
- incha = true
- }
- }
- if(creat){
- return '300'
- }else {
- if(incha){
- return '210'
- }else {
- return '0'
- }
- }
- }else {
- return '300'
- }
- },
- //显示新增界面
- handleAdd(i, item) {
- if(i == -1) {
- this.title = "新增项目";
- this.addForm = {
- name: '',
- isPublic:0,
- userId: [],
- userNames:'',
- code:'',
- inchargerId:null,
- level:1,
- customerId:null,
- notifyUserNames:'',
- chosenLeaders:[],
- category:null,
- creatorId: this.user.id,
- projectMainId: ''
- }
- this.projectBaseCostData = [];
- this.auseList = [];
- for (var m=0;m<this.baseCostItemList.length; m++) {
- this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
- }
- } else {
- this.title = "修改项目";
- var list = item.participator;
- if (item.isPublic == 1) {
- list = this.users;
- }
- var arr = [];
- var names = '';
- for(var j in list) {
- arr.push(list[j].id)
- names += list[j].name+',';
- }
- if (names.length > 0) {
- names = names.substring(0, names.length -1);
- }
-
- this.addForm = {
- id: item.id,
- name: item.projectName,
- isPublic: item.isPublic,
- userId: arr,
- userNames:names,
- code:item.projectCode,
- inchargerId: item.inchargerId,
- level: item.level,
- planStartDate: item.planStartDate,
- planEndDate: item.planEndDate,
- budget: item.budget,
- baseMan: item.baseMan,
- contractAmount: item.contractAmount,
- baseFee: item.baseFee,
- baseRisk1: item.baseRisk1,
- baseRisk2: item.baseRisk2,
- baseOutsourcing: item.baseOutsourcing,
- customerId:item.customerId==0?null:item.customerId,
- category:item.category,
- projectDesc: item.projectDesc,
- projectMainId: item.projectMainId,
- creatorId: item.creatorId
- }
- // 判断是否有供应商
- if(this.user.company.packageProvider) {
- // this.addForm.supplierId = item.providerIds.split(',')
- if(item.providerIds) {
- let arr = []
- let zhhi = item.providerIds.split(',')
- for(let i in zhhi) {
- arr.push(+zhhi[i] + 0)
- }
- this.$set(this.addForm, 'supplierId', arr)
- console.log( this.addForm.supplierId)
- } else {
- this.$set(this.addForm, 'supplierId', [])
- }
-
- }
- // 判断是否有供应商结尾
- this.deleteVif = item.creatorId
- console.log("handleadd",this.deleteVif,this.addForm.id)
- if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
- var spli = item.associateDegrees.split(',')
- var sl = []
- for(var i in spli) {
- var num = +spli[i] + 0
- sl.push(num)
- }
- this.auseList = sl
- // console.log(this.auseList)
- } else {
- this.auseList = []
- }
- // var spli = item.associateDegrees.split(',')
- // var sl = []
- // for(var i in spli) {
- // var num = +spli[i] + 0
- // sl.push(num)
- // }
- // this.auseList = sl
- // console.log(this.auseList)
- this.changeParticipator();
- this.getProjectBaseData(item.id);
- if (this.user.company.packageEngineering == 1) {
- this.getProjectProfessions(item.id);
-
- }
- //获取项目的相关领导
- this.getProjectNotifyUserList(item.id);
- this.getProjectAutorList(item.id);
- }
- this.addFormVisible = true;
- if (this.user.company.packageEngineering == 1) {
- if (this.professionList.length == 0) {
- this.getProfessionList();
- }
- }
- },
- //获取项目审核人
- getProjectAutorList(projectId) {
- this.http.post('/project-auditor/getList',{projectId: projectId},
- res => {
- if (res.code == "ok") {
- this.addForm.auditUserIds = res.data.map(function(item) {
- return item.auditorId;
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- getProjectBaseData(projectId) {
- this.http.post('/project-basecost/get',{projectId: projectId},
- res => {
- if (res.code == "ok") {
- this.projectBaseCostData = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //提交子项目创建修改请求
- submitInsertSubProject () {
- this.$refs.form2.validate(valid => {
- if (valid) {
- this.http.post('/sub-project/saveOrUpdate',this.temaddForm,
- res => {
- if (res.code == "ok") {
- this.$message({
- message: "操作成功",
- type: "success"
- });
- this.subProject(this.currentProject);
- this.addSubProject = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- });
- },
- // 项目基线合计
- addUpfun() {
- var total = 0;
- for (var i=0;i<this.projectBaseCostData.length; i++) {
- total += parseFloat(this.projectBaseCostData[i].baseAmount);
- }
- this.addForm.budget = total;
- // var a = '0'
- // var q = '0'
- // var w = '0'
- // var e = '0'
- // var r = '0'
- // // this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
- // if (this.addForm.baseMan == undefined || this.addForm.baseMan == NaN) {
- // a = 0
- // } else {
- // a = this.addForm.baseMan
- // }
- // if (this.addForm.baseFee !== undefined) q = this.addForm.baseFee
- // if (this.addForm.baseOutsourcing !== undefined) w = this.addForm.baseOutsourcing
- // if (this.addForm.baseRisk1 !== undefined) e = this.addForm.baseRisk1
- // if (this.addForm.baseRisk2 !== undefined) r = this.addForm.baseRisk2
- // this.addForm.budget = +a + +q + +w + +e + +r
- },
- submitInsert() {
- this.$refs.form1.validate(valid => {
- if (valid) {
- if (this.user.company.packageEngineering == 1) {
- if (!this.checkProjectProfession()) {//检查不通过,直接返回
- return;
- }
- }
- this.addLoading = true;
- let formData = new FormData();
- formData.append("name", this.addForm.name);
- if(this.addForm.projectDesc != null) {
- formData.append("projectDesc", this.addForm.projectDesc);
- }
- if(this.addForm.id != null) {
- formData.append("id", this.addForm.id);
- }
- if(this.addForm.isPublic != null) {
- formData.append("isPublic", this.addForm.isPublic);
- }
- if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
- for(var j in this.addForm.userId) {
- formData.append("userId", this.addForm.userId[j]);
- }
- }
- if(this.addForm.inchargerId != null) {
- formData.append("inchargerId", this.addForm.inchargerId);
- }
- if(this.addForm.code != null) {
- formData.append("code", this.addForm.code);
- }
- if(this.addForm.planStartDate != null) {
- formData.append("planStartDate", this.addForm.planStartDate);
- }
- if(this.addForm.planEndDate != null) {
- formData.append("planEndDate", this.addForm.planEndDate);
- }
- if(this.addForm.level != null) {
- formData.append("level", this.addForm.level);
- }
- if(this.addForm.contractAmount != null) {
- formData.append("contractAmount", this.addForm.contractAmount);
- }
- if (this.projectBaseCostData != null) {
- formData.append("projectBaseCostData", JSON.stringify(this.projectBaseCostData));
- //计算总预算成本
- if (this.addForm.budget == null) {
- this.addForm.budget = 0;
- }
- formData.append("budget", this.addForm.budget);
- }
- if (this.addForm.customerId == null) {
- formData.append("customerId", 0);
- } else {
- formData.append("customerId", this.addForm.customerId);
- }
- if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
- formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
- }
- var listId = []
- var listName = []
- for(var i in this.auseList) {
- for(var j in this.ause) {
- if(this.auseList[i] == this.ause[j].id) {
- listId.push(this.ause[j].id);
- listName.push(this.ause[j].name);
- break;
- }
- }
- }
- listId.toString()
- listName.toString()
- formData.append("associateDegrees", listId)
- formData.append("associateDegreeNames", listName)
- //日报审核人
- formData.append("auditUserIds", JSON.stringify(this.addForm.auditUserIds));
- if(this.addForm.category != null) {
- formData.append("category", this.addForm.category);
- }
- if(this.user.timeType.mainProjectState == '1' && this.addForm.projectMainId) {
- formData.append("projectMainId", this.addForm.projectMainId);
- }
- // 提交供应商
- // 线判断是否有供应商
- if(this.user.company.packageProvider) {
- let suppStrName = []
- for(let is in this.addForm.supplierId) {
- for(let js in this.supplierList) {
- if(this.addForm.supplierId[is] == this.supplierList[js].id) {
- suppStrName.push(this.supplierList[js].providerName)
- }
- }
- }
- formData.append("providerNames", suppStrName.toString());
- formData.append("providerIds", this.addForm.supplierId.toString());
- }
- // formData.append("associateDegreeNames", listName)
- // console.log("addform",this.addForm);
- // return
- this.http.uploadFile(this.port.project.add,formData,
- res => {
- this.addLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: (this.addForm.id!=null?'修改':'创建')+"成功",
- type: "success"
- });
- this.addFormVisible = false;
- this.getList();
- if (this.user.company.packageEngineering == 1) {
- this.saveProjectProfessions(res.data);
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.addLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- });
- },
- // 删除
- deletePro(i, item) {
- this.$confirm("确定要删除项目[" + item.name + "]吗?","删除项目", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post(this.port.project.delete,{
- id: item.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getList();
- this.addFormVisible = false
- } else if (res.code == 'reconfirm') {
- this.deleteAlertMsg = res.msg;
- this.forceDeletePro(item.id);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- // 模板下载
- downloadmb(){
- this.http.post('/project/getTemplate',{
- companyId: this.user.companyId
- },res => {
- if(res.code == 'ok'){
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- var fileName = filePath.split('/')[2];
- a.setAttribute('download', fileName);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- //强制删除项目
- forceDeletePro(deleteProId) {
- this.$confirm(this.deleteAlertMsg,"删除项目", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post(this.port.project.delete,{
- id: deleteProId ,force:1
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getList();
- this.addFormVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- detail(i) {
- this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
- }
- },
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 195;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 195;
- };
- },
- mounted() {
- this.userssHu()
- this.getDepartment();
- this.getList();
- this.getUsers();
- this.getCustomerList();
- this.getProjectBaseConfigList();
- this.getClfConfigList()
- this.yanjiuzx()
- // 判断是否有供应商字段
- if(this.user.company.packageProvider == 1){
- this.getSupplierList()
- // this.getPhase()
- }
- if(this.user.company.packageProject == 1) {
- this.obtainPhase()
- }
- // this.getSupplierList()
- if(this.user.timeType.mainProjectState == 1){
- this.getMainProject()
- }
- if(this.user.timeType.projectLevelState == 1){
- this.getProjectLevel()
- }
- // 判断释放为专业版
- if(this.user.company.packageProject == 1) {
- this.importanceList = [{id:1,label:'正常'},{id:5,label:'低风险'},{id:6,label:'中风险'},{id:7,label:'高风险'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}]
- } else {
- this.importanceList = [{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}]
- }
-
- }
- };
- </script>
- <style lang="scss" scoped>
- .rg_span{
- display: inline-block;
- }
- .rg_span span {
- text-align: right;
- box-sizing: border-box;
- padding-right: 10px;
- }
- .el-dialog__title {
- display: inline-table;
- margin-top: 20px;
- }
- .addss {
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- // 111
- </style>
- <style>
- .el-dropdown-link {
- color: #409EFF;
- }
- .customdropdown{
- margin-left: 10px;
- }
- .customdropdown .el-dropdown__caret-button{
- height: 27px;
- }
- .customdropdown .el-button--mini:nth-child(1){
- height: 27px;
- }
- .customdropdown_menu{
- padding: 0;
- }
- .customdropdown_menu_btn{
- border-color: transparent;
- }
- .ganttdialog .el-dialog__body{
- height: 550px;
- }
- .toolbar_formitem_n1{
- margin-right: 0 !important;
- }
- </style>
|