approvalTaskDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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 class="card-lable" :class="taskData.class">{{taskData.status}}</view>
  14. </view>
  15. <view class="card-meta">
  16. <view class="meta-tag">{{ taskData.tag }}</view>
  17. <view class="meta-id">ID:{{ taskData.id }}</view>
  18. </view>
  19. </view>
  20. <!-- 任务信息 -->
  21. <view class="info-section">
  22. <view class="section-header">
  23. <view class="section-indicator"></view>
  24. <text class="section-title">任务信息</text>
  25. </view>
  26. <view class="info-list">
  27. <view class="info-item">
  28. <text class="info-label">任务名称:</text>
  29. <text class="info-value">{{ taskInfo.costSharing }}</text>
  30. </view>
  31. <view class="info-item">
  32. <text class="info-label">任务类型:</text>
  33. <text class="info-value">{{ taskInfo.belongProject }}</text>
  34. </view>
  35. <view class="info-item">
  36. <text class="info-label">归属部门:</text>
  37. <text class="info-value">{{ taskInfo.belongDept }}</text>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 内容信息 -->
  42. <view class="info-section">
  43. <view class="section-header">
  44. <view class="section-indicator"></view>
  45. <text class="section-title">项目信息</text>
  46. </view>
  47. <view class="info-list">
  48. <view class="info-item">
  49. <text class="info-label">项目名称:</text>
  50. <text class="info-value">{{ contentInfo.deliverableName }}</text>
  51. </view>
  52. <view class="info-item">
  53. <text class="info-label">项目活动ID:</text>
  54. <text class="info-value">{{ contentInfo.deliverableId }}</text>
  55. </view>
  56. <view class="info-item">
  57. <text class="info-label">项目备注:</text>
  58. <text class="info-value">{{ contentInfo.description }}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 客户信息 -->
  63. <view class="info-section">
  64. <view class="section-header">
  65. <view class="section-indicator"></view>
  66. <text class="section-title">客户信息</text>
  67. </view>
  68. <view class="client-list">
  69. <view class="client-item" v-for="(item, index) in clientList" :key="index">
  70. <view class="client-info">
  71. <image class="avatar" src="/static/image/my_heads_icon.png"></image>
  72. <view class="client-txt">
  73. <view class="client-name">
  74. {{ item.name }}
  75. <text class="client-level">{{ item.level }}</text>
  76. </view>
  77. <view class="client-hospital">
  78. <text>{{ item.hospital }} </text>
  79. <view class="line"></view>
  80. <text>{{ item.department }}</text>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="client-stats">
  85. <view class="stat-item"><text class="num">{{ item.taskCount }} </text>任务</view>
  86. <view class="stat-item"><text class="num">{{ item.points }} </text>积分</view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 审批信息 -->
  92. <view class="info-section">
  93. <view class="section-header">
  94. <view class="section-indicator"></view>
  95. <text class="section-title">审批信息</text>
  96. </view>
  97. <view class="approval-list">
  98. <view class="approval-item" v-for="(item, index) in approvalInfo" :key="index">
  99. <view class="left">
  100. <view class="avatar-box">
  101. <image class="avatar" src="/static/image/my_heads_icon.png"></image>
  102. <image class="icon" src="/static/image/icon_wait.png"></image>
  103. </view>
  104. <view class="approval-user">
  105. <view class="user-name">{{ item.name }}</view>
  106. <view class="user-status" :style="{ color: item.statusColor }">{{ item.status }}</view>
  107. </view>
  108. </view>
  109. <text class="approval-time">{{ item.time }}</text>
  110. <view class="approval-line" v-if="index < approvalInfo.length - 1"></view>
  111. </view>
  112. </view>
  113. <view class="reason">
  114. 费用分摊部门填写错误,应该是学术研究事业部,请修改后重新提交。
  115. </view>
  116. </view>
  117. </scroll-view>
  118. <view class="bottom-bar">
  119. <view class="action-buttons">
  120. <view class="btn btn-cancel" @click="openRejectPopup">
  121. <image class="icon" src="/static/image/icon_approval_no.png"></image>
  122. <text>驳回</text>
  123. </view>
  124. <view class="btn btn-submit" @click="handleNext">
  125. <image class="icon" src="/static/image/icon_approval_yes.png"></image>
  126. <text>通过</text>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 驳回弹窗 -->
  131. <u-popup :show="showRejectPopup" mode="bottom" border-radius="24" z-index="9999999">
  132. <view class="reject-popup-content">
  133. <view class="popup-header">
  134. <text class="popup-title">驳回</text>
  135. <u-icon name="close" size="20" @click="showRejectPopup = false" />
  136. </view>
  137. <view class="input-area">
  138. <textarea v-model="rejectReason" placeholder="请输入驳回意见" class="reason-input" :auto-height="true"
  139. maxlength="200" />
  140. </view>
  141. <view class="btn-group">
  142. <u-button text="取消" plain color="#388BFF" class="cancel-btn" @click="showRejectPopup = false" />
  143. <u-button text="确认驳回" type="primary" class="confirm-btn" @click="handleConfirmReject" />
  144. </view>
  145. </view>
  146. </u-popup>
  147. </view>
  148. </template>
  149. <script>
  150. export default {
  151. data() {
  152. return {
  153. // 修改5:弹窗默认隐藏
  154. showRejectPopup: true,
  155. // 驳回意见
  156. rejectReason: '',
  157. // 仅获取微信小程序状态栏高度,无多余逻辑
  158. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  159. taskId: '',
  160. // 任务基础信息
  161. taskData: {
  162. title: '王小明医师学术讲座',
  163. tag: '学术讲座',
  164. id: 'CRW0000001022345',
  165. class: 'pending',
  166. status: '待审核'
  167. },
  168. // 任务信息
  169. taskInfo: {
  170. costSharing: '湖北省药学服务公司',
  171. belongProject: '项目名称',
  172. belongDept: '中药事业部',
  173. belongProduct: '201',
  174. applySupplementLive: '否',
  175. supplementRoomId: '-',
  176. supplementReason: '-'
  177. },
  178. // 内容信息
  179. contentInfo: {
  180. deliverableName: '直播',
  181. deliverableId: '-',
  182. liveRoomUrl: 'http://www.zhibotest123333...',
  183. pushUrl: 'http://www.zhibotest123123...',
  184. startUrl: 'http://www.zhibotest123123...',
  185. liveReplay: '-',
  186. playVideo: '-',
  187. downloadVideo: '-',
  188. viewerCount: '203',
  189. validView: '198',
  190. description: '这是一段说明,这是一段说明,一行展示不完就换行展示。'
  191. },
  192. // 客户信息列表
  193. clientList: [{
  194. name: '王小明',
  195. level: '一级',
  196. hospital: '湖南省人民医院',
  197. department: '口腔科',
  198. taskCount: '1',
  199. points: '30'
  200. },
  201. {
  202. name: '王小明',
  203. level: '一级',
  204. hospital: '湖南省人民医院',
  205. department: '口腔科',
  206. taskCount: '1',
  207. points: '30'
  208. }
  209. ],
  210. // 补充材料
  211. supplementMaterial: {
  212. deliverableName: '-',
  213. description: '-',
  214. attachment: {
  215. name: '文件名称文件名称.pdf',
  216. size: '128kb'
  217. }
  218. },
  219. // 审批信息
  220. approvalInfo: [{
  221. name: '王彬彬',
  222. status: '发起申请',
  223. statusColor: '#4CAF50',
  224. time: '2025-03-04 18:00'
  225. },
  226. {
  227. name: '王小明',
  228. status: '待审核',
  229. statusColor: '#FF9800',
  230. time: ''
  231. }
  232. ]
  233. }
  234. },
  235. onLoad(options) {
  236. if (options.id) {
  237. this.taskId = options.id
  238. this.loadData()
  239. }
  240. },
  241. methods: {
  242. // 修改6:新增打开弹窗的方法
  243. openRejectPopup() {
  244. this.showRejectPopup = true;
  245. },
  246. // 确认驳回
  247. handleConfirmReject() {
  248. if (!this.rejectReason.trim()) {
  249. uni.showToast({
  250. title: '请输入驳回意见',
  251. icon: 'none'
  252. })
  253. return
  254. }
  255. // 这里写你的驳回接口逻辑
  256. console.log('提交驳回意见:', this.rejectReason)
  257. // 关闭弹窗
  258. this.showRejectPopup = false
  259. // 重置输入
  260. this.rejectReason = ''
  261. },
  262. goBack() {
  263. uni.navigateBack()
  264. },
  265. async loadData() {
  266. try {
  267. uni.showLoading({
  268. title: '加载中...'
  269. })
  270. // 实际项目中替换为接口请求:const res = await getTaskDetail({ id: this.taskId })
  271. // 这里模拟接口赋值
  272. uni.hideLoading()
  273. } catch (e) {
  274. uni.hideLoading()
  275. console.error('加载数据失败', e)
  276. }
  277. },
  278. // 复制到剪贴板
  279. copyToClipboard(text) {
  280. uni.setClipboardData({
  281. data: text,
  282. success() {
  283. uni.showToast({
  284. title: '复制成功',
  285. icon: 'success'
  286. })
  287. }
  288. })
  289. },
  290. // 下载附件
  291. downloadAttachment() {
  292. uni.showToast({
  293. title: '开始下载附件',
  294. icon: 'none'
  295. })
  296. // 实际项目中添加下载逻辑:uni.downloadFile + uni.saveFile
  297. },
  298. // 修改7:补全handlePrev(备用,实际用openRejectPopup)
  299. handlePrev() {
  300. this.openRejectPopup();
  301. },
  302. // 补全handleNext方法(避免点击报错)
  303. handleNext() {
  304. uni.showToast({
  305. title: '审批通过逻辑待实现',
  306. icon: 'none'
  307. })
  308. }
  309. }
  310. }
  311. </script>
  312. <style lang="scss" scoped>
  313. // 弹窗样式
  314. .reject-popup-content {
  315. padding: 32rpx;
  316. box-sizing: border-box;
  317. background: #fff;
  318. overflow: hidden;
  319. .popup-header {
  320. display: flex;
  321. justify-content: space-between;
  322. align-items: center;
  323. margin-bottom: 32rpx;
  324. .popup-title {
  325. font-size: 32rpx;
  326. font-weight: bold;
  327. color: #333;
  328. }
  329. }
  330. .input-area {
  331. margin-bottom: 40rpx;
  332. .reason-input {
  333. min-height: 120rpx;
  334. padding: 20rpx;
  335. background: #F7F8FA;
  336. border-radius: 12rpx;
  337. font-size: 28rpx;
  338. color: #333;
  339. width: 100%; // 新增:确保输入框宽度100%
  340. box-sizing: border-box;
  341. }
  342. }
  343. .btn-group {
  344. display: flex;
  345. gap: 24rpx;
  346. .cancel-btn,
  347. .confirm-btn {
  348. flex: 1;
  349. height: 80rpx;
  350. border-radius: 200rpx;
  351. font-size: 28rpx;
  352. }
  353. }
  354. }
  355. // 原有样式
  356. .container {
  357. min-height: 100vh;
  358. background: #f5f5f5;
  359. display: flex;
  360. flex-direction: column;
  361. height: auto;
  362. &::before {
  363. content: '';
  364. position: absolute;
  365. top: 0;
  366. left: 0;
  367. right: 0;
  368. width: 100%;
  369. height: 532rpx;
  370. background: linear-gradient(180deg, rgba(56, 139, 255, 0.79) 0%, rgba(56, 139, 255, 0) 100%);
  371. }
  372. }
  373. .top {
  374. display: flex;
  375. justify-content: center;
  376. align-items: center;
  377. height: 88rpx;
  378. position: relative;
  379. font-weight: 600;
  380. font-size: 36rpx;
  381. color: #FFFFFF;
  382. .return {
  383. position: absolute;
  384. left: 32rpx;
  385. width: 40rpx;
  386. height: 40rpx;
  387. }
  388. }
  389. .content {
  390. flex: 1;
  391. padding: 24rpx;
  392. box-sizing: border-box;
  393. padding-bottom: 200rpx;
  394. }
  395. /* 任务卡片样式 */
  396. .task-card {
  397. background: #fff;
  398. border-radius: 16rpx;
  399. padding: 24rpx;
  400. margin-bottom: 24rpx;
  401. .card-header {
  402. display: flex;
  403. justify-content: space-between;
  404. .card-title {
  405. font-weight: 500;
  406. font-size: 36rpx;
  407. color: #333333;
  408. margin-bottom: 24rpx;
  409. }
  410. .card-lable {
  411. height: 40rpx;
  412. box-sizing: border-box;
  413. padding: 4rpx 12rpx;
  414. font-size: 24rpx;
  415. border-radius: 8rpx;
  416. &.pending {
  417. background: #FEF8E3;
  418. color: #DE9B14;
  419. }
  420. &.reject {
  421. background: #FFF4F5;
  422. color: #CF3546;
  423. }
  424. &.pass {
  425. color: #07C160;
  426. background: #E6FAEF;
  427. }
  428. }
  429. }
  430. .card-meta {
  431. display: flex;
  432. align-items: center;
  433. gap: 16rpx;
  434. font-size: 24rpx;
  435. color: #666;
  436. .meta-tag {
  437. border-radius: 8rpx 8rpx 8rpx 8rpx;
  438. border: 2rpx solid rgba(56, 139, 255, 0.4);
  439. padding: 4rpx 8rpx;
  440. color: #388BFF;
  441. }
  442. }
  443. }
  444. /* 通用信息区块样式 */
  445. .info-section {
  446. background: #fff;
  447. border-radius: 16rpx;
  448. padding: 24rpx;
  449. margin-bottom: 24rpx;
  450. .section-header {
  451. display: flex;
  452. align-items: center;
  453. margin-bottom: 24rpx;
  454. .section-indicator {
  455. width: 6rpx;
  456. height: 32rpx;
  457. background: #388BFF;
  458. border-radius: 3rpx;
  459. margin-right: 16rpx;
  460. }
  461. .section-title {
  462. font-weight: 600;
  463. font-size: 32rpx;
  464. color: #333333;
  465. }
  466. }
  467. .info-list {
  468. .info-item {
  469. display: flex;
  470. margin-bottom: 24rpx;
  471. &:last-child {
  472. margin-bottom: 0;
  473. }
  474. .info-label {
  475. width: 50%;
  476. font-size: 28rpx;
  477. color: #666;
  478. flex-shrink: 0;
  479. }
  480. .info-value {
  481. flex: 1;
  482. text-align: end;
  483. font-size: 28rpx;
  484. color: #333;
  485. }
  486. .copy-btn {
  487. margin-left: 16rpx;
  488. color: #2196F3;
  489. font-size: 24rpx;
  490. cursor: pointer;
  491. }
  492. .column {
  493. flex-direction: column;
  494. }
  495. .attachment-item {
  496. margin-top: 24rpx;
  497. display: flex;
  498. justify-content: space-between;
  499. align-items: center;
  500. gap: 16rpx;
  501. background: #F7F8FA;
  502. border-radius: 16rpx 16rpx 16rpx 16rpx;
  503. .left {
  504. display: flex;
  505. align-items: center;
  506. .img {
  507. width: 72rpx;
  508. height: 72rpx;
  509. margin-right: 24rpx;
  510. }
  511. .txt-item {
  512. .attachment-name {
  513. font-size: 28rpx;
  514. color: #333;
  515. }
  516. .attachment-size {
  517. font-size: 24rpx;
  518. color: #999;
  519. }
  520. }
  521. }
  522. .download-btn {
  523. width: 32rpx;
  524. height: 32rpx;
  525. }
  526. }
  527. }
  528. }
  529. }
  530. /* 客户信息样式 */
  531. .client-list {
  532. .client-item {
  533. display: flex;
  534. justify-content: space-between;
  535. align-items: center;
  536. padding: 16rpx 0;
  537. &:last-child {
  538. border-bottom: none;
  539. }
  540. .client-info {
  541. display: flex;
  542. align-items: center;
  543. .avatar {
  544. width: 88rpx;
  545. height: 88rpx;
  546. margin-right: 24rpx;
  547. }
  548. .client-txt {
  549. .client-name {
  550. font-size: 28rpx;
  551. font-weight: 500;
  552. color: #333;
  553. .client-level {
  554. margin-left: 8rpx;
  555. padding: 2rpx 8rpx;
  556. background: #FFF6E5;
  557. color: #C89743;
  558. font-size: 22rpx;
  559. border-radius: 8rpx;
  560. }
  561. }
  562. }
  563. .client-hospital {
  564. font-size: 24rpx;
  565. color: #666;
  566. margin-top: 4rpx;
  567. display: flex;
  568. align-items: center;
  569. .line {
  570. width: 2rpx;
  571. height: 28rpx;
  572. background: #EAEBEE;
  573. margin: 0 24rpx;
  574. }
  575. }
  576. }
  577. .client-stats {
  578. display: flex;
  579. gap: 24rpx;
  580. font-size: 24rpx;
  581. color: #999999;
  582. .stat-item {
  583. display: flex;
  584. flex-direction: column;
  585. align-items: center;
  586. .num {
  587. font-weight: 500;
  588. font-size: 28rpx;
  589. color: #333333;
  590. }
  591. }
  592. }
  593. }
  594. }
  595. /* 审批信息样式 */
  596. .approval-list {
  597. .approval-item {
  598. position: relative;
  599. padding-left: 24rpx;
  600. margin-bottom: 68rpx;
  601. display: flex;
  602. align-items: center;
  603. justify-content: space-between;
  604. &:last-child {
  605. margin-bottom: 0;
  606. }
  607. .left {
  608. display: flex;
  609. align-items: center;
  610. .avatar-box {
  611. width: 80rpx;
  612. height: 80rpx;
  613. margin-right: 32rpx;
  614. position: relative;
  615. .avatar {
  616. width: 100%;
  617. height: 100%;
  618. }
  619. .icon {
  620. position: absolute;
  621. bottom: 0;
  622. right: 0;
  623. width: 32rpx;
  624. height: 32rpx;
  625. }
  626. }
  627. .approval-user {
  628. gap: 12rpx;
  629. .user-name {
  630. font-weight: 500;
  631. font-size: 28rpx;
  632. color: #333;
  633. }
  634. .user-status {
  635. font-size: 24rpx;
  636. }
  637. }
  638. }
  639. .approval-time {
  640. font-size: 24rpx;
  641. color: #999;
  642. margin-top: 4rpx;
  643. }
  644. }
  645. .approval-line {
  646. position: absolute;
  647. left: 64rpx;
  648. bottom: -64rpx;
  649. width: 1rpx;
  650. height: 56rpx;
  651. background: #BFD8FF;
  652. }
  653. }
  654. .reason {
  655. font-size: 28rpx;
  656. color: #666666;
  657. line-height: 40rpx;
  658. margin-left: 136rpx;
  659. background: #F7F8FA;
  660. border-radius: 16rpx;
  661. line-height: 40rpx;
  662. padding: 20rpx;
  663. }
  664. .bottom-bar {
  665. position: fixed;
  666. bottom: 0;
  667. left: 0;
  668. right: 0;
  669. background: #fff;
  670. padding: 24rpx 32rpx;
  671. border-top: 1rpx solid #F2F3F5;
  672. z-index: 100;
  673. display: flex;
  674. align-items: center;
  675. .action-buttons {
  676. display: flex;
  677. flex: 1;
  678. justify-content: space-between;
  679. .btn {
  680. width: 292rpx;
  681. height: 88rpx;
  682. display: flex;
  683. align-items: center;
  684. justify-content: center;
  685. font-size: 32rpx;
  686. font-weight: 500;
  687. border-radius: 200rpx 200rpx 200rpx 200rpx;
  688. cursor: pointer;
  689. display: flex;
  690. align-items: center;
  691. &.btn-cancel {
  692. background: #fff;
  693. border: 2rpx solid #CF3546;
  694. color: #CF3546;
  695. }
  696. &.btn-submit {
  697. background: #388BFF;
  698. color: #fff;
  699. }
  700. .icon {
  701. width: 32rpx;
  702. height: 32rpx;
  703. margin-right: 16rpx;
  704. }
  705. }
  706. }
  707. }
  708. </style>