approvalCenter.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <template>
  2. <view class="container">
  3. <!-- 搜索+筛选栏 -->
  4. <view class="top-box">
  5. <view class="input-item">
  6. <image class="icon search-icon" src="@/static/image/search.png" mode="widthFix"></image>
  7. <input placeholder="请输入发起人姓名、手机号" placeholder-class="placeholder" />
  8. </view>
  9. </view>
  10. <!-- 顶部选项卡 -->
  11. <view class="top-tabs">
  12. <view class="top-tab-item" :class="{ active: currentTopTab === index }" @click="switchTopTab(index)"
  13. v-for="(item, index) in topTabs" :key="index">
  14. {{ item.label }}·{{ item.badge }}
  15. </view>
  16. </view>
  17. <!-- 核心修改:新增子标签容器,作为popup-box的定位参考 -->
  18. <view class="sub-tabs-wrapper">
  19. <!-- 动态子标签 -->
  20. <view class="sub-tabs">
  21. <view class="sub-tab-item" :class="{ active: currentSubTab === item.value }" @click="popShow = !popShow"
  22. v-for="(item, index) in currentSubTabsList" :key="index">
  23. <text>{{ item.label }}</text>
  24. <image class="icon" src="/static/image/icon_expand.png" mode="widthFix"></image>
  25. </view>
  26. </view>
  27. <!-- 动态子标签弹窗:相对于sub-tabs-wrapper定位 -->
  28. <view class="popup-box" v-if="popShow">
  29. <view class="item" v-for="(item, index) in tabsList" :key="index">
  30. {{item}}
  31. </view>
  32. </view>
  33. </view>
  34. <!-- popup遮罩层 - 仅在popShow为true时显示 -->
  35. <view class="popup-mask" v-if="popShow"></view>
  36. <!-- 列表内容 -->
  37. <scroll-view class="content" scroll-y>
  38. <view class="task-card" v-for="(item, index) in currentList" :key="index" @click="goDetails(item)">
  39. <!-- 任务/审核标题+状态 -->
  40. <view class="card-top">
  41. <text class="card-task-title">{{ item.taskTitle }}</text>
  42. <view class="status-tag" :class="item.statusClass">{{ item.statusText }}</view>
  43. </view>
  44. <view class="card-content">
  45. <!-- 时间信息 -->
  46. <view class="time-info">
  47. <view class="time-item">
  48. <text class="title">任务名称:</text>
  49. <text>王小明医师问卷调查任务</text>
  50. </view>
  51. <!-- 改为判断index:0对应待办 -->
  52. <view class="time-item" v-if="currentTopTab === 0">
  53. <text class="title">任务类型:</text>
  54. <text>问卷调查</text>
  55. </view>
  56. </view>
  57. <!-- 操作按钮:改为判断index:0对应待办 -->
  58. <view class="operate-btn-group" v-if="currentTopTab === 0">
  59. <view class="share-btn" @click="handleShare(item)">
  60. <image class="share-icon" src="/static/image/icon_user.png" mode="widthFix"></image>
  61. <text>王彬彬</text>
  62. </view>
  63. <view class="date">
  64. 2025-12-24 20:57
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. <!-- 筛选弹窗 -->
  71. <view class="filter-popup" v-if="showFilter" @click="closeFilter">
  72. <view class="filter-content" @click.stop>
  73. <view class="filter-header">
  74. <view class="filter-title">筛选</view>
  75. <image class="filter-close-btn" src="@/static/image/icon_close.png" @click="closeFilter"
  76. mode="widthFix"></image>
  77. </view>
  78. <view class="filter-form">
  79. <!-- 任务申请时间 -->
  80. <view class="filter-section">
  81. <view class="section-label">任务申请时间</view>
  82. <view class="time-range">
  83. <input class="time-input" placeholder="开始时间" v-model="filters.applyTimeStart" />
  84. <view class="time-separator">-</view>
  85. <input class="time-input" placeholder="结束时间" v-model="filters.applyTimeEnd" />
  86. </view>
  87. </view>
  88. <!-- 任务完成时间:改为判断index:1对应已办 -->
  89. <view class="filter-section" v-if="currentTopTab === 1">
  90. <view class="section-label">任务完成时间</view>
  91. <view class="time-range">
  92. <input class="time-input" placeholder="开始时间" v-model="filters.finishTimeStart" />
  93. <view class="time-separator">-</view>
  94. <input class="time-input" placeholder="结束时间" v-model="filters.finishTimeEnd" />
  95. </view>
  96. </view>
  97. <!-- 完成审核时间:改为判断index:1对应已办 -->
  98. <view class="filter-section" v-if="currentTopTab === 1">
  99. <view class="section-label">完成审核时间</view>
  100. <view class="time-range">
  101. <input class="time-input" placeholder="开始时间" v-model="filters.auditTimeStart" />
  102. <view class="time-separator">-</view>
  103. <input class="time-input" placeholder="结束时间" v-model="filters.auditTimeEnd" />
  104. </view>
  105. </view>
  106. <!-- 任务归属 -->
  107. <view class="filter-section">
  108. <view class="section-label">任务归属</view>
  109. <view class="btn-group">
  110. <view class="filter-btn" :class="{ active: filters.taskBelong === 'my' }"
  111. @click="filters.taskBelong = 'my'">我的任务</view>
  112. <view class="filter-btn" :class="{ active: filters.taskBelong === 'dept' }"
  113. @click="filters.taskBelong = 'dept'">部门任务</view>
  114. </view>
  115. </view>
  116. <!-- 完结状态:改为判断index:1对应已办 -->
  117. <view class="filter-section" v-if="currentTopTab === 1">
  118. <view class="section-label">完结状态</view>
  119. <view class="btn-group">
  120. <view class="filter-btn" :class="{ active: filters.finishStatus === 'unfinished' }"
  121. @click="filters.finishStatus = 'unfinished'">未完结</view>
  122. <view class="filter-btn" :class="{ active: filters.finishStatus === 'finished' }"
  123. @click="filters.finishStatus = 'finished'">已完结</view>
  124. </view>
  125. </view>
  126. <!-- 归属类型 -->
  127. <view class="filter-section">
  128. <view class="section-label">归属类型</view>
  129. <view class="btn-group">
  130. <view class="filter-btn" :class="{ active: filters.belongType === 'inner' }"
  131. @click="filters.belongType = 'inner'">院内</view>
  132. <view class="filter-btn" :class="{ active: filters.belongType === 'outer' }"
  133. @click="filters.belongType = 'outer'">院外</view>
  134. </view>
  135. </view>
  136. </view>
  137. <view class="filter-actions">
  138. <view class="reset-btn" @click="resetFilters">重置</view>
  139. <view class="confirm-btn" @click="confirmFilters">确定</view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </template>
  145. <script>
  146. export default {
  147. data() {
  148. return {
  149. popShow: false,
  150. showFilter: false,
  151. filters: {
  152. applyTimeStart: '',
  153. applyTimeEnd: '',
  154. finishTimeStart: '',
  155. finishTimeEnd: '',
  156. auditTimeStart: '',
  157. auditTimeEnd: '',
  158. taskBelong: 'my',
  159. finishStatus: '',
  160. belongType: ''
  161. },
  162. // 顶部选项卡数组
  163. topTabs: [{
  164. label: '待办',
  165. value: 'todo',
  166. badge: 1
  167. },
  168. {
  169. label: '已办',
  170. value: 'done',
  171. badge: 22
  172. },
  173. {
  174. label: '我发起的',
  175. value: 'myInitiate',
  176. badge: 19
  177. }
  178. ],
  179. currentTopTab: 0,
  180. currentSubTab: 'all',
  181. // 子标签数组
  182. taskSubTabs: [{
  183. label: '全部审批',
  184. value: 'all'
  185. },
  186. {
  187. label: '最新发起',
  188. value: 'unfinished'
  189. }
  190. ],
  191. tabsList: ['全部审批', '任务创建'],
  192. tabsList2: ['最新发起', '最早发起'],
  193. auditSubTabs: [{
  194. label: '全部',
  195. value: 'all'
  196. },
  197. {
  198. label: '驳回',
  199. value: 'rejected'
  200. }
  201. ],
  202. // 列表数据
  203. todoList: [{ // 待办列表(index=0)
  204. taskTitle: '任务创建',
  205. statusText: '待审核',
  206. statusClass: 'status-createPending',
  207. speaker: '王小明',
  208. level: '一级',
  209. hospital: '湖南省人民医院',
  210. department: '口腔科',
  211. videoType: '长视频',
  212. category: '学术',
  213. points: 10,
  214. count: 1,
  215. applyTime: '2025-9-20 13:55',
  216. finishTime: '-',
  217. auditStatus: '-',
  218. showDelete: true,
  219. sealImg: '/static/image/img_unfinish.png'
  220. }],
  221. doneList: [{ // 已办列表(index=1)
  222. taskTitle: '任务创建',
  223. statusText: '创建驳回',
  224. statusClass: 'status-createPending',
  225. speaker: '王小明',
  226. level: '一级',
  227. hospital: '湖南省人民医院',
  228. department: '口腔科',
  229. videoType: '长视频',
  230. category: '学术',
  231. points: 10,
  232. count: 1,
  233. applyTime: '2025-9-20 13:55',
  234. showDelete: true,
  235. showEdit: true
  236. }],
  237. myInitiateList: [] // 我发起的列表(index=2)
  238. }
  239. },
  240. computed: {
  241. currentSubTabsList() {
  242. if (this.currentTopTab === 0) return this.taskSubTabs;
  243. if (this.currentTopTab === 1) return this.auditSubTabs;
  244. if (this.currentTopTab === 2) return this.taskSubTabs;
  245. },
  246. currentList() {
  247. if (this.currentTopTab === 0) return this.todoList;
  248. if (this.currentTopTab === 1) return this.doneList;
  249. if (this.currentTopTab === 2) return this.myInitiateList;
  250. }
  251. },
  252. methods: {
  253. goDetails(item) {
  254. console.log("跳转")
  255. uni.navigateTo({
  256. url: '/pages_task/approvalTaskDetail'
  257. })
  258. },
  259. switchTopTab(index) {
  260. this.currentTopTab = index;
  261. this.currentSubTab = 'all';
  262. // 切换顶部选项卡时关闭popup
  263. this.popShow = false;
  264. },
  265. closeFilter() {
  266. this.showFilter = false
  267. },
  268. resetFilters() {
  269. this.filters = {
  270. applyTimeStart: '',
  271. applyTimeEnd: '',
  272. finishTimeStart: '',
  273. finishTimeEnd: '',
  274. auditTimeStart: '',
  275. auditTimeEnd: '',
  276. taskBelong: 'my',
  277. finishStatus: '',
  278. belongType: ''
  279. }
  280. },
  281. confirmFilters() {
  282. this.showFilter = false
  283. console.log('筛选条件:', this.filters)
  284. },
  285. handleShare(item) {
  286. uni.showToast({
  287. title: '分享功能待实现',
  288. icon: 'none'
  289. })
  290. },
  291. handleTaskDelete(item, index) {
  292. uni.showModal({
  293. title: '提示',
  294. content: '确定要删除这条任务吗?',
  295. cancelText: '取消',
  296. confirmText: '删除',
  297. confirmColor: '#FF0000',
  298. success: (res) => {
  299. if (res.confirm) {
  300. this.todoList.splice(index, 1);
  301. uni.showToast({
  302. title: '任务已删除',
  303. icon: 'success',
  304. duration: 1500
  305. });
  306. }
  307. }
  308. });
  309. },
  310. handleCopy(item) {
  311. uni.showToast({
  312. title: '复制创建功能待实现',
  313. icon: 'none'
  314. })
  315. },
  316. handleAuditDelete(item, index) {
  317. uni.showModal({
  318. title: '提示',
  319. content: '确定要删除这条审核项吗?',
  320. cancelText: '取消',
  321. confirmText: '删除',
  322. confirmColor: '#FF0000',
  323. success: (res) => {
  324. if (res.confirm) {
  325. this.doneList.splice(index, 1);
  326. uni.showToast({
  327. title: '审核项已删除',
  328. icon: 'success',
  329. duration: 1500
  330. });
  331. }
  332. }
  333. });
  334. },
  335. handleEdit(item) {
  336. uni.showToast({
  337. title: '编辑功能待实现',
  338. icon: 'none'
  339. })
  340. }
  341. }
  342. }
  343. </script>
  344. <style lang="scss" scoped>
  345. .container {
  346. min-height: 100vh;
  347. background: #F7F8FA;
  348. position: relative;
  349. // 搜索栏
  350. .top-box {
  351. padding: 20rpx 32rpx;
  352. display: flex;
  353. align-items: center;
  354. background: #fff;
  355. position: relative;
  356. z-index: 101;
  357. .input-item {
  358. display: flex;
  359. align-items: center;
  360. flex: 1;
  361. height: 72rpx;
  362. background: #F7F8FA;
  363. border-radius: 38rpx;
  364. .search-icon {
  365. width: 26rpx;
  366. height: 26rpx;
  367. margin: 0 10rpx 0 28rpx;
  368. }
  369. input {
  370. flex: 1;
  371. font-size: 28rpx;
  372. color: #333;
  373. }
  374. }
  375. }
  376. // 顶部选项卡
  377. .top-tabs {
  378. display: flex;
  379. background: #fff;
  380. position: relative;
  381. z-index: 101;
  382. .top-tab-item {
  383. flex: 1;
  384. text-align: center;
  385. padding: 24rpx 0;
  386. font-size: 28rpx;
  387. color: #999;
  388. transition: all 0.2s;
  389. &.active {
  390. color: #333;
  391. font-weight: 500;
  392. position: relative;
  393. &::after {
  394. content: '';
  395. position: absolute;
  396. bottom: 0;
  397. left: 50%;
  398. transform: translateX(-50%);
  399. border-radius: 3rpx;
  400. width: 80rpx;
  401. height: 6rpx;
  402. background: #388BFF;
  403. }
  404. }
  405. }
  406. }
  407. // popup遮罩层
  408. .popup-mask {
  409. position: fixed; // 全屏遮罩
  410. top: 0;
  411. left: 0;
  412. right: 0;
  413. bottom: 0;
  414. background: rgba(0, 0, 0, 0.3);
  415. z-index: 99; // 低于子标签容器,高于列表
  416. }
  417. // 核心修改:子标签容器(定位参考)
  418. .sub-tabs-wrapper {
  419. position: relative; // 作为popup-box的定位参考
  420. z-index: 101; // 确保在遮罩层之上
  421. // 子标签栏
  422. .sub-tabs {
  423. display: flex;
  424. justify-content: space-between;
  425. background: #fff;
  426. padding: 16rpx 32rpx;
  427. gap: 24rpx;
  428. .sub-tab-item {
  429. flex: 1;
  430. height: 64rpx;
  431. display: flex;
  432. border-radius: 70rpx;
  433. border: 2rpx solid #F2F2F2;
  434. justify-content: center;
  435. align-items: center;
  436. font-size: 28rpx;
  437. color: #666;
  438. transition: all 0.2s;
  439. .icon {
  440. width: 28rpx;
  441. height: 28rpx;
  442. margin-left: 12rpx;
  443. }
  444. }
  445. }
  446. // 核心修改:popup-box绝对定位,相对于sub-tabs-wrapper
  447. .popup-box {
  448. position: absolute;
  449. top: 100%; // 紧贴sub-tabs底部
  450. left: 0;
  451. right: 0;
  452. display: flex;
  453. padding: 32rpx;
  454. background: #FFFFFF;
  455. border-radius: 0 0 40rpx 40rpx;
  456. z-index: 100; // 高于遮罩层
  457. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); // 增加阴影提升层级感
  458. .item {
  459. padding: 14rpx 32rpx;
  460. height: 72rpx;
  461. box-sizing: border-box;
  462. background: #F7F8FA;
  463. border-radius: 70rpx;
  464. font-size: 28rpx;
  465. color: #333;
  466. flex-wrap: wrap;
  467. margin-right: 24rpx;
  468. &:last-child {
  469. margin-right: 0;
  470. }
  471. }
  472. }
  473. }
  474. // 列表区域
  475. .content {
  476. padding: 24rpx;
  477. box-sizing: border-box;
  478. min-height: calc(100vh - 300rpx);
  479. position: relative;
  480. z-index: 98; // 低于遮罩层
  481. .task-card {
  482. background: #fff;
  483. border-radius: 24rpx;
  484. margin-bottom: 20rpx;
  485. border: 2rpx solid #E9F2FF;
  486. position: relative;
  487. padding-bottom: 24rpx;
  488. .card-top {
  489. display: flex;
  490. justify-content: space-between;
  491. align-items: center;
  492. background: linear-gradient(90deg, #E8F1FF 0%, #FFFFFF 100%);
  493. border-radius: 24rpx 24rpx 0 0;
  494. padding: 26rpx 24rpx;
  495. margin-bottom: 16rpx;
  496. .card-task-title {
  497. font-size: 32rpx;
  498. font-weight: 600;
  499. color: #333;
  500. }
  501. .status-tag {
  502. padding: 8rpx 16rpx;
  503. border-radius: 20rpx;
  504. font-size: 24rpx;
  505. &.status-wait {
  506. background: #E3F2FD;
  507. color: #2196F3;
  508. }
  509. &.status-finish {
  510. background: #E6FAEF;
  511. color: #07C160;
  512. }
  513. &.status-rejected {
  514. background: #FFF4F5;
  515. color: #CF3546;
  516. }
  517. &.status-createPending {
  518. background: #FFF8E6;
  519. color: #FF9500;
  520. }
  521. }
  522. }
  523. .card-content {
  524. padding: 0 24rpx;
  525. .time-info {
  526. font-size: 28rpx;
  527. color: #666;
  528. display: flex;
  529. flex-direction: column;
  530. gap: 8rpx;
  531. margin-bottom: 24rpx;
  532. .time-item {
  533. display: flex;
  534. font-size: 28rpx;
  535. color: #333;
  536. .title {
  537. color: #666;
  538. }
  539. }
  540. }
  541. .operate-btn-group {
  542. display: flex;
  543. align-items: center;
  544. justify-content: space-between;
  545. .share-btn {
  546. display: flex;
  547. align-items: center;
  548. font-size: 28rpx;
  549. color: #666;
  550. .share-icon {
  551. width: 36rpx;
  552. height: 36rpx;
  553. margin-right: 8rpx;
  554. }
  555. }
  556. .date {
  557. font-size: 24rpx;
  558. color: #999;
  559. }
  560. }
  561. }
  562. }
  563. }
  564. // 筛选弹窗
  565. .filter-popup {
  566. position: fixed;
  567. top: 0;
  568. left: 0;
  569. right: 0;
  570. bottom: 0;
  571. background: rgba(0, 0, 0, 0.5);
  572. z-index: 999;
  573. display: flex;
  574. align-items: flex-end;
  575. .filter-content {
  576. width: 100%;
  577. background: #fff;
  578. border-radius: 24rpx 24rpx 0 0;
  579. padding: 32rpx;
  580. .filter-header {
  581. display: flex;
  582. align-items: center;
  583. justify-content: center;
  584. margin-bottom: 32rpx;
  585. position: relative;
  586. .filter-title {
  587. font-size: 32rpx;
  588. font-weight: bold;
  589. color: #333;
  590. }
  591. .filter-close-btn {
  592. position: absolute;
  593. right: 0;
  594. width: 44rpx;
  595. height: 44rpx;
  596. }
  597. }
  598. .filter-form {
  599. padding: 0 0 24rpx 0;
  600. .filter-section {
  601. margin-bottom: 32rpx;
  602. .section-label {
  603. font-weight: 500;
  604. font-size: 28rpx;
  605. color: #333;
  606. margin-bottom: 24rpx;
  607. }
  608. .time-range {
  609. display: flex;
  610. align-items: center;
  611. gap: 16rpx;
  612. .time-input {
  613. flex: 1;
  614. height: 72rpx;
  615. text-align: center;
  616. background: #F7F8FA;
  617. border-radius: 8rpx;
  618. padding: 0 16rpx;
  619. font-size: 26rpx;
  620. color: #333;
  621. }
  622. .time-separator {
  623. font-size: 24rpx;
  624. color: #999;
  625. }
  626. }
  627. .btn-group {
  628. display: flex;
  629. gap: 16rpx;
  630. .filter-btn {
  631. width: 214rpx;
  632. height: 72rpx;
  633. background: #F7F8FA;
  634. border-radius: 70rpx;
  635. line-height: 72rpx;
  636. text-align: center;
  637. font-size: 28rpx;
  638. transition: all 0.2s;
  639. color: #333;
  640. &.active {
  641. background: rgba(56, 139, 255, 0.15);
  642. color: #388BFF;
  643. }
  644. }
  645. }
  646. }
  647. }
  648. .filter-actions {
  649. display: flex;
  650. gap: 24rpx;
  651. margin-top: 40rpx;
  652. .reset-btn,
  653. .confirm-btn {
  654. flex: 1;
  655. height: 80rpx;
  656. line-height: 80rpx;
  657. text-align: center;
  658. border-radius: 200rpx;
  659. font-size: 28rpx;
  660. transition: all 0.2s;
  661. }
  662. .reset-btn {
  663. background: #fff;
  664. color: #388BFF;
  665. border: 2rpx solid #388BFF;
  666. &:active {
  667. background: #EBF3FF;
  668. }
  669. }
  670. .confirm-btn {
  671. background: #388BFF;
  672. color: #fff;
  673. &:active {
  674. background: #2A78E5;
  675. }
  676. }
  677. }
  678. }
  679. }
  680. }
  681. </style>