|
@@ -6,16 +6,16 @@
|
|
|
<template #search>
|
|
|
<div class="w-32">
|
|
|
<el-select v-model="searchForm.typeValue" clearable block placeholder="任务类型">
|
|
|
- <!-- el-option v-for="item in tasksType" :label="item.dictValue" :value="item.dictKey" / -->
|
|
|
+ <el-option v-for="item in tasksType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-32">
|
|
|
<el-select v-model="searchForm.statusValue" clearable block placeholder="任务状态">
|
|
|
- <!-- el-option v-for="item in tasksStatus" :label="item.dictValue" :value="item.dictKey" / -->
|
|
|
+ <el-option v-for="item in tasksStatus" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-32">
|
|
|
- <el-select v-model="searchForm.batch" clearable block placeholder="上报批次">
|
|
|
+ <el-select v-model="searchForm.batchValue" clearable block placeholder="上报批次">
|
|
|
<!-- el-option v-for="item in reportBatch" :label="item.batch" :value="item.batch" / -->
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -74,11 +74,20 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
+import mainApi from '~api/tasks/hc-data'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
import taskReview from './components/hc-data/task-review.vue'
|
|
|
|
|
|
+const useAppState = useAppStore()
|
|
|
+const projectId = ref(useAppState.getProjectId || '')
|
|
|
+const contractId = ref(useAppState.getContractId || '')
|
|
|
+
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
-
|
|
|
+ queryTaskType()
|
|
|
+ queryTaskStatus()
|
|
|
+ getTableData()
|
|
|
})
|
|
|
|
|
|
//类型处理
|
|
@@ -90,13 +99,31 @@ const tabsData = [
|
|
|
]
|
|
|
const tabsClick = ({ key }) => {
|
|
|
tabsKey.value = key
|
|
|
+ searchForm.value.selectedType = key
|
|
|
+ searchForm.value.current = 1
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//搜索条件
|
|
|
const searchForm = ref({
|
|
|
+ selectedType: 1, typeValue: '', statusValue: '', batchValue: '', queryValue: '', startTimeValue: '', endTimeValue: '',
|
|
|
current: 1, size: 200, total: 0,
|
|
|
})
|
|
|
|
|
|
+//获取任务类型
|
|
|
+const tasksType = ref([])
|
|
|
+const queryTaskType = async () => {
|
|
|
+ const { data } = await mainApi.queryTaskTypeStatus({ typeOrStatus: 'task_type' })
|
|
|
+ tasksType.value = getArrValue(data)
|
|
|
+}
|
|
|
+
|
|
|
+//获取任务状态
|
|
|
+const tasksStatus = ref([])
|
|
|
+const queryTaskStatus = async () => {
|
|
|
+ const { data } = await mainApi.queryTaskTypeStatus({ typeOrStatus: 'task_status' })
|
|
|
+ tasksStatus.value = getArrValue(data)
|
|
|
+}
|
|
|
+
|
|
|
//日期范围选择
|
|
|
const betweenTime = ref(null)
|
|
|
const betweenTimeUpdate = ({ val, arr }) => {
|
|
@@ -108,17 +135,18 @@ const betweenTimeUpdate = ({ val, arr }) => {
|
|
|
//搜索
|
|
|
const searchClick = () => {
|
|
|
searchForm.value.current = 1
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//分页被点击
|
|
|
const pageChange = ({ current, size }) => {
|
|
|
searchForm.value.current = current
|
|
|
searchForm.value.size = size
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//获取数据
|
|
|
const tableListRef = ref(null)
|
|
|
-const tableLoading = ref(false)
|
|
|
const tableListColumn = ref([
|
|
|
{ key: 'taskName', name: '任务名称' },
|
|
|
{ key: 'taskTypeName', name: '任务类型', width: '120' },
|
|
@@ -137,6 +165,31 @@ const tableListData = ref([
|
|
|
{ taskName: '材料预付款计量申请审批模板', type: 4 },
|
|
|
])
|
|
|
|
|
|
+//获取表格数据
|
|
|
+const tableLoading = ref(false)
|
|
|
+const getTableData = async () => {
|
|
|
+ tableLoading.value = true
|
|
|
+ //清空数据
|
|
|
+ tableListData.value = []
|
|
|
+ tableListRef.value?.clearSelection()
|
|
|
+ tableCheckedKeys.value = []
|
|
|
+ //发起请求
|
|
|
+ const { error, code, data } = await mainApi.getPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableListData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data.total || 0
|
|
|
+ } else {
|
|
|
+ tableListData.value = []
|
|
|
+ searchForm.value.total = 0
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//多选
|
|
|
const tableCheckedKeys = ref([])
|
|
|
const tableSelectionChange = (rows) => {
|