taskComponent.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <template>
  2. <div>
  3. <div style="height: 72vh;overflow: auto;">
  4. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  5. <!--子任务需要选择任务列表 -->
  6. <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
  7. <el-select v-model="addForm.stagesId" style="width:100%;" >
  8. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  9. </el-select>
  10. </el-form-item>
  11. <el-form-item :label="$t('types')">
  12. <!-- <el-button @click="test">test</el-button> -->
  13. <!-- 0011 -->
  14. <!-- {{groupResponsibleId == user.id}} -->
  15. <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) && !(groupResponsibleId == user.id)" @change="selchg()">
  16. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  17. <i :class="item.icon" ></i>
  18. <span>{{item.name}}</span>
  19. </el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item :label="$t('taskdefinition')" prop="name">
  23. <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
  24. </el-form-item>
  25. <!-- {{timelabel}}{{mileageCup}} -->
  26. <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
  27. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  28. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()" v-if="!timelabel"></el-date-picker>
  29. <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
  30. <el-date-picker style="width:40%;" v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
  31. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  32. <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
  33. <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"
  34. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  35. </el-form-item>
  36. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  37. <el-form-item :label="$t('zhi-hang-ren') + (index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
  38. <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
  39. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  40. <span style="float: left">{{ item.name }}</span>
  41. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  42. </el-option>
  43. </el-select>
  44. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
  45. <!-- <selectCat v-if="user.userNameNeedTranslate == '1'" :wxCope="true" :size="'size'" :subjectId="executorItem.executorId" :distinction="'1'" :subject="users" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat> -->
  46. <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
  47. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
  48. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
  49. <!--移除执行人 -->
  50. <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
  51. </el-form-item>
  52. <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<10) &&
  53. (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement)) ||
  54. groupResponsibleId == user.id)"
  55. style="margin-left:35px;" @click="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
  56. </div>
  57. <el-form-item :label="$t('priority')">
  58. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  59. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <!-- 富文本 -->
  63. <el-form-item :label="$t('detaileddescription')" style="height: 200px">
  64. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  65. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  66. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  67. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  68. </el-form-item>
  69. <!-- 富文本 -->
  70. <div v-if="addForm.id != null">
  71. <el-divider ></el-divider>
  72. <!-- 任务进展 -->
  73. <template v-if="!timelabel || isRelationItem">
  74. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('taskprogress') }}</i>
  75. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
  76. </p>
  77. <!-- 任务进展展示 -->
  78. <div style="display: none;" ref="proBox" class="progress">
  79. <!-- <el-form :model="> -->
  80. <el-radio-group v-model="radio">
  81. <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
  82. <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
  83. <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
  84. </el-radio-group>
  85. <el-input
  86. type="textarea"
  87. border="0"
  88. :autosize="{ minRows: 2, maxRows: 6}"
  89. :placeholder="$t('detailedprogressdescription')"
  90. v-model="text2"
  91. style="margin:10px 0 0 0">
  92. </el-input>
  93. <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
  94. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  95. <div class="remind" ref="addRem" style="display: none">
  96. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  97. <p>
  98. <el-checkbox :label="item.name" @change="kkk(item)">
  99. <span>
  100. <span v-if="user.userNameNeedTranslate != '1'">
  101. {{item.name}}
  102. </span>
  103. <span v-if="user.userNameNeedTranslate == '1'">
  104. <ww-open-data type='userName' :openid='item.name'></ww-open-data>
  105. </span>
  106. </span>
  107. </el-checkbox>
  108. </p>
  109. </el-checkbox-group>
  110. </div>
  111. <div class="ssp" @click="sss"></div>
  112. <!-- </el-form> -->
  113. <div class="pro_btn">
  114. <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
  115. <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
  116. </div>
  117. </div>
  118. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  119. <div class="elCard" style="margin-bottom: 10px; height:" >
  120. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  121. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  122. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  123. <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
  124. <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
  125. <span v-else>{{ $t('withinthetimelimit') }}</span>
  126. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  127. <i class="el-icon-more" ></i>
  128. <el-dropdown-menu slot="dropdown">
  129. <el-dropdown-item divided>
  130. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
  131. </el-dropdown-menu>
  132. </el-dropdown>
  133. <!-- <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div> -->
  134. <div class="elCard_qu">
  135. <span>
  136. <span v-if="user.userNameNeedTranslate != '1'">
  137. {{recentProgressInfo.creatorName}}
  138. </span>
  139. <span v-if="user.userNameNeedTranslate == '1'">
  140. <ww-open-data type='userName' :openid='recentProgressInfo.creatorName'></ww-open-data>
  141. </span>
  142. </span>
  143. {{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}
  144. </div>
  145. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  146. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
  147. </div>
  148. </div>
  149. <!-- 任务列表没有数据的时候展示 -->
  150. <div class="nones" v-if="ProgressList.length <= 0">
  151. {{ $t('nodata') }}
  152. </div>
  153. <!-- 任务进展完整状态 -->
  154. <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
  155. <div class="integrity">
  156. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} :{{ProgressList.length}}</h3>
  157. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  158. <el-divider></el-divider>
  159. <!-- -->
  160. <div class="block" style="height: 200px;">
  161. <el-timeline style="padding:20px 0 0 0;">
  162. <el-timeline-item
  163. v-for="(activity, index) in ProgressList"
  164. :key="index">
  165. <div class="tb">
  166. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  167. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  168. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  169. <div>
  170. <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
  171. <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
  172. <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
  173. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  174. </div>
  175. <p style="color: #8C8C8C">{{activity.content}}</p>
  176. </div>
  177. </el-timeline-item>
  178. </el-timeline>
  179. </div>
  180. <!-- -->
  181. </div>
  182. <span slot="footer" class="dialog-footer">
  183. <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
  184. </span>
  185. </el-dialog>
  186. </template>
  187. <!-- 子任务/关联任务 -->
  188. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? $t('guanlian') : $t('zirwu')}}</i>
  189. <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">{{ $t('associatedTask') }}</el-link>
  190. <el-link style="float:right;" @click="addSubTask" v-else>{{ $t('addingsubtask') }}</el-link>
  191. </p>
  192. <!-- 关联任务列表 -->
  193. <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
  194. :header-cell-style="{'font-weight':'normal'}"
  195. highlight-current-row
  196. v-loading="listLoading"
  197. style="width: 100%;margin-top:10px;"
  198. @row-click="relationTaskClick">
  199. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  200. <template slot-scope="scope">
  201. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)" @click.stop.native=""></el-checkbox>
  202. </template>
  203. </el-table-column>
  204. <el-table-column prop="taskName" :label="$t('biao-ti')" >
  205. <template slot-scope="scope">
  206. <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top" style="cursor:pointer;color:#409eff;">
  207. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
  208. </el-tooltip>
  209. </template>
  210. </el-table-column>
  211. <el-table-column :label="$t('operation')" width="130" align="left">
  212. <template slot-scope="scope">
  213. <el-button @click.stop.native="deleteRelationItem(scope.row.id)" size="mini">{{ $t('dissociated') }}</el-button>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. <!--子任务列表 -->
  218. <el-table key="zi" :data="addForm.subTaskList" v-else
  219. :header-cell-style="{'font-weight':'normal'}"
  220. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  221. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  222. <template slot-scope="scope">
  223. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  224. @click.stop.native=""
  225. @change="finishTask(scope.row)"
  226. ></el-checkbox>
  227. </template>
  228. </el-table-column>
  229. <el-table-column prop="name" :label="$t('biao-ti')" >
  230. <template slot-scope="scope">
  231. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  232. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  233. </el-tooltip>
  234. </template>
  235. </el-table-column>
  236. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  237. <template slot-scope="scope">
  238. <span v-if="user.userNameNeedTranslate != 1">
  239. {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
  240. </span>
  241. <span v-if="user.userNameNeedTranslate == 1">
  242. <span v-if="scope.row.executorName == null">
  243. {{$t('dai-fen-pei')}}
  244. </span>
  245. <span v-else>
  246. <span v-for="item,index in scope.row.executorName" :key="index">
  247. <ww-open-data type='userName' :openid='item'></ww-open-data>
  248. <span v-if="index < scope.row.executorName.length - 1">,</span>
  249. </span>
  250. </span>
  251. </span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
  255. <template slot-scope="scope">
  256. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  257. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  258. </template>
  259. </el-table-column>
  260. </el-table>
  261. </div>
  262. </el-form>
  263. <!-- 关联文件列表 -->
  264. <template v-if="isEditFile">
  265. <div style="width:100%;margin:1em 0;">
  266. <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
  267. <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
  268. <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
  269. <el-link>{{ $t('uoloadFiles') }}</el-link>
  270. </el-upload>
  271. </div>
  272. <el-table
  273. v-loading="fileListLoading"
  274. ref="filetable"
  275. :data="taskFileList"
  276. :header-cell-style="{'font-weight':'normal'}"
  277. highlight-current-row
  278. max-height="240"
  279. style="width: 100%;margin-top:10px;margin-bottom:15px">
  280. <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="40" align="center">
  281. <template slot-scope="scope">
  282. <div>
  283. {{scope.$index + 1}}
  284. </div>
  285. </template>
  286. </el-table-column>
  287. <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
  288. <el-table-column :label="$t('filesize')" prop="size" min-width="60" align="center"></el-table-column>
  289. <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
  290. <template slot-scope="scope">
  291. <div>
  292. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
  293. <span v-if="user.userNameNeedTranslate == 1">
  294. <ww-open-data type='userName' :openid='scope.row.creatorName'></ww-open-data>
  295. </span>
  296. </div>
  297. </template>
  298. </el-table-column>
  299. <el-table-column :label="$t('creationtime')" prop="indate" min-width="120" align="center">
  300. <template slot-scope="scope">
  301. <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
  302. </template>
  303. </el-table-column>
  304. <el-table-column :label="$t('operation')" min-width="90">
  305. <template slot-scope="scope">
  306. <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
  307. <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
  308. </template>
  309. </el-table-column>
  310. </el-table>
  311. </template>
  312. <!-- 关联文件dialog -->
  313. <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
  314. <span>{{ $t('wenjian1guanli') }}</span>
  315. <div>
  316. <span>{{ $t('xuanzwenjian') }}</span>
  317. <el-select v-model="addFileId" filterable >
  318. <el-option
  319. v-for="item in projectFileList"
  320. :key="item.id"
  321. :label="item.documentName"
  322. :value="item.id"
  323. ></el-option>
  324. </el-select>
  325. <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
  326. <!-- <el-button @click="relationFileDialog = false">取消</el-button> -->
  327. </div>
  328. </el-dialog>
  329. <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
  330. <el-form ref="relationItemForm" label-width="100px">
  331. <el-form-item :label="$t('selecttask')" prop="taskType">
  332. <el-select v-model="relationvalue" multiple style="width:80%">
  333. <el-option
  334. v-for="item in relationdata"
  335. :key="item.id"
  336. :label="item.name"
  337. :value="item.id"
  338. ></el-option>
  339. </el-select>
  340. </el-form-item>
  341. </el-form>
  342. <div slot="footer" class="dialog-footer">
  343. <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
  344. <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
  345. </div>
  346. </el-dialog>
  347. </div>
  348. <div slot="footer" class="dialog-footer">
  349. <el-button v-if="(user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement) && canAddTask" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
  350. <el-button @click.native="closeBounced()">{{ $t('btn.cancel') }}</el-button>
  351. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  352. </div>
  353. <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
  354. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  355. <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
  356. </div>
  357. <!-- 评论 -->
  358. <div class="remark" v-show="addForm.id != null">
  359. <span class="zh">
  360. <div class="player">
  361. <p>{{ $t('participantin') }}</p>
  362. <div class="bj">
  363. <span v-for="(pl, i) in critic" :key="i">
  364. <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  365. <span v-if="user.userNameNeedTranslate == 1">
  366. <ww-open-data type='userName' :openid='pl'></ww-open-data>
  367. </span>
  368. </span>
  369. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  370. </div>
  371. </div>
  372. <div class="subject">
  373. <div class="sub-all">
  374. <div :class="dynamicTab ? 'subOn' : ''" @click="dynamicTab = true">{{ $t('alldynamic') }}</div>
  375. <div :class="dynamicTab ? '' : 'subOn'" @click="dynamicTab = false">{{ $t('xiang-guan-ri-bao') }}</div>
  376. </div>
  377. <div class="sub-details" ref="main" v-if="dynamicTab">
  378. <ul class="infinite-list" v-infinite-scroll="load" ref="contRoll">
  379. <div style="width: 100%" v-if="commentList.length <= 0">
  380. <img src="../assets/image/xiao.png" alt="">
  381. </div>
  382. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  383. <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
  384. </li>
  385. <li class="carts" v-for="item in commentList" :key="item.id">
  386. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  387. <!-- <i :style="'background' + item.userColor"> -->
  388. <i :style="'background' + item.userColor">
  389. <i v-if="user.userNameNeedTranslate != 1">
  390. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  391. </i>
  392. <i v-if="user.userNameNeedTranslate == 1">
  393. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  394. </i>
  395. </i>
  396. <div>
  397. <!-- <p>{{item.userName}}</p> -->
  398. <!-- <p> -->
  399. <p v-if="user.userNameNeedTranslate != 1">
  400. {{item.userName}}
  401. </p>
  402. <p v-if="user.userNameNeedTranslate == 1">
  403. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  404. </p>
  405. <!-- </p> -->
  406. <em>
  407. <!-- {{item.content}} -->
  408. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
  409. {{item.content.msg1}}
  410. <ww-open-data type='userName' :openid='item.content.msg2'></ww-open-data>
  411. {{item.content.msg3}}
  412. </p>
  413. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
  414. </em>
  415. </div>
  416. <span>{{item.createTime | relativeTime}}</span>
  417. </li>
  418. </ul>
  419. </div>
  420. <div class="Daily" v-if="!dynamicTab">
  421. <div class="one_daily_body DailyBody">
  422. <el-card shadow="never" v-for="(item2,index2) in dailyList" :key="index2" style="margin-bottom: 20px;">
  423. <p>
  424. {{ $t('tian-bao-ren') }}: <span v-if="user.userNameNeedTranslate != 1">{{item2.userName}}</span>
  425. <span v-if="user.userNameNeedTranslate == 1">
  426. <ww-open-data type='userName' :openid='item2.userName'></ww-open-data>
  427. </span>
  428. <span style="float: right;">{{item2.createDate}}</span>
  429. </p>
  430. <p>{{ $t('other.approvalStatus') }}:
  431. <span v-if="user.company.packageEngineering == 0">
  432. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">
  433. <span v-if="item2.isDeptAudit==0">
  434. <span v-if="item2.projectAuditState==0">
  435. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  436. <span v-if="item2.projectAuditorName != null">(
  437. <span v-if="user.userNameNeedTranslate == '1'">
  438. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  439. </span>
  440. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  441. )</span>
  442. <!-- 审核 --> {{$t('other.audit')}}
  443. </span>
  444. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  445. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  446. <span v-if="item2.projectAuditorName != null">(
  447. <!-- {{item2.projectAuditorName}} -->
  448. <span v-if="user.userNameNeedTranslate == '1'">
  449. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  450. </span>
  451. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  452. )</span>
  453. <!-- 审核通过 --> {{$t('state.approved')}}
  454. </span>
  455. </span>
  456. <span v-else-if="item2.isDeptAudit==1">
  457. ({{$t('other.await')}}
  458. <span v-if="user.userNameNeedTranslate == '1'">
  459. <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
  460. </span>
  461. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  462. {{$t('other.audit')}})
  463. </span>
  464. </span>
  465. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  466. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}
  467. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  468. </span>
  469. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  470. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  471. </span>
  472. <span v-if="user.company.packageEngineering == 1">
  473. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  474. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">{{$t('other.waitingForProfessionalReview')}}</span>
  475. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">{{$t('other.waitingForDepartmentReview')}}</span>
  476. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">{{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  477. (
  478. <span v-if="user.userNameNeedTranslate != 1">
  479. {{item2.projectAuditorName}}
  480. </span>
  481. <span v-if="user.userNameNeedTranslate == 1">
  482. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  483. </span>
  484. )
  485. </span>{{$t('other.audit')}}</span>
  486. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}</span>
  487. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  488. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  489. </span>
  490. </p>
  491. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  492. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  493. <!-- 自定义日报文本 -->
  494. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  495. <p v-if="user.company.packageEngineering == 1">
  496. {{$t('other.professionalProgress')}}:
  497. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  498. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  499. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  500. </el-tooltip>
  501. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  502. <i class="iconfont firerock-iconshenhetongguo"></i>
  503. </el-tooltip>
  504. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  505. <i class="iconfont firerock-iconshenhebohui"></i>
  506. </el-tooltip>
  507. </span>
  508. </p>
  509. <div v-if="item2.multiWorktime==0">
  510. <p style="display: inline-block;">{{$t('time.duration')}}:
  511. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  512. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  513. {{item2.time.toFixed(1)}}h
  514. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  515. </p>
  516. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  517. </div>
  518. <div v-if="item2.multiWorktime==1" >
  519. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  520. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  521. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  522. <p style="display: inline-block;">{{$t('time.duration')}}:
  523. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  524. {{timeItem.time.toFixed(1)}}h
  525. </p>
  526. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  527. </div>
  528. </div>
  529. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  530. <!--照片的显示 -->
  531. <p v-if="item2.pics != null && item2.pics.length > 0">
  532. <el-image v-for="(pic, index) in item2.pics" :key="index"
  533. style="width: 100px; height: 100px; margin-right:10px;"
  534. :src="pic"
  535. :preview-src-list="item2.pics">
  536. </el-image>
  537. </p>
  538. </el-card>
  539. </div>
  540. </div>
  541. </div>
  542. <div class="issue" v-if="dynamicTab">
  543. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  544. <div class="issue_fixation">
  545. <div class="inputDeep"><el-input
  546. type="textarea"
  547. :placeholder="$t('pleaseentercontent')"
  548. :autosize="{ minRows: 6, maxRows: 6}"
  549. v-model="textarea2"
  550. class="inputDeeps"
  551. >
  552. </el-input></div>
  553. <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
  554. </div>
  555. </div>
  556. </span>
  557. </div>
  558. </div>
  559. </template>
  560. <script>
  561. // 富文本样式
  562. import 'quill/dist/quill.core.css'
  563. import 'quill/dist/quill.snow.css'
  564. import 'quill/dist/quill.bubble.css'
  565. // 导入富文本
  566. import { quillEditor } from 'vue-quill-editor'
  567. export default {
  568. props: {
  569. integrationTask:{
  570. type: Object,
  571. default: {}
  572. },
  573. },
  574. components: {
  575. quillEditor, // 富文本
  576. },
  577. data() {
  578. return {
  579. user: JSON.parse(sessionStorage.getItem("user")),
  580. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  581. date: new Date(),
  582. editorOption: { // 富文本框里面的默认值
  583. placeholder: this.$t('pleaseentethetext'),
  584. modules: {
  585. toolbar:[
  586. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  587. // ['blockquote', 'code-block'], //引用,代码块
  588. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  589. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  590. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  591. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  592. // [{ 'direction': 'rtl' }], // 文本方向
  593. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  594. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  595. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  596. // [{ 'font': [] }], //字体
  597. [{ 'align': [] }], //对齐方式
  598. ['clean'], //清除字体样式
  599. // ['image','video'] //上传图片、上传视频
  600. ['image'] //上传图片、上传视频
  601. ], //工具栏设置
  602. },
  603. theme: 'snow',
  604. },
  605. 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"}],
  606. addForm: {},
  607. currentProject: {},
  608. checkLists: {}
  609. };
  610. },
  611. computed: {},
  612. watch: {},
  613. created() {},
  614. mounted() {
  615. console.log('我获取到的数据', this.integrationTask)
  616. this.addForm = this.integrationTask.addForm
  617. this.currentProject = this.integrationTask.currentProject
  618. this.checkLists = this.integrationTask.checkLists
  619. },
  620. methods: {
  621. // 关闭最外层弹窗
  622. closeBounced() {
  623. this.$emit('closeBounced')
  624. }
  625. },
  626. };
  627. </script>
  628. <style scoped>
  629. </style>