list.vue 78 KB

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