duy 1 年間 前
コミット
dcb84ad368
2 ファイル変更64 行追加33 行削除
  1. 8 0
      src/api/modules/tasks/data.js
  2. 56 33
      src/views/tasks/components/TableCard.vue

+ 8 - 0
src/api/modules/tasks/data.js

@@ -81,4 +81,12 @@ export default {
             data: form,
         }, msg)
     },
+    //获取任务列表分页
+    async getTaskPage(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/task/page',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
 }

+ 56 - 33
src/views/tasks/components/TableCard.vue

@@ -2,18 +2,18 @@
     <HcCard>
         <template #header>
             <div class="w-32">
-                <el-select v-model="searchForm.taskType" block clearable placeholder="任务类型" size="large">
+                <el-select v-model="searchForm.typeValue" block clearable placeholder="任务类型" size="large">
                     <el-option v-for="item in tasksType" :label="item.dictValue" :value="item.dictKey" />
                 </el-select>
             </div>
             <div class="w-32 ml-3">
-                <el-select v-model="searchForm.taskStatus" block clearable placeholder="任务状态" size="large">
+                <el-select v-model="searchForm.statusValue" block clearable placeholder="任务状态" size="large">
                     <el-option v-for="item in tasksStatus" :label="item.dictValue" :value="item.dictKey" />
                 </el-select>
             </div>
             <div class="w-32 ml-3">
                 <el-select
-                    v-model="searchForm.contractId" block clearable placeholder="合同段" size="large"
+                    v-model="searchForm.contractIdValue" block clearable placeholder="合同段" size="large"
                     @change="ContractIdChange"
                 >
                     <el-option v-for="item in contractList" :label="item.contractName" :value="item.id" />
@@ -64,23 +64,16 @@
             <template #taskName="{ row }">
                 <span class="text-link" @click="rowTaskName(row)">{{ row?.taskName }}</span>
             </template>
-            <template #taskStatus="{ row }">
+            <template #taskStatusName="{ row }">
                 <el-tag
-                    v-if="row?.taskStatus?.statusValue"
-                    :type="`${row.taskStatus.status === 2 ? 'success' : row.taskStatus.status === 3 ? 'warning' : 'info'}`" class="mx-1" effect="dark"
+                    v-if="row?.taskStatusName"
+                    :type="`${row.taskStatusName === '已审批' ? 'success' : row.taskStatusName === '已废除' ? 'warning' : 'info'}`" class="mx-1" effect="dark"
                 >
-                    {{ row.taskStatus.statusValue }}
+                    {{ row.taskStatusName }}
                 </el-tag>
             </template>
-            <template #waitingUserList="{ row }">
-                <template v-for="item in row.waitingUserList">
-                    <el-tag
-                        v-if="item.waitingUserName"
-                        :type="`${item.status === 2 ? 'success' : item.status === 3 ? 'warning' : item.status === 999 ? 'danger' : 'info'}`" class="mx-1" effect="dark"
-                    >
-                        {{ item.waitingUserName }}
-                    </el-tag>
-                </template>
+            <template #taskReportUserName="{ row }">
+                {{ row.taskReportUserName }}
             </template>
         </HcTable>
         <template #action>
@@ -149,7 +142,7 @@ nextTick(() => {
 
 //获取相关数据
 const setQueryData = () => {
-    searchForm.value.contractId = contractId.value
+    searchForm.value.contractIdValue = contractId.value
     queryTaskType()
     queryTaskStatus()
     searchClick()
@@ -186,7 +179,7 @@ const queryTaskStatus = async () => {
 const ContractIdChange = () => {
     searchForm.value.batch = null
     queryBatchList()
-    queryUserStartFlow()
+    // queryUserStartFlow()
     getTableData()
 }
 
@@ -211,7 +204,7 @@ const queryBatchList = async () => {
 
 //搜索表单
 const searchForm = ref({
-    queryValue: null, taskType: null, taskStatus: null, batch: null, startTime: null, endTime: null,
+    queryValue: null, typeValue: null, statusValue: null, batch: null, startTimeValue: null, endTimeValue: null,
     current: 1, size: 200, total: 0,
 })
 
@@ -219,8 +212,8 @@ const searchForm = ref({
 const betweenTime = ref(null)
 const betweenTimeUpdate = ({ val, arr }) => {
     betweenTime.value = arr
-    searchForm.value.startTime = val['start']
-    searchForm.value.endTime = val['end']
+    searchForm.value.startTimeValue = val['start']
+    searchForm.value.endTimeValue = val['end']
 }
 
 //回车搜索
@@ -248,36 +241,66 @@ const pageChange = ({ current, size }) => {
 const tableLoading = ref(false)
 const tableListColumn = ref([
     { key: 'taskName', name: '任务名称' },
-    { key: 'typeValue', name: '任务类型', width: '120' },
-    { key: 'taskStatus', name: '任务状态', width: '160' },
+    { key: 'taskTypeName', name: '任务类型', width: '120' },
+    { key: 'taskStatusName', name: '任务状态', width: '160' },
     { key: 'startTime', name: '开始时间', width: '180' },
     { key: 'endTime', name: '限定时间', width: '180' },
-    { key: 'taskContent', name: '任务描述' },
-    { key: 'reportUserName', name: '上报人', width: '120' },
-    { key: 'waitingUserList', name: '签字人员' },
-    { key: 'evisaContent', name: '电签状态' },
+    { key: 'taskDesc', name: '任务描述' },
+    { key: 'taskReportUserName', name: '上报人', width: '120' },
+    { key: 'taskApproveUserNames', name: '签字人员' },
+    { key: 'evisaStatus', name: '电签状态' },
 ])
 const tableListData = ref([])
 const getTableData = () => {
     const key = isTableKey.value
     tableListRef.value?.clearSelection()
     tableCheckedKeys.value = []
+    // if (key === 'key1') {
+    //     queryUserToDoTaskList()
+    // } else if (key === 'key2') {
+    //     queryUserDoneTaskList()
+    // } else if (key === 'key3') {
+    //     queryUserStartFlow()
+    // }
     if (key === 'key1') {
-        queryUserToDoTaskList()
+        searchForm.value.selectedType = 1
     } else if (key === 'key2') {
-        queryUserDoneTaskList()
+        searchForm.value.selectedType = 2
     } else if (key === 'key3') {
-        queryUserStartFlow()
+        searchForm.value.selectedType = 3
     }
+    queryPage()
 }
 
 //待办任务列表
-const queryUserToDoTaskList = async () => {
+// const queryUserToDoTaskList = async () => {
+//     tableLoading.value = true
+//     const { error, code, data } = await tasksApi.queryUserToDoTaskList({
+//         ...searchForm.value,
+//         projectId: projectId.value,
+//         currentContractId:currentContractId.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 queryPage = async () => {
     tableLoading.value = true
-    const { error, code, data } = await tasksApi.queryUserToDoTaskList({
+    const { error, code, data } = await tasksApi.getTaskPage({
         ...searchForm.value,
-        projectId: projectId.value,
+  
+        projectIdValue: projectId.value,
+    
         currentContractId:currentContractId.value,
+
     })
     //处理数据
     tableLoading.value = false