| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343 |
- <!-- 项目管理--项目信息 -->
- <template>
- <el-drawer
- :title="title"
- :visible.sync="visible"
- direction="rtl"
- :append-to-body="true"
- size="100%"
- >
- <el-row :gutter="5">
- <el-col :span="3">
- <el-card class="box-card" style="height: calc(100vh - 56px)">
- <AssetTree
- @handleNodeClick="handleNodeClick1"
- :defaultExpandAll="true"
- code="XM1"
- :isProjects="true"
- :isFirstRefreshTable="false"
- ref="treeList"
- :init="false"
- />
- </el-card>
- <!-- <div style="padding: 5px;">
-
- </div> -->
- </el-col>
- <el-col :span="21">
- <el-card class="box-card">
- <div style="width: 100%">
- <el-row style="font-size: 16px">
- <el-col :span="5" style="color: #1890ff"
- >项目名称:{{ rowData.name }}
- </el-col>
- <el-col :span="5"
- >项目预算:{{
- rowData.budget
- ? rowData.budget +
- this.getDictV('pro_projects_budget_unit', rowData.unit)
- : ''
- }}
- </el-col>
- <el-col :span="5"
- >项目经理:{{ rowData.responsibleUserName }}
- </el-col>
- <el-col :span="5">项目周期:{{ rowData.cycle }} </el-col>
- <el-col :span="4"
- >项目状态:{{
- getDictV('pro_projects_status', rowData.status)
- }}</el-col
- >
- </el-row>
- </div>
- </el-card>
- <el-card class="card_2_box card" style="height: calc(100vh - 130px)">
- <el-row :gutter="24">
- <el-col :span="3" style="padding: 0">
- <div class="el_tree_box">
- <div
- style="
- margin-bottom: 6px;
- display: flex;
- justify-items: flex-start;
- "
- >
- <el-button
- style="width: 50%"
- type="primary"
- :class="{ current_button: leftTreeActiveName == 'BOM维度' }"
- size="small"
- plain
- @click="handleLeftTreeActiveName('BOM维度')"
- >BOM维度
- </el-button>
- <el-button
- style="width: 50%"
- type="primary"
- :class="{
- current_button: leftTreeActiveName == '阶段维度'
- }"
- size="small"
- plain
- @click="handleLeftTreeActiveName('阶段维度')"
- >阶段维度
- </el-button>
- </div>
- <el-input
- v-model="filterText"
- placeholder="在结构中查找"
- size="small"
- clearable
- style="margin-bottom: 3px"
- >
- </el-input>
- <el-tree
- class="project_tree"
- ref="treeRef"
- :data="treeList"
- :default-expanded-keys="
- currentNodeData && currentNodeData.id
- ? [currentNodeData.id]
- : []
- "
- :expand-on-click-node="false"
- :highlight-current="true"
- :indent="0"
- :props="defaultProps"
- node-key="id"
- style="height: 100%"
- :filter-node-method="filterNode"
- @node-click="handleNodeClick"
- >
- <div
- style="width: 100%; height: 100%; display: flex"
- slot-scope="{ node, data }"
- @contextmenu.stop="(e) => showRightMenu(e, node, data)"
- >
- <span class="custom-tree-node">
- <span
- :style="fontSize(node, data)"
- class="label_img"
- :class="getIconClass(node, data)"
- ></span>
- <span :style="fontSize(node, data)" class="label">{{
- node.label
- }}</span>
- </span>
- <vue-context-menu
- :transferIndex="0"
- :class="
- 'vue-contextmenuName-' +
- data.id +
- '_' +
- data.name +
- '_rightMenu'
- "
- v-if="
- data.id + '_' + data.name + '_rightMenu' ==
- contextMenuData.menuName
- "
- :contextMenuData="contextMenuData"
- @updateProject="
- () => handleUpdateProject(node, data, 'edit')
- "
- @removeBom="() => bomRemove(node, data)"
- @stageRemove="() => stageRemove(node, data)"
- @addBOM="() => addOrEditBOM('add', node, data)"
- @editBOM="() => addOrEditBOM('edit', node, data)"
- @addChildProject="
- () => handleUpdateProject(node, data, 'add')
- "
- @addStage="() => handleAddStage(node, data, 'add')"
- @addPlan="() => handleAddPlan('add', node, data)"
- @addTask="() => handleAddTask('add', node, data)"
- @handleTermination="
- () =>
- handleStatus(
- projectsTerminationAPI,
- '确定终止该项目吗?',
- node,
- data
- )
- "
- @handlePause="
- () =>
- handleStatus(
- projectsPauseAPI,
- '确定暂停该项目吗',
- node,
- data
- )
- "
- @handleStartup="
- () =>
- handleStatus(
- projectsStartupAPI,
- '确定启动该项目吗',
- node,
- data
- )
- "
- @handleFinish="
- () =>
- handleStatus(
- projectsFinishAPI,
- '确定完成该项目吗',
- node,
- data
- )
- "
- @handleBomTermination="
- () =>
- handleStatus(
- projectsBomTerminationAPI,
- '确定终止该BOM吗?',
- node,
- data
- )
- "
- @handleBomPause="
- () =>
- handleStatus(
- projectsBomPauseAPI,
- '确定暂停该BOM吗',
- node,
- data
- )
- "
- @handleBomStartup="
- () =>
- handleStatus(
- projectsBomStartupAPI,
- '确定启动该BOM吗',
- node,
- data
- )
- "
- @handleBomFinish="
- () =>
- handleStatus(
- projectsBomFinishAPI,
- '确定完成该BOM吗',
- node,
- data
- )
- "
- @handleStageTermination="
- () =>
- handleStatus(
- projectsStageTerminationAPI,
- '确定终止该项目阶段吗?',
- node,
- data
- )
- "
- @handleStagePause="
- () =>
- handleStatus(
- projectsStagePauseAPI,
- '确定暂停该项目阶段吗',
- node,
- data
- )
- "
- @handleStageStartup="
- () =>
- handleStatus(
- projectsStageStartupAPI,
- '确定启动该项目阶段吗',
- node,
- data
- )
- "
- @handleStageFinish="
- () =>
- handleStatus(
- projectsStageFinishAPI,
- '确定完成该项目阶段吗',
- node,
- data
- )
- "
- ></vue-context-menu>
- </div>
- </el-tree>
- </div>
- </el-col>
- <el-col :span="21" style="height: calc(100vh - 170px)">
- <ele-split-layout
- :left-style="{
- overflow: 'hidden',
- width: '100%'
- }"
- :vertical="true"
- style="height: calc(100vh - 180px)"
- :min-size="1"
- :resizable="true"
- :responsive="true"
- :width="
- activeName == '任务' || activeName == '计划'
- ? '450px'
- : '100%'
- "
- :right-style="{ overflow: 'hidden' }"
- :allow-collapse="false"
- >
- <div class="card_2_layout_content">
- <el-tabs
- v-model="activeName"
- class="tab-box_1"
- type="border-card"
- @tab-click="handleTabs1"
- >
- <el-tab-pane label="基本信息" name="基本信息">
- <div style="padding: 0 10px">
- <attribute
- v-if="currentNodeData.type == 1"
- ref="attributeRef"
- :dialog-type="dialogType"
- ></attribute>
- <project-form
- v-if="[0, 2].includes(currentNodeData.type)"
- ref="projectForm"
- :deptList="deptList"
- :deptTreeList="deptTreeList"
- :dialogForm="dialogForm"
- :teamList="teamList"
- dialog-type="view"
- ></project-form>
- </div>
- </el-tab-pane>
- <el-tab-pane
- v-if="[0, 2].includes(currentNodeData.type)"
- label="项目阶段"
- name="项目阶段"
- class="el-tab-pane-tree"
- >
- <project-info-table
- v-if="[0, 2].includes(currentNodeData.type)"
- ref="projectInfoTable"
- :dialog-type="dialogType"
- :dialogForm="dialogForm"
- :deptList="deptList"
- :deptTreeList="deptTreeList"
- :userList="userList"
- :responsibleDeptId="responsibleDeptId"
- ></project-info-table>
- </el-tab-pane>
- <el-tab-pane
- label="计划"
- name="计划"
- class="el-tab-pane-tree"
- style="overflow: scroll"
- >
- <div style="padding: 0 10px">
- <planManageList
- :tableHeight="'300px'"
- :projectType="currentNodeData.type"
- :ids="currentNodeData.id"
- @handlePlanTableNodeClick="handlePlanTableNodeClick"
- v-if="refreshPlan"
- ></planManageList>
- </div>
- </el-tab-pane>
- <el-tab-pane
- label="任务"
- name="任务"
- class="el-tab-pane-tree"
- >
- <ele-pro-table
- class="el-table"
- ref="table"
- row-key="id"
- :columns="columns"
- :datasource="taskTree"
- height="100%"
- :max-height="500"
- @row-click="
- (row) => handleTableNodeClick({ ...row, type: 2 })
- "
- @row-contextmenu="
- (row, column, event) =>
- showTableRightMenu(
- { ...row, type: 2 },
- column,
- event
- )
- "
- :toolkit="[]"
- :default-expand-all="true"
- cache-key="project-initiationTable"
- :tree-props="{ children: 'children' }"
- :need-page="false"
- :indent="0"
- >
- <template v-slot:name="{ row }">
- <span
- v-if="!row.children.length && row.level == 1"
- style="margin-left: 25px; display: inline-block"
- ></span>
- <span class="dot" v-if="row.milepost == '1'"></span>
- <span class="name"> {{ row.name }}</span>
- </template>
- <template v-slot:type="{ row }">
- <el-tag type="info">任务</el-tag>
- </template>
- <template v-slot:speedPercent="{ row }">
- <el-progress
- style="padding: 0 5px"
- :stroke-width="20"
- text-color="#606266"
- :text-inside="true"
- :percentage="row.speedPercent || 0"
- :color="customColorMethod"
- ></el-progress>
- <vue-context-menu
- :transferIndex="0"
- :class="'vue-contextmenuName-' + row.name"
- v-if="row.name == contextTableMenuData.menuName"
- :contextMenuData="contextTableMenuData"
- @addTask="
- () =>
- handleAddTask(
- 'add',
- '',
- { ...row, type: 2 },
- 'plan'
- )
- "
- @updateTask="
- () =>
- handleAddTask(
- 'edit',
- '',
- { ...row, type: 2 },
- 'plan'
- )
- "
- @removeTask="() => handleRemoveTask([row.id])"
- @startTask="
- () =>
- handleStartTask(row, 1, '是否确定执行该任务?')
- "
- @finishTask="
- () =>
- handleStartTask(row, 3, '是否确定报工该任务?')
- "
- @pauseTask="
- () =>
- handleStartTask(row, 2, '是否确定暂停该任务?')
- "
- @terminationTask="
- () =>
- handleStartTask(row, 4, '是否确定终止该任务?')
- "
- @handleTransfer="() => handleTransfer(row)"
- @handleSubmitDeliverables="
- () => handleSubmitDeliverables(row)
- "
- ></vue-context-menu>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane
- label="项目团队"
- name="项目团队"
- class="el-tab-pane-tree"
- >
- <team-info-table
- ref="deliverablesInfoTable"
- dialog-type="view"
- :dialogForm="teamForm"
- ></team-info-table>
- </el-tab-pane>
- <!-- <el-tab-pane
- label="项目看板"
- name="项目看板"
- class="el-tab-pane-tree"
- >
- <project-statistics></project-statistics>
- </el-tab-pane> -->
- <el-tab-pane
- label="项目审核流程"
- name="项目审核流程"
- class="el-tab-pane-tree"
- style="overflow: scroll; padding-bottom: 30px"
- >
- <bpmDetail
- v-if="dialogForm.processInstanceId && bpmDetailFlag"
- :id="dialogForm.processInstanceId"
- ></bpmDetail>
- </el-tab-pane>
- <el-tab-pane
- label="项目行事历"
- name="项目行事历"
- class="el-tab-pane-tree"
- >
- <projectCalendar
- ref="projectCalendarRef"
- ></projectCalendar>
- </el-tab-pane>
- </el-tabs>
- </div>
- <template v-slot:content>
- <el-tabs
- v-if="isShow"
- v-model="attrActiveName"
- class="tab-box_2"
- type="border-card"
- >
- <el-tab-pane label="属性" name="属性">
- <!--currentTableNodeData-->
- <plan-form
- ref="planForm"
- dialog-type="view"
- :dialogForm="rightForm"
- :deptList="deptList"
- :deptTreeList="deptTreeList"
- ></plan-form>
- <base-form
- ref="baseForm"
- v-if="[2].includes(currentTableNodeData.type)"
- dialog-type="view"
- :dialogForm="rightForm"
- :deptList="deptList"
- :deptTreeList="deptTreeList"
- ></base-form>
- </el-tab-pane>
- <el-tab-pane label="计划节点" name="计划节点">
- <plan-info-table
- ref="planInfoTable"
- dialog-type="view"
- :dialogForm="rightForm"
- :deptList="deptList"
- :deptTreeList="deptTreeList"
- ></plan-info-table>
- </el-tab-pane>
- <el-tab-pane
- v-if="[2].includes(currentTableNodeData.type)"
- label="交付物"
- name="交付物"
- class="el-tab-pane-tree"
- >
- <submit-deliverables-info-table
- ref="deliverablesInfoTable"
- :dictList="dictList"
- dialog-type="view"
- :dialogForm="rightForm"
- ></submit-deliverables-info-table>
- </el-tab-pane>
- </el-tabs>
- </template>
- </ele-split-layout>
- </el-col>
- </el-row>
- </el-card>
- </el-col>
- </el-row>
- <add-BOM-dialog
- v-if="addBOMDialogFlag"
- ref="addBOMDialogRef"
- :addBOMDialogFlag.sync="addBOMDialogFlag"
- :treeList="treeList"
- @reload="reload"
- ></add-BOM-dialog>
- <!-- 新增计划 -->
- <add-plan-dialog
- v-if="addPlanDialogFLag"
- @reload="reload"
- :addOrEditDialogFlag.sync="addPlanDialogFLag"
- ref="addPlanDialogRef"
- ></add-plan-dialog>
- <plan-detail-dialog
- v-if="planDetailDialogFlag"
- :detailDialogFlag.sync="planDetailDialogFlag"
- ref="planDetailDialogRef"
- ></plan-detail-dialog>
- <!-- 编辑弹窗 -->
- <add-task-dialog
- v-if="addTaskDialogFlag"
- @reload="reload"
- :addOrEditDialogFlag.sync="addTaskDialogFlag"
- ref="addTaskDialogRef"
- ></add-task-dialog>
- <task-detail-dialog
- v-if="taskDetailDialogFlag"
- :detailDialogFlag.sync="taskDetailDialogFlag"
- ref="taskDetailDialogRef"
- ></task-detail-dialog>
- <transfer-dialog
- ref="transferDialogRef"
- v-if="transferDialogFlag"
- @reload="reload"
- :transferDialogFlag.sync="transferDialogFlag"
- ></transfer-dialog>
- <submit-deliverables-dialog
- ref="submitDeliverablesDialogRef"
- v-if="submitDeliverablesDialogFlag"
- :submitDeliverablesDialogFlag.sync="submitDeliverablesDialogFlag"
- @reload="reload"
- ></submit-deliverables-dialog>
- <!-- 编辑弹窗 -->
- <addOrEditProjectDialog
- v-if="addOrEditProjectDialogFlag"
- @reload="reload"
- :addOrEditDialogFlag.sync="addOrEditProjectDialogFlag"
- ref="addOrEditProjectDialogRef"
- ></addOrEditProjectDialog>
- <!-- 阶段弹窗 -->
- <addOrEditStageDialog
- v-if="addOrEditDialogStageFlag"
- @reload="reload"
- :addOrEditDialogStageFlag.sync="addOrEditDialogStageFlag"
- ref="addOrEditStageDialogRef"
- ></addOrEditStageDialog>
- </el-drawer>
- </template>
- <script>
- import AssetTree from '@/components/AssetTree';
- import { getUserPage } from '@/api/system/organization';
- import p_search from './p_search.vue';
- import {
- projectsBomDeleteAPI,
- projectsBomFinishAPI,
- projectsBomPauseAPI,
- projectsBomStartupAPI,
- projectsBomTerminationAPI
- } from '@/api/project-manage/BOM.js';
- import Attribute from '@/views/BOMmanage/components/attribute.vue';
- import BOMBaseForm from '@/views/BOMmanage/components/BOMBaseForm.vue';
- import addBOMDialog from '@/views/BOMmanage/components/addBOMDialog.vue';
- import {
- getMyProjectsPage,
- getByBomTreeAPI,
- getPlanAndTaskTreeById,
- getProjectStageTree,
- getTaskTreeById,
- projectsFinishAPI,
- projectsGetByIdDetailsAPI,
- projectsPauseAPI,
- projectsStageDeleteAPI,
- projectsStageFinishAPI,
- projectsStagePauseAPI,
- projectsStageStartupAPI,
- projectsStageTerminationAPI,
- projectsStartupAPI,
- projectsTerminationAPI
- } from '@/api/project-manage';
- import projectForm from '@/views/project-manage/project-initiation/components/project-form.vue';
- import { listOrganizations } from '@/api/system/organization';
- import {
- projectsTeamGetByIdAPI,
- projectsTeamPageAPI
- } from '@/api/project-manage/team';
- import PlanCard from '@/views/BOMmanage/components/planCard.vue';
- import addPlanDialog from '@/views/project-manage/planManage/components/addOrEditDialog.vue';
- import planDetailDialog from '@/views/project-manage/planManage/components/detailDialog.vue';
- import taskDetailDialog from '@/views/project-manage/task-manage/components/detailDialog.vue';
- import projectStatistics from '@/views/project-manage/project-statistics/index.vue';
- import planForm from '@/views/project-manage/planManage/components/plan-form.vue';
- import {
- planFinishAPI,
- planPauseAPI,
- planStageFinishAPI,
- planStagePauseAPI,
- planStageStartupAPI,
- planStageTerminationAPI,
- planStartupAPI,
- planTerminationAPI,
- projectsPlanDeleteAPI,
- projectsPlanGetByIdAPI
- } from '@/api/project-manage/plan';
- import { deepClone } from '@/utils';
- import planInfoTable from '@/views/project-manage/planManage/components/planInfoTable.vue';
- import BaseForm from '@/views/project-manage/task-manage/components/base-form.vue';
- import {
- projectsTaskDeleteAPI,
- projectsTaskGetByIdAPI,
- projectsTaskOpRation
- } from '@/api/project-manage/task';
- import submitDeliverablesInfoTable from '@/views/project-manage/task-manage/components/submitDeliverablesInfoTable.vue';
- import { getByCode } from '@/api/system/dictionary-data';
- import teamInfoTable from '@/views/project-manage/team-manage/components/team-Info-table.vue';
- import addTaskDialog from '@/views/project-manage/task-manage/components/addOrEditDialog.vue';
- import { proStatusEnum, reviewStatusEnum } from '@/enum/dict';
- import transferDialog from '@/views/project-manage/task-manage/components/transferDialog.vue';
- import submitDeliverablesDialog from '@/views/project-manage/task-manage/components/submitDeliverablesDialog.vue';
- import addOrEditProjectDialog from '@/views/project-manage/project-initiation/components/addOrEditDialog.vue';
- import bpmDetail from '@/views/bpm/processInstance/detail.vue';
- import projectCalendar from '@/views/project-manage/project-calendar/index.vue';
- import planManageList from '@/views/project-manage/planManage/index.vue';
- import addOrEditStageDialog from '@/views/project-manage/project-initiation/components/addOrEditStageDialog.vue';
- import projectInfoTable from '@/views/project-manage/project-initiation/components/projectInfoTable.vue';
- export default {
- props: {},
- components: {
- p_search,
- bpmDetail,
- addOrEditProjectDialog,
- submitDeliverablesDialog,
- transferDialog,
- addTaskDialog,
- teamInfoTable,
- submitDeliverablesInfoTable,
- BaseForm,
- planInfoTable,
- planForm,
- taskDetailDialog,
- planDetailDialog,
- addPlanDialog,
- PlanCard,
- projectForm,
- BOMBaseForm,
- Attribute,
- addBOMDialog,
- AssetTree,
- planManageList,
- projectCalendar,
- projectInfoTable,
- addOrEditStageDialog,
- projectStatistics
- },
- data() {
- return {
- responsibleDeptId: '',
- userList: [],
- visible: false,
- title: '项目信息',
- projectsFinishAPI,
- projectsPauseAPI,
- projectsStartupAPI,
- projectsTerminationAPI,
- projectsBomFinishAPI,
- projectsBomPauseAPI,
- projectsBomStartupAPI,
- projectsBomTerminationAPI,
- projectsStageFinishAPI,
- projectsStagePauseAPI,
- projectsStageStartupAPI,
- projectsStageTerminationAPI,
- planFinishAPI,
- planPauseAPI,
- planStartupAPI,
- planTerminationAPI,
- planStageFinishAPI,
- planStagePauseAPI,
- planStageStartupAPI,
- planStageTerminationAPI,
- activeName: '基本信息',
- attrActiveName: '属性',
- leftTreeActiveName: 'BOM维度',
- active: 0,
- contextMenuData: {
- menuName: '',
- axis: {
- x: null,
- y: null
- }, // 鼠标位置
- menulists: []
- },
- contextTableMenuData: {
- menuName: '',
- axis: {
- x: null,
- y: null
- }, // 鼠标位置
- menulists: []
- },
- currentNodeData: {},
- planAndTaskTree: [],
- taskTree: [],
- deptList: [],
- deptTreeList: [],
- projectStepList: ['待立项', '审核中', '执行中', '已完成'],
- teamList: [],
- current: {},
- dialogForm: {},
- rightForm: {},
- teamForm: {},
- dictList: {},
- currentTableNodeData: {},
- treeList: [],
- addOrEditDialogStageFlag: false,
- bpmDetailFlag: false,
- isShow: false,
- treeLoading: false,
- addBOMDialogFlag: false,
- addPlanDialogFLag: false,
- addTaskDialogFlag: false,
- planDetailDialogFlag: false,
- taskDetailDialogFlag: false,
- transferDialogFlag: false,
- submitDeliverablesDialogFlag: false,
- addOrEditProjectDialogFlag: false,
- defaultProps: {
- children: 'children',
- label: 'name'
- },
- loading: false,
- filterText: null,
- categoryId: 1,
- loadingInstance: null,
- treeId: null,
- dialogType: null,
- rowData: {},
- refreshPlan: true
- };
- },
- watch: {
- filterText(val) {
- this.$refs.treeRef.filter(val);
- }
- },
- computed: {
- columns() {
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '名称',
- prop: 'name',
- showOverflowTooltip: true,
- minWidth: 180,
- slot: 'name'
- },
- {
- label: '类型名称',
- prop: 'type',
- showOverflowTooltip: true,
- minWidth: 80,
- align: 'center',
- slot: 'type'
- },
- {
- label: '预计开始时间',
- prop: 'planStartDate',
- formatter: (val) => {
- return val.planStartDate?.split(' ')[0];
- },
- showOverflowTooltip: true,
- minWidth: 150,
- align: 'center'
- },
- {
- label: '预计结束时间',
- prop: 'planEndDate',
- formatter: (val) => {
- return val.planEndDate?.split(' ')[0];
- },
- showOverflowTooltip: true,
- minWidth: 150,
- align: 'center'
- },
- {
- label: '预计工期(天)',
- prop: 'planDay',
- showOverflowTooltip: true,
- minWidth: 150,
- align: 'center'
- },
- {
- label: '实际开始时间',
- prop: 'realStartTime',
- // formatter: (val) => {
- // return val.realStartTime?.split(' ')[0]
- // },
- showOverflowTooltip: true,
- minWidth: 150,
- align: 'center'
- },
- {
- label: '实际结束时间',
- prop: 'realEndTime',
- // formatter: (val) => {
- // return val.realEndTime?.split(' ')[0]
- // },
- showOverflowTooltip: true,
- minWidth: 150,
- align: 'center'
- },
- {
- label: '实际工期(天)',
- prop: 'realDay',
- showOverflowTooltip: true,
- minWidth: 150,
- align: 'center'
- },
- {
- label: '负责人',
- prop: 'responsibleUserName',
- showOverflowTooltip: true,
- minWidth: 100,
- align: 'center'
- },
- {
- prop: 'processStatus',
- label: '审核状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100,
- formatter: (_row, _column, cellValue) => {
- return reviewStatusEnum[_row.processStatus]?.label;
- }
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100,
- formatter: (_row, _column, cellValue) => {
- return proStatusEnum[_row.status]?.label;
- }
- },
- {
- label: '进度',
- prop: 'speedPercent',
- showOverflowTooltip: false,
- minWidth: 120,
- align: 'center',
- slot: 'speedPercent'
- }
- ];
- }
- },
- mounted() {
- this.leftTreeActiveName = 'BOM维度';
- this.activeName = '基本信息';
- this.attrActiveName = '属性';
- this.isShow = false;
- /* if (this.$route.query.id) {
- this.initData();
- this.dialogType = this.$route.query.type;
- } */
- this.getDeptList();
- this.getTeamList();
- this.getDictList('pro_files_approve_type');
- this.getDictList('deliverables_type');
- this.getDictList('pro_projects_status');
- this.getDictList('pro_projects_budget_unit');
- },
- /* activated() {
- if (this.$route.query.id) {
- this.initData();
- this.dialogType = this.$route.query.type;
- }
- }, */
- methods: {
- getDictV(code, val) {
- if (!this.dictList[code]) return '';
- return this.dictList[code].find((item) => item.value == val)?.label;
- },
- async getDictList(code) {
- let { data: res } = await getByCode(code);
- this.dictList[code] = res.map((item) => {
- let values = Object.keys(item);
- return {
- value: values[0],
- label: item[values[0]]
- };
- });
- },
- async open(row) {
- this.rowData = row;
- this.visible = true;
- // 将负责人的列表带给新建项目阶段
- const { list: res } = await getUserPage({
- pageNum: 1,
- size: -1,
- groupId: row.responsibleDeptId
- });
- this.userList = res;
- this.responsibleDeptId = row.responsibleDeptId;
- // -----
- if (this.rowData.id) {
- this.$nextTick(() => {
- this.$refs.treeList.getTreeData('', this.rowData.id);
- this.$refs.projectCalendarRef.init(row.id);
- });
- this.initData();
- this.dialogType = this.rowData.type;
- }
- // this.getLeftData();
- },
- // async getLeftData(where) {
- // let pp = {
- // pageNum: 1,
- // size: 999,
- // parentId: parent?.id ?? '0',
- // /* name: this.rowData.name ?? '', */
- // ...where
- // };
- // const res = await getMyProjectsPage(pp);
- // this.leftTreeData = res.list;
- // },
- cancel() {
- this.$nextTick(() => {
- this.visible = false;
- });
- },
- handleTabs1(val) {
- this.activeName = val.label;
- this.attrActiveName = '属性';
- this.isShow = false;
- this.bpmDetailFlag = false;
- this.$nextTick(() => {
- this.bpmDetailFlag = true;
- });
- },
- filterNode(value, data) {
- if (!value) return true;
- return data.name.indexOf(value) !== -1;
- },
- async getDictList(code) {
- let { data: res } = await getByCode(code);
- this.dictList[code] = res.map((item) => {
- let values = Object.keys(item);
- return {
- value: values[0],
- label: item[values[0]]
- };
- });
- },
- initData() {
- this.getTreeData();
- },
- // 获取部门数据
- getDeptList() {
- listOrganizations().then((list) => {
- this.deptList = list;
- this.deptTreeList = this.$util.toTreeData({
- data: list,
- idField: 'id',
- parentIdField: 'parentId'
- });
- console.log(this.deptTreeList);
- });
- },
- getTeamList() {
- projectsTeamPageAPI({
- pageNum: 1,
- size: 999
- }).then((list) => {
- this.teamList = list;
- });
- },
- handleUpdateProject(node, data, type) {
- this.addOrEditProjectDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.addOrEditProjectDialogRef.init(data, type);
- });
- },
- bomRemove(node, data) {
- let message = data.children.length
- ? '当前节点包含子节点,是否确认删除?'
- : '是否确认删除?';
- this.$confirm(message, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- const loading = this.$loading({ lock: true });
- await projectsBomDeleteAPI([data.id]);
- loading.close();
- this.$message.success('删除成功');
- await this.getTreeData();
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- stageRemove(node, data) {
- let message = data.children.length
- ? '当前节点包含子节点,是否确认删除?'
- : '是否确认删除?';
- this.$confirm(message, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- const loading = this.$loading({ lock: true });
- await projectsStageDeleteAPI([data.id]);
- loading.close();
- this.$message.success('删除成功');
- await this.getTreeData();
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- back() {
- this.$router.go(-1);
- },
- async validateForm() {
- return Promise.all([
- new Promise((resolve, reject) => {
- this.$refs.BOMBaseFormRef.getValidaValue((valid) => {
- if (!valid) {
- reject(false);
- } else {
- resolve(true);
- }
- });
- })
- ]).catch(() => {
- this.$message.warning('请先填写完整信息');
- return Promise.reject(false);
- });
- },
- addChildProject() {},
- addOrEditBOM(type, node, data) {
- this.addBOMDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.addBOMDialogRef.init(data, type);
- });
- },
- handleAddStage(node, data, type) {
- this.addOrEditDialogStageFlag = true;
- this.$nextTick(() => {
- this.$refs.addOrEditStageDialogRef.init(data, type);
- });
- },
- handleAddPlan(type, node, data, sourceName = 'project') {
- this.addPlanDialogFLag = true;
- let params = {};
- if (sourceName == 'plan') {
- params = {
- projectId: data.projectId,
- projectStageId: data.projectStageId,
- projectBomId: data.projectBomId,
- parentPlanId: data.id,
- id: data.id
- };
- } else {
- switch (data.type) {
- case 0:
- params = {
- projectId: data.id
- };
- break;
- case 1:
- params = {
- projectId: data.projectId,
- projectBomId: data.id
- };
- break;
- case 2:
- params = {
- projectId: data.projectId,
- projectStageId: data.id
- };
- break;
- }
- }
- this.$nextTick(() => {
- this.$refs.addPlanDialogRef.init(params, type);
- this.$refs.refreshPlan.datasource();
- });
- },
- async handleStatus(API, msg, node, row) {
- this.$confirm(msg, '提示', {
- type: 'warning'
- })
- .then(async () => {
- await API(row.id);
- this.$message.success('操作成功');
- this.reload();
- })
- .catch(() => {});
- },
- //报工/执行
- async handleStartTask(row, afterStatus, msg) {
- this.$confirm(msg, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- let params = {
- id: row.id,
- afterStatus: afterStatus,
- status: row.status
- };
- await projectsTaskOpRation(params);
- this.$message.success('操作成功');
- this.reload();
- })
- .catch(() => {});
- },
- handleRemovePlan(ids) {
- this.$confirm('此操作将永久删除该计划, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- const loading = this.$loading({ lock: true });
- projectsPlanDeleteAPI(ids)
- .then((res) => {
- loading.close();
- this.$message.success('删除成功');
- this.reload();
- })
- .catch((e) => {
- loading.close();
- // this.$message.error(e.message);
- });
- });
- },
- /* 删除 */
- handleRemoveTask(ids) {
- this.$confirm('此操作将永久删除该任务, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- const loading = this.$loading({ lock: true });
- projectsTaskDeleteAPI(ids)
- .then((res) => {
- loading.close();
- this.$message.success('删除成功');
- this.reload();
- })
- .catch((e) => {
- loading.close();
- // this.$message.error(e.message);
- });
- })
- .catch(() => {});
- },
- /* */
- handleAddTask(type, node, data, sourceName = 'project') {
- this.addTaskDialogFlag = true;
- let params = {};
- if (sourceName == 'plan') {
- switch (data.type) {
- case 0:
- params = {
- targetPlanId: data.id,
- projectId: data.projectId,
- projectStageId: data.projectStageId
- };
- break;
- case 1:
- params = {
- targetPlanId: data.parentId,
- projectId: data.projectId,
- projectStageId: data.projectStageId,
- planStageId: data.id
- };
- break;
- case 2:
- params = {
- targetPlanId: data.targetPlanId,
- projectId: data.projectId,
- projectStageId: data.projectStageId,
- planStageId: data.planStageId,
- taskId: data.id,
- id: type !== 'add' ? data.id : ''
- };
- break;
- }
- } else {
- switch (data.type) {
- case 0:
- params = {
- projectId: data.id
- };
- break;
- case 1:
- params = {
- projectId: data.projectId,
- projectBomId: data.id
- };
- break;
- case 2:
- params = {
- projectId: data.projectId,
- projectStageId: data.id
- };
- break;
- }
- }
- this.$nextTick(() => {
- this.$refs.addTaskDialogRef.init(params, type);
- });
- },
- async getTreeData() {
- try {
- this.treeLoading = true;
- let API =
- this.leftTreeActiveName == 'BOM维度'
- ? getByBomTreeAPI
- : getProjectStageTree;
- const res = await API(this.rowData.id);
- this.treeList = [res];
- this.$nextTick(() => {
- if (this.treeList.length) {
- // 默认高亮第一个
- this.$refs.treeRef.setCurrentKey(this.treeList[0]?.id);
- this.handleNodeClick(this.treeList[0]);
- }
- });
- } catch (error) {}
- this.treeLoading = false;
- },
- async handleNodeClick1(data) {
- if (data.type == 'projectType') {
- this.rowData = this.dialogForm = await projectsGetByIdDetailsAPI(
- data.id
- );
- this.getTreeData();
- this.$nextTick(() => {
- this.$refs.projectCalendarRef.init(data.id);
- });
- }
- },
- getIconClass(node, data) {
- switch (data.type) {
- case 2:
- return node.expanded ? 'el-icon-document' : 'el-icon-tickets';
- case 1:
- return node.expanded ? 'el-icon-document' : 'el-icon-tickets';
- case 0:
- return node.expanded ? 'el-icon-folder-opened' : 'el-icon-folder';
- default:
- return '';
- }
- },
- showRightMenu(event, node, data) {
- if (this.dialogType == 'view') return;
- this.contextMenuData.menuName = data.id + '_' + data.name + '_rightMenu';
- this.$nextTick(() => {
- let menuList = [
- ...document.querySelectorAll('.vue-contextmenu-listWrapper')
- ];
- menuList.forEach((item) => {
- item.style.display = 'none';
- });
- event.preventDefault();
- const x = event.clientX;
- const y = event.clientY;
- this.contextMenuData.axis = { x, y };
- switch (data.type) {
- case 0:
- this.contextMenuData.menulists = [
- {
- fnHandler: 'addChildProject',
- icoName: 'fa el-icon-plus',
- btnName: '新建子项目',
- disabled:
- this.disableToAddBOM(data) &&
- this.$hasPermission('pro:projects:save')
- },
- {
- fnHandler: 'addStage',
- icoName: 'fa el-icon-plus',
- btnName: '新建阶段',
- disabled:
- this.disableToAddBOM(data) &&
- this.$hasPermission('pro:projects:save')
- },
- {
- fnHandler: 'addBOM',
- icoName: 'fa el-icon-plus',
- btnName: '新建BOM',
- disabled:
- this.disableToAddBOM(data) &&
- this.$hasPermission('pro:projects:save')
- },
- {
- fnHandler: 'addPlan',
- icoName: 'fa el-icon-plus',
- btnName: '新建计划',
- disabled: this.disableToAddPlan(data)
- },
- {
- fnHandler: 'addTask',
- icoName: 'fa el-icon-plus',
- btnName: '新建任务',
- disabled: this.disableToAddTask(data)
- },
- {
- fnHandler: 'updateProject',
- icoName: 'fa el-icon-edit',
- btnName: '修改',
- disabled:
- [1, 2].includes(data.processStatus) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'onRemove',
- icoName: 'fa el-icon-delete',
- btnName: '删除',
- disabled:
- [1, 2].includes(data.processStatus) &&
- this.$hasPermission('pro:projects:delete')
- },
- {
- fnHandler: 'handleFinish',
- icoName: 'fa el-icon-success',
- btnName: '完成',
- disabled:
- this.disableToFinish(data) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'handlePause',
- icoName: 'fa el-icon-video-pause',
- btnName: '暂停',
- disabled:
- this.disableToPause(data) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'handleStartup',
- icoName: 'fa el-icon-video-play',
- btnName: '启动',
- disabled:
- this.disableToStartup(data) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'handleTermination',
- icoName: 'fa el-icon-error',
- btnName: '终止',
- disabled:
- this.disableToTermination(data) &&
- this.$hasPermission('pro:projects:update')
- }
- ];
- break;
- case 1:
- this.contextMenuData.menulists = [
- {
- fnHandler: 'addBOM',
- icoName: 'fa el-icon-plus',
- btnName: '新建BOM',
- disabled:
- this.disableToAddBOM(data) &&
- this.$hasPermission('pro:projects:save')
- },
- {
- fnHandler: 'addPlan',
- icoName: 'fa el-icon-plus',
- btnName: '新建计划',
- disabled: this.disableToAddPlan(data)
- },
- {
- fnHandler: 'addTask',
- icoName: 'fa el-icon-plus',
- btnName: '新建任务',
- disabled: this.disableToAddTask(data)
- },
- {
- fnHandler: 'editBOM',
- icoName: 'fa el-icon-edit',
- btnName: '修改',
- disabled:
- ![0].includes(data.status) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'removeBom',
- icoName: 'fa el-icon-delete',
- btnName: '删除',
- disabled:
- ![0].includes(data.status) &&
- this.$hasPermission('pro:projects:delete')
- },
- {
- fnHandler: 'handleBomFinish',
- icoName: 'fa el-icon-success',
- btnName: '完成',
- disabled:
- this.disableToFinish(data) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'handleBomPause',
- icoName: 'fa el-icon-video-pause',
- btnName: '暂停',
- disabled:
- this.disableToPause(data) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'handleBomStartup',
- icoName: 'fa el-icon-video-play',
- btnName: '启动',
- disabled:
- this.disableToStartup(data) &&
- this.$hasPermission('pro:projects:update')
- },
- {
- fnHandler: 'handleBomTermination',
- icoName: 'fa el-icon-error',
- btnName: '终止',
- disabled:
- this.disableToTermination(data) &&
- this.$hasPermission('pro:projects:update')
- }
- ];
- break;
- case 2:
- this.contextMenuData.menulists = [
- {
- fnHandler: 'addPlan',
- icoName: 'fa el-icon-plus',
- btnName: '新建计划',
- disabled: this.disableToAddPlan(data)
- },
- {
- fnHandler: 'addTask',
- icoName: 'fa el-icon-plus',
- btnName: '新建任务',
- disabled: this.disableToAddTask(data)
- },
- // {fnHandler: 'onSave',
- // icoName: 'fa el-icon-edit',
- // btnName: '修改'
- // },
- // {fnHandler: 'stageRemove',
- // icoName: 'fa el-icon-delete',
- // btnName: '删除'
- // },
- {
- fnHandler: 'handleStageFinish',
- icoName: 'fa el-icon-success',
- btnName: '完成',
- disabled: this.disableToFinish(data)
- },
- {
- fnHandler: 'handleStagePause',
- icoName: 'fa el-icon-video-pause',
- btnName: '暂停',
- disabled: this.disableToPause(data)
- },
- {
- fnHandler: 'handleStageStartup',
- icoName: 'fa el-icon-video-play',
- btnName: '启动',
- disabled: this.disableToStartup(data)
- },
- {
- fnHandler: 'handleStageTermination',
- icoName: 'fa el-icon-error',
- btnName: '终止',
- disabled: this.disableToTermination(data)
- }
- ];
- break;
- }
- });
- },
- disableToAddBOM(row) {
- return (
- ![0, 1, 2, 3].includes(row.processStatus) ||
- ![0, 1].includes(row.status)
- );
- },
- disableToAddPlan(row) {
- return (
- ![0, 1, 2, 3].includes(row.processStatus) ||
- ![0, 1].includes(row.status)
- );
- },
- disableToAddTask(row) {
- return (
- ![0, 1, 2, 3].includes(row.processStatus) ||
- ![0, 1].includes(row.status)
- );
- },
- disableToFinish(row) {
- return ![2].includes(row.processStatus) || [4, 2, 3].includes(row.status);
- },
- disableToPause(row) {
- return ![2].includes(row.processStatus) || [4, 2, 3].includes(row.status);
- },
- disableToStartup(row) {
- return (
- ![2].includes(row.processStatus) || [4, 1, 0, 3].includes(row.status)
- );
- },
- disableToTermination(row) {
- return ![2].includes(row.processStatus) || [4, 3].includes(row.status);
- },
- handleNodeClick(data) {
- console.log('点击');
- this.treeId = data.id;
- this.currentNodeData = data;
- this.$nextTick(async () => {
- // this.$refs.projectInfoTable.init();
- switch (data.type) {
- case 1:
- await this.$refs.attributeRef.setAttributeFormData(
- this.currentNodeData
- );
- break;
- case 2:
- this.dialogForm = await projectsGetByIdDetailsAPI(data.parentId);
- break;
- case 0:
- this.dialogForm = await projectsGetByIdDetailsAPI(data.id);
- this.dialogForm.type = this.dialogForm.type + '';
- this.dialogForm.level = this.dialogForm.level + '';
- this.dialogForm.parentId =
- this.dialogForm.parentId == 0 ? '' : this.dialogForm.parentId;
- this.projectStepList = ['待立项', '审核中', '执行中', '已完成'];
- if (data.processStatus == 0) {
- this.active = 0;
- break;
- }
- if ([1, 3].includes(data.processStatus)) {
- let stepName = data.processStatus == 3 ? '审核未通过' : '审核中';
- this.projectStepList.splice(1, 1, stepName);
- this.active = 1;
- break;
- }
- if ([0, 1, 2].includes(data.status)) {
- let stepName =
- data.status == 1
- ? '执行中'
- : data.status == 2
- ? '暂停中'
- : '未开始';
- this.projectStepList.splice(2, 1, stepName);
- this.active = 2;
- break;
- }
- if ([3, 4].includes(data.status)) {
- let stepName = data.status == 3 ? '已完成' : '已终止';
- this.projectStepList.splice(3, 1, stepName);
- this.active = 4;
- break;
- }
- break;
- }
- if ([0, 2].includes(data.type)) {
- this.dialogForm.type = this.dialogForm.type + '';
- this.dialogForm.level = this.dialogForm.level + '';
- this.dialogForm.parentId =
- this.dialogForm.parentId == 0 ? '' : this.dialogForm.parentId;
- this.dialogForm.stageList = this.dialogForm.allStageList;
- await this.getTeamInfo(this.dialogForm.teamId);
- }
- });
- this.getPlanAndTaskTree(data);
- this.getTaskTree(data);
- },
- async getPlanAndTaskTree(data) {
- let paramAttr = '';
- switch (data.type) {
- case 1:
- paramAttr = 'projectBomId';
- break;
- case 2:
- paramAttr = 'projectStageId';
- break;
- default:
- paramAttr = 'projectId';
- }
- let params = {
- [paramAttr]: data.id
- };
- this.planAndTaskTree = await getPlanAndTaskTreeById(params);
- },
- async getTaskTree(data) {
- let paramAttr = '';
- switch (data.type) {
- case 1:
- paramAttr = 'projectBomId';
- break;
- case 2:
- paramAttr = 'projectStageId';
- break;
- default:
- paramAttr = 'projectId';
- }
- let params = {
- [paramAttr]: data.id
- };
- this.taskTree = await getTaskTreeById(params);
- },
- reload(where) {
- this.getTreeData();
- },
- setTableCell({ row }) {
- console.log(row.level);
- if (row.level === 1) return ''; //
- return { marginLeft: row.level + 3 + 'px' }; //
- },
- handleTableNodeClick(row) {
- this.isShow = true;
- this.attrActiveName = '属性';
- this.currentTableNodeData = row;
- console.log(row, 'row.type');
- switch (row.type) {
- case 0:
- this.getProjectPlanInfo(row.id);
- break;
- case 1:
- this.getProjectPlanInfo(row.targetPlanId);
- break;
- case 2:
- this.getProjectTaskInfo(row.id);
- break;
- }
- },
- handlePlanTableNodeClick(row) {
- console.log(row, '点击计划某一行');
- this.isShow = true;
- this.attrActiveName = '属性';
- this.currentTableNodeData = row;
- this.getProjectPlanInfo(row.id);
- },
- showTableRightMenu(row, column, event) {
- if (this.dialogType == 'view') return;
- this.contextTableMenuData.menuName = row.name;
- this.$nextTick(() => {
- let menuList = [
- ...document.querySelectorAll('.vue-contextmenu-listWrapper')
- ];
- menuList.forEach((item) => {
- item.style.display = 'none';
- });
- event.preventDefault();
- const x = event.clientX;
- const y = event.clientY;
- this.contextTableMenuData.axis = { x, y };
- switch (row.type) {
- case 0:
- this.contextTableMenuData.menulists = [
- {
- fnHandler: 'addPlan',
- icoName: 'fa el-icon-plus',
- btnName: '新建计划',
- disabled: this.disableToAddPlan(row)
- },
- {
- fnHandler: 'addTask',
- icoName: 'fa el-icon-plus',
- btnName: '新建任务',
- disabled: this.disableToAddTask(row)
- },
- {
- fnHandler: 'editPlan',
- icoName: 'fa el-icon-edit',
- btnName: '修改',
- disabled:
- [1, 2].includes(row.processStatus) ||
- ![0].includes(row.status)
- },
- {
- fnHandler: 'removePlan',
- icoName: 'fa el-icon-delete',
- btnName: '删除',
- disabled:
- [1, 2].includes(row.processStatus) ||
- ![0].includes(row.status)
- },
- {
- fnHandler: 'finishPlan',
- icoName: 'fa el-icon-success',
- btnName: '完成',
- disabled: this.disableToFinish(row)
- },
- {
- fnHandler: 'pausePlan',
- icoName: 'fa el-icon-video-pause',
- btnName: '暂停',
- disabled: this.disableToPause(row)
- },
- {
- fnHandler: 'startupPlan',
- icoName: 'fa el-icon-video-play',
- btnName: '启动',
- disabled: this.disableToStartup(row)
- },
- {
- fnHandler: 'terminationPlan',
- icoName: 'fa el-icon-error',
- btnName: '终止',
- disabled: this.disableToTermination(row)
- }
- ];
- break;
- case 1:
- this.contextTableMenuData.menulists = [
- {
- fnHandler: 'addTask',
- icoName: 'fa el-icon-plus',
- btnName: '新建任务',
- disabled: this.disableToAddTask(row)
- },
- // {fnHandler: 'editBOM', icoName: 'fa el-icon-edit', btnName: '修改'},
- // {fnHandler: 'removeBom', icoName: 'fa el-icon-delete', btnName: '删除'},
- {
- fnHandler: 'finishPlanStage',
- icoName: 'fa el-icon-success',
- btnName: '完成',
- disabled: this.disableToFinish(row)
- },
- {
- fnHandler: 'pausePlanStage',
- icoName: 'fa el-icon-video-pause',
- btnName: '暂停',
- disabled: this.disableToPause(row)
- },
- {
- fnHandler: 'startupPlanStage',
- icoName: 'fa el-icon-video-play',
- btnName: '启动',
- disabled: this.disableToStartup(row)
- },
- {
- fnHandler: 'terminationPlanStage',
- icoName: 'fa el-icon-error',
- btnName: '终止',
- disabled: this.disableToTermination(row)
- }
- ];
- break;
- case 2:
- this.contextTableMenuData.menulists = [
- {
- fnHandler: 'addTask',
- icoName: 'fa el-icon-plus',
- btnName: '新建任务',
- disabled: [4, 2, 3].includes(row.status)
- },
- {
- fnHandler: 'updateTask',
- icoName: 'fa el-icon-edit',
- btnName: '修改',
- disabled: [4, 2, 3, 1].includes(row.status)
- },
- {
- fnHandler: 'removeTask',
- icoName: 'fa el-icon-delete',
- btnName: '删除',
- disabled: [4, 2, 3, 1].includes(row.status)
- },
- {
- fnHandler: 'startTask',
- icoName: 'fa el-icon-video-play',
- btnName: '执行',
- disabled: [4, 3, 1].includes(row.status)
- },
- {
- fnHandler: 'handleSubmitDeliverables',
- icoName: 'fa el-icon-folder-add',
- btnName: '交付物提交',
- disabled: [4, 3, 0, 2].includes(row.status)
- },
- {
- fnHandler: 'finishTask',
- icoName: 'fa el-icon-success',
- btnName: '报工',
- disabled: !(
- [1].includes(row.status) && row.ifFilesAllFinish == 1
- )
- },
- {
- fnHandler: 'pauseTask',
- icoName: 'fa el-icon-video-pause',
- btnName: '暂停',
- disabled: this.disableToPause(row)
- },
- {
- fnHandler: 'terminationTask',
- icoName: 'fa el-icon-error',
- btnName: '终止',
- disabled: this.disableToTermination(row)
- },
- {
- fnHandler: 'handleTransfer',
- icoName: 'fa el-icon-position',
- btnName: '转派',
- disabled: ![1].includes(row.status)
- }
- ];
- break;
- }
- });
- },
- //转派
- handleTransfer(row) {
- this.transferDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.transferDialogRef.init(row);
- });
- },
- /* 交付物提交 */
- handleSubmitDeliverables(row = {}, type) {
- this.submitDeliverablesDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.submitDeliverablesDialogRef.init(row, type);
- });
- },
- async getProjectTaskInfo(id = '') {
- this.rightForm = await projectsTaskGetByIdAPI(id);
- this.rightForm.type = this.rightForm.type + '';
- this.rightForm.responsibleUserIds =
- this.rightForm.responsibleUserList?.map((i) => i.userName) || [];
- },
- async getProjectPlanInfo(id = '') {
- let res = await projectsPlanGetByIdAPI(id);
- this.rightForm = deepClone(res);
- this.rightForm.responsibleUserIds =
- this.rightForm.responsibleUserList?.map((i) => i.userName) || [];
- this.rightForm.planStageList?.forEach((item, index) => {
- let userNames = item.responsibleUserList.map((i) => i.userName) || [];
- this.$set(item, 'responsibleUserNames', userNames.join(','));
- });
- // await this.changeProject(this.dialogForm.projectId)
- },
- async getTeamInfo(teamId) {
- if (teamId) {
- this.teamForm = await projectsTeamGetByIdAPI(teamId);
- }
- },
- // 每一级字体变小
- fontSize(node, data) {
- if (node.level === 1 || node.level === 2) return 'font-size:14px'; // 一二级字体
- return 'font-size:' + 13 + 'px'; // 三级以下字号减小
- },
- uploadFile() {
- this.$refs.importDialogRef.open();
- },
- handleLeftTreeActiveName(val) {
- console.log(val);
- this.leftTreeActiveName = val;
- this.getTreeData();
- },
- customColorMethod(percentage) {
- if (percentage < 30) {
- return '#b6b6b6';
- } else if (percentage < 70) {
- return '#b3e496';
- } else {
- return '#67c23a';
- }
- }
- },
- created() {}
- };
- </script>
- <style lang="scss" scoped>
- :deep(.el-drawer__body) {
- overflow: hidden;
- }
- .ele-body {
- display: flex;
- flex-direction: column;
- height: 100%;
- .card_2_box {
- flex: 1;
- ::v-deep .el-card__body {
- height: 100%;
- .card_2_box_content {
- height: 100%;
- .ele-split-panel {
- height: 100%;
- .el_tree_box {
- padding: 0 4px 0 0;
- height: 100%;
- border: none;
- border-right: 1px solid #e8eaec;
- //border-radius: 3px;
- .el-tree-node {
- .el-tree-node__children {
- height: 100%;
- overflow: auto;
- }
- }
- }
- }
- }
- }
- }
- }
- .card_2_layout_content {
- display: flex;
- flex-direction: column;
- height: 100%;
- ::v-deep .card_2_1_box {
- height: 50px;
- width: 100%;
- margin-bottom: 10px;
- .border-box-content {
- height: 100%;
- width: 100%;
- background: rgba(203, 203, 203, 0.12);
- border-radius: 3px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- .card_2_1_box_div_1 {
- flex: 1;
- height: 50px;
- display: flex;
- align-items: center;
- .el-steps--simple {
- border-radius: 0 !important;
- background: none;
- width: 100%;
- padding: 10px 8%;
- }
- .is-success {
- color: rgb(103, 103, 103) !important;
- .el-step__icon {
- border-color: rgb(103, 103, 103) !important;
- }
- .el-icon-check:before {
- font-size: 14px;
- line-height: 14px;
- font-weight: bold;
- color: rgb(103, 103, 103) !important;
- }
- }
- .el-step__main {
- .is-process:before {
- content: '';
- background: rgba(182, 182, 182, 0.26);
- height: 30px;
- width: 160px;
- display: block;
- position: absolute;
- border-radius: 15px;
- transform: translate(-40%, -18%);
- }
- }
- .is-process {
- border-color: #f8f8f8 !important;
- font-weight: bold;
- }
- .is-success + .el-step__arrow:before {
- background: rgb(202, 205, 212) !important;
- }
- .is-success + .el-step__arrow:after {
- background: rgb(202, 205, 212) !important;
- }
- }
- .card_2_1_box_div_2 {
- width: 150px;
- margin-right: 10px;
- height: 100%;
- display: flex;
- align-items: center;
- .dv-percent-pond text {
- font-size: 20px !important;
- transform: translate(0%, 10%);
- }
- }
- }
- }
- ::v-deep .tab-box_1 {
- flex: 1;
- .el-tabs__content {
- //padding: 10px;
- height: calc(100% - 45px);
- //overflow: auto;
- padding: 0;
- padding-top: 10px;
- .el-tab-pane {
- height: 100%;
- }
- }
- }
- }
- ::v-deep .project_tree {
- .custom-tree-node {
- display: flex;
- align-items: center;
- .label_img {
- width: 20px;
- height: 20px;
- margin-left: 5px;
- }
- }
- .el-tree-node {
- position: relative;
- padding-left: 0px;
- }
- .el-tree-node__children {
- padding-left: 22px;
- }
- // 自定义图标中隐藏自带箭头
- //.el-tree-node__content > .el-tree-node__expand-icon {
- // position: absolute;
- // opacity: 0;
- //}
- .el-tree-node__content > .el-tree-node__expand-icon {
- padding: 0;
- }
- // 禁止旋转
- .el-tree .el-tree-node__expand-icon.expanded {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- // 节点高度与边距
- .el-tree-node__content {
- height: 30px;
- }
- .el-tree-node {
- margin: 1px 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- //高亮字体颜色
- .el-tree--highlight-current
- .el-tree-node.is-current
- > .el-tree-node__content {
- color: #ee7355 !important;
- background-color: red !important; // 设置选中背景颜色
- }
- // 设置竖线
- .el-tree-node .is-focusable:before {
- content: '';
- display: inline-block;
- position: absolute;
- left: -15px;
- border-left: 1px solid #f8f8f8;
- height: calc(100%);
- }
- .list-left {
- width: 214px;
- height: auto;
- margin: 10px 0 20px 20px;
- background-color: #fff;
- border-radius: 10px;
- padding: 20px;
- }
- // 鼠标移入高亮
- .custom-tree-node:hover {
- //color: #070a0c !important;
- }
- .el-icon-folder-opened,
- .el-icon-folder,
- .el-icon-document,
- .el-icon-tickets {
- display: flex;
- align-items: center;
- }
- .el-icon-document,
- .el-icon-folder-opened {
- //color: #0e85fa;
- }
- //高亮字体颜色
- .el-tree--highlight-current,
- .el-tree-node.is-current > .el-tree-node__content {
- color: #f8f8f8 !important;
- background-color: #72b9ff !important; // 设置选中背景颜色
- border-radius: 3px;
- }
- .el-tree-node__content:hover {
- color: #f8f8f8 !important;
- background-color: #b7d6f8 !important; // 设置选中背景颜色
- border-radius: 3px;
- }
- }
- ::v-deep .ele-table-tool-default {
- display: none;
- }
- ::v-deep .ele-split-panel-body {
- .ele-split-panel-side {
- border-bottom: 1px solid #e8e8e8;
- }
- }
- ::v-deep .ele-split-panel-side {
- // border-bottom: 2px solid #e6e8ea;
- height: 100%;
- .tab-box_1 {
- height: 100%;
- .el-tabs__item {
- background: rgba(246, 246, 247, 0.8);
- border-bottom: 1px solid #e6e8ea;
- }
- .is-active.el-tabs__item {
- background: #ffffff;
- border-bottom: none;
- }
- .el-table {
- height: calc(100% - 1px);
- }
- }
- }
- ::v-deep .tab-box_2 {
- height: 100%;
- overflow: auto;
- display: flex;
- flex-direction: column;
- .el-tabs__content {
- flex: 1;
- .el-tab-pane {
- height: 100%;
- }
- }
- }
- .current_button {
- background: #096cd7;
- border-color: #096cd7;
- color: #ffffff;
- }
- ::v-deep .vue-contextmenu-listWrapper {
- display: block;
- background: #fff !important;
- padding: 4px 0 !important;
- border: 1px solid #dadada;
- border-radius: 7px !important;
- color: #606266;
- .context-menu-list:hover {
- background: rgba(156, 156, 156, 0.2) !important;
- //color: #FFFFFF !important;
- }
- .context-menu-list {
- background: #fff !important;
- width: 100%;
- height: 25px;
- div {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- min-width: 120px;
- width: 100%;
- height: 100%;
- i {
- margin-left: 15px;
- }
- span {
- margin: 0 !important;
- margin-left: 25px !important;
- }
- }
- }
- }
- ::v-deep tr[class^='el-table__row--level'] > td:nth-child(2) > .cell {
- margin-left: 24px;
- }
- ::v-deep .el-table__header-wrapper .el-table__cell {
- .cell {
- text-align: center;
- }
- }
- @for $i from 1 to 10 {
- ::v-deep .el-table__row--level-#{$i} > td:nth-child(2) > .cell {
- margin-left: #{$i * 4 +10}px;
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- }
- .dot {
- border-radius: 50%;
- -webkit-background-clip: text;
- color: #0e85fa;
- display: inline-block;
- width: 5px;
- height: 5px;
- margin-right: 2px;
- text-align: center;
- background: #0e85fa;
- }
- </style>
|