Browse Source

完成审核人

liuyc 2 years ago
parent
commit
37ae6a2c37
1 changed files with 36 additions and 32 deletions
  1. 36 32
      src/views/home/components/TaskTable.vue

+ 36 - 32
src/views/home/components/TaskTable.vue

@@ -3,32 +3,34 @@
         <template #header>
             <div v-if="isTableKey !== '1'" class="w-36 mr-4">
                 <el-select v-model="searchForm.selectStatus" block clearable placeholder="选择审批状态" size="large">
-                    <el-option v-for="item in reportTypes" :label="item.name" :value="item.key" />
+                    <el-option v-for="item in reportTypes" :label="item.name" :value="item.key"/>
                 </el-select>
             </div>
             <div class="w-36 mr-4">
                 <el-select v-model="searchForm.taskType" block clearable placeholder="选择上报类型" size="large">
-                    <el-option v-for="item in reportings" :label="item.dictName" :value="item.dictValue" />
+                    <el-option v-for="item in reportings" :label="item.dictName" :value="item.dictValue"/>
                 </el-select>
             </div>
             <div class="w-36">
-                <el-date-picker v-model="searchForm.startTime" class="block" type="month" value-format="YYYY-MM" placeholder="开始日期" clearable size="large" />
+                <el-date-picker v-model="searchForm.startTime" class="block" type="month" value-format="YYYY-MM"
+                                placeholder="开始日期" clearable size="large"/>
             </div>
             <div class="mx-2">
                 ~
             </div>
             <div class="w-36">
-                <el-date-picker v-model="searchForm.endTime" class="block" type="month" value-format="YYYY-MM" placeholder="结束日期" clearable size="large" />
+                <el-date-picker v-model="searchForm.endTime" class="block" type="month" value-format="YYYY-MM"
+                                placeholder="结束日期" clearable size="large"/>
             </div>
             <div class="ml-4">
                 <el-button size="large" type="primary" @click="searchClick">
-                    <HcIcon name="search-2" />
+                    <HcIcon name="search-2"/>
                     <span>搜索</span>
                 </el-button>
             </div>
             <div class="ml-2">
                 <el-button size="large" @click="resetClick">
-                    <HcIcon name="close-circle" />
+                    <HcIcon name="close-circle"/>
                     <span>重置</span>
                 </el-button>
             </div>
@@ -42,7 +44,8 @@
                 <span v-if="row.status === 1" class="text-orange">待审批</span>
                 <span v-if="row.status === 2" class="text-green">已审批</span>
                 <template v-if="row.status === 3">
-                    <el-popover placement="top-start" title="驳回原因" :width="200" :hide-after="0" :content="row?.rejectDesc">
+                    <el-popover placement="top-start" title="驳回原因" :width="200" :hide-after="0"
+                                :content="row?.rejectDesc">
                         <template #reference>
                             <span class="text-red">已驳回</span>
                         </template>
@@ -51,17 +54,17 @@
             </template>
         </HcTable>
         <template #action>
-            <HcPages :pages="searchForm" @change="pageChange" />
+            <HcPages :pages="searchForm" @change="pageChange"/>
         </template>
     </HcCard>
 </template>
 
 <script setup>
-import { nextTick, onActivated, onMounted, ref, watch } from 'vue'
-import { useRouter } from 'vue-router'
-import { getArrValue } from 'js-fast-way'
+import {nextTick, onActivated, onMounted, ref, watch} from 'vue'
+import {useRouter} from 'vue-router'
+import {getArrValue} from 'js-fast-way'
 import taskApi from '~api/home/task.js'
-import { getDictInfo } from '~api/other'
+import {getDictInfo} from '~api/other'
 
 //参数
 const props = defineProps({
@@ -76,14 +79,14 @@ const router = useRouter()
 //变量
 const isTableKey = ref(props.tableKey)
 const reportTypes = ref([
-    { name: '未上报', key: 0 },
-    { name: '待审批', key: 1 },
-    { name: '已审批', key: 2 },
-    { name: '已驳回', key: 3 },
+    {name: '未上报', key: 0},
+    {name: '待审批', key: 1},
+    {name: '已审批', key: 2},
+    {name: '已驳回', key: 3},
 ])
 
 
-onActivated(()=>{
+onActivated(() => {
     getTableData()
     getReporting()
 })
@@ -97,9 +100,9 @@ watch(() => [
 //选择上报类型
 const reportings = ref([])
 //获取上报类型
-const getReporting = async ()=>{
-    const { error, code, data, msg } = await getDictInfo(
-     'report_type',
+const getReporting = async () => {
+    const {error, code, data, msg} = await getDictInfo(
+        'report_type',
     )
     if (!error && code === 200) {
         reportings.value = getArrValue(data)
@@ -110,7 +113,7 @@ const getReporting = async ()=>{
 }
 //搜索表单
 const searchForm = ref({
-    selectStatus: null, startTime: null, endTime: null, reporting: null, selectType:parseInt(isTableKey.value),
+    selectStatus: null, startTime: null, endTime: null, reporting: null, selectType: parseInt(isTableKey.value),
     current: 1, size: 20, total: 0,
 })
 
@@ -124,14 +127,14 @@ const searchClick = () => {
 //重置
 const resetClick = () => {
     searchForm.value = {
-        selectStatus: null, startTime: null, endTime: null, selectType:parseInt(isTableKey.value),
+        selectStatus: null, startTime: null, endTime: null, selectType: parseInt(isTableKey.value),
         current: 1, size: 20, total: 0,
     }
     getTableData()
 }
 
 //分页被点击
-const pageChange = ({ current, size }) => {
+const pageChange = ({current, size}) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -140,20 +143,21 @@ const pageChange = ({ current, size }) => {
 //获取数据
 const tableLoading = ref(false)
 const tableColumn = ref([
-    { key: 'taskName', name: '任务名称' },
-    { key: 'reportDate', name: '上报日期', width: '160', align: 'center' },
-    { key: 'auditDate', name: '审核日期', width: '160', align: 'center' },
-    { key: 'reportTypeName', name: '上报类型', width: '120', align: 'center' },
-    { key: 'status', name: '审核状态', width: '100', align: 'center' },
-    { key: 'reportUserName', name: '上报人', width: '120', align: 'center' },
-    { key: 'auditUserNames', name: '审核人', width: '120', align: 'center' },
+    {key: 'taskName', name: '任务名称'},
+    {key: 'reportDate', name: '上报日期', width: '160', align: 'center'},
+    {key: 'auditDate', name: '审核日期', width: '160', align: 'center'},
+    {key: 'reportTypeName', name: '上报类型', width: '120', align: 'center'},
+    {key: 'status', name: '审核状态', width: '100', align: 'center'},
+    {key: 'reportUserName', name: '上报人', width: '120', align: 'center'},
+    {key: 'auditUserNames', name: '待审核人', width: '120', align: 'center'},
+    {key: 'auditUserCompleteNames', name: '完成审核人', width: '120', align: 'center'},
 ])
 const tableData = ref([])
 const getTableData = async () => {
     const key = Number(isTableKey.value)
     searchForm.value.selectType = key
     tableLoading.value = true
-    const { error, code, data } = await taskApi.getPage(searchForm.value)
+    const {error, code, data} = await taskApi.getPage(searchForm.value)
     //判断状态
     tableLoading.value = false
     if (!error && code === 200) {
@@ -171,7 +175,7 @@ const rowNameClick = (row) => {
         name: 'home-task-details', query: {
             id: row.id,
             type: row?.reportTypeName,
-            tabsKey:isTableKey.value,
+            tabsKey: isTableKey.value,
 
         },
     })