接口对接完成
This commit is contained in:
parent
d784e10bcf
commit
a2388c1b0d
|
|
@ -12,4 +12,12 @@ export function waitListApi(params) {
|
||||||
export function detailsApi(id) {
|
export function detailsApi(id) {
|
||||||
return axios.get('/api/chain-remove-applies/'+id);
|
return axios.get('/api/chain-remove-applies/'+id);
|
||||||
}
|
}
|
||||||
|
// 通过、驳回、保存
|
||||||
|
export function approvalApi(id,params) {
|
||||||
|
return axios.post('/api/chain-remove-applies/'+id+'/audit',params);
|
||||||
|
}
|
||||||
|
// 获取待审批数量
|
||||||
|
export function taskCountApi() {
|
||||||
|
return axios.get('/api/users/role', {});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ axios.interceptors.response.use(
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.response.status === 401) {
|
if (error.response.status === 401) {
|
||||||
showNotify({ type: 'danger', message: '账号已过期,请重新登录!' });
|
showNotify({ message: '账号已过期,请重新登录!', background: '#ff7d00' });
|
||||||
router.push({ path: '/login' });
|
router.push({ path: '/login' });
|
||||||
} else {
|
} else {
|
||||||
showNotify({ type: 'danger', message: error.response.data.message || '服务错误' });
|
showNotify({ message: error.response.data.message || '服务错误', background: '#ff7d00' });
|
||||||
}
|
}
|
||||||
return Promise.reject(error);;
|
return Promise.reject(error);;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import './assets/main.css'
|
import './assets/main.css'
|
||||||
|
import 'vant/lib/index.css'
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import 'amfe-flexible'
|
import 'amfe-flexible'
|
||||||
import 'vant/lib/index.css'
|
|
||||||
import '@/api/request';
|
import '@/api/request';
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,15 @@ import { ref,onMounted } from 'vue'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { showNotify } from 'vant'
|
import { showNotify } from 'vant'
|
||||||
import { detailsApi } from '@/api/apply';
|
import { detailsApi,approvalApi,taskCountApi } from '@/api/apply';
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const params = ref(null)
|
const params = ref(null)
|
||||||
const info = ref(null)
|
const info = ref(null)
|
||||||
|
const showReject = ref(false)
|
||||||
|
const rejectComment = ref('')
|
||||||
|
const taskCount = ref(0);
|
||||||
// 状态
|
// 状态
|
||||||
const statusList = ref([
|
const statusList = ref([
|
||||||
{text:'草稿',value:0},
|
{text:'草稿',value:0},
|
||||||
|
|
@ -45,14 +48,62 @@ const jumpTo = (val) => {
|
||||||
if(val===2){
|
if(val===2){
|
||||||
router.push({
|
router.push({
|
||||||
path: '/lockDetail',
|
path: '/lockDetail',
|
||||||
query: { id: params.value.id, type: params.value.type },
|
query: { id: params.value.id, type: params.value.type,isMyself: params.value.isMyself },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 同意
|
// 同意
|
||||||
const agree = () => {
|
const agree = async () => {
|
||||||
showNotify({ type: 'success', message: '同意成功' });
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
await approvalApi(params.value?.id,{
|
||||||
|
action: 'approve',
|
||||||
|
comment: '',
|
||||||
|
risk_description: info.value?.risk_description,
|
||||||
|
safety_measures: info.value?.safety_measures,
|
||||||
|
cosign_item_id: info.value?.cosign_item_id,//审核人id
|
||||||
|
});
|
||||||
|
showNotify({ message: '同意成功', background: '#00b42a' });
|
||||||
|
jumpTo(params.value?.type==='wait'?1:0);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// 驳回
|
||||||
|
const reject = async () => {
|
||||||
|
rejectComment.value = '';
|
||||||
|
showReject.value = true;
|
||||||
|
}
|
||||||
|
// 驳回确认
|
||||||
|
const rejectConfirm = (action) => new Promise(async (resolve) => {
|
||||||
|
// 取消
|
||||||
|
if(action==='cancel'){
|
||||||
|
showReject.value = false;
|
||||||
|
resolve(true);
|
||||||
|
}
|
||||||
|
// 确认
|
||||||
|
if(action==='confirm'){
|
||||||
|
if(rejectComment.value==''){
|
||||||
|
showNotify({ message: '请输入驳回理由', background: '#ff7d00' });
|
||||||
|
resolve(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await approvalApi(params.value?.id,{
|
||||||
|
action: 'reject',
|
||||||
|
comment: rejectComment.value,//驳回理由
|
||||||
|
risk_description: info.value?.risk_description,
|
||||||
|
safety_measures: info.value?.safety_measures,
|
||||||
|
cosign_item_id: info.value?.cosign_item_id,//审核人id
|
||||||
|
});
|
||||||
|
showNotify({ message: '驳回成功', background: '#00b42a' });
|
||||||
|
resolve(true);
|
||||||
|
jumpTo(params.value?.type==='wait'?1:0);
|
||||||
|
} catch (error) {
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
@ -69,12 +120,23 @@ const getDetail = async () => {
|
||||||
}else{
|
}else{
|
||||||
info.value.steps = res.data?.apply_steps;
|
info.value.steps = res.data?.apply_steps;
|
||||||
}
|
}
|
||||||
|
console.log(info.value)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 获取待审批数量
|
||||||
|
const getTaskCount = async () => {
|
||||||
|
try {
|
||||||
|
const res = await taskCountApi();
|
||||||
|
taskCount.value = res.data?.chain_remove?.count || 0;
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getTaskCount();
|
||||||
if(route.query){
|
if(route.query){
|
||||||
params.value = route.query;
|
params.value = route.query;
|
||||||
getDetail();
|
getDetail();
|
||||||
|
|
@ -90,7 +152,7 @@ onMounted(() => {
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="tab-box">
|
<div class="tab-box">
|
||||||
<p class="tab" :class="{'active':params?.type==='finish'}" @click="jumpTo(0)">已审批</p>
|
<p class="tab" :class="{'active':params?.type==='finish'}" @click="jumpTo(0)">已审批</p>
|
||||||
<p class="tab" :class="{'active':params?.type==='wait'}" @click="jumpTo(1)">待审批</p>
|
<p class="tab" :class="{'active':params?.type==='wait'}" @click="jumpTo(1)">待审批<span v-if="taskCount>0">{{taskCount}}</span></p>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="info">
|
<template v-if="info">
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
|
|
@ -156,18 +218,34 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row" v-if="info?.status==99 && info?.reject">
|
||||||
|
<p>驳回:{{info?.reject?.comment}}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<p class="btn" @click="jumpTo(params?.type==='finish'?0:1)">返回列表</p>
|
<p class="btn" @click="jumpTo(params?.type==='finish'?0:1)">返回列表</p>
|
||||||
<p class="btn" @click="jumpTo(2)">联锁详情</p>
|
<p class="btn" @click="jumpTo(2)">联锁详情</p>
|
||||||
<p class="btn" v-if="params?.type==='wait'" @click="agree">同意</p>
|
<div class="op" v-if="
|
||||||
<p class="btn" v-if="params?.type==='wait'">驳回</p>
|
params?.type==='wait' && info?.status!=99 && params?.isMyself==='pending' &&
|
||||||
|
(info?.status==1 || info?.status==2 || info?.status==3 || info?.status==4) &&
|
||||||
|
(((info?.template_id==1 || info?.template_id==4) && (info?.current_step>=1 && info?.current_step<=3)) ||
|
||||||
|
((info?.template_id==2 || info?.template_id)==3 && (info?.current_step>=1 && info?.current_step<=4)))
|
||||||
|
">
|
||||||
|
<p class="btn" @click="agree">同意</p>
|
||||||
|
<p class="btn" @click="reject">驳回</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<van-empty description="暂无数据" />
|
<van-empty description="暂无数据" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 驳回弹框 -->
|
||||||
|
<van-dialog v-model:show="showReject" title="驳回" show-cancel-button :before-close="rejectConfirm" @cancel="rejectConfirm">
|
||||||
|
<div style="padding: 10px 0;">
|
||||||
|
<van-field v-model="rejectComment" label="驳回理由" type="textarea" rows="1" autosize required clearable placeholder="请输入驳回理由" />
|
||||||
|
</div>
|
||||||
|
</van-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -234,6 +312,11 @@ onMounted(() => {
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
.btns .op {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
/* 时间线 */
|
/* 时间线 */
|
||||||
.timeline {
|
.timeline {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref,onMounted } from 'vue'
|
import { ref,onMounted } from 'vue'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { applyListApi } from '@/api/apply';
|
import { applyListApi,taskCountApi } from '@/api/apply';
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const isAll = ref('1');
|
const isAll = ref('1');
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
|
const taskCount = ref(0);
|
||||||
// 状态
|
// 状态
|
||||||
const statusList = ref([
|
const statusList = ref([
|
||||||
{text:'草稿',value:0},
|
{text:'草稿',value:0},
|
||||||
|
|
@ -74,8 +75,18 @@ const pageChange = (val) => {
|
||||||
currentPage.value = val;
|
currentPage.value = val;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
// 获取待审批数量
|
||||||
|
const getTaskCount = async () => {
|
||||||
|
try {
|
||||||
|
const res = await taskCountApi();
|
||||||
|
taskCount.value = res.data?.chain_remove?.count || 0;
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getTaskCount();
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -88,7 +99,7 @@ onMounted(() => {
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="tab-box">
|
<div class="tab-box">
|
||||||
<p class="tab active">已审批</p>
|
<p class="tab active">已审批</p>
|
||||||
<p class="tab" @click="jumpTo('wait',null)">待审批</p>
|
<p class="tab" @click="jumpTo('wait',null)">待审批<span v-if="taskCount>0">{{taskCount}}</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="radio-box">
|
<div class="radio-box">
|
||||||
<van-radio-group v-model="isAll" direction="horizontal" @change="radioChange">
|
<van-radio-group v-model="isAll" direction="horizontal" @change="radioChange">
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,15 @@ import { ref, onMounted } from 'vue'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { showNotify } from 'vant'
|
import { showNotify } from 'vant'
|
||||||
import { detailsApi } from '@/api/apply';
|
import { detailsApi,approvalApi,taskCountApi } from '@/api/apply';
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const params = ref(null)
|
const params = ref(null)
|
||||||
const info = ref(null)
|
const info = ref(null)
|
||||||
const list = ref([{}])
|
const showReject = ref(false)
|
||||||
|
const rejectComment = ref('')
|
||||||
|
const taskCount = ref(0);
|
||||||
// 路由跳转
|
// 路由跳转
|
||||||
const jumpTo = (val) => {
|
const jumpTo = (val) => {
|
||||||
// 跳转已审批列表
|
// 跳转已审批列表
|
||||||
|
|
@ -28,7 +30,7 @@ const jumpTo = (val) => {
|
||||||
if(val===3){
|
if(val===3){
|
||||||
router.push({
|
router.push({
|
||||||
path: '/detail',
|
path: '/detail',
|
||||||
query: { id: params.value.id, type: params.value.type },
|
query: { id: params.value.id, type: params.value.type,isMyself: params.value.isMyself },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -46,9 +48,57 @@ const getOrg = (data) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同意
|
// 同意
|
||||||
const agree = () => {
|
const agree = async () => {
|
||||||
showNotify({ type: 'success', message: '同意成功' });
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
await approvalApi(params.value?.id,{
|
||||||
|
action: 'approve',
|
||||||
|
comment: '',
|
||||||
|
risk_description: info.value?.risk_description,
|
||||||
|
safety_measures: info.value?.safety_measures,
|
||||||
|
cosign_item_id: info.value?.cosign_item_id,//审核人id
|
||||||
|
});
|
||||||
|
showNotify({ message: '同意成功', background: '#00b42a' });
|
||||||
|
jumpTo(params.value?.type==='wait'?1:0);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// 驳回
|
||||||
|
const reject = async () => {
|
||||||
|
rejectComment.value = '';
|
||||||
|
showReject.value = true;
|
||||||
|
}
|
||||||
|
// 驳回确认
|
||||||
|
const rejectConfirm = (action) => new Promise(async (resolve) => {
|
||||||
|
// 取消
|
||||||
|
if(action==='cancel'){
|
||||||
|
showReject.value = false;
|
||||||
|
resolve(true);
|
||||||
|
}
|
||||||
|
// 确认
|
||||||
|
if(action==='confirm'){
|
||||||
|
if(rejectComment.value==''){
|
||||||
|
showNotify({ message: '请输入驳回理由', background: '#ff7d00' });
|
||||||
|
resolve(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await approvalApi(params.value?.id,{
|
||||||
|
action: 'reject',
|
||||||
|
comment: rejectComment.value,//驳回理由
|
||||||
|
risk_description: info.value?.risk_description,
|
||||||
|
safety_measures: info.value?.safety_measures,
|
||||||
|
cosign_item_id: info.value?.cosign_item_id,//审核人id
|
||||||
|
});
|
||||||
|
showNotify({ message: '驳回成功', background: '#00b42a' });
|
||||||
|
resolve(true);
|
||||||
|
jumpTo(params.value?.type==='wait'?1:0);
|
||||||
|
} catch (error) {
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
|
|
@ -56,13 +106,22 @@ const getDetail = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await detailsApi(params.value?.id);
|
const res = await detailsApi(params.value?.id);
|
||||||
info.value = res.data;
|
info.value = res.data;
|
||||||
console.log(info.value);
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 获取待审批数量
|
||||||
|
const getTaskCount = async () => {
|
||||||
|
try {
|
||||||
|
const res = await taskCountApi();
|
||||||
|
taskCount.value = res.data?.chain_remove?.count || 0;
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getTaskCount();
|
||||||
if(route.query){
|
if(route.query){
|
||||||
params.value = route.query;
|
params.value = route.query;
|
||||||
getDetail();
|
getDetail();
|
||||||
|
|
@ -78,9 +137,9 @@ onMounted(() => {
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="tab-box">
|
<div class="tab-box">
|
||||||
<p class="tab" :class="{'active':params?.type==='finish'}" @click="jumpTo(0)">已审批</p>
|
<p class="tab" :class="{'active':params?.type==='finish'}" @click="jumpTo(0)">已审批</p>
|
||||||
<p class="tab" :class="{'active':params?.type==='wait'}" @click="jumpTo(1)">待审批</p>
|
<p class="tab" :class="{'active':params?.type==='wait'}" @click="jumpTo(1)">待审批<span v-if="taskCount>0">{{taskCount}}</span></p>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="list.length">
|
<template v-if="info && info?.items && info?.items.length">
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
<div class="item" v-for="(item, index) in info?.items" :key="index">
|
<div class="item" v-for="(item, index) in info?.items" :key="index">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
@ -117,14 +176,27 @@ onMounted(() => {
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<p class="btn" @click="jumpTo(params?.type==='finish'?0:1)">返回列表</p>
|
<p class="btn" @click="jumpTo(params?.type==='finish'?0:1)">返回列表</p>
|
||||||
<p class="btn" @click="jumpTo(3)">返回申请</p>
|
<p class="btn" @click="jumpTo(3)">返回申请</p>
|
||||||
<p class="btn" v-if="params?.type==='wait'" @click="agree">同意</p>
|
<div class="op" v-if="
|
||||||
<p class="btn" v-if="params?.type==='wait'">驳回</p>
|
params?.type==='wait' && info?.status!=99 && params?.isMyself==='pending' &&
|
||||||
|
(info?.status==1 || info?.status==2 || info?.status==3 || info?.status==4) &&
|
||||||
|
(((info?.template_id==1 || info?.template_id==4) && (info?.current_step>=1 && info?.current_step<=3)) ||
|
||||||
|
((info?.template_id==2 || info?.template_id)==3 && (info?.current_step>=1 && info?.current_step<=4)))
|
||||||
|
">
|
||||||
|
<p class="btn" @click="agree">同意</p>
|
||||||
|
<p class="btn" @click="reject">驳回</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<van-empty description="暂无数据" />
|
<van-empty description="暂无数据" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 驳回弹框 -->
|
||||||
|
<van-dialog v-model:show="showReject" title="驳回" show-cancel-button :before-close="rejectConfirm" @cancel="rejectConfirm">
|
||||||
|
<div style="padding: 10px 0;">
|
||||||
|
<van-field v-model="rejectComment" label="驳回理由" type="textarea" rows="1" autosize required clearable placeholder="请输入驳回理由" />
|
||||||
|
</div>
|
||||||
|
</van-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -212,4 +284,9 @@ onMounted(() => {
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
.btns .op {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ const statusList = ref([
|
||||||
{text:'已撤回',value:98},
|
{text:'已撤回',value:98},
|
||||||
{text:'已驳回',value:99},
|
{text:'已驳回',value:99},
|
||||||
]);
|
]);
|
||||||
|
const taskCount = ref(0);
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
|
|
||||||
// 匹配选项
|
// 匹配选项
|
||||||
|
|
@ -36,7 +37,7 @@ const jumpTo = (type,item) => {
|
||||||
if(type==='detail'){
|
if(type==='detail'){
|
||||||
router.push({
|
router.push({
|
||||||
path: '/detail',
|
path: '/detail',
|
||||||
query: {id: item.id,type: 'wait'}
|
query: {id: item.id,type: 'wait',isMyself: item.type}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -60,8 +61,18 @@ const getList = async () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 获取待审批数量
|
||||||
|
const getTaskCount = async () => {
|
||||||
|
try {
|
||||||
|
const res = await taskCountApi();
|
||||||
|
taskCount.value = res.data?.chain_remove?.count || 0;
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getTaskCount();
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -74,7 +85,7 @@ onMounted(() => {
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="tab-box">
|
<div class="tab-box">
|
||||||
<p class="tab" @click="jumpTo('finish',null)">已审批</p>
|
<p class="tab" @click="jumpTo('finish',null)">已审批</p>
|
||||||
<p class="tab active">待审批</p>
|
<p class="tab active">待审批<span v-if="taskCount>0">{{taskCount}}</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<template v-if="list.length">
|
<template v-if="list.length">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue