金融产品设计及数字化营销沙盘
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.9 KiB

2 years ago
<template>
<div>
<el-scrollbar wrap-style="height: calc(100% - 85px)">
<div v-if="!isConfig" class="avatar py-3 mx-auto mb-5 text-center">
<img class="mx-auto" src="@/assets/images/6.png" alt="" />
1 year ago
<p class="text-white text-base lg:text-sm">{{ roleName }}</p>
<p class="my-2 text-white text-sm lg:text-xs">产品部门</p>
<div class="flex justify-center items-center text-white text-xs lg:text-[10px]">
虚拟时间{{ date }}
<!-- <img class="ml-2 cursor-pointer"
src="@/assets/images/date.png"
alt=""
@click="dateVisible = true"> -->
</div>
2 years ago
</div>
<menus></menus>
2 years ago
</el-scrollbar>
<el-dialog v-model="dateVisible" title="选择交易日期" width="400px" center>
<div class="text-center">
<el-date-picker v-model="diaDate" format="YYYY/MM/DD" value-format="YYYY-MM-DD" type="date" />
</div>
<template #footer>
<span class="flex justify-center">
<div class="dia-btn cancel" @click="dateVisible = false">取消</div>
<div class="dia-btn" @click="submitDate">确定</div>
</span>
</template>
</el-dialog>
2 years ago
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, computed } from 'vue';
2 years ago
import { useRouter, useRoute } from 'vue-router';
import { getOperationTime, saveOperationTime } from '@/api/config';
import Cookies from 'js-cookie';
import dayjs from 'dayjs';
import { getNow } from '@/utils/common';
import Menus from './Menu.vue';
2 years ago
const router = useRouter();
const route = useRoute();
1 year ago
const isConfig = computed(() => route.path.startsWith('/config'));
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const date = ref<string>(dayjs(new Date()).format('YYYY-MM-DD'));
const diaDate = ref<string>(dayjs(new Date()).format('YYYY-M-D'));
const dateVisible = ref<boolean>(false);
const roleIds = {
41: '产品经理',
42: '风控经理',
43: '专家委员会',
};
2 years ago
1 year ago
const roleName = computed(() => {
if (route.query.role) {
return roleIds[+route.query.role];
}
if (route.path.includes('insurance')) {
1 year ago
return '保险产品经理';
}
if (route.path.includes('fund')) {
1 year ago
return '基金产品经理';
2 years ago
}
});
// 获取操作日期
const getDate = async () => {
1 year ago
if (levelId && projectId) {
const res = await getOperationTime(levelId, projectId);
if (res.operationTime) {
date.value = res.operationTime;
diaDate.value = res.operationTime;
}
}
};
// 日期提交
const submitDate = async () => {
1 year ago
await saveOperationTime(levelId, projectId, dayjs(new Date(diaDate.value)).format('YYYY-MM-DD'));
location.reload();
getDate();
dateVisible.value = false;
};
onMounted(async () => {
// getDate();
date.value = dayjs(await getNow()).format('YYYY-MM-DD');
});
2 years ago
</script>
<style lang="scss" scoped>
.avatar {
background: url(../../../assets/images/5.png) 0 0/100% 100% no-repeat;
}
</style>