|
@@ -2,7 +2,7 @@
|
|
<HcCard>
|
|
<HcCard>
|
|
<template #header>
|
|
<template #header>
|
|
<div class="w-36 mr-4" v-if="isTableKey !== 'to-do'">
|
|
<div class="w-36 mr-4" v-if="isTableKey !== 'to-do'">
|
|
- <el-select v-model="searchForm.reportType" block clearable placeholder="选择审批状态" size="large">
|
|
|
|
|
|
+ <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>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
@@ -35,10 +35,11 @@
|
|
<template #taskName="{row}">
|
|
<template #taskName="{row}">
|
|
<span class="text-blue text-hover" @click="rowNameClick(row)">{{row.taskName}}</span>
|
|
<span class="text-blue text-hover" @click="rowNameClick(row)">{{row.taskName}}</span>
|
|
</template>
|
|
</template>
|
|
- <template #auditStatus="{row}">
|
|
|
|
- <span class="text-green" v-if="row.auditStatus === '1'">已审核</span>
|
|
|
|
- <span class="text-orange" v-if="row.auditStatus === '2'">待审批</span>
|
|
|
|
- <template v-if="row.auditStatus === '3'">
|
|
|
|
|
|
+ <template #status="{row}">
|
|
|
|
+ <span class="text-orange" v-if="row.status === 0">未上报</span>
|
|
|
|
+ <span class="text-orange" v-if="row.status === 1">待审批</span>
|
|
|
|
+ <span class="text-green" v-if="row.status === 2">已审批</span>
|
|
|
|
+ <template v-if="row.status === 3">
|
|
<el-popover placement="top-start" title="驳回原因" :width="200" :hide-after="0" content="这里是驳回原因说明内容">
|
|
<el-popover placement="top-start" title="驳回原因" :width="200" :hide-after="0" content="这里是驳回原因说明内容">
|
|
<template #reference>
|
|
<template #reference>
|
|
<span class="text-red">已驳回</span>
|
|
<span class="text-red">已驳回</span>
|
|
@@ -54,9 +55,10 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import {ref, nextTick, watch} from "vue";
|
|
|
|
|
|
+import {ref, nextTick, watch,onMounted} from "vue";
|
|
import {useRouter} from 'vue-router'
|
|
import {useRouter} from 'vue-router'
|
|
import {getArrValue} from "js-fast-way"
|
|
import {getArrValue} from "js-fast-way"
|
|
|
|
+import taskApi from '~api/home/task.js';
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
|
|
|
@@ -71,29 +73,32 @@ const props = defineProps({
|
|
//变量
|
|
//变量
|
|
const isTableKey = ref(props.tableKey);
|
|
const isTableKey = ref(props.tableKey);
|
|
const reportTypes = ref([
|
|
const reportTypes = ref([
|
|
- {name: '待审批', key: '2'},
|
|
|
|
- {name: '已驳回', key: '3'},
|
|
|
|
|
|
+ {name: '待审批', key: 2},
|
|
|
|
+ {name: '已驳回', key: 3},
|
|
])
|
|
])
|
|
|
|
|
|
//选择上报类型
|
|
//选择上报类型
|
|
const reportings = ref([
|
|
const reportings = ref([
|
|
- {name: '任务审批', key: '1'},
|
|
|
|
- {name: '采购审批', key: '2'},
|
|
|
|
- {name: '用车审批', key: '3'},
|
|
|
|
- {name: '报销审批', key: '4'},
|
|
|
|
- {name: '借款审批', key: '5'},
|
|
|
|
|
|
+ {name: '任务审批', key: 1},
|
|
|
|
+ {name: '采购审批', key: 2},
|
|
|
|
+ {name: '用车审批', key: 3},
|
|
|
|
+ {name: '报销审批', key: 4},
|
|
|
|
+ {name: '借款审批', key: 5},
|
|
])
|
|
])
|
|
-
|
|
|
|
|
|
+onMounted(()=>{
|
|
|
|
+ getTableData()
|
|
|
|
+})
|
|
//监听
|
|
//监听
|
|
watch(() => [
|
|
watch(() => [
|
|
props.tableKey,
|
|
props.tableKey,
|
|
], ([Key]) => {
|
|
], ([Key]) => {
|
|
isTableKey.value = Key
|
|
isTableKey.value = Key
|
|
|
|
+ getTableData()
|
|
})
|
|
})
|
|
|
|
|
|
//搜索表单
|
|
//搜索表单
|
|
const searchForm = ref({
|
|
const searchForm = ref({
|
|
- reportType: null, startTime: null, endTime: null, reporting: null,
|
|
|
|
|
|
+ selectStatus: null, startTime: null, endTime: null, reporting: null,selectType:parseInt(isTableKey.value),
|
|
current: 1, size: 20, total: 0
|
|
current: 1, size: 20, total: 0
|
|
})
|
|
})
|
|
|
|
|
|
@@ -107,9 +112,10 @@ const searchClick = () => {
|
|
//重置
|
|
//重置
|
|
const resetClick = () => {
|
|
const resetClick = () => {
|
|
searchForm.value = {
|
|
searchForm.value = {
|
|
- reportType: null, startTime: null, endTime: null,
|
|
|
|
|
|
+ selectStatus: null, startTime: null, endTime: null,selectType:parseInt(isTableKey.value),
|
|
current: 1, size: 20, total: 0
|
|
current: 1, size: 20, total: 0
|
|
}
|
|
}
|
|
|
|
+ getTableData()
|
|
}
|
|
}
|
|
|
|
|
|
//分页被点击
|
|
//分页被点击
|
|
@@ -125,10 +131,10 @@ const tableColumn = ref([
|
|
{key: 'taskName', name: '任务名称'},
|
|
{key: 'taskName', name: '任务名称'},
|
|
{key: 'reportDate', name: '上报日期', width: '160', align: 'center'},
|
|
{key: 'reportDate', name: '上报日期', width: '160', align: 'center'},
|
|
{key: 'auditDate', name: '审核日期', width: '160', align: 'center'},
|
|
{key: 'auditDate', name: '审核日期', width: '160', align: 'center'},
|
|
- {key: 'reportType', name: '上报类型', width: '120', align: 'center'},
|
|
|
|
- {key: 'auditStatus', name: '审核状态', width: '100', align: 'center'},
|
|
|
|
- {key: 'informant', name: '上报人', width: '120', align: 'center'},
|
|
|
|
- {key: 'auditor', name: '审核人', width: '120', 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'},
|
|
])
|
|
])
|
|
const tableData = ref([
|
|
const tableData = ref([
|
|
{id: 1, taskName: '【上报人】向您发起【任务审批】审批', reportDate: '2022-02-01', auditDate: '2022-02-01', reportType: '任务审批', auditStatus: '1', informant: '张三', auditor: '李四'},
|
|
{id: 1, taskName: '【上报人】向您发起【任务审批】审批', reportDate: '2022-02-01', auditDate: '2022-02-01', reportType: '任务审批', auditStatus: '1', informant: '张三', auditor: '李四'},
|
|
@@ -139,8 +145,19 @@ const tableData = ref([
|
|
{id: 6, taskName: '【上报人】向您发起【任务审批】审批', reportDate: '2022-02-01', auditDate: '2022-02-01', reportType: '出差申请', auditStatus: '1', informant: '张三', auditor: '李四'},
|
|
{id: 6, taskName: '【上报人】向您发起【任务审批】审批', reportDate: '2022-02-01', auditDate: '2022-02-01', reportType: '出差申请', auditStatus: '1', informant: '张三', auditor: '李四'},
|
|
{id: 7, taskName: '【上报人】向您发起【任务审批】审批', reportDate: '2022-02-01', auditDate: '2022-02-01', reportType: '外包支付', auditStatus: '1', informant: '张三', auditor: '李四'},
|
|
{id: 7, taskName: '【上报人】向您发起【任务审批】审批', reportDate: '2022-02-01', auditDate: '2022-02-01', reportType: '外包支付', auditStatus: '1', informant: '张三', auditor: '李四'},
|
|
])
|
|
])
|
|
-const getTableData = () => {
|
|
|
|
|
|
+const getTableData = async() => {
|
|
//const key = isTableKey.value
|
|
//const key = isTableKey.value
|
|
|
|
+ tableLoading.value = true
|
|
|
|
+ const {error, code, data} = await taskApi.getPage(searchForm.value)
|
|
|
|
+ //判断状态
|
|
|
|
+ tableLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
|
+ searchForm.value.total = data['total'] || 0
|
|
|
|
+ } else {
|
|
|
|
+ tableData.value = []
|
|
|
|
+ searchForm.value.total = 0
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//任务名称被点击
|
|
//任务名称被点击
|