| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543 |
- <template>
- <view class="container">
- <!-- 搜索+筛选栏 -->
- <view class="top-box">
- <view class="input-item">
- <image class="icon search-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/search.png" mode="widthFix"></image>
- <input
- v-model="searchKeyword"
- :placeholder="searchPlaceholder"
- placeholder-class="placeholder"
- confirm-type="search"
- @confirm="onSearch"
- />
- </view>
- <view class="filter-item" @click="showFilter = true">
- <image class="filter-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_select.png" mode="widthFix"></image>
- <text>筛选</text>
- </view>
- </view>
- <!-- 顶部选项卡:任务列表/审核列表 -->
- <view class="top-tabs">
- <view class="top-tab-item" :class="{ active: currentTopTab === 'task' }" @click="switchTopTab('task')">
- 任务列表
- </view>
- <!-- <view class="top-tab-item" :class="{ active: currentTopTab === 'audit' }" @click="switchTopTab('audit')">
- 审核列表
- </view> -->
- </view>
- <!-- 动态子标签 -->
- <view class="sub-tabs">
- <view class="sub-tab-item" :class="{ active: currentSubTab === item.value }"
- @click="selectSubTab(item.value)" v-for="(item, index) in currentSubTabsList" :key="index">
- {{ item.label }}
- </view>
- </view>
- <!-- 列表内容 -->
- <scroll-view class="content" scroll-y @scrolltolower="loadMore" @refresherrefresh="refresh" refresher-enabled="true" refresher-threshold="80" refresher-default-style="black">
- <!-- 任务列表 -->
- <view v-if="currentTopTab === 'task'">
- <view class="task-card" v-for="(item, index) in currentList" :key="index" @click="goDetails(item)">
- <!-- 任务标题+状态 -->
- <view class="card-top">
- <text class="card-task-title">{{ item.taskName }}</text>
- <view class="status-tag" :class="item.statusClass">{{ item.statusText }}</view>
- </view>
- <view class="card-content">
- <!-- 讲者信息 -->
- <view class="speaker-info">
- <text class="speaker-name">{{ item.doctorName||'未命名' }}</text>
- <view class="level-tag" v-if="item.level">{{ item.level }}</view>
- </view>
- <!-- 医院+科室 -->
- <view class="org-info">
- <image class="org-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_hospital.png" mode="widthFix"></image>
- <text>{{ item.deptName ||'-' }}</text>
- <view class="line"></view>
- <text>{{ item.deptName||'-' }}</text>
- </view>
- <!-- 标签组 -->
- <view class="card-tags">
- <view class="tag-left-group">
- <view class="tag-item video-tag" v-if="item.taskTypeName">
- <image class="video-tag-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_longvideo.png" mode="widthFix">
- </image>
- <text>{{ item.taskTypeName ||'-'}}</text>
- </view>
- <view class="tag-item category-tag" v-if="item.taskTypeName">
- {{ item.taskTypeName }}
- </view>
- </view>
- <view class="tag-right-group">
- <view class="tag-item points-tag">{{ item.taskIntegral||'0' }}积分</view>
- <view class="tag-item count-tag">{{ item.taskCount ||'0' }}个</view>
- <view class="tag-item count-tag">院内</view>
- </view>
- </view>
- <!-- 时间信息 -->
- <view class="time-info">
- <view class="time-item">
- <text>申请时间:</text>
- <text>{{ item.createTime ||'-'}}</text>
- </view>
- <view class="time-item">
- <text>完成时间:</text>
- <text>{{ item.finishAuditTime || '-' }}</text>
- </view>
- <view class="time-item">
- <text>完成审核:</text>
- <text>{{ item.auditStatus || '-' }}</text>
- </view>
- </view>
- <!-- 操作按钮 -->
- <view class="operate-btn-group">
- <view class="share-btn" @click="handleShare(item)">
- <image class="share-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_share.png" mode="widthFix"></image>
- <text>分享</text>
- </view>
- <view class="btn-group">
- <view class="btn" v-if="item.showDelete" @click.stop="handleTaskDelete(item, index)">删除</view>
- <!-- <view class="btn" @click.stop="copyTask(item.id)" >复制创建</view> -->
- </view>
- </view>
- <!-- 状态印章 -->
- <image class="status-seal" :src="item.sealImg" mode="widthFix">
- </image>
- </view>
- </view>
- </view>
- <!-- 审核列表 -->
- <!-- <view v-else>
- <view class="task-card" v-for="(item, index) in currentList" :key="index" @click="goDetails(item)">
- <view class="card-top">
- <text class="card-task-title">{{ item.auditName || '未设置' }}</text>
- <view class="status-tag" :class="item.statusClass">{{ item.statusText }}</view>
- </view>
- <view class="card-content">
- <view class="speaker-info">
- <text class="speaker-name">{{ item.businessData.taskInfo.doctorVO.doctorName||'未命名' }}</text>
- <view class="level-tag" v-if="item.businessData.taskInfo.doctorVO.jobTitle">{{ item.businessData.taskInfo.doctorVO.jobTitle }}</view>
- </view>
- <view class="org-info">
- <image class="org-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_hospital.png" mode="widthFix"></image>
- <text>{{ item.businessData.taskInfo.doctorVO.institution ||'-' }}</text>
- <view class="line"></view>
- <text>{{ item.businessData.taskInfo.doctorVO.department||'-' }}</text>
- </view>
- <view class="card-tags">
- <view class="tag-left-group">
- <view class="tag-item video-tag" v-if="item.businessData.taskInfo.taskTypeName">
- <image class="video-tag-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_longvideo.png" mode="widthFix">
- </image>
- <text>{{ item.businessData.taskInfo.taskTypeName ||'-'}}</text>
- </view>
- <view class="tag-item category-tag" v-if="item.businessData.taskInfo.taskTypeName">
- {{ item.businessData.taskInfo.taskTypeName }}
- </view>
- </view>
- <view class="tag-right-group">
- <view class="tag-item points-tag">{{ item.businessData.taskInfo.taskIntegral||'0' }}积分</view>
- <view class="tag-item count-tag">{{ item.businessData.taskInfo.taskCount ||'0' }}个</view>
- <view class="tag-item count-tag">院内</view>
- </view>
- </view>
- <view class="time-info">
- <view class="time-item">
- <text>申请时间:</text>
- <text>{{ item.businessData.taskInfo.createTime ||'-'}}</text>
- </view>
- </view>
- <view class="operate-btn-group">
- <view class="share-btn" @click="handleShare(item)">
- <image class="share-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_user.png" mode="widthFix"></image>
- <text>{{ item.initiatorName || '未命名' }}</text>
- </view>
- <view class="btn-group">
- <view class="btn" @click.stop="handleTaskDelete(item, index)">删除</view>
- </view>
- </view>
- <image class="status-seal" :src="item.sealImg" mode="widthFix">
- </image>
- </view>
- </view>
- </view> -->
- </scroll-view>
- <view class="side">
- <view class="side-item" >
- <image class="icon" @click="goCreate" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/btn_add.png"></image>
- </view>
- <view class="side-item" >
- <image class="icon" @click="goData" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/btn_data.png"></image>
- </view>
- </view>
- <!-- 筛选弹窗 -->
- <view class="filter-popup" v-if="showFilter" @click="closeFilter">
- <view class="filter-content" @click.stop>
- <view class="filter-header">
- <view class="filter-title">筛选</view>
- <image class="filter-close-btn" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_close.png" @click="closeFilter"
- mode="widthFix"></image>
- </view>
- <view class="filter-form">
- <!-- 任务申请时间 -->
- <view class="filter-section">
- <view class="section-label">任务申请时间</view>
- <view class="time-range">
- <view class="time-input" @click="openDatePicker('applyStartTime')">{{ filters.applyStartTime || '开始时间' }}</view>
- <view class="time-separator">-</view>
- <view class="time-input" @click="openDatePicker('applyEndTime')">{{ filters.applyEndTime || '结束时间' }}</view>
- </view>
- </view>
- <!-- 任务完成时间 -->
- <view class="filter-section" v-if="currentTopTab === 'audit'">
- <view class="section-label">任务完成时间</view>
- <view class="time-range">
- <view class="time-input" @click="openDatePicker('finishTimeStart')">{{ filters.finishTimeStart || '开始时间' }}</view>
- <view class="time-separator">-</view>
- <view class="time-input" @click="openDatePicker('finishTimeEnd')">{{ filters.finishTimeEnd || '结束时间' }}</view>
- </view>
- </view>
- <!-- 完成审核时间 -->
- <view class="filter-section" v-if="currentTopTab === 'audit'">
- <view class="section-label">完成审核时间</view>
- <view class="time-range">
- <view class="time-input" @click="openDatePicker('auditTimeStart')">{{ filters.auditTimeStart || '开始时间' }}</view>
- <view class="time-separator">-</view>
- <view class="time-input" @click="openDatePicker('auditTimeEnd')">{{ filters.auditTimeEnd || '结束时间' }}</view>
- </view>
- </view>
- <!-- 任务归属 -->
- <view class="filter-section">
- <view class="section-label">任务归属</view>
- <view class="btn-group">
- <view class="filter-btn" :class="{ active: filters.taskBelong === '' }"
- @click="filters.taskBelong = ''">我的任务</view>
- </view>
- </view>
- <!-- 完结状态 -->
- <view class="filter-section" v-if="currentTopTab === 'audit'">
- <view class="section-label">完结状态</view>
- <view class="btn-group">
- <view class="filter-btn" :class="{ active: filters.finishStatus === 'unfinished' }"
- @click="filters.finishStatus = 'unfinished'">未完结</view>
- <view class="filter-btn" :class="{ active: filters.finishStatus === 'finished' }"
- @click="filters.finishStatus = 'finished'">已完结</view>
- </view>
- </view>
- <!-- 归属类型 -->
- <view class="filter-section">
- <view class="section-label">归属类型</view>
- <view class="btn-group">
- <view v-for="item in taskBelong" :key="item.dictValue"
- class="filter-btn" :class="{ active: filters.belongType === item.dictValue }"
- @click="filters.belongType = item.dictValue">{{ item.dictLabel }}</view>
- </view>
- </view>
- </view>
- <view class="filter-actions">
- <view class="reset-btn" @click="resetFilters">重置</view>
- <view class="confirm-btn" @click="confirmFilters">确定</view>
- </view>
- </view>
- </view>
-
- <!-- 日期选择器 -->
- <u-datetime-picker
- :show="showDatePicker"
- :value="datePickerValue"
- mode="date"
- @confirm="datePickerConfirm"
- @cancel="datePickerCancel"
- ></u-datetime-picker>
- </view>
- </template>
- <script>
- import { dicts } from '@/api/common.js';
- import utils from '@/utils/common.js'
- // auditList
- import { pendingtaskAudtList } from '@/api/task.js';
- import { list, deleted, company ,auditList,copy} from '@/api/task.js';
- import { getPendingAuditList } from '@/api/audit.js';
- export default {
- data() {
- return {
- searchKeyword: '',
- showFilter: false,
- showDatePicker: false,
- currentDateField: '',
- datePickerValue: new Date().getTime(),
- processTemplate: null,
- companySettingsLoaded: false,
- isLoading: false,
- filters: {
- applyStartTime: '',
- applyEndTime: '',
- finishTimeStart: '',
- finishTimeEnd: '',
- auditTimeStart: '',
- auditTimeEnd: '',
- taskBelong: '',
- finishStatus: '',
- belongType: ''
- },
- currentTopTab: 'task',
- currentSubTab: '',
- taskSubTabs: [
- { label: '全部任务', value: '' }
- ],
- auditSubTabs: [{
- label: '全部',
- value: ''
- }
-
- ],
- taskList: [],
- auditList: [],
- userInfo: {
- companyId: ''
- },taskStatus:{
- },
- taskBelong: [],
- taskType: [],
- taskAuditStatus: [],
- auditStatus: [],
- // 分页参数
- page: 1,
- pageSize: 20,
- hasMore: true,
- auditPage: 1,
- auditPageSize: 20,
- auditHasMore: true,
- // 加载状态
- isLoadingMore: false
- }
- },
- onLoad: async function(options) {
- // 先获取用户信息
- this.userInfo =uni.getStorageSync('userInfo') || '{}';
- // this.userInfo = JSON.parse(uni.getStorageSync('userInfo') || '{}');
-
- try {
- // 并行获取所有字典数据,提高性能
- const [taskBelongRes, taskTypeRes, processTemplateRes, taskAuditStatusRes] = await Promise.all([
- utils.getDicts("task_belong_type"),//任务归属
- utils.getDicts("task_type"),//任务类型
- utils.getDicts("FLOW_TEMPLATE"),//流程模板
- utils.getDicts("task_audit_status")//任务审核状态
- ]);
-
- this.taskBelong = taskBelongRes;
- this.taskType = taskTypeRes;
- this.processTemplate = processTemplateRes;
- this.taskAuditStatus = taskAuditStatusRes;
-
- console.log("task_audit_status", this.taskAuditStatus);
-
- // 构建审核子标签
- this.auditSubTabs = [{
- label: '全部',
- value: ''
- }];
-
- this.taskAuditStatus.forEach(item => {
- this.auditSubTabs.push({
- label: item.dictLabel,
- value: item.dictValue
- });
- });
-
- console.log('任务归属字典:', this.taskBelong);
- } catch (e) {
- console.log('获取字典数据失败:', e);
- }
-
- // 获取任务状态字典
- this.dicts();
- },
-
- computed: {
- currentSubTabsList() {
- return this.currentTopTab === 'task' ? this.taskSubTabs : this.auditSubTabs;
- },
- currentList() {
- return this.currentTopTab === 'task' ? this.taskList : this.auditList;
- },
- searchPlaceholder() {
- return this.currentTopTab === 'task' ? '请输入客户姓名/机构名称' : '请输入客户姓名/电话号码'
- }
- },
- mounted() {
- this.loadData();
- },
- methods: {
- // //查询公司下的待审核任务列表
- // pendingtaskAudtList() {
- // const params = {
- // companyId: this.userInfo.companyId || 0
- // }
- // pendingtaskAudtList(params).then(res => {
- // if (res.code === 200 && res.data) {
- // this.auditList = res.data || [];
- // } else {
- // uni.showToast({
- // title: res.msg || '查询失败',
- // icon: 'none'
- // });
- // }
- // });
- // },
- //复制任务
- copyTask(id){
- console.log("复制",id);
- copy(id).then(res => {
- if (res.code === 200) {
- uni.showToast({
- title: '复制成功',
- icon: 'success'
- });
- this.loadData();
- } else {
- uni.showToast({
- title: res.msg || '复制失败',
- icon: 'none'
- });}})},
- //审批列表
- getAuditList() {
- // 构建请求参数
- const params = {
- tempCode: ['ADUIT_CJRW', 'ADUIT_WCRWSH'],
- userId: this.userInfo.userId,
- taskStatus: this.currentSubTab || '',
- status:'',
- companyId:this.userInfo.companyId,
- templateCode: this.templateCode||'',
- pageNum: this.auditPage,
- pageSize: this.auditPageSize,
- keyWord: this.searchKeyword || '',
- // 任务申请时间
- applyStartTime: this.filters.applyStartTime || '',
- applyEndTime: this.filters.applyEndTime || '',
- // 任务完成时间
- taskFinishTimeStart: this.filters.finishTimeStart || '',
- taskFinishTimeEnd: this.filters.finishTimeEnd || '',
- // 任务完成审核时间
- finishAuditTimeStart: this.filters.auditTimeStart || '',
- finishAuditTimeEnd: this.filters.auditTimeEnd || '',
- // 完结状态
- finishStatus: this.filters.finishStatus === 'unfinished' ? 0 : this.filters.finishStatus === 'finished' ? 1 : ''
- };
-
- // 避免重复请求
- if (this.isLoading) return;
-
- this.isLoading = true;
- if (!this.isLoadingMore) {
- uni.showLoading({
- title: '加载中...'
- });
- }
-
- pendingtaskAudtList(params).then(res => {
- this.isLoading = false;
- this.isLoadingMore = false;
- uni.hideLoading();
- if (res.code === 200 ) {
- console.log("审批列表数据",res);
- // 处理审核列表数据
- const newAuditList = res.data.map(item => {
- // 从businessData.taskInfo中获取任务信息
- const taskInfo = item.businessData?.taskInfo || {};
- return {
- id: item.id,
- auditName: item.auditName,
- initiatorName: taskInfo.doctorName || item.initiatorName || '未知',
- createTime: item.createTime,
- statusText: this.getAuditStatusText(item.businessData.taskInfo.taskStatus),
- statusClass: this.getAuditStatusClass(item.status),
- doctorName: taskInfo.doctorName || item.initiatorName || '未知',
- initiatorId: item.initiatorId || '',
- sealImg: item.businessData.taskInfo.taskStatus === 1 ? 'https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/img_finished.png' : 'https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/img_unfinish.png',
- businessData: item.businessData || {},
- // 从taskInfo中获取其他需要的字段
- taskTitle: taskInfo.taskName || item.auditName,
- hospital: taskInfo.deptName || '-',
- department: taskInfo.deptName || '-',
- videoType: taskInfo.taskTypeName || '-',
- category: taskInfo.taskTypeName || '-',
- points: taskInfo.taskIntegral || 0,
- count: taskInfo.taskCount || 0,
- applyTime: item.createTime
- };
- });
- // 如果是加载更多,则追加数据
- if (this.isLoadingMore) {
- this.auditList = [...this.auditList, ...newAuditList];
- } else {
- // 否则替换数据
- this.auditList = newAuditList;
- }
- // 判断是否还有更多数据
- this.auditHasMore = res.data.length === this.auditPageSize;
- console.log("审核列表数据",this.auditList);
- } else {
- // 如果是加载更多,则保持原有数据
- if (!this.isLoadingMore) {
- uni.showToast({
- title: '获取数据失败',
- icon: 'none'
- });
- }
- this.auditHasMore = false;
- }
- }).catch(err => {
- this.isLoading = false;
- this.isLoadingMore = false;
- uni.hideLoading();
- });
- },
- dicts() {
- dicts('task_status').then(res => {
- if (res.code === 200 ) {
- console.log(res.data)
- this.taskStatus = res.data;
- this.taskSubTabs = [
- { label: '全部任务', value: '' }
- ];
- res.data.forEach(item => {
- this.taskSubTabs.push({
- label: item.dictLabel,
- value: item.dictValue
- });
- });
- console.log('更新后的taskSubTabs:', this.taskSubTabs);
- }
- });
- },
- loadData() {
- // 根据当前标签加载对应数据
- if (this.currentTopTab === 'task') {
- this.getTaskList();
- } else if (this.currentTopTab === 'audit') {
- this.getAuditList();
- }
- // 只在首次加载时获取公司项目设置
- if (!this.companySettingsLoaded) {
- this.getCompanySettings();
- this.companySettingsLoaded = true;
- }
- },
- // 下拉刷新
- refresh() {
- // 重置分页参数
- if (this.currentTopTab === 'task') {
- this.page = 1;
- this.hasMore = true;
- this.taskList = [];
- } else if (this.currentTopTab === 'audit') {
- this.auditPage = 1;
- this.auditHasMore = true;
- this.auditList = [];
- }
- // 重新加载数据
- this.loadData();
- },
- // 加载更多
- loadMore() {
- // 检查是否正在加载或没有更多数据
- if (this.isLoading || this.isLoadingMore) return;
-
- if (this.currentTopTab === 'task') {
- if (!this.hasMore) return;
- // 增加页码并加载更多
- this.page++;
- this.isLoadingMore = true;
- this.getTaskList();
- } else if (this.currentTopTab === 'audit') {
- if (!this.auditHasMore) return;
- // 增加页码并加载更多
- this.auditPage++;
- this.isLoadingMore = true;
- this.getAuditList();
- }
- },
- //任务列表
- getTaskList() {
- // 构建请求参数
- const params = {
- ...this.filters,
- type: this.currentTopTab,
- taskStatus: this.currentSubTab,
- page: this.page,
- pageSize: this.pageSize,
- companyId: this.userInfo.companyId || 0,
- keyWord: this.searchKeyword || ''
- };
-
- // 避免重复请求
- if (this.isLoading) return;
-
- this.isLoading = true;
- if (!this.isLoadingMore) {
- uni.showLoading({
- title: '加载中...'
- });
- }
-
- list(params).then(res => {
- this.isLoading = false;
- this.isLoadingMore = false;
- uni.hideLoading();
- if (res.code === 200 && res.rows) {
- // 处理任务列表数据
- const newTaskList = res.rows.map(item => ({
- id: item.id,
- doctorName: item.doctorName,
- taskName: item.taskName,
- statusText: this.getStatusText(item.taskStatus),
- statusClass: this.getStatusClass(item.taskStatus),
- level: '', // 接口返回数据中没有level字段
- deptName: item.deptName, // 使用deptName作为deptName
- taskTypeName: item.taskTypeName,
- taskIntegral: item.taskIntegral,
- taskCount: item.taskCount,
- createTime: item.createTime,
- finishAuditTime: item.finishAuditTime || '-',
- auditStatus: this.getAuditStatusText(item.finishAuditStatus),
- showDelete: true,
- sealImg: item.taskStatus === 1 ? 'https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/img_finished.png' : 'https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/img_unfinish.png',
- finishAuditInstanceId: item.finishAuditInstanceId || '-',
- createAuditInstanceId: item.createAuditInstanceId || '-',
- }));
- // 如果是加载更多,则追加数据
- if (this.isLoadingMore) {
- this.taskList = [...this.taskList, ...newTaskList];
- } else {
- // 否则替换数据
- this.taskList = newTaskList;
- }
- // 判断是否还有更多数据
- this.hasMore = res.rows.length === this.pageSize;
- } else {
- // 如果是加载更多,则保持原有数据
- if (!this.isLoadingMore) {
- uni.showToast({
- title: '获取数据失败',
- icon: 'none'
- });
- }
- this.hasMore = false;
- }
- }).catch(err => {
- this.isLoading = false;
- this.isLoadingMore = false;
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: '网络错误'
- });
- });
- },
- onSearch() {
- if (this.currentTopTab === 'task') {
- this.page = 1
- this.hasMore = true
- this.taskList = []
- this.getTaskList()
- } else {
- this.auditPage = 1
- this.auditHasMore = true
- this.auditList = []
- this.getAuditList()
- }
- },
- getCompanySettings() {
- // 获取公司项目设置
- if (this.userInfo.companyId) {
- company(this.userInfo.companyId).then(res => {
- if (res.code === 200) {
- console.log('公司项目设置:', res.data);
- // 处理公司项目设置数据
- }
- }).catch(err => {
- console.error('获取公司项目设置失败:', err);
- });
- }
- },
- getStatusText(status) {
- // 根据状态获取状态文本
- const statusMap = {
- 0: '未完成',
- 1: '已完成'
- };
- return statusMap[status] || '未知状态';
- },
- getStatusClass(status) {
- // 根据状态获取状态样式类
- const statusMap = {
- 0: 'status-wait',
- 1: 'status-finish'
- };
- return statusMap[status] || 'status-wait';
- },
- getAuditStatusText(status) {
- // 根据审核状态获取状态文本
- const statusMap = {
- 0: '待审核',
- 1: '已通过',
- 2: '已驳回',
- 3: '未完成'
- };
- return statusMap[status] || '-';
- },
- getAuditStatusClass(status) {
- // 根据审核状态获取状态样式类
- const statusMap = {
- 0: 'status-wait',
- 1: 'status-finish',
- 2: 'status-rejected',
- 3: 'status-wait',
- };
- return statusMap[status] || 'status-wait';
- },
- getBusinessTypeLabel(businessType) {
- // 根据业务类型获取标签文本
- if (!businessType || !this.processTemplate) {
- return '未设置';
- }
- const dictItem = this.processTemplate.find(item => item.dictValue === businessType);
- return dictItem ? dictItem.dictLabel : businessType;
- },
- formatTime(time) {
- // 格式化时间
- if (!time) return '-';
- const date = new Date(time);
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- return `${year}-${month}-${day}`;
- },
- goCreate(){
- console.log('创建任务');
- uni.navigateTo({
- url: '/pages_task/createTask'
- })
- },
- goData(){
- console.log("跳转到数据页");
- uni.navigateTo({
- url: '/pages_task/statistics'
- })
- },
- goDetails(item) {
- console.log("跳转到任务详情页",item);
- // 直接跳转到任务详情页,传递id作为taskId参数
- let id = ''
- if(this.currentTopTab === 'task'){
- id = item.id
- }else if(this.currentTopTab === 'audit'){
- id = item.businessData.taskInfo.id
- }
- uni.navigateTo({
- url: `/pages_task/taskDetail?taskId=${item.createAuditInstanceId||item.businessData.taskInfo.createAuditInstanceId||''}&taskId2=${item.finishAuditInstanceId||item.businessData.taskInfo.finishAuditInstanceId||''}&id=${id||''}&type=${this.currentTopTab}`
- });
- },
- selectSubTab(value) {
- this.currentSubTab = value;
- // 重置分页参数
- if (this.currentTopTab === 'task') {
- this.page = 1;
- this.hasMore = true;
- this.taskList = [];
- this.getTaskList();
- } else if (this.currentTopTab === 'audit') {
- this.auditPage = 1;
- this.auditHasMore = true;
- this.auditList = [];
- this.getAuditList();
- }
- },
- switchTopTab(type) {
- this.currentTopTab = type;
- this.currentSubTab = '';
- // 重置分页参数
- if (type === 'task') {
- this.page = 1;
- this.hasMore = true;
- this.taskList = [];
- this.getTaskList();
- } else if (type === 'audit') {
- this.auditPage = 1;
- this.auditHasMore = true;
- this.auditList = [];
- this.getAuditList();
- }
- },
- closeFilter() {
- this.showFilter = false
- },
- resetFilters() {
- this.filters = {
- applyStartTime: '',
- applyEndTime: '',
- finishTimeStart: '',
- finishTimeEnd: '',
- auditTimeStart: '',
- auditTimeEnd: '',
- taskBelong: '',
- finishStatus: '',
- belongType: ''
- }
- },
- confirmFilters() {
- this.showFilter = false
- // 根据筛选条件重新加载数据
- this.loadData();
- },
- // 打开日期选择器
- openDatePicker(field) {
- console.log('openDatePicker called with field:', field);
- this.currentDateField = field;
- const currentValue = this.filters[field];
- if (currentValue) {
- this.datePickerValue = new Date(currentValue).getTime();
- } else {
- this.datePickerValue = new Date().getTime();
- }
- this.showDatePicker = true;
- },
- // 日期选择器确认
- datePickerConfirm(e) {
- console.log('datePickerConfirm:', e);
- const date = new Date(e.value);
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- const formattedDate = `${year}-${month}-${day}`;
- this.filters[this.currentDateField] = formattedDate;
- this.showDatePicker = false;
- },
- // 日期选择器取消
- datePickerCancel() {
- this.showDatePicker = false;
- },
- handleShare(item) {
- uni.showToast({
- title: '分享功能待实现',
- icon: 'none'
- })
- },
- handleTaskDelete(item, index) {
- uni.showModal({
- title: '提示',
- content: '确定要删除这条任务吗?',
- cancelText: '取消',
- confirmText: '删除',
- confirmColor: '#FF0000',
- success: (res) => {
- if (res.confirm) {
- uni.showLoading({
- title: '删除中...'
- });
-
- deleted(item.id).then(res => {
- uni.hideLoading();
- if (res.code === 200) {
- this.taskList.splice(index, 1);
- uni.showToast({
- title: '任务已删除',
- icon: 'success',
- duration: 1500
- });
- this.loadData();
- } else {
- uni.showToast({
- title: '删除失败',
- icon: 'none'
- });
- }
- }).catch(err => {
- uni.hideLoading();
- uni.showToast({
- title: '网络错误',
- icon: 'none'
- });
- });
- }
- }
- });
- },
- handleCopy(item) {
- console.log('去编辑', item);
- uni.navigateTo({
- url: `/pages_task/fillTask?id=${item.id}&doctorId=${item.initiatorId}©=true`
- })
- },
- handleAuditDelete(item, index) {
- uni.showModal({
- title: '提示',
- content: '确定要删除这条审核项吗?',
- cancelText: '取消',
- confirmText: '删除',
- confirmColor: '#FF0000',
- success: (res) => {
- if (res.confirm) {
- uni.showLoading({
- title: '删除中...'
- });
-
- deleted(item.id).then(res => {
- uni.hideLoading();
- if (res.code === 200) {
- this.auditList.splice(index, 1);
- uni.showToast({
- title: '审核项已删除',
- icon: 'success',
- duration: 1500
- });
- } else {
- uni.showToast({
- title: '删除失败',
- icon: 'none'
- });
- }
- }).catch(err => {
- uni.hideLoading();
- uni.showToast({
- title: '网络错误',
- icon: 'none'
- });
- });
- }
- }
- });
- },
- handleEdit(item) {
- uni.navigateTo({
- url: `/pages_task/createTask?id=${item.id}&edit=true`
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- min-height: 100vh;
- background: #f5f5f5;
- .top-box {
- padding: 20rpx 32rpx;
- display: flex;
- align-items: center;
- background: #fff;
- .input-item {
- display: flex;
- align-items: center;
- flex: 1;
- height: 72rpx;
- background: #F7F8FA;
- border-radius: 38rpx;
- .search-icon {
- width: 26rpx;
- height: 26rpx;
- margin: 0 10rpx 0 28rpx;
- }
- input {
- flex: 1;
- font-size: 28rpx;
- color: #333;
- }
- }
- .filter-item {
- margin-left: 24rpx;
- display: flex;
- align-items: center;
- font-size: 28rpx;
- color: #999;
- .filter-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 10rpx;
- }
- }
- }
- .top-tabs {
- display: flex;
- background: #fff;
- .top-tab-item {
- flex: 1;
- text-align: center;
- padding: 24rpx 0;
- font-size: 28rpx;
- color: #999;
- transition: all 0.2s;
- &.active {
- color: #333;
- font-weight: 500;
- position: relative;
- &::after {
- content: '';
- position: absolute;
- bottom: 0;
- left: 50%;
- transform: translateX(-50%);
- border-radius: 3rpx;
- width: 80rpx;
- height: 6rpx;
- background: #388BFF;
- }
- }
- }
- }
- .sub-tabs {
- display: flex;
- justify-content: space-between;
- background: #fff;
- padding: 16rpx 32rpx;
- gap: 24rpx;
- .sub-tab-item {
- padding: 12rpx 24rpx;
- border-radius: 30rpx;
- font-size: 28rpx;
- color: #666;
- transition: all 0.2s;
- &.active {
- background: #EBF3FF;
- color: #388BFF;
- }
- }
- }
- .content {
- padding: 24rpx;
- box-sizing: border-box;
- min-height: calc(100vh - 300rpx);
- .task-card {
- background: #fff;
- border-radius: 24rpx;
- margin-bottom: 20rpx;
- border: 2rpx solid #E9F2FF;
- position: relative;
- padding-bottom: 24rpx;
- .card-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: linear-gradient(90deg, #E8F1FF 0%, #FFFFFF 100%);
- border-radius: 24rpx 24rpx 0 0;
- padding: 26rpx 24rpx;
- margin-bottom: 16rpx;
- .card-task-title {
- font-size: 32rpx;
- font-weight: 600;
- color: #333;
- }
- .status-tag {
- padding: 8rpx 16rpx;
- border-radius: 20rpx;
- font-size: 24rpx;
- &.status-wait {
- background: #E3F2FD;
- color: #2196F3;
- }
- &.status-finish {
- background: #E6FAEF;
- color: #07C160;
- }
- &.status-rejected {
- background: #FFF4F5;
- color: #CF3546;
- }
- &.status-createPending {
- background: #FFF8E6;
- color: #FF9500;
- }
- }
- }
- .card-content {
- padding: 0 24rpx;
- .speaker-info {
- display: flex;
- align-items: center;
- margin-bottom: 16rpx;
- .speaker-name {
- font-weight: 600;
- font-size: 32rpx;
- color: #333;
- }
- .level-tag {
- margin-left: 16rpx;
- padding: 2rpx 12rpx;
- font-size: 22rpx;
- color: #C89743;
- background: #FFF6E5;
- border-radius: 8rpx;
- }
- }
- .org-info {
- display: flex;
- align-items: center;
- margin-bottom: 16rpx;
- font-size: 28rpx;
- color: #666;
- .org-icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 16rpx;
- }
- .line {
- width: 2rpx;
- height: 28rpx;
- background: #EAEBEE;
- margin: 0 24rpx;
- }
- }
- .card-tags {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: 12rpx;
- margin-bottom: 16rpx;
- .tag-left-group {
- display: flex;
- gap: 0;
- .video-tag {
- background: linear-gradient(90deg, #FFE9C7 0%, #F3D091 100%);
- border-radius: 8rpx 0 0 8rpx;
- color: #5D410F;
- display: flex;
- align-items: center;
- padding: 8rpx;
- font-size: 24rpx;
- .video-tag-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 10rpx;
- }
- }
- .category-tag {
- border-radius: 0 8rpx 8rpx 0;
- border: 2rpx solid #F3D191;
- background: #FFFAF4;
- color: #5D410F;
- padding: 8rpx;
- font-size: 24rpx;
- }
- }
- .tag-right-group {
- display: flex;
- gap: 12rpx;
- .points-tag {
- border: 1rpx solid #388BFF;
- color: #388BFF;
- background: transparent;
- border-radius: 8rpx;
- padding: 8rpx;
- font-size: 24rpx;
- }
- .count-tag {
- border: 2rpx solid #E8E8E8;
- border-radius: 8rpx;
- padding: 8rpx;
- font-size: 24rpx;
- color: #666;
- }
- }
- }
- .time-info {
- font-size: 28rpx;
- color: #666;
- display: flex;
- flex-direction: column;
- gap: 8rpx;
- margin-bottom: 24rpx;
- .time-item {
- display: flex;
- &:first-child {
- color: #333;
- }
- }
- }
- .operate-btn-group {
- display: flex;
- align-items: center;
- justify-content: space-between;
- &.flex-end {
- justify-content: flex-end;
- }
- .share-btn {
- display: flex;
- align-items: center;
- font-size: 28rpx;
- color: #666;
- .share-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 8rpx;
- }
- }
- .btn-group {
- display: flex;
- align-items: center;
- .btn {
- padding: 12rpx 32rpx;
- font-size: 28rpx;
- color: #388BFF;
- border: 2rpx solid #388BFF;
- margin-left: 16rpx;
- border-radius: 34rpx;
- transition: all 0.2s;
- &:active {
- background: #EBF3FF;
- }
- }
- }
- }
- .status-seal {
- position: absolute;
- right: 24rpx;
- bottom: 156rpx;
- width: 152rpx;
- height: 142rpx;
- opacity: 0.8;
- }
- }
- }
- .audit-card {
- background: #f9f9f9;
- border-radius: 24rpx;
- margin-bottom: 20rpx;
- border: 2rpx solid #E9F2FF;
- position: relative;
- padding-bottom: 24rpx;
- .card-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: linear-gradient(90deg, #E8F1FF 0%, #FFFFFF 100%);
- border-radius: 24rpx 24rpx 0 0;
- padding: 26rpx 24rpx;
- margin-bottom: 16rpx;
- .card-task-title {
- font-size: 32rpx;
- font-weight: 600;
- color: #333;
- }
- .status-tag {
- padding: 8rpx 16rpx;
- border-radius: 20rpx;
- font-size: 24rpx;
- &.status-wait {
- background: #E3F2FD;
- color: #2196F3;
- }
- &.status-finish {
- background: #E6FAEF;
- color: #07C160;
- }
- &.status-rejected {
- background: #FFF4F5;
- color: #CF3546;
- }
- &.status-createPending {
- background: #FFF8E6;
- color: #FF9500;
- }
- }
- }
- .card-content {
- padding: 0 24rpx;
- .time-info {
- margin-bottom: 16rpx;
- .time-item {
- margin-bottom: 8rpx;
- display: flex;
- align-items: flex-start;
- text {
- font-size: 24rpx;
- color: #999;
- &.title {
- color: #666;
- margin-right: 8rpx;
- white-space: nowrap;
- }
- &:not(.title) {
- flex: 1;
- word-break: break-word;
- overflow-wrap: break-word;
- }
- }
- }
- }
- .operate-btn-group {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 16rpx;
- .share-btn {
- display: flex;
- align-items: center;
- font-size: 24rpx;
- color: #999;
- .share-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 8rpx;
- }
- }
- .date {
- font-size: 24rpx;
- color: #999;
- }
- }
- }
- }
- }
- .side {
- position: fixed;
- top: 60%;
- right: 36rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- z-index: 9;
- .side-item {
- width: 96rpx;
- height: 96rpx;
- margin-bottom: 28rpx;
- .icon {
- width: 100%;
- height: 100%;
- }
- &:active {
- opacity: 0.6;
- }
- }
- }
- .filter-popup {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: 999;
- display: flex;
- align-items: flex-end;
- .filter-content {
- width: 100%;
- background: #fff;
- border-radius: 24rpx 24rpx 0 0;
- padding: 32rpx;
- .filter-header {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 32rpx;
- position: relative;
- .filter-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- }
- .filter-close-btn {
- position: absolute;
- right: 0;
- width: 44rpx;
- height: 44rpx;
- }
- }
- .filter-form {
- padding: 0 0 24rpx 0;
- .filter-section {
- margin-bottom: 32rpx;
- .section-label {
- font-weight: 500;
- font-size: 28rpx;
- color: #333;
- margin-bottom: 24rpx;
- }
- .time-range {
- display: flex;
- align-items: center;
- gap: 16rpx;
- .time-input {
- flex: 1;
- line-height: 72rpx;
- height: 72rpx;
- text-align: center;
- background: #F7F8FA;
- border-radius: 8rpx;
- padding: 0 16rpx;
- font-size: 26rpx;
- color: #333;
- }
- .time-separator {
- font-size: 24rpx;
- color: #999;
- }
- }
- .btn-group {
- display: flex;
- gap: 16rpx;
- .filter-btn {
- width: 214rpx;
- height: 72rpx;
- background: #F7F8FA;
- border-radius: 70rpx 70rpx 70rpx 70rpx;
- line-height: 72rpx;
- text-align: center;
- font-size: 28rpx;
- transition: all 0.2s;
- color: #333333;
- &.active {
- background: rgba(56, 139, 255, 0.15);
- color: #388BFF;
- }
- }
- }
- }
- }
- .filter-actions {
- display: flex;
- gap: 24rpx;
- margin-top: 40rpx;
- .reset-btn,
- .confirm-btn {
- flex: 1;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- border-radius: 200rpx;
- font-size: 28rpx;
- transition: all 0.2s;
- }
- .reset-btn {
- background: #fff;
- color: #388BFF;
- border: 2rpx solid #388BFF;
- &:active {
- background: #EBF3FF;
- }
- }
- .confirm-btn {
- background: #388BFF;
- color: #fff;
- &:active {
- background: #2A78E5;
- }
- }
- }
- }
- }
- }
- </style>
|