taskDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. <template>
  2. <view class="container">
  3. <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
  4. <view class="top">
  5. <image class="return" @click="goBack" src="/static/image/back_white.png"></image>
  6. <text>任务详情</text>
  7. </view>
  8. <scroll-view class="content" scroll-y>
  9. <!-- 任务卡片 -->
  10. <view class="task-card">
  11. <view class="card-header">
  12. <view class="card-title">{{ taskData.title }}</view>
  13. </view>
  14. <view class="card-meta">
  15. <view class="meta-tag">{{ taskData.tag }}</view>
  16. <view class="meta-id">ID:{{ taskData.id }}</view>
  17. </view>
  18. </view>
  19. <!-- 任务信息 -->
  20. <view class="info-section">
  21. <view class="section-header">
  22. <view class="section-indicator"></view>
  23. <text class="section-title">任务信息</text>
  24. </view>
  25. <view class="info-list">
  26. <view class="info-item">
  27. <text class="info-label">费用分摊:</text>
  28. <text class="info-value">{{ taskInfo.costSharing }}</text>
  29. </view>
  30. <view class="info-item">
  31. <text class="info-label">归属项目:</text>
  32. <text class="info-value">{{ taskInfo.belongProject }}</text>
  33. </view>
  34. <view class="info-item">
  35. <text class="info-label">归属部门:</text>
  36. <text class="info-value">{{ taskInfo.belongDept }}</text>
  37. </view>
  38. <view class="info-item">
  39. <text class="info-label">归属产品:</text>
  40. <text class="info-value">{{ taskInfo.belongProduct }}</text>
  41. </view>
  42. <view class="info-item">
  43. <text class="info-label">申请补充直播任务:</text>
  44. <text class="info-value">{{ taskInfo.applySupplementLive }}</text>
  45. </view>
  46. <view class="info-item">
  47. <text class="info-label">补充任务直播间ID:</text>
  48. <text class="info-value">{{ taskInfo.supplementRoomId }}</text>
  49. </view>
  50. <view class="info-item">
  51. <text class="info-label">申请补充任务原因:</text>
  52. <text class="info-value">{{ taskInfo.supplementReason }}</text>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 内容信息 -->
  57. <view class="info-section">
  58. <view class="section-header">
  59. <view class="section-indicator"></view>
  60. <text class="section-title">内容信息</text>
  61. </view>
  62. <view class="info-list">
  63. <view class="info-item">
  64. <text class="info-label">交付物名称:</text>
  65. <text class="info-value">{{ contentInfo.deliverableName }}</text>
  66. </view>
  67. <view class="info-item">
  68. <text class="info-label">交付物ID:</text>
  69. <text class="info-value">{{ contentInfo.deliverableId }}</text>
  70. </view>
  71. <view class="info-item">
  72. <text class="info-label">直播间地址:</text>
  73. <text class="info-value">{{ contentInfo.liveRoomUrl }}</text>
  74. <text class="copy-btn" @click="copyToClipboard(contentInfo.liveRoomUrl)">复制</text>
  75. </view>
  76. <view class="info-item">
  77. <text class="info-label">推流地址:</text>
  78. <text class="info-value">{{ contentInfo.pushUrl }}</text>
  79. <text class="copy-btn" @click="copyToClipboard(contentInfo.pushUrl)">复制</text>
  80. </view>
  81. <view class="info-item">
  82. <text class="info-label">开播地址:</text>
  83. <text class="info-value">{{ contentInfo.startUrl }}</text>
  84. <text class="copy-btn" @click="copyToClipboard(contentInfo.startUrl)">复制</text>
  85. </view>
  86. <view class="info-item">
  87. <text class="info-label">直播回放:</text>
  88. <text class="info-value">{{ contentInfo.liveReplay }}</text>
  89. </view>
  90. <view class="info-item">
  91. <text class="info-label">播放视频:</text>
  92. <text class="info-value">{{ contentInfo.playVideo }}</text>
  93. </view>
  94. <view class="info-item">
  95. <text class="info-label">下载视频:</text>
  96. <text class="info-value">{{ contentInfo.downloadVideo }}</text>
  97. </view>
  98. <view class="info-item">
  99. <text class="info-label">观众人数:</text>
  100. <text class="info-value">{{ contentInfo.viewerCount }}</text>
  101. </view>
  102. <view class="info-item">
  103. <text class="info-label">有效观看:</text>
  104. <text class="info-value">{{ contentInfo.validView }}</text>
  105. </view>
  106. <view class="info-item">
  107. <text class="info-label">情况说明:</text>
  108. <text class="info-value">{{ contentInfo.description }}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 客户信息 -->
  113. <view class="info-section">
  114. <view class="section-header">
  115. <view class="section-indicator"></view>
  116. <text class="section-title">客户信息</text>
  117. </view>
  118. <view class="client-list">
  119. <view class="client-item" v-for="(item, index) in clientList" :key="index">
  120. <view class="client-info">
  121. <image class="avatar" src="/static/image/my_heads_icon.png"></image>
  122. <view class="client-txt">
  123. <view class="client-name">
  124. {{ item.name }}
  125. <text class="client-level">{{ item.level }}</text>
  126. </view>
  127. <view class="client-hospital">
  128. <text>{{ item.hospital }} </text>
  129. <view class="line"></view>
  130. <text>{{ item.department }}</text>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="client-stats">
  135. <view class="stat-item"><text class="num">{{ item.taskCount }} </text>任务</view>
  136. <view class="stat-item"><text class="num">{{ item.points }} </text>积分</view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 补充材料 -->
  142. <view class="info-section">
  143. <view class="section-header">
  144. <view class="section-indicator"></view>
  145. <text class="section-title">补充材料</text>
  146. </view>
  147. <view class="info-list">
  148. <view class="info-item">
  149. <text class="info-label">交付物名称:</text>
  150. <text class="info-value">{{ supplementMaterial.deliverableName }}</text>
  151. </view>
  152. <view class="info-item">
  153. <text class="info-label">情况说明:</text>
  154. <text class="info-value">{{ supplementMaterial.description }}</text>
  155. </view>
  156. <view class="info-item column">
  157. <text class="info-label">附件:</text>
  158. <view class="attachment-item" v-if="supplementMaterial.attachment.name">
  159. <view class="left">
  160. <image class="img" src="/static/image/icon_attachment.png"></image>
  161. <view class="txt-item">
  162. <view class="attachment-name">{{ supplementMaterial.attachment.name }}</view>
  163. <view class="attachment-size">{{ supplementMaterial.attachment.size }}</view>
  164. </view>
  165. </view>
  166. <image class="download-btn" @click="downloadAttachment"
  167. src="/static/image/icon_downlad.png"></image>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 审批信息 -->
  173. <view class="info-section">
  174. <view class="section-header">
  175. <view class="section-indicator"></view>
  176. <text class="section-title">审批信息</text>
  177. </view>
  178. <view class="approval-list">
  179. <view class="approval-item" v-for="(item, index) in approvalInfo" :key="index">
  180. <view class="left">
  181. <view class="avatar-box">
  182. <image class="avatar" src="/static/image/my_heads_icon.png"></image>
  183. <image class="icon" v-if="item.status==2" src="/static/image/icon_wait.png"></image>
  184. <image class="icon" v-if="item.status==0" src="/static/image/icon_pass.png"></image>
  185. <image class="icon" v-if="item.status==1" src="/static/image/icon_refuse.png"></image>
  186. </view>
  187. <view class="approval-user">
  188. <view class="user-name">{{ item.name }}</view>
  189. <view class="user-status" :style="{ color: item.statusColor }">{{ item.status }}</view>
  190. </view>
  191. </view>
  192. <text class="approval-time">{{ item.time }}</text>
  193. <view class="approval-line" v-if="index < approvalInfo.length - 1"></view>
  194. </view>
  195. </view>
  196. <view class="reason" v-if="item.status==3">
  197. 费用分摊部门填写错误,应该是学术研究事业部,请修改后重新提交。
  198. </view>
  199. </view>
  200. </scroll-view>
  201. </view>
  202. </template>
  203. <script>
  204. import { getTaskFinishAuditInfo} from '@/api/task.js';
  205. export default {
  206. data() {
  207. return {
  208. // 仅获取微信小程序状态栏高度,无多余逻辑
  209. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  210. taskId: '',
  211. // 任务基础信息
  212. taskData: {
  213. },
  214. // 任务信息
  215. taskInfo: {
  216. },
  217. // 内容信息
  218. contentInfo: {
  219. },
  220. // 客户信息列表
  221. clientList: [
  222. ],
  223. // 补充材料
  224. supplementMaterial: {
  225. deliverableName: '-',
  226. description: '-',
  227. attachment: {
  228. }
  229. },
  230. // 审批信息
  231. approvalInfo: []
  232. }
  233. },
  234. onLoad(options) {
  235. if (options.taskId) {
  236. this.taskId = options.taskId
  237. this.loadData()
  238. }
  239. },
  240. methods: {
  241. goBack() {
  242. uni.navigateBack()
  243. },
  244. async loadData() {
  245. try {
  246. uni.showLoading({
  247. title: '加载中...'
  248. })
  249. // 调用接口获取任务详情
  250. const res = await getTaskFinishAuditInfo({ taskId: this.taskId })
  251. uni.hideLoading()
  252. if (res.code === 200) {
  253. // 处理返回的数据
  254. const data = res.data
  255. // 更新任务基础信息
  256. this.taskData = {
  257. title: data.auditTaskInfoVO?.taskName || '任务名称',
  258. tag: data.auditTaskInfoVO?.taskTypeName || '任务类型',
  259. id: data.auditTaskInfoVO?.taskNo || ''
  260. }
  261. // 更新任务信息
  262. this.taskInfo = {
  263. costSharing: data.auditTaskInfoVO?.costShareName || '-',
  264. belongProject: data.auditTaskInfoVO?.projectName || '-',
  265. belongDept: data.auditTaskInfoVO?.deptName || '-',
  266. belongProduct: '-', // 接口返回数据中没有产品名称
  267. applySupplementLive: '否', // 接口返回数据中没有该字段
  268. supplementRoomId: '-', // 接口返回数据中没有该字段
  269. supplementReason: '-', // 接口返回数据中没有该字段
  270. }
  271. // 更新内容信息
  272. this.contentInfo = {
  273. deliverableName: data.auditTaskInfoVO?.taskName || '-',
  274. deliverableId: data.auditTaskInfoVO?.taskNo || '-',
  275. liveRoomUrl: '-', // 接口返回数据中没有该字段
  276. pushUrl: '-', // 接口返回数据中没有该字段
  277. startUrl: '-', // 接口返回数据中没有该字段
  278. liveReplay: '-', // 接口返回数据中没有该字段
  279. playVideo: '-', // 接口返回数据中没有该字段
  280. downloadVideo: '-', // 接口返回数据中没有该字段
  281. viewerCount: '-', // 接口返回数据中没有该字段
  282. validView: '-', // 接口返回数据中没有该字段
  283. description: '-', // 接口返回数据中没有该字段
  284. }
  285. // 更新客户信息列表
  286. this.clientList = [{
  287. name: data.docterVO?.doctorName || '医生姓名',
  288. level: '', // 接口返回数据中没有该字段
  289. hospital: data.docterVO?.institution || '-',
  290. department: data.docterVO?.department || '-',
  291. taskCount: data.auditTaskInfoVO?.taskCount || '0',
  292. points: data.auditTaskInfoVO?.taskIntegral || '0'
  293. }]
  294. // 更新审批信息
  295. this.approvalInfo = data.auditFlowVO?.map(item => ({
  296. name: item.auditUserName || '审批人',
  297. status: item.statusName || '-',
  298. statusColor: this.getAuditStatusColor(item.status),
  299. time: item.auditTime || ''
  300. })) || []
  301. } else {
  302. uni.showToast({
  303. title: '获取任务详情失败',
  304. icon: 'none'
  305. })
  306. }
  307. } catch (e) {
  308. uni.hideLoading()
  309. console.error('加载数据失败', e)
  310. uni.showToast({
  311. title: '网络错误',
  312. icon: 'none'
  313. })
  314. }
  315. },
  316. getAuditStatusText(status) {
  317. // 根据审核状态获取状态文本
  318. const statusMap = {
  319. 0: '待审核',
  320. 1: '已通过',
  321. 2: '已驳回'
  322. }
  323. return statusMap[status] || '-'
  324. },
  325. getAuditStatusColor(status) {
  326. // 根据审核状态获取状态颜色
  327. const colorMap = {
  328. 1: '#FF9800',
  329. 2: '#4CAF50',
  330. 3: '#F44336'
  331. }
  332. return colorMap[status] || '#999'
  333. },
  334. // 复制到剪贴板
  335. copyToClipboard(text) {
  336. uni.setClipboardData({
  337. data: text,
  338. success() {
  339. uni.showToast({
  340. title: '复制成功',
  341. icon: 'success'
  342. })
  343. }
  344. })
  345. },
  346. // 下载附件
  347. downloadAttachment() {
  348. uni.showToast({
  349. title: '开始下载附件',
  350. icon: 'none'
  351. })
  352. // 实际项目中添加下载逻辑:uni.downloadFile + uni.saveFile
  353. }
  354. }
  355. }
  356. </script>
  357. <style lang="scss" scoped>
  358. .container {
  359. min-height: 100vh;
  360. background: #f5f5f5;
  361. display: flex;
  362. flex-direction: column;
  363. height: auto;
  364. &::before {
  365. content: '';
  366. position: absolute;
  367. top: 0;
  368. left: 0;
  369. right: 0;
  370. width: 100%;
  371. height: 532rpx;
  372. background: linear-gradient(180deg, rgba(56, 139, 255, 0.79) 0%, rgba(56, 139, 255, 0) 100%);
  373. }
  374. }
  375. .top {
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. height: 88rpx;
  380. position: relative;
  381. font-weight: 600;
  382. font-size: 36rpx;
  383. color: #FFFFFF;
  384. .return {
  385. position: absolute;
  386. left: 32rpx;
  387. width: 40rpx;
  388. height: 40rpx;
  389. }
  390. }
  391. .content {
  392. flex: 1;
  393. padding: 24rpx;
  394. box-sizing: border-box;
  395. }
  396. /* 任务卡片样式 */
  397. .task-card {
  398. background: #fff;
  399. border-radius: 16rpx;
  400. padding: 24rpx;
  401. margin-bottom: 24rpx;
  402. .card-header {
  403. .card-title {
  404. font-weight: 500;
  405. font-size: 36rpx;
  406. color: #333333;
  407. margin-bottom: 24rpx;
  408. }
  409. }
  410. .card-meta {
  411. display: flex;
  412. align-items: center;
  413. gap: 16rpx;
  414. font-size: 24rpx;
  415. color: #666;
  416. .meta-tag {
  417. border-radius: 8rpx 8rpx 8rpx 8rpx;
  418. border: 2rpx solid rgba(56, 139, 255, 0.4);
  419. padding: 4rpx 8rpx;
  420. color: #388BFF;
  421. }
  422. }
  423. }
  424. /* 通用信息区块样式 */
  425. .info-section {
  426. background: #fff;
  427. border-radius: 16rpx;
  428. padding: 24rpx;
  429. margin-bottom: 24rpx;
  430. .section-header {
  431. display: flex;
  432. align-items: center;
  433. margin-bottom: 24rpx;
  434. .section-indicator {
  435. width: 6rpx;
  436. height: 32rpx;
  437. background: #388BFF;
  438. border-radius: 3rpx;
  439. margin-right: 16rpx;
  440. }
  441. .section-title {
  442. font-weight: 600;
  443. font-size: 32rpx;
  444. color: #333333;
  445. }
  446. }
  447. .info-list {
  448. .info-item {
  449. display: flex;
  450. margin-bottom: 24rpx;
  451. &:last-child {
  452. margin-bottom: 0;
  453. }
  454. .info-label {
  455. width: 50%;
  456. font-size: 28rpx;
  457. color: #666;
  458. flex-shrink: 0;
  459. }
  460. .info-value {
  461. flex: 1;
  462. text-align: end;
  463. font-size: 28rpx;
  464. color: #333;
  465. }
  466. .copy-btn {
  467. margin-left: 16rpx;
  468. color: #2196F3;
  469. font-size: 24rpx;
  470. cursor: pointer;
  471. }
  472. .column {
  473. flex-direction: column;
  474. }
  475. .attachment-item {
  476. margin-top: 24rpx;
  477. display: flex;
  478. justify-content: space-between;
  479. align-items: center;
  480. gap: 16rpx;
  481. background: #F7F8FA;
  482. border-radius: 16rpx 16rpx 16rpx 16rpx;
  483. .left {
  484. display: flex;
  485. align-items: center;
  486. .img {
  487. width: 72rpx;
  488. height: 72rpx;
  489. margin-right: 24rpx;
  490. }
  491. .txt-item {
  492. .attachment-name {
  493. font-size: 28rpx;
  494. color: #333;
  495. }
  496. .attachment-size {
  497. font-size: 24rpx;
  498. color: #999;
  499. }
  500. }
  501. }
  502. .download-btn {
  503. width: 32rpx;
  504. height: 32rpx;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. /* 客户信息样式 */
  511. .client-list {
  512. .client-item {
  513. display: flex;
  514. justify-content: space-between;
  515. align-items: center;
  516. padding: 16rpx 0;
  517. &:last-child {
  518. border-bottom: none;
  519. }
  520. .client-info {
  521. display: flex;
  522. align-items: center;
  523. .avatar {
  524. width: 88rpx;
  525. height: 88rpx;
  526. margin-right: 24rpx;
  527. }
  528. .client-txt {
  529. .client-name {
  530. font-size: 28rpx;
  531. font-weight: 500;
  532. color: #333;
  533. .client-level {
  534. margin-left: 8rpx;
  535. padding: 2rpx 8rpx;
  536. background: #FFF6E5;
  537. color: #C89743;
  538. font-size: 22rpx;
  539. border-radius: 8rpx;
  540. }
  541. }
  542. }
  543. .client-hospital {
  544. font-size: 24rpx;
  545. color: #666;
  546. margin-top: 4rpx;
  547. display: flex;
  548. align-items: center;
  549. .line {
  550. width: 2rpx;
  551. height: 28rpx;
  552. background: #EAEBEE;
  553. margin: 0 24rpx;
  554. }
  555. }
  556. }
  557. .client-stats {
  558. display: flex;
  559. gap: 24rpx;
  560. font-size: 24rpx;
  561. color: #999999;
  562. .stat-item {
  563. display: flex;
  564. flex-direction: column;
  565. align-items: center;
  566. .num {
  567. font-weight: 500;
  568. font-size: 28rpx;
  569. color: #333333;
  570. }
  571. }
  572. }
  573. }
  574. }
  575. /* 审批信息样式 */
  576. .approval-list {
  577. .approval-item {
  578. position: relative;
  579. padding-left: 24rpx;
  580. margin-bottom: 68rpx;
  581. display: flex;
  582. align-items: center;
  583. justify-content: space-between;
  584. &:last-child {
  585. margin-bottom: 0;
  586. }
  587. .left {
  588. display: flex;
  589. align-items: center;
  590. .avatar-box {
  591. width: 80rpx;
  592. height: 80rpx;
  593. margin-right: 32rpx;
  594. position: relative;
  595. .avatar {
  596. width: 100%;
  597. height: 100%;
  598. }
  599. .icon {
  600. position: absolute;
  601. bottom: 0;
  602. right: 0;
  603. width: 32rpx;
  604. height: 32rpx;
  605. }
  606. }
  607. .approval-user {
  608. gap: 12rpx;
  609. .user-name {
  610. font-weight: 500;
  611. font-size: 28rpx;
  612. color: #333;
  613. }
  614. .user-status {
  615. font-size: 24rpx;
  616. }
  617. }
  618. }
  619. .approval-time {
  620. font-size: 24rpx;
  621. color: #999;
  622. margin-top: 4rpx;
  623. }
  624. }
  625. .approval-line {
  626. position: absolute;
  627. left: 64rpx;
  628. bottom: -64rpx;
  629. width: 1rpx;
  630. height: 56rpx;
  631. background: #BFD8FF;
  632. }
  633. }
  634. .reason {
  635. font-size: 28rpx;
  636. color: #666666;
  637. line-height: 40rpx;
  638. margin-left: 136rpx;
  639. }
  640. </style>