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.
42 lines
1.3 KiB
42 lines
1.3 KiB
<template>
|
|
<!-- 工资条插件 -->
|
|
<view class="p-4 flex justify-between items-center">
|
|
<text>{{ prveMonth }}月份工资条</text>
|
|
<u-button size="mini" type="primary" class="m-0" @click="toLink">查看</u-button>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, computed } from 'vue';
|
|
import { useStore } from 'vuex';
|
|
import dayjs from 'dayjs';
|
|
|
|
const props = defineProps({ task: { type: Object, default: () => {} } });
|
|
|
|
const store = useStore();
|
|
const projectId = computed(() => store.getters['project/projectId']);
|
|
const userId = computed(() => store.getters['user/userId']);
|
|
const roleId = computed(() => store.state.role.roleId);
|
|
const token = computed(() => store.state.user.token);
|
|
const domain = computed(() => store.state.domain);
|
|
|
|
const prveMonth = computed(() => {
|
|
const currMonth = dayjs(+props.task.planStart).format("M");
|
|
return currMonth === 1 ? 12 : currMonth - 1;
|
|
});
|
|
|
|
function toLink() {
|
|
const url = "http://101.201.226.163/tallsalary/";
|
|
const params = {
|
|
pid: projectId.value,
|
|
uid: userId.value,
|
|
rid: roleId.value,
|
|
token: token.value,
|
|
url: domain.value
|
|
}
|
|
window.location.href = `${url}?pid=${params.pid}&uid=${params.uid}&rid=${params.rid}&token=${params.token}&url=${params.url}`;
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
</style>
|