taskFile.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130
  1. <template>
  2. <div class="taskfile_box">
  3. <van-nav-bar :title="title" :left-text="isHome? '首页':'返回'" @click-left="routeBack" class="headerbar no-down-icon" left-arrow>
  4. <template slot="right">
  5. <div style="padding:0 0.32rem;" @click="sheet_show = true"><van-icon name="ellipsis" v-if="The_current_account" /></div>
  6. </template>
  7. </van-nav-bar>
  8. <div class="body_com has_header">
  9. <scroller>
  10. <van-cell
  11. class="efficiency_list"
  12. size="large"
  13. :title="info.employee_name"
  14. >
  15. <template slot="icon">
  16. <userImage :user_name="info.employee_name" :img_url="info.img_url" width="1rem" height="1rem" style="margin-right: 0.12rem;"></userImage>
  17. </template>
  18. <template slot="label">
  19. <span v-if="info.dept_list.length > 0" v-for="(item, index) in info.dept_list" :key="index" class="sub-title">
  20. <em v-if="index > 0">,</em>
  21. {{ item.dept_name }}
  22. </span>
  23. <span v-else>暂无部门</span>
  24. </template>
  25. <template slot="default">
  26. <div style="float: right;text-align: center;padding:0 0.1rem;" v-if="info.status == 4" class="sub-title">
  27. <span class="point-span">{{ info.point_config.review_point }}</span>
  28. <div style="color: #909399;">最终分</div>
  29. </div>
  30. <div style="float: right;text-align: center;padding:0 0.1rem;">
  31. <span class="point-span">{{ `${info.point_config.base_point} ${info.pt_name}` }}</span>
  32. </div>
  33. </template>
  34. </van-cell>
  35. <van-cell-group
  36. :border="false"
  37. class="task_detail_group"
  38. v-if="info.review_status === 2"
  39. >
  40. <van-cell
  41. :border="false"
  42. title-class="align_self"
  43. value-class="align_self"
  44. >
  45. <template slot="title">
  46. <div class="time">
  47. <span>审批结果</span>
  48. <span class="timeExactly red">已拒绝</span>
  49. </div>
  50. </template>
  51. </van-cell>
  52. <van-cell
  53. :border="false"
  54. title-class="align_self"
  55. value-class="align_self"
  56. >
  57. <template slot="title">
  58. <div class="time">
  59. <span>驳回理由</span>
  60. <span class="timeExactly" style="white-space: pre-line;padding-left: 10px;">{{ info.review_remark }}</span>
  61. </div>
  62. </template>
  63. </van-cell>
  64. </van-cell-group>
  65. <van-row justify="space-around" class="item-title">
  66. <van-col span="6" >任务信息</van-col>
  67. </van-row>
  68. <van-cell-group
  69. :border="false"
  70. class="task_detail_group"
  71. inset
  72. >
  73. <van-cell
  74. title-class="align_self"
  75. value-class="align_self"
  76. :border="false"
  77. title="审批人"
  78. :value="info.reviewer_name"
  79. />
  80. <van-cell
  81. title-class="align_self"
  82. value-class="align_self"
  83. :border="false"
  84. title="发布人"
  85. :value="info.publisher_name"
  86. />
  87. <van-cell
  88. title-class="align_self"
  89. value-class="align_self"
  90. :border="false"
  91. title="任务积分"
  92. :value="`${info.point_config.base_point} ${info.pt_name || ''}`"
  93. />
  94. <van-cell
  95. title-class="align_self"
  96. value-class="align_self"
  97. :border="false"
  98. title="内容"
  99. :value="info.task_name"
  100. />
  101. <van-cell
  102. title-class="align_self"
  103. value-class="align_self"
  104. v-if="info.task_remark"
  105. :border="false"
  106. title="任务备注"
  107. :value="info.task_remark"
  108. />
  109. <van-cell
  110. title-class="align_self"
  111. value-class="align_self"
  112. :border="false"
  113. title="发布时间"
  114. :value="info.create_time"
  115. />
  116. <van-cell
  117. title-class="align_self"
  118. value-class="align_self"
  119. v-if="info.point_config.review_point"
  120. :border="false"
  121. title="最终分"
  122. :value="info.point_config.review_point"
  123. />
  124. <van-cell
  125. title-class="align_self"
  126. value-class="align_self"
  127. :border="false"
  128. title="截止时间"
  129. >
  130. <template slot="default">
  131. {{ info.expire_time }} <span style="padding-left: 10px;" class="red" v-show="info.expire_day > 0">逾期{{ info.expire_day }}天</span>
  132. </template>
  133. </van-cell>
  134. <van-cell
  135. title-class="align_self"
  136. value-class="align_self"
  137. v-if="info.point_config.timeout_deduction_point > 0"
  138. :border="false"
  139. title="逾期扣分"
  140. :value="`${info.point_config.timeout_deduction_point} B分/天`"
  141. />
  142. <van-cell
  143. title-class="align_self"
  144. value-class="align_self"
  145. v-if="info.point_config.ahead_award_point > 0"
  146. :border="false"
  147. title="提前奖分"
  148. :value="`${info.point_config.ahead_award_point} B分/天`"
  149. />
  150. <van-cell
  151. title-class="align_self"
  152. value-class="align_self"
  153. :border="false"
  154. v-if="info.task_file_list.length > 0"
  155. >
  156. <template #title>
  157. <div class="time">
  158. <span>任务图片</span>
  159. <span>
  160. <van-image v-for="(items, index) in info.task_file_list" :key="index" @click="open_image(info.task_file_list)" width="45" height="45" radius="3" :src="items" />
  161. </span>
  162. </div>
  163. </template>
  164. </van-cell>
  165. <!-- <van-cell :border="false">-->
  166. <!-- <template slot="title">-->
  167. <!-- <div class="time">-->
  168. <!-- <span>发布时间</span>-->
  169. <!-- <span class="timeExactly">{{ info.create_time }}</span>-->
  170. <!-- </div>-->
  171. <!-- </template>-->
  172. <!-- </van-cell>-->
  173. <!-- <van-cell :border="false">-->
  174. <!-- <template slot="title">-->
  175. <!-- <div class="time">-->
  176. <!-- <span>截止时间</span>-->
  177. <!-- <span class="timeExactly">{{ info.expire_time }}</span>-->
  178. <!-- <span style="padding-left: 10px;" class="red" v-show="info.expire_day > 0">逾期{{ info.expire_day }}天</span>-->
  179. <!-- </div>-->
  180. <!-- </template>-->
  181. <!-- </van-cell>-->
  182. <!-- <van-cell v-if="info.point_config.ahead_award_point * 1 > 0" :border="false">-->
  183. <!-- <template slot="title">-->
  184. <!-- <div class="time">-->
  185. <!-- <span>提前奖分</span>-->
  186. <!-- <span class="timeExactly">{{ info.point_config.ahead_award_point }}分/天</span>-->
  187. <!-- </div>-->
  188. <!-- </template>-->
  189. <!-- </van-cell>-->
  190. <!-- <van-cell v-if="info.point_config.timeout_deduction_point * 1 > 0" :border="false">-->
  191. <!-- <template slot="title">-->
  192. <!-- <div class="time">-->
  193. <!-- <span>逾期扣分</span>-->
  194. <!-- <span class="timeExactly">{{ info.point_config.timeout_deduction_point }}分/天</span>-->
  195. <!-- </div>-->
  196. <!-- </template>-->
  197. <!-- </van-cell>-->
  198. <!-- <van-cell :border="false">-->
  199. <!-- <template slot="title">-->
  200. <!-- <div class="time">-->
  201. <!-- <span>任务备注</span>-->
  202. <!-- <span class="timeExactly" style="white-space: pre-line;">{{ info.task_remark }}</span>-->
  203. <!-- </div>-->
  204. <!-- </template>-->
  205. <!-- </van-cell>-->
  206. <!-- <van-cell :border="false">-->
  207. <!-- <template slot="title">-->
  208. <!-- <div class="time">-->
  209. <!-- <span>审批人</span>-->
  210. <!-- <span class="timeExactly">{{ info.reviewer_name }}</span>-->
  211. <!-- </div>-->
  212. <!-- </template>-->
  213. <!-- </van-cell>-->
  214. <!-- <van-cell :border="false" v-if="info.review_remark">-->
  215. <!-- <template slot="title">-->
  216. <!-- <div class="time">-->
  217. <!-- <span>审批意见</span>-->
  218. <!-- <span class="timeExactly" style="white-space: pre-line;">{{ info.review_remark }}</span>-->
  219. <!-- </div>-->
  220. <!-- </template>-->
  221. <!-- </van-cell>-->
  222. <!-- <van-cell :border="false">-->
  223. <!-- <template slot="title">-->
  224. <!-- <div class="time">-->
  225. <!-- <span>发布人</span>-->
  226. <!-- <span class="timeExactly">{{ info.publisher_name }}</span>-->
  227. <!-- </div>-->
  228. <!-- </template>-->
  229. <!-- </van-cell>-->
  230. <!-- <van-cell :border="false">-->
  231. <!-- <template slot="title">-->
  232. <!-- <div class="time">-->
  233. <!-- <span>积分种类</span>-->
  234. <!-- <span class="timeExactly">{{ info.pt_name }}</span>-->
  235. <!-- </div>-->
  236. <!-- </template>-->
  237. <!-- </van-cell>-->
  238. <!-- <van-cell :border="false" v-if="info.task_file_list.length != 0">-->
  239. <!-- <template slot="title">-->
  240. <!-- <div class="time">-->
  241. <!-- <span>任务图片</span>-->
  242. <!-- <span>-->
  243. <!-- <van-image v-for="(items, index) in info.task_file_list" :key="index" @click="open_image(info.task_file_list)" width="45" height="45" radius="3" :src="items" />-->
  244. <!-- </span>-->
  245. <!-- </div>-->
  246. <!-- </template>-->
  247. <!-- </van-cell>-->
  248. </van-cell-group>
  249. <template v-if="info.item_info">
  250. <van-row justify="space-around" class="item-title">
  251. <van-col span="6" >规则依据</van-col>
  252. </van-row>
  253. <van-cell-group
  254. :border="false"
  255. class="task_detail_group"
  256. inset
  257. >
  258. <van-cell
  259. title-class="align_self"
  260. value-class="align_self"
  261. :border="false"
  262. title="规则"
  263. :value="info.item_info.remark"
  264. />
  265. <van-cell
  266. title-class="align_self"
  267. value-class="align_self"
  268. :border="false"
  269. title="积分"
  270. :value="pointRemark"
  271. />
  272. <van-cell
  273. title-class="align_self"
  274. value-class="align_self"
  275. v-if="info.item_info.has_delete"
  276. :border="false"
  277. title="规则状态"
  278. >
  279. <template slot="default">
  280. <van-tag type="warning">规则已删除</van-tag>
  281. </template>
  282. </van-cell>
  283. <van-cell
  284. title-class="align_self"
  285. value-class="align_self"
  286. v-if="info.rule_info"
  287. :border="false"
  288. title="分类"
  289. :value="info.rule_info.name"
  290. />
  291. <van-cell
  292. title-class="align_self"
  293. value-class="align_self"
  294. v-if="info.rule_info && info.rule_info.has_delete"
  295. :border="false"
  296. title="分类状态"
  297. >
  298. <template slot="default">
  299. <van-tag type="warning">分类已删除</van-tag>
  300. </template>
  301. </van-cell>
  302. </van-cell-group>
  303. </template>
  304. <template v-else-if="info.rule_info">
  305. <van-row justify="space-around" class="item-title">
  306. <van-col span="6" >分类依据</van-col>
  307. </van-row>
  308. <van-cell-group
  309. :border="false"
  310. class="task_detail_group"
  311. inset
  312. >
  313. <van-cell
  314. title-class="align_self"
  315. value-class="align_self"
  316. :border="false"
  317. title="分类"
  318. :value="info.rule_info.name"
  319. />
  320. <van-cell
  321. title-class="align_self"
  322. value-class="align_self"
  323. v-if="info.rule_info.has_delete"
  324. :border="false"
  325. title="分类状态"
  326. >
  327. <template slot="default">
  328. <van-tag type="warning">分类已删除</van-tag>
  329. </template>
  330. </van-cell>
  331. </van-cell-group>
  332. </template>
  333. <van-cell-group
  334. class="point"
  335. v-if="info.point_config.standard && info.point_config.standard.super_satisfied * 1 > 0"
  336. inset
  337. >
  338. <van-cell
  339. title-class="align_self"
  340. value-class="align_self"
  341. v-if="info.point_config.standard"
  342. title="评分标准"
  343. >
  344. <template slot="label">
  345. <van-grid slot="label" :border="false">
  346. <van-grid-item text="超预期">
  347. <template slot="icon">
  348. {{ info.point_config.standard.super_satisfied }}
  349. </template>
  350. </van-grid-item>
  351. <van-grid-item text="满意">
  352. <template slot="icon">
  353. {{ info.point_config.standard.satisfied }}
  354. </template>
  355. </van-grid-item>
  356. <van-grid-item text="合格">
  357. <template slot="icon">
  358. {{ info.point_config.standard.qualified }}
  359. </template>
  360. </van-grid-item>
  361. <van-grid-item text="不合格">
  362. <template slot="icon">
  363. {{ info.point_config.standard.unqualified }}
  364. </template>
  365. </van-grid-item>
  366. </van-grid>
  367. </template>
  368. </van-cell>
  369. </van-cell-group>
  370. <van-panel
  371. class="schedule"
  372. @click="info.employee_id == $userInfo().id && info.status == 1 ? $router.push({ name: 'process', query: { work_id: info.id, progress: info.progress } }) : null"
  373. style="margin: 0.2rem 0;"
  374. title="任务进度"
  375. :status="info.employee_id == $userInfo().id && info.status == 1 && info.progress != 100 ? '更新进度' : ''"
  376. >
  377. <div slot="default">
  378. <van-slider class="task_slider" v-model="info.progress" active-color="#ee0a24" bar-height="0.2rem" disabled style="opacity:1">
  379. <template slot="button">
  380. <div class="custom-button" :class="info.progress == '0' ? 'custom-button-left' : info.progress == '100' ? 'custom-button-right' : ''">{{ info.progress }}%</div>
  381. </template>
  382. </van-slider>
  383. </div>
  384. </van-panel>
  385. <div class="task">
  386. <van-row>
  387. <van-col span="16">
  388. <van-tabs v-model="active">
  389. <van-tab title="任务记录"></van-tab>
  390. <van-tab title="记分记录"></van-tab>
  391. </van-tabs>
  392. </van-col>
  393. <van-col span="8" style="background:#fff;border-bottom:0.02rem #efefef solid;">
  394. <div v-if="active === 0 && canUpdate" @click="remberOne" class="rember">+记一条</div>
  395. <div v-if="active !== 0 && isShowJf" @click="noteone" class="rember">记分</div>
  396. </van-col>
  397. </van-row>
  398. <div ref="scoringNotice" style="clear: both;">
  399. <van-notice-bar v-if="active != 0 && info.employee_id != $userInfo().id && info.status < 3 && novice" wrapable mode="closeable" @close="closeNotice">
  400. 记分不会立即生效,评审时可根据此记录打分
  401. </van-notice-bar>
  402. </div>
  403. <van-cell-group
  404. v-if="info.process !== null && info.process.list !== null"
  405. v-for="(item, index) in info.process.list"
  406. :key="'record' + index"
  407. v-show="active == 0 && item.point == 0"
  408. :border="false"
  409. >
  410. <div class="task_record_list clear">
  411. <van-image
  412. class="fl"
  413. :src="item.img_url ? item.img_url : 'static/images/defalut_custmer_headicon.png'"
  414. round
  415. width="46px"
  416. height="46px"
  417. style="margin-right: 0.12rem;"
  418. type="contain"
  419. />
  420. <span class="fr" style=" width: 72vw;">
  421. <div class="clear">
  422. <span class="fl" style="color:#606266;font-size: 16px;">{{ item.recorder }}</span>
  423. <span class="fr" style="color: #909399;font-size: 14px;">{{ item.time }}</span>
  424. </div>
  425. <div style="margin: 0.2rem 0;word-break: break-all;">{{ item.remark }}</div>
  426. </span>
  427. <van-icon v-if="active == 0 && item.recorder_id == $userInfo().id"
  428. name="delete"
  429. color="#909399"
  430. style="float: right; position: absolute;right: 0.1rem;bottom: 0.1rem;"
  431. size="0.5rem"
  432. @click="delItem(index, 'work')"
  433. />
  434. </div>
  435. </van-cell-group>
  436. <van-cell-group style="background: none;" v-show="active == 0 && text_list.length == 0">
  437. <noTask src="static/images/noTask.png" detail_text="还没有任务记录去记一条吧" />
  438. </van-cell-group>
  439. <van-cell-group
  440. v-if="info.process !== null && info.process.list !== null"
  441. v-for="(item, index) in info.process.list"
  442. :key="'point' + index"
  443. v-show="info.process.list !== null && active != 0 && item.point != 0"
  444. :border="false"
  445. >
  446. <div style="color:#FFCC00;padding: 0.16rem 0 0 0.32rem;" v-if="index == 0">
  447. 合计
  448. <template v-if="point_total > 0">
  449. +{{ point_total }}
  450. </template>
  451. <template v-if="point_total <= 0">
  452. {{ point_total }}
  453. </template>
  454. </div>
  455. <van-cell label-class="changsize" :title="item.recorder">
  456. <template slot="icon">
  457. <van-image
  458. :src="item.img_url ? item.img_url : 'static/images/defalut_custmer_headicon.png'"
  459. round
  460. width="46px"
  461. height="46px"
  462. style="margin-right: 0.12rem;"
  463. type="contain"
  464. />
  465. </template>
  466. <template slot="label">
  467. <div class="right_time">{{ item.time }}</div>
  468. <div v-if="item.point * 1 > 0" class="red">+{{ item.point }}</div>
  469. <div v-if="item.point * 1 < 0" class="green">{{ item.point }}</div>
  470. <div style="margin: 0.2rem 0;word-break: break-all;">{{ item.remark }}</div>
  471. <div v-if="active != 0 && item.recorder_id == $userInfo().id">
  472. <van-icon name="delete" color="#909399" style="float: right;" size="0.5rem" @click="delItem(index, 'point')" />
  473. </div>
  474. </template>
  475. </van-cell>
  476. </van-cell-group>
  477. <van-cell-group style="background: none;" v-show="active != 0 && point_list.length == 0">
  478. <noTask src="static/images/noTask.png" detail_text="还没有记分记录去记一条吧" />
  479. </van-cell-group>
  480. </div>
  481. <div v-if="text_list.length != 0 || point_list.length != 0" style="height: 2rem;"></div>
  482. </scroller>
  483. <van-image-preview v-model="show" :images="imageSrc"></van-image-preview>
  484. <div style="padding:0.32rem;width: 90%;position: fixed;bottom: 0;" v-if="info.reviewer_id == $userInfo().id && info.status == 2&&!isShowSp">
  485. <van-button block type="info" @click="go_approval">去审批</van-button>
  486. </div>
  487. <div style="padding:0.4rem;width: 90%;position: fixed;bottom: 0; background-color: white;" v-if="canUpdate&&!isShowSp">
  488. <van-button block type="info" @click="complete_task(info)">完成</van-button>
  489. </div>
  490. </div>
  491. <van-action-sheet v-model="sheet_show" :actions="actions" @select="sheet_select" cancel-text="取消" close-on-click-action @cancel="sheet_show = false" />
  492. </div>
  493. </template>
  494. <script>
  495. import Vue from 'vue'
  496. import noTask from '@/components/noTask'
  497. import { Image, Panel, Tab, Tabs, Progress, Slider, ImagePreview, Col, Row, ActionSheet, NoticeBar } from 'vant'
  498. Vue.use(Image)
  499. .use(Panel)
  500. .use(Tab)
  501. .use(Tabs)
  502. .use(Progress)
  503. .use(Slider)
  504. .use(ImagePreview)
  505. .use(Col)
  506. .use(Row)
  507. .use(ActionSheet)
  508. .use(NoticeBar)
  509. export default {
  510. components: { noTask},
  511. // 数据
  512. data () {
  513. return {
  514. userInfo:this.$userInfo(),
  515. The_current_account: false,
  516. active: 0,
  517. numberslider: 0,
  518. active1: 'running',
  519. title: '任务详情',
  520. filter: {
  521. page: 1,
  522. type: 'all',
  523. status: 'waiting'
  524. },
  525. info: {
  526. date: 0,
  527. employee_id: 0,
  528. employee_name: '',
  529. expire_time: '',
  530. id: 0,
  531. dept_list: [],
  532. month: 0,
  533. performance_data: [],
  534. point_config: {},
  535. process: [],
  536. progress: 0,
  537. pt_id: 0,
  538. pt_name: '',
  539. publisher_id: 0,
  540. publisher_name: '',
  541. reviewer_id: 0,
  542. reviewer_name: '',
  543. source_type: 0,
  544. source_type_mark: '',
  545. status: 0,
  546. status_mark: '',
  547. task_file_list: [],
  548. task_name: '',
  549. task_remark: '',
  550. rule_id:0,
  551. rule_info:{},
  552. item_id:0,
  553. item_info:{}
  554. },
  555. process: [],
  556. checked: false,
  557. point_total: 0,
  558. point_list: [],
  559. text_list: [],
  560. types_list: {},
  561. imageSrc: [],
  562. show: false,
  563. sheet_show: false,
  564. actions: [],
  565. novice: false,
  566. isShowSp:false,
  567. isShowJf:false,//是否显示记分
  568. isHome:false,//微信信息点击进来
  569. }
  570. },
  571. created () {
  572. if (this.$route.query.task_id) {
  573. this.info.id = this.$route.query.task_id
  574. this.isShowSp = this.$route.query.isShowSp
  575. this.get_point_types()
  576. }
  577. if(this.$route.query.isHome){
  578. this.isHome = true;
  579. }else{
  580. this.isHome = false;
  581. }
  582. },
  583. activated() {
  584. if (this.$route.query.task_id) {
  585. this.info.id = this.$route.query.task_id
  586. this.getList()
  587. }
  588. if(this.$route.query.isHome){
  589. this.isHome = true;
  590. }else{
  591. this.isHome = false;
  592. }
  593. },
  594. methods: {
  595. routeBack(){
  596. this.isHome? this.$router.replace({ name: 'home' }):this.$route_back();
  597. },
  598. // 完成任务
  599. complete_task (item) {
  600. this.$router.push({ name: 'process', query: { work_id: item.id, progress: 100 } })
  601. },
  602. getLocalStorage () {
  603. if (!localStorage.getItem('taskFileNotice') || (window.plus && !plus.storage.getItem('taskFileNotice'))) {
  604. this.novice = true
  605. } else {
  606. this.novice = false
  607. }
  608. },
  609. closeNotice () {
  610. window.plus ? plus.storage.setItem('taskFileNotice') : localStorage.setItem('taskFileNotice', true)
  611. this.getLocalStorage()
  612. },
  613. sheet_select (action, index) {
  614. if (action.name == '更新任务') {
  615. if (this.$route.query.isJx) {
  616. // 编辑 从上一个页面传过来一些参数
  617. this.$router.push({
  618. name: 'compile_efficiency',
  619. query: {
  620. info: JSON.stringify(this.info),
  621. base_point: this.$route.query.base_point,
  622. surplus: this.$route.query.surplus
  623. }
  624. })
  625. } else {
  626. this.$router.push({name:'WorkEdit',params:{workId:this.$route.query.task_id.toString()}})
  627. // this.$router.push({ name: 'compile_task', query: { info: JSON.stringify(this.info) } })
  628. }
  629. }
  630. if (action.name == '撤销任务') {
  631. this.$dialog
  632. .confirm({
  633. title: '撤销任务',
  634. message: '任务撤销后将不可恢复,确认撤销吗?'
  635. })
  636. .then(() => {
  637. this.delete_task(0)
  638. })
  639. }
  640. if (action.name == '删除任务') {
  641. this.$dialog
  642. .confirm({
  643. title: '删除任务',
  644. message: '删除此任务将会删除其相关记录和积分数据,确认删除吗?'
  645. })
  646. .then(() => {
  647. this.delete_task(1)
  648. })
  649. }
  650. },
  651. // 撤销任务---删除任务
  652. delete_task (e) {
  653. this.$toast.loading({
  654. loadingType: 'spinner',
  655. message: '正在处理'
  656. })
  657. this.$axiosUser(
  658. e == 0 ? 'post' : 'DELETE',
  659. e == 0 ? '/api/pro/integral/work' : '/api/pro/integral/work',
  660. e == 0 ? { work_id: this.info.id, status: 'refuse' } : { work_id: this.info.id }
  661. ).then(res => {
  662. this.$route_back()
  663. })
  664. },
  665. open_image (index) {
  666. this.imageSrc = index
  667. this.show = true
  668. },
  669. get_point_types () {
  670. var types = this.$getTypes
  671. for (let i in types) {
  672. this.types_list[types[i].id] = types[i].name
  673. }
  674. },
  675. go_approval () {
  676. if (this.info.pt_id == 1) { // 如果是绩效类型
  677. this.$router.push({ name: 'performanceAudit', query: { review_id: this.info.review_id, task_id: this.$route.query.task_id } })
  678. } else {
  679. this.$router.push({ name: 'integralAudit', query: { review_id: this.info.review_id } })
  680. }
  681. },
  682. noteone () {
  683. if (this.info.process.list) {
  684. localStorage.setItem('task_process_array', JSON.stringify(this.info.process.list))
  685. } else {
  686. localStorage.setItem('task_process_array', JSON.stringify([]))
  687. }
  688. this.$router.push({ name: 'integral_noteone', query: { work_id: this.info.id, employee_name: this.info.employee_name } })
  689. },
  690. remberOne () {
  691. if (this.info.process.list) {
  692. localStorage.setItem('task_process_array', JSON.stringify(this.info.process.list))
  693. } else {
  694. localStorage.setItem('task_process_array', JSON.stringify([]))
  695. }
  696. this.$router.push({ name: 'remberOne', query: { work_id: this.info.id } })
  697. },
  698. showLoading () {
  699. this.$toast.loading({
  700. loadingType: 'spinner',
  701. message: '正在处理'
  702. })
  703. },
  704. // 判断当前账号与发布工作者是否同一人;
  705. current_none (data) {
  706. // APP PC 兼容写法(如果下方无效 用这个)
  707. var userInfo = this.$userInfo()
  708. if (data.publisher_id == userInfo.id) {
  709. this.The_current_account = true
  710. } else {
  711. this.The_current_account = false
  712. }
  713. this.actions = []
  714. // 这里比较复杂,因为团队绩效的工作详情跟我的发布的工作详情都调用这个页面
  715. if (data.status == 1) {
  716. if (data.pt_id != 1) {
  717. this.actions.push({ name: '更新任务' })
  718. this.actions.push({ name: '删除任务' })
  719. } else if (data.pt_id == 1 && this.$route.query.isJx) {
  720. this.actions.push({ name: '更新任务' })
  721. this.actions.push({ name: '删除任务' })
  722. } else {
  723. this.actions.push({ name: '删除任务' })
  724. }
  725. } else {
  726. this.actions.push({ name: '删除任务' })
  727. }
  728. },
  729. keepTheScore(data){
  730. if(![1,2,6].includes(data.status)){
  731. return false
  732. }
  733. if(this.userInfo.id === data.reviewer_id){
  734. return true
  735. }
  736. let info=this.$getEmployeeMapItem(data.employee_id)
  737. if(info){
  738. return info.employee_detail.superior_list.some(x =>{
  739. if(this.userInfo.id === x.id){
  740. return true
  741. }
  742. })
  743. }
  744. },
  745. getList () {
  746. this.showLoading()
  747. this.$axiosUser('get', '/api/pro/integral/work', { work_id: this.info.id }).then(res => {
  748. this.current_none(res.data.data) // 传入当前任务的信息,包含发布者
  749. this.info = res.data.data;
  750. this.isShowJf=this.keepTheScore(res.data.data);
  751. let text_list = []
  752. let point_list = []
  753. this.point_total = 0
  754. if (this.info.process.list && this.info.process.list.length > 0) {
  755. for (let i in this.info.process.list) {
  756. this.point_total += this.info.process.list[i].point * 1
  757. if (this.info.process.list[i].point != 0) {
  758. point_list.push(this.info.process.list[i])
  759. } else {
  760. text_list.push(this.info.process.list[i])
  761. }
  762. }
  763. }
  764. this.text_list = text_list
  765. this.point_list = point_list
  766. }).finally(()=>{
  767. this.$toast.clear()
  768. })
  769. },
  770. delItem (index, type) {
  771. let self = this
  772. this.$dialog
  773. .confirm({
  774. title: '提示',
  775. message: '确定永久删除此项?'
  776. })
  777. .then(() => {
  778. let data = {
  779. work_id: this.info.id,
  780. process: JSON.parse(JSON.stringify(this.info.process.list))||'[]'
  781. }
  782. data.process.splice(index, 1)
  783. if(data.process.length==0){
  784. data.process='[]'
  785. }
  786. this.$axiosUser('post', '/api/pro/integral/work', data)
  787. .then(res => {
  788. if (res.data.code == 1) {
  789. self.info.process.list.splice(index, 1)
  790. self.getTotalData()
  791. } else {
  792. self.$toast(res.data.msg)
  793. }
  794. })
  795. .catch(e => {
  796. self.$toast.clear()
  797. })
  798. })
  799. },
  800. getTotalData () {
  801. let self = this
  802. this.$axiosUser('get', '/api/pro/integral/work', { work_id: self.info.id }).then(res => {
  803. if (res.data.code == '1') {
  804. const info = res.data.data
  805. if (info.process !== null) {
  806. self.point_total = info.process.total
  807. }
  808. }
  809. })
  810. }
  811. },
  812. computed:{
  813. canUpdate(){
  814. return this.info.employee_id === this.userInfo.id && [1,6].includes(this.info.status)
  815. },
  816. pointRemark(){
  817. if (!(this.info && this.info.item_info)) return ''
  818. return this.info.item_info.range_type === 1 ? `${this.info.item_info.min_point} ${this.$getTypesName(this.info.item_info.pt_id)}` : `${this.info.item_info.min_point} -- ${this.info.item_info.max_point} ${this.$getTypesName(this.info.item_info.pt_id)}`
  819. }
  820. },
  821. mounted () {
  822. this.getLocalStorage()
  823. },
  824. }
  825. </script>
  826. <style rel="stylesheet/less" lang="less" scoped>
  827. .body_com {
  828. height: calc(100% - 1rem);
  829. position: relative;
  830. }
  831. .add_btn {
  832. background-color: #26a2ff;
  833. border-radius: 50%;
  834. width: 1.12rem;
  835. height: 1.12rem;
  836. position: fixed;
  837. right: 0.48rem;
  838. bottom: 1.04rem;
  839. text-align: center;
  840. .van-icon {
  841. line-height: 1.12rem;
  842. }
  843. }
  844. .van-cell__value {
  845. text-align: right;
  846. }
  847. .time {
  848. color: #909399;
  849. font-size: 0.28rem;
  850. display: flex;
  851. span {
  852. display: table-cell;
  853. vertical-align: middle;
  854. word-wrap: break-word;
  855. word-break: break-all;
  856. white-space: nowrap;
  857. font-size: inherit;
  858. }
  859. .van-image {
  860. border: 1px #ccc solid;
  861. margin-left: 0.2rem;
  862. }
  863. }
  864. .timeExactly {
  865. color: #303133;
  866. padding-left: 0.16rem;
  867. font-size: 0.28rem;
  868. }
  869. .date {
  870. color: #303133;
  871. font-size: 18px;
  872. }
  873. .van-panel__header-value {
  874. color: #26a2ff;
  875. font-size: 0.28rem;
  876. }
  877. .van-progress {
  878. width: 100%;
  879. margin: 0 auto;
  880. }
  881. .van-tabs__line {
  882. background-color: #26a2ff;
  883. }
  884. .changsize {
  885. font-size: 0.32rem;
  886. color: #303133;
  887. word-break: break-all;
  888. }
  889. .rember {
  890. font-size: 0.28rem;
  891. height: 1rem;
  892. line-height: 1rem;
  893. color: #26a2ff;
  894. float: right;
  895. padding-right: 0.32rem;
  896. }
  897. .taskfile_box /deep/ .efficiency_list .van-cell__value .team_info {
  898. display: table-cell;
  899. text-align: left;
  900. padding-left: 0.12rem;
  901. }
  902. /deep/ .efficiency_list .van-cell__value .team_record {
  903. display: table-cell;
  904. text-align: right;
  905. }
  906. .taskfile_box .team {
  907. padding: 0.1rem 0 0.2rem;
  908. }
  909. .taskfile_box .head_title {
  910. color: #303133;
  911. padding: 0.24rem 0.32rem 0rem 0.24rem;
  912. }
  913. .taskfile_box .head_title:after {
  914. border: none;
  915. }
  916. .taskfile_box .schedule /deep/ .van-progress {
  917. margin: 0.24rem auto;
  918. font-size: 0.28rem;
  919. }
  920. .taskfile_box .review /deep/ .van-cell__title span {
  921. line-height: 0.8rem;
  922. }
  923. .taskfile_box .task {
  924. margin: 0.24rem 0;
  925. }
  926. .taskfile_box .task /deep/ .van-tabs__wrap {
  927. height: 1rem;
  928. line-height: 1rem;
  929. }
  930. .taskfile_box .task /deep/ .van-col {
  931. height: 1rem;
  932. line-height: 1rem;
  933. }
  934. .taskfile_box .task /deep/ .van-row .van-col .van-ellipsis {
  935. width: 2rem;
  936. line-height: 1rem;
  937. }
  938. .taskfile_box .task /deep/ .van-row .van-col .van-ellipsis .van-tab__text {
  939. font-size: 0.32rem;
  940. }
  941. .taskfile_box .task /deep/ .van-tabs__line {
  942. width: 2rem !important;
  943. }
  944. .taskfile_box .task /deep/ .van-cell__title {
  945. position: relative;
  946. }
  947. .taskfile_box .task .right_time {
  948. float: right;
  949. position: absolute;
  950. top: 0;
  951. right: 0;
  952. color: #999;
  953. }
  954. .taskfile_box .point /deep/ .van-grid {
  955. margin: 0.32rem 0rem;
  956. }
  957. .taskfile_box .point /deep/ .van-grid .van-grid-item .van-grid-item__content {
  958. margin: 0;
  959. padding: 0;
  960. border-right: 0.02rem #efefef solid;
  961. }
  962. .taskfile_box .point /deep/ .van-grid .van-grid-item:nth-last-child(1) .van-grid-item__content {
  963. border-right: none;
  964. }
  965. .taskfile_box .schedule /deep/ .van-panel__header:after {
  966. border-bottom: none;
  967. }
  968. .van-panel__content {
  969. padding: 0 0.32rem 0.5rem;
  970. }
  971. .taskfile_box .task_slider {
  972. position: relative;
  973. display: inline-block;
  974. }
  975. .taskfile_box .task_slider /deep/ .van-slider__bar {
  976. // background-image: linear-gradient(45deg,#4ECFFF, #26A2FF) !important;
  977. background-color: #26a2ff !important;
  978. }
  979. .taskfile_box .task_slider /deep/ .van-slider__bar .custom-button {
  980. width: 1rem;
  981. margin-top: 0.4rem;
  982. color: #fff;
  983. font-size: 10px;
  984. line-height: 18px;
  985. text-align: center;
  986. background: #26a2ff;
  987. border-radius: 100px;
  988. }
  989. .taskfile_box .task_slider /deep/ .van-slider__bar .custom-button-left {
  990. margin-top: 0;
  991. margin-left: 1rem;
  992. }
  993. .taskfile_box .task_slider /deep/ .van-slider__bar .custom-button-right {
  994. margin-top: 0;
  995. margin-right: 1rem;
  996. }
  997. .taskfile_box .task_slider /deep/ .van-slider__bar .custom-button-font {
  998. font-size: 0.26rem;
  999. text-align: center;
  1000. color: #323233;
  1001. padding: 0.3rem 1.4rem 0 0;
  1002. }
  1003. .taskfile_box .task_slider /deep/ .van-slider__bar .custom-button-font-show {
  1004. display: block;
  1005. }
  1006. .taskfile_box .task_slider /deep/ .van-slider__bar .custom-button-font-hide {
  1007. display: none;
  1008. }
  1009. /deep/ .van-grid-item__icon-wrapper {
  1010. font-size: 0.4rem;
  1011. color: #323233;
  1012. font-weight: normal;
  1013. line-height: 0.5rem;
  1014. }
  1015. /deep/ .van-grid-item__text {
  1016. font-size: 0.28rem;
  1017. color: rgb(144, 147, 153);
  1018. font-size: 0.24rem;
  1019. }
  1020. .point-span {
  1021. font-size: 0.36rem;
  1022. color: #646566;
  1023. }
  1024. .task_detail_group .van-cell {
  1025. padding: 0.1rem 0.32rem 0.1rem;
  1026. }
  1027. .task_detail_group .name {
  1028. padding-bottom: 0.2rem;
  1029. }
  1030. .task_detail_group {
  1031. padding: 0.16rem 0;
  1032. }
  1033. .task_record_list {
  1034. padding: 0.24rem 0.32rem 0.32rem;
  1035. font-size: 0.32rem;
  1036. position: relative;
  1037. }
  1038. .reviewer_info_title {
  1039. padding-left: 0.32rem;
  1040. padding-top: 0.2rem;
  1041. position: relative;
  1042. // border-bottom: 1px #ebedf0 solid;
  1043. &&::after {
  1044. position: absolute;
  1045. box-sizing: border-box;
  1046. content: ' ';
  1047. pointer-events: none;
  1048. top: -50%;
  1049. right: -50%;
  1050. bottom: -50%;
  1051. left: -50%;
  1052. border: 0 solid #ebedf0;
  1053. -webkit-transform: scale(0.5);
  1054. transform: scale(0.5);
  1055. }
  1056. }
  1057. .reviewer_info {
  1058. line-height: 0.8rem;
  1059. span {
  1060. color: chocolate;
  1061. margin-left: 0.2rem;
  1062. }
  1063. }
  1064. .company_dept_img {
  1065. width: 1.4rem;
  1066. height: 1.4rem;
  1067. }
  1068. [class*='van-hairline']::after {
  1069. position: absolute;
  1070. box-sizing: border-box;
  1071. content: ' ';
  1072. pointer-events: none;
  1073. top: -50%;
  1074. right: -50%;
  1075. bottom: -50%;
  1076. left: -50%;
  1077. border: none;
  1078. -webkit-transform: scale(0.5);
  1079. transform: scale(0.5);
  1080. }
  1081. .item-title{
  1082. text-align: center;
  1083. margin-top: 10px;
  1084. font-size: 0.25rem;
  1085. line-height: 0.5rem;
  1086. color: #969799;
  1087. }
  1088. .sub-title{
  1089. font-size: 0.25rem;
  1090. line-height: 0.25rem;
  1091. color: #969799;
  1092. }
  1093. .align_self{
  1094. align-self: center;
  1095. }
  1096. </style>