|
@@ -21,12 +21,12 @@
|
|
|
<!-- 日期范围和筛选 -->
|
|
<!-- 日期范围和筛选 -->
|
|
|
<view class="date-filter-bar mb16">
|
|
<view class="date-filter-bar mb16">
|
|
|
<view class="date-range" @click="showDatePicker = true">
|
|
<view class="date-range" @click="showDatePicker = true">
|
|
|
- <image class="w32 h32" src="@/static/image/icon_time.png" mode=""></image>
|
|
|
|
|
|
|
+ <image class="w32 h32" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_time.png" mode=""></image>
|
|
|
<text class="date-text">{{ dateRangeText }}</text>
|
|
<text class="date-text">{{ dateRangeText }}</text>
|
|
|
<text class="arrow-down">▼</text>
|
|
<text class="arrow-down">▼</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="filter-btn" @click="showFilter = true">
|
|
<view class="filter-btn" @click="showFilter = true">
|
|
|
- <image class="w32 h32" src="@/static/image/icon_select.png" mode=""></image>
|
|
|
|
|
|
|
+ <image class="w32 h32" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_select.png" mode=""></image>
|
|
|
<text>筛选</text>
|
|
<text>筛选</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -66,10 +66,6 @@
|
|
|
:loading="loading.service"
|
|
:loading="loading.service"
|
|
|
@load-more="loadMore('service')"
|
|
@load-more="loadMore('service')"
|
|
|
>
|
|
>
|
|
|
- <!-- 状态列自定义插槽 -->
|
|
|
|
|
- <template #statusText="{ item }">
|
|
|
|
|
- <text class="status-tag" :class="item.status">{{ item.statusText }}</text>
|
|
|
|
|
- </template>
|
|
|
|
|
</statistics-table>
|
|
</statistics-table>
|
|
|
|
|
|
|
|
<statistics-table
|
|
<statistics-table
|
|
@@ -80,10 +76,6 @@
|
|
|
:loading="loading.service"
|
|
:loading="loading.service"
|
|
|
@load-more="loadMore('service')"
|
|
@load-more="loadMore('service')"
|
|
|
>
|
|
>
|
|
|
- <!-- 状态列自定义插槽 -->
|
|
|
|
|
- <template #statusText="{ item }">
|
|
|
|
|
- <text class="status-tag" :class="item.status">{{ item.statusText }}</text>
|
|
|
|
|
- </template>
|
|
|
|
|
</statistics-table>
|
|
</statistics-table>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -117,7 +109,7 @@
|
|
|
<view class="filter-content" @click.stop>
|
|
<view class="filter-content" @click.stop>
|
|
|
<view class="filter-header">
|
|
<view class="filter-header">
|
|
|
<view class="filter-title">筛选</view>
|
|
<view class="filter-title">筛选</view>
|
|
|
- <image class="filter-close-btn" src="/static/image/icon_cross.png" @click="closeFilter"></image>
|
|
|
|
|
|
|
+ <image class="filter-close-btn" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_cross.png" @click="closeFilter"></image>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 根据统计类型显示不同的筛选条件 -->
|
|
<!-- 根据统计类型显示不同的筛选条件 -->
|
|
@@ -126,9 +118,9 @@
|
|
|
<view class="filter-group">
|
|
<view class="filter-group">
|
|
|
<view class="group-label">任务类型</view>
|
|
<view class="group-label">任务类型</view>
|
|
|
<view class="filter-tags">
|
|
<view class="filter-tags">
|
|
|
- <view class="filter-tag" :class="{ active: tempSelectedTaskType === item.value }"
|
|
|
|
|
- v-for="(item, index) in taskTypeOptions" :key="index" @click="selectTaskType(item.value)">
|
|
|
|
|
- {{ item.label }}
|
|
|
|
|
|
|
+ <view class="filter-tag" :class="{ active: tempSelectedTaskType.includes(item.dictValue) }"
|
|
|
|
|
+ v-for="(item, index) in taskTypeDict" :key="index" @click="toggleTaskType(item.dictValue)">
|
|
|
|
|
+ {{ item.dictLabel }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -137,10 +129,9 @@
|
|
|
<view class="filter-group">
|
|
<view class="filter-group">
|
|
|
<view class="group-label">任务状态</view>
|
|
<view class="group-label">任务状态</view>
|
|
|
<view class="filter-tags">
|
|
<view class="filter-tags">
|
|
|
- <view class="filter-tag" :class="{ active: tempSelectedTaskStatus === item.value }"
|
|
|
|
|
- v-for="(item, index) in taskStatusOptions" :key="index"
|
|
|
|
|
- @click="selectTaskStatus(item.value)">
|
|
|
|
|
- {{ item.label }}
|
|
|
|
|
|
|
+ <view class="filter-tag" :class="{ active: tempSelectedTaskStatus.includes(item.dictValue) }"
|
|
|
|
|
+ v-for="(item, index) in taskStatusDict" :key="index" @click="toggleTaskStatus(item.dictValue)">
|
|
|
|
|
+ {{ item.dictLabel }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -182,6 +173,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import utils from '@/utils/common.js'
|
|
|
import StatisticsTable from '@/components/StatisticsTable.vue'
|
|
import StatisticsTable from '@/components/StatisticsTable.vue'
|
|
|
import { getTaskCompleteStats, getTaskCreateStats } from '@/api/task.js'
|
|
import { getTaskCompleteStats, getTaskCreateStats } from '@/api/task.js'
|
|
|
export default {
|
|
export default {
|
|
@@ -190,6 +182,7 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ userInfo: uni.getStorageSync("userInfo")||'',
|
|
|
statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
|
|
statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
|
|
|
showDatePicker: false,
|
|
showDatePicker: false,
|
|
|
showFilter: false,
|
|
showFilter: false,
|
|
@@ -206,10 +199,10 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 任务统计筛选
|
|
// 任务统计筛选
|
|
|
- selectedTaskType: 'academicLecture',
|
|
|
|
|
- selectedTaskStatus: '',
|
|
|
|
|
- tempSelectedTaskType: 'academicLecture',
|
|
|
|
|
- tempSelectedTaskStatus: '',
|
|
|
|
|
|
|
+ selectedTaskType: [],
|
|
|
|
|
+ selectedTaskStatus: [],
|
|
|
|
|
+ tempSelectedTaskType: [],
|
|
|
|
|
+ tempSelectedTaskStatus: [],
|
|
|
|
|
|
|
|
// 服务单统计筛选
|
|
// 服务单统计筛选
|
|
|
selectedServiceType: 'all',
|
|
selectedServiceType: 'all',
|
|
@@ -217,76 +210,6 @@
|
|
|
tempSelectedServiceType: 'all',
|
|
tempSelectedServiceType: 'all',
|
|
|
tempSelectedServiceStatus: '',
|
|
tempSelectedServiceStatus: '',
|
|
|
|
|
|
|
|
- // 任务类型选项
|
|
|
|
|
- taskTypeOptions: [{
|
|
|
|
|
- label: '医生坐诊',
|
|
|
|
|
- value: 'doctorConsultation'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '科普讲座',
|
|
|
|
|
- value: 'popularScienceLecture'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '学术讲座',
|
|
|
|
|
- value: 'academicLecture'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '科普文章',
|
|
|
|
|
- value: 'popularScienceArticle'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '科普短视频',
|
|
|
|
|
- value: 'popularScienceShortVideo'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '科普长视频',
|
|
|
|
|
- value: 'popularScienceLongVideo'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '空中课堂',
|
|
|
|
|
- value: 'airClassroom'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '用药调研',
|
|
|
|
|
- value: 'medicationSurvey'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '问卷调研',
|
|
|
|
|
- value: 'questionnaireSurvey'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '社群咨询',
|
|
|
|
|
- value: 'communityConsultation'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '健康问答',
|
|
|
|
|
- value: 'healthQA'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
-
|
|
|
|
|
- // 任务状态选项
|
|
|
|
|
- taskStatusOptions: [{
|
|
|
|
|
- label: '未完成',
|
|
|
|
|
- value: 'uncompleted'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '待审核',
|
|
|
|
|
- value: 'pendingReview'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '已驳回',
|
|
|
|
|
- value: 'rejected'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '已完成',
|
|
|
|
|
- value: 'completed'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '已完结',
|
|
|
|
|
- value: 'finished'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
-
|
|
|
|
|
// 服务单类型选项
|
|
// 服务单类型选项
|
|
|
serviceTypeOptions: [{
|
|
serviceTypeOptions: [{
|
|
|
label: '全部类型',
|
|
label: '全部类型',
|
|
@@ -455,6 +378,8 @@
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
|
|
+ taskTypeDict: [],//任务类型
|
|
|
|
|
+ taskStatusDict: [],//任务状态
|
|
|
|
|
|
|
|
// 加载状态
|
|
// 加载状态
|
|
|
loading: {
|
|
loading: {
|
|
@@ -473,8 +398,8 @@
|
|
|
if (newVal) {
|
|
if (newVal) {
|
|
|
// 打开弹窗时,同步临时选择值
|
|
// 打开弹窗时,同步临时选择值
|
|
|
if (this.currentStatType === 'task') {
|
|
if (this.currentStatType === 'task') {
|
|
|
- this.tempSelectedTaskType = this.selectedTaskType
|
|
|
|
|
- this.tempSelectedTaskStatus = this.selectedTaskStatus
|
|
|
|
|
|
|
+ this.tempSelectedTaskType = [...this.selectedTaskType]
|
|
|
|
|
+ this.tempSelectedTaskStatus = [...this.selectedTaskStatus]
|
|
|
} else {
|
|
} else {
|
|
|
this.tempSelectedServiceType = this.selectedServiceType
|
|
this.tempSelectedServiceType = this.selectedServiceType
|
|
|
this.tempSelectedServiceStatus = this.selectedServiceStatus
|
|
this.tempSelectedServiceStatus = this.selectedServiceStatus
|
|
@@ -488,8 +413,15 @@
|
|
|
this.loadData()
|
|
this.loadData()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- onLoad() {
|
|
|
|
|
- this.loadData()
|
|
|
|
|
|
|
+ onLoad: async function(options) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.taskTypeDict = await utils.getDicts("task_type");//任务类型
|
|
|
|
|
+ this.taskStatusDict = await utils.getDicts("task_status");//任务状态
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log('获取字典数据失败:', e)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
|
this.loadMore(this.currentStatType)
|
|
this.loadMore(this.currentStatType)
|
|
@@ -549,19 +481,25 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 任务筛选相关方法
|
|
// 任务筛选相关方法
|
|
|
- selectTaskType(value) {
|
|
|
|
|
- if (this.tempSelectedTaskType === value) {
|
|
|
|
|
- this.tempSelectedTaskType = ''
|
|
|
|
|
|
|
+ toggleTaskType(value) {
|
|
|
|
|
+ const index = this.tempSelectedTaskType.indexOf(value);
|
|
|
|
|
+ if (index > -1) {
|
|
|
|
|
+ // 已选中,取消选择
|
|
|
|
|
+ this.tempSelectedTaskType.splice(index, 1);
|
|
|
} else {
|
|
} else {
|
|
|
- this.tempSelectedTaskType = value
|
|
|
|
|
|
|
+ // 未选中,添加选择
|
|
|
|
|
+ this.tempSelectedTaskType.push(value);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- selectTaskStatus(value) {
|
|
|
|
|
- if (this.tempSelectedTaskStatus === value) {
|
|
|
|
|
- this.tempSelectedTaskStatus = ''
|
|
|
|
|
|
|
+ toggleTaskStatus(value) {
|
|
|
|
|
+ const index = this.tempSelectedTaskStatus.indexOf(value);
|
|
|
|
|
+ if (index > -1) {
|
|
|
|
|
+ // 已选中,取消选择
|
|
|
|
|
+ this.tempSelectedTaskStatus.splice(index, 1);
|
|
|
} else {
|
|
} else {
|
|
|
- this.tempSelectedTaskStatus = value
|
|
|
|
|
|
|
+ // 未选中,添加选择
|
|
|
|
|
+ this.tempSelectedTaskStatus.push(value);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -584,8 +522,8 @@
|
|
|
|
|
|
|
|
resetFilters() {
|
|
resetFilters() {
|
|
|
if (this.currentStatType === 'task') {
|
|
if (this.currentStatType === 'task') {
|
|
|
- this.tempSelectedTaskType = ''
|
|
|
|
|
- this.tempSelectedTaskStatus = ''
|
|
|
|
|
|
|
+ this.tempSelectedTaskType = []
|
|
|
|
|
+ this.tempSelectedTaskStatus = []
|
|
|
} else {
|
|
} else {
|
|
|
this.tempSelectedServiceType = 'all'
|
|
this.tempSelectedServiceType = 'all'
|
|
|
this.tempSelectedServiceStatus = ''
|
|
this.tempSelectedServiceStatus = ''
|
|
@@ -594,8 +532,8 @@
|
|
|
|
|
|
|
|
confirmFilters() {
|
|
confirmFilters() {
|
|
|
if (this.currentStatType === 'task') {
|
|
if (this.currentStatType === 'task') {
|
|
|
- this.selectedTaskType = this.tempSelectedTaskType
|
|
|
|
|
- this.selectedTaskStatus = this.tempSelectedTaskStatus
|
|
|
|
|
|
|
+ this.selectedTaskType = [...this.tempSelectedTaskType]
|
|
|
|
|
+ this.selectedTaskStatus = [...this.tempSelectedTaskStatus]
|
|
|
} else {
|
|
} else {
|
|
|
this.selectedServiceType = this.tempSelectedServiceType
|
|
this.selectedServiceType = this.tempSelectedServiceType
|
|
|
this.selectedServiceStatus = this.tempSelectedServiceStatus
|
|
this.selectedServiceStatus = this.tempSelectedServiceStatus
|
|
@@ -614,8 +552,7 @@
|
|
|
if (this.currentStatType === 'task') {
|
|
if (this.currentStatType === 'task') {
|
|
|
// 加载任务统计数据
|
|
// 加载任务统计数据
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
|
- const userInfoStr = uni.getStorageSync('userInfo')
|
|
|
|
|
- const userInfo = userInfoStr ? JSON.parse(userInfoStr) : {}
|
|
|
|
|
|
|
+ const userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
|
|
|
// 构建请求参数
|
|
// 构建请求参数
|
|
|
const params = {
|
|
const params = {
|
|
@@ -624,6 +561,16 @@
|
|
|
pageSize: 10
|
|
pageSize: 10
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 如果有选中的任务类型,添加到请求参数中
|
|
|
|
|
+ if (this.selectedTaskType && this.selectedTaskType.length > 0) {
|
|
|
|
|
+ params.taskTypes = this.selectedTaskType.join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 如果有选中的任务状态,添加到请求参数中
|
|
|
|
|
+ if (this.selectedTaskStatus && this.selectedTaskStatus.length > 0) {
|
|
|
|
|
+ params.taskStatuses = this.selectedTaskStatus.join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 调用任务完成统计接口
|
|
// 调用任务完成统计接口
|
|
|
const completeStatsRes = await getTaskCompleteStats(params)
|
|
const completeStatsRes = await getTaskCompleteStats(params)
|
|
|
// 调用任务创建统计接口
|
|
// 调用任务创建统计接口
|