taskDetail.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. <template>
  2. <div class="detail">
  3. <mt-header class="detail_head" fixed title="任务详情">
  4. <router-link to="" slot="left">
  5. <mt-button icon="back" v-on:click.native='jumpBack()'></mt-button>
  6. </router-link>
  7. <mt-button slot="right" icon="more" v-if="detail.state != 5 && detail.state != 7 && detail.publishId == user.id" v-on:click.native="showList()"></mt-button>
  8. </mt-header>
  9. <div class="btn_list" v-show="popupVisible">
  10. <div v-on:click="show(1)">延期</div>
  11. <div v-on:click="edit()">修改</div>
  12. <div v-on:click="del()">删除</div>
  13. </div>
  14. <div class="detail_body" id="allocation">
  15. <div class="detailBox taskInfo">
  16. <div>
  17. <span class="type">({{detail.tagName}})</span>
  18. <span class="name">{{detail.name}}</span>
  19. <span v-if="detail.state==0" class="type state">待派发</span>
  20. <span v-if="detail.state==1" class="type state">已派发</span>
  21. <span v-if="detail.state==2" class="type state">已接收</span>
  22. <span v-if="detail.state==3" class="type state">待审核</span>
  23. <span v-if="detail.state==4" class="type state">未通过</span>
  24. <span v-if="detail.state==5" class="type state">已完成</span>
  25. <span v-if="detail.state==6" class="type state">已延期</span>
  26. <span v-if="detail.state==7" class="type state">已失效</span>
  27. </div>
  28. <div class="department">
  29. <div class="one_dep">任务编码:{{detail.code}}</div>
  30. <div class="one_dep">计划时间:{{detail.planTime}}</div>
  31. <div class="one_dep">工作量:{{detail.workLoad}}天</div>
  32. <div class="one_dep">费用:{{detail.fee==null?0:detail.fee}}元</div>
  33. <div class="one_dep">付款方:{{detail.payer}}</div>
  34. <div class="one_dep">收款方:{{detail.payee}}</div>
  35. <div v-if="detail.delayTime != null" class="one_dep">延期日期:{{detail.delayTime}}</div>
  36. <div style="line-height:0.25rem">接收人:{{detail.recipientName}}</div>
  37. <div style="line-height:0.25rem">
  38. 参与人:<span v-for="(item,index) in detail.participantsVOS">{{item.userName}} <span v-if="index != detail.participantsVOS.length-1">、</span></span>
  39. </div>
  40. </div>
  41. <div class="content">
  42. {{detail.content}}
  43. </div>
  44. <div style="margin:0">
  45. <div class="userInfo">
  46. <img src="../../assets/image/userHead.jpg">
  47. <span>{{detail.publisherName}}&nbsp;&nbsp;&nbsp; {{detail.planTime}}</span>
  48. </div>
  49. <div class="allBtn">
  50. <mt-button type="primary" size="small" v-if="detail.state==1 && detail.recipientId==user.id" v-on:click.native="receive()">接收</mt-button>
  51. <mt-button type="primary" size="small" v-if="detail.state==2 || detail.state==4 && detail.recipientId==user.id" v-on:click.native="show(3)">提交</mt-button>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="detailBox" id="fixTop">
  56. <mt-navbar v-model="selected" class="task_tab_head" v-on:click.native="changeTab">
  57. <mt-tab-item id="tab1">任务动态</mt-tab-item>
  58. <mt-tab-item id="tab2">审核结果</mt-tab-item>
  59. <mt-tab-item id="tab3">任务资料</mt-tab-item>
  60. </mt-navbar>
  61. <mt-tab-container v-model="selected">
  62. <!-- 任务动态 -->
  63. <mt-tab-container-item id="tab1">
  64. <div class="noList" v-if="dynaList.length==0">
  65. <img src="../../assets/image/noList.png">
  66. </div>
  67. <ul v-else class="recordBox" v-infinite-scroll="loadMoreDyna" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
  68. <li v-for="item in dynaList" class="one_recordBox">
  69. <div>
  70. <span class="type">{{item.stateContent}}</span>
  71. <span class="time">{{item.indate}}</span>
  72. </div>
  73. <div class="content">{{item.content}}</div>
  74. </li>
  75. <div class="order" v-if="haveMoreDyna">
  76. <span class="line"></span>
  77. <span class="txt">没有更多了</span>
  78. <span class="line"></span>
  79. </div>
  80. </ul>
  81. </mt-tab-container-item>
  82. <!-- 审核结果 -->
  83. <mt-tab-container-item id="tab2">
  84. <div class="noList" v-if="examList.length==0">
  85. <img src="../../assets/image/noList.png">
  86. </div>
  87. <ul v-else class="recordBox" v-infinite-scroll="loadMoreExam" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
  88. <li v-for="item in examList" class="one_recordBox">
  89. <div>
  90. <span class="userName">{{item.publisher}}</span>
  91. <span class="time">{{item.publishDate}}</span>
  92. <span v-if="item.isPass == 0 && user.id == detail.publishId" class="isPass" v-on:click="show(2,item.id)">审核</span>
  93. <span v-if="item.isPass == 0 && user.id != detail.publishId" class="isPass isPassN">待审核</span>
  94. <span v-if="item.isPass == 1" class="isPass isPassN">未通过</span>
  95. <span v-if="item.isPass == 2" class="isPass isPassY">已完成</span>
  96. </div>
  97. <div class="content">{{item.publishContent}}</div>
  98. <div v-if="item.responderId != null" class="respond">
  99. <div>
  100. <span class="userName">{{item.responder}}</span>
  101. <span class="time">{{item.respondDate}}</span>
  102. </div>
  103. <div v-if="item.isPass == 2">
  104. <el-rate v-model="item.score" disabled show-score disabled-void-color="#cfcfcf" text-color="#ff9900" score-template="{value}"></el-rate>
  105. </div>
  106. <div class="content">
  107. {{item.respondContent}}
  108. </div>
  109. </div>
  110. </li>
  111. <div class="order" v-if="loadMoreExam">
  112. <span class="line"></span>
  113. <span class="txt">没有更多了</span>
  114. <span class="line"></span>
  115. </div>
  116. </ul>
  117. </mt-tab-container-item>
  118. <!-- 任务资料 -->
  119. <mt-tab-container-item id="tab3">
  120. <div v-if="detail.state == 5" class="upload" v-on:click="choosePic()">上传资料</div>
  121. <input @change="fileChange($event)" type="file" id="upload_file" style="display: none"/>
  122. <div class="noList" v-if="fileList.length==0">
  123. <img src="../../assets/image/noList.png">
  124. </div>
  125. <ul v-else class="recordBox" v-infinite-scroll="loadMoreFile" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
  126. <li v-for="item in fileList" class="one_recordBox one_file">
  127. <div class="fileName"><a :href="item.url" :download="item.name">{{item.name}}</a></div>
  128. <div>
  129. {{item.indate}}
  130. <span v-if="item.uploaderId == user.id" v-on:click="delFile(item.id)"><img src="../../assets/image/del_red.png"></span>
  131. </div>
  132. </li>
  133. <div class="order" v-if="haveMoreFile">
  134. <span class="line"></span>
  135. <span class="txt">没有更多了</span>
  136. <span class="line"></span>
  137. </div>
  138. </ul>
  139. </mt-tab-container-item>
  140. </mt-tab-container>
  141. </div>
  142. </div>
  143. <mt-popup v-model="delayTimePop" position="middle" popup-transition="popup-fade">
  144. <div class="mint-popup-div">
  145. <h4>延期任务</h4>
  146. <mt-field label="" class="input" placeholder="请选择延期时间" type="date" v-model="delayTime"></mt-field>
  147. <div class="btns">
  148. <mt-button class="btn" size="small" v-on:click.native="submit(1)">确定</mt-button>
  149. <mt-button class="btn" size="small" v-on:click.native="closePop(1)">取消</mt-button>
  150. </div>
  151. </div>
  152. </mt-popup>
  153. <mt-popup v-model="scorePop" position="middle" popup-transition="popup-fade">
  154. <div class="mint-popup-div accep">
  155. <h4>审核</h4>
  156. <mt-radio class="scoreIsPass" title="" v-model="scoreIsPass" :options="['通过', '不通过']"></mt-radio>
  157. <div v-if="scoreIsPass=='通过'" style="height:0.25rem;text-align:left;margin:0.12rem 0 0 0;padding: 0.1rem">
  158. <el-rate v-model="score" allow-half show-score disabled-void-color="#cfcfcf" text-color="#ff9900" score-template="{value}"></el-rate>
  159. </div>
  160. <mt-field label="" style="margin-top:0;" class="input" placeholder="请输入回复内容" type="textarea" rows="4" v-model="scoreContent"></mt-field>
  161. <div class="btns">
  162. <mt-button class="btn" size="small" v-on:click.native="submit(2)">确定</mt-button>
  163. <mt-button class="btn" size="small" v-on:click.native="closePop(2)">取消</mt-button>
  164. </div>
  165. </div>
  166. </mt-popup>
  167. <mt-popup v-model="submitPop" position="middle" popup-transition="popup-fade">
  168. <div class="mint-popup-div">
  169. <h4>提交</h4>
  170. <mt-field label="" class="input" placeholder="请输入发布内容" type="textarea" rows="4" v-model="submitContent"></mt-field>
  171. <div class="btns">
  172. <mt-button class="btn" size="small" v-on:click.native="submit(3)">确定</mt-button>
  173. <mt-button class="btn" size="small" v-on:click.native="closePop(3)">取消</mt-button>
  174. </div>
  175. </div>
  176. </mt-popup>
  177. </div>
  178. </template>
  179. <script>
  180. import { MessageBox } from 'mint-ui';
  181. export default {
  182. data() {
  183. return {
  184. id: this.$route.params.id,
  185. user: JSON.parse(sessionStorage.getItem("user")),
  186. power: sessionStorage.getItem("power"),
  187. detail: "",
  188. selected: "tab1",
  189. popupVisible: false,
  190. dynaList: [],
  191. dynaPageNum: 1,
  192. dynaPages: 1,
  193. haveMoreDyna: false,
  194. examList: [],
  195. examPageNum: 1,
  196. examPages: 1,
  197. haveMoreExam: false,
  198. fileList: [],
  199. filePageNum: 1,
  200. filePages: 1,
  201. haveMoreFile: false,
  202. delayTime: '',
  203. delayTimePop: false,
  204. scoreId: 0,
  205. score: 0,
  206. scoreIsPass: '通过',
  207. scoreContent: '',
  208. scorePop: false,
  209. submitContent: '',
  210. submitPop: false,
  211. }
  212. },
  213. methods: {
  214. getDetail() {
  215. this.$indicator.open();
  216. this.http.post(this.port.task.detail, {
  217. 'id': this.id
  218. } ,
  219. res => {
  220. this.$indicator.close();
  221. if (res.code == "ok") {
  222. this.detail = res.data;
  223. } else {
  224. this.$toast({
  225. message: res.msg,
  226. duration: 2000
  227. });
  228. }
  229. }, error => {
  230. this.$indicator.close();
  231. this.$toast({
  232. message: error,
  233. duration: 2000
  234. });
  235. })
  236. },
  237. // 右上角按钮
  238. showList() {
  239. this.popupVisible = !this.popupVisible;
  240. },
  241. show(type,id) {
  242. if(type == 1) {
  243. this.delayTime = "";
  244. this.delayTimePop = true;
  245. this.popupVisible = false;
  246. } else if(type == 2) {
  247. this.scoreId = id;
  248. this.score = 0;
  249. this.scoreIsPass = '通过',
  250. this.scoreContent = '';
  251. this.scorePop = true;
  252. } else if(type == 3) {
  253. this.submitContent = '';
  254. this.submitPop = true;
  255. }
  256. },
  257. closePop(type) {
  258. if(type == 1) {
  259. this.delayTimePop = false;
  260. } else if(type == 2) {
  261. this.scorePop = false;
  262. } else if(type == 3) {
  263. this.submitPop = false;
  264. }
  265. },
  266. submit(type) {
  267. if(type == 1) {
  268. if(this.delayTime == '') {
  269. this.$toast({
  270. message: "请选择延期日期",
  271. duration: 2000
  272. });
  273. return false;
  274. } else {
  275. this.$indicator.open();
  276. this.http.post(this.port.task.add, {
  277. 'id': this.id,
  278. 'delayTime': this.delayTime,
  279. 'publishId': this.user.id
  280. } ,
  281. res => {
  282. this.delayTimePop = false;
  283. this.$indicator.close();
  284. if (res.code == "ok") {
  285. this.$toast({
  286. message: "延期成功",
  287. duration: 2000
  288. });
  289. this.getDetail();
  290. this.getDynaList();
  291. } else {
  292. this.$toast({
  293. message: res.msg,
  294. duration: 2000
  295. });
  296. }
  297. }, error => {
  298. this.$indicator.close();
  299. this.$toast({
  300. message: error,
  301. duration: 2000
  302. });
  303. })
  304. }
  305. } else if(type == 2) {
  306. if(this.scoreContent == '') {
  307. this.$toast({
  308. message: "请输入发布内容",
  309. duration: 2000
  310. });
  311. return false;
  312. } else {
  313. this.$indicator.open();
  314. var form = {
  315. 'id': this.scoreId,
  316. 'isPass': this.scoreIsPass=='通过'?2:1,
  317. 'respondContent': this.scoreContent,
  318. 'responderId': this.user.id
  319. };
  320. if(this.scoreIsPass == '通过'){
  321. form.score = this.score
  322. }
  323. this.http.post(this.port.task.addExam, form ,
  324. res => {
  325. this.scorePop = false;
  326. this.$indicator.close();
  327. if (res.code == "ok") {
  328. this.$toast({
  329. message: "审核成功",
  330. duration: 2000
  331. });
  332. this.getDetail();
  333. this.getExamList();
  334. this.getDynaList();
  335. } else {
  336. this.$toast({
  337. message: res.msg,
  338. duration: 2000
  339. });
  340. }
  341. }, error => {
  342. this.$indicator.close();
  343. this.$toast({
  344. message: error,
  345. duration: 2000
  346. });
  347. })
  348. }
  349. } else if(type == 3) {
  350. if(this.submitContent == '') {
  351. this.$toast({
  352. message: "请输入发布内容",
  353. duration: 2000
  354. });
  355. return false;
  356. } else {
  357. this.$indicator.open();
  358. this.http.post(this.port.task.addExam, {
  359. 'taskId': this.id,
  360. 'publishContent': this.submitContent,
  361. 'publisherId': this.user.id
  362. } ,
  363. res => {
  364. this.submitPop = false;
  365. this.$indicator.close();
  366. if (res.code == "ok") {
  367. this.$toast({
  368. message: "提交成功",
  369. duration: 2000
  370. });
  371. this.getDetail();
  372. this.getExamList();
  373. this.getDynaList();
  374. } else {
  375. this.$toast({
  376. message: res.msg,
  377. duration: 2000
  378. });
  379. }
  380. }, error => {
  381. this.$indicator.close();
  382. this.$toast({
  383. message: error,
  384. duration: 2000
  385. });
  386. })
  387. }
  388. }
  389. },
  390. // 修改
  391. edit() {
  392. this.$router.push("/taskEdit/" + this.id );
  393. },
  394. // 删除任务
  395. del() {
  396. MessageBox.confirm('', { 
  397. message: '是否删除该任务?', 
  398. title: '', 
  399. confirmButtonText: '确定', 
  400. cancelButtonText: '取消' 
  401.  }).then(action => { 
  402. if (action == 'confirm') {     //确认的回调
  403. this.http.post(this.port.task.del, {
  404. 'id': this.id
  405. } ,
  406. res => {
  407. if (res.code == "ok") {
  408. this.$toast({
  409. message: "删除成功",
  410. duration: 2000
  411. });
  412. this.$router.go(-1);
  413. } else {
  414. this.$toast({
  415. message: res.msg,
  416. duration: 2000
  417. });
  418. }
  419. }, error => {
  420. this.$toast({
  421. message: error,
  422. duration: 2000
  423. });
  424. })
  425. }
  426.  }).catch(err => { 
  427.  });
  428. },
  429. // 跳转
  430. jumpBack() {
  431. this.$router.go(-1);
  432. },
  433. // 接收任务
  434. receive() {
  435. this.http.post(this.port.task.accept, {
  436. 'id': this.id,
  437. 'recipientId': this.user.id
  438. } ,
  439. res => {
  440. if (res.code == "ok") {
  441. this.$toast({
  442. message: "接收成功",
  443. duration: 2000
  444. });
  445. this.getDetail();
  446. this.getDynaList();
  447. } else {
  448. this.$toast({
  449. message: res.msg,
  450. duration: 2000
  451. });
  452. }
  453. }, error => {
  454. this.$toast({
  455. message: error,
  456. duration: 2000
  457. });
  458. })
  459. },
  460. // 状态切换
  461. changeTab() {
  462. if(this.selected == "tab1") {
  463. this.getDynaList();
  464. } else if(this.selected == "tab2") {
  465. this.getExamList();
  466. } else if(this.selected == "tab3") {
  467. this.getFileList();
  468. }
  469. },
  470. // 任务动态
  471. getDynaList() {
  472. this.$indicator.open();
  473. this.http.post(this.port.task.dynaList, {
  474. 'id': this.id,
  475. 'pageNum': 1,
  476. } ,
  477. res => {
  478. this.$indicator.close();
  479. if (res.code == "ok") {
  480. this.dynaList = res.data.list;
  481. this.dynaPages = res.data.pages==0?1:res.data.pages;
  482. } else {
  483. this.$toast({
  484. message: res.msg,
  485. duration: 2000
  486. });
  487. }
  488. }, error => {
  489. this.$indicator.close();
  490. this.$toast({
  491. message: error,
  492. duration: 2000
  493. });
  494. })
  495. },
  496. loadMoreDyna() {
  497. if(this.dynaPageNum == this.dynaPages) {
  498. this.haveMoreDyna = true;
  499. } else if(this.dynaPageNum < this.dynaPages) {
  500. this.$indicator.open();
  501. this.http.post(this.port.task.dynaList, {
  502. 'id': this.id,
  503. 'pageNum': ++this.dynaPageNum,
  504. } ,
  505. res => {
  506. this.$indicator.close();
  507. if (res.code == "ok") {
  508. this.dynaPages = res.data.pages==0?1:res.data.pages;
  509. if(res.data.list.length != 0) {
  510. for(var i in res.data.list) {
  511. this.dynaList.push(res.data.list[i]);
  512. }
  513. }
  514. } else {
  515. this.$toast({
  516. message: res.msg,
  517. duration: 2000
  518. });
  519. }
  520. }, error => {
  521. this.$indicator.close();
  522. this.$toast({
  523. message: error,
  524. duration: 2000
  525. });
  526. })
  527. }
  528. },
  529. // 审核结果
  530. getExamList() {
  531. this.$indicator.open();
  532. this.http.post(this.port.task.examList, {
  533. 'taskId': this.detail.id,
  534. 'pageNum': 1,
  535. } ,
  536. res => {
  537. this.$indicator.close();
  538. if (res.code == "ok") {
  539. this.examList = res.data.list;
  540. this.examPages = res.data.pages==0?1:res.data.pages;
  541. } else {
  542. this.$toast({
  543. message: res.msg,
  544. duration: 2000
  545. });
  546. }
  547. }, error => {
  548. this.$indicator.close();
  549. this.$toast({
  550. message: error,
  551. duration: 2000
  552. });
  553. })
  554. },
  555. loadMoreExam() {
  556. if(this.examPageNum == this.examPages) {
  557. this.haveMoreExam = true;
  558. } else if(this.examPageNum < this.examPages) {
  559. this.$indicator.open();
  560. this.http.post(this.port.task.examList, {
  561. 'keyName': this.keyWord,
  562. 'pageNum': ++this.examPageNum,
  563. } ,
  564. res => {
  565. this.$indicator.close();
  566. if (res.code == "ok") {
  567. this.examPages = res.data.pages==0?1:res.data.pages;
  568. if(res.data.list.length != 0) {
  569. for(var i in res.data.list) {
  570. this.examList.push(res.data.list[i]);
  571. }
  572. }
  573. } else {
  574. this.$toast({
  575. message: res.msg,
  576. duration: 2000
  577. });
  578. }
  579. }, error => {
  580. this.$indicator.close();
  581. this.$toast({
  582. message: error,
  583. duration: 2000
  584. });
  585. })
  586. }
  587. },
  588. // 文件上传
  589. choosePic() {
  590. document.getElementById('upload_file').click();
  591. },
  592. fileChange(el) {
  593. if (!el.target.files[0].size) return;
  594. this.fileAdd(el.target.files[0]);
  595. el.target.value = ''
  596. },
  597. fileAdd(file) {
  598. var form = new FormData();
  599. form.append("file", file);
  600. form.append("taskId",this.id);
  601. form.append("uploaderId",this.user.id);
  602. this.$indicator.open();
  603. this.http.uploadFile( this.port.task.upload, form,
  604. res => {
  605. this.$indicator.close();
  606. if (res.code == "ok") {
  607. this.$toast({
  608. message: '上传成功',
  609. duration: 2000
  610. });
  611. this.filePageNum = 1;
  612. this.getFileList();
  613. document.getElementById('upload_file').value = "";
  614. } else {
  615. this.$toast({
  616. message: res.msg,
  617. duration: 2000
  618. });
  619. }
  620. },
  621. error => {
  622. this.$indicator.close();
  623. this.$toast({
  624. message: error,
  625. duration: 2000
  626. });
  627. });
  628. },
  629. // 文件列表
  630. getFileList() {
  631. this.$indicator.open();
  632. this.http.post(this.port.task.fileList, {
  633. 'taskId': this.detail.id,
  634. 'pageNum': 1,
  635. } ,
  636. res => {
  637. this.$indicator.close();
  638. if (res.code == "ok") {
  639. this.fileList = res.data.list;
  640. this.filePages = res.data.pages==0?1:res.data.pages;
  641. } else {
  642. this.$toast({
  643. message: res.msg,
  644. duration: 2000
  645. });
  646. }
  647. }, error => {
  648. this.$indicator.close();
  649. this.$toast({
  650. message: error,
  651. duration: 2000
  652. });
  653. })
  654. },
  655. loadMoreFile() {
  656. if(this.filePageNum == this.filePages) {
  657. this.haveMoreFile = true;
  658. } else if(this.filePageNum < this.filePages) {
  659. this.$indicator.open();
  660. this.http.post(this.port.task.fileList, {
  661. 'keyName': this.keyWord,
  662. 'pageNum': ++this.filePageNum,
  663. } ,
  664. res => {
  665. this.$indicator.close();
  666. if (res.code == "ok") {
  667. this.filePages = res.data.pages==0?1:res.data.pages;
  668. if(res.data.list.length != 0) {
  669. for(var i in res.data.list) {
  670. this.fileList.push(res.data.list[i]);
  671. }
  672. }
  673. } else {
  674. this.$toast({
  675. message: res.msg,
  676. duration: 2000
  677. });
  678. }
  679. }, error => {
  680. this.$indicator.close();
  681. this.$toast({
  682. message: error,
  683. duration: 2000
  684. });
  685. })
  686. }
  687. },
  688. // 文件删除
  689. delFile(id) {
  690. MessageBox.confirm('', { 
  691. message: '是否删除该文件?', 
  692. title: '', 
  693. confirmButtonText: '确定', 
  694. cancelButtonText: '取消' 
  695.  }).then(action => { 
  696. if (action == 'confirm') {     //确认的回调
  697. this.http.post(this.port.task.delFile, {
  698. 'id': id,
  699. 'uploaderId': this.user.id,
  700. } ,
  701. res => {
  702. if (res.code == "ok") {
  703. this.$toast({
  704. message: "删除成功",
  705. duration: 2000
  706. });
  707. this.filePageNum = 1;
  708. this.getFileList();
  709. } else {
  710. this.$toast({
  711. message: res.msg,
  712. duration: 2000
  713. });
  714. }
  715. }, error => {
  716. this.$toast({
  717. message: error,
  718. duration: 2000
  719. });
  720. })
  721. }
  722.  }).catch(err => { 
  723.  });
  724. },
  725. // 滚动固定
  726. handleScroll () {
  727. var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
  728. var offsetTop = document.querySelector('#fixTop').offsetTop;
  729. if (scrollTop > offsetTop) {
  730. $("#fixTop .task_tab_head").addClass('fixTop')
  731. } else {
  732. $("#fixTop .task_tab_head").removeClass('fixTop')
  733. }
  734. },
  735. globalClick(callback) {
  736. var _this = this;
  737. document.getElementById('allocation').onclick = function () {
  738. if( _this.popupVisible == true) {
  739. _this.popupVisible = false;
  740. }
  741. }
  742. }
  743. },
  744. created() {
  745. this.getDetail();
  746. this.getDynaList();
  747. },
  748. mounted() {
  749. window.addEventListener('scroll', this.handleScroll);
  750. this.globalClick();
  751. }
  752. }
  753. </script>
  754. <style scoped>
  755. .detail {
  756. background: #EFEFEF;
  757. }
  758. .detail_head {
  759. background: #fff;
  760. color: #333;
  761. height: 0.4rem;
  762. }
  763. .detail_body {
  764. margin-top: 0.4rem;
  765. }
  766. .detailBox {
  767. background: #fff;
  768. margin-bottom: 0.11rem;
  769. }
  770. /* 任务详情 START */
  771. .taskInfo {
  772. padding: 0.08rem 0.15rem;
  773. }
  774. .taskInfo > div {
  775. margin: 0 0 0.15rem 0;
  776. }
  777. span.type {
  778. color: #2680eb;
  779. vertical-align: middle;
  780. }
  781. span.state {
  782. float: right;
  783. }
  784. span.name {
  785. font-size: 0.16rem;
  786. font-weight: 600;
  787. width: 60%;
  788. vertical-align: middle;
  789. display: inline-block;
  790. overflow: hidden;
  791. white-space: nowrap;
  792. }
  793. span.num {
  794. font-size: 0.14rem;
  795. color: #26a2ff;
  796. }
  797. div.department {
  798. font-size: 0.12rem;
  799. color: #9E9E9E;
  800. padding: 0 0 0.15rem 0;
  801. border-bottom: 1px solid #ddd;
  802. }
  803. .department .one_dep {
  804. display: inline-block;
  805. height: 0.25rem;
  806. line-height: 0.25rem;
  807. width: 49%;
  808. }
  809. div.content {
  810. font-size: 0.14rem;
  811. color: #333;
  812. }
  813. .userInfo {
  814. width: 70%;
  815. display: inline-block;
  816. }
  817. .userInfo img {
  818. width: 0.18rem;
  819. border-radius: 50%;
  820. vertical-align: middle;
  821. }
  822. .userInfo span {
  823. vertical-align: middle;
  824. margin-right: 0.12rem;
  825. color: #999;
  826. font-size: 0.12rem;
  827. vertical-align: middle;
  828. margin-left: 0.05rem;
  829. }
  830. span.arrow {
  831. float: right;
  832. }
  833. span.arrow img {
  834. width: 0.12rem;
  835. margin-right: 0.05rem;
  836. transform: rotate(-90deg);
  837. -ms-transform: rotate(-90deg); /* IE 9 */
  838. -moz-transform: rotate(-90deg); /* Firefox */
  839. -webkit-transform: rotate(-90deg); /* Safari and Chrome */
  840. -o-transform: rotate(-90deg); /* Opera */
  841. }
  842. .allBtn {
  843. display: inline-block;
  844. width: 28%;
  845. text-align: right;
  846. }
  847. .task_tab_head {
  848. border-bottom: 1px solid #ddd;
  849. padding-right: 40%;
  850. }
  851. /* 任务详情 END */
  852. /* 底部列表 START */
  853. .fixTop {
  854. position: fixed;
  855. top: 0.4rem;
  856. width: 60%;
  857. z-index: 100;
  858. }
  859. .recordBox {
  860. margin-bottom: 0.2rem;
  861. }
  862. .one_recordBox {
  863. padding: 0.12rem;
  864. background: #fff;
  865. }
  866. .one_recordBox > div {
  867. line-height: 0.25rem;
  868. }
  869. .one_recordBox .time {
  870. color: #999;
  871. margin-left: 0.08rem;
  872. font-size: 0.12rem;
  873. }
  874. .one_recordBox .content {
  875. font-size: 0.13rem;
  876. color: #666;
  877. word-wrap: break-word;
  878. margin-top:0.08rem;
  879. margin-bottom: 0.08rem;
  880. }
  881. .userName {
  882. font-size: 0.15rem;
  883. color: #333;
  884. }
  885. .isPass {
  886. float: right;
  887. color: #2680eb;
  888. width: 0.5rem;
  889. height: 0.3rem;
  890. text-align: right;
  891. }
  892. .isPassN {
  893. color: #999;
  894. }
  895. .isPassY {
  896. color: #55d650;
  897. }
  898. .respond {
  899. padding: 0.12rem;
  900. background: #efefef;
  901. }
  902. .btn_list {
  903. position: absolute;
  904. right: 0.05rem;
  905. top: 0.37rem;
  906. border:#aaa;
  907. background: #fcfcfc;
  908. box-shadow: 5px 5px 10px #ccc;
  909. z-index: 120;
  910. }
  911. .btn_list:before {
  912. display: inline-block;
  913. width: 0;
  914. height: 0;
  915. border: solid transparent;
  916. border-width: 10px;
  917. border-bottom-color: #fcfcfc;
  918. content: "";
  919. position: absolute;
  920. top: -20px;
  921. right: 0.06rem;
  922. }
  923. .btn_list > div {
  924. width: 0.4rem;
  925. font-size: 0.13rem;
  926. padding: 0.1rem 0.15rem;
  927. border-bottom: 1px solid #efefef;
  928. text-align: center;
  929. }
  930. .btn_list > div img {
  931. width: 0.14rem;
  932. height: 0.14rem;
  933. vertical-align: middle;
  934. margin-right: 0.05rem;
  935. }
  936. .btn_list > div span {
  937. height: 0.15rem;
  938. line-height: 0.15rem;
  939. vertical-align: middle;
  940. }
  941. .noList {
  942. text-align: center;
  943. padding: 1.5rem 0;
  944. }
  945. .noList img {
  946. width: 1.2rem;
  947. height: 1.2rem;
  948. }
  949. .order {
  950. height: 0.6rem;
  951. line-height: 0.6rem;
  952. text-align: center;
  953. }
  954. .order .line {
  955. display: inline-block;
  956. width: 1.2rem;
  957. border-top: 1px solid #ccc ;
  958. vertical-align: middle;
  959. }
  960. .order .txt {
  961. color: #ccc;
  962. font-size: 0.13rem;
  963. vertical-align: middle;
  964. }
  965. .upload {
  966. color: #2680eb;
  967. font-size: 0.14rem;
  968. padding: 0.12rem;
  969. }
  970. .one_file a {
  971. color: #409eff;
  972. text-decoration:none;
  973. display: inline-block;
  974. width: 100%;
  975. overflow: hidden;
  976. white-space: nowrap;
  977. text-overflow: ellipsis;
  978. }
  979. .one_file > div {
  980. line-height: 0.2rem;
  981. }
  982. .one_file > div:nth-child(2) {
  983. color: #aaa;
  984. }
  985. .one_file > div:nth-child(2) span {
  986. float: right;
  987. }
  988. .one_file > div:nth-child(2) span img {
  989. width: 0.12rem;
  990. }
  991. /* 底部列表 END */
  992. /* 弹框样式 START */
  993. .mint-popup {
  994. width: 70%;
  995. box-sizing: content-box;
  996. }
  997. .mint-popup-div {
  998. padding: 0.12rem;
  999. background: #fff;
  1000. }
  1001. .mint-popup-div h4 {
  1002. margin: 0;
  1003. padding: 0;
  1004. }
  1005. .mint-popup-div .mint-cell {
  1006. margin: 0.2rem 0;
  1007. }
  1008. .mint-popup-div > div.btns {
  1009. height: 0.3rem;
  1010. }
  1011. .mint-popup-div .btn {
  1012. float: right;
  1013. margin-right: 0.1rem;
  1014. background: #fff;
  1015. box-shadow: none;
  1016. width: 50%;
  1017. margin: 0;
  1018. }
  1019. .mint-popup-div .btn:nth-child(1) {
  1020. color: #f00;
  1021. }
  1022. /* 弹框样式 END */
  1023. </style>
  1024. <style>
  1025. .detail_head .mint-header-title {
  1026. font-weight: 600;
  1027. font-size: 0.15rem;
  1028. }
  1029. .detail_head .mint-button-text {
  1030. color: #26a2ff;
  1031. }
  1032. .detailBox .mint-cell {
  1033. padding: 0 0 0 0.02rem;
  1034. }
  1035. .task_tab_head .mint-tab-item {
  1036. padding: 0;
  1037. height: 0.4rem;
  1038. }
  1039. .task_tab_head .mint-tab-item-label {
  1040. font-size: 0.13rem;
  1041. color: #999;
  1042. line-height: 0.4rem;
  1043. }
  1044. .task_tab_head .mint-tab-item.is-selected {
  1045. border-bottom: none;
  1046. font-weight: 600;
  1047. }
  1048. .task_tab_head .mint-tab-item.is-selected .mint-tab-item-label {
  1049. font-size: 0.14rem;
  1050. color: #333;
  1051. font-weight: 700;
  1052. }
  1053. .mint-cell:last-child {
  1054. background-image: none;
  1055. }
  1056. .scoreIsPass .mint-cell {
  1057. display: inline-block;
  1058. width: 49%;
  1059. }
  1060. .el-rate:focus {
  1061. outline-width: 0;
  1062. }
  1063. .el-rate__icon {
  1064. font-size: 0.25rem;
  1065. border: none!important;
  1066. outline: 0!important;
  1067. box-shadow: none!important;
  1068. -webkit-box-shadow: none!important;
  1069. }
  1070. .el-rate__item {
  1071. border: none!important;
  1072. outline: 0!important;
  1073. box-shadow: none!important;
  1074. -webkit-box-shadow: none!important;
  1075. }
  1076. </style>