list.vue 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true">
  6. <!-- <div style="margin-left: 20px;display: inline-block">
  7. <el-form-item label="任务列表">
  8. </el-form-item>
  9. </div> -->
  10. <el-form-item label="任务列表">
  11. <div style="margin-left: 8px">
  12. <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
  13. <el-select v-model="searchField" style="width:120px;" slot="prepend" placeholder="请选择">
  14. <el-option label="进行中" value="0" @click.native="hiddens()"></el-option>
  15. <el-option label="已完成" value="1" @click.native="hiddens()"></el-option>
  16. </el-select>
  17. <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
  18. <!-- </el-input> -->
  19. </div>
  20. </el-form-item>
  21. <!-- <el-form-item label="项目分组" v-if="user.companyId == '428'">
  22. <div style="margin-left: 8px">
  23. <el-select v-model="groupName" style="width:200px;" placeholder="请选择" clearable @change="hiddens()">
  24. <el-option v-for="(item, index) in groupNameList" :key="index" :label="item" :value="item"></el-option>
  25. </el-select>
  26. </div>
  27. </el-form-item> -->
  28. <el-form-item label="所属部门" v-if="user.timeType.projectWithDept">
  29. <!-- <span style="margin-left:5px;margin-right:5px;color:#606266;">部门</span> -->
  30. <el-cascader v-model="deptId" :options="departmentList" placeholder="请选择部门"
  31. :props="{ checkStrictly: true, expandTrigger: 'hover' }" :show-all-levels="false" clearable filterable @change="hiddens"
  32. ></el-cascader>
  33. </el-form-item>
  34. <!-- <el-form-item style="float:right;">
  35. <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增任务</el-link>
  36. </el-form-item> -->
  37. <!-- <div style="margin-left: 40px;display: inline-block">
  38. <el-form-item label="类型">
  39. </el-form-item>
  40. </div> -->
  41. <el-form-item label="类型">
  42. <div style="margin-left: 8px">
  43. <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
  44. <el-select v-model="typeField" style="width:120px;" slot="prepend" placeholder="请选择" clearable @change="hiddens()">
  45. <!-- <el-option label="任务" value="0" @click.native="hiddens()"></el-option>
  46. <el-option label="里程碑" value="1" @click.native="hiddens()"></el-option>
  47. <el-option label="风险" value="2" @click.native="hiddens()"></el-option> -->
  48. <el-option label="任务" value="0"></el-option>
  49. <el-option label="里程碑" value="1"></el-option>
  50. <el-option label="风险" value="2"></el-option>
  51. </el-select>
  52. <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
  53. <!-- </el-input> -->
  54. </div>
  55. </el-form-item>
  56. <el-form-item >
  57. <div style="margin-left: 80px">
  58. <el-select v-model="dateType" style="width:120px;" slot="prepend" placeholder="请选择">
  59. <el-option label="开始时间" :value="0" @click.native="hiddens()"></el-option>
  60. <el-option label="截止时间" :value="1" @click.native="hiddens()"></el-option>
  61. </el-select>
  62. </div>
  63. </el-form-item>
  64. <el-form-item >
  65. <div style="margin-left: 8px">
  66. <el-date-picker
  67. v-model="dateSelect"
  68. type="daterange"
  69. range-separator="-"
  70. start-placeholder="区间"
  71. end-placeholder="区间"
  72. value-format="yyyy-MM-dd"
  73. clearable
  74. @change="hiddens()">
  75. </el-date-picker>
  76. </div>
  77. </el-form-item>
  78. </el-form>
  79. </el-col>
  80. <div style="display: flex;width: 100%;">
  81. <div class="classification">
  82. <div>
  83. <p :class="idx == 0 ? 'on' : ''" @click="switchs(0)" v-if="permissions.projectView || permissions.projectManagement">全部任务</p>
  84. <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">我执行的</p>
  85. <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">我创建的</p>
  86. </div>
  87. </div>
  88. <div style="max-width: 94%;min-width: 90%">
  89. <!--列表-->
  90. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
  91. <el-table-column type="index" width="60">
  92. <template slot-scope="scope" >
  93. {{scope.$index+1+(page-1)*size}}
  94. </template>
  95. </el-table-column>
  96. <el-table-column prop="stagesName" label="任务阶段" sortable width="180" @mouseover="mouseOver">
  97. </el-table-column>
  98. <el-table-column prop="name" label="任务名称" sortable width="330">
  99. <template slot-scope="scope">
  100. <div v-if="scope.row.name.length > 20">
  101. <el-popover trigger="hover" placement="top" width="330" v-if="scope.row.name">
  102. <p id="caseContent">{{scope.row.name}}</p>
  103. <div slot="reference" class="name-wrapper">
  104. <div class="cal" >
  105. <el-link type="primary" @click="editTask(scope.row)">{{scope.row.name}}</el-link>
  106. </div>
  107. </div>
  108. </el-popover>
  109. </div>
  110. <div v-else>
  111. <div class="cal">
  112. <el-link type="primary" @click="editTask(scope.row)">{{scope.row.name}}</el-link>
  113. </div>
  114. </div>
  115. </template>
  116. </el-table-column>
  117. <!-- <el-table-column prop="projectCategorySub" label="项目分组" sortable width="300" v-if="user.companyId == '428'"></el-table-column> -->
  118. <el-table-column prop="departmentName" label="所属部门" sortable width="300" v-if="user.timeType.projectWithDept"></el-table-column>
  119. <el-table-column prop="projectName" label="项目名称" sortable width="260" show-overflow-tooltip>
  120. <template slot-scope="scope">
  121. <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="executorName" label="执行人" sortable width="130">
  125. <template slot-scope="scope">
  126. <!-- <el-link type="primary" @click="showUser(scope.row.executorId)">{{scope.row.executorName}}</el-link> -->
  127. <span>{{scope.row.executorName}}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column prop="startDate" label="开始时间" sortable width="180"></el-table-column>
  131. <el-table-column prop="endDate" label="截止时间" width="260" fixed="right" sortable>
  132. <template slot-scope="scope">
  133. <div style="display: flex;justify-content: space-between;padding-right: 40px">
  134. <span style="display: inline-block;margin-right: 55px">
  135. <span :class="judgedate(scope.row.endDate) && searchField == '0' && scope.row.taskStatus == 0 ? 'redwarningspan autodatespan' : 'autodatespan'">{{scope.row.endDate}}</span>
  136. </span>
  137. <el-button v-if="searchField == 0" size="small" type="primary" @click="completes(scope.row.id, 0)">完成</el-button>
  138. <el-button v-if="searchField == 1" size="small" type="warning" @click="completes(scope.row.id, 1)">重启</el-button>
  139. </div>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. <!--工具条-->
  144. <el-col :span="24" class="toolbar">
  145. <el-pagination
  146. @size-change="handleSizeChange"
  147. @current-change="handleCurrentChange"
  148. :page-sizes="[20, 50 , 80 , 100]"
  149. :page-size="20"
  150. :current-page="page"
  151. layout="total, sizes, prev, pager, next"
  152. :total="total"
  153. style="float:right;"
  154. ></el-pagination>
  155. </el-col>
  156. </div>
  157. </div>
  158. <!--新增界面-->
  159. <!-- <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
  160. <el-form ref="form1" :model="addForm" :rules="rules" label-width="100px">
  161. <el-form-item label="任务名称" >
  162. <el-input v-model="addForm.code" :disabled="user.role==0" placeholder="请输入项目编号" clearable></el-input>
  163. </el-form-item>
  164. <el-form-item label="项目名称" prop="name">
  165. <el-input v-model="addForm.name" :disabled="user.role==0" placeholder="请输入项目名称" clearable></el-input>
  166. </el-form-item>
  167. <el-form-item label="全部参与者">
  168. <el-select v-model="addForm.userId" multiple filterable placeholder="请选择参与者" style="width:100%;" @change="changeParticipator">
  169. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  170. </el-select>
  171. </el-form-item>
  172. <el-form-item label="主要负责人" >
  173. <el-select v-model="addForm.inchargerId" :disabled="addForm.userId.length==0 || user.role==0" filterable placeholder="请选择负责人" style="width:100%;" @change="changeIncharger">
  174. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  175. </el-select>
  176. </el-form-item>
  177. </el-form>
  178. <div slot="footer" class="dialog-footer">
  179. <el-button @click.native="addFormVisible = false">取消</el-button>
  180. <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
  181. </div>
  182. </el-dialog> -->
  183. <!--用户详细信息弹出框-->
  184. <el-dialog title="查看详情" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  185. <div class="line"><span>姓名</span><span>{{userDetail.name}}</span></div>
  186. <div class="line"><span>手机号码</span><span>{{userDetail.phone}}</span></div>
  187. <div class="line"><span>部门</span><span>{{userDetail.departmentName}}</span></div>
  188. <div class="line"><span>成本</span><span>{{userDetail.cost}}元/小时</span></div>
  189. <div slot="footer" class="dialog-footer">
  190. <el-button type="primary" @click="userDetailVisible = false" >确定</el-button>
  191. </div>
  192. </el-dialog>
  193. <!-- 子项目列表 -->
  194. <el-dialog title="子项目列表" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  195. <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
  196. <el-table-column type="index" width="60" label="序号">
  197. <template slot-scope="scope" >
  198. {{scope.$index+1+(page-1)*size}}
  199. </template>
  200. </el-table-column>
  201. <el-table-column prop="name" label="名称" ></el-table-column>
  202. <el-table-column label="操作" width="150">
  203. <template slot-scope="scope" >
  204. <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">编辑</el-button>
  205. <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">删除</el-button>
  206. </template>
  207. </el-table-column>
  208. </el-table>
  209. <div slot="footer" class="dialog-footer">
  210. <el-button type="primary" @click="subProjectVisible = false" >关闭</el-button>
  211. <el-button type="primary" @click="addNewSubProject()" >新增子项目</el-button>
  212. </div>
  213. </el-dialog>
  214. <!-- 新增子项目弹出框 -->
  215. <!-- <el-dialog title="新增/修改子项目" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
  216. <el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
  217. <el-form-item label="项目名称" prop="name">
  218. <el-input v-model="addForm.name" placeholder="请输入项目名称" clearable></el-input>
  219. </el-form-item>
  220. </el-form>
  221. <div slot="footer" class="dialog-footer">
  222. <el-button @click.native="addSubProject = false">取消</el-button>
  223. <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">提交456</el-button>
  224. </div>
  225. </el-dialog> -->
  226. <!-- 任务详情信息弹出框 -->
  227. <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
  228. :close-on-click-modal="false" customClass="customWidth" width="800px">
  229. <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
  230. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  231. <!--子任务需要选择任务列表 -->
  232. <el-form-item label="任务列表" prop="stages" v-if="addForm.parentTid != null">
  233. <el-select v-model="addForm.stagesId" style="width:100%;" >
  234. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  235. </el-select>
  236. </el-form-item>
  237. <el-form-item label="类型">
  238. <el-select v-model="addForm.taskType" style="width:100%;" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement">
  239. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  240. <i :class="item.icon" ></i>
  241. <span>{{item.name}}</span>
  242. </el-option>
  243. </el-select>
  244. </el-form-item>
  245. <el-form-item label="任务内容" prop="name">
  246. <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" placeholder="请输入任务内容" clearable></el-input>
  247. </el-form-item>
  248. <el-form-item :label="addForm.taskType == 1 ? '截至时间' : '开始时间'" :prop="addForm.taskType == 1 ? 'endDate' : 'startDate'">
  249. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  250. placeholder="请选择日期" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" v-if="addForm.taskType != 1"></el-date-picker>
  251. <span style="margin-left:30px;margin-right:10px;" v-if="addForm.taskType != 1">截止时间</span>
  252. <el-date-picker v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
  253. placeholder="请选择日期" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement"></el-date-picker>
  254. </el-form-item>
  255. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  256. <el-form-item :label="'执行人'+(index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
  257. <el-select v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" size="small" filterable clearable placeholder="请选择执行人" style="width:40%;" @change="$forceUpdate()">
  258. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  259. <span style="float: left">{{ item.name }}</span>
  260. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  261. </el-option>
  262. </el-select>
  263. <span style="margin-left:30px;margin-right:10px;">计划工时</span>
  264. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" v-model="executorItem.planHours" style="width:30%;" :min="1" :max="100" placeholder="请输入计划工作时长,单位小时" ></el-input-number ><span style="margin-left:10px;">小时</span>
  265. <!--移除执行人 -->
  266. <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
  267. </el-form-item>
  268. <el-link type="primary" v-if="(addForm.executorListFront == null || addForm.executorListFront.length<10)&& (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement)" style="margin-left:35px;" @click="addExecutorLine">添加执行人</el-link>
  269. </div>
  270. <el-form-item label="优先级">
  271. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  272. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  273. </el-select>
  274. </el-form-item>
  275. <!-- 富文本 -->
  276. <el-form-item label="详细描述" style="height: 200px">
  277. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  278. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  279. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  280. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  281. </el-form-item>
  282. <!-- 富文本 -->
  283. <div v-if="addForm.id != null">
  284. <el-divider ></el-divider>
  285. <!-- 任务进展 -->
  286. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">任务进展</i>
  287. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">添加任务进展</el-link></span>
  288. </p>
  289. <!-- 任务进展展示 -->
  290. <div style="display: none;" ref="proBox" class="progress">
  291. <!-- <el-form :model="> -->
  292. <el-radio-group v-model="radio">
  293. <el-radio :label="0" class="rala1">状态正常</el-radio>
  294. <el-radio :label="1" class="rala2">存在风险</el-radio>
  295. <el-radio :label="2" class="rala3">进展逾期</el-radio>
  296. </el-radio-group>
  297. <el-input
  298. type="textarea"
  299. border="0"
  300. :autosize="{ minRows: 2, maxRows: 6}"
  301. placeholder="请输入详细进展描述"
  302. v-model.trim="text2"
  303. style="margin:10px 0 0 0">
  304. </el-input>
  305. <h4 style="font-weight: normal;">提醒谁查看:{{checkLists.length}}</h4>
  306. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  307. <div class="remind" ref="addRem" style="display: none">
  308. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  309. <p><el-checkbox :label="item.name" @change="kkk(item)"></el-checkbox></p>
  310. </el-checkbox-group>
  311. </div>
  312. <div class="ssp" @click="sss"></div>
  313. <!-- </el-form> -->
  314. <div class="pro_btn">
  315. <el-button size="mini" @click="shutPro">取消</el-button>
  316. <el-button size="mini" type="primary" @click="addTaskProgress">发布</el-button>
  317. </div>
  318. </div>
  319. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  320. <div class="elCard" style="margin-bottom: 10px; height:" >
  321. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  322. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  323. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  324. <span v-if="recentProgressInfo.status == 0">状态正常</span>
  325. <span v-else-if="recentProgressInfo.status == 1">状态正常</span>
  326. <span v-else>进展逾期</span>
  327. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  328. <i class="el-icon-more" ></i>
  329. <el-dropdown-menu slot="dropdown">
  330. <el-dropdown-item divided>
  331. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>删除列表</span></el-dropdown-item>
  332. </el-dropdown-menu>
  333. </el-dropdown>
  334. <div class="elCard_qu">{{recentProgressInfo.creatorName}}更新于{{recentProgressInfo.indate | relativeTime}}</div>
  335. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  336. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">查看历史记录</el-button></div>
  337. </div>
  338. </div>
  339. <!-- 任务列表没有数据的时候展示 -->
  340. <div class="nones" v-if="ProgressList.length <= 0">
  341. 暂无数据
  342. </div>
  343. <!-- 任务进展完整状态 -->
  344. <el-dialog title="提示" :visible.sync="innerVisibless" append-to-body width="500px">
  345. <div class="integrity">
  346. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">任务进展:{{ProgressList.length}}</h3>
  347. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  348. <el-divider></el-divider>
  349. <!-- -->
  350. <div class="block" style="height: 200px;">
  351. <el-timeline style="padding:20px 0 0 0;">
  352. <el-timeline-item
  353. v-for="(activity, index) in ProgressList"
  354. :key="index">
  355. <div class="tb">
  356. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  357. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  358. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  359. <div>
  360. <span v-if="activity.status == 0" style="color: #43D14F">状态正常</span>
  361. <span v-if="activity.status == 1" style="color: #FD7624">存在风险</span>
  362. <span v-if="activity.status == 2" style="color: red">进展逾期</span>
  363. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  364. </div>
  365. <p style="color: #8C8C8C">{{activity.content}}</p>
  366. </div>
  367. </el-timeline-item>
  368. </el-timeline>
  369. </div>
  370. <!-- -->
  371. </div>
  372. <span slot="footer" class="dialog-footer">
  373. <el-button type="primary" @click="innerVisibless = false">关闭</el-button>
  374. </span>
  375. </el-dialog>
  376. <!-- 子任务 -->
  377. <!-- <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">子任务</i>
  378. <el-link style="float:right;" @click="addSubTask">添加子任务</el-link>
  379. </p> -->
  380. <!--子任务列表 -->
  381. <!-- <el-table :data="addForm.subTaskList"
  382. :header-cell-style="{'font-weight':'normal'}"
  383. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  384. <el-table-column prop="taskStatus" label="完成" width="50" >
  385. <template slot-scope="scope">
  386. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  387. @click.stop.native=""
  388. @change="finishTask(scope.row)"
  389. ></el-checkbox>
  390. </template>
  391. </el-table-column>
  392. <el-table-column prop="name" label="标题" >
  393. <template slot-scope="scope">
  394. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  395. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  396. </el-tooltip>
  397. </template>
  398. </el-table-column>
  399. <el-table-column prop="executorName" label="执行人" width="100" >
  400. <template slot-scope="scope">
  401. {{scope.row.executorName == null?"待分配":scope.row.executorName}}
  402. </template>
  403. </el-table-column>
  404. <el-table-column prop="endDate" label="截止时间" width="100" >
  405. <template slot-scope="scope">
  406. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  407. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  408. </template>
  409. </el-table-column>
  410. </el-table> -->
  411. </div>
  412. </el-form>
  413. <div slot="footer" class="dialog-footer">
  414. <el-button v-if="user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement" @click.native="deleteTask" style="float:left;">删除</el-button>
  415. <el-button @click.native="addFormVisible = false">取消</el-button>
  416. <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
  417. </div>
  418. <div slot="title" v-if="addForm.parentTid != null" >
  419. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  420. <el-page-header @back="backToParentTask" title="返回父任务" :content="addForm.parentTname"></el-page-header>
  421. </div>
  422. <!-- 评论 -->
  423. <div class="remark" v-show="addForm.id != null">
  424. <span class="zh">
  425. <!-- <span v-for="(pl, i) in critic" :key="i"> -->
  426. <!-- <div class="player" v-if="pl"> -->
  427. <div class="player">
  428. <p @click="chan">参与人</p>
  429. <span v-for="(pl, i) in critic" :key="i">
  430. <div class="bj" style="width: 14%">
  431. <span style="background: #778899">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  432. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  433. </div>
  434. </span>
  435. </div>
  436. <!-- </span> -->
  437. <div class="subject">
  438. <div class="sub-all">所有动态</div>
  439. <div class="sub-details" ref="main">
  440. <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto" ref="contRoll">
  441. <div style="width: 100%" v-if="commentList.length <= 0">
  442. <img src="../../assets/image/xiao.png" alt="">
  443. </div>
  444. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  445. <p><i class="el-icon-s-fold"></i> <em>屈经理完成了依赖任务</em><span>4月20日</span></p>
  446. </li>
  447. <li class="carts" v-for="item in commentList" :key="item.id">
  448. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  449. <!-- <i :style="'background' + item.userColor"> -->
  450. <i :style="'background' + item.userColor">
  451. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  452. </i>
  453. <div>
  454. <!-- <p>{{item.userName}}</p> -->
  455. <p>{{item.userName}}</p>
  456. <em>{{item.content}}</em>
  457. </div>
  458. <span>{{item.createTime | relativeTime}}</span>
  459. </li>
  460. </ul>
  461. </div>
  462. </div>
  463. <div class="issue">
  464. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  465. <div class="issue_fixation">
  466. <div class="inputDeep"><el-input
  467. type="textarea"
  468. placeholder="请输入内容"
  469. :autosize="{ minRows: 6, maxRows: 6}"
  470. v-model.trim="textarea2"
  471. class="inputDeeps"
  472. >
  473. </el-input></div>
  474. <el-button class="issue-button" type="primary" @click="release()">发布</el-button>
  475. </div>
  476. </div>
  477. </span>
  478. </div>
  479. <!-- 评论 -->
  480. </el-dialog>
  481. </section>
  482. </template>
  483. <style scoped>
  484. .input-with-select .el-input-group__prepend {
  485. background-color: #fff;
  486. }
  487. .line {
  488. padding:10px;
  489. }
  490. .line span{
  491. font-size:18px;
  492. }
  493. .line span:nth-child(even){
  494. float:right;
  495. }
  496. .classification {
  497. width: 120px;
  498. border-right: 1px solid #f2f2f2;
  499. display: flex;
  500. flex-wrap: wrap;
  501. padding-top: 20px;
  502. }
  503. .classification p{
  504. width: 120px;
  505. text-align: center;
  506. line-height: 50px;
  507. margin: 0;
  508. cursor: pointer;
  509. }
  510. .classification p:hover {
  511. background: #dddddd;
  512. }
  513. .on {
  514. color: #409EFF;
  515. }
  516. .acl{
  517. display: inline-block;
  518. width: 300px;
  519. height: 22px;
  520. overflow: hidden;
  521. white-space: nowrap;
  522. text-overflow: ellipsis;
  523. display: flex;
  524. align-items: center;
  525. margin: 0;
  526. padding: 0;
  527. line-height: 0;
  528. }
  529. .cal {
  530. color: #409EFF;
  531. width: 300px;
  532. overflow: hidden;
  533. white-space: nowrap;
  534. text-overflow: ellipsis;
  535. }
  536. .autodatespan{
  537. padding: 1.5px 2.5px;
  538. width: 73px;
  539. height: 16px;
  540. line-height: 16px;
  541. text-align: center;
  542. display: block;
  543. }
  544. .redwarningspan{
  545. background: #e62412;
  546. color: #fff;
  547. border-radius: 3px;
  548. }
  549. /* p {
  550. margin: 0 !important;
  551. } */
  552. </style>
  553. <style lang="scss" scoped>
  554. .counli {
  555. em {
  556. font-style: normal;
  557. display: inline-block;
  558. margin-left: 9%;
  559. }
  560. span {
  561. float: right;
  562. }
  563. }
  564. .carts {
  565. position: relative;
  566. .el-image{
  567. border-radius: 50%;
  568. float: left;
  569. width: 20%;
  570. }
  571. i {
  572. width: 30px;
  573. height: 30px;
  574. // background: #778899;
  575. display: inline-block;
  576. float: left;
  577. border-radius:50%;
  578. font-style:normal;
  579. font-size: 12px;
  580. line-height: 30px;
  581. text-align: center;
  582. color: #fff;
  583. background: #778899;
  584. }
  585. div {
  586. text-align: left;
  587. p {
  588. text-align: left;
  589. margin-left: 10px;
  590. margin-left: 13%;
  591. }
  592. em {
  593. display: block;
  594. font-style: normal;
  595. margin-left: 13%;
  596. }
  597. }
  598. span {
  599. font-size: 10px;
  600. float: right;
  601. margin-top: -40px;
  602. }
  603. }
  604. .issue {
  605. // height: 20%;
  606. // position: relative;
  607. // z-index: 4;
  608. .zh{
  609. position: relative;
  610. width: 100%;
  611. height: 100%;
  612. }
  613. .textareays {
  614. background: #000;
  615. height: 140px;
  616. border: 0;
  617. .el-textarea__inner {
  618. height: 85%;
  619. }
  620. }
  621. .issue-button {
  622. position: absolute;
  623. bottom: 20px;
  624. right: 20px;
  625. }
  626. }
  627. .inputDeep {
  628. position: absolute;
  629. bottom: 85px;
  630. width: 95%;
  631. margin: 0 12px;
  632. }
  633. .inputDeep .el-textarea .el-textarea__inner{
  634. border: 0 !important;
  635. resize: none !important;
  636. }
  637. .inputDeeps .el-textarea__inner {
  638. border: 0 !important;
  639. resize: none !important;
  640. }
  641. .scop_span {
  642. display: inline-block;
  643. padding: 2px 5px;
  644. }
  645. </style>
  646. <script>
  647. import { error } from 'dingtalk-jsapi';
  648. import util from "../../common/js/util";
  649. // 富文本样式
  650. import 'quill/dist/quill.core.css'
  651. import 'quill/dist/quill.snow.css'
  652. import 'quill/dist/quill.bubble.css'
  653. // 导入富文本
  654. import { quillEditor } from 'vue-quill-editor'
  655. export default {
  656. name: "two-list-headerslots",
  657. display: "Two list header slot",
  658. order: 14,
  659. components: {
  660. // draggable,
  661. // // editor,
  662. // FileCenter,
  663. // ProjectInfo,
  664. // Summary,
  665. // Earning,
  666. quillEditor // 富文本
  667. },
  668. data() {
  669. return {
  670. typeField: null,
  671. searchField: '0',
  672. keyword:null,
  673. user: JSON.parse(sessionStorage.getItem("user")),
  674. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  675. userDetailVisible: false,
  676. userDetail:{},
  677. date: new Date(),
  678. users: [],
  679. participator:[],
  680. tableHeight: 0,
  681. listLoading: false,
  682. total: 0,
  683. page: 1,
  684. size: 20,
  685. list: [],
  686. subProjectVisible: false,
  687. subProjectList: [],//子项目列表
  688. currentProject:{},
  689. addSubProject: false,
  690. addFormVisible: false,
  691. addLoading: false,
  692. title: "",
  693. addForm: {
  694. name: '',
  695. userId: [],
  696. },
  697. rules: {
  698. name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
  699. },
  700. idx: 1,
  701. taskDetails: false,
  702. addForm: {
  703. name: '',
  704. },
  705. rules: {
  706. name: [{ required: true, message: "请输入分组名称", trigger: "blur" }],
  707. },
  708. rules2: {
  709. stagesName: [{ required: true, message: "请输入任务列表名称", trigger: "blur" }],
  710. },
  711. taskRules : {
  712. name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
  713. },
  714. sleectId: null,
  715. sleectProjectId: null,
  716. sidebarIndex: null, // 侧边栏索引
  717. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  718. count: 0,
  719. textarea2: '',
  720. taskId: null,
  721. commentList: [],
  722. radio: 0,
  723. critic: [], // 评论头像的数组
  724. editorOption: { // 富文本框里面的默认值
  725. placeholder: '请输入文本...',
  726. modules: {
  727. toolbar:[
  728. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  729. // ['blockquote', 'code-block'], //引用,代码块
  730. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  731. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  732. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  733. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  734. // [{ 'direction': 'rtl' }], // 文本方向
  735. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  736. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  737. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  738. // [{ 'font': [] }], //字体
  739. [{ 'align': [] }], //对齐方式
  740. ['clean'], //清除字体样式
  741. // ['image','video'] //上传图片、上传视频
  742. ['image'] //上传图片、上传视频
  743. ], //工具栏设置
  744. },
  745. theme: 'snow',
  746. },
  747. textContent: true, // 控制提交
  748. times: null,
  749. text2: '',
  750. innerVisibless: false, // 任务展示弹出层
  751. activities: [{
  752. content: '状态正常',
  753. timestamp: '7小时前',
  754. size: 'large',
  755. type: 'primary',
  756. icon: 'el-icon-circle-check',
  757. color: '#409EFF'
  758. }, {
  759. content: '进展逾期',
  760. timestamp: '八小时前',
  761. color: '#F87872'
  762. }],
  763. ProgressList: [],
  764. checkboxGrounp: [], // 选中人的数据
  765. checkLists: [], // 选中人数据的ID
  766. taskIid: null,
  767. viewList: [{id:1,name:"全部任务"},{id:2,name:"进行中的任务"},{id:3,name:"已完成的任务"},{id:4,name:"待安排任务"},
  768. {id:5,name:"我创建的任务"},{id:6,name:"我执行的任务"},{id:7,name:"今天的任务"},{id:8,name:"已超期的任务"}],
  769. importanceList:[{id:0,name:"一般"},{id:1,name:"重要"},{id:2,name:"紧急"},],
  770. taskTypeList:[{id:0,name:"任务", icon:"iconfont firerock-iconrenwu"},{id:1,name:"里程碑",icon:"iconfont firerock-iconicon-"},{id:2,name:"风险",icon:"iconfont firerock-iconfengxian"}],
  771. taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
  772. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  773. taskStatusList:['进行中','已完成','已撤销'],
  774. //优先级
  775. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  776. stageList: '',
  777. selectedGroup:{},
  778. dateClass: true,
  779. dateType: 0,
  780. dateSelect: [],
  781. groupName: '',
  782. groupNameList: [],
  783. departmentList: [],
  784. deptId: []
  785. };
  786. },
  787. methods: {
  788. judgedate(itemD){
  789. let nowdate = new Date()
  790. let idate = new Date(itemD + " 23:59:59")
  791. return nowdate > idate ? true : false
  792. },
  793. deleteSubPro(subProject) {
  794. this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
  795. confirmButtonText: "确定",
  796. cancelButtonText: "取消",
  797. type: "warning"
  798. })
  799. .then(() => {
  800. this.listLoading = true;
  801. this.http.post('/sub-project/deleteProject',{
  802. id: subProject.id
  803. },
  804. res => {
  805. this.listLoading = false;
  806. if (res.code == "ok") {
  807. this.$message({
  808. message: "删除成功",
  809. type: "success"
  810. });
  811. this.subProject(this.currentProject);
  812. } else {
  813. this.$message({
  814. message: res.msg,
  815. type: "error"
  816. });
  817. }
  818. },
  819. error => {
  820. this.listLoading = false;
  821. this.$message({
  822. message: error,
  823. type: "error"
  824. });
  825. }
  826. );
  827. })
  828. .catch(() => {});
  829. },
  830. searchList() {
  831. this.page = 1;
  832. this.getList();
  833. },
  834. addNewSubProject(subProject) {
  835. if (subProject == null) {
  836. this.addForm = {projectId: this.currentProject.id}
  837. } else {
  838. this.addForm = subProject;
  839. }
  840. this.addSubProject = true;
  841. },
  842. //显示子项目
  843. subProject(item) {
  844. this.subProjectVisible = true;
  845. this.currentProject = item;
  846. this.http.post('/sub-project/list', {
  847. projectId: item.id
  848. },
  849. res => {
  850. if (res.code == "ok") {
  851. this.subProjectList = res.data;
  852. } else {
  853. this.$message({
  854. message: res.msg,
  855. type: "error"
  856. });
  857. }
  858. },
  859. error => {
  860. this.$message({
  861. message: error,
  862. type: "error"
  863. });
  864. });
  865. },
  866. //显示用户详情
  867. showUser(userId) {
  868. this.userDetailVisible = true;
  869. this.http.post(this.port.manage.userDetail, {
  870. userId: userId
  871. },
  872. res => {
  873. if (res.code == "ok") {
  874. this.userDetail = res.data;
  875. } else {
  876. this.$message({
  877. message: res.msg,
  878. type: "error"
  879. });
  880. }
  881. },
  882. error => {
  883. this.$message({
  884. message: error,
  885. type: "error"
  886. });
  887. });
  888. },
  889. //选择参与人
  890. changeParticipator() {
  891. //检查是否在参与人中,如果没有需要加入到参与人中
  892. // console.log(this.addForm.userId);
  893. var find = false;
  894. this.participator = [];
  895. this.addForm.userId.forEach(u=>{
  896. var findUser = this.users.filter(au=>au.id == u)[0];
  897. this.participator.push(findUser);
  898. })
  899. },
  900. getUsers() {
  901. // this.http.post(this.port.manage.list, {
  902. // departmentId: -1,
  903. // pageIndex: 1,
  904. // // pageSize: 99999
  905. // pageSize: -1
  906. // },
  907. this.http.post('/user/getSimpleActiveUserList', {},
  908. res => {
  909. if (res.code == "ok") {
  910. this.users = res.data;
  911. } else {
  912. this.$message({
  913. message: res.msg,
  914. type: "error"
  915. });
  916. }
  917. },
  918. error => {
  919. this.$message({
  920. message: error,
  921. type: "error"
  922. });
  923. });
  924. },
  925. addStagePost() {
  926. let param = JSON.parse(JSON.stringify(this.stageForm));
  927. param.taskList = [];
  928. this.http.post('/stages/save',param,
  929. res => {
  930. if (res.code == "ok") {
  931. this.stageList = res.data;
  932. this.addStageDialog = false;
  933. } else {
  934. this.$message({
  935. message: res.msg,
  936. type: "error"
  937. });
  938. }
  939. },
  940. error => {
  941. this.$message({
  942. message: error,
  943. type: "error"
  944. });
  945. });
  946. },
  947. //分页
  948. handleCurrentChange(val) {
  949. this.page = val;
  950. this.getList();
  951. },
  952. handleSizeChange(val) {
  953. this.size = val;
  954. this.getList();
  955. },
  956. //获取项目列表
  957. getList() {
  958. this.listLoading = true;
  959. let parameter = {
  960. status: this.searchField,
  961. viewId: this.idx,
  962. pageIndex: this.page,
  963. pageSize: this.size,
  964. // type: this.typeField
  965. }
  966. if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
  967. parameter.type = this.typeField
  968. }
  969. if(this.dateSelect.length != 0){
  970. parameter.dateType = this.dateType
  971. parameter.startDate = this.dateSelect[0]
  972. parameter.endDate = this.dateSelect[1]
  973. }
  974. // if(this.user.companyId == '428') {
  975. // parameter.groupName = this.groupName
  976. // }
  977. if(this.deptId.length > 0) {
  978. parameter.deptId = this.deptId[this.deptId.length - 1]
  979. } else {
  980. parameter.deptId = ''
  981. }
  982. this.http.post('/task/listByPage', parameter,
  983. res => {
  984. this.listLoading = false;
  985. if(res.code == 'ok') {
  986. this.list = res.data.records
  987. this.total = res.data.total
  988. } else {
  989. this.$message({
  990. message: res.msg,
  991. type: "error"
  992. });
  993. }
  994. // console.log(res)
  995. },
  996. error => {
  997. this.listLoading = false;
  998. this.$message({
  999. message: error,
  1000. type: "error"
  1001. });
  1002. })
  1003. },
  1004. //显示新增界面
  1005. handleAdd(i, item) {
  1006. if(i == -1) {
  1007. this.title = "新增任务";
  1008. this.addForm = {
  1009. name: '',
  1010. userId: [],
  1011. code:'',
  1012. inchargerId:null,
  1013. }
  1014. } else {
  1015. this.title = "修改项目";
  1016. var list = item.participator , arr = [];
  1017. for(var j in list) {
  1018. arr.push(list[j].id)
  1019. }
  1020. this.addForm = {
  1021. id: item.id,
  1022. name: item.projectName,
  1023. userId: arr,
  1024. code:item.projectCode,
  1025. inchargerId: item.inchargerId
  1026. }
  1027. this.changeParticipator();
  1028. }
  1029. this.addFormVisible = true;
  1030. },
  1031. //提交子项目创建修改请求
  1032. submitInsertSubProject () {
  1033. this.$refs.form2.validate(valid => {
  1034. if (valid) {
  1035. this.http.post('/sub-project/saveOrUpdate',this.addForm,
  1036. res => {
  1037. if (res.code == "ok") {
  1038. this.$message({
  1039. message: "操作成功",
  1040. type: "success"
  1041. });
  1042. this.subProject(this.currentProject);
  1043. this.addSubProject = false;
  1044. } else {
  1045. this.$message({
  1046. message: res.msg,
  1047. type: "error"
  1048. });
  1049. }
  1050. },
  1051. error => {
  1052. this.listLoading = false;
  1053. this.$message({
  1054. message: error,
  1055. type: "error"
  1056. });
  1057. }
  1058. );
  1059. }
  1060. });
  1061. },
  1062. // submitInsert() {
  1063. // console.log("111");
  1064. // this.$refs.form1.validate(valid => {
  1065. // if (valid) {
  1066. // this.addLoading = true;
  1067. // let formData = new FormData();
  1068. // formData.append("name", this.addForm.name);
  1069. // if(this.addForm.id != null) {
  1070. // formData.append("id", this.addForm.id);
  1071. // }
  1072. // if(this.addForm.userId.length != 0) {
  1073. // for(var j in this.addForm.userId) {
  1074. // formData.append("userId", this.addForm.userId[j]);
  1075. // }
  1076. // }
  1077. // if(this.addForm.inchargerId != null) {
  1078. // formData.append("inchargerId", this.addForm.inchargerId);
  1079. // }
  1080. // if(this.addForm.code != null) {
  1081. // formData.append("code", this.addForm.code);
  1082. // }
  1083. // formData.delete("refTaskList")
  1084. // console.log('走了')
  1085. // this.http.uploadFile(this.port.project.add,formData,
  1086. // res => {
  1087. // this.addLoading = false;
  1088. // if (res.code == "ok") {
  1089. // this.$message({
  1090. // message: this.addForm.id!=null?'修改':'创建'+"成功",
  1091. // type: "success"
  1092. // });
  1093. // this.addFormVisible = false;
  1094. // this.getList();
  1095. // } else {
  1096. // this.$message({
  1097. // message: res.msg,
  1098. // type: "error"
  1099. // });
  1100. // }
  1101. // },
  1102. // error => {
  1103. // this.addLoading = false;
  1104. // this.$message({
  1105. // message: error,
  1106. // type: "error"
  1107. // });
  1108. // });
  1109. // }
  1110. // });
  1111. // },
  1112. // 删除
  1113. deletePro(i, item) {
  1114. this.$confirm("确定要项目" + item.projectName + "吗?","删除项目", {
  1115. confirmButtonText: "确定",
  1116. cancelButtonText: "取消",
  1117. type: "warning"
  1118. })
  1119. .then(() => {
  1120. this.listLoading = true;
  1121. this.http.post(this.port.project.delete,{
  1122. id: item.id
  1123. },
  1124. res => {
  1125. this.listLoading = false;
  1126. if (res.code == "ok") {
  1127. this.$message({
  1128. message: "删除成功",
  1129. type: "success"
  1130. });
  1131. this.getList();
  1132. } else {
  1133. this.$message({
  1134. message: res.msg,
  1135. type: "error"
  1136. });
  1137. }
  1138. },
  1139. error => {
  1140. this.listLoading = false;
  1141. this.$message({
  1142. message: error,
  1143. type: "error"
  1144. });
  1145. }
  1146. );
  1147. })
  1148. .catch(() => {});
  1149. },
  1150. detail(i) {
  1151. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  1152. },
  1153. // 切换当前选项的索引
  1154. switchs(e) {
  1155. this.idx = e
  1156. this.page = 1
  1157. // console.log(this.searchField)
  1158. this.getList()
  1159. },
  1160. // 下拉框选择
  1161. hiddens() {
  1162. // console.log(this.searchField)
  1163. this.page = 1
  1164. this.getList()
  1165. },
  1166. // 完成
  1167. completes(e, el) {
  1168. this.http.post('/task/finish', {
  1169. id: e,
  1170. taskStatus: el
  1171. },
  1172. res => {
  1173. if (res.code == "ok") {
  1174. this.$message({
  1175. message: "操作成功",
  1176. type: "success"
  1177. });
  1178. this.getList();
  1179. } else {
  1180. this.$message({
  1181. message: res.msg,
  1182. type: "error"
  1183. });
  1184. }
  1185. },
  1186. error => {
  1187. this.listLoading = false;
  1188. this.$message({
  1189. message: error,
  1190. type: "error"
  1191. });
  1192. }
  1193. )
  1194. },
  1195. // 点击任务事件
  1196. editTask(task) {
  1197. // console.log(task)
  1198. this.addFormVisible = true;
  1199. // this.addLoading = false;
  1200. this.title = "编辑任务";
  1201. this.getTaskDetail(task.id);
  1202. this.getTaskProgressList(task.id); // 获取任务进展列表
  1203. this.getUsers(); // 获取名单数据
  1204. this.gain(task); // 获取评论列表
  1205. // this.getStageList()
  1206. },
  1207. addExecutorLine() {
  1208. this.addForm.executorListFront.push({executorId:null, planHours:8});
  1209. this.$forceUpdate();
  1210. },
  1211. removeExecutorLine(index) {
  1212. this.addForm.executorListFront.splice(index,1);
  1213. this.$forceUpdate();
  1214. },
  1215. getTaskDetail(id) {
  1216. this.http.post('/task/getTask',{id: id},
  1217. res => {
  1218. if (res.code == "ok") {
  1219. this.addForm = res.data;
  1220. this.addForm.createDate = null;
  1221. this.addForm.indate = null;
  1222. this.addLoading = false;
  1223. this.recentProgressInfo = this.addForm.progress;
  1224. this.addForm.executorListFront = this.addForm.executorList;
  1225. //删除中间传值的变量数组
  1226. delete this.addForm.executorList;
  1227. } else {
  1228. this.$message({
  1229. message: res.msg,
  1230. type: "error"
  1231. });
  1232. }
  1233. },
  1234. error => {
  1235. this.$message({
  1236. message: error,
  1237. type: "error"
  1238. });
  1239. });
  1240. },
  1241. //获取任务进展列表
  1242. getTaskProgressList(taskId) {
  1243. this.taskIid = taskId
  1244. this.http.post('/task-progress/list', {taskId: taskId},
  1245. res => {
  1246. if (res.code == "ok") {
  1247. this.ProgressList = res.data;
  1248. this.recentProgressInfo = res.data[0]
  1249. } else {
  1250. this.$message({
  1251. message: res.msg,
  1252. type: "error"
  1253. });
  1254. }
  1255. }
  1256. );
  1257. },
  1258. getUsers() {
  1259. // console.log(this.port.manage.list)
  1260. // this.http.post(this.port.manage.list, {
  1261. // departmentId: -1,
  1262. // pageIndex: 1,
  1263. // pageSize: 99999
  1264. // },
  1265. this.http.post('/user/getSimpleActiveUserList', {},
  1266. res => {
  1267. if (res.code == "ok") {
  1268. this.users = res.data;
  1269. } else {
  1270. this.$message({
  1271. message: res.msg,
  1272. type: "error"
  1273. });
  1274. }
  1275. },
  1276. error => {
  1277. this.$message({
  1278. message: error,
  1279. type: "error"
  1280. });
  1281. });
  1282. },
  1283. // 获取评论列表
  1284. gain (task) {
  1285. this.commentList = [];
  1286. this.taskId = task.id;
  1287. this.http.post('/task-comment/getList', {taskId: task.id},
  1288. res => {
  1289. if (res.code == "ok") {
  1290. this.commentList = res.data
  1291. this.sppk(this.commentList) // 获取参与人的方法
  1292. } else {
  1293. this.$message({
  1294. message: res.msg,
  1295. type: "error"
  1296. });
  1297. }
  1298. },
  1299. error => {
  1300. this.$message({
  1301. message: error,
  1302. type: "error"
  1303. });
  1304. });
  1305. },
  1306. // 获取评论参与人
  1307. sppk(comit) {
  1308. var sk = []
  1309. comit.forEach(function(e){
  1310. sk.push(e.userName)
  1311. })
  1312. this.critic = new Set(sk)
  1313. },
  1314. sss(){
  1315. this.$refs.addRem.style.display="none"
  1316. },
  1317. addprogress(){ // 添加子任务进展事件
  1318. this.$refs.proBox.style.display="block"
  1319. this.$refs.addPro.style.display="none"
  1320. },
  1321. shutPro() { // 关闭任务进展
  1322. this.$refs.addPro.style.display="block"
  1323. this.$refs.addRem.style.display="none"
  1324. this.$refs.proBox.style.display="none"
  1325. },
  1326. addI() { // 打开选择查看
  1327. this.$refs.addRem.style.display="block"
  1328. },
  1329. load() {
  1330. if(this.count >= 0) return
  1331. this.count += 2
  1332. },
  1333. onEditorFocus() {
  1334. this.onEditorBlur()
  1335. },
  1336. kkk(el){
  1337. var k = this.checkLists.indexOf(el.id)
  1338. if (k == -1) {
  1339. this.checkLists.push(el.id)
  1340. } else {
  1341. this.checkLists.splice(k, 1)
  1342. }
  1343. },
  1344. shutPro() { // 关闭任务进展
  1345. this.$refs.addPro.style.display="block"
  1346. this.$refs.addRem.style.display="none"
  1347. this.$refs.proBox.style.display="none"
  1348. },
  1349. addTaskProgress() { //创建任务进展
  1350. var param = {
  1351. taskId: this.taskIid,
  1352. status: this.radio,
  1353. content: this.text2,
  1354. participatorIds: this.checkLists.toString()
  1355. };
  1356. this.http.post('/task-progress/addProgress', param,
  1357. res => {
  1358. if (res.code == "ok") {
  1359. this.shutPro()
  1360. this.getTaskProgressList(this.taskIid)
  1361. this.$message({
  1362. message: '发布成功',
  1363. type: "success"
  1364. });
  1365. this.checkboxGrounp = [],
  1366. this.checkLists = [],
  1367. this.text2 = '',
  1368. this.radio = 0
  1369. } else {
  1370. this.$message({
  1371. message: res.msg,
  1372. type: "error"
  1373. });
  1374. }
  1375. }
  1376. );
  1377. },
  1378. //删除任务进展
  1379. deleteTaskProgress(id) {
  1380. this.http.post('/task-progress/deleteProgress', {id: id},
  1381. res => {
  1382. if (res.code == "ok") {
  1383. this.getTaskProgressList(this.taskIid)
  1384. this.$message({
  1385. message: '删除成功',
  1386. type: "success"
  1387. });
  1388. } else {
  1389. this.$message({
  1390. message: res.msg,
  1391. type: "error"
  1392. });
  1393. }
  1394. }
  1395. );
  1396. },
  1397. //显示子任务创建卡片
  1398. addSubTask() {
  1399. this.addFormVisible = true;
  1400. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  1401. this.addLoading = false;
  1402. },
  1403. taskLineClick(row, column, event) {
  1404. this.editTask(row);
  1405. },
  1406. finishTask(task) {
  1407. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  1408. res => {
  1409. if (res.code == "ok") {
  1410. if (this.groupType == 0) {
  1411. this.getStageList();
  1412. } else {
  1413. // this.getViewTaskList();
  1414. }
  1415. } else {
  1416. this.$message({
  1417. message: res.msg,
  1418. type: "error"
  1419. });
  1420. }
  1421. },
  1422. error => {
  1423. this.$message({
  1424. message: error,
  1425. type: "error"
  1426. });
  1427. });
  1428. },
  1429. //认领任务
  1430. addAsMyTask(task) {
  1431. this.http.post('/task/addAsMyTask',{id: task.id},
  1432. res => {
  1433. if (res.code == "ok") {
  1434. this.getStageList();
  1435. } else {
  1436. this.$message({
  1437. message: res.msg,
  1438. type: "error"
  1439. });
  1440. }
  1441. },
  1442. error => {
  1443. this.$message({
  1444. message: error,
  1445. type: "error"
  1446. });
  1447. });
  1448. },
  1449. timess(){
  1450. var date = new Date()
  1451. let Y = date.getFullYear()
  1452. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  1453. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  1454. this.times = `${Y}-${M}-${D}`
  1455. },
  1456. showSubTaskList(task) {
  1457. this.subTaskVisible = true;
  1458. this.addForm = task;
  1459. },
  1460. addTask(stage) {
  1461. this.addFormVisible = true;
  1462. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  1463. this.addLoading = false;
  1464. this.title="创建任务";
  1465. this.commentList = [];
  1466. },
  1467. addStage() {
  1468. this.addStageDialog = true;
  1469. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId};
  1470. },
  1471. // 获得焦点时触发
  1472. onEditorBlur(){
  1473. let theEle = this.$refs.text; // 获取元素
  1474. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  1475. var arrImg = ''
  1476. for (var j = 0; j < img.length; j++) {
  1477. // 正则匹配,摘出img标签下的src里的内容,即capture
  1478. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  1479. arrImg += capture
  1480. });
  1481. }
  1482. // 原来的字符流大小,单位为字节
  1483. var strLen = arrImg.length;
  1484. // 计算后得到的文件流大小,单位为字节
  1485. var fileSize=parseInt(strLen-(strLen/8)*2);
  1486. var size = "";
  1487. size = (fileSize/1024/1024).toFixed(2);
  1488. if (size > 2){
  1489. this.textContent = false
  1490. this.$message({
  1491. showClose: true,
  1492. message: '图片超过了2MB,请重新上传',
  1493. type: 'warning'
  1494. });
  1495. }
  1496. this.textContent = true
  1497. },
  1498. backToParentTask() {
  1499. this.getTaskDetail(this.addForm.parentTid);
  1500. },
  1501. // 点击发布
  1502. release() {
  1503. if(this.textarea2.length <= 0) return this.$message({message: "请输入内容", type: "error"})
  1504. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  1505. res => {
  1506. if(res.code == "ok"){
  1507. this.commentList.push(res.data)
  1508. this.sppk(this.commentList)
  1509. this.textarea2 = ""
  1510. this.contRoll() // 滚动到底部
  1511. } else {
  1512. this.$message({
  1513. message: res.msg,
  1514. type: "error"
  1515. });
  1516. }
  1517. },
  1518. error => {
  1519. this.$message({
  1520. message: error,
  1521. type: "error"
  1522. });
  1523. })
  1524. },
  1525. // 滚动到底部
  1526. contRoll(){
  1527. this.$nextTick(() => {
  1528. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  1529. })
  1530. },
  1531. submitInsert() {
  1532. if (this.textContent !== true) return this.$message({
  1533. showClose: true,
  1534. message: '图片太大,请重新上传',
  1535. type: 'warning'
  1536. });
  1537. //检查是有重名的执行人
  1538. var exeList = this.addForm.executorListFront;
  1539. for (var i=0;i<exeList.length;i++) {
  1540. var findSameUser = false;
  1541. for (var j=i+1;j<exeList.length; j++) {
  1542. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  1543. findSameUser = true;
  1544. break;
  1545. }
  1546. }
  1547. if (findSameUser) {
  1548. return this.$message({
  1549. showClose: true,
  1550. message: '执行人存在重复',
  1551. type: 'error'
  1552. });
  1553. }
  1554. }
  1555. this.$refs.form1.validate(valid => {
  1556. if (valid) {
  1557. delete this.addForm.subTaskList;
  1558. delete this.addForm.progress;
  1559. delete this.addForm.refTaskList;
  1560. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  1561. this.http.post('/task/save',this.addForm,
  1562. res => {
  1563. if (res.code == "ok") {
  1564. this.$message({
  1565. message: "提交成功",
  1566. type: "success"
  1567. });
  1568. if (this.addForm.parentTid == null) {
  1569. this.addFormVisible = false;
  1570. if (this.groupType == 0) {
  1571. this.getStageList();
  1572. } else {
  1573. // this.getViewTaskList();
  1574. }
  1575. } else {
  1576. this.backToParentTask();
  1577. }
  1578. this.getList()
  1579. } else {
  1580. this.$message({
  1581. message: res.msg,
  1582. type: "error"
  1583. });
  1584. }
  1585. },
  1586. error => {
  1587. this.$message({
  1588. message: error,
  1589. type: "error"
  1590. });
  1591. }
  1592. );
  1593. }
  1594. });
  1595. },
  1596. //加载项目内的任务列表
  1597. getStageList() {
  1598. // console.log('进来了')
  1599. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
  1600. res => {
  1601. if (res.code == "ok") {
  1602. this.stageList = res.data.list;
  1603. // console.log('触发获取任务列表函数')
  1604. this.timess() // 处理时间的方法
  1605. } else {
  1606. this.$message({
  1607. message: res.msg,
  1608. type: "error"
  1609. });
  1610. }
  1611. },
  1612. error => {
  1613. this.$message({
  1614. message: error,
  1615. type: "error"
  1616. });
  1617. });
  1618. },
  1619. //删除当前编辑的任务
  1620. deleteTask() {
  1621. var warning='';
  1622. if (this.addForm.subTaskList.length > 0) {
  1623. warning='您确定要删除当前任务及其子任务吗?';
  1624. } else {
  1625. warning='您确定要删除当前任务吗?';
  1626. }
  1627. this.$confirm(warning, "提示", {
  1628. //type: 'warning'
  1629. }).then(() => {
  1630. this.http.post('/task/delete',{id: this.addForm.id},
  1631. res => {
  1632. if (res.code == "ok") {
  1633. this.addFormVisible = false;
  1634. // this.getStageList();
  1635. this.getList();
  1636. } else {
  1637. this.$message({
  1638. message: res.msg,
  1639. type: "error"
  1640. });
  1641. }
  1642. },
  1643. error => {
  1644. this.$message({
  1645. message: error,
  1646. type: "error"
  1647. });
  1648. });
  1649. });
  1650. },
  1651. chan() {
  1652. // console.log(this.critic)
  1653. },
  1654. getSthForSb() {
  1655. this.http.post('/task/getGroupNameList ',{},
  1656. res => {
  1657. if (res.code == "ok") {
  1658. console.log('看看是', res.data)
  1659. this.groupNameList = res.data
  1660. } else {
  1661. this.$message({
  1662. message: res.msg,
  1663. type: "error"
  1664. });
  1665. }
  1666. },
  1667. error => {
  1668. this.$message({
  1669. message: error,
  1670. type: "error"
  1671. });
  1672. });
  1673. },
  1674. // 获取部门
  1675. getDepartmentList() {
  1676. this.http.post( this.port.manage.depList, {},
  1677. res => {
  1678. if (res.code == "ok") {
  1679. let dptlist = JSON.parse(JSON.stringify(res.data));
  1680. this.departmentList = this.changeArr(dptlist);
  1681. } else {
  1682. this.$message({
  1683. message: res.msg,
  1684. type: "error"
  1685. });
  1686. }
  1687. },error => {
  1688. this.$message({
  1689. message: error,
  1690. type: "error"
  1691. });
  1692. });
  1693. },
  1694. changeArr(arr) {
  1695. for (var i = 0; i < arr.length; i++) {
  1696. if(arr[i].id != -1 && arr[i].id != 0) {
  1697. if (arr[i].children != null && arr[i].children.length>0) {
  1698. arr[i].children = this.changeArr(arr[i].children);
  1699. }
  1700. arr[i].id && (arr[i].value = arr[i].id);
  1701. delete arr[i].id;
  1702. }
  1703. }
  1704. for(var i in arr) {
  1705. if(arr[i].id == -1 || arr[i].id == 0) {
  1706. arr.splice(i,1)
  1707. }
  1708. }
  1709. return arr;
  1710. },
  1711. },
  1712. created() {
  1713. let height = window.innerHeight;
  1714. this.tableHeight = height - 195;
  1715. const that = this;
  1716. window.onresize = function temp() {
  1717. that.tableHeight = window.innerHeight - 195;
  1718. };
  1719. },
  1720. mounted() {
  1721. this.getList();
  1722. this.getUsers();
  1723. if(this.user.timeType.projectWithDept) {
  1724. this.getDepartmentList()
  1725. }
  1726. if(this.user.companyId == '428') {
  1727. this.getSthForSb()
  1728. }
  1729. },
  1730. };
  1731. </script>
  1732. <style lang="scss" scoped>
  1733. // .classification {
  1734. // width: 120px;
  1735. // // height: 100%;
  1736. // border-right: 1px solid #f2f2f2;
  1737. // display: flex;
  1738. // flex-wrap: wrap;
  1739. // // align-items: center;
  1740. // // justify-content: center;
  1741. // padding-top: 20px;
  1742. // }
  1743. // .classification p{
  1744. // width: 120px;
  1745. // text-align: center;
  1746. // line-height: 50px;
  1747. // margin: 0;
  1748. // cursor: pointer;
  1749. // }
  1750. // .classification p:hover {
  1751. // background: #dddddd;
  1752. // }
  1753. // .on {
  1754. // // background: #dddddd;
  1755. // color: #409EFF;
  1756. // }
  1757. // .acl{
  1758. // display: inline-block;
  1759. // width: 300px;
  1760. // height: 22px;
  1761. // // line-height: 22px;
  1762. // overflow: hidden;
  1763. // white-space: nowrap;
  1764. // text-overflow: ellipsis;
  1765. // margin: 0;
  1766. // padding: 0;
  1767. // line-height: 0;
  1768. // }
  1769. // .cal {
  1770. // width: 300px;
  1771. // overflow: hidden;
  1772. // white-space: nowrap;
  1773. // text-overflow: ellipsis;
  1774. // cursor: pointer;
  1775. // }
  1776. </style>