list.vue 81 KB

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